blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
871f432bb981d3248e639a8240daff66245f1bac | b45053e331f91d66d14f4e6b7810a37b683885ae | /libraries/ArduinoJson/include/ArduinoJson/JsonSubscriptBase.hpp | 124061566a01cf616d85c0cf914762b72fac7e09 | [
"MIT"
] | permissive | marfis/arduino-libraries | 9d4f066e2145dd08450d3eaf00bd56f5a3c50482 | bd1707235bee94d1b187c097f907d04046d0880c | refs/heads/master | 2021-06-15T05:08:08.662236 | 2017-03-16T00:34:33 | 2017-03-16T00:34:33 | 41,245,741 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,003 | hpp | // Copyright Benoit Blanchon 2014-2015
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
#pragma once
#include "JsonVariantBase.hpp"
namespace ArduinoJson {
template <typename TImpl>
class JsonSubscriptBase : public JsonVariantBase<TImpl> {
public:
FORCE_INLINE TImpl& operator=(bool value) { return assign<bool>(value); }
FORCE_INLINE TImpl& operator=(float value) { return assign<float>(value); }
FORCE_INLINE TImpl& operator=(double value) { return assign<double>(value); }
FORCE_INLINE TImpl& operator=(signed char value) {
return assign<signed char>(value);
}
FORCE_INLINE TImpl& operator=(signed long value) {
return assign<signed long>(value);
}
FORCE_INLINE TImpl& operator=(signed int value) {
return assign<signed int>(value);
}
FORCE_INLINE TImpl& operator=(signed short value) {
return assign<signed short>(value);
}
FORCE_INLINE TImpl& operator=(unsigned char value) {
return assign<unsigned char>(value);
}
FORCE_INLINE TImpl& operator=(unsigned long value) {
return assign<unsigned long>(value);
}
FORCE_INLINE TImpl& operator=(unsigned int value) {
return assign<unsigned int>(value);
}
FORCE_INLINE TImpl& operator=(unsigned short value) {
return assign<unsigned short>(value);
}
FORCE_INLINE TImpl& operator=(const char* value) {
return assign<const char*>(value);
}
FORCE_INLINE TImpl& operator=(const String& value) {
return assign<const String&>(value);
}
FORCE_INLINE TImpl& operator=(JsonArray& array) {
return assign<JsonArray&>(array);
}
FORCE_INLINE TImpl& operator=(JsonObject& object) {
return assign<JsonObject&>(object);
}
FORCE_INLINE TImpl& operator=(JsonVariant value) {
return assign<JsonVariant>(value);
}
private:
template <typename TValue>
FORCE_INLINE TImpl& assign(TValue value) {
TImpl* impl = static_cast<TImpl*>(this);
impl->template set<TValue>(value);
return *impl;
}
};
}
| [
"git@marfis.org"
] | git@marfis.org |
7375a7a6696e0885ec88dcb5a6cf7739d5bf3e12 | 46a007728b86bd09c96ce2494cee31603b1098df | /HW6/HW6/AssemblyInfo.cpp | 8602478d4e47b5ea530222258ccbec30745fb311 | [] | no_license | dosmode/Computer-Science-II-Assignment | 2ef4e8fd639bee66a0e50b12dc21392be7c4a20d | a51db712b307f12ba11bd7d4bcb9b25057ef4f90 | refs/heads/master | 2021-08-30T22:45:25.758231 | 2017-12-19T17:32:47 | 2017-12-19T17:32:47 | 105,925,442 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,203 | cpp | #include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute(L"HW6")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"")];
[assembly:AssemblyProductAttribute(L"HW6")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2017")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)]; | [
"jungsik.byun01@utrgv.edu"
] | jungsik.byun01@utrgv.edu |
00c9f96231567f328f09f3bda4c54e4af7d22c69 | 815cf15edc0fc07e2db9f9629c8d06f9adfe564d | /Progetto_PDS_1/Progetto_PDS_1/Progetto_PDS_1.cpp | a27d0634fcac40de1997d106f8b2a336a92f034e | [] | no_license | wargas92/PDS_CPP | 042908362339e2f0c3742f5fc93c3d53c159acdd | ac0e19b3c4c9c376550da1051b9f2bec06b15d42 | refs/heads/master | 2020-07-26T19:00:57.400681 | 2016-11-14T15:22:12 | 2016-11-14T15:22:12 | 73,717,577 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,794 | cpp | // Progetto_PDS_1.cpp : definisce il punto di ingresso dell'applicazione console.
//
#include "stdafx.h"
#include <thread>
#include "Progetto_PDS_1.h"
#include <oleacc.h>
MyProcessManager& p = MyProcessManager::CreateInstance();
DWORD prevthread = 0;
void CALLBACK WinEventProcFC(HWINEVENTHOOK hook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) {
DWORD c;
GetWindowThreadProcessId(hwnd, &c);
std::cout << c << std::endl;
p.UpdateFocus(c);
}
/*
void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) {
char str[256];
//if ( idObject!=0) return;
GetClassNameA(hwnd, str,256);
if (strlen(str) == 0) return;
DWORD d;
GetWindowThreadProcessId(hwnd, &d);
if(d==dwEventThread)
std::cout << "create: class name " << str << " " << d << std::endl;
}
*/
void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime)
{
IAccessible* pAcc = NULL;
VARIANT varChild;
IDispatch *d = NULL;
if (idObject != 0) return;
DWORD c;
HRESULT hr = AccessibleObjectFromEvent(hwnd, idObject, idChild, &pAcc, &varChild);
if ((hr == S_OK) && (pAcc != NULL) && IsWindowEnabled(hwnd))
{
VARIANT varResult = {};
pAcc->get_accRole(varChild, &varResult);
BSTR bstrName;
pAcc->get_accName(varChild, &bstrName);
std::wstring s (L"");
if (bstrName != NULL)
s = bstrName;
GetWindowThreadProcessId(hwnd, &c);
if (event == EVENT_OBJECT_CREATE && s.length() != 0 && c != prevthread){
HANDLE t = OpenThread(THREAD_QUERY_LIMITED_INFORMATION, false, dwEventThread);
DWORD pd;
GetWindowThreadProcessId(GetForegroundWindow(), &pd);
std::cout << "Cchild pid " << pd<< std::endl;
//printf("Create: ");
prevthread = c;
CloseHandle(t);
}
if (event == EVENT_OBJECT_DESTROY)
{
DWORD pd;
GetWindowThreadProcessId(hwnd, &pd);
std::cout << "Dchild pid " << pd << std::endl;
}
//SysFreeString(bstrName);
//pAcc->Release();
}
}
/*
void CALLBACK HandleWinEvent(HWINEVENTHOOK hook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) {
DWORD c;
HANDLE t = OpenThread(THREAD_QUERY_LIMITED_INFORMATION, false, dwEventThread);
c = GetProcessIdOfThread(t);
GetWindowThreadProcessId(hwnd, &c);
IAccessible* pAcc = NULL;
VARIANT varChild;
// IDispatch *d = NULL;
//GetWindowThreadProcessId(hwnd, &c);
// if ( dwEventThread != c) return;
if (idObject != OBJID_WINDOW || !IsWindow(hwnd) || idChild != 0) return;
HRESULT hr = AccessibleObjectFromEvent(hwnd, idObject, idChild, &pAcc, &varChild);
if ((hr == S_OK) && (pAcc != NULL))
{
VARIANT varResult = {};
pAcc->get_accRole(varChild, &varResult);
// if (varResult.lVal != ROLE_SYSTEM_WINDOW) return;
char kj[123];
GetRoleTextA(varResult.lVal,kj,122);
switch (event)
{
case EVENT_OBJECT_DESTROY: //3116
std::cout << "obj destroyed: " << c << " " << idChild << " " << kj << " " << idObject << " " << dwEventThread << " " << event << std::endl;
break;
case EVENT_OBJECT_CREATE:
std::cout << "obj created: " << c << " " << idChild << " " << kj<< " " << idObject << " " << dwEventThread << " " << event << std::endl;
break;
default:
break;
}
}
}
*/
int main()
{
p.InitClass();
std::string str;
//p.UpdateFocus();
//Sleep(5000);
//p.UpdateListProcess();
//p.UpdateFocus();
//std::cout << "fine" << std::endl;
//Sleep(5000);
//HOOKPROC* proc = proc1;
std::thread t ([&]() {
MSG msg;
HWINEVENTHOOK hWinEventHook0 = SetWinEventHook(
EVENT_OBJECT_DESTROY, EVENT_OBJECT_DESTROY,
NULL, HandleWinEvent, 0, 0,
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
HWINEVENTHOOK hWinEventHook1 = SetWinEventHook(
EVENT_OBJECT_CREATE, EVENT_OBJECT_CREATE,
NULL, HandleWinEvent, 0, 0,
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
HWINEVENTHOOK h = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, 0, WinEventProcFC, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
);
//SetWindowsHook(WH_CBT,);
// UnhookWinEvent(h);
std::string st = p.PrintAll();
std::cout << st<<std::endl<<st.length();
My_Socket s;
s.NewConnection_Server(1552);
s.Sendind_Server((void*)st.c_str(),st.length());
//UnhookWinEvent(h);
Sleep(20000);
return 0;
}
| [
"noreply@github.com"
] | wargas92.noreply@github.com |
8886707d9643bd59b40c4fc874ca9ae8bc6cda9e | 477c8309420eb102b8073ce067d8df0afc5a79b1 | /VTK/Graphics/vtkElevationFilter.cxx | 4846424c6fca45e3bbda2fdcad4c77b3f75bbf27 | [
"BSD-3-Clause",
"LicenseRef-scancode-paraview-1.2"
] | permissive | aashish24/paraview-climate-3.11.1 | e0058124e9492b7adfcb70fa2a8c96419297fbe6 | c8ea429f56c10059dfa4450238b8f5bac3208d3a | refs/heads/uvcdat-master | 2021-07-03T11:16:20.129505 | 2013-05-10T13:14:30 | 2013-05-10T13:14:30 | 4,238,077 | 1 | 0 | NOASSERTION | 2020-10-12T21:28:23 | 2012-05-06T02:32:44 | C++ | UTF-8 | C++ | false | false | 4,621 | cxx | /*=========================================================================
Program: Visualization Toolkit
Module: vtkElevationFilter.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkElevationFilter.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkSmartPointer.h"
vtkStandardNewMacro(vtkElevationFilter);
//----------------------------------------------------------------------------
vtkElevationFilter::vtkElevationFilter()
{
this->LowPoint[0] = 0.0;
this->LowPoint[1] = 0.0;
this->LowPoint[2] = 0.0;
this->HighPoint[0] = 0.0;
this->HighPoint[1] = 0.0;
this->HighPoint[2] = 1.0;
this->ScalarRange[0] = 0.0;
this->ScalarRange[1] = 1.0;
}
//----------------------------------------------------------------------------
vtkElevationFilter::~vtkElevationFilter()
{
}
//----------------------------------------------------------------------------
void vtkElevationFilter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Low Point: ("
<< this->LowPoint[0] << ", "
<< this->LowPoint[1] << ", "
<< this->LowPoint[2] << ")\n";
os << indent << "High Point: ("
<< this->HighPoint[0] << ", "
<< this->HighPoint[1] << ", "
<< this->HighPoint[2] << ")\n";
os << indent << "Scalar Range: ("
<< this->ScalarRange[0] << ", "
<< this->ScalarRange[1] << ")\n";
}
//----------------------------------------------------------------------------
int vtkElevationFilter::RequestData(vtkInformation*,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
// Get the input and output data objects.
vtkDataSet* input = vtkDataSet::GetData(inputVector[0]);
vtkDataSet* output = vtkDataSet::GetData(outputVector);
// Check the size of the input.
vtkIdType numPts = input->GetNumberOfPoints();
if(numPts < 1)
{
vtkDebugMacro("No input!");
return 1;
}
// Allocate space for the elevation scalar data.
vtkSmartPointer<vtkFloatArray> newScalars =
vtkSmartPointer<vtkFloatArray>::New();
newScalars->SetNumberOfTuples(numPts);
// Set up 1D parametric system and make sure it is valid.
double diffVector[3] =
{ this->HighPoint[0] - this->LowPoint[0],
this->HighPoint[1] - this->LowPoint[1],
this->HighPoint[2] - this->LowPoint[2] };
double length2 = vtkMath::Dot(diffVector, diffVector);
if(length2 <= 0)
{
vtkErrorMacro("Bad vector, using (0,0,1).");
diffVector[0] = 0;
diffVector[1] = 0;
diffVector[2] = 1;
length2 = 1.0;
}
// Support progress and abort.
vtkIdType tenth = (numPts >= 10? numPts/10 : 1);
double numPtsInv = 1.0/numPts;
int abort = 0;
// Compute parametric coordinate and map into scalar range.
double diffScalar = this->ScalarRange[1] - this->ScalarRange[0];
vtkDebugMacro("Generating elevation scalars!");
for(vtkIdType i=0; i < numPts && !abort; ++i)
{
// Periodically update progress and check for an abort request.
if(i % tenth == 0)
{
this->UpdateProgress((i+1)*numPtsInv);
abort = this->GetAbortExecute();
}
// Project this input point into the 1D system.
double x[3];
input->GetPoint(i, x);
double v[3] = { x[0] - this->LowPoint[0],
x[1] - this->LowPoint[1],
x[2] - this->LowPoint[2] };
double s = vtkMath::Dot(v, diffVector) / length2;
s = (s < 0.0 ? 0.0 : s > 1.0 ? 1.0 : s);
// Store the resulting scalar value.
newScalars->SetValue(i, this->ScalarRange[0] + s*diffScalar);
}
// Copy all the input geometry and data to the output.
output->CopyStructure(input);
output->GetPointData()->PassData(input->GetPointData());
output->GetCellData()->PassData(input->GetCellData());
// Add the new scalars array to the output.
newScalars->SetName("Elevation");
output->GetPointData()->AddArray(newScalars);
output->GetPointData()->SetActiveScalars("Elevation");
return 1;
}
| [
"aashish.chaudhary@kitware.com"
] | aashish.chaudhary@kitware.com |
61137d2cbd11f6e9db0e55d8612d6ca53b790c89 | 62cd70b01d568c7fc30aaf97b5dcc4ebb729be4f | /KoshelevSA/Laba3(2)/Laba3(2)/Laba3(2).cpp | dbe5a290b680444eb9c7073316cb9e9499272cda | [] | no_license | MatveevSE1/IiP_381908-3 | 5c247eb99dd168b186906ebadf67bc33dd0daa04 | 4bef8de010dbc4ea4c233d95b8a7efd624e10f30 | refs/heads/master | 2022-09-29T07:47:51.800529 | 2020-06-04T19:24:10 | 2020-06-04T19:24:10 | 269,307,374 | 0 | 0 | null | 2020-06-04T08:49:22 | 2020-06-04T08:49:22 | null | UTF-8 | C++ | false | false | 2,794 | cpp | #include <iostream>
#include"fraction.h"
#include "Komp.h"
using namespace std;
int main()
{
int a1,a2,b1, b2,g;
fraction*dr1 = new fraction();
fraction*dr2 = new fraction();
Kompl aa, bb, cc,c1;
cout << "Vvedite try complexnih cisla" << endl;
cin >> c1;
cout << "pervoe " << c1 << endl;
cin >> aa;
cout << "vtoroe " << aa << endl;
cin >> bb;
cout << "tret'e " << bb << endl;
cout << "Vvedite chislo " << endl;
cin >> g;
cout <<"proverka in u out" <<c1 << endl;
cc = aa + bb;
cout << "Otvet compl chislo pri slozh "<<cc<<endl;
cc = aa + g;
cout << "Otvet compl chislo pri slozh s int " << cc << endl;
cc = aa - bb;
cout << "Otvet compl chislo pri vicjit " << cc<<endl;
cc = aa / bb;
cout << "Otvet compl chislo pri delen " << cc<<endl;
cc = aa * bb;
cout << "Otvet compl chislo pri umnozh " << cc << endl;
cc += aa + bb;
cout << "Otvet compl chislo pri slozh sovm s prisv " << cc << endl;
cc -= aa + bb;
cout << "Otvet compl chislo pri vicjit sovm s prisv " << cc << endl;
cc *= aa + bb;
cout << "Otvet compl chislo pri umnozh sovm s prisv " << cc << endl;
cc /= aa + bb;
cout << "Otvet compl chislo pri delen sovm s prisv " << cc << endl;
cc = aa - g;
cout << "Otvet compl chislo pri vicjit s int " << cc << endl;
cc = aa / g;
cout << "Otvet compl chislo pri delen s int " << cc << endl;
cc = aa - g;
cout << "Otvet compl chislo pri umnozh s int " << cc << endl;
cc != aa;
cout << "Otvet compl chislo pri nerawenstwe " << cc << endl;
cc > aa;
cout << "Otvet compl chislo pri bol'she " << cc << endl;
cc < aa;
cout << "Otvet compl chislo pri men'she " << cc << endl;
cc == aa;
cout << "Otvet compl chislo pri ravenstve " << cc << endl;
cc == aa;
cout << "Otvet compl chislo pri bol'she ili ravno " << cc << endl;
cc == aa;
cout << "Otvet compl chislo pri men'she ili ravno " << cc << endl;
cc /= g;
cout << "Otvet compl chislo pri delen sovm s prisv int " << cc << endl;
cc *= g;
cout << "Otvet compl chislo pri umnozh sovm s prisv int " << cc << endl;
do
{
cout << "vvedite chislit 1 drobi" << endl;
cin >> a1;
if (a1 == 0)
cout << "Vvedite chislo!=0" << endl;
} while (a1 == 0);
do
{
cout << "vvedite znam 1 drobi" << endl;
cin >> b1;
if (b1 == 0)
cout << "Vvedite chislo!=0" << endl;
} while (b1 == 0);
do
{
cout << "vvedite chislit 2 drobi" << endl;
cin >> a2;
if (a2 == 0)
cout << "Vvedite chislo!=0" << endl;
} while (a2 == 0);
do
{
cout << "vvedite znam 2 drobi" << endl;
cin >> b2;
if (b2 == 0)
cout << "Vvedite chislo!=0" << endl;
} while (b2 == 0);
dr1->SetCH(a1);
dr1->SetZN(b1);
dr2->SetCH(a2);
dr2->SetZN(b2);
Kompl* zal = new Kompl(*dr1, *dr2);
dr1->Proizv(*dr1, *dr2);
dr1->Shastn(*dr1, *dr2);
dr1->Sum(*dr1, *dr2);
dr1->Razn(*dr1, *dr2);
zal->Otv();
} | [
"s-kalita@yandex.ru"
] | s-kalita@yandex.ru |
c86437db2c2d6bd9ac6be1cb7e70d66f2d738672 | 57e2faf5f1df52fd0992b16471437a402000f866 | /Codes(since 12-01)/CF GYM101669L.cpp | db779a520331df4d9492b416cc22d36b2017e69a | [] | no_license | 1592063346/Codes | 694dac4ac8c2e7c9a068d0b517e5e895962d1c48 | 711782c5e1c5d329d306f7e864c1d3d3e2af388c | refs/heads/master | 2020-04-13T17:15:14.784201 | 2019-06-29T02:46:18 | 2019-06-29T02:46:18 | 163,342,851 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,162 | cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 123456;
int n, value[N];
class tree_t {
public:
vector<int> adj[N];
int father[20][N], depth[N];
void add(int x, int y) {
adj[x].push_back(y);
adj[y].push_back(x);
}
void dfs(int x, int f) {
father[0][x] = f;
for (int i = 1; i < 17; ++i) {
father[i][x] = father[i - 1][father[i - 1][x]];
}
for (auto y : adj[x]) {
if (y != f) {
depth[y] = depth[x] + 1;
dfs(y, x);
}
}
}
void init() {
dfs(1, 0);
}
int get_lca(int x, int y) {
if (depth[x] < depth[y]) {
swap(x, y);
}
for (int i = 16; ~i; --i) {
if (depth[x] - (1 << i) >= depth[y]) {
x = father[i][x];
}
}
if (x == y) {
return x;
}
for (int i = 16; ~i; --i) {
if (father[i][x] != father[i][y]) {
x = father[i][x];
y = father[i][y];
}
}
return father[0][x];
}
} a, b;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 1, x, y; i < n; ++i) {
cin >> x >> y;
a.add(x, y);
}
for (int i = 1, x, y; i < n; ++i) {
cin >> x >> y;
b.add(x, y);
}
a.init();
b.init();
int foo = n << 1, bar = 0;
auto solve = [&] (tree_t a, tree_t b) {
memset(value, 0, sizeof value);
for (int i = 1; i <= n; ++i) {
for (auto j : b.adj[i]) {
if (i < j) {
int lca = a.get_lca(i, j);
++value[i];
++value[j];
--value[lca];
--value[lca];
}
}
}
function<void (int)> dfs = [&] (int x) {
for (auto y : a.adj[x]) {
if (y != a.father[0][x]) {
dfs(y);
if (1 + value[y] < foo) {
foo = 1 + value[y];
bar = 1;
} else if (1 + value[y] == foo) {
++bar;
}
value[x] += value[y];
}
}
};
dfs(1);
};
solve(a, b);
if (foo != 2) {
solve(b, a);
}
cout << foo << ' ' << bar << '\n';
return 0;
}
| [
"noreply@github.com"
] | 1592063346.noreply@github.com |
0bf4d119bc22e5aa39efff68bd4ef55122ec91c4 | 97478e6083db1b7ec79680cfcfd78ed6f5895c7d | /components/viz/service/display/gl_renderer_copier_pixeltest.cc | e6c8247fcd9fcafb7e032c893248e7a3eedeed2a | [
"BSD-3-Clause"
] | permissive | zeph1912/milkomeda_chromium | 94e81510e1490d504b631a29af2f1fef76110733 | 7b29a87147c40376bcdd1742f687534bcd0e4c78 | refs/heads/master | 2023-03-15T11:05:27.924423 | 2018-12-19T07:58:08 | 2018-12-19T07:58:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,007 | cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/viz/service/display/gl_renderer_copier.h"
#include <stdint.h>
#include <cstring>
#include <memory>
#include <tuple>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "cc/base/switches.h"
#include "cc/test/pixel_test.h"
#include "cc/test/pixel_test_utils.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/service/display/gl_renderer.h"
#include "components/viz/test/paths.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkPixmap.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
namespace viz {
namespace {
// The size of the source texture or framebuffer.
constexpr gfx::Size kSourceSize = gfx::Size(240, 120);
// In order to test coordinate calculations and Y-flipping, the tests will issue
// copy requests for a small region just to the right and below the center of
// the entire source texture/framebuffer.
constexpr gfx::Rect kRequestArea = gfx::Rect(kSourceSize.width() / 2,
kSourceSize.height() / 2,
kSourceSize.width() / 4,
kSourceSize.height() / 4);
base::FilePath GetTestFilePath(const base::FilePath::CharType* basename) {
base::FilePath test_dir;
base::PathService::Get(Paths::DIR_TEST_DATA, &test_dir);
return test_dir.Append(base::FilePath(basename));
}
} // namespace
class GLRendererCopierPixelTest
: public cc::PixelTest,
public testing::WithParamInterface<
std::tuple<GLenum, bool, CopyOutputResult::Format, bool>> {
public:
void SetUp() override {
SetUpGLWithoutRenderer(false /* flipped_output_surface */);
texture_deleter_ =
std::make_unique<TextureDeleter>(base::ThreadTaskRunnerHandle::Get());
gl_ = context_provider()->ContextGL();
copier_ = std::make_unique<GLRendererCopier>(
context_provider(), texture_deleter_.get(),
base::BindRepeating([](const gfx::Rect& draw_rect) {
gfx::Rect window_rect = draw_rect;
window_rect.set_y(kSourceSize.height() - window_rect.bottom());
return window_rect;
}));
source_gl_format_ = std::get<0>(GetParam());
have_source_texture_ = std::get<1>(GetParam());
result_format_ = std::get<2>(GetParam());
scale_by_half_ = std::get<3>(GetParam());
ASSERT_TRUE(cc::ReadPNGFile(
GetTestFilePath(FILE_PATH_LITERAL("16_color_rects.png")),
&source_bitmap_));
source_bitmap_.setImmutable();
}
void TearDown() override {
DeleteSourceFramebuffer();
DeleteSourceTexture();
copier_.reset();
texture_deleter_.reset();
}
GLRendererCopier* copier() { return copier_.get(); }
// Creates a packed RGBA (bytes_per_pixel=4) or RGB (bytes_per_pixel=3) bitmap
// in OpenGL byte/row order from the given SkBitmap.
std::unique_ptr<uint8_t[]> CreateGLPixelsFromSkBitmap(SkBitmap bitmap,
int bytes_per_pixel) {
// |bitmap| could be of any color type (and is usually BGRA). Convert it to
// a RGBA bitmap in the GL byte order.
SkBitmap rgba_bitmap;
rgba_bitmap.allocPixels(SkImageInfo::Make(bitmap.width(), bitmap.height(),
kRGBA_8888_SkColorType,
kPremul_SkAlphaType));
SkPixmap pixmap;
const bool success =
bitmap.peekPixels(&pixmap) && rgba_bitmap.writePixels(pixmap, 0, 0);
CHECK(success);
// Copy the RGBA bitmap into a raw byte array, reversing the row order and
// maybe stripping-out the alpha channel.
std::unique_ptr<uint8_t[]> pixels(
new uint8_t[rgba_bitmap.width() * rgba_bitmap.height() *
bytes_per_pixel]);
for (int y = 0; y < rgba_bitmap.height(); ++y) {
const uint8_t* src = static_cast<uint8_t*>(rgba_bitmap.getAddr(0, y));
const int flipped_y = rgba_bitmap.height() - y - 1;
uint8_t* dest =
pixels.get() + flipped_y * rgba_bitmap.width() * bytes_per_pixel;
for (int x = 0; x < rgba_bitmap.width(); ++x) {
*(dest++) = *(src++);
*(dest++) = *(src++);
*(dest++) = *(src++);
if (bytes_per_pixel == 4)
*(dest++) = *(src++);
else
++src;
}
}
return pixels;
}
// Returns a SkBitmap, given a packed RGBA bitmap in OpenGL byte/row order.
SkBitmap CreateSkBitmapFromGLPixels(const uint8_t* pixels,
const gfx::Size& size) {
SkBitmap bitmap;
bitmap.allocPixels(
SkImageInfo::Make(size.width(), size.height(), kRGBA_8888_SkColorType,
kPremul_SkAlphaType),
size.width() * 4);
for (int y = 0; y < size.height(); ++y) {
const int flipped_y = size.height() - y - 1;
const uint8_t* const src_row = pixels + flipped_y * size.width() * 4;
void* const dest_row = bitmap.getAddr(0, y);
std::memcpy(dest_row, src_row, size.width() * 4);
}
return bitmap;
}
GLuint CreateSourceTexture() {
CHECK_EQ(0u, source_texture_);
gl_->GenTextures(1, &source_texture_);
gl_->BindTexture(GL_TEXTURE_2D, source_texture_);
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl_->TexImage2D(GL_TEXTURE_2D, 0, source_gl_format_, kSourceSize.width(),
kSourceSize.height(), 0, source_gl_format_,
GL_UNSIGNED_BYTE,
CreateGLPixelsFromSkBitmap(
source_bitmap_, source_gl_format_ == GL_RGBA ? 4 : 3)
.get());
gl_->BindTexture(GL_TEXTURE_2D, 0);
return source_texture_;
}
void DeleteSourceTexture() {
if (source_texture_ != 0) {
gl_->DeleteTextures(1, &source_texture_);
source_texture_ = 0;
}
}
void CreateAndBindSourceFramebuffer(GLuint texture) {
ASSERT_EQ(0u, source_framebuffer_);
gl_->GenFramebuffers(1, &source_framebuffer_);
gl_->BindFramebuffer(GL_FRAMEBUFFER, source_framebuffer_);
gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, texture, 0);
}
void DeleteSourceFramebuffer() {
if (source_framebuffer_ != 0) {
gl_->DeleteFramebuffers(1, &source_framebuffer_);
source_framebuffer_ = 0;
}
}
// Reads back the texture in the given |mailbox| to a SkBitmap in Skia-native
// format.
SkBitmap ReadbackToSkBitmap(const gpu::Mailbox& mailbox,
const gpu::SyncToken& sync_token,
const gfx::Size& texture_size) {
// Bind the texture to a framebuffer from which to read the pixels.
if (sync_token.HasData())
gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
GLuint texture =
gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
GLuint framebuffer = 0;
gl_->GenFramebuffers(1, &framebuffer);
gl_->BindFramebuffer(GL_FRAMEBUFFER, framebuffer);
gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, texture, 0);
// Read the pixels and convert to SkBitmap form for test comparisons.
std::unique_ptr<uint8_t[]> pixels(new uint8_t[texture_size.GetArea() * 4]);
gl_->ReadPixels(0, 0, texture_size.width(), texture_size.height(), GL_RGBA,
GL_UNSIGNED_BYTE, pixels.get());
gl_->DeleteFramebuffers(1, &framebuffer);
gl_->DeleteTextures(1, &texture);
return CreateSkBitmapFromGLPixels(pixels.get(), texture_size);
}
protected:
GLenum source_gl_format_;
bool have_source_texture_;
CopyOutputResult::Format result_format_;
bool scale_by_half_;
SkBitmap source_bitmap_;
private:
gpu::gles2::GLES2Interface* gl_ = nullptr;
std::unique_ptr<TextureDeleter> texture_deleter_;
std::unique_ptr<GLRendererCopier> copier_;
GLuint source_texture_ = 0;
GLuint source_framebuffer_ = 0;
};
TEST_P(GLRendererCopierPixelTest, ExecutesCopyRequest) {
// Create and execute a CopyOutputRequest via the GLRendererCopier.
std::unique_ptr<CopyOutputResult> result;
{
base::RunLoop loop;
auto request = std::make_unique<CopyOutputRequest>(
result_format_,
base::BindOnce(
[](std::unique_ptr<CopyOutputResult>* result,
const base::Closure& quit_closure,
std::unique_ptr<CopyOutputResult> result_from_copier) {
*result = std::move(result_from_copier);
quit_closure.Run();
},
&result, loop.QuitClosure()));
if (scale_by_half_) {
request->set_result_selection(
gfx::ScaleToEnclosingRect(gfx::Rect(kRequestArea), 0.5f));
request->SetUniformScaleRatio(2, 1);
} else {
request->set_result_selection(gfx::Rect(kRequestArea));
}
const GLuint source_texture = CreateSourceTexture();
CreateAndBindSourceFramebuffer(source_texture);
copier()->CopyFromTextureOrFramebuffer(
std::move(request), gfx::Rect(kSourceSize), source_gl_format_,
have_source_texture_ ? source_texture : 0, kSourceSize,
gfx::ColorSpace::CreateSRGB());
loop.Run();
}
// Check that a result was produced and is of the expected rect/size.
ASSERT_TRUE(result);
ASSERT_FALSE(result->IsEmpty());
if (scale_by_half_)
ASSERT_EQ(gfx::ScaleToEnclosingRect(kRequestArea, 0.5f), result->rect());
else
ASSERT_EQ(kRequestArea, result->rect());
// Examine the image in the |result|, and compare it to the baseline PNG file.
const SkBitmap actual =
(result_format_ == CopyOutputResult::Format::RGBA_BITMAP)
? result->AsSkBitmap()
: ReadbackToSkBitmap(result->GetTextureResult()->mailbox,
result->GetTextureResult()->sync_token,
result->size());
const auto png_file_path = GetTestFilePath(
scale_by_half_ ? FILE_PATH_LITERAL("half_of_one_of_16_color_rects.png")
: FILE_PATH_LITERAL("one_of_16_color_rects.png"));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
cc::switches::kCCRebaselinePixeltests))
EXPECT_TRUE(cc::WritePNGFile(actual, png_file_path, false));
if (!cc::MatchesPNGFile(actual, png_file_path,
cc::ExactPixelComparator(false))) {
LOG(ERROR) << "Entire source: " << cc::GetPNGDataUrl(source_bitmap_);
ADD_FAILURE();
}
}
// Instantiate parameter sets for all possible combinations of scenarios
// GLRendererCopier will encounter, which will cause it to follow different
// workflows.
INSTANTIATE_TEST_CASE_P(
,
GLRendererCopierPixelTest,
testing::Combine(
// Source framebuffer GL format.
testing::Values(static_cast<GLenum>(GL_RGBA),
static_cast<GLenum>(GL_RGB)),
// Source: Have texture too?
testing::Values(false, true),
// Result format.
testing::Values(CopyOutputResult::Format::RGBA_BITMAP,
CopyOutputResult::Format::RGBA_TEXTURE),
// Result scaling: Scale by half?
testing::Values(false, true)));
} // namespace viz
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
992e2a897dfcf95974598d52e63e7768d8efb91f | 2347ac8aa88d1700e97941b943ed036d77384498 | /examples/mindsensors_pressure.cpp | 7ff68075206aacd7787240d3633e1ef1e9a0f854 | [] | no_license | Hubert424/hSensors | 7699af46afc25287a713bc2028578f4f04f700a4 | ce1938f5cb07dbaafad71651d2e3ed8f8b7712d0 | refs/heads/master | 2021-08-24T02:27:21.387517 | 2017-02-16T11:19:24 | 2017-02-16T11:19:24 | 113,467,954 | 0 | 0 | null | 2017-12-07T15:33:04 | 2017-12-07T15:33:04 | null | UTF-8 | C++ | false | false | 360 | cpp | #include <hFramework.h>
#include <stdio.h>
#include "Mindsensors_Pressure.h"
using namespace hFramework;
using namespace hSensors;
void hMain(void)
{
hLegoSensor_i2c s(hSens1);
Mindsensors_Pressure sensor(s);
for (;;)
{
float pressure;
sensor.read(pressure);
LED1.toggle();
printf("Pressure: %f \r\n",pressure);
sys.delay_ms(100);
}
}
| [
"ksia4@onet.eu"
] | ksia4@onet.eu |
f3e14007801dceaac11d057b2ae9ee4ea938a46e | 6a9cceb4560d64ac7cdf21d85a52bc4673a28c79 | /applications/ConstitutiveModelsApplication/custom_models/elasticity_models/hypo_elastic_model.cpp | 239375d148937121b88919c0b8287cea5566077b | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | nasay/Kratos | 110ef064dca6328952bdf7d59b94e736983839bf | 711a9fc122819157cdc7f99a3d79cdd8e43d3a2e | refs/heads/master | 2020-03-18T19:21:24.670727 | 2018-05-28T10:08:36 | 2018-05-28T10:08:36 | 135,149,605 | 1 | 0 | null | 2018-05-28T11:05:10 | 2018-05-28T11:05:09 | null | UTF-8 | C++ | false | false | 19,730 | cpp | //
// Project Name: KratosConstitutiveModelsApplication $
// Created by: $Author: JMCarbonell $
// Last modified by: $Co-Author: $
// Date: $Date: April 2018 $
// Revision: $Revision: 0.0 $
//
//
// System includes
// External includes
// Project includes
#include "custom_models/elasticity_models/hypo_elastic_model.hpp"
namespace Kratos
{
//******************************CONSTRUCTOR*******************************************
//************************************************************************************
HypoElasticModel::HypoElasticModel()
: ConstitutiveModel()
{
}
//******************************COPY CONSTRUCTOR**************************************
//************************************************************************************
HypoElasticModel::HypoElasticModel(const HypoElasticModel& rOther)
: ConstitutiveModel(rOther)
{
}
//********************************CLONE***********************************************
//************************************************************************************
ConstitutiveModel::Pointer HypoElasticModel::Clone() const
{
return ( HypoElasticModel::Pointer(new HypoElasticModel(*this)) );
}
//********************************ASSIGNMENT******************************************
//************************************************************************************
HypoElasticModel& HypoElasticModel::operator=(HypoElasticModel const& rOther)
{
ConstitutiveModel::operator=(rOther);
return *this;
}
//*******************************DESTRUCTOR*******************************************
//************************************************************************************
HypoElasticModel::~HypoElasticModel()
{
}
//***********************PUBLIC OPERATIONS FROM BASE CLASS****************************
//************************************************************************************
void HypoElasticModel::InitializeModel(ModelDataType& rValues)
{
KRATOS_TRY
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::FinalizeModel(ModelDataType& rValues)
{
KRATOS_TRY
//update total stress measure
this->mHistoryVector = ConstitutiveModelUtilities::SymmetricTensorToVector(rValues.StressMatrix, this->mHistoryVector);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::InitializeElasticData(ModelDataType& rValues, ElasticDataType& rVariables)
{
KRATOS_TRY
//set model data pointer
rVariables.SetModelData(rValues);
rVariables.SetState(rValues.State);
// ConstitutiveModelData::StressMeasure_Kirchhoff allowed only
// symmetric spatial velocity gradient
noalias(rVariables.StrainMatrix) = 0.5 * (rValues.StrainMatrix + trans(rValues.StrainMatrix)); // spatial velocity gradient is rValues.StrainMatrix
rValues.SetStrainMeasure(ConstitutiveModelData::CauchyGreen_None);
rValues.MaterialParameters.LameMuBar = rValues.MaterialParameters.LameMu;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateStrainEnergy(ModelDataType& rValues, double& rDensityFunction)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************// W
void HypoElasticModel::CalculateAndAddIsochoricStrainEnergy(ElasticDataType& rVariables, double& rIsochoricDensityFunction)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
void HypoElasticModel::CalculateAndAddVolumetricStrainEnergy(ElasticDataType& rVariables, double& rVolumetricDensityFunction)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::AddHistoricalStress(ModelDataType& rValues, MatrixType& rStressMatrix)
{
KRATOS_TRY
// Add historical stress
const MatrixType& rSpatialVelocityGradient = rValues.GetDeltaDeformationMatrix();
const double& rDeltaTime = rValues.GetProcessInfo()[DELTA_TIME];
// Skewsymmetric spatial velocity gradient
MatrixType W = 0.5 * rDeltaTime * (rSpatialVelocityGradient - trans(rSpatialVelocityGradient));
// Exponential map using quaternions
Quaternion<double> QuaternionValue = Quaternion<double>::FromRotationMatrix( W );
QuaternionValue.ToRotationMatrix(W);
MatrixType PreviousStressMatrix;
PreviousStressMatrix = ConstitutiveModelUtilities::VectorToSymmetricTensor(this->mHistoryVector, PreviousStressMatrix);
PreviousStressMatrix = prod( W, PreviousStressMatrix );
PreviousStressMatrix = prod( PreviousStressMatrix, trans(W) );
rStressMatrix += PreviousStressMatrix;
// To store when FinalizeModel (can be the total or the isochoric stress)
rValues.StressMatrix = rStressMatrix;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
VectorType StrainVector;
StrainVector = ConstitutiveModelUtilities::StrainTensorToVector(Variables.StrainMatrix, StrainVector);
this->CalculateAndAddConstitutiveTensor(Variables);
VectorType StressVector;
this->CalculateAndAddStressTensor(Variables,StrainVector,StressVector);
rStressMatrix = ConstitutiveModelUtilities::VectorToSymmetricTensor(StressVector,rStressMatrix);
// Rate to stress value
rStressMatrix *= rValues.GetProcessInfo()[DELTA_TIME];
// Total stress stored in the HistoryVector
this->AddHistoricalStress(rValues, rStressMatrix);
Variables.State().Set(ConstitutiveModelData::STRESS_COMPUTED);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector)
{
KRATOS_TRY
noalias(rStressVector) = prod(rVariables.ConstitutiveTensor,rStrainVector);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateIsochoricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
VectorType StrainVector;
StrainVector = ConstitutiveModelUtilities::StrainTensorToVector(Variables.StrainMatrix, StrainVector);
this->CalculateAndAddConstitutiveTensor(Variables);
VectorType StressVector;
this->CalculateAndAddIsochoricStressTensor(Variables,StrainVector,StressVector);
rStressMatrix = ConstitutiveModelUtilities::VectorToSymmetricTensor(StressVector,rStressMatrix);
// Rate to stress value
rStressMatrix *= rValues.GetProcessInfo()[DELTA_TIME];
// Isochoric stress stored in the HistoryVector
this->AddHistoricalStress(rValues, rStressMatrix);
Variables.State().Set(ConstitutiveModelData::STRESS_COMPUTED);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddIsochoricStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector)
{
KRATOS_TRY
//total stress
noalias(rStressVector) = prod(rVariables.ConstitutiveTensor,rStrainVector);
//deviatoric stress
double MeanStress = (1.0/3.0) * (rStressVector[0]+rStressVector[1]+rStressVector[2]);
rStressVector[0] -= MeanStress;
rStressVector[1] -= MeanStress;
rStressVector[2] -= MeanStress;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateVolumetricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix)
{
KRATOS_TRY
this->CalculateStressTensor( rValues, rStressMatrix );
double MeanPressure = 0;
for (unsigned int i = 0; i < 3; i++)
MeanPressure += rStressMatrix(i,i)/3.0;
rStressMatrix = identity_matrix<double>(3);
rStressMatrix *= MeanPressure;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddVolumetricStressTensor(ElasticDataType& rVariables, VectorType& rStrainVector, VectorType& rStressVector)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
//Set constitutive matrix to zero before adding
rConstitutiveMatrix.clear();
this->CalculateAndAddConstitutiveTensor(Variables,rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
this->CalculateAndAddConstitutiveTensor(rVariables);
rConstitutiveMatrix = ConstitutiveModelUtilities::ConstitutiveTensorToMatrix(rVariables.ConstitutiveTensor,rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddConstitutiveTensor(ElasticDataType& rVariables)
{
KRATOS_TRY
//Calculate Elastic ConstitutiveMatrix
const ModelDataType& rModelData = rVariables.GetModelData();
const MaterialDataType& rMaterial = rModelData.GetMaterialParameters();
rVariables.ConstitutiveTensor.clear();
// Lame constants
const double& rYoungModulus = rMaterial.GetYoungModulus();
const double& rPoissonCoefficient = rMaterial.GetPoissonCoefficient();
// 3D linear elastic constitutive matrix
rVariables.ConstitutiveTensor ( 0 , 0 ) = (rYoungModulus*(1.0-rPoissonCoefficient)/((1.0+rPoissonCoefficient)*(1.0-2.0*rPoissonCoefficient)));
rVariables.ConstitutiveTensor ( 1 , 1 ) = rVariables.ConstitutiveTensor ( 0 , 0 );
rVariables.ConstitutiveTensor ( 2 , 2 ) = rVariables.ConstitutiveTensor ( 0 , 0 );
rVariables.ConstitutiveTensor ( 3 , 3 ) = rVariables.ConstitutiveTensor ( 0 , 0 )*(1.0-2.0*rPoissonCoefficient)/(2.0*(1.0-rPoissonCoefficient));
rVariables.ConstitutiveTensor ( 4 , 4 ) = rVariables.ConstitutiveTensor ( 3 , 3 );
rVariables.ConstitutiveTensor ( 5 , 5 ) = rVariables.ConstitutiveTensor ( 3 , 3 );
rVariables.ConstitutiveTensor ( 0 , 1 ) = rVariables.ConstitutiveTensor ( 0 , 0 )*rPoissonCoefficient/(1.0-rPoissonCoefficient);
rVariables.ConstitutiveTensor ( 1 , 0 ) = rVariables.ConstitutiveTensor ( 0 , 1 );
rVariables.ConstitutiveTensor ( 0 , 2 ) = rVariables.ConstitutiveTensor ( 0 , 1 );
rVariables.ConstitutiveTensor ( 2 , 0 ) = rVariables.ConstitutiveTensor ( 0 , 1 );
rVariables.ConstitutiveTensor ( 1 , 2 ) = rVariables.ConstitutiveTensor ( 0 , 1 );
rVariables.ConstitutiveTensor ( 2 , 1 ) = rVariables.ConstitutiveTensor ( 0 , 1 );
rVariables.State().Set(ConstitutiveModelData::CONSTITUTIVE_MATRIX_COMPUTED);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
VectorType StrainVector;
StrainVector = ConstitutiveModelUtilities::StrainTensorToVector(Variables.StrainMatrix, StrainVector);
//Set constitutive matrix to zero before adding
rConstitutiveMatrix.clear();
this->CalculateAndAddConstitutiveTensor(Variables, rConstitutiveMatrix);
VectorType StressVector;
this->CalculateAndAddStressTensor(Variables,StrainVector,StressVector);
rStressMatrix = ConstitutiveModelUtilities::VectorToSymmetricTensor(StressVector,rStressMatrix);
// Rate to stress value
rStressMatrix *= rValues.GetProcessInfo()[DELTA_TIME];
// Total stress stored in the HistoryVector
this->AddHistoricalStress(rValues, rStressMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateIsochoricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateVolumetricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateIsochoricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
this->CalculateAndAddIsochoricConstitutiveTensor(Variables,rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddIsochoricConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
this->CalculateAndAddIsochoricConstitutiveTensor(rVariables);
rConstitutiveMatrix = ConstitutiveModelUtilities::ConstitutiveTensorToMatrix(rVariables.ConstitutiveTensor, rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddIsochoricConstitutiveTensor(ElasticDataType& rVariables)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateVolumetricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
ElasticDataType Variables;
this->InitializeElasticData(rValues,Variables);
this->CalculateAndAddVolumetricConstitutiveTensor(Variables,rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddVolumetricConstitutiveTensor(ElasticDataType& rVariables, Matrix& rConstitutiveMatrix)
{
KRATOS_TRY
this->CalculateAndAddVolumetricConstitutiveTensor(rVariables);
rConstitutiveMatrix = ConstitutiveModelUtilities::ConstitutiveTensorToMatrix(rVariables.ConstitutiveTensor, rConstitutiveMatrix);
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
void HypoElasticModel::CalculateAndAddVolumetricConstitutiveTensor(ElasticDataType& rVariables)
{
KRATOS_TRY
KRATOS_ERROR << "calling the base class function in HypoElasticModel ... illegal operation" << std::endl;
KRATOS_CATCH(" ")
}
//************************************************************************************
//************************************************************************************
int HypoElasticModel::Check(const Properties& rMaterialProperties, const ProcessInfo& rCurrentProcessInfo)
{
KRATOS_TRY
if(YOUNG_MODULUS.Key() == 0 || rMaterialProperties[YOUNG_MODULUS] <= 0.00)
KRATOS_ERROR << "YOUNG_MODULUS has Key zero or invalid value" << std::endl;
if(POISSON_RATIO.Key() == 0){
KRATOS_ERROR << "POISSON_RATIO has Key zero invalid value" << std::endl;
}
else{
const double& nu = rMaterialProperties[POISSON_RATIO];
if( (nu > 0.499 && nu < 0.501) || (nu < -0.999 && nu > -1.01) )
KRATOS_ERROR << "POISSON_RATIO has an invalid value" << std::endl;
}
return 0;
KRATOS_CATCH(" ")
}
} // Namespace Kratos
| [
"cpuigbo@cimne.upc.edu"
] | cpuigbo@cimne.upc.edu |
42bcab382f53d63eeaeff6749708801eca953d18 | d1bb370c70bc2ee2199f8a887cbdbf362c520ed6 | /042_New_year_chaos_HR/new_year_chaos.cpp | b75f347fbb6fdda115aa8a9a1135c93f3507f1f8 | [] | no_license | kwakjames5/Three-Dollar | 788d5251f376e9f1b6e3b328903036090e8850c8 | 49881b717b39728c2941762962717fd72fc9473e | refs/heads/master | 2021-03-27T03:57:31.801143 | 2020-11-07T20:07:00 | 2020-11-07T20:07:00 | 247,784,267 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,110 | cpp | #include <bits/stdc++.h>
using namespace std;
// link: https://www.hackerrank.com/challenges/new-year-chaos/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays
// date: 5/16/2020
/*
The first line contains an integer t, the number of test cases.
Each of the next t pairs of lines are as follows:
- The first line contains an integer n, the number of people in the queue
- The second line has n space-separated integers describing the final state of the queue.
*/
/*
ex)
2
5
2 1 5 3 4
5
2 5 1 3 4
3 (1 2 3 4 5 -> 1 2 3 5 4 -> 1 2 5 3 4 -> 2 1 5 3 4)
Too chaotic
Return too chaotic if more than two bribes need to be made
otherwise return minimum number of bribes to achieve the inputted queue
*/
/*
a number in a spot cannot be more than 2 difference
ex)
5 1 2 3 4 is clearly too chaotic
q[0] currently has 5
5 - (0 + 1) is higher than 2
on the other hand, 1 2 5 3 4 is possible
q[2] currently has 5
5 - (2 + 1) is 2, so this works
since the numbers start from 1 instead of 0, the index that is being tracked must have a 1 added to match the numbers in the queue
*/
vector<string> split_string(string);
// Complete the minimumBribes function below.
void minimumBribes(vector<int> q)
{
int total_bribes = 0;
// check each element in q going backwards
for(int i = q.size() - 1; i >= 0; i--)
{
// if the element being checked is more than 2 away from their original spots, cout Too chaotic and return
if(q[i] - (i + 1) > 2)
{
cout << "Too chaotic" << endl;
return;
}
// now the function must check how many bribes the element at q[i] made to get to the spot it is at right now
// run a new for loop from 2 potential bribes/spots away from the current q[i]
// from there, check every element up to q[i]
// since q[i] - 2 can also become a negative number (which cannot be used), use max(0, q[i] - 2) so that when q[i] - 2 is negative, 0 is used instead
for(int j = max(0, q[i] - 2); j < i; j++)
{
// if the element that is in a spot lower than q[i] has a element higher in value than q[i], that means a bribe was made
// increment up total_bribe for each bribe made
if(q[j] > q[i])
{
total_bribes++;
}
}
}
cout << total_bribes << endl;
/*
for(int i = 0; i < q.size() - 1; i++)
{
// if the element being checked is more than 2 away from their original spots, cout Too chaotic and return
if(q[i] - (i + 1) > 2)
{
cout << "Too chaotic" << endl;
return;
}
}
*/
}
int main()
{
int t;
cin >> t;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
for (int t_itr = 0; t_itr < t; t_itr++) {
int n;
cin >> n;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
string q_temp_temp;
getline(cin, q_temp_temp);
vector<string> q_temp = split_string(q_temp_temp);
vector<int> q(n);
for (int i = 0; i < n; i++) {
int q_item = stoi(q_temp[i]);
q[i] = q_item;
}
minimumBribes(q);
}
return 0;
}
vector<string> split_string(string input_string) {
string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) {
return x == y and x == ' ';
});
input_string.erase(new_end, input_string.end());
while (input_string[input_string.length() - 1] == ' ') {
input_string.pop_back();
}
vector<string> splits;
char delimiter = ' ';
size_t i = 0;
size_t pos = input_string.find(delimiter);
while (pos != string::npos) {
splits.push_back(input_string.substr(i, pos - i));
i = pos + 1;
pos = input_string.find(delimiter, i);
}
splits.push_back(input_string.substr(i, min(pos, input_string.length()) - i + 1));
return splits;
}
| [
"kwakjame@usc.edu"
] | kwakjame@usc.edu |
8f07bab3f3b135d0c90ca25df27d1881330887f1 | 2ea7eee88cc16ffedb88083094b76031c8a81413 | /AHC/HTTF2022Q/tools/Main.cpp | 14d40bc483b02d4da61d2172957da228acd3e7a5 | [] | no_license | shotauedaGit/cp_practice | c6ea658f47ac84e3e4cdecf691d7cad10789133d | e2d006a6d7c392692dff9ab182e214b3f855b554 | refs/heads/master | 2023-01-24T10:36:08.742179 | 2023-01-07T05:34:26 | 2023-01-07T05:34:26 | 248,667,877 | 0 | 0 | null | 2020-05-07T07:38:49 | 2020-03-20T04:28:05 | C++ | UTF-8 | C++ | false | false | 11,758 | cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define LINF 9223372036854775807
#define MOD 1000000007
#define MOD2 998244353
template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}
#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)
#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;
#define all(a) (a).begin(),(a).end()
#define dig(n) to_string(n).length()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,P> PP;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a/gcd(a,b))*b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int dx8[8] ={1,1,0,-1,-1,-1, 0, 1};
int dy8[8] ={0,1,1, 1, 0,-1,-1,-1};
chrono::system_clock::time_point start;
void Timer_start(){start = std::chrono::system_clock::now();}
double Timer_end(){
auto end = std::chrono::system_clock::now();
double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count(); //処理に要した時間をミリ秒に変換
return elapsed;
}
#define N 1000
#define M 20
#define D 2000
#define isDBG true
#define pred false
#define errPrint false
class HTTF2022Q{
public:
int rd_change = 0,implv=0,failed=0;
int K,R;
int today=0;
int task_done_cnt=0;
vector< P > task_dt;
int task_doing[M];
vector< vector<float> > d;
vector< vector<float> > s;
vector<vector<int>> adj;
// iさんがtask[j]にwij日かかった履歴
vector<vector<P>> past_task;
ofstream outputfile,outputscorefile;
HTTF2022Q(int k,int r){
if(isDBG)outputfile.open("C:\\prog\\gitrepos\\cp_practice\\AHC\\HTTF2022Q\\tools\\out.txt",std::ios::out);
if(isDBG)outputscorefile.open("C:\\prog\\gitrepos\\cp_practice\\AHC\\HTTF2022Q\\tools\\score.txt",std::ios::app);
// init
K=k;R=r;
// tasks
d.resize(N);
// member
float ex = sqrtf(2.0/(atan(1.0)*4.0*K))*30.0;
//float ex = 0.0f;
s.resize(M);
rep(i,M)s[i] = vector<float>(K,ex);
past_task.resize(M);
// doing
fill_n(task_doing,M,-1);
// task begin end
task_dt.resize(N);
fill(all(task_dt),P(0,0));
// task adj list
// 先にやっておかないといけないlist
adj.resize(N);
rep(i,N){
vector<float> di(k,0.0f);
rep(j,k){cin>>di[j];}
d[i] = di;
}
rep(i,r){
int vi,ui; cin>>ui>>vi; --vi;--ui;
adj[vi].emplace_back(ui);
}
}
vector<int> doable_task(){
vector<int> ret;
rep(i,N){
bool isdoable = true;
if(task_dt[i].second != 0 || task_dt[i].first != 0)continue;
for(int ti : adj[i]){
if(task_dt[ti].second == 0){isdoable = false; break;}
}
if(isdoable)ret.emplace_back(i);
}
/*
//cerr<<"day:"<<today<<" doable: "<<ret.size()<<endl;
cerr<<"day "<<today<<": ";
if(ret.size() > M){
cerr<<"******* 20+ ********"<<endl;
}else{
rep( i , (int)ret.size())cerr<<"*";
cerr<<endl;
}
*/
return ret;
}
float skill_func(vector<float> di,vector<float> si){
float ret=1.0;
rep(i,K){
ret += max( 0.0f ,di[i]-si[i]);
}
return ret;
}
void change_si_random(int si){
double now = Timer_end();
int rnd_k = rand()%K;
//int rd_change_cur = rd_change;
while(/*(Timer_end()-now) < 1.0*/ Timer_end()<(2.7f*task_done_cnt)+80){
rnd_k = rand()%K;
int r1 = -1,r2 = -1;
int r = (rand()%100);
if(past_task[si].size() <= 3){
if(r >= r1)change_skill(si,rnd_k, 0.5f ,true);
else change_skill(si,rnd_k, -0.1f ,true);
}else{
if(r >= r2)change_skill(si,rnd_k, 0.5f ,true);
else change_skill(si,rnd_k, -0.5f ,true);
}
}
}
void change_skill(int si,int k,float dx,bool isFirst){
vector<float> si_1 = s[si];
// modify
si_1[k] += dx; chmax(si_1[k],0.0f); chmin(si_1[k],60.0f);
float St=0.0f,St_1=0.0f;
for(P p : past_task[si]){
int tsk = p.first;
float T_tsk = p.second;
float t_tsk = 1.0f,t1_tsk = 1.0f;
rep(i,K){
t_tsk += max(0.0f , d[tsk][i] - s[si][i]);
t1_tsk += max(0.0f , d[tsk][i] - si_1[i]);
}
St += (T_tsk - t_tsk)*(T_tsk - t_tsk);
St_1 += (T_tsk - t1_tsk)*(T_tsk - t1_tsk);
}
int time_left = (3000-(int)Timer_end());
int rnd = rand()%1000;
++rd_change;
if(St_1 < St){
// modify
s[si][k] += dx; chmax(s[si][k],0.0f); chmin(s[si][k],60.0f);
++implv;
change_skill(si,k,dx,isFirst);
}else if(St_1 > St){
if(isFirst){
change_skill(si,k,-dx,false);
}
++failed;
}else if(St_1 == St && ((time_left/120)+1) > rnd && false){
// modify
s[si][k] += dx; chmax(s[si][k],0.0f); chmin(s[si][k],60.0f);
++implv;
if(dx >= 0.1f)change_skill(si,k,dx,isFirst);
}
}
void change_si(int si,int task,int took){
float r;
int done = past_task[si].size()+1;
if(past_task[si].size() == 0){
r = 1.0f/(sqrt(took/7));
}else{
r = 1.0f/(sqrt(done)*(sqrt(took/7)));
}
if(r>1.0f)r=1.0f;
rep(i,K){
s[si][i] = (1-r)*s[si][i] + r*(5.0f/2.0f)*d[task][i];
chmax(s[si][i],0.0f);
}
}
bool addDate(){
++today;
vector<int> done_member;
vector<int> done_task;
if(today != 1){
int mi; cin>>mi;
//cerr<<fixed<<setprecision(3)<<Timer_end()<<endl;
if(mi == -1){
int score,cnt=0;
rep(i,N)if(task_dt[i].second != 0)cnt++;
score = (D - min(today-1,D)) + cnt;
cerr<<"score_self:"<<score<<endl;
outputscorefile<<score<<endl;
cerr<<rd_change<<","<<implv<<","<<failed<<endl;
cerr<<Timer_end()<<endl;
return true;
}
if(errPrint)cerr<<mi<<" has done task:";
rep(i,mi){
int si;
cin>>si;--si;
if(errPrint)cerr<<", ["<<si+1<<","<<task_doing[si]+1<<"]";
done_task.emplace_back( task_doing[si] );
//cerr<<"1 ";
int day_took = today - task_dt[ task_doing[si] ].first;
//cerr<<"2 ";
task_dt[ task_doing[si] ].second = today;
//cerr<<"3 ";
past_task[si].emplace_back(P(task_doing[si] , day_took));
//cerr<<"4 ";
// void.
//change_si(si,task_doing[si],day_took);
++task_done_cnt;
//if(task_done_cnt == 1 ||task_done_cnt%100 == 0)cerr<<task_done_cnt<<": "<<Timer_end()<<" ms"<<endl;
change_si_random(si);
//cerr<<rd_change<<","<<implv<<","<<failed<<endl;
//cerr<<"5 ";
if(pred && si == 0){
cout<<"#s "<<si+1;
cerr<<"#s "<<si+1;
outputfile<<"#s "<<si+1;
rep(j,K){
outputfile<<fixed<<setprecision(0)<<" "<<s[si][j];
cerr<<fixed<<setprecision(0)<<" "<<s[si][j];
cout<<fixed<<setprecision(0)<<" "<<s[si][j];
}
outputfile<<endl;
cerr<<endl;
cout<<endl;
}
task_doing[si] = -1;
//cerr<<"6 ";
}
if(errPrint)cerr<<endl;
}else{
rep(si,M){
if(pred){
cout<<"#s "<<si+1;
//cerr<<"#s "<<si+1;
outputfile<<"#s "<<si+1;
rep(j,K){
outputfile<<fixed<<setprecision(0)<<" "<<s[si][j];
//cerr<<fixed<<setprecision(0)<<" "<<s[si][j];
cout<<fixed<<setprecision(0)<<" "<<s[si][j];
}
outputfile<<endl;
//cerr<<endl;
cout<<endl;
}
}
}
//doable task
int member_cnt=0;
vector<P> output;
//誰が何やるか決める
/**/
vector<int> doable_tasks = doable_task();
// 人/タスク の touple
vector<pair<float,P>> skill_error;
int pat=0;
for(int ti : doable_tasks){
rep(i,M){
if(task_doing[i] != -1)continue;
pair<float,P> p = make_pair(skill_func(d[ti],s[i]),P(i,ti));
skill_error.emplace_back(p);
pat++;
//cerr<<pat<<": score "<<p.first<<"(m,t)= "<<i<<","<<ti<<endl;
}
}
unordered_map<int,int> task_member;
bool ismemberdoable[M];
rep(i,M)ismemberdoable[i]=true;
sort(all(skill_error));
for(pair<float,P> p : skill_error){
if(!ismemberdoable[p.second.first])continue;
if(task_member.find(p.second.second) == task_member.end()){
task_member[p.second.second] = p.second.first;
ismemberdoable[p.second.first] = false;
}
}
for(pair<int,int> p:task_member){
output.emplace_back(P(p.second,p.first));
}
/**/
//print
if(isDBG){
outputfile<<output.size()<<" ";
cout<<output.size()<<" ";
if(errPrint)cerr<<output.size()<<" works today!";
}
else cout<<output.size()<<" ";
//cerr<<"output?"<<endl;
for(P pi:output){
if(isDBG){
outputfile<<pi.fi + 1<<" "<<pi.se + 1<<" ";
if(errPrint)cerr<<pi.fi + 1<<" "<<pi.se + 1<<" ";
cout<<pi.fi + 1<<" "<<pi.se + 1<<" ";
}
else cout<<pi.fi + 1<<" "<<pi.se + 1<<" ";
task_doing[pi.fi] = pi.se;
task_dt[pi.se].first = today;
}
if(isDBG){
outputfile<<endl;//<<flush;
cout<<endl<<flush;
if(errPrint)cerr<<endl<<flush;
}else cout<<flush;
return false;
}
};
int main(){
Timer_start();
srand(time(NULL));
int _n,_m,_k,_r;
cin>>_n>>_m>>_k>>_r;
HTTF2022Q a(_k,_r);
while(a.addDate() == false){
}
//cout <<fixed<<setprecision(16)<< << endl;
//if(flag)cout << "Yes" <<endl;
//else cout << "No" <<endl;
return 0;
}
| [
"shota.ueda.ak@gmail.com"
] | shota.ueda.ak@gmail.com |
d8aaa8468f524d4a6ecb6c1c35808501177ce99f | 76ded045c45b31302a2ad3da87873204fe432d9b | /include/calc_psi.h | 229063f33cb04a3e35b553b9cde4cd6a8583a2f7 | [] | no_license | nyhirasawa/Flux-Interpolated-Advection | c9cb3b56554d46d39b275014f6261b2755ae1b5d | 592ae46e96a87007b6be88f9a072879114849972 | refs/heads/main | 2023-05-26T05:08:30.228121 | 2021-06-13T17:34:47 | 2021-06-13T17:34:47 | 376,601,619 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,323 | h | #pragma once
#include "physical_const.h"
#include "utils.h"
#include "grid.h"
#include "define_float_type.h"
namespace smoke_simulation {
void calc_discrete_psi_velocity_x(
const Grid &all_grid,
std::vector<MY_FLOAT_TYPE> &psi_velocity_x_on_cell_vertex_y,
const std::vector<MY_FLOAT_TYPE> &velocity_x,
const int Grid_num_x,
const int Grid_num_y,
const MY_FLOAT_TYPE cell_length,
const std::string interpolation_method
);
void calc_discrete_psi_velocity_y(
const Grid &all_grid,
std::vector<MY_FLOAT_TYPE> &psi_velocity_cell_center_y,
const std::vector<MY_FLOAT_TYPE> &velocity_y,
const int Grid_num_x,
const int Grid_num_y,
const MY_FLOAT_TYPE cell_length,
const std::string interpolation_method
);
void calc_psi_on_cell_face_from_density_on_cell_center(
const Grid &all_grid,
std::vector<MY_FLOAT_TYPE> &psi_on_cell_face_x,
std::vector<MY_FLOAT_TYPE> &psi_on_cell_face_y,
const std::vector<MY_FLOAT_TYPE> &density_on_cell_center,
const int Grid_num_x,
const int Grid_num_y,
const MY_FLOAT_TYPE cell_length,
const std::string interpolation_method
);
}//namespace smoke_simulation
| [
"73846721+nyhirasawa@users.noreply.github.com"
] | 73846721+nyhirasawa@users.noreply.github.com |
b09fef9d7e489a67d5d2390fc420264f24206cc2 | 8c881345865a01b5c63a5bb076f126403716420c | /Visual C++数字图像模式识别技术详解源码/chapter02/2-1/demo/demo1Doc.h | d8ff447fa5f027635a7cd18bedd0add784247e27 | [] | no_license | Asher-1/C_Plus_Plus-projects | f758df626de074a5a5071c6bf1ae08cfb5c4d2e3 | 56941f1a76cf1645df5cc0fcb5529eddc64643f2 | refs/heads/master | 2022-01-28T13:03:24.493838 | 2019-05-30T13:06:35 | 2019-05-30T13:06:35 | 160,189,947 | 3 | 2 | null | null | null | null | GB18030 | C++ | false | false | 1,629 | h | // demo1Doc.h : interface of the CDemo1Doc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DEMO1DOC_H__AAFD1A30_4BF5_4F8F_AA69_FBF9B91153BA__INCLUDED_)
#define AFX_DEMO1DOC_H__AAFD1A30_4BF5_4F8F_AA69_FBF9B91153BA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ImageDib.h"
class CDemo1Doc : public CDocument
{
protected: // create from serialization only
CDemo1Doc();
DECLARE_DYNCREATE(CDemo1Doc)
// Attributes
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDemo1Doc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CDemo1Doc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
public:
//ImgDib类的对象,从打开文件中读入的数据放在该对象中
ImageDib* m_dib;
protected:
//{{AFX_MSG(CDemo1Doc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DEMO1DOC_H__AAFD1A30_4BF5_4F8F_AA69_FBF9B91153BA__INCLUDED_)
| [
"ludahai19@163.com"
] | ludahai19@163.com |
887936169a3b07f0cd9dd3dc3cbe167d326e7cca | 19d00b3c4383c3ab3aafca32a4e0a93ecd05cc55 | /src/Naive.h | c93f4763fe7668942cae0fd595cc556a4c8d7441 | [] | no_license | dimamo5/LeGrepCAL | ff24fb75c1cde109bf7b4d6651f3e849d7f33d43 | 3e79a937c9d4719e9c78888780ef4a813d1d006d | refs/heads/master | 2021-01-17T16:45:58.118666 | 2015-05-31T23:18:38 | 2015-05-31T23:18:38 | 35,610,672 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 473 | h | /*
* Naive.h
*
* Created on: 21/05/2015
* Author: Utilizador
*/
#ifndef NAIVE_H_
#define NAIVE_H_
#include <string>
#include <vector>
#include "StringSearchAlgorith.h"
using namespace std;
/**
* @brief Algoritmo de Pesquisa de String Naive
* Compara na Haystack caracter a caracter
*/
class Naive: public StringSearchAlgorith {
public:
Naive(string haystack, string needle);
vector<int> run(bool (*compareFunc)(char, char));
};
#endif /* NAIVE_H_ */
| [
"diogomoura13@gmail.com"
] | diogomoura13@gmail.com |
9341a5ccfb49dcfd1c6747fa478c219246286d63 | 7dcd5c79a87245f92ac6f5c87eb686cb851714de | /Firmware/Main.cpp | 2292ed93c2333be1510e6d2a4dc45acec9a71b2e | [] | no_license | tadaspaliulis/RoboTooth | e1d0d75a2d51471d074abfa023828dd4c95901de | 423df8137edae3943c01a15315344a1635361cc9 | refs/heads/master | 2021-05-03T14:15:11.581299 | 2020-05-09T17:57:44 | 2020-05-09T17:57:44 | 69,169,346 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,485 | cpp | #include "state.h"
#include "actionQueue.h"
#include "queue.h"
//Need the ifdef to make sure that arduino IDE won't try to latch onto
//the main and ignore the real one.
#ifdef VS_TESTBED
#include "serialInterfaceMock.h"
#include "messagingService.h"
#include <cassert>
class actionMock
{
public:
actionMock(): executionTime(0), actionId(0) {}
actionMock(unsigned int ExecutionTime, byte ActionId): executionTime(ExecutionTime), actionId(ActionId) {}
bool isIndefinite() { return executionTime == 0; }
bool isStarted() { return false; }
unsigned int getExecutionTimeMs() const { return executionTime; }
void onActionCompleted() {}
byte getActionId() const { return actionId; }
void start() {}
private:
unsigned int executionTime;
byte actionId;
};
void testActionQueueIndefiniteActionReplacement()
{
actionQueue<actionMock> queue(0);
actionMock timedAction(1, 0);
actionMock indefAction1(0, 1);
actionMock indefAction2(0, 2);
actionMock indefAction3(0, 3);
queue.addNewAction(timedAction);
//Indefinite actions should overwrite each at the end of the queue
queue.addNewAction(indefAction1);
queue.addNewAction(indefAction2);
queue.addNewAction(indefAction3);
queue.UpdateQueue(0);
}
void testQueueAddLimit()
{
queue<int> q(5);
bool successfulAdd = false;
successfulAdd = q.tryAdd(1);
successfulAdd = q.tryAdd(2);
successfulAdd = q.tryAdd(3);
successfulAdd = q.tryAdd(4);
successfulAdd = q.tryAdd(5);
assert(successfulAdd == true);
//Expected false.
successfulAdd = q.tryAdd(6);
assert(successfulAdd == false);
}
void testQueuePopSizeChange()
{
queue<int> q(5);
q.tryAdd(1);
assert(q.getSize() == 1);
q.popFront();
assert(q.getSize() == 0);
}
void testQueueWraparound()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(2);
q.tryAdd(3);
q.tryAdd(4);
assert(q.getSize() == 4);
q.popFront();
q.popFront();
q.popFront();
assert(q.getSize() == 1);
assert(*q.get(0) == 4);
q.tryAdd(5);
q.tryAdd(6);
q.tryAdd(7);
assert(q.getSize() == 4);
assert(*q.get(0) == 4);
assert(*q.get(1) == 5);
assert(*q.get(2) == 6);
assert(*q.get(3) == 7);
}
void testQueueGetOutOfBounds()
{
queue<int> q(4);
q.tryAdd(1);
assert(q.get(2) == nullptr);
}
void testQueueReplace()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(2);
q.tryAdd(3);
assert(*q.get(1) == 2);
q.replace(1, 10);
assert(*q.get(1) == 10);
}
void testQueueEmptyFirst()
{
queue<int> q(4);
q.tryAdd(1);
q.popFront();
assert(q.first() == nullptr);
}
void testQueueEmptyLast()
{
queue<int> q(4);
q.tryAdd(1);
q.popFront();
assert(q.last() == nullptr);
}
void testQueueFirst()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(42);
q.popFront();
assert(*q.first() == 42);
}
void testQueueLast()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(11);
q.popFront();
q.tryAdd(42);
assert(*q.last() == 42);
}
void testQueuePopXItems()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(2);
q.tryAdd(3);
q.tryAdd(4);
q.popFront(3);
assert(*q.get(0) == 4);
assert(q.getSize() == 1);
}
void testQueuePopXItemsWithWraparound()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(2);
q.tryAdd(3);
q.tryAdd(4);
q.popFront(3);
q.tryAdd(5);
q.tryAdd(6);
q.tryAdd(7);
q.popFront(3);
assert(*q.get(0) == 7);
assert(q.getSize() == 1);
}
void testQueuePopXItemsPopAllItems()
{
queue<int> q(4);
q.tryAdd(1);
q.tryAdd(2);
q.tryAdd(3);
q.tryAdd(4);
q.popFront(4);
assert(q.get(0) == nullptr);
assert(q.getSize() == 0);
}
void queueTests()
{
testQueueAddLimit();
testQueuePopSizeChange();
testQueueWraparound();
testQueueGetOutOfBounds();
testQueueReplace();
testQueueEmptyFirst();
testQueueEmptyLast();
testQueueFirst();
testQueueLast();
testQueuePopXItems();
testQueuePopXItemsWithWraparound();
testQueuePopXItemsPopAllItems();
}
void assertMessagesEqual(const message& a, const message& b)
{
assert(a.dataLength == b.dataLength);
assert(a.id == b.id);
for (int i = 0; i < a.dataLength && i < constants.maximumMessageDataLength; ++i)
{
assert(a.messageData[i] == b.messageData[i]);
}
}
void messagingServiceZeroDataLengthMessage()
{
serialInterfaceMock serialMock;
message sentMessage;
sentMessage.dataLength = 0;
sentMessage.id = 12;
serialMock.addMessageBytesForReading(sentMessage);
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage != nullptr);
assertMessagesEqual(sentMessage, *receivedMessage);
}
void messagingServiceMessageParse()
{
serialInterfaceMock serialMock;
message sentMessage;
sentMessage.dataLength = 5;
sentMessage.id = 12;
sentMessage.messageData[0] = 0;
sentMessage.messageData[1] = 1;
sentMessage.messageData[2] = 2;
sentMessage.messageData[3] = 3;
sentMessage.messageData[4] = 4;
serialMock.addMessageBytesForReading(sentMessage);
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage != nullptr);
assertMessagesEqual(sentMessage, *receivedMessage);
}
void messagingServiceParseMessageReceivedInSingleBytes()
{
serialInterfaceMock serialMock;
//Create a message that we'll try to compare against.
message sentMessage;
sentMessage.dataLength = 1;
sentMessage.id = 12;
sentMessage.messageData[0] = 42;
const auto arraySize = constants.minimumMessageLength + 1;
byte messageAsByteArray[arraySize];
messageAsByteArray[0] = messageAsByteArray[1] = 0xbb;
memcpy(messageAsByteArray + 2, &sentMessage, sizeof(sentMessage.dataLength) + sentMessage.id + sizeof(byte));
messagingService<serialInterfaceMock> messaging(&serialMock);
//Receive the bytes one by one and try looking for a message each time.
for (int i = 0; i < arraySize - 1; ++i)
{
serialMock.addByte(messageAsByteArray[i]);
messaging.receiveIncomingData();
assert(messaging.processMessage() == nullptr);
}
//Add the final byte and try processing again.
//This time it should be successful.
serialMock.addByte(messageAsByteArray[arraySize - 1]);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage != nullptr);
assertMessagesEqual(sentMessage, *receivedMessage);
}
void messagingServiceMessageParseNotAllDataInitially()
{
serialInterfaceMock serialMock;
message sentMessage;
sentMessage.dataLength = 5;
sentMessage.id = 12;
sentMessage.messageData[0] = 0;
sentMessage.messageData[1] = 1;
sentMessage.messageData[2] = 2;
sentMessage.messageData[3] = 3;
sentMessage.messageData[4] = 4;
serialMock.addMessageBytesForReading(sentMessage, 2);
messagingService<serialInterfaceMock> messaging(&serialMock);
//Not all data received, shouldn't get a received message.
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage == nullptr);
serialMock.addByte(2);
serialMock.addByte(3);
serialMock.addByte(4);
//Receive the rest of the data and make sure the message is there too.
messaging.receiveIncomingData();
receivedMessage = messaging.processMessage();
assert(receivedMessage != nullptr);
assertMessagesEqual(sentMessage, *receivedMessage);
}
void messagingServiceMessageParseGarbageAtTheStart()
{
serialInterfaceMock serialMock;
//Add some 'gargabage' data to the data stream.
for (int i = 0; i < 6; ++i)
{
serialMock.addByte(42);
}
//And only then send the actual message.
message sentMessage;
sentMessage.dataLength = 5;
sentMessage.id = 12;
sentMessage.messageData[0] = 0;
sentMessage.messageData[1] = 1;
sentMessage.messageData[2] = 2;
sentMessage.messageData[3] = 3;
sentMessage.messageData[4] = 4;
serialMock.addMessageBytesForReading(sentMessage);
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage != nullptr);
assertMessagesEqual(sentMessage, *receivedMessage);
}
void messagingServiceGarbageDataOnly()
{
serialInterfaceMock serialMock;
//Add some 'gargabage' data to the data stream.
for (int i = 0; i < 20; ++i)
{
serialMock.addByte(42 + i);
}
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage == nullptr);
}
void messagingServiceMessageParseTwoInARow()
{
serialInterfaceMock serialMock;
//Queue up two messages in a row.
message sentMessage1;
sentMessage1.dataLength = 5;
sentMessage1.id = 12;
sentMessage1.messageData[0] = 0;
sentMessage1.messageData[1] = 1;
sentMessage1.messageData[2] = 2;
sentMessage1.messageData[3] = 3;
sentMessage1.messageData[4] = 4;
serialMock.addMessageBytesForReading(sentMessage1);
message sentMessage2;
sentMessage2.dataLength = 4;
sentMessage2.id = 42;
sentMessage2.messageData[0] = 4;
sentMessage2.messageData[1] = 5;
sentMessage2.messageData[2] = 6;
sentMessage2.messageData[3] = 7;
serialMock.addMessageBytesForReading(sentMessage2);
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
//Make sure we've received the the two messages
message* receivedMessage1 = messaging.processMessage();
assert(receivedMessage1 != nullptr);
assertMessagesEqual(sentMessage1, *receivedMessage1);
message* receivedMessage2 = messaging.processMessage();
assert(receivedMessage2 != nullptr);
assertMessagesEqual(sentMessage2, *receivedMessage2);
}
void messagingServiceDataLengthTooGreat()
{
serialInterfaceMock serialMock;
message sentMessage;
//Set the data length to be invalid.
sentMessage.dataLength = constants.maximumMessageDataLength + 1;
sentMessage.id = 12;
serialMock.addMessageBytesForReading(sentMessage, 2);
messagingService<serialInterfaceMock> messaging(&serialMock);
messaging.receiveIncomingData();
message* receivedMessage = messaging.processMessage();
assert(receivedMessage == nullptr);
}
void messagingServiceTests()
{
messagingServiceZeroDataLengthMessage();
messagingServiceMessageParse();
messagingServiceParseMessageReceivedInSingleBytes();
messagingServiceMessageParseNotAllDataInitially();
messagingServiceMessageParseGarbageAtTheStart();
messagingServiceGarbageDataOnly();
messagingServiceMessageParseTwoInARow();
messagingServiceDataLengthTooGreat();
}
int main()
{
//testActionQueueIndefiniteActionReplacement();
queueTests();
messagingServiceTests();
return 0;
}
#endif | [
"tadas.paliulis@gmail.com"
] | tadas.paliulis@gmail.com |
6bbd29cd1ebecdb8cf7038a576913710654cd4fa | c775abdf4d6c6de293b6dff852e4bc6d6ac1861d | /libcxx/test/std/thread/thread.semaphore/version.pass.cpp | 0a3affb876ac0f6c30d599f89a946619a1dedff9 | [
"NCSA",
"LLVM-exception",
"MIT",
"Apache-2.0"
] | permissive | LevyForchh/llvm-project | d934444c7aed9ca6bf0837efc17af1bab2267aec | 904c0865dfaef343245d6496623f187c4cdc1b61 | refs/heads/apple/master | 2022-04-18T09:33:19.463686 | 2020-04-17T19:45:08 | 2020-04-17T19:45:08 | 256,594,745 | 0 | 0 | Apache-2.0 | 2020-04-17T19:45:10 | 2020-04-17T19:44:40 | null | UTF-8 | C++ | false | false | 616 | cpp | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03, c++11
// <semaphore>
#include <semaphore>
#include "test_macros.h"
#ifndef _LIBCPP_VERSION
#error _LIBCPP_VERSION not defined
#endif
int main(int, char**)
{
return 0;
}
| [
"ldionne@apple.com"
] | ldionne@apple.com |
ff1f21812aab5de93bcd4fd4a498bb6918d07caa | f1286562d4273d0f6352a8cf02bf5c215d2068c8 | /demo/docs/sys/docformat/epub/econverter.cpp | efc4c009793bd889d20e1a6f6dbf59ae47e6afbf | [] | no_license | hongnod/QOASIS | 5b9f3f2d6247230235e43dbf7dd0f444b6880929 | b50c58cbd99fd2d01a2ad32a85591be7486c3ccc | refs/heads/master | 2022-03-28T09:35:12.720948 | 2020-01-30T12:35:26 | 2020-01-30T12:35:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 814 | cpp |
#include "../kzip.h"
#include <QPixmap>
#include <QtCore/QObject>
#include <QtCore/QQueue>
#include <QtCore/QUrl>
#include <QtGui/QTextCharFormat>
#include <QtGui/QTextCursor>
#include <QtGui/QTextDocument>
#include <QtGui/QTextFrame>
#include <QtGui/QTextList>
#include <QtGui/QTextTableCell>
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
#include <QtXml/QDomText>
#include <QtXml/QXmlSimpleReader>
#include "econverter.h"
#include "edocument.h"
using namespace Epub;
Converter::Converter() { /* init class */ }
Converter::~Converter() { }
const QList<EpubToc> Converter::convert(const QString &fileName , const QString dir ) {
Document oooDocument(fileName,dir);
if (!oooDocument.open()) {
QList<EpubToc> dummy;
return dummy;
} else {
return oooDocument.MenuList();
}
}
| [
"pehohlva@gmail.com"
] | pehohlva@gmail.com |
4541a8766dc01ce64ae572ecc32651a3030c03a9 | 3841f7991232e02c850b7e2ff6e02712e9128b17 | /小浪底泥沙三维/EV_Xld/jni/src/EV_MapControl_Java/wrapper/trackingimageitem_wrapperjava.cpp | da08156266e7dac74aee7cf5c6bd713235165985 | [] | no_license | 15831944/BeijingEVProjects | 62bf734f1cb0a8be6fed42cf6b207f9dbdf99e71 | 3b5fa4c4889557008529958fc7cb51927259f66e | refs/heads/master | 2021-07-22T14:12:15.106616 | 2017-10-15T11:33:06 | 2017-10-15T11:33:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,069 | cpp | /* This file is produced by the JNI AutoWrapper Utility
Copyright (c) 2012 by EarthView Image Inc */
#include "mapcontrol/trackingimageitem.h"
#include <jni.h>
#include "core_java/global_reference.h"
#include "core_java/jni_load.h"
#include <typeinfo>
namespace EarthView
{
namespace World
{
namespace Spatial2D
{
namespace Controls
{
class JCTrackingImageItemProxy : public EarthView::World::Spatial2D::Controls::CTrackingImageItem
{
private:
EarthView::World::Core::ev_string m_boundingRect_void_callback;
EarthView::World::Core::ev_string m_paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback;
EarthView::World::Core::ev_string m_isContains_ev_real64_ev_real64_callback;
EarthView::World::Core::ev_string m_type_void_callback;
public:
JCTrackingImageItemProxy(EarthView::World::Core::CNameValuePairList *pList) : CTrackingImageItem(pList)
{
}
ev_void unRegisterJavaReference()
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)this->getJavaReference();
if(__gr != NULL)
{
delete __gr;
this->registerJavaReference(NULL);
}
}
public:
void register_boundingRect_void_callback(EarthView::World::Core::ev_string __method)
{
this->m_boundingRect_void_callback = __method;
}
void register_paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback(EarthView::World::Core::ev_string __method)
{
this->m_paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback = __method;
}
void register_isContains_ev_real64_ev_real64_callback(EarthView::World::Core::ev_string __method)
{
this->m_isContains_ev_real64_ev_real64_callback = __method;
}
void register_type_void_callback(EarthView::World::Core::ev_string __method)
{
this->m_type_void_callback = __method;
}
virtual EarthView::World::Spatial::Display::CSpatialRect boundingRect() const
{
if (this->_gRef != NULL && this->m_boundingRect_void_callback != "" && this->isCustomExtend())
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)this->getJavaReference();
JNIEnv * __env;
#if EV_PLATFORM == EV_PLATFORM_ANDROID
bool __jniAttachable = false;
if(EarthView::World::Core::JNILoad::getCachedJVM()->GetEnv((void **)&__env, JNI_VERSION_1_6) != JNI_OK)
{
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
__jniAttachable = true;
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
#endif
jobject __obj = __gr->getJObject();
jclass __clazz = __gr->getClass();
jmethodID __method = __gr->getMethod("boundingRect_void_callback");
jlong __values1_j = (jlong)__env->CallLongMethod(__obj, __method );
#if EV_PLATFORM == EV_PLATFORM_ANDROID
if(__jniAttachable)
{
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
#endif
EarthView::World::Spatial::Display::CSpatialRect __values1 = *(EarthView::World::Spatial::Display::CSpatialRect*) __values1_j;
return __values1;
}
else
{
return this->CTrackingImageItem::boundingRect();
}
}
virtual void paint(EarthView::World::Spatial::Display::ISpatialDisplay* display, const EarthView::World::Spatial2D::Controls::EVTrackingItemState& state, const EarthView::World::Spatial::Display::CSpatialRect& rect)
{
if (this->_gRef != NULL && this->m_paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback != "" && this->isCustomExtend())
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)this->getJavaReference();
JNIEnv * __env;
#if EV_PLATFORM == EV_PLATFORM_ANDROID
bool __jniAttachable = false;
if(EarthView::World::Core::JNILoad::getCachedJVM()->GetEnv((void **)&__env, JNI_VERSION_1_6) != JNI_OK)
{
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
__jniAttachable = true;
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
#endif
jobject __obj = __gr->getJObject();
jclass __clazz = __gr->getClass();
jlong display_j = (jlong) display;
jint state_j = (jint) state;
jlong rect_j = (jlong) ▭
jmethodID __method = __gr->getMethod("paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback");
__env->CallVoidMethod(__obj, __method , display_j, state_j, rect_j);
#if EV_PLATFORM == EV_PLATFORM_ANDROID
if(__jniAttachable)
{
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
#endif
}
else
{
return this->CTrackingImageItem::paint(display, state, rect);
}
}
virtual ev_int32 type() const
{
if (this->_gRef != NULL && this->m_type_void_callback != "" && this->isCustomExtend())
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)this->getJavaReference();
JNIEnv * __env;
#if EV_PLATFORM == EV_PLATFORM_ANDROID
bool __jniAttachable = false;
if(EarthView::World::Core::JNILoad::getCachedJVM()->GetEnv((void **)&__env, JNI_VERSION_1_6) != JNI_OK)
{
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
__jniAttachable = true;
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
#endif
jobject __obj = __gr->getJObject();
jclass __clazz = __gr->getClass();
jmethodID __method = __gr->getMethod("type_void_callback");
jint __values1_j = (jint)__env->CallIntMethod(__obj, __method );
#if EV_PLATFORM == EV_PLATFORM_ANDROID
if(__jniAttachable)
{
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
#endif
ev_int32 __values1 = (ev_int32) __values1_j;
return __values1;
}
else
{
return this->CTrackingImageItem::type();
}
}
virtual ev_bool isContains(ev_real64 x, ev_real64 y) const
{
if (this->_gRef != NULL && this->m_isContains_ev_real64_ev_real64_callback != "" && this->isCustomExtend())
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)this->getJavaReference();
JNIEnv * __env;
#if EV_PLATFORM == EV_PLATFORM_ANDROID
bool __jniAttachable = false;
if(EarthView::World::Core::JNILoad::getCachedJVM()->GetEnv((void **)&__env, JNI_VERSION_1_6) != JNI_OK)
{
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
__jniAttachable = true;
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->AttachCurrentThread((void **)&__env, NULL);
#endif
jobject __obj = __gr->getJObject();
jclass __clazz = __gr->getClass();
jdouble x_j = (jdouble) x;
jdouble y_j = (jdouble) y;
jmethodID __method = __gr->getMethod("isContains_ev_real64_ev_real64_callback");
jboolean __values1_j = (jboolean)__env->CallBooleanMethod(__obj, __method , x_j, y_j);
#if EV_PLATFORM == EV_PLATFORM_ANDROID
if(__jniAttachable)
{
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
}
#else
EarthView::World::Core::JNILoad::getCachedJVM()->DetachCurrentThread();
#endif
ev_bool __values1 = (ev_bool) __values1_j;
return __values1;
}
else
{
return this->CTrackingImageItem::isContains(x, y);
}
}
};
REGISTER_FACTORY_CLASS(JCTrackingImageItemProxy);
extern "C" JNIEXPORT jlong JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_boundingRect_1void(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
if (typeid(*pObjectX) == typeid(JCTrackingImageItemProxy))
{
EarthView::World::Spatial::Display::CSpatialRect __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::boundingRect();
EarthView::World::Spatial::Display::CSpatialRect *returnvalues = new EarthView::World::Spatial::Display::CSpatialRect(__values1);
((EarthView::World::Core::CBaseObject*)returnvalues)->setExternFree(true);
jlong __values1_j = (jlong) returnvalues;
return __values1_j;
}
else
{
EarthView::World::Spatial::Display::CSpatialRect __values1 = pObjectX->boundingRect();
EarthView::World::Spatial::Display::CSpatialRect *returnvalues = new EarthView::World::Spatial::Display::CSpatialRect(__values1);
((EarthView::World::Core::CBaseObject*)returnvalues)->setExternFree(true);
jlong __values1_j = (jlong) returnvalues;
return __values1_j;
}
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_register_1boundingRect_1void(JNIEnv *__env, jobject __thiz, jlong pObjXXXX, jstring __method)
{
JCTrackingImageItemProxy *pObjectX = (JCTrackingImageItemProxy*) pObjXXXX;
const char *pMethod = __env->GetStringUTFChars(__method, NULL);
EarthView::World::Core::ev_string sMethod = pMethod;
__env->ReleaseStringUTFChars(__method, pMethod);
pObjectX->register_boundingRect_void_callback(sMethod);
if (pObjectX->getJavaReference() != NULL && sMethod != "")
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)pObjectX->getJavaReference();
jobject __obj1 = __gr->getJObject();
jclass __clazz1 = __env->GetObjectClass(__obj1);
jmethodID __method = __env->GetMethodID(__clazz1,"boundingRect_void_callback", "()J");
__gr->setMethod(sMethod, __method);
}
}
extern "C" JNIEXPORT jlong JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_boundingRect_1void_1NoVirtual(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
EarthView::World::Spatial::Display::CSpatialRect __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::boundingRect();
EarthView::World::Spatial::Display::CSpatialRect *returnvalues = new EarthView::World::Spatial::Display::CSpatialRect(__values1);
((EarthView::World::Core::CBaseObject*)returnvalues)->setExternFree(true);
jlong __values1_j = (jlong) returnvalues;
return __values1_j;
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_paint_1ISpatialDisplay_1EVTrackingItemState_1CSpatialRect(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jlong display_j, jint state_j, jlong rect_j)
{
EarthView::World::Spatial::Display::ISpatialDisplay *display = (EarthView::World::Spatial::Display::ISpatialDisplay*) display_j;
const EarthView::World::Spatial2D::Controls::EVTrackingItemState state = (const EarthView::World::Spatial2D::Controls::EVTrackingItemState) state_j;
const EarthView::World::Spatial::Display::CSpatialRect &rect = *(EarthView::World::Spatial::Display::CSpatialRect*) rect_j;
EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
if (typeid(*pObjectX) == typeid(JCTrackingImageItemProxy))
{
pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::paint(display, state, rect);
}
else
{
pObjectX->paint(display, state, rect);
}
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_register_1paint_1ISpatialDisplay_1EVTrackingItemState_1CSpatialRect(JNIEnv *__env, jobject __thiz, jlong pObjXXXX, jstring __method)
{
JCTrackingImageItemProxy *pObjectX = (JCTrackingImageItemProxy*) pObjXXXX;
const char *pMethod = __env->GetStringUTFChars(__method, NULL);
EarthView::World::Core::ev_string sMethod = pMethod;
__env->ReleaseStringUTFChars(__method, pMethod);
pObjectX->register_paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback(sMethod);
if (pObjectX->getJavaReference() != NULL && sMethod != "")
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)pObjectX->getJavaReference();
jobject __obj1 = __gr->getJObject();
jclass __clazz1 = __env->GetObjectClass(__obj1);
jmethodID __method = __env->GetMethodID(__clazz1,"paint_ISpatialDisplay_EVTrackingItemState_CSpatialRect_callback", "(JIJ)V");
__gr->setMethod(sMethod, __method);
}
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_paint_1ISpatialDisplay_1EVTrackingItemState_1CSpatialRect_1NoVirtual(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jlong display_j, jint state_j, jlong rect_j)
{
EarthView::World::Spatial::Display::ISpatialDisplay *display = (EarthView::World::Spatial::Display::ISpatialDisplay*) display_j;
const EarthView::World::Spatial2D::Controls::EVTrackingItemState state = (const EarthView::World::Spatial2D::Controls::EVTrackingItemState) state_j;
const EarthView::World::Spatial::Display::CSpatialRect &rect = *(EarthView::World::Spatial::Display::CSpatialRect*) rect_j;
EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::paint(display, state, rect);
}
extern "C" JNIEXPORT jint JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_type_1void(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
if (typeid(*pObjectX) == typeid(JCTrackingImageItemProxy))
{
ev_int32 __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::type();
jint __values1_j = (jint)__values1;
return __values1_j;
}
else
{
ev_int32 __values1 = pObjectX->type();
jint __values1_j = (jint)__values1;
return __values1_j;
}
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_register_1type_1void(JNIEnv *__env, jobject __thiz, jlong pObjXXXX, jstring __method)
{
JCTrackingImageItemProxy *pObjectX = (JCTrackingImageItemProxy*) pObjXXXX;
const char *pMethod = __env->GetStringUTFChars(__method, NULL);
EarthView::World::Core::ev_string sMethod = pMethod;
__env->ReleaseStringUTFChars(__method, pMethod);
pObjectX->register_type_void_callback(sMethod);
if (pObjectX->getJavaReference() != NULL && sMethod != "")
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)pObjectX->getJavaReference();
jobject __obj1 = __gr->getJObject();
jclass __clazz1 = __env->GetObjectClass(__obj1);
jmethodID __method = __env->GetMethodID(__clazz1,"type_void_callback", "()I");
__gr->setMethod(sMethod, __method);
}
}
extern "C" JNIEXPORT jint JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_type_1void_1NoVirtual(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
ev_int32 __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::type();
jint __values1_j = (jint)__values1;
return __values1_j;
}
extern "C" JNIEXPORT jboolean JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_isContains_1ev_1real64_1ev_1real64(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jdouble x_j, jdouble y_j)
{
ev_real64 x = (ev_real64) x_j;
ev_real64 y = (ev_real64) y_j;
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
if (typeid(*pObjectX) == typeid(JCTrackingImageItemProxy))
{
ev_bool __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::isContains(x, y);
jboolean __values1_j = (jboolean)__values1;
return __values1_j;
}
else
{
ev_bool __values1 = pObjectX->isContains(x, y);
jboolean __values1_j = (jboolean)__values1;
return __values1_j;
}
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_register_1isContains_1ev_1real64_1ev_1real64(JNIEnv *__env, jobject __thiz, jlong pObjXXXX, jstring __method)
{
JCTrackingImageItemProxy *pObjectX = (JCTrackingImageItemProxy*) pObjXXXX;
const char *pMethod = __env->GetStringUTFChars(__method, NULL);
EarthView::World::Core::ev_string sMethod = pMethod;
__env->ReleaseStringUTFChars(__method, pMethod);
pObjectX->register_isContains_ev_real64_ev_real64_callback(sMethod);
if (pObjectX->getJavaReference() != NULL && sMethod != "")
{
EarthView::World::Core::GlobalReference *__gr = (EarthView::World::Core::GlobalReference *)pObjectX->getJavaReference();
jobject __obj1 = __gr->getJObject();
jclass __clazz1 = __env->GetObjectClass(__obj1);
jmethodID __method = __env->GetMethodID(__clazz1,"isContains_ev_real64_ev_real64_callback", "(DD)Z");
__gr->setMethod(sMethod, __method);
}
}
extern "C" JNIEXPORT jboolean JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_isContains_1ev_1real64_1ev_1real64_1NoVirtual(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jdouble x_j, jdouble y_j)
{
ev_real64 x = (ev_real64) x_j;
ev_real64 y = (ev_real64) y_j;
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
ev_bool __values1 = pObjectX->EarthView::World::Spatial2D::Controls::CTrackingImageItem::isContains(x, y);
jboolean __values1_j = (jboolean)__values1;
return __values1_j;
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_setImage_1IBitmap(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jlong bitmap_j)
{
const EarthView::World::Display::IBitmap *bitmap = (const EarthView::World::Display::IBitmap*) bitmap_j;
EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
pObjectX->setImage(bitmap);
}
extern "C" JNIEXPORT jlong JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_getImageRef_1void(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
EarthView::World::Display::IBitmap* __values1 = pObjectX->getImageRef();
jlong __values1_j = (jlong) __values1;
return __values1_j;
}
extern "C" JNIEXPORT void JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_setRotation_1ev_1real64(JNIEnv *__env , jobject __thiz, jlong pObjXXXX, jdouble rotation_j)
{
ev_real64 rotation = (ev_real64) rotation_j;
EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
pObjectX->setRotation(rotation);
}
extern "C" JNIEXPORT jdouble JNICALL Java_com_earthview_world_spatial2d_controls_TrackingImageItem_getRotation_1void(JNIEnv *__env , jobject __thiz, jlong pObjXXXX)
{
const EarthView::World::Spatial2D::Controls::CTrackingImageItem *pObjectX = (EarthView::World::Spatial2D::Controls::CTrackingImageItem*) pObjXXXX;
ev_real64 __values1 = pObjectX->getRotation();
jdouble __values1_j = (jdouble)__values1;
return __values1_j;
}
}
}
}
}
| [
"yanguanqi@aliyun.com"
] | yanguanqi@aliyun.com |
c99e16472215c214199fcdbdce72bd9936ecbc71 | 8567438779e6af0754620a25d379c348e4cd5a5d | /base/third_party/symbolize/symbolize.cc | 0932e64abdd48adafb8dde6873f3ea4ae3c0a398 | [
"BSD-3-Clause"
] | permissive | thngkaiyuan/chromium | c389ac4b50ccba28ee077cbf6115c41b547955ae | dab56a4a71f87f64ecc0044e97b4a8f247787a68 | refs/heads/master | 2022-11-10T02:50:29.326119 | 2017-04-08T12:28:57 | 2017-04-08T12:28:57 | 84,073,924 | 0 | 1 | BSD-3-Clause | 2022-10-25T19:47:15 | 2017-03-06T13:04:15 | null | UTF-8 | C++ | false | false | 29,993 | cc | // Copyright (c) 2006, Google 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 Google 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
// OWNER 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.
//
// Author: Satoru Takabayashi
// Stack-footprint reduction work done by Raksit Ashok
//
// Implementation note:
//
// We don't use heaps but only use stacks. We want to reduce the
// stack consumption so that the symbolizer can run on small stacks.
//
// Here are some numbers collected with GCC 4.1.0 on x86:
// - sizeof(Elf32_Sym) = 16
// - sizeof(Elf32_Shdr) = 40
// - sizeof(Elf64_Sym) = 24
// - sizeof(Elf64_Shdr) = 64
//
// This implementation is intended to be async-signal-safe but uses
// some functions which are not guaranteed to be so, such as memchr()
// and memmove(). We assume they are async-signal-safe.
//
// Additional header can be specified by the GLOG_BUILD_CONFIG_INCLUDE
// macro to add platform specific defines (e.g. OS_OPENBSD).
#ifdef GLOG_BUILD_CONFIG_INCLUDE
#include GLOG_BUILD_CONFIG_INCLUDE
#endif // GLOG_BUILD_CONFIG_INCLUDE
#include "utilities.h"
#if defined(HAVE_SYMBOLIZE)
#include <algorithm>
#include <limits>
#include "symbolize.h"
#include "demangle.h"
_START_GOOGLE_NAMESPACE_
// We don't use assert() since it's not guaranteed to be
// async-signal-safe. Instead we define a minimal assertion
// macro. So far, we don't need pretty printing for __FILE__, etc.
// A wrapper for abort() to make it callable in ? :.
static int AssertFail() {
abort();
return 0; // Should not reach.
}
#define SAFE_ASSERT(expr) ((expr) ? 0 : AssertFail())
static SymbolizeCallback g_symbolize_callback = NULL;
void InstallSymbolizeCallback(SymbolizeCallback callback) {
g_symbolize_callback = callback;
}
static SymbolizeOpenObjectFileCallback g_symbolize_open_object_file_callback =
NULL;
void InstallSymbolizeOpenObjectFileCallback(
SymbolizeOpenObjectFileCallback callback) {
g_symbolize_open_object_file_callback = callback;
}
// This function wraps the Demangle function to provide an interface
// where the input symbol is demangled in-place.
// To keep stack consumption low, we would like this function to not
// get inlined.
static ATTRIBUTE_NOINLINE void DemangleInplace(char *out, int out_size) {
char demangled[256]; // Big enough for sane demangled symbols.
if (Demangle(out, demangled, sizeof(demangled))) {
// Demangling succeeded. Copy to out if the space allows.
size_t len = strlen(demangled);
if (len + 1 <= (size_t)out_size) { // +1 for '\0'.
SAFE_ASSERT(len < sizeof(demangled));
memmove(out, demangled, len + 1);
}
}
}
_END_GOOGLE_NAMESPACE_
#if defined(__ELF__)
#include <dlfcn.h>
#if defined(OS_OPENBSD)
#include <sys/exec_elf.h>
#else
#include <elf.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "symbolize.h"
#include "config.h"
#include "glog/raw_logging.h"
// Re-runs fn until it doesn't cause EINTR.
#define NO_INTR(fn) do {} while ((fn) < 0 && errno == EINTR)
_START_GOOGLE_NAMESPACE_
// Read up to "count" bytes from file descriptor "fd" into the buffer
// starting at "buf" while handling short reads and EINTR. On
// success, return the number of bytes read. Otherwise, return -1.
static ssize_t ReadPersistent(const int fd, void *buf, const size_t count) {
SAFE_ASSERT(fd >= 0);
SAFE_ASSERT(count <= std::numeric_limits<ssize_t>::max());
char *buf0 = reinterpret_cast<char *>(buf);
ssize_t num_bytes = 0;
while (num_bytes < count) {
ssize_t len;
NO_INTR(len = read(fd, buf0 + num_bytes, count - num_bytes));
if (len < 0) { // There was an error other than EINTR.
return -1;
}
if (len == 0) { // Reached EOF.
break;
}
num_bytes += len;
}
SAFE_ASSERT(num_bytes <= count);
return num_bytes;
}
// Read up to "count" bytes from "offset" in the file pointed by file
// descriptor "fd" into the buffer starting at "buf". On success,
// return the number of bytes read. Otherwise, return -1.
static ssize_t ReadFromOffset(const int fd, void *buf,
const size_t count, const off_t offset) {
off_t off = lseek(fd, offset, SEEK_SET);
if (off == (off_t)-1) {
return -1;
}
return ReadPersistent(fd, buf, count);
}
// Try reading exactly "count" bytes from "offset" bytes in a file
// pointed by "fd" into the buffer starting at "buf" while handling
// short reads and EINTR. On success, return true. Otherwise, return
// false.
static bool ReadFromOffsetExact(const int fd, void *buf,
const size_t count, const off_t offset) {
ssize_t len = ReadFromOffset(fd, buf, count, offset);
return len == count;
}
// Returns elf_header.e_type if the file pointed by fd is an ELF binary.
static int FileGetElfType(const int fd) {
ElfW(Ehdr) elf_header;
if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
return -1;
}
if (memcmp(elf_header.e_ident, ELFMAG, SELFMAG) != 0) {
return -1;
}
return elf_header.e_type;
}
// Read the section headers in the given ELF binary, and if a section
// of the specified type is found, set the output to this section header
// and return true. Otherwise, return false.
// To keep stack consumption low, we would like this function to not get
// inlined.
static ATTRIBUTE_NOINLINE bool
GetSectionHeaderByType(const int fd, ElfW(Half) sh_num, const off_t sh_offset,
ElfW(Word) type, ElfW(Shdr) *out) {
// Read at most 16 section headers at a time to save read calls.
ElfW(Shdr) buf[16];
for (int i = 0; i < sh_num;) {
const ssize_t num_bytes_left = (sh_num - i) * sizeof(buf[0]);
const ssize_t num_bytes_to_read =
(sizeof(buf) > num_bytes_left) ? num_bytes_left : sizeof(buf);
const ssize_t len = ReadFromOffset(fd, buf, num_bytes_to_read,
sh_offset + i * sizeof(buf[0]));
SAFE_ASSERT(len % sizeof(buf[0]) == 0);
const ssize_t num_headers_in_buf = len / sizeof(buf[0]);
SAFE_ASSERT(num_headers_in_buf <= sizeof(buf) / sizeof(buf[0]));
for (int j = 0; j < num_headers_in_buf; ++j) {
if (buf[j].sh_type == type) {
*out = buf[j];
return true;
}
}
i += num_headers_in_buf;
}
return false;
}
// There is no particular reason to limit section name to 63 characters,
// but there has (as yet) been no need for anything longer either.
const int kMaxSectionNameLen = 64;
// name_len should include terminating '\0'.
bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
ElfW(Shdr) *out) {
ElfW(Ehdr) elf_header;
if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
return false;
}
ElfW(Shdr) shstrtab;
off_t shstrtab_offset = (elf_header.e_shoff +
elf_header.e_shentsize * elf_header.e_shstrndx);
if (!ReadFromOffsetExact(fd, &shstrtab, sizeof(shstrtab), shstrtab_offset)) {
return false;
}
for (int i = 0; i < elf_header.e_shnum; ++i) {
off_t section_header_offset = (elf_header.e_shoff +
elf_header.e_shentsize * i);
if (!ReadFromOffsetExact(fd, out, sizeof(*out), section_header_offset)) {
return false;
}
char header_name[kMaxSectionNameLen];
if (sizeof(header_name) < name_len) {
RAW_LOG(WARNING, "Section name '%s' is too long (%" PRIuS "); "
"section will not be found (even if present).", name, name_len);
// No point in even trying.
return false;
}
off_t name_offset = shstrtab.sh_offset + out->sh_name;
ssize_t n_read = ReadFromOffset(fd, &header_name, name_len, name_offset);
if (n_read == -1) {
return false;
} else if (n_read != name_len) {
// Short read -- name could be at end of file.
continue;
}
if (memcmp(header_name, name, name_len) == 0) {
return true;
}
}
return false;
}
// Read a symbol table and look for the symbol containing the
// pc. Iterate over symbols in a symbol table and look for the symbol
// containing "pc". On success, return true and write the symbol name
// to out. Otherwise, return false.
// To keep stack consumption low, we would like this function to not get
// inlined.
static ATTRIBUTE_NOINLINE bool
FindSymbol(uint64_t pc, const int fd, char *out, int out_size,
uint64_t symbol_offset, const ElfW(Shdr) *strtab,
const ElfW(Shdr) *symtab) {
if (symtab == NULL) {
return false;
}
const int num_symbols = symtab->sh_size / symtab->sh_entsize;
for (int i = 0; i < num_symbols;) {
off_t offset = symtab->sh_offset + i * symtab->sh_entsize;
// If we are reading Elf64_Sym's, we want to limit this array to
// 32 elements (to keep stack consumption low), otherwise we can
// have a 64 element Elf32_Sym array.
#if __WORDSIZE == 64
#define NUM_SYMBOLS 32
#else
#define NUM_SYMBOLS 64
#endif
// Read at most NUM_SYMBOLS symbols at once to save read() calls.
ElfW(Sym) buf[NUM_SYMBOLS];
int num_symbols_to_read = std::min(NUM_SYMBOLS, num_symbols - i);
const ssize_t len =
ReadFromOffset(fd, &buf, sizeof(buf[0]) * num_symbols_to_read, offset);
SAFE_ASSERT(len % sizeof(buf[0]) == 0);
const ssize_t num_symbols_in_buf = len / sizeof(buf[0]);
SAFE_ASSERT(num_symbols_in_buf <= num_symbols_to_read);
for (int j = 0; j < num_symbols_in_buf; ++j) {
const ElfW(Sym)& symbol = buf[j];
uint64_t start_address = symbol.st_value;
start_address += symbol_offset;
uint64_t end_address = start_address + symbol.st_size;
if (symbol.st_value != 0 && // Skip null value symbols.
symbol.st_shndx != 0 && // Skip undefined symbols.
start_address <= pc && pc < end_address) {
ssize_t len1 = ReadFromOffset(fd, out, out_size,
strtab->sh_offset + symbol.st_name);
if (len1 <= 0 || memchr(out, '\0', out_size) == NULL) {
return false;
}
return true; // Obtained the symbol name.
}
}
i += num_symbols_in_buf;
}
return false;
}
// Get the symbol name of "pc" from the file pointed by "fd". Process
// both regular and dynamic symbol tables if necessary. On success,
// write the symbol name to "out" and return true. Otherwise, return
// false.
static bool GetSymbolFromObjectFile(const int fd, uint64_t pc,
char *out, int out_size,
uint64_t map_base_address) {
// Read the ELF header.
ElfW(Ehdr) elf_header;
if (!ReadFromOffsetExact(fd, &elf_header, sizeof(elf_header), 0)) {
return false;
}
uint64_t symbol_offset = 0;
if (elf_header.e_type == ET_DYN) { // DSO needs offset adjustment.
ElfW(Phdr) phdr;
// We need to find the PT_LOAD segment corresponding to the read-execute
// file mapping in order to correctly perform the offset adjustment.
for (unsigned i = 0; i != elf_header.e_phnum; ++i) {
if (!ReadFromOffsetExact(fd, &phdr, sizeof(phdr),
elf_header.e_phoff + i * sizeof(phdr)))
return false;
if (phdr.p_type == PT_LOAD &&
(phdr.p_flags & (PF_R | PF_X)) == (PF_R | PF_X)) {
// Find the mapped address corresponding to virtual address zero. We do
// this by first adding p_offset. This gives us the mapped address of
// the start of the segment, or in other words the mapped address
// corresponding to the virtual address of the segment. (Note that this
// is distinct from the start address, as p_offset is not guaranteed to
// be page aligned.) We then subtract p_vaddr, which takes us to virtual
// address zero.
symbol_offset = map_base_address + phdr.p_offset - phdr.p_vaddr;
break;
}
}
if (symbol_offset == 0)
return false;
}
ElfW(Shdr) symtab, strtab;
// Consult a regular symbol table first.
if (GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
SHT_SYMTAB, &symtab)) {
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
symtab.sh_link * sizeof(symtab))) {
return false;
}
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
&strtab, &symtab)) {
return true; // Found the symbol in a regular symbol table.
}
}
// If the symbol is not found, then consult a dynamic symbol table.
if (GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
SHT_DYNSYM, &symtab)) {
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
symtab.sh_link * sizeof(symtab))) {
return false;
}
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
&strtab, &symtab)) {
return true; // Found the symbol in a dynamic symbol table.
}
}
return false;
}
namespace {
// Thin wrapper around a file descriptor so that the file descriptor
// gets closed for sure.
struct FileDescriptor {
const int fd_;
explicit FileDescriptor(int fd) : fd_(fd) {}
~FileDescriptor() {
if (fd_ >= 0) {
NO_INTR(close(fd_));
}
}
int get() { return fd_; }
private:
explicit FileDescriptor(const FileDescriptor&);
void operator=(const FileDescriptor&);
};
// Helper class for reading lines from file.
//
// Note: we don't use ProcMapsIterator since the object is big (it has
// a 5k array member) and uses async-unsafe functions such as sscanf()
// and snprintf().
class LineReader {
public:
explicit LineReader(int fd, char *buf, int buf_len) : fd_(fd),
buf_(buf), buf_len_(buf_len), bol_(buf), eol_(buf), eod_(buf) {
}
// Read '\n'-terminated line from file. On success, modify "bol"
// and "eol", then return true. Otherwise, return false.
//
// Note: if the last line doesn't end with '\n', the line will be
// dropped. It's an intentional behavior to make the code simple.
bool ReadLine(const char **bol, const char **eol) {
if (BufferIsEmpty()) { // First time.
const ssize_t num_bytes = ReadPersistent(fd_, buf_, buf_len_);
if (num_bytes <= 0) { // EOF or error.
return false;
}
eod_ = buf_ + num_bytes;
bol_ = buf_;
} else {
bol_ = eol_ + 1; // Advance to the next line in the buffer.
SAFE_ASSERT(bol_ <= eod_); // "bol_" can point to "eod_".
if (!HasCompleteLine()) {
const int incomplete_line_length = eod_ - bol_;
// Move the trailing incomplete line to the beginning.
memmove(buf_, bol_, incomplete_line_length);
// Read text from file and append it.
char * const append_pos = buf_ + incomplete_line_length;
const int capacity_left = buf_len_ - incomplete_line_length;
const ssize_t num_bytes = ReadPersistent(fd_, append_pos,
capacity_left);
if (num_bytes <= 0) { // EOF or error.
return false;
}
eod_ = append_pos + num_bytes;
bol_ = buf_;
}
}
eol_ = FindLineFeed();
if (eol_ == NULL) { // '\n' not found. Malformed line.
return false;
}
*eol_ = '\0'; // Replace '\n' with '\0'.
*bol = bol_;
*eol = eol_;
return true;
}
// Beginning of line.
const char *bol() {
return bol_;
}
// End of line.
const char *eol() {
return eol_;
}
private:
explicit LineReader(const LineReader&);
void operator=(const LineReader&);
char *FindLineFeed() {
return reinterpret_cast<char *>(memchr(bol_, '\n', eod_ - bol_));
}
bool BufferIsEmpty() {
return buf_ == eod_;
}
bool HasCompleteLine() {
return !BufferIsEmpty() && FindLineFeed() != NULL;
}
const int fd_;
char * const buf_;
const int buf_len_;
char *bol_;
char *eol_;
const char *eod_; // End of data in "buf_".
};
} // namespace
// Place the hex number read from "start" into "*hex". The pointer to
// the first non-hex character or "end" is returned.
static char *GetHex(const char *start, const char *end, uint64_t *hex) {
*hex = 0;
const char *p;
for (p = start; p < end; ++p) {
int ch = *p;
if ((ch >= '0' && ch <= '9') ||
(ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) {
*hex = (*hex << 4) | (ch < 'A' ? ch - '0' : (ch & 0xF) + 9);
} else { // Encountered the first non-hex character.
break;
}
}
SAFE_ASSERT(p <= end);
return const_cast<char *>(p);
}
// Searches for the object file (from /proc/self/maps) that contains
// the specified pc. If found, sets |start_address| to the start address
// of where this object file is mapped in memory, sets the module base
// address into |base_address|, copies the object file name into
// |out_file_name|, and attempts to open the object file. If the object
// file is opened successfully, returns the file descriptor. Otherwise,
// returns -1. |out_file_name_size| is the size of the file name buffer
// (including the null-terminator).
static ATTRIBUTE_NOINLINE int
OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
uint64_t &start_address,
uint64_t &base_address,
char *out_file_name,
int out_file_name_size) {
int object_fd;
// Open /proc/self/maps.
int maps_fd;
NO_INTR(maps_fd = open("/proc/self/maps", O_RDONLY));
FileDescriptor wrapped_maps_fd(maps_fd);
if (wrapped_maps_fd.get() < 0) {
return -1;
}
// Iterate over maps and look for the map containing the pc. Then
// look into the symbol tables inside.
char buf[1024]; // Big enough for line of sane /proc/self/maps
int num_maps = 0;
LineReader reader(wrapped_maps_fd.get(), buf, sizeof(buf));
while (true) {
num_maps++;
const char *cursor;
const char *eol;
if (!reader.ReadLine(&cursor, &eol)) { // EOF or malformed line.
return -1;
}
// Start parsing line in /proc/self/maps. Here is an example:
//
// 08048000-0804c000 r-xp 00000000 08:01 2142121 /bin/cat
//
// We want start address (08048000), end address (0804c000), flags
// (r-xp) and file name (/bin/cat).
// Read start address.
cursor = GetHex(cursor, eol, &start_address);
if (cursor == eol || *cursor != '-') {
return -1; // Malformed line.
}
++cursor; // Skip '-'.
// Read end address.
uint64_t end_address;
cursor = GetHex(cursor, eol, &end_address);
if (cursor == eol || *cursor != ' ') {
return -1; // Malformed line.
}
++cursor; // Skip ' '.
// Check start and end addresses.
if (!(start_address <= pc && pc < end_address)) {
continue; // We skip this map. PC isn't in this map.
}
// Read flags. Skip flags until we encounter a space or eol.
const char * const flags_start = cursor;
while (cursor < eol && *cursor != ' ') {
++cursor;
}
// We expect at least four letters for flags (ex. "r-xp").
if (cursor == eol || cursor < flags_start + 4) {
return -1; // Malformed line.
}
// Check flags. We are only interested in "r-x" maps.
if (memcmp(flags_start, "r-x", 3) != 0) { // Not a "r-x" map.
continue; // We skip this map.
}
++cursor; // Skip ' '.
// Read file offset.
uint64_t file_offset;
cursor = GetHex(cursor, eol, &file_offset);
if (cursor == eol || *cursor != ' ') {
return -1; // Malformed line.
}
++cursor; // Skip ' '.
// Don't subtract 'start_address' from the first entry:
// * If a binary is compiled w/o -pie, then the first entry in
// process maps is likely the binary itself (all dynamic libs
// are mapped higher in address space). For such a binary,
// instruction offset in binary coincides with the actual
// instruction address in virtual memory (as code section
// is mapped to a fixed memory range).
// * If a binary is compiled with -pie, all the modules are
// mapped high at address space (in particular, higher than
// shadow memory of the tool), so the module can't be the
// first entry.
base_address = ((num_maps == 1) ? 0U : start_address) - file_offset;
// Skip to file name. "cursor" now points to dev. We need to
// skip at least two spaces for dev and inode.
int num_spaces = 0;
while (cursor < eol) {
if (*cursor == ' ') {
++num_spaces;
} else if (num_spaces >= 2) {
// The first non-space character after skipping two spaces
// is the beginning of the file name.
break;
}
++cursor;
}
if (cursor == eol) {
return -1; // Malformed line.
}
// Finally, "cursor" now points to file name of our interest.
NO_INTR(object_fd = open(cursor, O_RDONLY));
if (object_fd < 0) {
// Failed to open object file. Copy the object file name to
// |out_file_name|.
strncpy(out_file_name, cursor, out_file_name_size);
// Making sure |out_file_name| is always null-terminated.
out_file_name[out_file_name_size - 1] = '\0';
return -1;
}
return object_fd;
}
}
// POSIX doesn't define any async-signal safe function for converting
// an integer to ASCII. We'll have to define our own version.
// itoa_r() converts a (signed) integer to ASCII. It returns "buf", if the
// conversion was successful or NULL otherwise. It never writes more than "sz"
// bytes. Output will be truncated as needed, and a NUL character is always
// appended.
// NOTE: code from sandbox/linux/seccomp-bpf/demo.cc.
char *itoa_r(intptr_t i, char *buf, size_t sz, int base, size_t padding) {
// Make sure we can write at least one NUL byte.
size_t n = 1;
if (n > sz)
return NULL;
if (base < 2 || base > 16) {
buf[0] = '\000';
return NULL;
}
char *start = buf;
uintptr_t j = i;
// Handle negative numbers (only for base 10).
if (i < 0 && base == 10) {
// This does "j = -i" while avoiding integer overflow.
j = static_cast<uintptr_t>(-(i + 1)) + 1;
// Make sure we can write the '-' character.
if (++n > sz) {
buf[0] = '\000';
return NULL;
}
*start++ = '-';
}
// Loop until we have converted the entire number. Output at least one
// character (i.e. '0').
char *ptr = start;
do {
// Make sure there is still enough space left in our output buffer.
if (++n > sz) {
buf[0] = '\000';
return NULL;
}
// Output the next digit.
*ptr++ = "0123456789abcdef"[j % base];
j /= base;
if (padding > 0)
padding--;
} while (j > 0 || padding > 0);
// Terminate the output with a NUL character.
*ptr = '\000';
// Conversion to ASCII actually resulted in the digits being in reverse
// order. We can't easily generate them in forward order, as we can't tell
// the number of characters needed until we are done converting.
// So, now, we reverse the string (except for the possible "-" sign).
while (--ptr > start) {
char ch = *ptr;
*ptr = *start;
*start++ = ch;
}
return buf;
}
// Safely appends string |source| to string |dest|. Never writes past the
// buffer size |dest_size| and guarantees that |dest| is null-terminated.
void SafeAppendString(const char* source, char* dest, int dest_size) {
int dest_string_length = strlen(dest);
SAFE_ASSERT(dest_string_length < dest_size);
dest += dest_string_length;
dest_size -= dest_string_length;
strncpy(dest, source, dest_size);
// Making sure |dest| is always null-terminated.
dest[dest_size - 1] = '\0';
}
// Converts a 64-bit value into a hex string, and safely appends it to |dest|.
// Never writes past the buffer size |dest_size| and guarantees that |dest| is
// null-terminated.
void SafeAppendHexNumber(uint64_t value, char* dest, int dest_size) {
// 64-bit numbers in hex can have up to 16 digits.
char buf[17] = {'\0'};
SafeAppendString(itoa_r(value, buf, sizeof(buf), 16, 0), dest, dest_size);
}
// The implementation of our symbolization routine. If it
// successfully finds the symbol containing "pc" and obtains the
// symbol name, returns true and write the symbol name to "out".
// Otherwise, returns false. If Callback function is installed via
// InstallSymbolizeCallback(), the function is also called in this function,
// and "out" is used as its output.
// To keep stack consumption low, we would like this function to not
// get inlined.
static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out,
int out_size) {
uint64_t pc0 = reinterpret_cast<uintptr_t>(pc);
uint64_t start_address = 0;
uint64_t base_address = 0;
int object_fd = -1;
if (out_size < 1) {
return false;
}
out[0] = '\0';
SafeAppendString("(", out, out_size);
if (g_symbolize_open_object_file_callback) {
object_fd = g_symbolize_open_object_file_callback(pc0, start_address,
base_address, out + 1,
out_size - 1);
} else {
object_fd = OpenObjectFileContainingPcAndGetStartAddress(pc0, start_address,
base_address,
out + 1,
out_size - 1);
}
// Check whether a file name was returned.
if (object_fd < 0) {
if (out[1]) {
// The object file containing PC was determined successfully however the
// object file was not opened successfully. This is still considered
// success because the object file name and offset are known and tools
// like asan_symbolize.py can be used for the symbolization.
out[out_size - 1] = '\0'; // Making sure |out| is always null-terminated.
SafeAppendString("+0x", out, out_size);
SafeAppendHexNumber(pc0 - base_address, out, out_size);
SafeAppendString(")", out, out_size);
return true;
}
// Failed to determine the object file containing PC. Bail out.
return false;
}
FileDescriptor wrapped_object_fd(object_fd);
int elf_type = FileGetElfType(wrapped_object_fd.get());
if (elf_type == -1) {
return false;
}
if (g_symbolize_callback) {
// Run the call back if it's installed.
// Note: relocation (and much of the rest of this code) will be
// wrong for prelinked shared libraries and PIE executables.
uint64_t relocation = (elf_type == ET_DYN) ? start_address : 0;
int num_bytes_written = g_symbolize_callback(wrapped_object_fd.get(),
pc, out, out_size,
relocation);
if (num_bytes_written > 0) {
out += num_bytes_written;
out_size -= num_bytes_written;
}
}
if (!GetSymbolFromObjectFile(wrapped_object_fd.get(), pc0,
out, out_size, base_address)) {
return false;
}
// Symbolization succeeded. Now we try to demangle the symbol.
DemangleInplace(out, out_size);
return true;
}
_END_GOOGLE_NAMESPACE_
#elif defined(OS_MACOSX) && defined(HAVE_DLADDR)
#include <dlfcn.h>
#include <string.h>
_START_GOOGLE_NAMESPACE_
static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out,
int out_size) {
Dl_info info;
if (dladdr(pc, &info)) {
if ((int)strlen(info.dli_sname) < out_size) {
strcpy(out, info.dli_sname);
// Symbolization succeeded. Now we try to demangle the symbol.
DemangleInplace(out, out_size);
return true;
}
}
return false;
}
_END_GOOGLE_NAMESPACE_
#else
# error BUG: HAVE_SYMBOLIZE was wrongly set
#endif
_START_GOOGLE_NAMESPACE_
bool Symbolize(void *pc, char *out, int out_size) {
SAFE_ASSERT(out_size >= 0);
return SymbolizeAndDemangle(pc, out, out_size);
}
_END_GOOGLE_NAMESPACE_
#else /* HAVE_SYMBOLIZE */
#include <assert.h>
#include "config.h"
_START_GOOGLE_NAMESPACE_
// TODO: Support other environments.
bool Symbolize(void *pc, char *out, int out_size) {
assert(0);
return false;
}
_END_GOOGLE_NAMESPACE_
#endif
| [
"hedonist.ky@gmail.com"
] | hedonist.ky@gmail.com |
fbb0ae60e460717aa04e94c9a781a6c2e8698d0b | 0c305c0685a4812442a0f1deadad40367d312d76 | /src/robot_utilities/include/robot_utilities/irb2600.cpp | 6a65b46a83133862fdb1a3b8fa2a2fd0a89d4bc6 | [
"BSD-2-Clause"
] | permissive | 0000duck/cartesian_planner | 4072c1a9acf60147c7cc7090b245a5ad1f330575 | be3dbca18d7cd0dd4f2496231cc951cc3503fde3 | refs/heads/master | 2023-03-18T16:21:53.981577 | 2021-02-11T23:02:51 | 2021-02-11T23:02:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 298,494 | cpp | /// autogenerated analytical inverse kinematics code from ikfast program part of OpenRAVE
/// \author Rosen Diankov
///
/// 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.
///
/// ikfast version 0x10000049 generated on 2020-04-10 11:42:46.934178
/// To compile with gcc:
/// gcc -lstdc++ ik.cpp
/// To compile without any main function as a shared object (might need -llapack):
/// gcc -fPIC -lstdc++ -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -shared -Wl,-soname,libik.so -o libik.so ik.cpp
#define IKFAST_HAS_LIBRARY
#include "ikfast.h" // found inside share/openrave-X.Y/python/ikfast.h
using namespace ikfast;
// check if the included ikfast version matches what this file was compiled with
#define IKFAST_COMPILE_ASSERT(x) extern int __dummy[(int)x]
IKFAST_COMPILE_ASSERT(IKFAST_VERSION==0x10000049);
#include <cmath>
#include <vector>
#include <limits>
#include <algorithm>
#include <complex>
#ifndef IKFAST_ASSERT
#include <stdexcept>
#include <sstream>
#include <iostream>
#ifdef _MSC_VER
#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __FUNCDNAME__
#endif
#endif
#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __func__
#endif
#define IKFAST_ASSERT(b) { if( !(b) ) { std::stringstream ss; ss << "ikfast exception: " << __FILE__ << ":" << __LINE__ << ": " <<__PRETTY_FUNCTION__ << ": Assertion '" << #b << "' failed"; throw std::runtime_error(ss.str()); } }
#endif
#if defined(_MSC_VER)
#define IKFAST_ALIGNED16(x) __declspec(align(16)) x
#else
#define IKFAST_ALIGNED16(x) x __attribute((aligned(16)))
#endif
#define IK2PI ((IkReal)6.28318530717959)
#define IKPI ((IkReal)3.14159265358979)
#define IKPI_2 ((IkReal)1.57079632679490)
#ifdef _MSC_VER
#ifndef isnan
#define isnan _isnan
#endif
#ifndef isinf
#define isinf _isinf
#endif
//#ifndef isfinite
//#define isfinite _isfinite
//#endif
#endif // _MSC_VER
// lapack routines
extern "C" {
void dgetrf_ (const int* m, const int* n, double* a, const int* lda, int* ipiv, int* info);
void zgetrf_ (const int* m, const int* n, std::complex<double>* a, const int* lda, int* ipiv, int* info);
void dgetri_(const int* n, const double* a, const int* lda, int* ipiv, double* work, const int* lwork, int* info);
void dgesv_ (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info);
void dgetrs_(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info);
void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi,double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info);
}
using namespace std; // necessary to get std math routines
#ifdef IKFAST_NAMESPACE
namespace IKFAST_NAMESPACE {
#endif
inline float IKabs(float f) { return fabsf(f); }
inline double IKabs(double f) { return fabs(f); }
inline float IKsqr(float f) { return f*f; }
inline double IKsqr(double f) { return f*f; }
inline float IKlog(float f) { return logf(f); }
inline double IKlog(double f) { return log(f); }
// allows asin and acos to exceed 1. has to be smaller than thresholds used for branch conds and evaluation
#ifndef IKFAST_SINCOS_THRESH
#define IKFAST_SINCOS_THRESH ((IkReal)1e-7)
#endif
// used to check input to atan2 for degenerate cases. has to be smaller than thresholds used for branch conds and evaluation
#ifndef IKFAST_ATAN2_MAGTHRESH
#define IKFAST_ATAN2_MAGTHRESH ((IkReal)1e-7)
#endif
// minimum distance of separate solutions
#ifndef IKFAST_SOLUTION_THRESH
#define IKFAST_SOLUTION_THRESH ((IkReal)1e-6)
#endif
// there are checkpoints in ikfast that are evaluated to make sure they are 0. This threshold speicfies by how much they can deviate
#ifndef IKFAST_EVALCOND_THRESH
#define IKFAST_EVALCOND_THRESH ((IkReal)0.00001)
#endif
inline float IKasin(float f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return float(-IKPI_2);
else if( f >= 1 ) return float(IKPI_2);
return asinf(f);
}
inline double IKasin(double f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return -IKPI_2;
else if( f >= 1 ) return IKPI_2;
return asin(f);
}
// return positive value in [0,y)
inline float IKfmod(float x, float y)
{
while(x < 0) {
x += y;
}
return fmodf(x,y);
}
// return positive value in [0,y)
inline double IKfmod(double x, double y)
{
while(x < 0) {
x += y;
}
return fmod(x,y);
}
inline float IKacos(float f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return float(IKPI);
else if( f >= 1 ) return float(0);
return acosf(f);
}
inline double IKacos(double f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return IKPI;
else if( f >= 1 ) return 0;
return acos(f);
}
inline float IKsin(float f) { return sinf(f); }
inline double IKsin(double f) { return sin(f); }
inline float IKcos(float f) { return cosf(f); }
inline double IKcos(double f) { return cos(f); }
inline float IKtan(float f) { return tanf(f); }
inline double IKtan(double f) { return tan(f); }
inline float IKsqrt(float f) { if( f <= 0.0f ) return 0.0f; return sqrtf(f); }
inline double IKsqrt(double f) { if( f <= 0.0 ) return 0.0; return sqrt(f); }
inline float IKatan2Simple(float fy, float fx) {
return atan2f(fy,fx);
}
inline float IKatan2(float fy, float fx) {
if( isnan(fy) ) {
IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
return float(IKPI_2);
}
else if( isnan(fx) ) {
return 0;
}
return atan2f(fy,fx);
}
inline double IKatan2Simple(double fy, double fx) {
return atan2(fy,fx);
}
inline double IKatan2(double fy, double fx) {
if( isnan(fy) ) {
IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
return IKPI_2;
}
else if( isnan(fx) ) {
return 0;
}
return atan2(fy,fx);
}
template <typename T>
struct CheckValue
{
T value;
bool valid;
};
template <typename T>
inline CheckValue<T> IKatan2WithCheck(T fy, T fx, T epsilon)
{
CheckValue<T> ret;
ret.valid = false;
ret.value = 0;
if( !isnan(fy) && !isnan(fx) ) {
if( IKabs(fy) >= IKFAST_ATAN2_MAGTHRESH || IKabs(fx) > IKFAST_ATAN2_MAGTHRESH ) {
ret.value = IKatan2Simple(fy,fx);
ret.valid = true;
}
}
return ret;
}
inline float IKsign(float f) {
if( f > 0 ) {
return float(1);
}
else if( f < 0 ) {
return float(-1);
}
return 0;
}
inline double IKsign(double f) {
if( f > 0 ) {
return 1.0;
}
else if( f < 0 ) {
return -1.0;
}
return 0;
}
template <typename T>
inline CheckValue<T> IKPowWithIntegerCheck(T f, int n)
{
CheckValue<T> ret;
ret.valid = true;
if( n == 0 ) {
ret.value = 1.0;
return ret;
}
else if( n == 1 )
{
ret.value = f;
return ret;
}
else if( n < 0 )
{
if( f == 0 )
{
ret.valid = false;
ret.value = (T)1.0e30;
return ret;
}
if( n == -1 ) {
ret.value = T(1.0)/f;
return ret;
}
}
int num = n > 0 ? n : -n;
if( num == 2 ) {
ret.value = f*f;
}
else if( num == 3 ) {
ret.value = f*f*f;
}
else {
ret.value = 1.0;
while(num>0) {
if( num & 1 ) {
ret.value *= f;
}
num >>= 1;
f *= f;
}
}
if( n < 0 ) {
ret.value = T(1.0)/ret.value;
}
return ret;
}
/// solves the forward kinematics equations.
/// \param pfree is an array specifying the free joints of the chain.
IKFAST_API void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) {
IkReal x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36,x37,x38,x39,x40,x41,x42,x43,x44,x45,x46,x47,x48,x49,x50,x51;
x0=IKcos(j[0]);
x1=IKsin(j[1]);
x2=IKsin(j[2]);
x3=IKcos(j[1]);
x4=IKcos(j[2]);
x5=IKsin(j[3]);
x6=IKcos(j[3]);
x7=IKsin(j[0]);
x8=IKsin(j[5]);
x9=IKcos(j[4]);
x10=IKsin(j[4]);
x11=IKcos(j[5]);
x12=((0.795)*x4);
x13=((0.7)*x1);
x14=((1.0)*x9);
x15=((0.115)*x2);
x16=((0.085)*x6);
x17=((1.0)*x7);
x18=((0.085)*x7);
x19=((1.0)*x2);
x20=((1.0)*x0);
x21=((1.0)*x10);
x22=(x0*x3);
x23=(x1*x2);
x24=(x5*x7);
x25=(x3*x4);
x26=(x3*x7);
x27=(x1*x4);
x28=(x0*x5);
x29=(x2*x3);
x30=(x10*x6);
x31=((1.0)*x25);
x32=(x0*x1*x19);
x33=(x17*x23);
x34=((((-1.0)*x31))+x23);
x35=((((-1.0)*x1*x19))+x31);
x36=(((x19*x3))+(((1.0)*x27)));
x37=(x34*x6);
x38=(x35*x5);
x39=(x10*x36);
x40=(x32+(((-1.0)*x20*x25)));
x41=((((-1.0)*x17*x25))+x33);
x42=(((x19*x22))+((x20*x27)));
x43=((-1.0)*x42);
x44=(x17*((x27+x29)));
x45=((-1.0)*x44);
x46=(x10*x40);
x47=(x45*x6);
x48=((((-1.0)*x17*x5))+((x43*x6)));
x49=(((x42*x5))+(((-1.0)*x17*x6)));
x50=(((x0*x6))+((x44*x5)));
x51=(x47+x28);
eerot[0]=(((x11*((x46+((x48*x9))))))+((x49*x8)));
eerot[1]=(((x11*x49))+((x8*(((((-1.0)*x14*x48))+(((-1.0)*x21*x40)))))));
eerot[2]=(((x10*x48))+((x9*(((((-1.0)*x32))+((x22*x4)))))));
IkReal x52=(x0*x23);
eetrans[0]=(((x0*x13))+(((0.115)*x0*x27))+(((0.15)*x0))+(((-0.795)*x52))+((x12*x22))+((x15*x22))+((x9*(((((-0.085)*x52))+(((0.085)*x22*x4))))))+((x10*(((((-1.0)*x18*x5))+((x16*x43)))))));
eerot[3]=(((x50*x8))+((x11*((((x10*x41))+((x51*x9)))))));
eerot[4]=(((x8*(((((-1.0)*x21*x41))+(((-1.0)*x14*x51))))))+((x11*x50)));
eerot[5]=(((x10*x51))+((x9*(((((-1.0)*x33))+((x25*x7)))))));
eetrans[1]=((((-0.795)*x23*x7))+(((0.115)*x27*x7))+(((0.15)*x7))+((x9*((((x18*x25))+(((-1.0)*x18*x23))))))+((x12*x26))+((x13*x7))+((x15*x26))+((x10*((((x16*x45))+(((0.085)*x28)))))));
eerot[6]=(((x38*x8))+((x11*((x39+((x37*x9)))))));
eerot[7]=(((x8*(((((-1.0)*x14*x37))+(((-1.0)*x21*x36))))))+((x11*x38)));
eerot[8]=((((-1.0)*x36*x9))+((x30*x34)));
IkReal x53=((1.0)*x1);
eetrans[2]=((0.445)+(((0.7)*x3))+(((0.115)*x25))+(((-1.0)*x12*x53))+((x30*(((((0.085)*x23))+(((-0.085)*x25))))))+((x9*(((((-0.085)*x29))+(((-0.085)*x27))))))+(((-1.0)*x15*x53))+(((-0.795)*x29)));
}
IKFAST_API int GetNumFreeParameters() { return 0; }
IKFAST_API int* GetFreeParameters() { return NULL; }
IKFAST_API int GetNumJoints() { return 6; }
IKFAST_API int GetIkRealSize() { return sizeof(IkReal); }
IKFAST_API int GetIkType() { return 0x67000001; }
class IKSolver {
public:
IkReal j0,cj0,sj0,htj0,j0mul,j1,cj1,sj1,htj1,j1mul,j2,cj2,sj2,htj2,j2mul,j3,cj3,sj3,htj3,j3mul,j4,cj4,sj4,htj4,j4mul,j5,cj5,sj5,htj5,j5mul,new_r00,r00,rxp0_0,new_r01,r01,rxp0_1,new_r02,r02,rxp0_2,new_r10,r10,rxp1_0,new_r11,r11,rxp1_1,new_r12,r12,rxp1_2,new_r20,r20,rxp2_0,new_r21,r21,rxp2_1,new_r22,r22,rxp2_2,new_px,px,npx,new_py,py,npy,new_pz,pz,npz,pp;
unsigned char _ij0[2], _nj0,_ij1[2], _nj1,_ij2[2], _nj2,_ij3[2], _nj3,_ij4[2], _nj4,_ij5[2], _nj5;
IkReal j100, cj100, sj100;
unsigned char _ij100[2], _nj100;
bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) {
j0=numeric_limits<IkReal>::quiet_NaN(); _ij0[0] = -1; _ij0[1] = -1; _nj0 = -1; j1=numeric_limits<IkReal>::quiet_NaN(); _ij1[0] = -1; _ij1[1] = -1; _nj1 = -1; j2=numeric_limits<IkReal>::quiet_NaN(); _ij2[0] = -1; _ij2[1] = -1; _nj2 = -1; j3=numeric_limits<IkReal>::quiet_NaN(); _ij3[0] = -1; _ij3[1] = -1; _nj3 = -1; j4=numeric_limits<IkReal>::quiet_NaN(); _ij4[0] = -1; _ij4[1] = -1; _nj4 = -1; j5=numeric_limits<IkReal>::quiet_NaN(); _ij5[0] = -1; _ij5[1] = -1; _nj5 = -1;
for(int dummyiter = 0; dummyiter < 1; ++dummyiter) {
solutions.Clear();
r00 = eerot[0*3+0];
r01 = eerot[0*3+1];
r02 = eerot[0*3+2];
r10 = eerot[1*3+0];
r11 = eerot[1*3+1];
r12 = eerot[1*3+2];
r20 = eerot[2*3+0];
r21 = eerot[2*3+1];
r22 = eerot[2*3+2];
px = eetrans[0]; py = eetrans[1]; pz = eetrans[2];
new_r00=r00;
new_r01=r01;
new_r02=r02;
new_px=(px+(((-0.085)*r02)));
new_r10=r10;
new_r11=r11;
new_r12=r12;
new_py=((((-0.085)*r12))+py);
new_r20=r20;
new_r21=r21;
new_r22=r22;
new_pz=((-0.445)+(((-0.085)*r22))+pz);
r00 = new_r00; r01 = new_r01; r02 = new_r02; r10 = new_r10; r11 = new_r11; r12 = new_r12; r20 = new_r20; r21 = new_r21; r22 = new_r22; px = new_px; py = new_py; pz = new_pz;
IkReal x54=((1.0)*px);
IkReal x55=((1.0)*pz);
IkReal x56=((1.0)*py);
pp=((px*px)+(py*py)+(pz*pz));
npx=(((px*r00))+((py*r10))+((pz*r20)));
npy=(((px*r01))+((py*r11))+((pz*r21)));
npz=(((px*r02))+((py*r12))+((pz*r22)));
rxp0_0=((((-1.0)*r20*x56))+((pz*r10)));
rxp0_1=(((px*r20))+(((-1.0)*r00*x55)));
rxp0_2=((((-1.0)*r10*x54))+((py*r00)));
rxp1_0=((((-1.0)*r21*x56))+((pz*r11)));
rxp1_1=(((px*r21))+(((-1.0)*r01*x55)));
rxp1_2=((((-1.0)*r11*x54))+((py*r01)));
rxp2_0=(((pz*r12))+(((-1.0)*r22*x56)));
rxp2_1=(((px*r22))+(((-1.0)*r02*x55)));
rxp2_2=((((-1.0)*r12*x54))+((py*r02)));
{
IkReal j0eval[1];
j0eval[0]=((IKabs(px))+(IKabs(py)));
if( IKabs(j0eval[0]) < 0.0000010000000000 )
{
continue; // no branches [j0, j1, j2]
} else
{
{
IkReal j0array[2], cj0array[2], sj0array[2];
bool j0valid[2]={false};
_nj0 = 2;
CheckValue<IkReal> x58 = IKatan2WithCheck(IkReal(((-1.0)*py)),IkReal(px),IKFAST_ATAN2_MAGTHRESH);
if(!x58.valid){
continue;
}
IkReal x57=x58.value;
j0array[0]=((-1.0)*x57);
sj0array[0]=IKsin(j0array[0]);
cj0array[0]=IKcos(j0array[0]);
j0array[1]=((3.14159265358979)+(((-1.0)*x57)));
sj0array[1]=IKsin(j0array[1]);
cj0array[1]=IKcos(j0array[1]);
if( j0array[0] > IKPI )
{
j0array[0]-=IK2PI;
}
else if( j0array[0] < -IKPI )
{ j0array[0]+=IK2PI;
}
j0valid[0] = true;
if( j0array[1] > IKPI )
{
j0array[1]-=IK2PI;
}
else if( j0array[1] < -IKPI )
{ j0array[1]+=IK2PI;
}
j0valid[1] = true;
for(int ij0 = 0; ij0 < 2; ++ij0)
{
if( !j0valid[ij0] )
{
continue;
}
_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < 2; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
j0valid[iij0]=false; _ij0[1] = iij0; break;
}
}
j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
{
IkReal j2array[2], cj2array[2], sj2array[2];
bool j2valid[2]={false};
_nj2 = 2;
if( (((0.989476674221324)+(((0.266765223335338)*py*sj0))+(((0.266765223335338)*cj0*px))+(((-0.889217411117793)*pp)))) < -1-IKFAST_SINCOS_THRESH || (((0.989476674221324)+(((0.266765223335338)*py*sj0))+(((0.266765223335338)*cj0*px))+(((-0.889217411117793)*pp)))) > 1+IKFAST_SINCOS_THRESH )
continue;
IkReal x59=IKasin(((0.989476674221324)+(((0.266765223335338)*py*sj0))+(((0.266765223335338)*cj0*px))+(((-0.889217411117793)*pp))));
j2array[0]=((-2.99793503742435)+(((-1.0)*x59)));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
j2array[1]=((0.143657616165445)+x59);
sj2array[1]=IKsin(j2array[1]);
cj2array[1]=IKcos(j2array[1]);
if( j2array[0] > IKPI )
{
j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{ j2array[0]+=IK2PI;
}
j2valid[0] = true;
if( j2array[1] > IKPI )
{
j2array[1]-=IK2PI;
}
else if( j2array[1] < -IKPI )
{ j2array[1]+=IK2PI;
}
j2valid[1] = true;
for(int ij2 = 0; ij2 < 2; ++ij2)
{
if( !j2valid[ij2] )
{
continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 2; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
j2valid[iij2]=false; _ij2[1] = iij2; break;
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IkReal j1eval[3];
IkReal x60=cj2*cj2;
IkReal x61=(pz*sj2);
IkReal x62=(cj2*sj2);
IkReal x63=(py*sj0);
IkReal x64=((0.115)*sj2);
IkReal x65=((46.0869565217391)*cj2);
IkReal x66=((0.795)*cj2);
IkReal x67=(cj0*px);
IkReal x68=((6.66666666666667)*sj2);
IkReal x69=(cj2*pz);
j1eval[0]=(sj2+(((-46.0869565217391)*x61))+(((-1.0)*x67*x68))+(((6.66666666666667)*x69))+(((40.5797101449275)*pz))+(((-1.0)*x65*x67))+(((-1.0)*x63*x68))+(((-1.0)*x63*x65))+(((6.91304347826087)*cj2)));
j1eval[1]=((IKabs(((-0.013225)+(pz*pz)+(((-0.18285)*x62))+(((-0.6188)*x60)))))+(IKabs(((0.091425)+(((-0.0805)*sj2))+(((-0.15)*pz))+(((-0.5565)*cj2))+(((-0.18285)*x60))+((pz*x67))+((pz*x63))+(((0.6188)*x62))))));
j1eval[2]=IKsign(((((-1.0)*x66*x67))+(((0.7)*pz))+(((0.01725)*sj2))+(((0.115)*x69))+(((0.11925)*cj2))+(((-1.0)*x64*x67))+(((-0.795)*x61))+(((-1.0)*x63*x64))+(((-1.0)*x63*x66))));
if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 || IKabs(j1eval[2]) < 0.0000010000000000 )
{
{
IkReal j1eval[2];
IkReal x70=(cj0*px);
IkReal x71=((0.795)*sj2);
IkReal x72=(py*sj0);
IkReal x73=(pz*sj2);
IkReal x74=((46.0869565217391)*sj2);
IkReal x75=(cj2*pz);
IkReal x76=((0.115)*cj2);
IkReal x77=((6.66666666666667)*cj2);
j1eval[0]=((6.08695652173913)+(((-46.0869565217391)*x75))+(((-40.5797101449275)*x70))+(((-40.5797101449275)*x72))+cj2+(((-1.0)*x70*x77))+(((-6.66666666666667)*x73))+(((-1.0)*x72*x77))+((x70*x74))+((x72*x74))+(((-6.91304347826087)*sj2)));
j1eval[1]=IKsign(((0.105)+(((-0.11925)*sj2))+(((-1.0)*x70*x76))+(((-0.795)*x75))+(((0.01725)*cj2))+(((-0.115)*x73))+(((-0.7)*x70))+(((-0.7)*x72))+(((-1.0)*x72*x76))+((x70*x71))+((x71*x72))));
if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 )
{
{
IkReal j1eval[2];
IkReal x78=py*py;
IkReal x79=cj0*cj0;
IkReal x80=px*px;
IkReal x81=pz*pz;
IkReal x82=(cj0*px);
IkReal x83=(py*sj0);
IkReal x84=(x78*x79);
IkReal x85=(x79*x80);
j1eval[0]=((-1.0)+(((-88.8888888888889)*x82*x83))+(((-44.4444444444444)*x85))+(((-44.4444444444444)*x81))+(((13.3333333333333)*x83))+(((13.3333333333333)*x82))+(((-44.4444444444444)*x78))+(((44.4444444444444)*x84)));
j1eval[1]=IKsign(((-0.0225)+(((0.3)*x83))+(((0.3)*x82))+(((-2.0)*x82*x83))+x84+(((-1.0)*x81))+(((-1.0)*x85))+(((-1.0)*x78))));
if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 )
{
continue; // no branches [j1]
} else
{
{
IkReal j1array[1], cj1array[1], sj1array[1];
bool j1valid[1]={false};
_nj1 = 1;
IkReal x86=py*py;
IkReal x87=cj0*cj0;
IkReal x88=((0.115)*cj2);
IkReal x89=(py*sj0);
IkReal x90=(cj0*px);
IkReal x91=((0.795)*sj2);
IkReal x92=((0.115)*sj2);
IkReal x93=((0.795)*cj2);
CheckValue<IkReal> x94 = IKatan2WithCheck(IkReal(((0.105)+((x89*x91))+(((-0.11925)*sj2))+((pz*x92))+((pz*x93))+(((0.01725)*cj2))+((x90*x91))+(((-0.7)*x90))+(((-0.7)*x89))+(((-1.0)*x88*x89))+(((-1.0)*x88*x90)))),IkReal(((((-0.7)*pz))+(((-1.0)*x90*x93))+(((-1.0)*x90*x92))+(((0.01725)*sj2))+((pz*x91))+(((0.11925)*cj2))+(((-1.0)*pz*x88))+(((-1.0)*x89*x92))+(((-1.0)*x89*x93)))),IKFAST_ATAN2_MAGTHRESH);
if(!x94.valid){
continue;
}
CheckValue<IkReal> x95=IKPowWithIntegerCheck(IKsign(((-0.0225)+(((0.3)*x90))+(((0.3)*x89))+((x86*x87))+(((-2.0)*x89*x90))+(((-1.0)*x86))+(((-1.0)*(pz*pz)))+(((-1.0)*x87*(px*px))))),-1);
if(!x95.valid){
continue;
}
j1array[0]=((-1.5707963267949)+(x94.value)+(((1.5707963267949)*(x95.value))));
sj1array[0]=IKsin(j1array[0]);
cj1array[0]=IKcos(j1array[0]);
if( j1array[0] > IKPI )
{
j1array[0]-=IK2PI;
}
else if( j1array[0] < -IKPI )
{ j1array[0]+=IK2PI;
}
j1valid[0] = true;
for(int ij1 = 0; ij1 < 1; ++ij1)
{
if( !j1valid[ij1] )
{
continue;
}
_ij1[0] = ij1; _ij1[1] = -1;
for(int iij1 = ij1+1; iij1 < 1; ++iij1)
{
if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
{
j1valid[iij1]=false; _ij1[1] = iij1; break;
}
}
j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
{
IkReal evalcond[5];
IkReal x96=IKsin(j1);
IkReal x97=IKcos(j1);
IkReal x98=((0.115)*sj2);
IkReal x99=(cj0*px);
IkReal x100=(py*sj0);
IkReal x101=((0.795)*sj2);
IkReal x102=((0.115)*cj2);
IkReal x103=((0.795)*cj2);
IkReal x104=(pz*x97);
IkReal x105=((1.0)*x97);
IkReal x106=(cj2*x97);
IkReal x107=((1.4)*x96);
evalcond[0]=((-0.7)+((x96*x99))+((x100*x96))+(((-1.0)*x102))+x104+x101+(((-0.15)*x96)));
evalcond[1]=((((-1.0)*x100*x105))+(((0.15)*x97))+x103+((pz*x96))+(((-1.0)*x105*x99))+x98);
evalcond[2]=(((x96*x98))+(((-1.0)*x102*x97))+((x103*x96))+((x101*x97))+(((-0.7)*x97))+pz);
evalcond[3]=((0.13275)+(((0.3)*x99))+((x107*x99))+(((1.4)*x104))+(((0.3)*x100))+(((-1.0)*pp))+(((-0.21)*x96))+((x100*x107)));
evalcond[4]=((0.15)+((x103*x97))+((x102*x96))+((x97*x98))+(((-1.0)*x101*x96))+(((-1.0)*x99))+(((0.7)*x96))+(((-1.0)*x100)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
rotationfunction0(solutions);
}
}
}
}
} else
{
{
IkReal j1array[1], cj1array[1], sj1array[1];
bool j1valid[1]={false};
_nj1 = 1;
IkReal x642=cj2*cj2;
IkReal x643=((0.115)*cj2);
IkReal x644=(py*sj0);
IkReal x645=(cj0*px);
IkReal x646=((0.795)*sj2);
IkReal x647=(cj2*sj2);
IkReal x648=((1.0)*pz);
CheckValue<IkReal> x649=IKPowWithIntegerCheck(IKsign(((0.105)+(((-0.11925)*sj2))+((x644*x646))+(((-0.115)*pz*sj2))+(((0.01725)*cj2))+((x645*x646))+(((-1.0)*x643*x645))+(((-1.0)*x643*x644))+(((-0.795)*cj2*pz))+(((-0.7)*x644))+(((-0.7)*x645)))),-1);
if(!x649.valid){
continue;
}
CheckValue<IkReal> x650 = IKatan2WithCheck(IkReal(((-1.122025)+(((0.6188)*x642))+(((1.113)*sj2))+(((0.18285)*x647))+(pz*pz)+(((-0.161)*cj2)))),IkReal(((0.091425)+(((-0.0805)*sj2))+(((0.15)*pz))+(((0.6188)*x647))+(((-0.18285)*x642))+(((-0.5565)*cj2))+(((-1.0)*x644*x648))+(((-1.0)*x645*x648)))),IKFAST_ATAN2_MAGTHRESH);
if(!x650.valid){
continue;
}
j1array[0]=((-1.5707963267949)+(((1.5707963267949)*(x649.value)))+(x650.value));
sj1array[0]=IKsin(j1array[0]);
cj1array[0]=IKcos(j1array[0]);
if( j1array[0] > IKPI )
{
j1array[0]-=IK2PI;
}
else if( j1array[0] < -IKPI )
{ j1array[0]+=IK2PI;
}
j1valid[0] = true;
for(int ij1 = 0; ij1 < 1; ++ij1)
{
if( !j1valid[ij1] )
{
continue;
}
_ij1[0] = ij1; _ij1[1] = -1;
for(int iij1 = ij1+1; iij1 < 1; ++iij1)
{
if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
{
j1valid[iij1]=false; _ij1[1] = iij1; break;
}
}
j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
{
IkReal evalcond[5];
IkReal x651=IKsin(j1);
IkReal x652=IKcos(j1);
IkReal x653=((0.115)*sj2);
IkReal x654=(cj0*px);
IkReal x655=(py*sj0);
IkReal x656=((0.795)*sj2);
IkReal x657=((0.115)*cj2);
IkReal x658=((0.795)*cj2);
IkReal x659=(pz*x652);
IkReal x660=((1.0)*x652);
IkReal x661=(cj2*x652);
IkReal x662=((1.4)*x651);
evalcond[0]=((-0.7)+(((-0.15)*x651))+(((-1.0)*x657))+((x651*x655))+((x651*x654))+x656+x659);
evalcond[1]=((((-1.0)*x654*x660))+((pz*x651))+x653+x658+(((-1.0)*x655*x660))+(((0.15)*x652)));
evalcond[2]=((((-0.7)*x652))+((x652*x656))+((x651*x653))+((x651*x658))+pz+(((-1.0)*x652*x657)));
evalcond[3]=((0.13275)+(((1.4)*x659))+(((-1.0)*pp))+((x654*x662))+(((0.3)*x655))+(((0.3)*x654))+(((-0.21)*x651))+((x655*x662)));
evalcond[4]=((0.15)+(((0.7)*x651))+(((-1.0)*x651*x656))+(((-1.0)*x655))+(((-1.0)*x654))+((x652*x658))+((x652*x653))+((x651*x657)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
rotationfunction0(solutions);
}
}
}
}
} else
{
{
IkReal j1array[1], cj1array[1], sj1array[1];
bool j1valid[1]={false};
_nj1 = 1;
IkReal x663=cj2*cj2;
IkReal x664=(py*sj0);
IkReal x665=(cj0*px);
IkReal x666=((0.795)*cj2);
IkReal x667=((0.115)*sj2);
IkReal x668=(cj2*sj2);
CheckValue<IkReal> x669=IKPowWithIntegerCheck(IKsign(((((-1.0)*x665*x666))+(((-1.0)*x665*x667))+(((-0.795)*pz*sj2))+(((0.7)*pz))+(((0.115)*cj2*pz))+(((0.01725)*sj2))+(((0.11925)*cj2))+(((-1.0)*x664*x667))+(((-1.0)*x664*x666)))),-1);
if(!x669.valid){
continue;
}
CheckValue<IkReal> x670 = IKatan2WithCheck(IkReal(((0.091425)+(((-0.0805)*sj2))+(((-0.18285)*x663))+(((-0.15)*pz))+(((-0.5565)*cj2))+((pz*x664))+((pz*x665))+(((0.6188)*x668)))),IkReal(((-0.013225)+(((-0.18285)*x668))+(pz*pz)+(((-0.6188)*x663)))),IKFAST_ATAN2_MAGTHRESH);
if(!x670.valid){
continue;
}
j1array[0]=((-1.5707963267949)+(((1.5707963267949)*(x669.value)))+(x670.value));
sj1array[0]=IKsin(j1array[0]);
cj1array[0]=IKcos(j1array[0]);
if( j1array[0] > IKPI )
{
j1array[0]-=IK2PI;
}
else if( j1array[0] < -IKPI )
{ j1array[0]+=IK2PI;
}
j1valid[0] = true;
for(int ij1 = 0; ij1 < 1; ++ij1)
{
if( !j1valid[ij1] )
{
continue;
}
_ij1[0] = ij1; _ij1[1] = -1;
for(int iij1 = ij1+1; iij1 < 1; ++iij1)
{
if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
{
j1valid[iij1]=false; _ij1[1] = iij1; break;
}
}
j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
{
IkReal evalcond[5];
IkReal x671=IKsin(j1);
IkReal x672=IKcos(j1);
IkReal x673=((0.115)*sj2);
IkReal x674=(cj0*px);
IkReal x675=(py*sj0);
IkReal x676=((0.795)*sj2);
IkReal x677=((0.115)*cj2);
IkReal x678=((0.795)*cj2);
IkReal x679=(pz*x672);
IkReal x680=((1.0)*x672);
IkReal x681=(cj2*x672);
IkReal x682=((1.4)*x671);
evalcond[0]=((-0.7)+((x671*x674))+((x671*x675))+x679+x676+(((-0.15)*x671))+(((-1.0)*x677)));
evalcond[1]=(((pz*x671))+(((0.15)*x672))+(((-1.0)*x675*x680))+x678+x673+(((-1.0)*x674*x680)));
evalcond[2]=(((x672*x676))+((x671*x673))+((x671*x678))+(((-0.7)*x672))+pz+(((-1.0)*x672*x677)));
evalcond[3]=((0.13275)+((x674*x682))+(((0.3)*x674))+(((0.3)*x675))+(((-1.0)*pp))+(((-0.21)*x671))+((x675*x682))+(((1.4)*x679)));
evalcond[4]=((0.15)+((x672*x673))+((x672*x678))+((x671*x677))+(((-1.0)*x674))+(((-1.0)*x675))+(((0.7)*x671))+(((-1.0)*x671*x676)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
rotationfunction0(solutions);
}
}
}
}
}
}
}
}
}
}
}
return solutions.GetNumSolutions()>0;
}
inline void rotationfunction0(IkSolutionListBase<IkReal>& solutions) {
for(int rotationiter = 0; rotationiter < 1; ++rotationiter) {
IkReal x108=(cj0*r00);
IkReal x109=(cj0*r01);
IkReal x110=(sj1*sj2);
IkReal x111=((1.0)*sj0);
IkReal x112=(r10*sj0);
IkReal x113=((1.0)*cj2);
IkReal x114=(r11*sj0);
IkReal x115=(cj0*r02);
IkReal x116=(r12*sj0);
IkReal x117=((((-1.0)*cj1*x113))+x110);
IkReal x118=(((cj1*cj2))+(((-1.0)*x110)));
IkReal x119=(cj0*x118);
IkReal x120=((((-1.0)*sj1*x113))+(((-1.0)*cj1*sj2)));
IkReal x121=(sj0*x120);
new_r00=(((x112*x120))+((x108*x120))+((r20*x117)));
new_r01=(((x114*x120))+((r21*x117))+((x109*x120)));
new_r02=(((r22*x117))+((x115*x120))+((x116*x120)));
new_r10=((((-1.0)*r00*x111))+((cj0*r10)));
new_r11=((((-1.0)*r01*x111))+((cj0*r11)));
new_r12=((((-1.0)*r02*x111))+((cj0*r12)));
new_r20=(((x112*x118))+((r20*x120))+((x108*x118)));
new_r21=(((r21*x120))+((x114*x118))+((x109*x118)));
new_r22=(((r22*x120))+((x116*x118))+((x115*x118)));
{
IkReal j4array[2], cj4array[2], sj4array[2];
bool j4valid[2]={false};
_nj4 = 2;
cj4array[0]=new_r22;
if( cj4array[0] >= -1-IKFAST_SINCOS_THRESH && cj4array[0] <= 1+IKFAST_SINCOS_THRESH )
{
j4valid[0] = j4valid[1] = true;
j4array[0] = IKacos(cj4array[0]);
sj4array[0] = IKsin(j4array[0]);
cj4array[1] = cj4array[0];
j4array[1] = -j4array[0];
sj4array[1] = -sj4array[0];
}
else if( isnan(cj4array[0]) )
{
// probably any value will work
j4valid[0] = true;
cj4array[0] = 1; sj4array[0] = 0; j4array[0] = 0;
}
for(int ij4 = 0; ij4 < 2; ++ij4)
{
if( !j4valid[ij4] )
{
continue;
}
_ij4[0] = ij4; _ij4[1] = -1;
for(int iij4 = ij4+1; iij4 < 2; ++iij4)
{
if( j4valid[iij4] && IKabs(cj4array[ij4]-cj4array[iij4]) < IKFAST_SOLUTION_THRESH && IKabs(sj4array[ij4]-sj4array[iij4]) < IKFAST_SOLUTION_THRESH )
{
j4valid[iij4]=false; _ij4[1] = iij4; break;
}
}
j4 = j4array[ij4]; cj4 = cj4array[ij4]; sj4 = sj4array[ij4];
{
IkReal j3eval[3];
j3eval[0]=sj4;
j3eval[1]=IKsign(sj4);
j3eval[2]=((IKabs(new_r12))+(IKabs(new_r02)));
if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[3];
j5eval[0]=sj4;
j5eval[1]=IKsign(sj4);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j3eval[2];
j3eval[0]=new_r12;
j3eval[1]=sj4;
if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
{
{
IkReal evalcond[5];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
IkReal j5mul = 1;
j5=0;
j3mul=-1.0;
if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(new_r00)-1) <= IKFAST_SINCOS_THRESH )
continue;
j3=IKatan2(((-1.0)*new_r01), new_r00);
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].fmul = j3mul;
vinfos[3].freeind = 0;
vinfos[3].maxsolutions = 0;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].fmul = j5mul;
vinfos[5].freeind = 0;
vinfos[5].maxsolutions = 0;
std::vector<int> vfree(1);
vfree[0] = 5;
solutions.AddSolution(vinfos,vfree);
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
IkReal j5mul = 1;
j5=0;
j3mul=1.0;
if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(((-1.0)*new_r00))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3=IKatan2(((-1.0)*new_r01), ((-1.0)*new_r00));
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].fmul = j3mul;
vinfos[3].freeind = 0;
vinfos[3].maxsolutions = 0;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].fmul = j5mul;
vinfos[5].freeind = 0;
vinfos[5].maxsolutions = 0;
std::vector<int> vfree(1);
vfree[0] = 5;
solutions.AddSolution(vinfos,vfree);
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r12))+(IKabs(new_r02)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
IkReal x122=new_r22*new_r22;
IkReal x123=((16.0)*new_r10);
IkReal x124=((16.0)*new_r01);
IkReal x125=((16.0)*new_r22);
IkReal x126=((8.0)*new_r11);
IkReal x127=((8.0)*new_r00);
IkReal x128=(x122*x123);
IkReal x129=(x122*x124);
j3eval[0]=((IKabs(((((-1.0)*x128))+x123)))+(IKabs(((((-1.0)*x129))+x124)))+(IKabs(((((-1.0)*x123))+x128)))+(IKabs((((x122*x126))+(((-1.0)*new_r22*x127)))))+(IKabs(((((-1.0)*x124))+x129)))+(IKabs(((((16.0)*new_r00))+(((-32.0)*new_r00*x122))+((new_r11*x125)))))+(IKabs(((((32.0)*new_r11))+(((-1.0)*new_r00*x125))+(((-16.0)*new_r11*x122)))))+(IKabs((((new_r22*x126))+(((-1.0)*x127))))));
if( IKabs(j3eval[0]) < 0.0000000010000000 )
{
continue; // no branches [j3, j5]
} else
{
IkReal op[4+1], zeror[4];
int numroots;
IkReal j3evalpoly[1];
IkReal x130=new_r22*new_r22;
IkReal x131=((16.0)*new_r10);
IkReal x132=(new_r11*new_r22);
IkReal x133=(x130*x131);
IkReal x134=((((-8.0)*new_r00))+(((8.0)*x132)));
op[0]=x134;
op[1]=(x131+(((-1.0)*x133)));
op[2]=((((16.0)*x132))+(((16.0)*new_r00))+(((-32.0)*new_r00*x130)));
op[3]=(x133+(((-1.0)*x131)));
op[4]=x134;
polyroots4(op,zeror,numroots);
IkReal j3array[4], cj3array[4], sj3array[4], tempj3array[1];
int numsolutions = 0;
for(int ij3 = 0; ij3 < numroots; ++ij3)
{
IkReal htj3 = zeror[ij3];
tempj3array[0]=((2.0)*(atan(htj3)));
for(int kj3 = 0; kj3 < 1; ++kj3)
{
j3array[numsolutions] = tempj3array[kj3];
if( j3array[numsolutions] > IKPI )
{
j3array[numsolutions]-=IK2PI;
}
else if( j3array[numsolutions] < -IKPI )
{
j3array[numsolutions]+=IK2PI;
}
sj3array[numsolutions] = IKsin(j3array[numsolutions]);
cj3array[numsolutions] = IKcos(j3array[numsolutions]);
numsolutions++;
}
}
bool j3valid[4]={true,true,true,true};
_nj3 = 4;
for(int ij3 = 0; ij3 < numsolutions; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
htj3 = IKtan(j3/2);
IkReal x135=new_r22*new_r22;
IkReal x136=((16.0)*new_r01);
IkReal x137=(new_r00*new_r22);
IkReal x138=((8.0)*x137);
IkReal x139=(new_r11*x135);
IkReal x140=((8.0)*x139);
IkReal x141=(x135*x136);
j3evalpoly[0]=((((htj3*htj3)*(((((32.0)*new_r11))+(((-16.0)*x137))+(((-16.0)*x139))))))+((htj3*(((((-1.0)*x141))+x136))))+x140+(((-1.0)*x138))+(((htj3*htj3*htj3)*((x141+(((-1.0)*x136))))))+(((htj3*htj3*htj3*htj3)*((x140+(((-1.0)*x138)))))));
if( IKabs(j3evalpoly[0]) > 0.0000000010000000 )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < numsolutions; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
{
IkReal j5eval[3];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
IkReal x142=cj3*cj3;
IkReal x143=(cj3*new_r22);
IkReal x144=((-1.0)+x142+(((-1.0)*x142*(new_r22*new_r22))));
j5eval[0]=x144;
j5eval[1]=((IKabs((((new_r01*x143))+((new_r00*sj3)))))+(IKabs((((new_r01*sj3))+(((-1.0)*new_r00*x143))))));
j5eval[2]=IKsign(x144);
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
j5eval[0]=new_r22;
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5eval[2];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
IkReal x145=new_r22*new_r22;
j5eval[0]=(((cj3*x145))+(((-1.0)*cj3)));
j5eval[1]=((((-1.0)*sj3))+((sj3*x145)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
{
{
IkReal evalcond[1];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r01));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x146=IKsin(j5);
IkReal x147=IKcos(j5);
evalcond[0]=x146;
evalcond[1]=((-1.0)*x147);
evalcond[2]=((((-1.0)*x146))+(((-1.0)*new_r00)));
evalcond[3]=((((-1.0)*x147))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r01)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r00, new_r01);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x148=IKsin(j5);
IkReal x149=IKcos(j5);
evalcond[0]=x148;
evalcond[1]=((-1.0)*x149);
evalcond[2]=((((-1.0)*x148))+new_r00);
evalcond[3]=((((-1.0)*x149))+new_r01);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r10)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r10, new_r11);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x150=IKsin(j5);
IkReal x151=IKcos(j5);
evalcond[0]=x150;
evalcond[1]=((-1.0)*x151);
evalcond[2]=((((-1.0)*x150))+new_r10);
evalcond[3]=((((-1.0)*x151))+new_r11);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x152=IKsin(j5);
IkReal x153=IKcos(j5);
evalcond[0]=x152;
evalcond[1]=((-1.0)*x153);
evalcond[2]=((((-1.0)*x152))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*x153))+(((-1.0)*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
CheckValue<IkReal> x154=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x154.valid){
continue;
}
if((x154.value) < -0.00001)
continue;
IkReal gconst6=((-1.0)*(IKsqrt(x154.value)));
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst6)))))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
sj3=IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))));
cj3=gconst6;
if( (gconst6) < -1-IKFAST_SINCOS_THRESH || (gconst6) > 1+IKFAST_SINCOS_THRESH )
continue;
j3=IKacos(gconst6);
CheckValue<IkReal> x155=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x155.valid){
continue;
}
if((x155.value) < -0.00001)
continue;
IkReal gconst6=((-1.0)*(IKsqrt(x155.value)));
j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
CheckValue<IkReal> x156=IKPowWithIntegerCheck(gconst6,-1);
if(!x156.valid){
continue;
}
if( IKabs((((gconst6*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x156.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst6*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6))))))))))+IKsqr((new_r11*(x156.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((((gconst6*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6))))))))), (new_r11*(x156.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x157=IKcos(j5);
IkReal x158=IKsin(j5);
IkReal x159=((1.0)*x158);
IkReal x160=((1.0)*x157);
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
IkReal x161=IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))));
IkReal x162=((1.0)*x161);
evalcond[0]=x158;
evalcond[1]=((-1.0)*x157);
evalcond[2]=((((-1.0)*gconst6*x160))+new_r11);
evalcond[3]=((((-1.0)*gconst6*x159))+new_r10);
evalcond[4]=(((x157*x161))+new_r01);
evalcond[5]=(new_r00+((x158*x161)));
evalcond[6]=((((-1.0)*new_r00*x162))+(((-1.0)*x159))+((gconst6*new_r10)));
evalcond[7]=((((-1.0)*x160))+((gconst6*new_r11))+(((-1.0)*new_r01*x162)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x163 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r11),IKFAST_ATAN2_MAGTHRESH);
if(!x163.valid){
continue;
}
CheckValue<IkReal> x164=IKPowWithIntegerCheck(IKsign(gconst6),-1);
if(!x164.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(x163.value)+(((1.5707963267949)*(x164.value))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x165=IKcos(j5);
IkReal x166=IKsin(j5);
IkReal x167=((1.0)*x166);
IkReal x168=((1.0)*x165);
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
IkReal x169=IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))));
IkReal x170=((1.0)*x169);
evalcond[0]=x166;
evalcond[1]=((-1.0)*x165);
evalcond[2]=((((-1.0)*gconst6*x168))+new_r11);
evalcond[3]=((((-1.0)*gconst6*x167))+new_r10);
evalcond[4]=(((x165*x169))+new_r01);
evalcond[5]=(((x166*x169))+new_r00);
evalcond[6]=((((-1.0)*x167))+((gconst6*new_r10))+(((-1.0)*new_r00*x170)));
evalcond[7]=((((-1.0)*x168))+((gconst6*new_r11))+(((-1.0)*new_r01*x170)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
CheckValue<IkReal> x171=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x171.valid){
continue;
}
if((x171.value) < -0.00001)
continue;
IkReal gconst6=((-1.0)*(IKsqrt(x171.value)));
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs((cj3+(((-1.0)*gconst6)))))+(IKabs(((1.0)+(IKsign(sj3)))))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))))));
cj3=gconst6;
if( (gconst6) < -1-IKFAST_SINCOS_THRESH || (gconst6) > 1+IKFAST_SINCOS_THRESH )
continue;
j3=((-1.0)*(IKacos(gconst6)));
CheckValue<IkReal> x172=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x172.valid){
continue;
}
if((x172.value) < -0.00001)
continue;
IkReal gconst6=((-1.0)*(IKsqrt(x172.value)));
j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
CheckValue<IkReal> x173=IKPowWithIntegerCheck(gconst6,-1);
if(!x173.valid){
continue;
}
if( IKabs((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6))))))))+((gconst6*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x173.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6))))))))+((gconst6*new_r10))))+IKsqr((new_r11*(x173.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6))))))))+((gconst6*new_r10))), (new_r11*(x173.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x174=IKcos(j5);
IkReal x175=IKsin(j5);
IkReal x176=((1.0)*x174);
IkReal x177=((1.0)*x175);
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
IkReal x178=IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))));
IkReal x179=((1.0)*x178);
evalcond[0]=x175;
evalcond[1]=((-1.0)*x174);
evalcond[2]=((((-1.0)*gconst6*x176))+new_r11);
evalcond[3]=((((-1.0)*gconst6*x177))+new_r10);
evalcond[4]=((((-1.0)*x176*x178))+new_r01);
evalcond[5]=((((-1.0)*x177*x178))+new_r00);
evalcond[6]=(((new_r00*x178))+(((-1.0)*x177))+((gconst6*new_r10)));
evalcond[7]=(((new_r01*x178))+(((-1.0)*x176))+((gconst6*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x180 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r11),IKFAST_ATAN2_MAGTHRESH);
if(!x180.valid){
continue;
}
CheckValue<IkReal> x181=IKPowWithIntegerCheck(IKsign(gconst6),-1);
if(!x181.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(x180.value)+(((1.5707963267949)*(x181.value))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x182=IKcos(j5);
IkReal x183=IKsin(j5);
IkReal x184=((1.0)*x182);
IkReal x185=((1.0)*x183);
if((((1.0)+(((-1.0)*(gconst6*gconst6))))) < -0.00001)
continue;
IkReal x186=IKsqrt(((1.0)+(((-1.0)*(gconst6*gconst6)))));
IkReal x187=((1.0)*x186);
evalcond[0]=x183;
evalcond[1]=((-1.0)*x182);
evalcond[2]=((((-1.0)*gconst6*x184))+new_r11);
evalcond[3]=((((-1.0)*gconst6*x185))+new_r10);
evalcond[4]=((((-1.0)*x184*x186))+new_r01);
evalcond[5]=((((-1.0)*x185*x186))+new_r00);
evalcond[6]=(((new_r00*x186))+((gconst6*new_r10))+(((-1.0)*x185)));
evalcond[7]=(((new_r01*x186))+((gconst6*new_r11))+(((-1.0)*x184)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
CheckValue<IkReal> x188=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x188.valid){
continue;
}
if((x188.value) < -0.00001)
continue;
IkReal gconst7=IKsqrt(x188.value);
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst7)))))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
sj3=IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))));
cj3=gconst7;
if( (gconst7) < -1-IKFAST_SINCOS_THRESH || (gconst7) > 1+IKFAST_SINCOS_THRESH )
continue;
j3=IKacos(gconst7);
CheckValue<IkReal> x189=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x189.valid){
continue;
}
if((x189.value) < -0.00001)
continue;
IkReal gconst7=IKsqrt(x189.value);
j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
CheckValue<IkReal> x190=IKPowWithIntegerCheck(gconst7,-1);
if(!x190.valid){
continue;
}
if( IKabs(((((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7))))))))+((gconst7*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x190.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7))))))))+((gconst7*new_r10))))+IKsqr((new_r11*(x190.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7))))))))+((gconst7*new_r10))), (new_r11*(x190.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x191=IKcos(j5);
IkReal x192=IKsin(j5);
IkReal x193=((1.0)*x192);
IkReal x194=((1.0)*x191);
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
IkReal x195=IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))));
IkReal x196=((1.0)*x195);
evalcond[0]=x192;
evalcond[1]=((-1.0)*x191);
evalcond[2]=(new_r11+(((-1.0)*gconst7*x194)));
evalcond[3]=(new_r10+(((-1.0)*gconst7*x193)));
evalcond[4]=(((x191*x195))+new_r01);
evalcond[5]=(((x192*x195))+new_r00);
evalcond[6]=((((-1.0)*x193))+(((-1.0)*new_r00*x196))+((gconst7*new_r10)));
evalcond[7]=((((-1.0)*x194))+(((-1.0)*new_r01*x196))+((gconst7*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x197=IKPowWithIntegerCheck(IKsign(gconst7),-1);
if(!x197.valid){
continue;
}
CheckValue<IkReal> x198 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r11),IKFAST_ATAN2_MAGTHRESH);
if(!x198.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x197.value)))+(x198.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x199=IKcos(j5);
IkReal x200=IKsin(j5);
IkReal x201=((1.0)*x200);
IkReal x202=((1.0)*x199);
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
IkReal x203=IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))));
IkReal x204=((1.0)*x203);
evalcond[0]=x200;
evalcond[1]=((-1.0)*x199);
evalcond[2]=(new_r11+(((-1.0)*gconst7*x202)));
evalcond[3]=(new_r10+(((-1.0)*gconst7*x201)));
evalcond[4]=(new_r01+((x199*x203)));
evalcond[5]=(((x200*x203))+new_r00);
evalcond[6]=((((-1.0)*new_r00*x204))+(((-1.0)*x201))+((gconst7*new_r10)));
evalcond[7]=((((-1.0)*x202))+(((-1.0)*new_r01*x204))+((gconst7*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
CheckValue<IkReal> x205=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x205.valid){
continue;
}
if((x205.value) < -0.00001)
continue;
IkReal gconst7=IKsqrt(x205.value);
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs((cj3+(((-1.0)*gconst7)))))+(IKabs(((1.0)+(IKsign(sj3)))))), 6.28318530717959)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))))));
cj3=gconst7;
if( (gconst7) < -1-IKFAST_SINCOS_THRESH || (gconst7) > 1+IKFAST_SINCOS_THRESH )
continue;
j3=((-1.0)*(IKacos(gconst7)));
CheckValue<IkReal> x206=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
if(!x206.valid){
continue;
}
if((x206.value) < -0.00001)
continue;
IkReal gconst7=IKsqrt(x206.value);
j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
CheckValue<IkReal> x207=IKPowWithIntegerCheck(gconst7,-1);
if(!x207.valid){
continue;
}
if( IKabs((((gconst7*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x207.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst7*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7))))))))))+IKsqr((new_r11*(x207.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((((gconst7*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7))))))))), (new_r11*(x207.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x208=IKcos(j5);
IkReal x209=IKsin(j5);
IkReal x210=((1.0)*x208);
IkReal x211=((1.0)*x209);
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
IkReal x212=IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))));
evalcond[0]=x209;
evalcond[1]=((-1.0)*x208);
evalcond[2]=((((-1.0)*gconst7*x210))+new_r11);
evalcond[3]=((((-1.0)*gconst7*x211))+new_r10);
evalcond[4]=((((-1.0)*x210*x212))+new_r01);
evalcond[5]=((((-1.0)*x211*x212))+new_r00);
evalcond[6]=(((new_r00*x212))+(((-1.0)*x211))+((gconst7*new_r10)));
evalcond[7]=(((new_r01*x212))+(((-1.0)*x210))+((gconst7*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x213=IKPowWithIntegerCheck(IKsign(gconst7),-1);
if(!x213.valid){
continue;
}
CheckValue<IkReal> x214 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r11),IKFAST_ATAN2_MAGTHRESH);
if(!x214.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x213.value)))+(x214.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x215=IKcos(j5);
IkReal x216=IKsin(j5);
IkReal x217=((1.0)*x215);
IkReal x218=((1.0)*x216);
if((((1.0)+(((-1.0)*(gconst7*gconst7))))) < -0.00001)
continue;
IkReal x219=IKsqrt(((1.0)+(((-1.0)*(gconst7*gconst7)))));
evalcond[0]=x216;
evalcond[1]=((-1.0)*x215);
evalcond[2]=((((-1.0)*gconst7*x217))+new_r11);
evalcond[3]=((((-1.0)*gconst7*x218))+new_r10);
evalcond[4]=((((-1.0)*x217*x219))+new_r01);
evalcond[5]=((((-1.0)*x218*x219))+new_r00);
evalcond[6]=(((new_r00*x219))+(((-1.0)*x218))+((gconst7*new_r10)));
evalcond[7]=(((new_r01*x219))+(((-1.0)*x217))+((gconst7*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x220=new_r22*new_r22;
CheckValue<IkReal> x221=IKPowWithIntegerCheck((((cj3*x220))+(((-1.0)*cj3))),-1);
if(!x221.valid){
continue;
}
CheckValue<IkReal> x222=IKPowWithIntegerCheck(((((-1.0)*sj3))+((sj3*x220))),-1);
if(!x222.valid){
continue;
}
if( IKabs(((x221.value)*(((((-1.0)*new_r01*new_r22))+(((-1.0)*new_r10)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x222.value)*((((new_r10*new_r22))+new_r01)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x221.value)*(((((-1.0)*new_r01*new_r22))+(((-1.0)*new_r10))))))+IKsqr(((x222.value)*((((new_r10*new_r22))+new_r01))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((x221.value)*(((((-1.0)*new_r01*new_r22))+(((-1.0)*new_r10))))), ((x222.value)*((((new_r10*new_r22))+new_r01))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[10];
IkReal x223=IKsin(j5);
IkReal x224=IKcos(j5);
IkReal x225=(cj3*new_r22);
IkReal x226=(new_r22*sj3);
IkReal x227=((1.0)*sj3);
IkReal x228=((1.0)*x224);
IkReal x229=(sj3*x223);
IkReal x230=((1.0)*x223);
evalcond[0]=(((new_r11*sj3))+((new_r22*x223))+((cj3*new_r01)));
evalcond[1]=(((new_r01*x225))+x223+((new_r11*x226)));
evalcond[2]=((((-1.0)*x230))+((cj3*new_r10))+(((-1.0)*new_r00*x227)));
evalcond[3]=((((-1.0)*new_r01*x227))+((cj3*new_r11))+(((-1.0)*x228)));
evalcond[4]=(((x223*x225))+((sj3*x224))+new_r01);
evalcond[5]=(((new_r10*sj3))+((cj3*new_r00))+(((-1.0)*new_r22*x228)));
evalcond[6]=((((-1.0)*x225*x228))+x229+new_r00);
evalcond[7]=(((x223*x226))+(((-1.0)*cj3*x228))+new_r11);
evalcond[8]=(((new_r00*x225))+((new_r10*x226))+(((-1.0)*x228)));
evalcond[9]=((((-1.0)*cj3*x230))+new_r10+(((-1.0)*x226*x228)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x231=((1.0)*new_r01);
CheckValue<IkReal> x232=IKPowWithIntegerCheck(new_r22,-1);
if(!x232.valid){
continue;
}
if( IKabs(((x232.value)*(((((-1.0)*cj3*x231))+(((-1.0)*new_r11*sj3)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj3*new_r11))+(((-1.0)*sj3*x231)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x232.value)*(((((-1.0)*cj3*x231))+(((-1.0)*new_r11*sj3))))))+IKsqr((((cj3*new_r11))+(((-1.0)*sj3*x231))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((x232.value)*(((((-1.0)*cj3*x231))+(((-1.0)*new_r11*sj3))))), (((cj3*new_r11))+(((-1.0)*sj3*x231))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[10];
IkReal x233=IKsin(j5);
IkReal x234=IKcos(j5);
IkReal x235=(cj3*new_r22);
IkReal x236=(new_r22*sj3);
IkReal x237=((1.0)*sj3);
IkReal x238=((1.0)*x234);
IkReal x239=(sj3*x233);
IkReal x240=((1.0)*x233);
evalcond[0]=(((new_r11*sj3))+((new_r22*x233))+((cj3*new_r01)));
evalcond[1]=(((new_r11*x236))+((new_r01*x235))+x233);
evalcond[2]=(((cj3*new_r10))+(((-1.0)*x240))+(((-1.0)*new_r00*x237)));
evalcond[3]=((((-1.0)*x238))+((cj3*new_r11))+(((-1.0)*new_r01*x237)));
evalcond[4]=(((x233*x235))+new_r01+((sj3*x234)));
evalcond[5]=((((-1.0)*new_r22*x238))+((new_r10*sj3))+((cj3*new_r00)));
evalcond[6]=((((-1.0)*x235*x238))+x239+new_r00);
evalcond[7]=(((x233*x236))+(((-1.0)*cj3*x238))+new_r11);
evalcond[8]=(((new_r10*x236))+((new_r00*x235))+(((-1.0)*x238)));
evalcond[9]=((((-1.0)*cj3*x240))+(((-1.0)*x236*x238))+new_r10);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x241=cj3*cj3;
IkReal x242=(cj3*new_r22);
CheckValue<IkReal> x243=IKPowWithIntegerCheck(IKsign(((-1.0)+(((-1.0)*x241*(new_r22*new_r22)))+x241)),-1);
if(!x243.valid){
continue;
}
CheckValue<IkReal> x244 = IKatan2WithCheck(IkReal((((new_r00*sj3))+((new_r01*x242)))),IkReal(((((-1.0)*new_r00*x242))+((new_r01*sj3)))),IKFAST_ATAN2_MAGTHRESH);
if(!x244.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x243.value)))+(x244.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[10];
IkReal x245=IKsin(j5);
IkReal x246=IKcos(j5);
IkReal x247=(cj3*new_r22);
IkReal x248=(new_r22*sj3);
IkReal x249=((1.0)*sj3);
IkReal x250=((1.0)*x246);
IkReal x251=(sj3*x245);
IkReal x252=((1.0)*x245);
evalcond[0]=(((new_r11*sj3))+((new_r22*x245))+((cj3*new_r01)));
evalcond[1]=(x245+((new_r01*x247))+((new_r11*x248)));
evalcond[2]=((((-1.0)*new_r00*x249))+((cj3*new_r10))+(((-1.0)*x252)));
evalcond[3]=((((-1.0)*new_r01*x249))+((cj3*new_r11))+(((-1.0)*x250)));
evalcond[4]=(((sj3*x246))+new_r01+((x245*x247)));
evalcond[5]=(((new_r10*sj3))+((cj3*new_r00))+(((-1.0)*new_r22*x250)));
evalcond[6]=((((-1.0)*x247*x250))+x251+new_r00);
evalcond[7]=((((-1.0)*cj3*x250))+new_r11+((x245*x248)));
evalcond[8]=(((new_r00*x247))+((new_r10*x248))+(((-1.0)*x250)));
evalcond[9]=((((-1.0)*x248*x250))+(((-1.0)*cj3*x252))+new_r10);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j3, j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
} else
{
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
CheckValue<IkReal> x254=IKPowWithIntegerCheck(sj4,-1);
if(!x254.valid){
continue;
}
IkReal x253=x254.value;
CheckValue<IkReal> x255=IKPowWithIntegerCheck(new_r12,-1);
if(!x255.valid){
continue;
}
if( IKabs((x253*(x255.value)*(((1.0)+(((-1.0)*(cj4*cj4)))+(((-1.0)*(new_r02*new_r02))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r02*x253)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x253*(x255.value)*(((1.0)+(((-1.0)*(cj4*cj4)))+(((-1.0)*(new_r02*new_r02)))))))+IKsqr((new_r02*x253))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2((x253*(x255.value)*(((1.0)+(((-1.0)*(cj4*cj4)))+(((-1.0)*(new_r02*new_r02)))))), (new_r02*x253));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[8];
IkReal x256=IKcos(j3);
IkReal x257=IKsin(j3);
IkReal x258=((1.0)*sj4);
IkReal x259=(sj4*x257);
IkReal x260=(sj4*x256);
IkReal x261=(new_r02*x256);
IkReal x262=(new_r12*x257);
evalcond[0]=((((-1.0)*x256*x258))+new_r02);
evalcond[1]=((((-1.0)*x257*x258))+new_r12);
evalcond[2]=(((new_r12*x256))+(((-1.0)*new_r02*x257)));
evalcond[3]=(x261+x262+(((-1.0)*x258)));
evalcond[4]=(((cj4*new_r20))+((new_r00*x260))+((new_r10*x259)));
evalcond[5]=(((cj4*new_r21))+((new_r01*x260))+((new_r11*x259)));
evalcond[6]=((-1.0)+((cj4*new_r22))+((new_r12*x259))+((new_r02*x260)));
evalcond[7]=(((cj4*x261))+((cj4*x262))+(((-1.0)*new_r22*x258)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
IkReal j5eval[3];
j5eval[0]=sj4;
j5eval[1]=IKsign(sj4);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[2];
j5eval[0]=sj3;
j5eval[1]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
{
{
IkReal j5eval[3];
j5eval[0]=cj3;
j5eval[1]=cj4;
j5eval[2]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal evalcond[5];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959)));
evalcond[1]=new_r02;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[3];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=sj4;
j5eval[1]=IKsign(sj4);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[3];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=cj4;
j5eval[1]=IKsign(cj4);
j5eval[2]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[1];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal evalcond[4];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r12;
evalcond[3]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r11))+IKsqr(new_r10)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r11), new_r10);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x263=IKsin(j5);
IkReal x264=((1.0)*(IKcos(j5)));
evalcond[0]=(x263+new_r11);
evalcond[1]=(new_r10+(((-1.0)*x264)));
evalcond[2]=((((-1.0)*x263))+(((-1.0)*new_r00)));
evalcond[3]=((((-1.0)*new_r01))+(((-1.0)*x264)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r12;
evalcond[3]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r11)+IKsqr(((-1.0)*new_r10))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r11, ((-1.0)*new_r10));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x265=IKcos(j5);
IkReal x266=((1.0)*(IKsin(j5)));
evalcond[0]=(x265+new_r10);
evalcond[1]=(new_r11+(((-1.0)*x266)));
evalcond[2]=((((-1.0)*new_r00))+(((-1.0)*x266)));
evalcond[3]=((((-1.0)*x265))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r11;
evalcond[3]=new_r10;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x267=IKcos(j5);
IkReal x268=((1.0)*(IKsin(j5)));
evalcond[0]=(x267+new_r20);
evalcond[1]=(new_r21+(((-1.0)*x268)));
evalcond[2]=((((-1.0)*new_r00))+(((-1.0)*x268)));
evalcond[3]=((((-1.0)*x267))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r11;
evalcond[3]=new_r10;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x269=IKsin(j5);
IkReal x270=((1.0)*(IKcos(j5)));
evalcond[0]=(x269+new_r21);
evalcond[1]=((((-1.0)*x270))+new_r20);
evalcond[2]=((((-1.0)*x269))+(((-1.0)*new_r00)));
evalcond[3]=((((-1.0)*x270))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r01));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x271=IKsin(j5);
IkReal x272=IKcos(j5);
IkReal x273=((-1.0)*x272);
evalcond[0]=x271;
evalcond[1]=(new_r22*x271);
evalcond[2]=x273;
evalcond[3]=(new_r22*x273);
evalcond[4]=((((-1.0)*x271))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x272))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x274=IKPowWithIntegerCheck(sj4,-1);
if(!x274.valid){
continue;
}
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*(x274.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r20*(x274.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r20*(x274.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x275=IKsin(j5);
IkReal x276=IKcos(j5);
IkReal x277=((1.0)*sj4);
IkReal x278=((1.0)*x276);
IkReal x279=((1.0)*x275);
evalcond[0]=(new_r20+((sj4*x276)));
evalcond[1]=(((cj4*x275))+new_r11);
evalcond[2]=((((-1.0)*x275*x277))+new_r21);
evalcond[3]=((((-1.0)*cj4*x278))+new_r10);
evalcond[4]=((((-1.0)*x279))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x278))+(((-1.0)*new_r01)));
evalcond[6]=(((cj4*new_r11))+(((-1.0)*new_r21*x277))+x275);
evalcond[7]=(((cj4*new_r10))+(((-1.0)*new_r20*x277))+(((-1.0)*x278)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x280=IKPowWithIntegerCheck(IKsign(cj4),-1);
if(!x280.valid){
continue;
}
CheckValue<IkReal> x281 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(new_r10),IKFAST_ATAN2_MAGTHRESH);
if(!x281.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x280.value)))+(x281.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x282=IKsin(j5);
IkReal x283=IKcos(j5);
IkReal x284=((1.0)*sj4);
IkReal x285=((1.0)*x283);
IkReal x286=((1.0)*x282);
evalcond[0]=(new_r20+((sj4*x283)));
evalcond[1]=(new_r11+((cj4*x282)));
evalcond[2]=((((-1.0)*x282*x284))+new_r21);
evalcond[3]=((((-1.0)*cj4*x285))+new_r10);
evalcond[4]=((((-1.0)*x286))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x285))+(((-1.0)*new_r01)));
evalcond[6]=(((cj4*new_r11))+x282+(((-1.0)*new_r21*x284)));
evalcond[7]=(((cj4*new_r10))+(((-1.0)*x285))+(((-1.0)*new_r20*x284)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x287=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x287.valid){
continue;
}
CheckValue<IkReal> x288 = IKatan2WithCheck(IkReal(new_r21),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH);
if(!x288.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x287.value)))+(x288.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x289=IKsin(j5);
IkReal x290=IKcos(j5);
IkReal x291=((1.0)*sj4);
IkReal x292=((1.0)*x290);
IkReal x293=((1.0)*x289);
evalcond[0]=(((sj4*x290))+new_r20);
evalcond[1]=(new_r11+((cj4*x289)));
evalcond[2]=((((-1.0)*x289*x291))+new_r21);
evalcond[3]=((((-1.0)*cj4*x292))+new_r10);
evalcond[4]=((((-1.0)*x293))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x292))+(((-1.0)*new_r01)));
evalcond[6]=((((-1.0)*new_r21*x291))+((cj4*new_r11))+x289);
evalcond[7]=((((-1.0)*new_r20*x291))+((cj4*new_r10))+(((-1.0)*x292)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959)));
evalcond[1]=new_r02;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r01)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r00, new_r01);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x294=IKcos(j5);
IkReal x295=IKsin(j5);
IkReal x296=((1.0)*cj4);
IkReal x297=((1.0)*sj4);
IkReal x298=((1.0)*x294);
IkReal x299=((1.0)*x295);
evalcond[0]=(((sj4*x294))+new_r20);
evalcond[1]=((((-1.0)*x299))+new_r00);
evalcond[2]=((((-1.0)*x298))+new_r01);
evalcond[3]=((((-1.0)*x295*x297))+new_r21);
evalcond[4]=(((cj4*x295))+(((-1.0)*new_r11)));
evalcond[5]=((((-1.0)*new_r10))+(((-1.0)*x294*x296)));
evalcond[6]=((((-1.0)*new_r11*x296))+(((-1.0)*new_r21*x297))+x295);
evalcond[7]=((((-1.0)*new_r10*x296))+(((-1.0)*new_r20*x297))+(((-1.0)*x298)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x300=IKcos(j5);
IkReal x301=IKsin(j5);
IkReal x302=((1.0)*sj3);
IkReal x303=((1.0)*x301);
IkReal x304=((1.0)*x300);
evalcond[0]=(x300+new_r20);
evalcond[1]=(new_r21+(((-1.0)*x303)));
evalcond[2]=(((sj3*x300))+new_r01);
evalcond[3]=(((sj3*x301))+new_r00);
evalcond[4]=((((-1.0)*cj3*x304))+new_r11);
evalcond[5]=((((-1.0)*new_r02*x303))+new_r10);
evalcond[6]=(((cj3*new_r10))+(((-1.0)*new_r00*x302))+(((-1.0)*x303)));
evalcond[7]=((((-1.0)*new_r01*x302))+((cj3*new_r11))+(((-1.0)*x304)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x305=IKcos(j5);
IkReal x306=IKsin(j5);
IkReal x307=((1.0)*sj3);
IkReal x308=((1.0)*x305);
evalcond[0]=(x306+new_r21);
evalcond[1]=(new_r20+(((-1.0)*x308)));
evalcond[2]=(((sj3*x305))+new_r01);
evalcond[3]=(((sj3*x306))+new_r00);
evalcond[4]=(((new_r02*x306))+new_r10);
evalcond[5]=((((-1.0)*cj3*x308))+new_r11);
evalcond[6]=((((-1.0)*x306))+((cj3*new_r10))+(((-1.0)*new_r00*x307)));
evalcond[7]=((((-1.0)*new_r01*x307))+((cj3*new_r11))+(((-1.0)*x308)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x309=((1.0)*new_r01);
if( IKabs(((((-1.0)*cj3*x309))+(((-1.0)*new_r00*sj3)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*sj3*x309))+((cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj3*x309))+(((-1.0)*new_r00*sj3))))+IKsqr(((((-1.0)*sj3*x309))+((cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((((-1.0)*cj3*x309))+(((-1.0)*new_r00*sj3))), ((((-1.0)*sj3*x309))+((cj3*new_r00))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x310=IKsin(j5);
IkReal x311=IKcos(j5);
IkReal x312=((1.0)*sj3);
IkReal x313=((1.0)*x311);
IkReal x314=(sj3*x310);
IkReal x315=((1.0)*x310);
IkReal x316=(cj3*x313);
evalcond[0]=(((new_r11*sj3))+x310+((cj3*new_r01)));
evalcond[1]=(((cj3*x310))+new_r01+((sj3*x311)));
evalcond[2]=(((new_r10*sj3))+(((-1.0)*x313))+((cj3*new_r00)));
evalcond[3]=((((-1.0)*new_r00*x312))+(((-1.0)*x315))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*x313))+((cj3*new_r11))+(((-1.0)*new_r01*x312)));
evalcond[5]=(x314+(((-1.0)*x316))+new_r00);
evalcond[6]=(x314+(((-1.0)*x316))+new_r11);
evalcond[7]=(new_r10+(((-1.0)*x311*x312))+(((-1.0)*cj3*x315)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x317=((1.0)*sj3);
if( IKabs(((((-1.0)*new_r00*x317))+((cj3*new_r01)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x317)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*x317))+((cj3*new_r01))))+IKsqr(((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x317))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((((-1.0)*new_r00*x317))+((cj3*new_r01))), ((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x317))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x318=IKsin(j5);
IkReal x319=IKcos(j5);
IkReal x320=((1.0)*sj3);
IkReal x321=((1.0)*x318);
IkReal x322=(sj3*x319);
IkReal x323=((1.0)*x319);
IkReal x324=(cj3*x321);
evalcond[0]=(((new_r10*sj3))+x319+((cj3*new_r00)));
evalcond[1]=(((new_r11*sj3))+(((-1.0)*x321))+((cj3*new_r01)));
evalcond[2]=(((cj3*x319))+new_r00+((sj3*x318)));
evalcond[3]=((((-1.0)*x321))+(((-1.0)*new_r00*x320))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*x323))+(((-1.0)*new_r01*x320))+((cj3*new_r11)));
evalcond[5]=((((-1.0)*x324))+x322+new_r01);
evalcond[6]=((((-1.0)*x324))+x322+new_r10);
evalcond[7]=((((-1.0)*cj3*x323))+(((-1.0)*x318*x320))+new_r11);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
evalcond[1]=new_r12;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r10)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r10, new_r11);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x325=IKcos(j5);
IkReal x326=IKsin(j5);
IkReal x327=((1.0)*sj4);
IkReal x328=((1.0)*x325);
IkReal x329=((1.0)*x326);
evalcond[0]=(new_r20+((new_r02*x325)));
evalcond[1]=((((-1.0)*x329))+new_r10);
evalcond[2]=((((-1.0)*x328))+new_r11);
evalcond[3]=(((cj4*x326))+new_r01);
evalcond[4]=((((-1.0)*new_r02*x329))+new_r21);
evalcond[5]=(new_r00+(((-1.0)*cj4*x328)));
evalcond[6]=(((cj4*new_r01))+x326+(((-1.0)*new_r21*x327)));
evalcond[7]=(((cj4*new_r00))+(((-1.0)*x328))+(((-1.0)*new_r20*x327)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
evalcond[1]=new_r12;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[3];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
j5eval[1]=IKsign(new_r02);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[1];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5eval[2];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
j5eval[1]=cj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
{
{
IkReal evalcond[4];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r01;
evalcond[3]=new_r00;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x330=IKcos(j5);
IkReal x331=((1.0)*(IKsin(j5)));
evalcond[0]=(x330+new_r20);
evalcond[1]=((((-1.0)*x331))+new_r21);
evalcond[2]=((((-1.0)*new_r10))+(((-1.0)*x331)));
evalcond[3]=((((-1.0)*x330))+(((-1.0)*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r01;
evalcond[3]=new_r00;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x332=IKsin(j5);
IkReal x333=((1.0)*(IKcos(j5)));
evalcond[0]=(x332+new_r21);
evalcond[1]=((((-1.0)*x333))+new_r20);
evalcond[2]=((((-1.0)*x332))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*new_r11))+(((-1.0)*x333)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=IKabs(new_r02);
evalcond[1]=new_r20;
evalcond[2]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs((cj4*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((cj4*new_r01))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((cj4*new_r01), ((-1.0)*new_r11));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x334=IKsin(j5);
IkReal x335=IKcos(j5);
IkReal x336=((1.0)*new_r00);
IkReal x337=((1.0)*new_r01);
IkReal x338=((1.0)*x335);
evalcond[0]=((((-1.0)*cj4*x337))+x334);
evalcond[1]=((((-1.0)*x334))+(((-1.0)*new_r10)));
evalcond[2]=((((-1.0)*new_r11))+(((-1.0)*x338)));
evalcond[3]=((((-1.0)*x337))+((cj4*x334)));
evalcond[4]=((((-1.0)*cj4*x338))+(((-1.0)*x336)));
evalcond[5]=((((-1.0)*cj4*x336))+(((-1.0)*x338)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x339=IKsin(j5);
IkReal x340=IKcos(j5);
IkReal x341=((-1.0)*x340);
evalcond[0]=x339;
evalcond[1]=(new_r22*x339);
evalcond[2]=x341;
evalcond[3]=(new_r22*x341);
evalcond[4]=((((-1.0)*x339))+(((-1.0)*new_r10)));
evalcond[5]=((((-1.0)*new_r11))+(((-1.0)*x340)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x342=IKPowWithIntegerCheck(new_r02,-1);
if(!x342.valid){
continue;
}
CheckValue<IkReal> x343=IKPowWithIntegerCheck(cj4,-1);
if(!x343.valid){
continue;
}
if( IKabs(((-1.0)*new_r21*(x342.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r00*(x343.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*(x342.value)))+IKsqr(((-1.0)*new_r00*(x343.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21*(x342.value)), ((-1.0)*new_r00*(x343.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x344=IKsin(j5);
IkReal x345=IKcos(j5);
IkReal x346=((1.0)*new_r00);
IkReal x347=((1.0)*new_r01);
IkReal x348=((1.0)*sj4);
IkReal x349=((1.0)*x345);
evalcond[0]=(((new_r02*x344))+new_r21);
evalcond[1]=((((-1.0)*new_r02*x349))+new_r20);
evalcond[2]=((((-1.0)*new_r10))+(((-1.0)*x344)));
evalcond[3]=((((-1.0)*new_r11))+(((-1.0)*x349)));
evalcond[4]=(((cj4*x344))+(((-1.0)*x347)));
evalcond[5]=((((-1.0)*cj4*x349))+(((-1.0)*x346)));
evalcond[6]=((((-1.0)*cj4*x347))+x344+(((-1.0)*new_r21*x348)));
evalcond[7]=((((-1.0)*cj4*x346))+(((-1.0)*new_r20*x348))+(((-1.0)*x349)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x350=IKPowWithIntegerCheck(new_r02,-1);
if(!x350.valid){
continue;
}
if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r20*(x350.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr((new_r20*(x350.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r10), (new_r20*(x350.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x351=IKsin(j5);
IkReal x352=IKcos(j5);
IkReal x353=((1.0)*new_r00);
IkReal x354=((1.0)*new_r01);
IkReal x355=((1.0)*sj4);
IkReal x356=((1.0)*x352);
evalcond[0]=(new_r21+((new_r02*x351)));
evalcond[1]=((((-1.0)*new_r02*x356))+new_r20);
evalcond[2]=((((-1.0)*x351))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*x356))+(((-1.0)*new_r11)));
evalcond[4]=((((-1.0)*x354))+((cj4*x351)));
evalcond[5]=((((-1.0)*x353))+(((-1.0)*cj4*x356)));
evalcond[6]=(x351+(((-1.0)*cj4*x354))+(((-1.0)*new_r21*x355)));
evalcond[7]=((((-1.0)*x356))+(((-1.0)*cj4*x353))+(((-1.0)*new_r20*x355)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x357 = IKatan2WithCheck(IkReal(((-1.0)*new_r21)),IkReal(new_r20),IKFAST_ATAN2_MAGTHRESH);
if(!x357.valid){
continue;
}
CheckValue<IkReal> x358=IKPowWithIntegerCheck(IKsign(new_r02),-1);
if(!x358.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(x357.value)+(((1.5707963267949)*(x358.value))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x359=IKsin(j5);
IkReal x360=IKcos(j5);
IkReal x361=((1.0)*new_r00);
IkReal x362=((1.0)*new_r01);
IkReal x363=((1.0)*sj4);
IkReal x364=((1.0)*x360);
evalcond[0]=(new_r21+((new_r02*x359)));
evalcond[1]=(new_r20+(((-1.0)*new_r02*x364)));
evalcond[2]=((((-1.0)*x359))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*x364))+(((-1.0)*new_r11)));
evalcond[4]=((((-1.0)*x362))+((cj4*x359)));
evalcond[5]=((((-1.0)*cj4*x364))+(((-1.0)*x361)));
evalcond[6]=((((-1.0)*cj4*x362))+x359+(((-1.0)*new_r21*x363)));
evalcond[7]=((((-1.0)*new_r20*x363))+(((-1.0)*cj4*x361))+(((-1.0)*x364)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r21=0;
new_r20=0;
new_r02=0;
new_r12=0;
j5eval[0]=1.0;
if( IKabs(j5eval[0]) < 0.0000000100000000 )
{
continue; // no branches [j5]
} else
{
IkReal op[2+1], zeror[2];
int numroots;
op[0]=1.0;
op[1]=0;
op[2]=-1.0;
polyroots2(op,zeror,numroots);
IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1];
int numsolutions = 0;
for(int ij5 = 0; ij5 < numroots; ++ij5)
{
IkReal htj5 = zeror[ij5];
tempj5array[0]=((2.0)*(atan(htj5)));
for(int kj5 = 0; kj5 < 1; ++kj5)
{
j5array[numsolutions] = tempj5array[kj5];
if( j5array[numsolutions] > IKPI )
{
j5array[numsolutions]-=IK2PI;
}
else if( j5array[numsolutions] < -IKPI )
{
j5array[numsolutions]+=IK2PI;
}
sj5array[numsolutions] = IKsin(j5array[numsolutions]);
cj5array[numsolutions] = IKcos(j5array[numsolutions]);
numsolutions++;
}
}
bool j5valid[2]={true,true};
_nj5 = 2;
for(int ij5 = 0; ij5 < numsolutions; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
htj5 = IKtan(j5/2);
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x366=IKPowWithIntegerCheck(sj4,-1);
if(!x366.valid){
continue;
}
IkReal x365=x366.value;
CheckValue<IkReal> x367=IKPowWithIntegerCheck(cj3,-1);
if(!x367.valid){
continue;
}
CheckValue<IkReal> x368=IKPowWithIntegerCheck(cj4,-1);
if(!x368.valid){
continue;
}
if( IKabs((x365*(x367.value)*(x368.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x365)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x365*(x367.value)*(x368.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4))))))+IKsqr(((-1.0)*new_r20*x365))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((x365*(x367.value)*(x368.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4))))), ((-1.0)*new_r20*x365));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x369=IKsin(j5);
IkReal x370=IKcos(j5);
IkReal x371=(cj3*new_r00);
IkReal x372=(cj3*cj4);
IkReal x373=(cj4*sj3);
IkReal x374=((1.0)*sj3);
IkReal x375=((1.0)*sj4);
IkReal x376=((1.0)*x370);
IkReal x377=(sj3*x369);
IkReal x378=((1.0)*x369);
evalcond[0]=(((sj4*x370))+new_r20);
evalcond[1]=((((-1.0)*x369*x375))+new_r21);
evalcond[2]=(((new_r11*sj3))+((cj4*x369))+((cj3*new_r01)));
evalcond[3]=((((-1.0)*new_r00*x374))+(((-1.0)*x378))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*x376))+((cj3*new_r11))+(((-1.0)*new_r01*x374)));
evalcond[5]=(((x369*x372))+((sj3*x370))+new_r01);
evalcond[6]=(((new_r10*sj3))+(((-1.0)*cj4*x376))+x371);
evalcond[7]=((((-1.0)*x372*x376))+x377+new_r00);
evalcond[8]=(((x369*x373))+(((-1.0)*cj3*x376))+new_r11);
evalcond[9]=((((-1.0)*x373*x376))+(((-1.0)*cj3*x378))+new_r10);
evalcond[10]=((((-1.0)*new_r21*x375))+((new_r01*x372))+x369+((new_r11*x373)));
evalcond[11]=((((-1.0)*new_r20*x375))+(((-1.0)*x376))+((cj4*x371))+((new_r10*x373)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x380=IKPowWithIntegerCheck(sj4,-1);
if(!x380.valid){
continue;
}
IkReal x379=x380.value;
CheckValue<IkReal> x381=IKPowWithIntegerCheck(sj3,-1);
if(!x381.valid){
continue;
}
if( IKabs((x379*(x381.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x379)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x379*(x381.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4))))))+IKsqr(((-1.0)*new_r20*x379))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((x379*(x381.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4))))), ((-1.0)*new_r20*x379));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x382=IKsin(j5);
IkReal x383=IKcos(j5);
IkReal x384=(cj3*new_r00);
IkReal x385=(cj3*cj4);
IkReal x386=(cj4*sj3);
IkReal x387=((1.0)*sj3);
IkReal x388=((1.0)*sj4);
IkReal x389=((1.0)*x383);
IkReal x390=(sj3*x382);
IkReal x391=((1.0)*x382);
evalcond[0]=(((sj4*x383))+new_r20);
evalcond[1]=(new_r21+(((-1.0)*x382*x388)));
evalcond[2]=(((new_r11*sj3))+((cj3*new_r01))+((cj4*x382)));
evalcond[3]=((((-1.0)*x391))+(((-1.0)*new_r00*x387))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*new_r01*x387))+((cj3*new_r11))+(((-1.0)*x389)));
evalcond[5]=(((x382*x385))+new_r01+((sj3*x383)));
evalcond[6]=(((new_r10*sj3))+x384+(((-1.0)*cj4*x389)));
evalcond[7]=(x390+new_r00+(((-1.0)*x385*x389)));
evalcond[8]=(((x382*x386))+new_r11+(((-1.0)*cj3*x389)));
evalcond[9]=((((-1.0)*cj3*x391))+(((-1.0)*x386*x389))+new_r10);
evalcond[10]=(((new_r01*x385))+x382+((new_r11*x386))+(((-1.0)*new_r21*x388)));
evalcond[11]=((((-1.0)*new_r20*x388))+((new_r10*x386))+(((-1.0)*x389))+((cj4*x384)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x392=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x392.valid){
continue;
}
CheckValue<IkReal> x393 = IKatan2WithCheck(IkReal(new_r21),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH);
if(!x393.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x392.value)))+(x393.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x394=IKsin(j5);
IkReal x395=IKcos(j5);
IkReal x396=(cj3*new_r00);
IkReal x397=(cj3*cj4);
IkReal x398=(cj4*sj3);
IkReal x399=((1.0)*sj3);
IkReal x400=((1.0)*sj4);
IkReal x401=((1.0)*x395);
IkReal x402=(sj3*x394);
IkReal x403=((1.0)*x394);
evalcond[0]=(new_r20+((sj4*x395)));
evalcond[1]=((((-1.0)*x394*x400))+new_r21);
evalcond[2]=(((new_r11*sj3))+((cj4*x394))+((cj3*new_r01)));
evalcond[3]=(((cj3*new_r10))+(((-1.0)*new_r00*x399))+(((-1.0)*x403)));
evalcond[4]=((((-1.0)*new_r01*x399))+((cj3*new_r11))+(((-1.0)*x401)));
evalcond[5]=(((x394*x397))+((sj3*x395))+new_r01);
evalcond[6]=(((new_r10*sj3))+x396+(((-1.0)*cj4*x401)));
evalcond[7]=(x402+(((-1.0)*x397*x401))+new_r00);
evalcond[8]=((((-1.0)*cj3*x401))+((x394*x398))+new_r11);
evalcond[9]=((((-1.0)*cj3*x403))+(((-1.0)*x398*x401))+new_r10);
evalcond[10]=(((new_r11*x398))+x394+((new_r01*x397))+(((-1.0)*new_r21*x400)));
evalcond[11]=(((cj4*x396))+(((-1.0)*new_r20*x400))+(((-1.0)*x401))+((new_r10*x398)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x404=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x404.valid){
continue;
}
CheckValue<IkReal> x405 = IKatan2WithCheck(IkReal(new_r21),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH);
if(!x405.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x404.value)))+(x405.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[2];
evalcond[0]=(((sj4*(IKcos(j5))))+new_r20);
evalcond[1]=((((-1.0)*sj4*(IKsin(j5))))+new_r21);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
IkReal j3eval[3];
j3eval[0]=sj4;
j3eval[1]=IKsign(sj4);
j3eval[2]=((IKabs(new_r12))+(IKabs(new_r02)));
if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
{
{
IkReal j3eval[2];
j3eval[0]=cj5;
j3eval[1]=sj4;
if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
{
{
IkReal evalcond[5];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j5)))), 6.28318530717959)));
evalcond[1]=new_r20;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(new_r10)-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2(((-1.0)*new_r00), new_r10);
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[18];
IkReal x406=IKsin(j3);
IkReal x407=IKcos(j3);
IkReal x408=((1.0)*sj4);
IkReal x409=(new_r22*x406);
IkReal x410=(sj4*x407);
IkReal x411=(new_r01*x407);
IkReal x412=(new_r11*x406);
IkReal x413=(sj4*x406);
IkReal x414=((1.0)*x406);
IkReal x415=(new_r00*x407);
IkReal x416=(new_r22*x407);
evalcond[0]=(x406+new_r00);
evalcond[1]=(x416+new_r01);
evalcond[2]=(x409+new_r11);
evalcond[3]=(new_r10+(((-1.0)*x407)));
evalcond[4]=((((-1.0)*x407*x408))+new_r02);
evalcond[5]=((((-1.0)*x406*x408))+new_r12);
evalcond[6]=(x415+((new_r10*x406)));
evalcond[7]=(((new_r12*x407))+(((-1.0)*new_r02*x414)));
evalcond[8]=(((new_r11*x407))+(((-1.0)*new_r01*x414)));
evalcond[9]=(x412+x411+new_r22);
evalcond[10]=((-1.0)+((new_r10*x407))+(((-1.0)*new_r00*x414)));
evalcond[11]=(((new_r10*x413))+((new_r00*x410)));
evalcond[12]=(((new_r22*x415))+((new_r10*x409)));
evalcond[13]=(((new_r12*x406))+(((-1.0)*x408))+((new_r02*x407)));
evalcond[14]=(((cj4*new_r21))+((new_r01*x410))+((sj4*x412)));
evalcond[15]=((-1.0)+(new_r22*new_r22)+((new_r12*x413))+((new_r02*x410)));
evalcond[16]=(((new_r12*x409))+((new_r02*x416))+(((-1.0)*new_r22*x408)));
evalcond[17]=((1.0)+((new_r22*x411))+(((-1.0)*sj4*x408))+((new_r11*x409)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j5)))), 6.28318530717959)));
evalcond[1]=new_r20;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(((-1.0)*new_r10))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2(new_r00, ((-1.0)*new_r10));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[18];
IkReal x417=IKcos(j3);
IkReal x418=IKsin(j3);
IkReal x419=((1.0)*sj4);
IkReal x420=(new_r22*x418);
IkReal x421=(sj4*x417);
IkReal x422=(new_r01*x417);
IkReal x423=(new_r11*x418);
IkReal x424=(sj4*x418);
IkReal x425=((1.0)*x418);
IkReal x426=(new_r00*x417);
IkReal x427=(new_r22*x417);
evalcond[0]=(x417+new_r10);
evalcond[1]=((((-1.0)*x425))+new_r00);
evalcond[2]=((((-1.0)*x417*x419))+new_r02);
evalcond[3]=((((-1.0)*x418*x419))+new_r12);
evalcond[4]=((((-1.0)*x427))+new_r01);
evalcond[5]=((((-1.0)*x420))+new_r11);
evalcond[6]=(x426+((new_r10*x418)));
evalcond[7]=(((new_r12*x417))+(((-1.0)*new_r02*x425)));
evalcond[8]=(((new_r11*x417))+(((-1.0)*new_r01*x425)));
evalcond[9]=((1.0)+(((-1.0)*new_r00*x425))+((new_r10*x417)));
evalcond[10]=(((new_r10*x424))+((new_r00*x421)));
evalcond[11]=(((new_r22*x426))+((new_r10*x420)));
evalcond[12]=(((new_r12*x418))+(((-1.0)*x419))+((new_r02*x417)));
evalcond[13]=(x423+x422+(((-1.0)*new_r22)));
evalcond[14]=(((sj4*x423))+((cj4*new_r21))+((new_r01*x421)));
evalcond[15]=((-1.0)+(new_r22*new_r22)+((new_r12*x424))+((new_r02*x421)));
evalcond[16]=(((new_r12*x420))+(((-1.0)*new_r22*x419))+((new_r02*x427)));
evalcond[17]=((-1.0)+((new_r22*x422))+(sj4*sj4)+((new_r11*x420)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
IkReal x428=((1.0)*new_r01);
if( IKabs(((((-1.0)*cj5*x428))+(((-1.0)*new_r00*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*sj5*x428))+((cj5*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj5*x428))+(((-1.0)*new_r00*sj5))))+IKsqr(((((-1.0)*sj5*x428))+((cj5*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2(((((-1.0)*cj5*x428))+(((-1.0)*new_r00*sj5))), ((((-1.0)*sj5*x428))+((cj5*new_r00))));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[8];
IkReal x429=IKcos(j3);
IkReal x430=IKsin(j3);
IkReal x431=((1.0)*cj5);
IkReal x432=(sj5*x430);
IkReal x433=(sj5*x429);
IkReal x434=((1.0)*x430);
IkReal x435=(x429*x431);
evalcond[0]=(sj5+((new_r11*x430))+((new_r01*x429)));
evalcond[1]=(((cj5*x430))+x433+new_r01);
evalcond[2]=((((-1.0)*x435))+x432+new_r00);
evalcond[3]=((((-1.0)*x435))+x432+new_r11);
evalcond[4]=((((-1.0)*x431))+((new_r10*x430))+((new_r00*x429)));
evalcond[5]=((((-1.0)*x430*x431))+(((-1.0)*x433))+new_r10);
evalcond[6]=((((-1.0)*new_r00*x434))+(((-1.0)*sj5))+((new_r10*x429)));
evalcond[7]=((((-1.0)*x431))+(((-1.0)*new_r01*x434))+((new_r11*x429)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
IkReal x436=((1.0)*cj5);
if( IKabs(((((-1.0)*new_r01*x436))+(((-1.0)*new_r00*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r00*x436))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r01*x436))+(((-1.0)*new_r00*sj5))))+IKsqr(((((-1.0)*new_r00*x436))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2(((((-1.0)*new_r01*x436))+(((-1.0)*new_r00*sj5))), ((((-1.0)*new_r00*x436))+((new_r01*sj5))));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[8];
IkReal x437=IKsin(j3);
IkReal x438=IKcos(j3);
IkReal x439=((1.0)*sj5);
IkReal x440=((1.0)*cj5);
IkReal x441=(cj5*x437);
IkReal x442=((1.0)*x437);
IkReal x443=(x438*x439);
evalcond[0]=(((new_r00*x438))+cj5+((new_r10*x437)));
evalcond[1]=(((cj5*x438))+new_r00+((sj5*x437)));
evalcond[2]=((((-1.0)*x443))+x441+new_r01);
evalcond[3]=((((-1.0)*x443))+x441+new_r10);
evalcond[4]=(((new_r01*x438))+(((-1.0)*x439))+((new_r11*x437)));
evalcond[5]=((((-1.0)*x437*x439))+(((-1.0)*x438*x440))+new_r11);
evalcond[6]=((((-1.0)*x439))+(((-1.0)*new_r00*x442))+((new_r10*x438)));
evalcond[7]=((((-1.0)*x440))+(((-1.0)*new_r01*x442))+((new_r11*x438)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r12))+(IKabs(new_r02)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j3eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
if( IKabs(j3eval[0]) < 0.0000010000000000 )
{
{
IkReal j3eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
if( IKabs(j3eval[0]) < 0.0000010000000000 )
{
{
IkReal j3eval[1];
new_r02=0;
new_r12=0;
new_r20=0;
new_r21=0;
j3eval[0]=((IKabs((new_r11*new_r22)))+(IKabs((new_r01*new_r22))));
if( IKabs(j3eval[0]) < 0.0000010000000000 )
{
continue; // no branches [j3]
} else
{
{
IkReal j3array[2], cj3array[2], sj3array[2];
bool j3valid[2]={false};
_nj3 = 2;
CheckValue<IkReal> x445 = IKatan2WithCheck(IkReal((new_r01*new_r22)),IkReal((new_r11*new_r22)),IKFAST_ATAN2_MAGTHRESH);
if(!x445.valid){
continue;
}
IkReal x444=x445.value;
j3array[0]=((-1.0)*x444);
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
j3array[1]=((3.14159265358979)+(((-1.0)*x444)));
sj3array[1]=IKsin(j3array[1]);
cj3array[1]=IKcos(j3array[1]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
if( j3array[1] > IKPI )
{
j3array[1]-=IK2PI;
}
else if( j3array[1] < -IKPI )
{ j3array[1]+=IK2PI;
}
j3valid[1] = true;
for(int ij3 = 0; ij3 < 2; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 2; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[5];
IkReal x446=IKsin(j3);
IkReal x447=IKcos(j3);
IkReal x448=(new_r00*x447);
IkReal x449=(new_r10*x446);
IkReal x450=((1.0)*x446);
evalcond[0]=(((new_r01*x447))+((new_r11*x446)));
evalcond[1]=(x449+x448);
evalcond[2]=((((-1.0)*new_r00*x450))+((new_r10*x447)));
evalcond[3]=((((-1.0)*new_r01*x450))+((new_r11*x447)));
evalcond[4]=(((new_r22*x448))+((new_r22*x449)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j3array[2], cj3array[2], sj3array[2];
bool j3valid[2]={false};
_nj3 = 2;
CheckValue<IkReal> x452 = IKatan2WithCheck(IkReal(new_r00),IkReal(new_r10),IKFAST_ATAN2_MAGTHRESH);
if(!x452.valid){
continue;
}
IkReal x451=x452.value;
j3array[0]=((-1.0)*x451);
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
j3array[1]=((3.14159265358979)+(((-1.0)*x451)));
sj3array[1]=IKsin(j3array[1]);
cj3array[1]=IKcos(j3array[1]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
if( j3array[1] > IKPI )
{
j3array[1]-=IK2PI;
}
else if( j3array[1] < -IKPI )
{ j3array[1]+=IK2PI;
}
j3valid[1] = true;
for(int ij3 = 0; ij3 < 2; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 2; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[5];
IkReal x453=IKcos(j3);
IkReal x454=IKsin(j3);
IkReal x455=(new_r22*x454);
IkReal x456=(new_r22*x453);
IkReal x457=((1.0)*x454);
evalcond[0]=(((new_r11*x454))+((new_r01*x453)));
evalcond[1]=(((new_r10*x453))+(((-1.0)*new_r00*x457)));
evalcond[2]=(((new_r11*x453))+(((-1.0)*new_r01*x457)));
evalcond[3]=(((new_r11*x455))+((new_r01*x456)));
evalcond[4]=(((new_r10*x455))+((new_r00*x456)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j3array[2], cj3array[2], sj3array[2];
bool j3valid[2]={false};
_nj3 = 2;
CheckValue<IkReal> x459 = IKatan2WithCheck(IkReal(new_r01),IkReal(new_r11),IKFAST_ATAN2_MAGTHRESH);
if(!x459.valid){
continue;
}
IkReal x458=x459.value;
j3array[0]=((-1.0)*x458);
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
j3array[1]=((3.14159265358979)+(((-1.0)*x458)));
sj3array[1]=IKsin(j3array[1]);
cj3array[1]=IKcos(j3array[1]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
if( j3array[1] > IKPI )
{
j3array[1]-=IK2PI;
}
else if( j3array[1] < -IKPI )
{ j3array[1]+=IK2PI;
}
j3valid[1] = true;
for(int ij3 = 0; ij3 < 2; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 2; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[5];
IkReal x460=IKcos(j3);
IkReal x461=IKsin(j3);
IkReal x462=(new_r22*x461);
IkReal x463=(new_r22*x460);
IkReal x464=((1.0)*x461);
evalcond[0]=(((new_r10*x461))+((new_r00*x460)));
evalcond[1]=(((new_r10*x460))+(((-1.0)*new_r00*x464)));
evalcond[2]=(((new_r11*x460))+(((-1.0)*new_r01*x464)));
evalcond[3]=(((new_r11*x462))+((new_r01*x463)));
evalcond[4]=(((new_r10*x462))+((new_r00*x463)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j3]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
} else
{
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
CheckValue<IkReal> x466=IKPowWithIntegerCheck(sj4,-1);
if(!x466.valid){
continue;
}
IkReal x465=x466.value;
CheckValue<IkReal> x467=IKPowWithIntegerCheck(cj5,-1);
if(!x467.valid){
continue;
}
if( IKabs((x465*(x467.value)*(((((-1.0)*cj4*new_r02*sj5))+(((-1.0)*new_r01*sj4)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r02*x465)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x465*(x467.value)*(((((-1.0)*cj4*new_r02*sj5))+(((-1.0)*new_r01*sj4))))))+IKsqr((new_r02*x465))-1) <= IKFAST_SINCOS_THRESH )
continue;
j3array[0]=IKatan2((x465*(x467.value)*(((((-1.0)*cj4*new_r02*sj5))+(((-1.0)*new_r01*sj4))))), (new_r02*x465));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[18];
IkReal x468=IKcos(j3);
IkReal x469=IKsin(j3);
IkReal x470=((1.0)*cj5);
IkReal x471=((1.0)*sj4);
IkReal x472=((1.0)*sj5);
IkReal x473=(cj4*x468);
IkReal x474=(sj4*x468);
IkReal x475=(cj4*x469);
IkReal x476=(new_r11*x469);
IkReal x477=(sj4*x469);
IkReal x478=((1.0)*x469);
evalcond[0]=((((-1.0)*x468*x471))+new_r02);
evalcond[1]=((((-1.0)*x469*x471))+new_r12);
evalcond[2]=(((new_r12*x468))+(((-1.0)*new_r02*x478)));
evalcond[3]=(((sj5*x473))+((cj5*x469))+new_r01);
evalcond[4]=(((new_r12*x469))+(((-1.0)*x471))+((new_r02*x468)));
evalcond[5]=(((new_r01*x468))+((cj4*sj5))+x476);
evalcond[6]=(new_r00+(((-1.0)*x470*x473))+((sj5*x469)));
evalcond[7]=(((sj5*x475))+(((-1.0)*x468*x470))+new_r11);
evalcond[8]=(((new_r10*x468))+(((-1.0)*new_r00*x478))+(((-1.0)*x472)));
evalcond[9]=(((new_r11*x468))+(((-1.0)*x470))+(((-1.0)*new_r01*x478)));
evalcond[10]=(((new_r10*x469))+((new_r00*x468))+(((-1.0)*cj4*x470)));
evalcond[11]=((((-1.0)*x468*x472))+new_r10+(((-1.0)*x470*x475)));
evalcond[12]=(((new_r10*x477))+((cj4*new_r20))+((new_r00*x474)));
evalcond[13]=(((new_r01*x474))+((sj4*x476))+((cj4*new_r21)));
evalcond[14]=((-1.0)+((new_r12*x477))+((cj4*new_r22))+((new_r02*x474)));
evalcond[15]=(((new_r12*x475))+(((-1.0)*new_r22*x471))+((new_r02*x473)));
evalcond[16]=(sj5+(((-1.0)*new_r21*x471))+((new_r01*x473))+((new_r11*x475)));
evalcond[17]=(((new_r10*x475))+(((-1.0)*x470))+((new_r00*x473))+(((-1.0)*new_r20*x471)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
CheckValue<IkReal> x479=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x479.valid){
continue;
}
CheckValue<IkReal> x480 = IKatan2WithCheck(IkReal(new_r12),IkReal(new_r02),IKFAST_ATAN2_MAGTHRESH);
if(!x480.valid){
continue;
}
j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x479.value)))+(x480.value));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[18];
IkReal x481=IKcos(j3);
IkReal x482=IKsin(j3);
IkReal x483=((1.0)*cj5);
IkReal x484=((1.0)*sj4);
IkReal x485=((1.0)*sj5);
IkReal x486=(cj4*x481);
IkReal x487=(sj4*x481);
IkReal x488=(cj4*x482);
IkReal x489=(new_r11*x482);
IkReal x490=(sj4*x482);
IkReal x491=((1.0)*x482);
evalcond[0]=((((-1.0)*x481*x484))+new_r02);
evalcond[1]=((((-1.0)*x482*x484))+new_r12);
evalcond[2]=((((-1.0)*new_r02*x491))+((new_r12*x481)));
evalcond[3]=(((cj5*x482))+((sj5*x486))+new_r01);
evalcond[4]=(((new_r02*x481))+(((-1.0)*x484))+((new_r12*x482)));
evalcond[5]=(((cj4*sj5))+x489+((new_r01*x481)));
evalcond[6]=((((-1.0)*x483*x486))+((sj5*x482))+new_r00);
evalcond[7]=((((-1.0)*x481*x483))+((sj5*x488))+new_r11);
evalcond[8]=((((-1.0)*new_r00*x491))+(((-1.0)*x485))+((new_r10*x481)));
evalcond[9]=((((-1.0)*new_r01*x491))+(((-1.0)*x483))+((new_r11*x481)));
evalcond[10]=(((new_r10*x482))+((new_r00*x481))+(((-1.0)*cj4*x483)));
evalcond[11]=((((-1.0)*x483*x488))+(((-1.0)*x481*x485))+new_r10);
evalcond[12]=(((cj4*new_r20))+((new_r10*x490))+((new_r00*x487)));
evalcond[13]=(((sj4*x489))+((cj4*new_r21))+((new_r01*x487)));
evalcond[14]=((-1.0)+((new_r02*x487))+((cj4*new_r22))+((new_r12*x490)));
evalcond[15]=(((new_r02*x486))+((new_r12*x488))+(((-1.0)*new_r22*x484)));
evalcond[16]=((((-1.0)*new_r21*x484))+sj5+((new_r11*x488))+((new_r01*x486)));
evalcond[17]=((((-1.0)*x483))+(((-1.0)*new_r20*x484))+((new_r10*x488))+((new_r00*x486)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
}
}
}
} else
{
{
IkReal j3array[1], cj3array[1], sj3array[1];
bool j3valid[1]={false};
_nj3 = 1;
CheckValue<IkReal> x492=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x492.valid){
continue;
}
CheckValue<IkReal> x493 = IKatan2WithCheck(IkReal(new_r12),IkReal(new_r02),IKFAST_ATAN2_MAGTHRESH);
if(!x493.valid){
continue;
}
j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x492.value)))+(x493.value));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
if( j3array[0] > IKPI )
{
j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{ j3array[0]+=IK2PI;
}
j3valid[0] = true;
for(int ij3 = 0; ij3 < 1; ++ij3)
{
if( !j3valid[ij3] )
{
continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 1; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
j3valid[iij3]=false; _ij3[1] = iij3; break;
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
{
IkReal evalcond[8];
IkReal x494=IKcos(j3);
IkReal x495=IKsin(j3);
IkReal x496=((1.0)*sj4);
IkReal x497=(sj4*x495);
IkReal x498=(sj4*x494);
IkReal x499=(new_r02*x494);
IkReal x500=(new_r12*x495);
evalcond[0]=((((-1.0)*x494*x496))+new_r02);
evalcond[1]=((((-1.0)*x495*x496))+new_r12);
evalcond[2]=((((-1.0)*new_r02*x495))+((new_r12*x494)));
evalcond[3]=((((-1.0)*x496))+x499+x500);
evalcond[4]=(((cj4*new_r20))+((new_r10*x497))+((new_r00*x498)));
evalcond[5]=(((cj4*new_r21))+((new_r11*x497))+((new_r01*x498)));
evalcond[6]=((-1.0)+((new_r02*x498))+((cj4*new_r22))+((new_r12*x497)));
evalcond[7]=(((cj4*x499))+((cj4*x500))+(((-1.0)*new_r22*x496)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
IkReal j5eval[3];
j5eval[0]=sj4;
j5eval[1]=IKsign(sj4);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[2];
j5eval[0]=sj3;
j5eval[1]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
{
{
IkReal j5eval[3];
j5eval[0]=cj3;
j5eval[1]=cj4;
j5eval[2]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal evalcond[5];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959)));
evalcond[1]=new_r02;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[3];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=sj4;
j5eval[1]=IKsign(sj4);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[3];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=cj4;
j5eval[1]=IKsign(cj4);
j5eval[2]=((IKabs(new_r11))+(IKabs(new_r10)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[1];
sj3=1.0;
cj3=0;
j3=1.5707963267949;
j5eval[0]=sj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal evalcond[4];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r12;
evalcond[3]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r11))+IKsqr(new_r10)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r11), new_r10);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x501=IKsin(j5);
IkReal x502=((1.0)*(IKcos(j5)));
evalcond[0]=(x501+new_r11);
evalcond[1]=((((-1.0)*x502))+new_r10);
evalcond[2]=((((-1.0)*new_r00))+(((-1.0)*x501)));
evalcond[3]=((((-1.0)*x502))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r12;
evalcond[3]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r11)+IKsqr(((-1.0)*new_r10))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r11, ((-1.0)*new_r10));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x503=IKcos(j5);
IkReal x504=((1.0)*(IKsin(j5)));
evalcond[0]=(x503+new_r10);
evalcond[1]=((((-1.0)*x504))+new_r11);
evalcond[2]=((((-1.0)*x504))+(((-1.0)*new_r00)));
evalcond[3]=((((-1.0)*new_r01))+(((-1.0)*x503)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r11;
evalcond[3]=new_r10;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x505=IKcos(j5);
IkReal x506=((1.0)*(IKsin(j5)));
evalcond[0]=(x505+new_r20);
evalcond[1]=((((-1.0)*x506))+new_r21);
evalcond[2]=((((-1.0)*x506))+(((-1.0)*new_r00)));
evalcond[3]=((((-1.0)*new_r01))+(((-1.0)*x505)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r11;
evalcond[3]=new_r10;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x507=IKsin(j5);
IkReal x508=((1.0)*(IKcos(j5)));
evalcond[0]=(x507+new_r21);
evalcond[1]=((((-1.0)*x508))+new_r20);
evalcond[2]=((((-1.0)*new_r00))+(((-1.0)*x507)));
evalcond[3]=((((-1.0)*x508))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r01));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x509=IKsin(j5);
IkReal x510=IKcos(j5);
IkReal x511=((-1.0)*x510);
evalcond[0]=x509;
evalcond[1]=(new_r22*x509);
evalcond[2]=x511;
evalcond[3]=(new_r22*x511);
evalcond[4]=((((-1.0)*new_r00))+(((-1.0)*x509)));
evalcond[5]=((((-1.0)*x510))+(((-1.0)*new_r01)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x512=IKPowWithIntegerCheck(sj4,-1);
if(!x512.valid){
continue;
}
if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*(x512.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r20*(x512.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r20*(x512.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x513=IKsin(j5);
IkReal x514=IKcos(j5);
IkReal x515=((1.0)*sj4);
IkReal x516=((1.0)*x514);
IkReal x517=((1.0)*x513);
evalcond[0]=(((sj4*x514))+new_r20);
evalcond[1]=(((cj4*x513))+new_r11);
evalcond[2]=((((-1.0)*x513*x515))+new_r21);
evalcond[3]=((((-1.0)*cj4*x516))+new_r10);
evalcond[4]=((((-1.0)*new_r00))+(((-1.0)*x517)));
evalcond[5]=((((-1.0)*new_r01))+(((-1.0)*x516)));
evalcond[6]=(((cj4*new_r11))+x513+(((-1.0)*new_r21*x515)));
evalcond[7]=(((cj4*new_r10))+(((-1.0)*new_r20*x515))+(((-1.0)*x516)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x518=IKPowWithIntegerCheck(IKsign(cj4),-1);
if(!x518.valid){
continue;
}
CheckValue<IkReal> x519 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(new_r10),IKFAST_ATAN2_MAGTHRESH);
if(!x519.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x518.value)))+(x519.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x520=IKsin(j5);
IkReal x521=IKcos(j5);
IkReal x522=((1.0)*sj4);
IkReal x523=((1.0)*x521);
IkReal x524=((1.0)*x520);
evalcond[0]=(new_r20+((sj4*x521)));
evalcond[1]=(((cj4*x520))+new_r11);
evalcond[2]=((((-1.0)*x520*x522))+new_r21);
evalcond[3]=(new_r10+(((-1.0)*cj4*x523)));
evalcond[4]=((((-1.0)*x524))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x523))+(((-1.0)*new_r01)));
evalcond[6]=(((cj4*new_r11))+(((-1.0)*new_r21*x522))+x520);
evalcond[7]=(((cj4*new_r10))+(((-1.0)*new_r20*x522))+(((-1.0)*x523)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x525=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x525.valid){
continue;
}
CheckValue<IkReal> x526 = IKatan2WithCheck(IkReal(new_r21),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH);
if(!x526.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x525.value)))+(x526.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x527=IKsin(j5);
IkReal x528=IKcos(j5);
IkReal x529=((1.0)*sj4);
IkReal x530=((1.0)*x528);
IkReal x531=((1.0)*x527);
evalcond[0]=(new_r20+((sj4*x528)));
evalcond[1]=(((cj4*x527))+new_r11);
evalcond[2]=((((-1.0)*x527*x529))+new_r21);
evalcond[3]=(new_r10+(((-1.0)*cj4*x530)));
evalcond[4]=((((-1.0)*x531))+(((-1.0)*new_r00)));
evalcond[5]=((((-1.0)*x530))+(((-1.0)*new_r01)));
evalcond[6]=(((cj4*new_r11))+(((-1.0)*new_r21*x529))+x527);
evalcond[7]=(((cj4*new_r10))+(((-1.0)*new_r20*x529))+(((-1.0)*x530)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959)));
evalcond[1]=new_r02;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r01)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r00, new_r01);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x532=IKcos(j5);
IkReal x533=IKsin(j5);
IkReal x534=((1.0)*cj4);
IkReal x535=((1.0)*sj4);
IkReal x536=((1.0)*x532);
IkReal x537=((1.0)*x533);
evalcond[0]=(new_r20+((sj4*x532)));
evalcond[1]=((((-1.0)*x537))+new_r00);
evalcond[2]=((((-1.0)*x536))+new_r01);
evalcond[3]=((((-1.0)*x533*x535))+new_r21);
evalcond[4]=(((cj4*x533))+(((-1.0)*new_r11)));
evalcond[5]=((((-1.0)*x532*x534))+(((-1.0)*new_r10)));
evalcond[6]=((((-1.0)*new_r21*x535))+(((-1.0)*new_r11*x534))+x533);
evalcond[7]=((((-1.0)*x536))+(((-1.0)*new_r20*x535))+(((-1.0)*new_r10*x534)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x538=IKcos(j5);
IkReal x539=IKsin(j5);
IkReal x540=((1.0)*sj3);
IkReal x541=((1.0)*x539);
IkReal x542=((1.0)*x538);
evalcond[0]=(x538+new_r20);
evalcond[1]=((((-1.0)*x541))+new_r21);
evalcond[2]=(((sj3*x538))+new_r01);
evalcond[3]=(((sj3*x539))+new_r00);
evalcond[4]=((((-1.0)*cj3*x542))+new_r11);
evalcond[5]=(new_r10+(((-1.0)*new_r02*x541)));
evalcond[6]=((((-1.0)*new_r00*x540))+(((-1.0)*x541))+((cj3*new_r10)));
evalcond[7]=((((-1.0)*new_r01*x540))+(((-1.0)*x542))+((cj3*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x543=IKcos(j5);
IkReal x544=IKsin(j5);
IkReal x545=((1.0)*sj3);
IkReal x546=((1.0)*x543);
evalcond[0]=(x544+new_r21);
evalcond[1]=((((-1.0)*x546))+new_r20);
evalcond[2]=(((sj3*x543))+new_r01);
evalcond[3]=(((sj3*x544))+new_r00);
evalcond[4]=(((new_r02*x544))+new_r10);
evalcond[5]=((((-1.0)*cj3*x546))+new_r11);
evalcond[6]=((((-1.0)*x544))+(((-1.0)*new_r00*x545))+((cj3*new_r10)));
evalcond[7]=((((-1.0)*new_r01*x545))+(((-1.0)*x546))+((cj3*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x547=((1.0)*new_r01);
if( IKabs(((((-1.0)*cj3*x547))+(((-1.0)*new_r00*sj3)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*sj3*x547))+((cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj3*x547))+(((-1.0)*new_r00*sj3))))+IKsqr(((((-1.0)*sj3*x547))+((cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((((-1.0)*cj3*x547))+(((-1.0)*new_r00*sj3))), ((((-1.0)*sj3*x547))+((cj3*new_r00))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x548=IKsin(j5);
IkReal x549=IKcos(j5);
IkReal x550=((1.0)*sj3);
IkReal x551=((1.0)*x549);
IkReal x552=(sj3*x548);
IkReal x553=((1.0)*x548);
IkReal x554=(cj3*x551);
evalcond[0]=(((new_r11*sj3))+x548+((cj3*new_r01)));
evalcond[1]=(((sj3*x549))+((cj3*x548))+new_r01);
evalcond[2]=(((new_r10*sj3))+(((-1.0)*x551))+((cj3*new_r00)));
evalcond[3]=((((-1.0)*new_r00*x550))+(((-1.0)*x553))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*new_r01*x550))+(((-1.0)*x551))+((cj3*new_r11)));
evalcond[5]=((((-1.0)*x554))+x552+new_r00);
evalcond[6]=((((-1.0)*x554))+x552+new_r11);
evalcond[7]=((((-1.0)*cj3*x553))+(((-1.0)*x549*x550))+new_r10);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
evalcond[1]=new_r20;
evalcond[2]=new_r02;
evalcond[3]=new_r12;
evalcond[4]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
IkReal x555=((1.0)*sj3);
if( IKabs(((((-1.0)*new_r00*x555))+((cj3*new_r01)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x555))+(((-1.0)*cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*x555))+((cj3*new_r01))))+IKsqr(((((-1.0)*new_r01*x555))+(((-1.0)*cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((((-1.0)*new_r00*x555))+((cj3*new_r01))), ((((-1.0)*new_r01*x555))+(((-1.0)*cj3*new_r00))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x556=IKsin(j5);
IkReal x557=IKcos(j5);
IkReal x558=((1.0)*sj3);
IkReal x559=((1.0)*x556);
IkReal x560=(sj3*x557);
IkReal x561=((1.0)*x557);
IkReal x562=(cj3*x559);
evalcond[0]=(((new_r10*sj3))+x557+((cj3*new_r00)));
evalcond[1]=(((new_r11*sj3))+(((-1.0)*x559))+((cj3*new_r01)));
evalcond[2]=(((sj3*x556))+new_r00+((cj3*x557)));
evalcond[3]=((((-1.0)*new_r00*x558))+(((-1.0)*x559))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*new_r01*x558))+((cj3*new_r11))+(((-1.0)*x561)));
evalcond[5]=(x560+new_r01+(((-1.0)*x562)));
evalcond[6]=(x560+new_r10+(((-1.0)*x562)));
evalcond[7]=((((-1.0)*x556*x558))+(((-1.0)*cj3*x561))+new_r11);
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
evalcond[1]=new_r12;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r10)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r10, new_r11);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x563=IKcos(j5);
IkReal x564=IKsin(j5);
IkReal x565=((1.0)*sj4);
IkReal x566=((1.0)*x563);
IkReal x567=((1.0)*x564);
evalcond[0]=(((new_r02*x563))+new_r20);
evalcond[1]=(new_r10+(((-1.0)*x567)));
evalcond[2]=(new_r11+(((-1.0)*x566)));
evalcond[3]=(new_r01+((cj4*x564)));
evalcond[4]=((((-1.0)*new_r02*x567))+new_r21);
evalcond[5]=((((-1.0)*cj4*x566))+new_r00);
evalcond[6]=(((cj4*new_r01))+x564+(((-1.0)*new_r21*x565)));
evalcond[7]=((((-1.0)*new_r20*x565))+((cj4*new_r00))+(((-1.0)*x566)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
evalcond[1]=new_r12;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[3];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
j5eval[1]=IKsign(new_r02);
j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
{
{
IkReal j5eval[1];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
if( IKabs(j5eval[0]) < 0.0000010000000000 )
{
{
IkReal j5eval[2];
sj3=0;
cj3=-1.0;
j3=3.14159265358979;
j5eval[0]=new_r02;
j5eval[1]=cj4;
if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
{
{
IkReal evalcond[4];
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r01;
evalcond[3]=new_r00;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(new_r21, ((-1.0)*new_r20));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x568=IKcos(j5);
IkReal x569=((1.0)*(IKsin(j5)));
evalcond[0]=(x568+new_r20);
evalcond[1]=(new_r21+(((-1.0)*x569)));
evalcond[2]=((((-1.0)*new_r10))+(((-1.0)*x569)));
evalcond[3]=((((-1.0)*x568))+(((-1.0)*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j4)))), 6.28318530717959)));
evalcond[1]=new_r22;
evalcond[2]=new_r01;
evalcond[3]=new_r00;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21), new_r20);
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[4];
IkReal x570=IKsin(j5);
IkReal x571=((1.0)*(IKcos(j5)));
evalcond[0]=(x570+new_r21);
evalcond[1]=((((-1.0)*x571))+new_r20);
evalcond[2]=((((-1.0)*x570))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*x571))+(((-1.0)*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=IKabs(new_r02);
evalcond[1]=new_r20;
evalcond[2]=new_r21;
if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs((cj4*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((cj4*new_r01))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((cj4*new_r01), ((-1.0)*new_r11));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x572=IKsin(j5);
IkReal x573=IKcos(j5);
IkReal x574=((1.0)*new_r00);
IkReal x575=((1.0)*new_r01);
IkReal x576=((1.0)*x573);
evalcond[0]=((((-1.0)*cj4*x575))+x572);
evalcond[1]=((((-1.0)*x572))+(((-1.0)*new_r10)));
evalcond[2]=((((-1.0)*x576))+(((-1.0)*new_r11)));
evalcond[3]=((((-1.0)*x575))+((cj4*x572)));
evalcond[4]=((((-1.0)*cj4*x576))+(((-1.0)*x574)));
evalcond[5]=((((-1.0)*cj4*x574))+(((-1.0)*x576)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[6];
IkReal x577=IKsin(j5);
IkReal x578=IKcos(j5);
IkReal x579=((-1.0)*x578);
evalcond[0]=x577;
evalcond[1]=(new_r22*x577);
evalcond[2]=x579;
evalcond[3]=(new_r22*x579);
evalcond[4]=((((-1.0)*x577))+(((-1.0)*new_r10)));
evalcond[5]=((((-1.0)*x578))+(((-1.0)*new_r11)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x580=IKPowWithIntegerCheck(new_r02,-1);
if(!x580.valid){
continue;
}
CheckValue<IkReal> x581=IKPowWithIntegerCheck(cj4,-1);
if(!x581.valid){
continue;
}
if( IKabs(((-1.0)*new_r21*(x580.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r00*(x581.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*(x580.value)))+IKsqr(((-1.0)*new_r00*(x581.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r21*(x580.value)), ((-1.0)*new_r00*(x581.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x582=IKsin(j5);
IkReal x583=IKcos(j5);
IkReal x584=((1.0)*new_r00);
IkReal x585=((1.0)*new_r01);
IkReal x586=((1.0)*sj4);
IkReal x587=((1.0)*x583);
evalcond[0]=(((new_r02*x582))+new_r21);
evalcond[1]=((((-1.0)*new_r02*x587))+new_r20);
evalcond[2]=((((-1.0)*x582))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*new_r11))+(((-1.0)*x587)));
evalcond[4]=(((cj4*x582))+(((-1.0)*x585)));
evalcond[5]=((((-1.0)*cj4*x587))+(((-1.0)*x584)));
evalcond[6]=((((-1.0)*cj4*x585))+(((-1.0)*new_r21*x586))+x582);
evalcond[7]=((((-1.0)*cj4*x584))+(((-1.0)*new_r20*x586))+(((-1.0)*x587)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x588=IKPowWithIntegerCheck(new_r02,-1);
if(!x588.valid){
continue;
}
if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r20*(x588.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr((new_r20*(x588.value)))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2(((-1.0)*new_r10), (new_r20*(x588.value)));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x589=IKsin(j5);
IkReal x590=IKcos(j5);
IkReal x591=((1.0)*new_r00);
IkReal x592=((1.0)*new_r01);
IkReal x593=((1.0)*sj4);
IkReal x594=((1.0)*x590);
evalcond[0]=(((new_r02*x589))+new_r21);
evalcond[1]=((((-1.0)*new_r02*x594))+new_r20);
evalcond[2]=((((-1.0)*x589))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*x594))+(((-1.0)*new_r11)));
evalcond[4]=(((cj4*x589))+(((-1.0)*x592)));
evalcond[5]=((((-1.0)*cj4*x594))+(((-1.0)*x591)));
evalcond[6]=((((-1.0)*cj4*x592))+(((-1.0)*new_r21*x593))+x589);
evalcond[7]=((((-1.0)*cj4*x591))+(((-1.0)*new_r20*x593))+(((-1.0)*x594)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x595 = IKatan2WithCheck(IkReal(((-1.0)*new_r21)),IkReal(new_r20),IKFAST_ATAN2_MAGTHRESH);
if(!x595.valid){
continue;
}
CheckValue<IkReal> x596=IKPowWithIntegerCheck(IKsign(new_r02),-1);
if(!x596.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(x595.value)+(((1.5707963267949)*(x596.value))));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[8];
IkReal x597=IKsin(j5);
IkReal x598=IKcos(j5);
IkReal x599=((1.0)*new_r00);
IkReal x600=((1.0)*new_r01);
IkReal x601=((1.0)*sj4);
IkReal x602=((1.0)*x598);
evalcond[0]=(((new_r02*x597))+new_r21);
evalcond[1]=((((-1.0)*new_r02*x602))+new_r20);
evalcond[2]=((((-1.0)*x597))+(((-1.0)*new_r10)));
evalcond[3]=((((-1.0)*new_r11))+(((-1.0)*x602)));
evalcond[4]=((((-1.0)*x600))+((cj4*x597)));
evalcond[5]=((((-1.0)*x599))+(((-1.0)*cj4*x602)));
evalcond[6]=(x597+(((-1.0)*cj4*x600))+(((-1.0)*new_r21*x601)));
evalcond[7]=((((-1.0)*cj4*x599))+(((-1.0)*new_r20*x601))+(((-1.0)*x602)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
if( IKabs(evalcond[0]) < 0.0000050000000000 )
{
bgotonextstatement=false;
{
IkReal j5eval[1];
new_r21=0;
new_r20=0;
new_r02=0;
new_r12=0;
j5eval[0]=1.0;
if( IKabs(j5eval[0]) < 0.0000000100000000 )
{
continue; // no branches [j5]
} else
{
IkReal op[2+1], zeror[2];
int numroots;
op[0]=1.0;
op[1]=0;
op[2]=-1.0;
polyroots2(op,zeror,numroots);
IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1];
int numsolutions = 0;
for(int ij5 = 0; ij5 < numroots; ++ij5)
{
IkReal htj5 = zeror[ij5];
tempj5array[0]=((2.0)*(atan(htj5)));
for(int kj5 = 0; kj5 < 1; ++kj5)
{
j5array[numsolutions] = tempj5array[kj5];
if( j5array[numsolutions] > IKPI )
{
j5array[numsolutions]-=IK2PI;
}
else if( j5array[numsolutions] < -IKPI )
{
j5array[numsolutions]+=IK2PI;
}
sj5array[numsolutions] = IKsin(j5array[numsolutions]);
cj5array[numsolutions] = IKcos(j5array[numsolutions]);
numsolutions++;
}
}
bool j5valid[2]={true,true};
_nj5 = 2;
for(int ij5 = 0; ij5 < numsolutions; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
htj5 = IKtan(j5/2);
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} while(0);
if( bgotonextstatement )
{
bool bgotonextstatement = true;
do
{
if( 1 )
{
bgotonextstatement=false;
continue; // branch miss [j5]
}
} while(0);
if( bgotonextstatement )
{
}
}
}
}
}
}
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x604=IKPowWithIntegerCheck(sj4,-1);
if(!x604.valid){
continue;
}
IkReal x603=x604.value;
CheckValue<IkReal> x605=IKPowWithIntegerCheck(cj3,-1);
if(!x605.valid){
continue;
}
CheckValue<IkReal> x606=IKPowWithIntegerCheck(cj4,-1);
if(!x606.valid){
continue;
}
if( IKabs((x603*(x605.value)*(x606.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x603)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x603*(x605.value)*(x606.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4))))))+IKsqr(((-1.0)*new_r20*x603))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((x603*(x605.value)*(x606.value)*((((new_r20*sj3))+(((-1.0)*new_r01*sj4))))), ((-1.0)*new_r20*x603));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x607=IKsin(j5);
IkReal x608=IKcos(j5);
IkReal x609=(cj3*new_r00);
IkReal x610=(cj3*cj4);
IkReal x611=(cj4*sj3);
IkReal x612=((1.0)*sj3);
IkReal x613=((1.0)*sj4);
IkReal x614=((1.0)*x608);
IkReal x615=(sj3*x607);
IkReal x616=((1.0)*x607);
evalcond[0]=(((sj4*x608))+new_r20);
evalcond[1]=((((-1.0)*x607*x613))+new_r21);
evalcond[2]=(((new_r11*sj3))+((cj3*new_r01))+((cj4*x607)));
evalcond[3]=((((-1.0)*x616))+((cj3*new_r10))+(((-1.0)*new_r00*x612)));
evalcond[4]=((((-1.0)*x614))+((cj3*new_r11))+(((-1.0)*new_r01*x612)));
evalcond[5]=(((x607*x610))+new_r01+((sj3*x608)));
evalcond[6]=(((new_r10*sj3))+(((-1.0)*cj4*x614))+x609);
evalcond[7]=((((-1.0)*x610*x614))+x615+new_r00);
evalcond[8]=((((-1.0)*cj3*x614))+((x607*x611))+new_r11);
evalcond[9]=((((-1.0)*cj3*x616))+(((-1.0)*x611*x614))+new_r10);
evalcond[10]=((((-1.0)*new_r21*x613))+((new_r11*x611))+x607+((new_r01*x610)));
evalcond[11]=(((new_r10*x611))+(((-1.0)*x614))+(((-1.0)*new_r20*x613))+((cj4*x609)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x618=IKPowWithIntegerCheck(sj4,-1);
if(!x618.valid){
continue;
}
IkReal x617=x618.value;
CheckValue<IkReal> x619=IKPowWithIntegerCheck(sj3,-1);
if(!x619.valid){
continue;
}
if( IKabs((x617*(x619.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x617)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x617*(x619.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4))))))+IKsqr(((-1.0)*new_r20*x617))-1) <= IKFAST_SINCOS_THRESH )
continue;
j5array[0]=IKatan2((x617*(x619.value)*(((((-1.0)*cj3*cj4*new_r20))+(((-1.0)*new_r00*sj4))))), ((-1.0)*new_r20*x617));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x620=IKsin(j5);
IkReal x621=IKcos(j5);
IkReal x622=(cj3*new_r00);
IkReal x623=(cj3*cj4);
IkReal x624=(cj4*sj3);
IkReal x625=((1.0)*sj3);
IkReal x626=((1.0)*sj4);
IkReal x627=((1.0)*x621);
IkReal x628=(sj3*x620);
IkReal x629=((1.0)*x620);
evalcond[0]=(((sj4*x621))+new_r20);
evalcond[1]=((((-1.0)*x620*x626))+new_r21);
evalcond[2]=(((new_r11*sj3))+((cj4*x620))+((cj3*new_r01)));
evalcond[3]=((((-1.0)*new_r00*x625))+(((-1.0)*x629))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*new_r01*x625))+(((-1.0)*x627))+((cj3*new_r11)));
evalcond[5]=(((sj3*x621))+new_r01+((x620*x623)));
evalcond[6]=(((new_r10*sj3))+(((-1.0)*cj4*x627))+x622);
evalcond[7]=((((-1.0)*x623*x627))+x628+new_r00);
evalcond[8]=(new_r11+(((-1.0)*cj3*x627))+((x620*x624)));
evalcond[9]=((((-1.0)*x624*x627))+new_r10+(((-1.0)*cj3*x629)));
evalcond[10]=(((new_r01*x623))+(((-1.0)*new_r21*x626))+((new_r11*x624))+x620);
evalcond[11]=(((cj4*x622))+(((-1.0)*x627))+((new_r10*x624))+(((-1.0)*new_r20*x626)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
} else
{
{
IkReal j5array[1], cj5array[1], sj5array[1];
bool j5valid[1]={false};
_nj5 = 1;
CheckValue<IkReal> x630=IKPowWithIntegerCheck(IKsign(sj4),-1);
if(!x630.valid){
continue;
}
CheckValue<IkReal> x631 = IKatan2WithCheck(IkReal(new_r21),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH);
if(!x631.valid){
continue;
}
j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x630.value)))+(x631.value));
sj5array[0]=IKsin(j5array[0]);
cj5array[0]=IKcos(j5array[0]);
if( j5array[0] > IKPI )
{
j5array[0]-=IK2PI;
}
else if( j5array[0] < -IKPI )
{ j5array[0]+=IK2PI;
}
j5valid[0] = true;
for(int ij5 = 0; ij5 < 1; ++ij5)
{
if( !j5valid[ij5] )
{
continue;
}
_ij5[0] = ij5; _ij5[1] = -1;
for(int iij5 = ij5+1; iij5 < 1; ++iij5)
{
if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
{
j5valid[iij5]=false; _ij5[1] = iij5; break;
}
}
j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
{
IkReal evalcond[12];
IkReal x632=IKsin(j5);
IkReal x633=IKcos(j5);
IkReal x634=(cj3*new_r00);
IkReal x635=(cj3*cj4);
IkReal x636=(cj4*sj3);
IkReal x637=((1.0)*sj3);
IkReal x638=((1.0)*sj4);
IkReal x639=((1.0)*x633);
IkReal x640=(sj3*x632);
IkReal x641=((1.0)*x632);
evalcond[0]=(((sj4*x633))+new_r20);
evalcond[1]=(new_r21+(((-1.0)*x632*x638)));
evalcond[2]=(((new_r11*sj3))+((cj4*x632))+((cj3*new_r01)));
evalcond[3]=((((-1.0)*new_r00*x637))+(((-1.0)*x641))+((cj3*new_r10)));
evalcond[4]=((((-1.0)*new_r01*x637))+(((-1.0)*x639))+((cj3*new_r11)));
evalcond[5]=(((sj3*x633))+((x632*x635))+new_r01);
evalcond[6]=(((new_r10*sj3))+(((-1.0)*cj4*x639))+x634);
evalcond[7]=((((-1.0)*x635*x639))+x640+new_r00);
evalcond[8]=(((x632*x636))+new_r11+(((-1.0)*cj3*x639)));
evalcond[9]=((((-1.0)*cj3*x641))+(((-1.0)*x636*x639))+new_r10);
evalcond[10]=(((new_r01*x635))+(((-1.0)*new_r21*x638))+((new_r11*x636))+x632);
evalcond[11]=(((cj4*x634))+(((-1.0)*x639))+(((-1.0)*new_r20*x638))+((new_r10*x636)));
if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
{
continue;
}
}
{
std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
vinfos[0].jointtype = 1;
vinfos[0].foffset = j0;
vinfos[0].indices[0] = _ij0[0];
vinfos[0].indices[1] = _ij0[1];
vinfos[0].maxsolutions = _nj0;
vinfos[1].jointtype = 1;
vinfos[1].foffset = j1;
vinfos[1].indices[0] = _ij1[0];
vinfos[1].indices[1] = _ij1[1];
vinfos[1].maxsolutions = _nj1;
vinfos[2].jointtype = 1;
vinfos[2].foffset = j2;
vinfos[2].indices[0] = _ij2[0];
vinfos[2].indices[1] = _ij2[1];
vinfos[2].maxsolutions = _nj2;
vinfos[3].jointtype = 1;
vinfos[3].foffset = j3;
vinfos[3].indices[0] = _ij3[0];
vinfos[3].indices[1] = _ij3[1];
vinfos[3].maxsolutions = _nj3;
vinfos[4].jointtype = 1;
vinfos[4].foffset = j4;
vinfos[4].indices[0] = _ij4[0];
vinfos[4].indices[1] = _ij4[1];
vinfos[4].maxsolutions = _nj4;
vinfos[5].jointtype = 1;
vinfos[5].foffset = j5;
vinfos[5].indices[0] = _ij5[0];
vinfos[5].indices[1] = _ij5[1];
vinfos[5].maxsolutions = _nj5;
std::vector<int> vfree(0);
solutions.AddSolution(vinfos,vfree);
}
}
}
}
}
}
}
}
}
}
}
}
}static inline void polyroots3(IkReal rawcoeffs[3+1], IkReal rawroots[3], int& numroots)
{
using std::complex;
if( rawcoeffs[0] == 0 ) {
// solve with one reduced degree
polyroots2(&rawcoeffs[1], &rawroots[0], numroots);
return;
}
IKFAST_ASSERT(rawcoeffs[0] != 0);
const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon();
const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon());
complex<IkReal> coeffs[3];
const int maxsteps = 110;
for(int i = 0; i < 3; ++i) {
coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]);
}
complex<IkReal> roots[3];
IkReal err[3];
roots[0] = complex<IkReal>(1,0);
roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works
err[0] = 1.0;
err[1] = 1.0;
for(int i = 2; i < 3; ++i) {
roots[i] = roots[i-1]*roots[1];
err[i] = 1.0;
}
for(int step = 0; step < maxsteps; ++step) {
bool changed = false;
for(int i = 0; i < 3; ++i) {
if ( err[i] >= tol ) {
changed = true;
// evaluate
complex<IkReal> x = roots[i] + coeffs[0];
for(int j = 1; j < 3; ++j) {
x = roots[i] * x + coeffs[j];
}
for(int j = 0; j < 3; ++j) {
if( i != j ) {
if( roots[i] != roots[j] ) {
x /= (roots[i] - roots[j]);
}
}
}
roots[i] -= x;
err[i] = abs(x);
}
}
if( !changed ) {
break;
}
}
numroots = 0;
bool visited[3] = {false};
for(int i = 0; i < 3; ++i) {
if( !visited[i] ) {
// might be a multiple root, in which case it will have more error than the other roots
// find any neighboring roots, and take the average
complex<IkReal> newroot=roots[i];
int n = 1;
for(int j = i+1; j < 3; ++j) {
// care about error in real much more than imaginary
if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) {
newroot += roots[j];
n += 1;
visited[j] = true;
}
}
if( n > 1 ) {
newroot /= n;
}
// there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt
if( IKabs(imag(newroot)) < tolsqrt ) {
rawroots[numroots++] = real(newroot);
}
}
}
}
static inline void polyroots2(IkReal rawcoeffs[2+1], IkReal rawroots[2], int& numroots) {
IkReal det = rawcoeffs[1]*rawcoeffs[1]-4*rawcoeffs[0]*rawcoeffs[2];
if( det < 0 ) {
numroots=0;
}
else if( det == 0 ) {
rawroots[0] = -0.5*rawcoeffs[1]/rawcoeffs[0];
numroots = 1;
}
else {
det = IKsqrt(det);
rawroots[0] = (-rawcoeffs[1]+det)/(2*rawcoeffs[0]);
rawroots[1] = (-rawcoeffs[1]-det)/(2*rawcoeffs[0]);//rawcoeffs[2]/(rawcoeffs[0]*rawroots[0]);
numroots = 2;
}
}
static inline void polyroots4(IkReal rawcoeffs[4+1], IkReal rawroots[4], int& numroots)
{
using std::complex;
if( rawcoeffs[0] == 0 ) {
// solve with one reduced degree
polyroots3(&rawcoeffs[1], &rawroots[0], numroots);
return;
}
IKFAST_ASSERT(rawcoeffs[0] != 0);
const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon();
const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon());
complex<IkReal> coeffs[4];
const int maxsteps = 110;
for(int i = 0; i < 4; ++i) {
coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]);
}
complex<IkReal> roots[4];
IkReal err[4];
roots[0] = complex<IkReal>(1,0);
roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works
err[0] = 1.0;
err[1] = 1.0;
for(int i = 2; i < 4; ++i) {
roots[i] = roots[i-1]*roots[1];
err[i] = 1.0;
}
for(int step = 0; step < maxsteps; ++step) {
bool changed = false;
for(int i = 0; i < 4; ++i) {
if ( err[i] >= tol ) {
changed = true;
// evaluate
complex<IkReal> x = roots[i] + coeffs[0];
for(int j = 1; j < 4; ++j) {
x = roots[i] * x + coeffs[j];
}
for(int j = 0; j < 4; ++j) {
if( i != j ) {
if( roots[i] != roots[j] ) {
x /= (roots[i] - roots[j]);
}
}
}
roots[i] -= x;
err[i] = abs(x);
}
}
if( !changed ) {
break;
}
}
numroots = 0;
bool visited[4] = {false};
for(int i = 0; i < 4; ++i) {
if( !visited[i] ) {
// might be a multiple root, in which case it will have more error than the other roots
// find any neighboring roots, and take the average
complex<IkReal> newroot=roots[i];
int n = 1;
for(int j = i+1; j < 4; ++j) {
// care about error in real much more than imaginary
if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) {
newroot += roots[j];
n += 1;
visited[j] = true;
}
}
if( n > 1 ) {
newroot /= n;
}
// there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt
if( IKabs(imag(newroot)) < tolsqrt ) {
rawroots[numroots++] = real(newroot);
}
}
}
}
};
/// solves the inverse kinematics equations.
/// \param pfree is an array specifying the free joints of the chain.
IKFAST_API bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) {
IKSolver solver;
return solver.ComputeIk(eetrans,eerot,pfree,solutions);
}
IKFAST_API bool ComputeIk2(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions, void* pOpenRAVEManip) {
IKSolver solver;
return solver.ComputeIk(eetrans,eerot,pfree,solutions);
}
IKFAST_API const char* GetKinematicsHash() { return "<robot:GenericRobot - abb_irb2600_12_165 (789336e1f68d6783c915ab72a83e56fd)>"; }
IKFAST_API const char* GetIkFastVersion() { return "0x10000049"; }
#ifdef IKFAST_NAMESPACE
} // end namespace
#endif
#ifndef IKFAST_NO_MAIN
#include <stdio.h>
#include <stdlib.h>
#ifdef IKFAST_NAMESPACE
using namespace IKFAST_NAMESPACE;
#endif
int main(int argc, char** argv)
{
if( argc != 12+GetNumFreeParameters()+1 ) {
printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n"
"Returns the ik solutions given the transformation of the end effector specified by\n"
"a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n"
"There are %d free parameters that have to be specified.\n\n",GetNumFreeParameters());
return 1;
}
IkSolutionList<IkReal> solutions;
std::vector<IkReal> vfree(GetNumFreeParameters());
IkReal eerot[9],eetrans[3];
eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]);
eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]);
eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]);
for(std::size_t i = 0; i < vfree.size(); ++i)
vfree[i] = atof(argv[13+i]);
bool bSuccess = ComputeIk(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : NULL, solutions);
if( !bSuccess ) {
fprintf(stderr,"Failed to get ik solution\n");
return -1;
}
printf("Found %d ik solutions:\n", (int)solutions.GetNumSolutions());
std::vector<IkReal> solvalues(GetNumJoints());
for(std::size_t i = 0; i < solutions.GetNumSolutions(); ++i) {
const IkSolutionBase<IkReal>& sol = solutions.GetSolution(i);
printf("sol%d (free=%d): ", (int)i, (int)sol.GetFree().size());
std::vector<IkReal> vsolfree(sol.GetFree().size());
sol.GetSolution(&solvalues[0],vsolfree.size()>0?&vsolfree[0]:NULL);
for( std::size_t j = 0; j < solvalues.size(); ++j)
printf("%.15f, ", solvalues[j]);
printf("\n");
}
return 0;
}
#endif
| [
"rmalhan0112@gmail.com"
] | rmalhan0112@gmail.com |
b860c277fdda132f4790c90b704b1455dd2d1ddb | 4c0c57f9ddb87f46d58192e1ebfd2c40f6d2c315 | /td/telegram/AudiosManager.hpp | 1e03924267a07e2b8d35f6778a29a01540f95725 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | luckydonald-backup/td | 9693cf868b3afdc5b5257e95e37af79380472d0b | 71d03f39c364367a8a7c51f783a41099297de826 | refs/heads/master | 2021-09-02T08:08:18.834827 | 2018-12-31T19:04:05 | 2017-12-31T20:08:40 | 115,928,341 | 2 | 0 | null | 2018-01-01T15:37:21 | 2018-01-01T15:37:20 | null | UTF-8 | C++ | false | false | 1,309 | hpp | //
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2017
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/AudiosManager.h"
#include "td/telegram/files/FileId.hpp"
#include "td/telegram/Photo.hpp"
#include "td/utils/logging.h"
#include "td/utils/tl_helpers.h"
namespace td {
template <class T>
void AudiosManager::store_audio(FileId file_id, T &storer) const {
auto it = audios_.find(file_id);
CHECK(it != audios_.end());
const Audio *audio = it->second.get();
store(audio->file_name, storer);
store(audio->mime_type, storer);
store(audio->duration, storer);
store(audio->title, storer);
store(audio->performer, storer);
store(audio->thumbnail, storer);
store(audio->file_id, storer);
}
template <class T>
FileId AudiosManager::parse_audio(T &parser) {
auto audio = make_unique<Audio>();
parse(audio->file_name, parser);
parse(audio->mime_type, parser);
parse(audio->duration, parser);
parse(audio->title, parser);
parse(audio->performer, parser);
parse(audio->thumbnail, parser);
parse(audio->file_id, parser);
return on_get_audio(std::move(audio), true);
}
} // namespace td
| [
"arseny30@gmail.com"
] | arseny30@gmail.com |
97b2f41b7847ecc2915e2c1cf1d1fc841d810fce | b57193090bbfa5838f1e673f37ac82ad26286b54 | /src/widget/Registry.cxx | 46a7edb349f90707d68d031700a37b52f86673c2 | [] | no_license | luckydonald-backup/beng-proxy | 8021e4fe7bb06e24b6f7d2a5464fc6051a8df25f | 34ef0a94c7005bde20390c3b60a6439cc6770573 | refs/heads/master | 2020-05-24T20:56:31.428664 | 2019-05-16T08:40:44 | 2019-05-16T09:14:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,591 | cxx | /*
* Copyright 2007-2019 Content Management AG
* All rights reserved.
*
* author: Max Kellermann <mk@cm4all.com>
*
* 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.
*
* 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
* FOUNDATION 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 "Registry.hxx"
#include "Class.hxx"
#include "translation/Service.hxx"
#include "translation/Handler.hxx"
#include "translation/Request.hxx"
#include "translation/Response.hxx"
#include "translation/Transformation.hxx"
#include "AllocatorPtr.hxx"
#include "io/Logger.hxx"
#include "util/Exception.hxx"
static void
widget_registry_lookup(struct pool &pool,
TranslationService &service,
const char *widget_type,
const TranslateHandler &handler, void *ctx,
CancellablePointer &cancel_ptr)
{
auto request = NewFromPool<TranslateRequest>(pool);
request->widget_type = widget_type;
service.SendRequest(pool, *request, handler, ctx, cancel_ptr);
}
struct WidgetRegistryLookup {
struct pool &pool;
const WidgetRegistryCallback callback;
WidgetRegistryLookup(struct pool &_pool,
WidgetRegistryCallback _callback)
:pool(_pool), callback(_callback) {}
};
static void
widget_translate_response(TranslateResponse &response, void *ctx)
{
const auto lookup = (WidgetRegistryLookup *)ctx;
assert(response.views != nullptr);
if (response.status != 0) {
lookup->callback(nullptr);
return;
}
auto cls = NewFromPool<WidgetClass>(lookup->pool);
cls->local_uri = response.local_uri;
cls->untrusted_host = response.untrusted;
cls->untrusted_prefix = response.untrusted_prefix;
cls->untrusted_site_suffix = response.untrusted_site_suffix;
cls->untrusted_raw_site_suffix = response.untrusted_raw_site_suffix;
if (cls->untrusted_host == nullptr)
/* compatibility with v0.7.16 */
cls->untrusted_host = response.host;
cls->cookie_host = response.cookie_host;
cls->group = response.widget_group;
cls->container_groups = std::move(response.container_groups);
cls->direct_addressing = response.direct_addressing;
cls->stateful = response.stateful;
cls->anchor_absolute = response.anchor_absolute;
cls->info_headers = response.widget_info;
cls->dump_headers = response.dump_headers;
cls->views.CopyChainFrom(lookup->pool, *response.views);
lookup->callback(cls);
}
static void
widget_translate_error(std::exception_ptr ep, void *ctx)
{
const auto lookup = (WidgetRegistryLookup *)ctx;
LogConcat(2, "WidgetRegistry", ep);
lookup->callback(nullptr);
}
static constexpr TranslateHandler widget_translate_handler = {
.response = widget_translate_response,
.error = widget_translate_error,
};
void
widget_class_lookup(struct pool &pool, struct pool &widget_pool,
TranslationService &service,
const char *widget_type,
WidgetRegistryCallback callback,
CancellablePointer &cancel_ptr)
{
assert(widget_type != nullptr);
auto lookup = NewFromPool<WidgetRegistryLookup>(pool, widget_pool,
callback);
widget_registry_lookup(pool, service, widget_type,
widget_translate_handler, lookup,
cancel_ptr);
}
| [
"mk@cm4all.com"
] | mk@cm4all.com |
e6e566c22c0daed0133f5f69fe3429a2619518ac | 60ea4c101c49b0293ab82bd052fe4ce7f589374a | /choice.cpp | 22fedcb2a0d52ce086274c9580576794753b065c | [] | no_license | shahrasticourt3600/Pokemon-Battle-Simulator | 0976a186d3e5918b534168f05c7fa724389a4246 | bd9f0132af808ec84f009a2d06099544ae56db61 | refs/heads/main | 2023-03-16T03:33:21.423528 | 2021-02-10T07:40:09 | 2021-02-10T07:40:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,131 | cpp | #include <iostream>
#include "choice.hpp"
using namespace std;
int chooseType(int &a){
cout << "Please enter the type of combat that you want: " <<endl;
cout << "1.Attacking type" << endl;
cout<< "2.Defending type" << endl;
cin >> a;
if (a == 1) {
cout << "You chose: Attacking type.";
return a;
}
else if(a == 2){
cout << "You chose: Defending type.";
return a;
}
else{
cout << endl;
cout << "Error... Please try again!" << endl;
cout << endl;
chooseType(a);
}
return 0;
};
int choosePokeType(int &b){
cout << " Under this genre you have 15 different types of Pokemon to pick: " << endl;
cout << "-----------------------------------" << endl;
cout << "| 1.Bug 2.Dragon 3.Electric|" << endl;
cout << "| 4.Fighting 5.Fire 6.Flying |" << endl;
cout << "| 7.Ghost 8.Grass 9.Ground |" << endl;
cout << "|10.Ice 11.Normal 12.Poison |" << endl;
cout << "|13.Psychic 14.Rock 15.Water |" << endl;
cout << "-----------------------------------" << endl;
cout << "Enter the type you want: ";
cin >>b;
if (b>15 || b<1) {
cout << endl;
cout << "Error... Please try again!" << endl;
cout << endl;
choosePokeType(b);
}
cout << endl;
return 0;
};
int choosePickType(int &c){
cout << "Now, pick a type of Pokemon you want to fight with: " << endl;
cout << "-----------------------------------" << endl;
cout << "| 1.Bug 2.Dragon 3.Electric|" << endl;
cout << "| 4.Fighting 5.Fire 6.Flying |" << endl;
cout << "| 7.Ghost 8.Grass 9.Ground |" << endl;
cout << "|10.Ice 11.Normal 12.Poison |" << endl;
cout << "|13.Psychic 14.Rock 15.Water |" << endl;
cout << "-----------------------------------" << endl;
cout << "Enter the type you want: ";
cin >> c;
if (c>15 || c<1) {
cout << endl;
cout << "Error... Please try again!" << endl;
cout << endl;
choosePokeType(c);
}
cout << endl;
return 0;
};
| [
"noreply@github.com"
] | shahrasticourt3600.noreply@github.com |
532eb5c3f7a1365c5ed9c1be27ffa5ac9e06ae86 | 1e87540d6b2173dbad358ef4a39f46c6228a3c7f | /vector_3.cpp | 1f288337707b44d068e39655caf8b799203353cc | [] | no_license | S-Ekin/myC | c842e104144f48e24a9893e1a77b91b659229bf0 | ac7c57b4672cc8ded836c179dd9117ea14556ce6 | refs/heads/master | 2023-07-09T02:56:36.999218 | 2021-08-20T00:59:58 | 2021-08-20T00:59:58 | 313,795,724 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,157 | cpp | #include <iostream>;
#include <string>;
#include <vector>;
using namespace std;
void initVector() {
int a = 34;
int& r = a;
vector<int> v = {r};
auto v1 = v;
}
// 添加
void pushFn() {
string word;
vector<string> text;
while (cin >> word) {
text.push_back(word);
}
cout << text.size() << " " << text[2] << endl;
}
// for 遍历
void forFn() {
vector<int> v(10, 4);
// vector<int> a = vector<int>(10, 4);
int index = 0;
for (auto& i : v) {
index++;
i = index + i;
cout << i << endl;
}
}
// 大写转换输出
void uPWord() {
string word;
vector<string> v;
while (cin >> word) {
v.push_back(word);
}
for (auto& str : v) {
for (char& s : str) {
s = toupper(s);
}
}
for (string i : v) {
cout << i << endl;
}
}
// 计算容器里的值
void count() {
vector<int> arr;
int t;
while (cin >> t)
{
arr.push_back(t);
}
auto size = arr.size();
for (size_t i= 0; i < size; i+=2)
{
if (i+1 < size) {
int sum = arr[i] + arr[i + 1];
cout << sum << endl;
}
}
for (size_t i = 0; i < size; i++)
{
int sum = arr[i] + arr[size - 1 - i];
cout << sum << endl;
}
}
int main3() {
uPWord();
return 0;
} | [
"sekin4866111@163.com"
] | sekin4866111@163.com |
54bfaf1d991b195a22ace4bc8920d59ae941546f | 4f7039b5c09d3e3f15cfcd22a218097a714bc64a | /include/CQChartsPlotSymbol.h | 7d32eba859a619544b872fdb8137328782d1dcd3 | [
"MIT"
] | permissive | shankarke/CQCharts | 2a2382f0e653225c0e21b6671a12f9212da769dd | 63fef63f9ba5d257d33c9f1f4a25606fb253c57f | refs/heads/master | 2022-04-26T17:55:29.336232 | 2020-04-26T23:20:13 | 2020-04-26T23:20:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,114 | h | #ifndef CQChartsPlotSymbol_H
#define CQChartsPlotSymbol_H
#include <CQChartsSymbol.h>
#include <CQChartsLength.h>
#include <QString>
#include <QBrush>
#include <QPen>
#include <vector>
class CQChartsPlotSymbolRenderer;
class CQChartsPaintDevice;
//---
/*!
* \brief plot symbol
* \ingroup Charts
*/
struct CQChartsPlotSymbol {
enum class Connect {
NONE,
LINE,
CLOSE,
STROKE,
FILL
};
struct Point {
Point(double x=0.0, double y=0.0) :
x(x), y(y) {
}
double x { 0.0 };
double y { 0.0 };
};
struct Line {
double x1 { 0.0 }, y1 { 0.0 };
double x2 { 0.0 }, y2 { 0.0 };
Connect connect { Connect::NONE };
Line(double x11, double y11, double x21, double y21, Connect connect1=Connect::NONE) :
x1(x11), y1(y11), x2(x21), y2(y21), connect(connect1) {
}
};
using Lines = std::vector<Line>;
CQChartsSymbol type { CQChartsSymbol::Type::NONE };
Lines lines;
Lines fillLines;
CQChartsPlotSymbol(CQChartsSymbol type, std::initializer_list<Line> lines,
std::initializer_list<Line> fillLines) :
type(type), lines(lines), fillLines(fillLines) {
}
};
//---
namespace CQChartsPlotSymbolMgr {
bool isSymbol(CQChartsSymbol type);
const CQChartsPlotSymbol &getSymbol(CQChartsSymbol type);
void drawSymbol (CQChartsSymbol type, CQChartsPlotSymbolRenderer *renderer);
void strokeSymbol(CQChartsSymbol type, CQChartsPlotSymbolRenderer *renderer);
void fillSymbol (CQChartsSymbol type, CQChartsPlotSymbolRenderer *renderer);
}
//---
#include <CQChartsGeom.h>
#include <QPainterPath>
class CQChartsPlot;
/*!
* \brief plot symbol renderer
* \ingroup Charts
*/
class CQChartsPlotSymbolRenderer {
public:
CQChartsPlotSymbolRenderer(CQChartsPaintDevice *painter, const CQChartsGeom::Point &p,
const CQChartsLength &size);
void drawSymbol (CQChartsSymbol type);
void strokeSymbol(CQChartsSymbol type);
void fillSymbol (CQChartsSymbol type);
//---
void moveTo(double x, double y);
void lineTo(double x, double y);
void closePath();
void stroke();
void fill();
void drawPoint(double x, double y) const;
void drawLine(double x1, double y1, double x2, double y2) const;
void fillRect(double x1, double y1, double x2, double y2) const;
void strokeCircle(double x, double y, double r) const;
void fillCircle (double x, double y, double r) const;
void mapXY(double x, double y, double &x1, double &y1) const;
double lineWidth() const;
void save () const;
void restore() const;
private:
CQChartsPaintDevice* device_ { nullptr }; //!< device
CQChartsGeom::Point p_ { 0.0, 0.0 }; //!< symbol center
CQChartsLength size_; //!< size as length
double w_ { 0.0 }; //!< line width
QPainterPath path_; //!< path
QPen strokePen_; //!< stroke pen
QBrush fillBrush_; //!< fill brush
mutable bool saved_ { false }; //!< saved
};
#endif
| [
"colinw@nc.rr.com"
] | colinw@nc.rr.com |
60ccca0d016651d83d94f12af8a8c658ecb073d7 | d89a102718ba60ee88b730d7a8c9412971e40fd9 | /External/libigl-2.1.0/include/igl/copyleft/cgal/remesh_intersections.h | 671baf118b0bfa6616e25335ae5e366f78c8ca58 | [
"GPL-1.0-or-later",
"MPL-2.0",
"GPL-3.0-only",
"MIT"
] | permissive | RokKos/eol-cloth | bd228eef04400d3199864d5d7cf60de641c88479 | b9c6f55f25ba17f33532ea5eefa41fedd29c5206 | refs/heads/master | 2021-02-18T23:08:30.700135 | 2020-03-28T10:46:48 | 2020-03-28T10:46:48 | 245,248,707 | 0 | 0 | MIT | 2020-03-05T19:20:33 | 2020-03-05T19:20:32 | null | UTF-8 | C++ | false | false | 3,408 | h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Qingnan Zhou <qnzhou@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
//
#ifndef IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
#define IGL_COPYLEFT_CGAL_REMESH_INTERSECTIONS_H
#include "../../igl_inline.h"
#include "CGAL_includes.hpp"
namespace igl
{
namespace copyleft
{
namespace cgal
{
// Remesh faces according to results of intersection detection and
// construction (e.g. from `igl::copyleft::cgal::intersect_other` or
// `igl::copyleft::cgal::SelfIntersectMesh`)
//
// Inputs:
// V #V by 3 list of vertex positions
// F #F by 3 list of triangle indices into V
// T #F list of cgal triangles
// offending #offending map taking face indices into F to pairs of order
// of first finding and list of intersection objects from all
// intersections
// stitch_all if true, merge all vertices with the same coordinate.
// Outputs:
// VV #VV by 3 list of vertex positions, if stitch_all = false then
// first #V vertices will always be V
// FF #FF by 3 list of triangle indices into V
// IF #intersecting face pairs by 2 list of intersecting face pairs,
// indexing F
// J #FF list of indices into F denoting birth triangle
// IM / stitch_all = true #VV list from 0 to #VV-1
// \ stitch_all = false #VV list of indices into VV of unique vertices.
//
template <
typename DerivedV,
typename DerivedF,
typename Kernel,
typename DerivedVV,
typename DerivedFF,
typename DerivedJ,
typename DerivedIM>
IGL_INLINE void remesh_intersections(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const std::vector<CGAL::Triangle_3<Kernel> > & T,
const std::map<
typename DerivedF::Index,
std::vector<
std::pair<typename DerivedF::Index, CGAL::Object> > > & offending,
bool stitch_all,
Eigen::PlainObjectBase<DerivedVV> & VV,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedJ> & J,
Eigen::PlainObjectBase<DerivedIM> & IM);
// Same as above except stitch_all is assumed "false"
template <
typename DerivedV,
typename DerivedF,
typename Kernel,
typename DerivedVV,
typename DerivedFF,
typename DerivedJ,
typename DerivedIM>
IGL_INLINE void remesh_intersections(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const std::vector<CGAL::Triangle_3<Kernel> > & T,
const std::map<
typename DerivedF::Index,
std::vector<
std::pair<typename DerivedF::Index, CGAL::Object> > > & offending,
Eigen::PlainObjectBase<DerivedVV> & VV,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedJ> & J,
Eigen::PlainObjectBase<DerivedIM> & IM);
}
}
}
#ifndef IGL_STATIC_LIBRARY
# include "remesh_intersections.cpp"
#endif
#endif
| [
"rok.kos@outfit7.com"
] | rok.kos@outfit7.com |
5b1a915c0f984cab9127d5d85877283d03249d47 | fb3478b6fbc2b888cd2e47d3271f79114ffc11d0 | /MissaoMapeamentoVANT/Poligono.h | e780fcc8dd729a71a0ded2bde74a00905ea19a93 | [] | no_license | arthurnader/MissaoMapeamentoVANT | d0b8e88bb28b1ed5929f410e558dc9dc36d57a4e | 58b885e7265371e3d2bcd6647d831dcb71c0a295 | refs/heads/master | 2023-05-14T15:09:20.969208 | 2021-06-04T19:04:25 | 2021-06-04T19:04:25 | 358,371,741 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 562 | h | #ifndef POLIGONO_H_INCLUDED
#define POLIGONO_H_INCLUDED
#pragma once
#include "Aresta.h"
using namespace std;
class Poligono
{
private:
vector<Point> vertices;
vector<Aresta> arestas;
double area;
bool convexo;
int numeroDeVertices;
void gerarArestas();
public:
Poligono() {};
Poligono(vector<Point> pontos);
vector<Point> getVertices();
vector<Aresta> getArestas();
void mostrarTodosVertices();
void mostrarTodasArestas();
//bool ehConvexo();
//bool contemPonto(Point* ponto);
//void calcularArea();
};
#endif // POLIGONO_H_INCLUDED
| [
"82470629+arthurnader@users.noreply.github.com"
] | 82470629+arthurnader@users.noreply.github.com |
e4808f475d0e424ba97d3cf03b8f7711ef621eee | b2e0cae83c7b16a9601b457c150930f535433272 | /CSS_343/lab4/lab4/classic.h | 301bae6ee62c15ba5052961843326d3eb1e7d639 | [
"Unlicense"
] | permissive | eocrawford/UW-CS-materials | 9d36f2bd7301d114b6e0f052e7e4acbf47834aa0 | 7c439b33d2c940520151501e3b82011803886e50 | refs/heads/master | 2021-01-22T14:38:44.956900 | 2014-08-05T17:26:43 | 2014-08-05T17:26:43 | 21,987,190 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,478 | h | #ifndef CLASSIC_H
#define CLASSIC_H
//---------------------------------------------------------------------------
// classic.h
// Classic movie implementation of Movie class
// Author(s): Mary Angelo and Ethan Crawford
// Date: Nov 14, 2007
//---------------------------------------------------------------------------
// Classic movie class: Implements a Classic Movie
//
// Assumptions:
// -- Input data is a valid format
//---------------------------------------------------------------------------
#include "stdinc.h"
#include "movie.h"
class Classic : public Movie
{
public:
// Displays formatted info
virtual void display();
// Creates a new instance of a NodeData object
virtual NodeData* create();
// Sets a key to be used in a hashtable
virtual void setKey(const string& hashKey);
// Reads a single input line, populating internal variables
virtual bool setData(ifstream& input);
// overloaded < operator
virtual bool operator<(const NodeData& b) const;
// overloaded > operator
virtual bool operator>(const NodeData& b) const;
// overloaded == operator
virtual bool operator==(const NodeData& b) const;
// overloaded != operator
virtual bool operator!=(const NodeData& b) const;
protected:
// compare method, used to implement comparison operators
virtual int compare(const NodeData& a, const NodeData& b) const;
private:
string m_info;
int m_month;
};
#endif // CLASSIC_H
| [
"ethan_crawford@hotmail.com"
] | ethan_crawford@hotmail.com |
dfa3bd1cf3f25fd3bf598ca8ce98103a638b4745 | 107bfcaeca83f7b577f7b00d2b7c15171e6a0470 | /include/agpack/preprocessor/arithmetic/dec.hpp | 4314d2f9b27c2d38ad06ca87d5f8fd2d7d62f3ed | [] | no_license | tobygz/confuse_msgpack | 0a54998a46aab5a8ee94bae90383fded9abe3578 | 5888441f7e5e7482a52f11448c61ad63b619dbdb | refs/heads/master | 2023-04-24T17:14:09.062222 | 2021-05-12T07:29:32 | 2021-05-12T07:29:32 | 366,411,467 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,595 | hpp | # /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef AGPACK_PREPROCESSOR_ARITHMETIC_DEC_HPP
# define AGPACK_PREPROCESSOR_ARITHMETIC_DEC_HPP
#
# include <agpack/preprocessor/config/config.hpp>
#
# /* AGPACK_PP_DEC */
#
# if ~AGPACK_PP_CONFIG_FLAGS() & AGPACK_PP_CONFIG_MWCC()
# define AGPACK_PP_DEC(x) AGPACK_PP_DEC_I(x)
# else
# define AGPACK_PP_DEC(x) AGPACK_PP_DEC_OO((x))
# define AGPACK_PP_DEC_OO(par) AGPACK_PP_DEC_I ## par
# endif
#
# define AGPACK_PP_DEC_I(x) AGPACK_PP_DEC_ ## x
#
# define AGPACK_PP_DEC_0 0
# define AGPACK_PP_DEC_1 0
# define AGPACK_PP_DEC_2 1
# define AGPACK_PP_DEC_3 2
# define AGPACK_PP_DEC_4 3
# define AGPACK_PP_DEC_5 4
# define AGPACK_PP_DEC_6 5
# define AGPACK_PP_DEC_7 6
# define AGPACK_PP_DEC_8 7
# define AGPACK_PP_DEC_9 8
# define AGPACK_PP_DEC_10 9
# define AGPACK_PP_DEC_11 10
# define AGPACK_PP_DEC_12 11
# define AGPACK_PP_DEC_13 12
# define AGPACK_PP_DEC_14 13
# define AGPACK_PP_DEC_15 14
# define AGPACK_PP_DEC_16 15
# define AGPACK_PP_DEC_17 16
# define AGPACK_PP_DEC_18 17
# define AGPACK_PP_DEC_19 18
# define AGPACK_PP_DEC_20 19
# define AGPACK_PP_DEC_21 20
# define AGPACK_PP_DEC_22 21
# define AGPACK_PP_DEC_23 22
# define AGPACK_PP_DEC_24 23
# define AGPACK_PP_DEC_25 24
# define AGPACK_PP_DEC_26 25
# define AGPACK_PP_DEC_27 26
# define AGPACK_PP_DEC_28 27
# define AGPACK_PP_DEC_29 28
# define AGPACK_PP_DEC_30 29
# define AGPACK_PP_DEC_31 30
# define AGPACK_PP_DEC_32 31
# define AGPACK_PP_DEC_33 32
# define AGPACK_PP_DEC_34 33
# define AGPACK_PP_DEC_35 34
# define AGPACK_PP_DEC_36 35
# define AGPACK_PP_DEC_37 36
# define AGPACK_PP_DEC_38 37
# define AGPACK_PP_DEC_39 38
# define AGPACK_PP_DEC_40 39
# define AGPACK_PP_DEC_41 40
# define AGPACK_PP_DEC_42 41
# define AGPACK_PP_DEC_43 42
# define AGPACK_PP_DEC_44 43
# define AGPACK_PP_DEC_45 44
# define AGPACK_PP_DEC_46 45
# define AGPACK_PP_DEC_47 46
# define AGPACK_PP_DEC_48 47
# define AGPACK_PP_DEC_49 48
# define AGPACK_PP_DEC_50 49
# define AGPACK_PP_DEC_51 50
# define AGPACK_PP_DEC_52 51
# define AGPACK_PP_DEC_53 52
# define AGPACK_PP_DEC_54 53
# define AGPACK_PP_DEC_55 54
# define AGPACK_PP_DEC_56 55
# define AGPACK_PP_DEC_57 56
# define AGPACK_PP_DEC_58 57
# define AGPACK_PP_DEC_59 58
# define AGPACK_PP_DEC_60 59
# define AGPACK_PP_DEC_61 60
# define AGPACK_PP_DEC_62 61
# define AGPACK_PP_DEC_63 62
# define AGPACK_PP_DEC_64 63
# define AGPACK_PP_DEC_65 64
# define AGPACK_PP_DEC_66 65
# define AGPACK_PP_DEC_67 66
# define AGPACK_PP_DEC_68 67
# define AGPACK_PP_DEC_69 68
# define AGPACK_PP_DEC_70 69
# define AGPACK_PP_DEC_71 70
# define AGPACK_PP_DEC_72 71
# define AGPACK_PP_DEC_73 72
# define AGPACK_PP_DEC_74 73
# define AGPACK_PP_DEC_75 74
# define AGPACK_PP_DEC_76 75
# define AGPACK_PP_DEC_77 76
# define AGPACK_PP_DEC_78 77
# define AGPACK_PP_DEC_79 78
# define AGPACK_PP_DEC_80 79
# define AGPACK_PP_DEC_81 80
# define AGPACK_PP_DEC_82 81
# define AGPACK_PP_DEC_83 82
# define AGPACK_PP_DEC_84 83
# define AGPACK_PP_DEC_85 84
# define AGPACK_PP_DEC_86 85
# define AGPACK_PP_DEC_87 86
# define AGPACK_PP_DEC_88 87
# define AGPACK_PP_DEC_89 88
# define AGPACK_PP_DEC_90 89
# define AGPACK_PP_DEC_91 90
# define AGPACK_PP_DEC_92 91
# define AGPACK_PP_DEC_93 92
# define AGPACK_PP_DEC_94 93
# define AGPACK_PP_DEC_95 94
# define AGPACK_PP_DEC_96 95
# define AGPACK_PP_DEC_97 96
# define AGPACK_PP_DEC_98 97
# define AGPACK_PP_DEC_99 98
# define AGPACK_PP_DEC_100 99
# define AGPACK_PP_DEC_101 100
# define AGPACK_PP_DEC_102 101
# define AGPACK_PP_DEC_103 102
# define AGPACK_PP_DEC_104 103
# define AGPACK_PP_DEC_105 104
# define AGPACK_PP_DEC_106 105
# define AGPACK_PP_DEC_107 106
# define AGPACK_PP_DEC_108 107
# define AGPACK_PP_DEC_109 108
# define AGPACK_PP_DEC_110 109
# define AGPACK_PP_DEC_111 110
# define AGPACK_PP_DEC_112 111
# define AGPACK_PP_DEC_113 112
# define AGPACK_PP_DEC_114 113
# define AGPACK_PP_DEC_115 114
# define AGPACK_PP_DEC_116 115
# define AGPACK_PP_DEC_117 116
# define AGPACK_PP_DEC_118 117
# define AGPACK_PP_DEC_119 118
# define AGPACK_PP_DEC_120 119
# define AGPACK_PP_DEC_121 120
# define AGPACK_PP_DEC_122 121
# define AGPACK_PP_DEC_123 122
# define AGPACK_PP_DEC_124 123
# define AGPACK_PP_DEC_125 124
# define AGPACK_PP_DEC_126 125
# define AGPACK_PP_DEC_127 126
# define AGPACK_PP_DEC_128 127
# define AGPACK_PP_DEC_129 128
# define AGPACK_PP_DEC_130 129
# define AGPACK_PP_DEC_131 130
# define AGPACK_PP_DEC_132 131
# define AGPACK_PP_DEC_133 132
# define AGPACK_PP_DEC_134 133
# define AGPACK_PP_DEC_135 134
# define AGPACK_PP_DEC_136 135
# define AGPACK_PP_DEC_137 136
# define AGPACK_PP_DEC_138 137
# define AGPACK_PP_DEC_139 138
# define AGPACK_PP_DEC_140 139
# define AGPACK_PP_DEC_141 140
# define AGPACK_PP_DEC_142 141
# define AGPACK_PP_DEC_143 142
# define AGPACK_PP_DEC_144 143
# define AGPACK_PP_DEC_145 144
# define AGPACK_PP_DEC_146 145
# define AGPACK_PP_DEC_147 146
# define AGPACK_PP_DEC_148 147
# define AGPACK_PP_DEC_149 148
# define AGPACK_PP_DEC_150 149
# define AGPACK_PP_DEC_151 150
# define AGPACK_PP_DEC_152 151
# define AGPACK_PP_DEC_153 152
# define AGPACK_PP_DEC_154 153
# define AGPACK_PP_DEC_155 154
# define AGPACK_PP_DEC_156 155
# define AGPACK_PP_DEC_157 156
# define AGPACK_PP_DEC_158 157
# define AGPACK_PP_DEC_159 158
# define AGPACK_PP_DEC_160 159
# define AGPACK_PP_DEC_161 160
# define AGPACK_PP_DEC_162 161
# define AGPACK_PP_DEC_163 162
# define AGPACK_PP_DEC_164 163
# define AGPACK_PP_DEC_165 164
# define AGPACK_PP_DEC_166 165
# define AGPACK_PP_DEC_167 166
# define AGPACK_PP_DEC_168 167
# define AGPACK_PP_DEC_169 168
# define AGPACK_PP_DEC_170 169
# define AGPACK_PP_DEC_171 170
# define AGPACK_PP_DEC_172 171
# define AGPACK_PP_DEC_173 172
# define AGPACK_PP_DEC_174 173
# define AGPACK_PP_DEC_175 174
# define AGPACK_PP_DEC_176 175
# define AGPACK_PP_DEC_177 176
# define AGPACK_PP_DEC_178 177
# define AGPACK_PP_DEC_179 178
# define AGPACK_PP_DEC_180 179
# define AGPACK_PP_DEC_181 180
# define AGPACK_PP_DEC_182 181
# define AGPACK_PP_DEC_183 182
# define AGPACK_PP_DEC_184 183
# define AGPACK_PP_DEC_185 184
# define AGPACK_PP_DEC_186 185
# define AGPACK_PP_DEC_187 186
# define AGPACK_PP_DEC_188 187
# define AGPACK_PP_DEC_189 188
# define AGPACK_PP_DEC_190 189
# define AGPACK_PP_DEC_191 190
# define AGPACK_PP_DEC_192 191
# define AGPACK_PP_DEC_193 192
# define AGPACK_PP_DEC_194 193
# define AGPACK_PP_DEC_195 194
# define AGPACK_PP_DEC_196 195
# define AGPACK_PP_DEC_197 196
# define AGPACK_PP_DEC_198 197
# define AGPACK_PP_DEC_199 198
# define AGPACK_PP_DEC_200 199
# define AGPACK_PP_DEC_201 200
# define AGPACK_PP_DEC_202 201
# define AGPACK_PP_DEC_203 202
# define AGPACK_PP_DEC_204 203
# define AGPACK_PP_DEC_205 204
# define AGPACK_PP_DEC_206 205
# define AGPACK_PP_DEC_207 206
# define AGPACK_PP_DEC_208 207
# define AGPACK_PP_DEC_209 208
# define AGPACK_PP_DEC_210 209
# define AGPACK_PP_DEC_211 210
# define AGPACK_PP_DEC_212 211
# define AGPACK_PP_DEC_213 212
# define AGPACK_PP_DEC_214 213
# define AGPACK_PP_DEC_215 214
# define AGPACK_PP_DEC_216 215
# define AGPACK_PP_DEC_217 216
# define AGPACK_PP_DEC_218 217
# define AGPACK_PP_DEC_219 218
# define AGPACK_PP_DEC_220 219
# define AGPACK_PP_DEC_221 220
# define AGPACK_PP_DEC_222 221
# define AGPACK_PP_DEC_223 222
# define AGPACK_PP_DEC_224 223
# define AGPACK_PP_DEC_225 224
# define AGPACK_PP_DEC_226 225
# define AGPACK_PP_DEC_227 226
# define AGPACK_PP_DEC_228 227
# define AGPACK_PP_DEC_229 228
# define AGPACK_PP_DEC_230 229
# define AGPACK_PP_DEC_231 230
# define AGPACK_PP_DEC_232 231
# define AGPACK_PP_DEC_233 232
# define AGPACK_PP_DEC_234 233
# define AGPACK_PP_DEC_235 234
# define AGPACK_PP_DEC_236 235
# define AGPACK_PP_DEC_237 236
# define AGPACK_PP_DEC_238 237
# define AGPACK_PP_DEC_239 238
# define AGPACK_PP_DEC_240 239
# define AGPACK_PP_DEC_241 240
# define AGPACK_PP_DEC_242 241
# define AGPACK_PP_DEC_243 242
# define AGPACK_PP_DEC_244 243
# define AGPACK_PP_DEC_245 244
# define AGPACK_PP_DEC_246 245
# define AGPACK_PP_DEC_247 246
# define AGPACK_PP_DEC_248 247
# define AGPACK_PP_DEC_249 248
# define AGPACK_PP_DEC_250 249
# define AGPACK_PP_DEC_251 250
# define AGPACK_PP_DEC_252 251
# define AGPACK_PP_DEC_253 252
# define AGPACK_PP_DEC_254 253
# define AGPACK_PP_DEC_255 254
# define AGPACK_PP_DEC_256 255
# define AGPACK_PP_DEC_257 256
#
# endif
| [
"2503417117@qq.com"
] | 2503417117@qq.com |
dcf29ac12d336b97d762ec2a0f82cf309772a67f | 6f9cb45bb1cf7b0105e40e0eab14382da7b8ba88 | /src/game/Quests/questmanager.h | 7012cf55127414006645312c6031054cb4b023be | [] | no_license | mehtiNET/Server | fde7f1138b14bde503abe37a267b529b6be1b6b4 | 028bafe930325744a0486f61aedc8223942642f9 | refs/heads/master | 2020-12-26T01:18:23.298585 | 2014-12-03T23:53:02 | 2014-12-03T23:53:02 | 27,513,958 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 8,242 | h | #ifndef __METIN2_SERVER_QUEST_MANAGER__
#define __METIN2_SERVER_QUEST_MANAGER__
#include <boost/unordered_map.hpp>
#include "questnpc.h"
class ITEM;
class CHARACTER;
class CDungeon;
namespace quest
{
using namespace std;
bool IsScriptTrue(const char* code, int size);
string ScriptToString(const string& str);
class CQuestManager : public singleton<CQuestManager>
{
public:
enum
{
QUEST_SKIN_NOWINDOW,
QUEST_SKIN_NORMAL,
//QUEST_SKIN_CINEMATIC,
QUEST_SKIN_SCROLL=4,
QUEST_SKIN_CINEMATIC=5,
QUEST_SKIN_COUNT
};
typedef map<string, int> TEventNameMap;
typedef map<unsigned int, PC> PCMap;
public:
CQuestManager();
virtual ~CQuestManager();
bool Initialize();
void Destroy();
bool InitializeLua();
lua_State * GetLuaState() { return L; }
void AddLuaFunctionTable(const char * c_pszName, luaL_reg * preg);
TEventNameMap m_mapEventName;
QuestState OpenState(const string& quest_name, int state_index);
void CloseState(QuestState& qs);
bool RunState(QuestState& qs);
PC * GetPC(unsigned int pc);
PC * GetPCForce(unsigned int pc); // 현재 PC를 바꾸지 않고 PC 포인터를 가져온다.
unsigned int GetCurrentNPCRace();
const string & GetCurrentQuestName();
unsigned int FindNPCIDByName(const string& name);
//void SetCurrentNPCCharacterPtr(LPCHARACTER ch) { m_pkCurrentNPC = ch; }
LPCHARACTER GetCurrentNPCCharacterPtr();
void SetCurrentEventIndex(int index) { m_iRunningEventIndex = index; }
bool UseItem(unsigned int pc, LPITEM item, bool bReceiveAll);
bool PickupItem(unsigned int pc, LPITEM item);
bool SIGUse(unsigned int pc, DWORD sig_vnum, LPITEM item, bool bReceiveAll);
bool TakeItem(unsigned int pc, unsigned int npc, LPITEM item);
LPITEM GetCurrentItem();
void ClearCurrentItem();
void SetCurrentItem(LPITEM item);
void AddServerTimer(const string& name, DWORD arg, LPEVENT event);
void ClearServerTimer(const string& name, DWORD arg);
void ClearServerTimerNotCancel(const string& name, DWORD arg);
void CancelServerTimers(DWORD arg);
void SetServerTimerArg(DWORD dwArg);
DWORD GetServerTimerArg();
// event over state and stae
bool ServerTimer(unsigned int npc, unsigned int arg);
void Login(unsigned int pc, const char * c_pszQuestName = NULL);
void Logout(unsigned int pc);
bool Timer(unsigned int pc, unsigned int npc);
bool Click(unsigned int pc, LPCHARACTER pkNPC);
void Kill(unsigned int pc, unsigned int npc);
void LevelUp(unsigned int pc);
void AttrIn(unsigned int pc, LPCHARACTER ch, int attr);
void AttrOut(unsigned int pc, LPCHARACTER ch, int attr);
bool Target(unsigned int pc, DWORD dwQuestIndex, const char * c_pszTargetName, const char * c_pszVerb);
bool GiveItemToPC(unsigned int pc, LPCHARACTER pkChr);
void Unmount(unsigned int pc);
void QuestButton(unsigned int pc, unsigned int quest_index);
void QuestInfo(unsigned int pc, unsigned int quest_index);
void EnterState(DWORD pc, DWORD quest_index, int state);
void LeaveState(DWORD pc, DWORD quest_index, int state);
void Letter(DWORD pc);
void Letter(DWORD pc, DWORD quest_index, int state);
void ItemInformer(unsigned int pc, unsigned int vnum); //독일선물기능
//
bool CheckQuestLoaded(PC* pc) { return pc && pc->IsLoaded(); }
// event occurs in one state
void Select(unsigned int pc, unsigned int selection);
void Resume(unsigned int pc);
void Input(unsigned int pc, const char* msg);
void Confirm(unsigned int pc, EQuestConfirmType confirm, unsigned int pc2 = 0);
void SelectItem(unsigned int pc, unsigned int selection);
void LogoutPC(LPCHARACTER ch);
void DisconnectPC(LPCHARACTER ch);
QuestState * GetCurrentState() { return m_CurrentRunningState; }
void LoadStartQuest(const string& quest_name, unsigned int idx);
//bool CanStartQuest(const string& quest_name, const PC& pc);
bool CanStartQuest(unsigned int quest_index, const PC& pc);
bool CanStartQuest(unsigned int quest_index);
bool CanEndQuestAtState(const string& quest_name, const string& state_name);
LPCHARACTER GetCurrentCharacterPtr() { return m_pCurrentCharacter; }
LPCHARACTER GetCurrentPartyMember() { return m_pCurrentPartyMember; }
PC * GetCurrentPC() { return m_pCurrentPC; }
LPDUNGEON GetCurrentDungeon();
void SelectDungeon(LPDUNGEON pDungeon);
void ClearScript();
void SendScript();
void AddScript(const string& str);
void BuildStateIndexToName(const char* questName);
int GetQuestStateIndex(const string& quest_name, const string& state_name);
const char* GetQuestStateName(const string& quest_name, const int state_index);
void SetSkinStyle(int iStyle);
void SetNoSend() { m_bNoSend = true; }
unsigned int LoadTimerScript(const string& name);
//unsigned int RegisterQuestName(const string& name);
void RegisterQuest(const string & name, unsigned int idx);
unsigned int GetQuestIndexByName(const string& name);
const string& GetQuestNameByIndex(unsigned int idx);
void RequestSetEventFlag(const string& name, int value);
void SetEventFlag(const string& name, int value);
int GetEventFlag(const string& name);
void BroadcastEventFlagOnLogin(LPCHARACTER ch);
void SendEventFlagList(LPCHARACTER ch);
void Reload();
//void CreateAllButton(const string& quest_name, const string& button_name);
void SetError() { m_bError = true; }
void ClearError() { m_bError = false; }
bool IsError() { return m_bError; }
void WriteRunningStateToSyserr();
#ifndef _WIN32
void QuestError(const char* func, int line, const char* fmt, ...);
#else
//void QuestError(const char* fmt, ...);
void QuestError(const char* func, int line, const char* fmt, ...);
#endif
void RegisterNPCVnum(DWORD dwVnum);
private:
LPDUNGEON m_pSelectedDungeon;
DWORD m_dwServerTimerArg;
map<pair<string, DWORD>, LPEVENT> m_mapServerTimer;
int m_iRunningEventIndex;
map<string, int> m_mapEventFlag;
void GotoSelectState(QuestState& qs);
void GotoPauseState(QuestState& qs);
void GotoEndState(QuestState& qs);
void GotoInputState(QuestState& qs);
void GotoConfirmState(QuestState& qs);
void GotoSelectItemState(QuestState& qs);
lua_State * L;
bool m_bNoSend;
set<unsigned int> m_registeredNPCVnum;
map<unsigned int, NPC> m_mapNPC;
map<string, unsigned int> m_mapNPCNameID;
map<string, unsigned int> m_mapTimerID;
QuestState * m_CurrentRunningState;
PCMap m_mapPC;
LPCHARACTER m_pCurrentCharacter;
LPCHARACTER m_pCurrentNPCCharacter;
LPCHARACTER m_pCurrentPartyMember;
PC* m_pCurrentPC;
string m_strScript;
int m_iCurrentSkin;
struct stringhash
{
size_t operator () (const string& str) const
{
const unsigned char * s = (const unsigned char*) str.c_str();
const unsigned char * end = s + str.size();
size_t h = 0;
while (s < end)
{
h *= 16777619;
h ^= (unsigned char) *(unsigned char *) (s++);
}
return h;
}
};
typedef boost::unordered_map<string, int, stringhash> THashMapQuestName;
typedef boost::unordered_map<unsigned int, vector<char> > THashMapQuestStartScript;
THashMapQuestName m_hmQuestName;
THashMapQuestStartScript m_hmQuestStartScript;
map<unsigned int, string> m_mapQuestNameByIndex;
bool m_bError;
public:
static bool ExecuteQuestScript(PC& pc, const string& quest_name, const int state, const char* code, const int code_size, vector<AArgScript*>* pChatScripts = NULL, bool bUseCache = true);
static bool ExecuteQuestScript(PC& pc, DWORD quest_index, const int state, const char* code, const int code_size, vector<AArgScript*>* pChatScripts = NULL, bool bUseCache = true);
// begin_other_pc_blcok, end_other_pc_block을 위한 객체들.
public:
void BeginOtherPCBlock(DWORD pid);
void EndOtherPCBlock();
bool IsInOtherPCBlock();
PC* GetOtherPCBlockRootPC();
private:
PC* m_pOtherPCBlockRootPC;
std::vector <DWORD> m_vecPCStack;
};
};
#endif
| [
"kevin.ryser@koweb.ch"
] | kevin.ryser@koweb.ch |
de190d1b5ecf8056800605210033ea779da149c3 | 263e7bb35a677d465138fefbf0920ec4f6927aaf | /solvers/htd-master/src/htd/GraphPreprocessorFactory.cpp | 45eb9bd4567346a9105bc96c5e378dca7191a76e | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"MIT"
] | permissive | vardigroup/TensorOrder | 4d4c7524b2e80f05790177416c681a0b894e5ef5 | 6f59e6a2ffe37aa372e128d6c5ee089376a6d8c1 | refs/heads/master | 2021-11-30T00:48:41.167751 | 2021-11-13T07:01:17 | 2021-11-13T07:01:17 | 196,642,737 | 19 | 2 | MIT | 2020-06-27T21:11:45 | 2019-07-12T20:36:28 | Python | UTF-8 | C++ | false | false | 1,482 | cpp | /*
* File: GraphPreprocessorFactory.cpp
*
* Author: ABSEHER Michael (abseher@dbai.tuwien.ac.at)
*
* Copyright 2015-2017, Michael Abseher
* E-Mail: <abseher@dbai.tuwien.ac.at>
*
* This file is part of htd.
*
* htd is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* htd is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
* You should have received a copy of the GNU General Public License
* along with htd. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HTD_HTD_GRAPHPREPROCESSORFACTORY_CPP
#define HTD_HTD_GRAPHPREPROCESSORFACTORY_CPP
#include <htd/Globals.hpp>
#include <htd/GraphPreprocessorFactory.hpp>
#include <htd/GraphPreprocessor.hpp>
htd::GraphPreprocessorFactory::GraphPreprocessorFactory(const htd::LibraryInstance * const manager) : htd::AlgorithmFactory<htd::IGraphPreprocessor>(new htd::GraphPreprocessor(manager))
{
}
htd::GraphPreprocessorFactory::~GraphPreprocessorFactory()
{
}
htd::IGraphPreprocessor * htd::GraphPreprocessorFactory::createInstance(void) const
{
return constructionTemplate_->clone();
}
#endif /* HTD_HTD_GRAPHPREPROCESSORFACTORY_CPP */
| [
"jeffreydudek@gmail.com"
] | jeffreydudek@gmail.com |
292a792816b01fd4aa012272be672988f9aa3fb3 | e94931735f9f0de03d75d0c9968fe32d2f03e344 | /programming Questions/Day4/June Long Challenge_Q5/main.cpp | 41e806363950a8978d1326c8b4a8d331d561676f | [] | no_license | agarwalsamarth/DS-Algo_Samarth-Agarwal | 925a2472fb2348a0d473d434a4f79235ed0a10fd | e6034748e698ec35f204b8ee9addbcaa5cda9547 | refs/heads/master | 2022-11-16T03:40:17.457649 | 2020-07-07T18:09:54 | 2020-07-07T18:09:54 | 271,789,265 | 0 | 0 | null | 2020-06-12T12:09:26 | 2020-06-12T12:09:26 | null | UTF-8 | C++ | false | false | 1,390 | cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll T;
cin>>T;
while(T--)
{
ll N;
cin>>N;
ll A[N][N];
ll k=1,dir=0,T=0,B=N-1,L=0,R=N-1,i,j;
while(T<=B && L<=B)
{
if(dir==0)
{
for(i=L;i<=R;i++)
{
A[T][i]=k;
k++;
}
T++;
}
else if(dir==1)
{
for(i=T;i<=B;i++)
{
A[i][R]=k;
k++;
}
R--;
}
else if(dir==2)
{
for(i=R;i>=L;i--)
{
A[B][i]=k;
k++;
}
B--;
}
else if(dir==3)
{
for(i=B;i>=T;i--)
{
A[i][L]=k;
k++;
}
L++;
}
dir++;
dir=dir%4;
}
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)
{
cout<<A[i][j]<<" ";
}
cout<<"\n";
}
cout<<"\n";
}
return 0;
}
| [
"noreply@github.com"
] | agarwalsamarth.noreply@github.com |
1cbe2f679d143d448fefaa5281ba5c045b63ba5a | 3051bd4bc0b7f3dace598880caf3364690688bc9 | /plugins/WinVST/Righteous4/Righteous4.cpp | 3c50a7493aaf77fdf72eaf7f745cdea5fc19f542 | [
"MIT"
] | permissive | Atavic/airwindows | aa6802409eb9c7254e405874a267af700cb6ba0d | ac8d974fb5bfa349af37412aa5e1fe2aeea1a8f6 | refs/heads/master | 2020-03-28T08:38:49.668758 | 2018-09-09T01:07:53 | 2018-09-09T01:07:53 | 147,978,977 | 1 | 0 | MIT | 2018-09-09T00:02:49 | 2018-09-09T00:02:49 | null | UTF-8 | C++ | false | false | 6,634 | cpp | /* ========================================
* Righteous4 - Righteous4.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */
#ifndef __Righteous4_H
#include "Righteous4.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Righteous4(audioMaster);}
Righteous4::Righteous4(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.0;
B = 0.0;
leftSampleA = 0.0;
leftSampleB = 0.0;
leftSampleC = 0.0;
leftSampleD = 0.0;
leftSampleE = 0.0;
leftSampleF = 0.0;
leftSampleG = 0.0;
leftSampleH = 0.0;
leftSampleI = 0.0;
leftSampleJ = 0.0;
leftSampleK = 0.0;
leftSampleL = 0.0;
leftSampleM = 0.0;
leftSampleN = 0.0;
leftSampleO = 0.0;
leftSampleP = 0.0;
leftSampleQ = 0.0;
leftSampleR = 0.0;
leftSampleS = 0.0;
leftSampleT = 0.0;
leftSampleU = 0.0;
leftSampleV = 0.0;
leftSampleW = 0.0;
leftSampleX = 0.0;
leftSampleY = 0.0;
leftSampleZ = 0.0;
rightSampleA = 0.0;
rightSampleB = 0.0;
rightSampleC = 0.0;
rightSampleD = 0.0;
rightSampleE = 0.0;
rightSampleF = 0.0;
rightSampleG = 0.0;
rightSampleH = 0.0;
rightSampleI = 0.0;
rightSampleJ = 0.0;
rightSampleK = 0.0;
rightSampleL = 0.0;
rightSampleM = 0.0;
rightSampleN = 0.0;
rightSampleO = 0.0;
rightSampleP = 0.0;
rightSampleQ = 0.0;
rightSampleR = 0.0;
rightSampleS = 0.0;
rightSampleT = 0.0;
rightSampleU = 0.0;
rightSampleV = 0.0;
rightSampleW = 0.0;
rightSampleX = 0.0;
rightSampleY = 0.0;
rightSampleZ = 0.0;
bynL[0] = 1000;
bynL[1] = 301;
bynL[2] = 176;
bynL[3] = 125;
bynL[4] = 97;
bynL[5] = 79;
bynL[6] = 67;
bynL[7] = 58;
bynL[8] = 51;
bynL[9] = 46;
bynL[10] = 1000;
noiseShapingL = 0.0;
lastSampleL = 0.0;
IIRsampleL = 0.0;
gwPrevL = 0.0;
gwAL = 0.0;
gwBL = 0.0;
bynR[0] = 1000;
bynR[1] = 301;
bynR[2] = 176;
bynR[3] = 125;
bynR[4] = 97;
bynR[5] = 79;
bynR[6] = 67;
bynR[7] = 58;
bynR[8] = 51;
bynR[9] = 46;
bynR[10] = 1000;
noiseShapingR = 0.0;
lastSampleR = 0.0;
IIRsampleR = 0.0;
gwPrevR = 0.0;
gwAR = 0.0;
gwBR = 0.0;
fpNShapeL = 0.0;
fpNShapeR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
_canDo.insert("x2in2out");
setNumInputs(kNumInputs);
setNumOutputs(kNumOutputs);
setUniqueID(kUniqueId);
canProcessReplacing(); // supports output replacing
canDoubleReplacing(); // supports double precision processing
programsAreChunks(true);
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}
Righteous4::~Righteous4() {}
VstInt32 Righteous4::getVendorVersion () {return 1000;}
void Righteous4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void Righteous4::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);}
//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than
//trying to do versioning and preventing people from using older versions. Maybe they like the old one!
static float pinParameter(float data)
{
if (data < 0.0f) return 0.0f;
if (data > 1.0f) return 1.0f;
return data;
}
VstInt32 Righteous4::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */
*data = chunkData;
return kNumParameters * sizeof(float);
}
VstInt32 Righteous4::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}
void Righteous4::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float Righteous4::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void Righteous4::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "LTarget", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "BtDepth", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void Righteous4::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string ((A*24.0)-28.0, text, kVstMaxParamStrLen); break;
case kParamB: switch((VstInt32)( B * 2.999 )) //0 to almost edge of # of params
{case 0: vst_strncpy (text, "16", kVstMaxParamStrLen); break;
case 1: vst_strncpy (text, "24", kVstMaxParamStrLen); break;
case 2: vst_strncpy (text, "32", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void Righteous4::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "bit", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 Righteous4::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool Righteous4::getEffectName(char* name) {
vst_strncpy(name, "Righteous4", kVstMaxProductStrLen); return true;
}
VstPlugCategory Righteous4::getPlugCategory() {return kPlugCategEffect;}
bool Righteous4::getProductString(char* text) {
vst_strncpy (text, "airwindows Righteous4", kVstMaxProductStrLen); return true;
}
bool Righteous4::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}
| [
"jinx6568@sover.net"
] | jinx6568@sover.net |
ac9af591b031c7b04eccd0e5582fc384260cbb57 | 37b8e1e748b63788a9432102e666a573f47da5f8 | /documentation/deliverables/poster/poster_data/beadpack-1-X/processor14/constant/polyMesh/boundary | 2ed4586858571bb234af2143408a2d8b6c99d356 | [] | no_license | LukasMosser/MSc_Thesis | 87c7b08f2e455ba5269d0527d30c824be3e8b99d | 96aaece76f6cd06a4a80e853c3cffdc458fa60db | refs/heads/master | 2020-04-13T15:10:04.376705 | 2016-08-30T17:41:40 | 2016-08-30T17:41:40 | 60,010,284 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,825 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format binary;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
11
(
Grainwalls
{
type patch;
nFaces 3445;
startFace 29833;
}
Left
{
type patch;
nFaces 457;
startFace 33278;
}
Right
{
type patch;
nFaces 0;
startFace 33735;
}
Bottom
{
type patch;
nFaces 346;
startFace 33735;
}
Top
{
type patch;
nFaces 0;
startFace 34081;
}
Back
{
type patch;
nFaces 0;
startFace 34081;
}
Front
{
type patch;
nFaces 0;
startFace 34081;
}
procBoundary14to13
{
type processor;
inGroups 1(processor);
nFaces 175;
startFace 34081;
matchTolerance 0.0001;
transform unknown;
myProcNo 14;
neighbProcNo 13;
}
procBoundary14to15
{
type processor;
inGroups 1(processor);
nFaces 626;
startFace 34256;
matchTolerance 0.0001;
transform unknown;
myProcNo 14;
neighbProcNo 15;
}
procBoundary14to12
{
type processor;
inGroups 1(processor);
nFaces 174;
startFace 34882;
matchTolerance 0.0001;
transform unknown;
myProcNo 14;
neighbProcNo 12;
}
procBoundary14to19
{
type processor;
inGroups 1(processor);
nFaces 67;
startFace 35056;
matchTolerance 0.0001;
transform unknown;
myProcNo 14;
neighbProcNo 19;
}
)
// ************************************************************************* //
| [
"lukas.mosser@gmail.com"
] | lukas.mosser@gmail.com | |
d64567d64ecc41bdf6b029e6e28822858cace760 | 3326db8648ecd23fabebbdece3a0db662b409664 | /Codeforces/a2oj Ladders/Div 2 C/459C - Pashmak and Buses.cpp | a87a35e08bed0e420ea78a976d890f5052af1b95 | [] | no_license | fazlerahmanejazi/Competitive-Programming | 96b9e934a72a978a9cae69ae50dd02ee84b6ca87 | 796021cdc7196d84976ee7c9e565c9e7feefce09 | refs/heads/master | 2021-11-10T08:23:31.128762 | 2019-12-24T22:11:12 | 2019-12-24T22:11:12 | 117,171,389 | 3 | 1 | null | 2021-10-30T20:31:10 | 2018-01-12T00:39:16 | C++ | UTF-8 | C++ | false | false | 1,082 | cpp | #include <bits/stdc++.h>
using namespace std ;
long long int n, k, d, curr ;
bool possible ;
int main()
{
ios_base::sync_with_stdio (false) ; cin.tie(0) ;
cin>> n >> k >> d ;
curr=1 ;
possible=false ;
for(int i=1 ; i<=d ; i++)
{
curr=curr*k ;
if(curr>=n)
{
possible=true ;
break ;
}
}
if(possible)
{
long long int a[1010][1010] ;
for (int i=1;i<=d;i++) a[i][1]=1;
int i=2;
while (i<=n)
{
int j=d; int t=1;
while (j>=1)
{
a[j][i]=a[j][i-1]+t;
if (a[j][i]>k)
{
t=1;
a[j][i]=1;
}
else t=0;
j--;
}
i++;
}
for (int i=1;i<=d;i++)
{
for (int j=1;j<=n;j++) cout<<a[i][j]<<" ";
cout <<endl;
}
}
else cout<< -1 ;
}
| [
"ahmed.belal98@gmail.com"
] | ahmed.belal98@gmail.com |
53b8d2aef87da16e6c2be114485413a01456fa24 | 30b67fd9fabda5c1350dcd2fb29973b8fd1c518f | /codeforces/TUTORIAL/DSU/B. Disjoint Sets Union 2/main.cpp | 08c9aefbec9619aa011fe5b2f2e9e8dc7caa01e1 | [] | no_license | Joey-Liu/online-judge | 97bd3025a38117de33547fdaf0382356d22b2047 | 2c48d9b7aa981d6c98cf92d80d69b0ac8f2b2aa1 | refs/heads/master | 2021-08-01T13:29:58.631190 | 2021-07-26T06:29:26 | 2021-07-26T06:29:26 | 132,420,744 | 2 | 0 | null | 2020-01-18T13:18:31 | 2018-05-07T07:05:21 | C++ | UTF-8 | C++ | false | false | 1,138 | cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int maxn = 3e5 + 10;
int par[maxn], maxi[maxn], mini[maxn], cnt[maxn];
int set_find(int a) {
return (a == par[a] ? a : par[a] = set_find(par[a]));
}
void set_join(int a, int b) {
int x = set_find(a);
int y = set_find(b);
if (x == y) {
return;
}
par[x] = y;
maxi[y] = max(maxi[y], maxi[x]);
mini[y] = min(mini[y], mini[x]);
cnt[y] += cnt[x];
}
int main() {
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int N, M;
cin >> N >> M;
for (int i = 1; i <= N; i++) {
par[i] = i;
maxi[i] = i;
mini[i] = i;
cnt[i] = 1;
}
string str;
int a, b;
for (int i = 0; i < M; i++) {
cin >> str;
if (str == "union") {
cin >> a >> b;
set_join(a, b);
} else {
cin >> a;
int x = set_find(a);
cout << mini[x] << " " << maxi[x] << " " << cnt[x] << endl;
}
}
return 0;
} | [
"joey_liucoder@163.com"
] | joey_liucoder@163.com |
30fbf51d5f7f5a4ffb9013fead05894dab37b4c1 | 30114f6730aac693971d826f58e46f6d158e6957 | /MFC/ole/acdual/initiids.cpp | 8abdf7a9be99fabb6da504648650816188b93e28 | [] | no_license | oudream/vc_example_official | 67111751a416df93cdc4b9f1048d93f482819992 | 8075deebd4755b2a7531a8f918c19ad2e82e2b23 | refs/heads/master | 2020-06-14T08:00:01.267447 | 2019-07-03T01:03:59 | 2019-07-03T01:03:59 | 194,953,887 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 589 | cpp | // initIIDs.cpp: defines IIDs for dual interfaces
// ** This must not be built with precompiled header **
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include <ole2.h>
#include <initguid.h>
//#include "acdual.h"
| [
"oudream@126.com"
] | oudream@126.com |
6b3dddfafb83daebd4207d85a1d2816564187366 | c426efb6fbfe9bdb55315063526b803c4efe24ce | /src/qt/aboutdialog.cpp | 29531fdabcf6916e6124eff506b1ec0de45a58e4 | [
"MIT"
] | permissive | mammix2/boostcoinv5 | 825430f5bc81713aa558b04e60eedd4a7158d8aa | b64a399b5a7aad30252faabaac272fadc71c3633 | refs/heads/master | 2021-04-15T17:59:19.595941 | 2018-06-20T09:20:01 | 2018-06-20T09:20:01 | 126,520,137 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 517 | cpp | #include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "clientmodel.h"
#include "util.h"
#include "version.h"
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
}
void AboutDialog::setModel(ClientModel *model)
{
if(model)
{
ui->versionLabel->setText(model->formatFullVersion());
}
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::on_buttonBox_accepted()
{
close();
}
| [
"mammix2@hotmail.com"
] | mammix2@hotmail.com |
f7e9cb891ff710300671be12a62e7478bba84481 | 92a96bbc460ec7a35369d26cd886e5004eb8dcef | /transcript/transcriptTaster.cpp | f8831b90263e30d461e795827c426cf73525b652 | [] | no_license | thisway8788/oop244 | 6af1cf91c7dbbf36d65c2e2ebf4416127102462b | ddf395ff137625b286a8430095c2b7159369f0bb | refs/heads/master | 2022-12-28T19:12:43.027293 | 2020-10-12T03:16:55 | 2020-10-12T03:16:55 | 295,812,619 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 539 | cpp | // Workshop 3:
// Version: 0.9
// Date: 10/02/2020
// Author: Fardad Soleimanloo
// Description:
// This file tests the lab section of your workshop
/////////////////////////////////////////////
#include "Transcript.h"
using namespace sdds;
int main() {
Transcript T;
T.init("Fred Soley", 5);
T.add("EAC150", 65);
T.add("DBS211", 85);
T.add("DCF255", 75);
T.add("OOP244", 95);
// Premature call to display will result an error
T.display();
T.add("WEB222", 100);
T.display();
T.deallocate();
return 0;
}
| [
"noreply@github.com"
] | thisway8788.noreply@github.com |
fe726a33b458c4ada7fe92e83c11cc744f5ff2eb | e0cd22a3dbf1589cee37c33374607ed2ce66e95e | /cpp/opensourcesrcs/ace/tests/Thread_Manager_Test.cpp | 1c5a10c1f420289565fe00f094cb1bb037c110fb | [] | no_license | CodeOpsTech/DesignPatternsCpp | 1335402e2c88a4b8715430210ec153af7bb733be | 2c67495ffdc65443fae98b2879f7b608e3562876 | refs/heads/master | 2021-01-11T19:19:48.498940 | 2017-07-19T02:52:56 | 2017-07-19T02:52:56 | 79,355,314 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,352 | cpp | // Thread_Manager_Test.cpp,v 4.59 2001/06/18 20:21:08 shuston Exp
// ============================================================================
//
// = LIBRARY
// tests
//
// = FILENAME
// Thread_Manager_Test.cpp
//
// = DESCRIPTION
// This program tests the group management mechanisms provided by
// the <ACE_Thread_Manager>, including the group signal handling,
// group suspension and resumption, and cooperative thread
// cancellation mechanisms.
//
// = AUTHOR
// Prashant Jain <pjain@cs.wustl.edu> and Douglas C. Schmidt
// <schmidt@cs.wustl.edu>
//
// ============================================================================
#include "test_config.h"
#include "ace/Thread_Manager.h"
#include "ace/Signal.h"
#include "ace/Task.h"
ACE_RCSID(tests, Thread_Manager_Test, "Thread_Manager_Test.cpp,v 4.59 2001/06/18 20:21:08 shuston Exp")
#if defined (ACE_HAS_THREADS)
// Each thread keeps track of whether it has been signalled by using a
// global array. It must be dynamically allocated to allow sizing at
// runtime, based on the number of threads.
static ACE_thread_t *signalled = 0;
static u_int n_threads = ACE_MAX_THREADS;
// Helper function that looks for an existing entry in the signalled
// array. Also finds the position of the first unused entry in the
// array, and updates if requested with the t_id.
extern "C" int
been_signalled (const ACE_thread_t t_id,
const u_int update = 0)
{
u_int unused_slot = n_threads;
for (u_int i = 0; i < n_threads; ++i)
{
if (ACE_OS::thr_equal (signalled[i], t_id))
// Already signalled.
return 1;
if (update &&
unused_slot == n_threads &&
ACE_OS::thr_equal (signalled[i],
ACE_OS::NULL_thread))
unused_slot = i;
}
if (update && unused_slot < n_threads)
// Update the array using the first unused_slot.
signalled[unused_slot] = t_id;
return 0;
}
// Synchronize starts of threads, so that they all start before the
// main thread cancels them. To avoid creating a static object, it is
// dynamically allocated, before spawning any threads.
static ACE_Barrier *thread_start = 0;
extern "C" void
handler (int /* signum */)
{
if (signalled)
{
// No printout here, to be safe. Signal handlers must not
// acquire locks, etc.
const ACE_thread_t t_id = ACE_OS::thr_self ();
// Update the signalled indication.
(void) been_signalled (t_id, 1u /* update */);
}
}
static void *
worker (int iterations)
{
#if defined (VXWORKS)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) %s: stack size is %u\n"),
ACE_OS::thr_self (),
ACE_OS::thr_min_stack ()));
#endif /* VXWORKS */
#if !defined (ACE_LACKS_UNIX_SIGNALS)
// Cache this thread's ID.
const ACE_thread_t t_id = ACE_OS::thr_self ();
#endif /* ! ACE_LACKS_UNIX_SIGNAL */
ACE_Thread_Manager *thr_mgr = ACE_Thread_Manager::instance ();
// After setting up the signal catcher, block on the start barrier.
thread_start->wait ();
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) worker starting loop\n")));
for (int i = 0; i < iterations; i++)
{
if ((i % 1000) == 0)
{
#if !defined (ACE_LACKS_UNIX_SIGNALS)
if (been_signalled (t_id))
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) had received signal\n")));
// Only test for cancellation after we've been signaled,
// to avoid race conditions for suspend() and resume().
if (thr_mgr->testcancel (ACE_Thread::self ()) != 0)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) has been cancelled "
"before iteration %d!\n"),
i));
break;
}
}
#else
if (thr_mgr->testcancel (ACE_Thread::self ()) != 0)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) has been cancelled ")
ACE_TEXT ("before iteration %d!\n"),
i));
break;
}
#endif /* ! ACE_LACKS_UNIX_SIGNAL */
ACE_OS::sleep (1);
}
}
// Destructor removes thread from Thread_Manager.
return 0;
}
static const int DEFAULT_ITERATIONS = 10000;
// Define a ACE_Task that will serve in the tests related to tasks.
class ThrMgr_Task : public ACE_Task_Base {
public:
ThrMgr_Task (ACE_Thread_Manager *);
virtual int svc (void);
static int errors;
};
int ThrMgr_Task::errors = 0;
// Just be sure to set the ACE_Thread_Manager correctly.
ThrMgr_Task::ThrMgr_Task (ACE_Thread_Manager *mgr)
: ACE_Task_Base (mgr)
{
}
// svc just waits til it's been cancelled, then exits.
int
ThrMgr_Task::svc (void)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Task 0x%x, thread %t waiting to be cancelled\n"),
this));
ACE_thread_t me = ACE_Thread::self ();
for (int i = 0; i < 30 && !this->thr_mgr ()->testcancel (me); ++i)
ACE_OS::sleep (1);
if (this->thr_mgr ()->testcancel (me))
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Task 0x%x, thread %t cancelled; exiting\n"),
this));
}
else
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Task 0x%x, thread %t was not cancelled\n"),
this));
++ThrMgr_Task::errors;
}
return 0;
}
// This function tests the task-based record keeping functions.
static int
test_task_record_keeping (ACE_Thread_Manager *mgr)
{
int status = 0;
ThrMgr_Task t1 (mgr), t2 (mgr);
int t1_grp (20), t2_grp (30);
// Start two tasks, with multiple threads per task. Make sure that
// task_all_list() works.
if (-1 == t1.activate (THR_JOINABLE, 2, 0,
ACE_DEFAULT_THREAD_PRIORITY, t1_grp))
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("activate")), 1);
if (-1 == t2.activate (THR_JOINABLE, 3, 0,
ACE_DEFAULT_THREAD_PRIORITY, t2_grp))
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("activate")), 1);
ACE_Task_Base *task_list[10];
int num_tasks = mgr->task_all_list (task_list, 10);
if (2 != num_tasks)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Expected 2 tasks; got %d\n"),
num_tasks));
status = 1;
}
else
{
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Got %d tasks - correct\n"), num_tasks));
if ((task_list[0] == &t1 || task_list[0] == &t2) &&
(task_list[1] == &t1 || task_list[0] == &t2) &&
task_list[0] != task_list[1])
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("The Task IDs are correct\n")));
else
ACE_ERROR ((LM_ERROR, ACE_TEXT ("But Task ID values are wrong!\n")));
}
ACE_DEBUG ((LM_DEBUG, "Canceling grp %d\n", t1_grp));
if (-1 == mgr->cancel_grp (t1_grp))
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("cancel_grp")),
1);
ACE_DEBUG ((LM_DEBUG, "Canceling grp %d\n", t2_grp));
if (-1 == mgr->cancel_grp (t2_grp))
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("cancel_grp")),
1);
mgr->wait ();
if (ThrMgr_Task::errors > 0 && status == 0)
status = 1;
return status;
}
#endif /* ACE_HAS_THREADS */
int
main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Thread_Manager_Test"));
int status = 0;
#if defined (ACE_HAS_THREADS)
int n_iterations = DEFAULT_ITERATIONS;
u_int i;
// Dynamically allocate signalled so that we can control when it
// gets deleted. Specifically, we need to delete it before the main
// thread's TSS is cleaned up.
ACE_NEW_RETURN (signalled,
ACE_thread_t[n_threads],
1);
// Initialize each ACE_thread_t to avoid Purify UMR's.
for (i = 0; i < n_threads; ++i)
signalled[i] = ACE_OS::NULL_thread;
// And similarly, dynamically allocate the thread_start barrier.
ACE_NEW_RETURN (thread_start,
ACE_Barrier (n_threads + 1),
-1);
// Register a signal handler.
ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT);
ACE_UNUSED_ARG (sa);
ACE_Thread_Manager *thr_mgr = ACE_Thread_Manager::instance ();
#if defined (VXWORKS)
// Assign thread (VxWorks task) names to test that feature.
ACE_thread_t *thread_name;
ACE_NEW_RETURN (thread_name,
ACE_thread_t[n_threads],
-1);
// And test the ability to specify stack size.
size_t *stack_size;
ACE_NEW_RETURN (stack_size,
size_t[n_threads],
-1);
for (i = 0; i < n_threads; ++i)
{
if (i < n_threads - 1)
{
ACE_NEW_RETURN (thread_name[i],
char[32],
-1);
ACE_OS::sprintf (thread_name[i],
ACE_TEXT ("thread%u"),
i);
}
else
// Pass an ACE_thread_t pointer of 0 for the last thread name.
thread_name[n_threads - 1] = 0;
stack_size[i] = 40000;
}
#endif /* VXWORKS */
int grp_id = thr_mgr->spawn_n
(
#if defined (VXWORKS)
thread_name,
#endif /* VXWORKS */
n_threads,
(ACE_THR_FUNC) worker,
ACE_reinterpret_cast (void *, n_iterations),
THR_BOUND
#if defined (VXWORKS)
, ACE_DEFAULT_THREAD_PRIORITY
, -1
, 0
, stack_size
#endif /* VXWORKS */
);
ACE_ASSERT (grp_id != -1);
thread_start->wait ();
// Wait for 1 second and then suspend every thread in the group.
ACE_OS::sleep (1);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) suspending group\n")));
if (thr_mgr->suspend_grp (grp_id) == -1)
{
// Pthreads w/o UNIX 98 extensions doesn't support suspend/resume,
// so it's allowed to ENOTSUP; anything else is a hard fail.
ACE_ASSERT (errno == ENOTSUP);
ACE_DEBUG((LM_DEBUG,
ACE_TEXT (" OK: suspend_grp isn't supported with ")
ACE_TEXT ("Pthreads\n")));
}
// Wait for 1 more second and then resume every thread in the
// group.
ACE_OS::sleep (ACE_Time_Value (1));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) resuming group\n")));
if (thr_mgr->resume_grp (grp_id) == -1)
{
ACE_ASSERT (errno == ENOTSUP);
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT (" OK: resume_grp isn't supported with ")
ACE_TEXT ("Pthreads\n")));
}
// Wait for 1 more second and then send a SIGINT to every thread in
// the group.
ACE_OS::sleep (ACE_Time_Value (1));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) signaling group\n")));
#if defined (ACE_HAS_WTHREADS)
thr_mgr->kill_grp (grp_id,
SIGINT);
#elif !defined (ACE_HAS_PTHREADS_DRAFT4)
#if defined (CHORUS)
ACE_ASSERT (thr_mgr->kill_grp (grp_id,
SIGTHREADKILL) != -1);
#else
ACE_ASSERT (thr_mgr->kill_grp (grp_id,
SIGINT) != -1);
#endif /* CHORUS */
#else
if (thr_mgr->kill_grp (grp_id,
SIGINT) == -1)
ACE_ASSERT (errno == ENOTSUP);
#endif /* ACE_HAS_WTHREADS */
// Wait and then cancel all the threads.
ACE_OS::sleep (ACE_Time_Value (1));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) cancelling group\n")));
ACE_ASSERT (thr_mgr->cancel_grp (grp_id) != -1);
// Perform a barrier wait until all the threads have shut down.
// But, wait for a limited time, just in case.
const ACE_Time_Value max_wait (600);
const ACE_Time_Value wait_time (ACE_OS::gettimeofday () + max_wait);
if (thr_mgr->wait (&wait_time) == -1)
{
if (errno == ETIME)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("maximum wait time of %d msec exceeded\n"),
max_wait.msec ()));
else
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"), ACE_TEXT ("wait")));
status = -1;
}
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) main thread finished\n")));
#if defined (VXWORKS)
for (i = 0; i < n_threads - 1; ++i)
{
delete [] thread_name[i];
// Don't delete the last thread_name, because it points to the
// name in the TCB. It was initially 0.
}
delete [] thread_name;
delete [] stack_size;
#endif /* VXWORKS */
delete thread_start;
thread_start = 0;
delete [] signalled;
signalled = 0;
// Now test task record keeping
if (test_task_record_keeping (thr_mgr) != 0)
status = -1;
#else
ACE_ERROR ((LM_INFO,
ACE_TEXT ("threads not supported on this platform\n")));
#endif /* ACE_HAS_THREADS */
ACE_END_TEST;
return status;
}
| [
"ganesh@codeops.tech"
] | ganesh@codeops.tech |
795c2c153c83572bb0774d514d59135831f003d3 | 0b9012fd64b62432fb0ce3ca9720cbe78f4693b6 | /messageMap/MyApp.cpp | 4323bfd1d5c978bbebc9b753e8b686e7403c91a5 | [] | no_license | weihuang527/MFCLearning | 715971650059a1db7fff673528b7ae169c1c6ac2 | a880ad224a942c0e01a40fb2469b862baeed5b1d | refs/heads/master | 2020-03-27T19:48:06.600401 | 2018-09-01T16:05:45 | 2018-09-01T16:05:45 | 147,011,800 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 885 | cpp | #include "MyApp.h"
BOOL CMyApp::InitInstance()
{
this->m_pMainWnd = new CMainWindow();
this->m_pMainWnd->ShowWindow(this->m_nCmdShow);
this->m_pMainWnd->UpdateWindow();
return true;
}
BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
CMainWindow::CMainWindow()
{
this->Create(NULL, TEXT("MessageMap"),//_T is also ok
WS_OVERLAPPEDWINDOW | WS_VSCROLL,
CRect(100,100,680,300));//控制窗口大小,起始位置到结束位置
}
void CMainWindow::OnPaint()//处理绘制消息,Paint消息
{
CPaintDC dc(this);
//dc.Ellipse(100, 100, 200, 300);//绘制一个椭圆
CRect rect;
this->GetClientRect(&rect);
dc.DrawText(TEXT("Hello, MFC!"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
void CMainWindow::OnLButtonDown(UINT nFlags, CPoint point)
{
this->MessageBox(TEXT("The left mouse button is pressed!"));
} | [
"weih527@mail.ustc.edu.cn"
] | weih527@mail.ustc.edu.cn |
4cd73637e4235d7dca83a864c81513096f0e6d3b | f275939f9ef67424d2d08c37e2b84d5820c190cf | /music.cpp | 2dcbbb923784a02b83b19612536fac54be9a285a | [] | no_license | Daphne-wu/Classes-Project | d55411ef64e2c3d8e3123d162cc86ed35d84f7e6 | 9d99ef54dc6162474cf39fb4f32c99e59e25c95b | refs/heads/main | 2023-01-01T02:34:29.509079 | 2020-10-26T02:22:50 | 2020-10-26T02:22:50 | 307,239,337 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 460 | cpp | //music cpp file with methods and construtor to set values
#include "music.h"
using namespace std;
music::music(string tit, string pub, string art, int yea, int dur) {
digitalMedia::title = tit;
publisher = pub;
artist = art;
digitalMedia::year = yea;
duration = dur;
digitalMedia::type = "music";
}
string music::getPublisher() {
return publisher;
}
string music::getArtist() {
return artist;
}
int music::getDuration() {
return duration;
}
| [
"noreply@github.com"
] | Daphne-wu.noreply@github.com |
24b11b0e2a7e8d4bb061b2951e5043b80c7c2dda | 269da3704a2e8ee561aa44f678aed124ae6332e2 | /TopCoder/SRM536-D2-1000.cpp | bc6d08da99028d08dc8ea4355d83507e183f1986 | [] | no_license | abdallahmontaser/Competitive-Programming | 5eda4e9cde88428072f096ca6175fea3986c4404 | 01bb93625d9b53cb065e9651c25548e0819d23d2 | refs/heads/master | 2022-12-20T03:45:31.934300 | 2020-09-25T20:29:48 | 2020-09-25T20:29:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,184 | cpp | #include<bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define endl '\n'
const ld PI = 3.141592653589793238L;
const ll N=100002;
using namespace std;
/**
*My approach was dp+memoization.I sorted the array in increasing order and begin looping from the start.
*At each index i: I loop from j=i+k-2 to j=n-1,
*and each time I compute the result of merging the j-i+1(from i to j) companies with the rest which is one company; the result of merging all the remaining companies
*i.e. companies from j+1 to n-1.Then I take the max and return it, also storing in the process the denominator.
*This works when I sort the array in this order because of the observation, that for any order chosen for the array, the final look of it after the merge
*will be in the form of consecutive groups of adjacent companies of size atleast k-1(last group must be of size >= k) divided by the product
*of the number of companies in it multiplied by the number of companies in each previous group.So the denominator gets bigger with every group,
*that's why the optimal answer will be in the case where the smallest numbers come in last, and the biggest in first.The only thing remaining
*is to figure out how many companies in each group; which is the job of the recursive dp function(solve).
*/
class MergersDivTwo{
public:
double dp[51][N];
double sum(vector<double>v,ll l,ll r){
double ans=0;
for(int i=l;i!=r+1;++i) ans+=v[i];
return ans;
}
double solve(vector<double>v,ll n,ll i,ll p,double k){
if(i==n) return (double)0;
if(n-i<k) return (double)-1e9;
double& ans=dp[i][p];
if(ans!=-1e10) return ans;
ans=(double)-1e9;
for(ll j=i+k-2;j<n;++j){
ll pp=p*(j-i+2-(j==n-1));
ans=max(ans,(double)(sum(v,i,j)/pp)+solve(v,n,j+1,pp,k));
}
return ans;
}
double findMaximum(vector <int> revenues, int k){
for(int i=0;i!=51;++i) for(int j=0;j!=N;++j) dp[i][j]=(double)-1e10;
vector<double>v(revenues.begin(),revenues.end());
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
return solve(v,v.size(),0,1ll,k);
}
};
| [
"noreply@github.com"
] | abdallahmontaser.noreply@github.com |
5e8af434046a5dcfa6585fd7ec615c2245a630b6 | f850b12bc82a8799ee3a4d004632767774a95893 | /source/FrameGraph.cpp | 4d36728a5f0843ba64cdf0f4f7f110e4a0b7c102 | [
"MIT"
] | permissive | bbercovici/ShapeUQLib | 427ad98cf616e032425004e22d0c1c6989c1eb60 | 4906704270ab306f799c88336b4b35484e89eb1b | refs/heads/master | 2020-04-20T03:57:19.857160 | 2019-02-04T00:13:08 | 2019-02-04T00:13:08 | 168,613,140 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,728 | cpp | #include <ShapeUQLib/FrameGraph.hpp>
FrameGraph::FrameGraph() {
}
arma::vec FrameGraph::convert(arma::vec input, std::string from, std::string to,
bool is_unit_vector) {
std::deque<std::shared_ptr<RefFrame > > path = this -> adjacency_list.dfs(
ref_names_to_ref_ptrs[from], ref_names_to_ref_ptrs[to]);
arma::vec coords = input;
if (from == to) {
return coords;
}
for (auto it_current_frame = path.begin();
it_current_frame != --path.end();
++it_current_frame) {
auto it_next_frame = std::next(it_current_frame);
std::pair<std::string, std::string> transform = this -> adjacency_list.getedge(*it_current_frame, *it_next_frame);
// current frame is parent frame
if (transform.second == (*it_next_frame) -> get_name()) {
this -> convert_to_child_of_provided_parent_frame(coords, (*it_next_frame).get(),
is_unit_vector);
}
// current frame is child frame
else if (transform.first == (*it_next_frame) -> get_name()) {
this -> convert_to_parent_of_provided_child_frame(coords, (*it_current_frame).get(),
is_unit_vector);
}
else {
throw (std::runtime_error("Illegal frame conversion"));
}
}
return coords;
}
void FrameGraph::convert_to_parent_of_provided_child_frame(arma::vec & coords,
RefFrame * ref_frame, bool is_unit_vector) const {
if (is_unit_vector == false) {
coords = *ref_frame -> get_origin_from_parent() + (*ref_frame -> get_dcm_from_parent()).t() * coords;
}
else {
coords = (*ref_frame -> get_dcm_from_parent()).t() * coords;
}
}
void FrameGraph::convert_to_child_of_provided_parent_frame(arma::vec & coords,
RefFrame * ref_frame, bool is_unit_vector) const {
if (is_unit_vector == false) {
coords = (*ref_frame -> get_dcm_from_parent()) * ( coords - (*ref_frame -> get_origin_from_parent()) );
}
else {
coords = (*ref_frame -> get_dcm_from_parent()) * ( coords );
}
}
void FrameGraph::add_frame(std::string frame_name) {
std::shared_ptr<RefFrame> frame = std::make_shared<RefFrame>(RefFrame(frame_name));
std::set<std::shared_ptr<RefFrame> > frames = this -> adjacency_list.get_vertices();
for (auto const & existing_frame : frames) {
if (existing_frame -> get_name() == frame_name) {
std::cerr << "The reference frame name ' " << frame_name << " 'is already in use" << std::endl;
return;
}
}
this -> adjacency_list.addvertex(frame);
this -> ref_names_to_ref_ptrs[frame_name] = frame;
}
void FrameGraph::set_transform_mrp(std::string parent_name,
std::string child_name,
arma::vec mrp) {
std::set<std::pair<std::string, std::string > > transforms = this -> adjacency_list.get_edges();
for (auto const & transform : transforms) {
if (transform.first == parent_name) {
if (transform.second == child_name) {
this -> ref_names_to_ref_ptrs[child_name]-> set_mrp_from_parent(mrp) ;
return;
}
}
}
std::cerr << "The transform relating parent '" << parent_name << "' to child '" << child_name << "' was not found in the graph" << std::endl;
return;
}
void FrameGraph::set_transform_origin(std::string parent_name,
std::string child_name,
arma::vec origin) {
// Consistency check: if $child_name == "N", something is wrong
if (child_name == "N") {
std::cerr << " The inertial frame of reference N cannot have its origin edited" << std::endl;
return;
}
std::set<std::pair<std::string, std::string > > transforms = this -> adjacency_list.get_edges();
for (auto const & transform : transforms) {
if (transform.first == parent_name) {
if (transform.second == child_name) {
this -> ref_names_to_ref_ptrs[child_name]-> set_origin_from_parent(origin) ;
return;
}
}
}
std::cerr << "The transform relating parent '" << parent_name << "' to child '" << child_name << "' was not found in the graph" << std::endl;
return;
}
RefFrame * FrameGraph::get_frame(std::string frame_name) {
return this -> ref_names_to_ref_ptrs[frame_name].get();
}
void FrameGraph::add_transform(std::string parent_name, std::string child_name) {
std::set<std::shared_ptr<RefFrame> > frames = this -> adjacency_list.get_vertices();
std::shared_ptr<RefFrame> child_frame;
std::shared_ptr<RefFrame> parent_frame;
//########################################################################
//####################### Consistency checks #############################
//########################################################################
// Consistency check: are the two provided frames identically called?
if (parent_name == child_name) {
std::cerr << "The parent name has to be different from the child name. Both were called " << child_name << std::endl;
return;
}
// Consistency check: are both frames present?
bool found_parent = false;
for (auto const & existing_frame : frames) {
if (existing_frame -> get_name() == parent_name) {
found_parent = true;
parent_frame = existing_frame;
}
}
if (found_parent == false) {
std::cerr << "The parent reference frame name '" << parent_name << "' was not found in the graph" << std::endl;
return;
}
bool found_child = false;
for (auto const & existing_frame : frames) {
if (existing_frame -> get_name() == child_name) {
found_child = true;
child_frame = existing_frame;
}
}
if (found_child == false) {
std::cerr << "The child reference frame name '" << child_name << "' was not found in the graph" << std::endl;
return;
}
// Consistency check: is this transform already present?
std::set<std::pair<std::string, std::string > > transforms = this -> adjacency_list.get_edges();
for (auto const & transform : transforms) {
if (transform.first == parent_name || transform.first == child_name) {
if (transform.second == parent_name || transform.second == child_name) {
std::cerr << "A transform relating '" << parent_name << "' and '" << child_name << "' was found in the graph" << std::endl;
return;
}
}
}
//########################################################################
//########################################################################
//########################################################################
// The edge is then created by storing the name of the corresponding tansform
// The transform is stored in a pair formed with the following members:
// - first: parent frame
// - second: child frame
std::pair<std::string, std::string> transform_name = std::make_pair(parent_name, child_name);
this -> adjacency_list.addedge(parent_frame, child_frame, transform_name);
} | [
"benjamin.bercovici@gmail.com"
] | benjamin.bercovici@gmail.com |
d22964ef2725d5705c36e212708c0a6d30d8ee7c | 581cca327cebb613b7dedfb1a4c5ff85a3c0f036 | /src/decentralised-core/include/core/network/hosts.hpp | 32f400a5a1ec75353fa7b432c7ee72440ee80d7b | [
"MIT"
] | permissive | ballisticwhisper/decentralised | f62b37a78285b5d2e1c9cd4f8ca4201dbf855af5 | 8dd4cc7dc4fd39665044351c0c85264f2a18544f | refs/heads/master | 2021-01-10T13:24:49.540421 | 2016-03-15T11:11:52 | 2016-03-15T11:11:52 | 44,601,399 | 1 | 3 | null | 2016-08-12T10:36:38 | 2015-10-20T11:21:42 | Logos | UTF-8 | C++ | false | false | 1,944 | hpp | #ifndef DC_CORE_HPPOSTS_HPP
#define DC_CORE_HPPOSTS_HPP
#include <string>
#include <fstream>
#include <functional>
#include <system_error>
#include <boost/circular_buffer.hpp>
#include <core/primitives.hpp>
#include <core/threadpool.hpp>
namespace decentralised
{
namespace core
{
class hosts
{
public:
typedef std::function<void(const std::error_code&)> load_handler;
typedef std::function<void(const std::error_code&)> save_handler;
typedef std::function<void(const std::error_code&)> store_handler;
typedef std::function<void(const std::error_code&)> remove_handler;
typedef std::function<
void(const std::error_code&, const network_address_type&)>
fetch_address_handler;
typedef std::function<void(const std::error_code&, size_t)>
fetch_count_handler;
hosts(threadpool& pool, size_t capacity = 1000);
hosts(const hosts&) = delete;
void operator=(const hosts&) = delete;
void load(const std::string& filename, load_handler handle_load);
void save(const std::string& filename, save_handler handle_save);
void store(const network_address_type& address,
store_handler handle_store);
void remove(const network_address_type& address,
remove_handler handle_remove);
void fetch_address(fetch_address_handler handle_fetch);
void fetch_count(fetch_count_handler handle_fetch);
private:
struct hosts_field
{
bool operator==(const hosts_field& other);
ip_address_type ip;
uint16_t port;
};
void do_load(const std::string& filename, load_handler handle_load);
void do_save(const std::string& filename, save_handler handle_save);
void do_remove(const network_address_type& address,
remove_handler handle_remove);
void do_fetch_address(fetch_address_handler handle_fetch_address);
void do_fetch_count(fetch_count_handler handle_fetch);
async_strand strand_;
boost::circular_buffer<hosts_field> buffer_;
};
}
}
#endif
| [
"ballistic.whisper@decentralised-project.org"
] | ballistic.whisper@decentralised-project.org |
7fbc2b62d52a84b71aeef668bdafa4574e99c812 | f62e0b4bfcb2f3398762c421590f9a3713b4e64e | /ExamEasy_naver_blog_get_html_step1/ExamEasy/tipsware.h | 11b4e7a04d808794d6d920eaedc93b3ea771fdc5 | [] | no_license | SDB016/Project_movie | 4c35626f6d08f612d5f7a0b548bf6fd1b79d0598 | 170bb42ab85bfa9cda52bf442f9a872913555401 | refs/heads/master | 2020-12-29T22:09:04.299576 | 2020-12-19T13:14:47 | 2020-12-19T13:14:47 | 238,750,112 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 3,429 | h | #ifndef _TIPSWARE_H_
#define _TIPSWARE_H_
/* [ 기본 샘플 코드 ]
#include "pch.h"
#include "tipswre.h"
NOT_USE_MESSAGE
int main()
{
// 구구단에서 2단을 출력한다.
for (int i = 1; i < 10; i++) {
// (20, 5+i*20) 좌표에 RGB(0, 200, 255) 색상으로 출력!
printf(20, 5+i*20, RGB(0, 200, 255), "2 * %d = %d", i, 2 * i);
}
ShowDisplay(); // 정보를 윈도우에 출력한다.
return 0;
}
*/
#include "resource.h"
// ExpParserEx에서 사용하는 구조체
struct ExpDataType {
unsigned char d_type;
union {
__int8 i8;
__int16 i16;
__int32 i32;
__int64 i64;
float f;
double d;
};
};
#include "EasyWin32.h"
#pragma comment(lib, "gdiplus")
#pragma comment(lib, "Msimg32.lib")
#pragma comment(lib, "WS2_32.lib")
#ifdef _DEBUG
#pragma comment(lib, "DSH_EasyWin32.lib")
#else
#pragma comment(lib, "RST_EasyWin32.lib")
#endif
/*
소켓에서 지켜야할 UserData 시작 형식!! - 1개의 클라이언트 정보를 저장할 구조체
struct UserData
{
unsigned int h_socket; // 소켓 핸들
char ip_address[16]; // 접속한 클라이언트의 주소
};
*/
// 현재 수신한 데이터 정보를 저장할 구조체
struct CurrentServerNetworkData
{
unsigned char m_net_msg_id; // 메시지 ID
unsigned short m_net_body_size; // Body 데이터의 크기
char *mp_net_body_data; // Body 데이터 정보
void *mp_net_user; // 데이터를 전송한 클라이언트 정보
};
// 현재 수신한 데이터 정보를 저장할 구조체
struct CurrentClientNetworkData
{
unsigned char m_net_msg_id; // 메시지 ID
unsigned short m_net_body_size; // Body 데이터의 크기
char *mp_net_body_data; // Body 데이터 정보
};
// 응용 프로그램이 사용하는 내부 윈도우 클래스 이름입니다. (수정 가능)
const char *gp_app_name = "EasyMyWindow";
// 응용 프로그램이 사용하는 제목입니다. (수정 가능)
const char *gp_window_title = "블로그 페이지 Html 소스 가져오기 - Step 1 (https://cafe.naver.com/easywin32)";
// 응용 프로그램이 사용할 메뉴의 ID입니다. (0이면 메뉴를 사용하지 않는다는 뜻입니다.)
int g_menu_id = 0;
using namespace EasyAPI_Tipsware;
#define printf TextOut
#define TIMER void CALLBACK
#define NOT_USE_TIMER_DATA HWND ah_wnd, UINT a_msg_id, UINT_PTR a_timer_id, DWORD a_time
#define NOT_USE_MESSAGE SystemMessageMap g_system_map(NULL, NULL, NULL, NULL, NULL, NULL);
#define MOUSE_MESSAGE(left_down, left_up, move) SystemMessageMap g_system_map(left_down, left_up, move, NULL, NULL, NULL);
#define MOUSE_MESSAGE_EX(left_down, left_up, move, destory) SystemMessageMap g_system_map(left_down, left_up, move, NULL, destory, NULL);
#define MOUSE_CMD_MESSAGE(left_down, left_up, move, command) SystemMessageMap g_system_map(left_down, left_up, move, command, NULL, NULL);
#define MOUSE_CMD_MESSAGE_EX(left_down, left_up, move, command, destory) SystemMessageMap g_system_map(left_down, left_up, move, command, destory, NULL);
#define CMD_MESSAGE(command) SystemMessageMap g_system_map(NULL, NULL, NULL, command, NULL, NULL);
#define CMD_USER_MESSAGE(command, destory, user_msg) SystemMessageMap g_system_map(NULL, NULL, NULL, command, destory, user_msg);
#define ON_MESSAGE(left_down, left_up, move, command, destory, user_msg) SystemMessageMap g_system_map(left_down, left_up, move, command, destory, user_msg);
#endif | [
"dongbin4013@naver.com"
] | dongbin4013@naver.com |
205729e751b5fe298bd31e4e37cbee116f12007d | 44a146314b06d0d7d77b85181e6af10d487caf44 | /src/Server.cpp | bbf2505cd5bbe4213bd1b49b7cf7bce8bb385b5c | [] | no_license | JiangSheng1987/fooking | 052ad82c48e2b3e74afa366462fab3a11bf1a411 | d234e0ecfd3a52717d23edd240413c6654b6c72b | refs/heads/master | 2021-01-19T22:28:38.779777 | 2016-08-22T14:44:52 | 2016-08-22T14:44:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,595 | cpp | #include <iostream>
#include "Server.h"
#include "Connection.h"
#include "Log.h"
NS_USING;
Server::Server(EventLoop *loop, int fd):
pLoop(loop),
sSocket(fd)
{
EV_CB_INIT(cbConnection);
}
Server::~Server()
{
}
int Server::createTcpServer(int port)
{
if(sSocket.create(AF_INET) == SOCKET_ERR){
return -1;
}
//listen
struct sockaddr_in sa;
memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
sa.sin_addr.s_addr = htonl(INADDR_ANY);
if(sSocket.listen((sockaddr *)&sa, sizeof(sa)) == SOCKET_ERR){
sSocket.close();
return -1;
}
//set nonblock
sSocket.setNonBlock();
return 0;
}
int Server::createUnixServer(const char *path)
{
#ifdef WIN32
return -1;
#else
if(sSocket.create(AF_LOCAL) == SOCKET_ERR){
return -1;
}
//listen
struct sockaddr_un sa;
memset(&sa, 0, sizeof(sa));
sa.sun_family = AF_LOCAL;
strncpy(sa.sun_path, path, sizeof(sa.sun_path) - 1);
if(sSocket.listen((sockaddr*)&sa, sizeof(sa)) == SOCKET_ERR){
sSocket.close();
return -1;
}
//set nonblock
sSocket.setNonBlock();
return 0;
#endif
}
void Server::start()
{
pLoop->addEventListener(sSocket.getFd(), EV_IO_READ, EV_IO_CB(this, Server::onConnection), NULL);
}
void Server::stop()
{
pLoop->removeEventListener(sSocket.getFd(), EV_IO_ALL);
}
void Server::onConnection(int fd, int ev, void *data)
{
struct sockaddr_in sa;
int len = sizeof(sa);
int conn = sSocket.accept((sockaddr *)&sa, &len);
if(conn == SOCKET_ERR){
LOG_ERR("accept fail, errno=%d, error=%s", errno, strerror(errno));
return ;
}
EV_INVOKE(cbConnection, conn, 0, &sa);
} | [
"304463400@qq.com"
] | 304463400@qq.com |
cd3553c6af9cccc0ed14552d3f2113088133a558 | d40efadec5724c236f1ec681ac811466fcf848d8 | /tags/fs2_open_3_7_0/code/ui/inputbox.cpp | 1bf429bbaf690a57e825df90f65ef630df2af33b | [] | no_license | svn2github/fs2open | 0fcbe9345fb54d2abbe45e61ef44a41fa7e02e15 | c6d35120e8372c2c74270c85a9e7d88709086278 | refs/heads/master | 2020-05-17T17:37:03.969697 | 2015-01-08T15:24:21 | 2015-01-08T15:24:21 | 14,258,345 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,511 | cpp | /*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#include <ctype.h>
#include "ui/uidefs.h"
#include "ui/ui.h"
#include "bmpman/bmpman.h"
#include "io/timer.h"
#include "globalincs/alphacolors.h"
#define INPUTBOX_PASSWD_CHAR '*' // the password protected char
// Retuen true if c is a letter, else return false.
int is_letter(char c)
{
return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
}
// if the passed key is keypad number, return the ascii value, otherwise -1
int keypad_to_ascii(int c)
{
switch(c){
case KEY_PAD0:
return key_to_ascii(KEY_0);
break;
case KEY_PAD1:
return key_to_ascii(KEY_1);
break;
case KEY_PAD2:
return key_to_ascii(KEY_2);
break;
case KEY_PAD3:
return key_to_ascii(KEY_3);
break;
case KEY_PAD4:
return key_to_ascii(KEY_4);
break;
case KEY_PAD5:
return key_to_ascii(KEY_5);
break;
case KEY_PAD6:
return key_to_ascii(KEY_6);
break;
case KEY_PAD7:
return key_to_ascii(KEY_7);
break;
case KEY_PAD8:
return key_to_ascii(KEY_8);
break;
case KEY_PAD9:
return key_to_ascii(KEY_9);
break;
case KEY_PADPERIOD:
return key_to_ascii(KEY_PERIOD);
break;
default :
return -1;
break;
}
}
// insert character c into string s at position p.
void strcins(char *s, int p, char c)
{
int n;
for (n=strlen(s)-p; n>=0; n-- )
*(s+p+n+1) = *(s+p+n); // Move everything over
*(s+p) = c; // then insert the character
}
// delete n character from string s starting at position p
void strndel(char *s, int p, int n)
{
for (; (*(s+p) = *(s+p+n)) != '\0'; s++ )
*(s+p+n) = '\0'; // Delete and zero fill
}
void UI_INPUTBOX::init_cursor()
{
cursor_first_frame = bm_load_animation("cursor1", &cursor_nframes, &cursor_fps);
if ( cursor_first_frame < 0 ) {
Warning(LOCATION,"Cannot load input box cursor: cursor1.ani\n");
return;
}
cursor_elapsed_time=0;
cursor_current_frame=0;
}
void UI_INPUTBOX::create(UI_WINDOW *wnd, int _x, int _y, int _w, int _text_len, char *_text, int _flags, int pixel_lim, color *clr)
{
int tw, th;
Assert(_text_len >= 0);
Assert((int) strlen(_text) <= _text_len);
gr_set_font(wnd->f_id);
gr_get_string_size( &tw, &th, "*" );
// check to see if the user passed in a text color otherwise use the default green color
if (clr){
text_color = clr;
} else {
text_color = &CBRIGHT;
}
base_create( wnd, UI_KIND_INPUTBOX, _x, _y, _w, th+4 );
text = (char *) vm_malloc( _text_len + 1);
// input boxes no longer use background
_flags |= UI_INPUTBOX_FLAG_NO_BACK;
// if its in "password" mode, allocate a second string
// and copy it
if (_flags & UI_INPUTBOX_FLAG_PASSWD) {
passwd_text = (char *) vm_malloc(_text_len + 1);
memset(passwd_text, INPUTBOX_PASSWD_CHAR, strlen(_text));
passwd_text[strlen(_text)] = 0;
} else {
passwd_text = NULL;
}
init_cursor();
if ( _text_len > 0 ) {
strncpy( text, _text, _text_len );
}
text[_text_len] = 0;
position = strlen(_text);
oldposition = position;
length = _text_len;
pressed_down = 0;
// first_time = 1;
changed_flag = 0;
flags = _flags;
pixel_limit = pixel_lim;
locked = 0;
valid_chars = NULL;
invalid_chars = NULL;
}
void UI_INPUTBOX::set_valid_chars(char *vchars)
{
// free up any existing string
if(valid_chars != NULL){
vm_free(valid_chars);
valid_chars = NULL;
}
valid_chars = vm_strdup(vchars);
}
void UI_INPUTBOX::set_invalid_chars(char *ichars)
{
// free up any existing string
if(invalid_chars != NULL){
vm_free(invalid_chars);
invalid_chars = NULL;
}
invalid_chars = vm_strdup(ichars);
}
void UI_INPUTBOX::destroy()
{
if (text) {
vm_free(text);
text = NULL;
}
// free any valid chars
if(valid_chars != NULL){
vm_free(valid_chars);
valid_chars = NULL;
}
// free any invalid chars
if(invalid_chars != NULL){
vm_free(invalid_chars);
invalid_chars = NULL;
}
if ((flags & UI_INPUTBOX_FLAG_PASSWD) && passwd_text) {
vm_free(passwd_text);
passwd_text = NULL;
}
UI_GADGET::destroy();
}
void UI_INPUTBOX::draw()
{
int invis, w1, h1, tw, th;
int text_x, text_y;
if (hidden){
return;
}
w1 = w;
h1 = h;
invis = flags & UI_INPUTBOX_FLAG_INVIS;
gr_set_font(my_wnd->f_id);
gr_reset_clip();
if (!invis && !(flags & UI_INPUTBOX_FLAG_NO_BACK)) {
// draw the entire text box region
ui_draw_sunken_border( x-2, y-2, x+w+1, y+h+1 );
gr_set_color_fast( &CBLACK );
gr_rect( 0, 0, w, h );
w1 -= 4;
h1 -= 4;
gr_set_clip( x + 1, y + 1, w1 + 1, h1 + 1 );
} else {
gr_set_clip( x - 1, y - 1, w1 + 1, h1 + 1 );
}
if (flags & UI_INPUTBOX_FLAG_PASSWD){
gr_get_string_size(&tw, &th, passwd_text);
} else {
gr_get_string_size(&tw, &th, text);
}
// If first_time is set, that means this input box got
// focus, but nothing is typed yet, so all the text is
// selected, if you type a character it will replace the
// text, if you type an arrow it will unselect it.
// So it needs to be colored differently to show this.
if (!disabled_flag && !(flags & UI_INPUTBOX_FLAG_NO_BACK)) {
// if ( (my_wnd->selected_gadget == this) && first_time ) {
// gr_set_color_fast( text_color );
// } else {
gr_set_color_fast( &CBLACK );
// }
// color the background behind the text
gr_rect( 0, 0, tw + 1, th );
}
if ( (my_wnd->selected_gadget == this) || disabled_flag ) {
gr_set_color_fast(text_color);
} else {
gr_set_color_fast(&CWHITE);
}
// coords of where to draw the text
text_x = 1;
text_y = 1;
if(flags & UI_INPUTBOX_FLAG_TEXT_CEN){
// if we fit within the text area, draw it centered
if(tw <= w1 - 5){
text_x += (w1 - tw)/2;
}
}
// draw the text
if (flags & UI_INPUTBOX_FLAG_PASSWD){
gr_string(text_x, text_y, passwd_text);
} else {
gr_string(text_x, text_y, text);
}
// draw the "cursor"
if (!disabled_flag) {
if (my_wnd->selected_gadget == this) {
if (cursor_first_frame == -1) {
gr_set_color_fast(text_color);
ui_vline(1, h1, text_x + tw + 4);
ui_vline(1, h1, text_x + tw + 5);
} else {
// draw animating cursor
int time_delta = timer_get_milliseconds() - cursor_elapsed_time;
if ( (time_delta / 1000.0f) > (1.0f / cursor_fps) ) {
// advance frame
cursor_elapsed_time += time_delta;
cursor_current_frame++;
if (cursor_current_frame >= cursor_nframes) {
cursor_current_frame = 0;
}
}
// draw current frame
gr_set_bitmap(cursor_first_frame + cursor_current_frame);
gr_bitmap(text_x + tw + 4, 1);
}
}
}
gr_reset_clip();
}
int UI_INPUTBOX::validate_input(int chr)
{
if (chr < 32) { // weed out control characters
return 0;
}
// if we're disallowing letters altogether
if((flags & UI_INPUTBOX_FLAG_NO_LETTERS) && isalpha(chr)){
return 0;
}
// if we're disallowing numbers altogether
if((flags & UI_INPUTBOX_FLAG_NO_NUMERALS) && isdigit(chr)){
return 0;
}
// otherwise allow numbers and alpha chars by
if (isdigit(chr) || isalpha(chr)){
return chr;
}
// if we have specified no valid or invalid chars, accept everything
if(!valid_chars && !invalid_chars){
return chr;
}
// otherwise compare against the valid chars list
if((valid_chars) && strchr(valid_chars, chr)){
return chr;
}
// otherwise compare against the invalid chars list0
if((invalid_chars) && !strchr(invalid_chars,chr)){
return chr;
}
return 0;
}
void UI_INPUTBOX::process(int focus)
{
int ascii, clear_lastkey, key, key_used, key_check;
// check if mouse is pressed
if (B1_PRESSED && is_mouse_on()) {
set_focus();
// first_time = 1;
}
if (disabled_flag)
return;
if (my_wnd->selected_gadget == this)
focus = 1;
// else
// first_time = 0;
key_used = 0;
changed_flag = 0;
oldposition = position;
pressed_down = 0;
clear_lastkey = (flags & UI_INPUTBOX_FLAG_KEYTHRU) ? 0 : 1;
if (focus) {
key = my_wnd->keypress;
switch (key) {
case 0:
break;
//case KEY_LEFT:
case KEY_BACKSP:
if (position > 0)
position--;
text[position] = 0;
if (flags & UI_INPUTBOX_FLAG_PASSWD) {
passwd_text[position] = 0;
}
changed_flag = 1;
key_used = 1;
// if (first_time)
// first_time = 0;
break;
case KEY_ENTER:
pressed_down = 1;
locked = 0;
changed_flag = 1;
key_used = 1;
// if (first_time)
// first_time = 0;
// should_reset = 1;
break;
case KEY_ESC:
if (flags & UI_INPUTBOX_FLAG_ESC_CLR){
if (position > 0) {
set_text("");
key_used = 1;
} else {
key_used = 0;
clear_lastkey = 0;
}
}
if (flags & UI_INPUTBOX_FLAG_ESC_FOC) {
clear_focus();
}
break;
default:
if (!locked) {
// MWA -- determine if alt or ctrl held down on this key and don't process if it is. We
// need to be able to pass these keys back to the top level. (And anyway -- ctrl-a shouldn't
// print out an A in the input window
if ( key & (KEY_ALTED | KEY_CTRLED) ) {
clear_lastkey = 0;
break;
}
// get an ascii char from the input if possible
key_check = keypad_to_ascii(key);
if(key_check == -1){
key_check = key_to_ascii(key);
}
ascii = validate_input(key_check);
if ((ascii > 0) && (ascii < 255)) {
#ifndef NDEBUG
/*if ((ascii >= 0x20) && (ascii <= 0x7e))
mprintf((" Inputbox: '%c'\n", ascii));
else
mprintf((" Inputbox: 0x%02X\n", ascii));*/
#endif
if (flags & UI_INPUTBOX_FLAG_LETTER_FIRST) {
if ((position == 0) && !is_letter((char) ascii))
break;
}
key_used = 1;
// if (should_reset) {
// should_reset = 0;
// position = 0;
// }
// if (first_time) {
// first_time = 0;
// position = 0;
// }
if ( position < length ) {
text[position] = (char) ascii;
text[position + 1] = 0;
if (flags & UI_INPUTBOX_FLAG_PASSWD) {
passwd_text[position] = (char) INPUTBOX_PASSWD_CHAR;
passwd_text[position + 1] = 0;
}
position++;
// check to see if we should limit by pixel width
if (pixel_limit > -1) {
int _w;
if (flags & UI_INPUTBOX_FLAG_PASSWD) {
gr_get_string_size(&_w, NULL, passwd_text);
} else {
gr_get_string_size(&_w, NULL, text);
}
if (_w > pixel_limit) {
position--;
locked = 1;
text[position] = 0;
if (flags & UI_INPUTBOX_FLAG_PASSWD) {
passwd_text[position] = 0;
}
}
}
}
changed_flag = 1;
}
}
break;
}
if (clear_lastkey || (key_used && (flags & UI_INPUTBOX_FLAG_EAT_USED)) )
my_wnd->last_keypress=0;
// } else {
// first_time = 1;
}
}
int UI_INPUTBOX::changed()
{
return changed_flag;
}
int UI_INPUTBOX::pressed()
{
return pressed_down;
}
void UI_INPUTBOX::get_text(char *out)
{
strncpy(out, text, length);
out[length] = 0;
}
void UI_INPUTBOX::set_text(char *in)
{
int in_length;
in_length = strlen(in);
if (in_length > length)
Assert(0); // tried to force text into an input box that won't fit into allocated memory
strcpy(text, in);
if (flags & UI_INPUTBOX_FLAG_PASSWD) {
memset(passwd_text, INPUTBOX_PASSWD_CHAR, strlen(text));
passwd_text[strlen(text)] = 0;
}
position = in_length; // fixes the zero-length-I-don't-think-so bug
}
| [
"chief1983@387891d4-d844-0410-90c0-e4c51a9137d3"
] | chief1983@387891d4-d844-0410-90c0-e4c51a9137d3 |
576360a7a5007d8625f90d1db9d87fb1253a16be | d08dd26b1dd36585a56afa0708a8c2ebb03de538 | /05/ex02/PresidentialPardonForm.cpp | a3238610c8612f385d351c49961e6249f8482c8e | [] | no_license | jjs576/cpp-module | ab2d9b3b0096637c86f104022bf11b99bfa20ea8 | 52eb12fe4a56f8a700e86592d76dffc6a7de1ca9 | refs/heads/master | 2023-05-27T09:12:00.791585 | 2021-06-13T04:54:00 | 2021-06-13T04:54:00 | 374,712,169 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 721 | cpp | #include "PresidentialPardonForm.hpp"
PresidentialPardonForm::PresidentialPardonForm(std::string const &target) : Form("presidential pardon", 5, 25), target(target)
{}
PresidentialPardonForm::PresidentialPardonForm(PresidentialPardonForm const &sh) : Form(sh.getName(), 5, 25), target(sh.target)
{}
PresidentialPardonForm &PresidentialPardonForm::operator=(PresidentialPardonForm const &form) {
if (this != &form)
this->target = form.target;
return *this;
}
PresidentialPardonForm::~PresidentialPardonForm() {}
void PresidentialPardonForm::excute(Bureaucrat const &excutor) const {
this->Form::checkExcute(excutor);
std::cout << "<" << this->target << "> has been pardoned by Zafod Beeblebrox" << std::endl;
}
| [
"jjs576@naver.com"
] | jjs576@naver.com |
68a6916bf49a945c82229365aac6bf03e8692816 | 08cb99ebffe10f22316173ad97f32f35803d9402 | /StaticCityA/Source/StaticCityA/StaticCityAGameModeBase.h | d9e8f2dffb8e726082422ae7b5b353b0e78c542b | [] | no_license | Static-City/StaticCity | ebfe08ff00e2e9e2eb196340cef2347c41a4bf63 | 954ce22453642b94d7afa0cd9bfe2853158fd7db | refs/heads/main | 2023-06-05T21:01:33.850528 | 2021-06-11T12:47:14 | 2021-06-11T12:47:14 | 353,859,148 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 295 | h | // Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "StaticCityAGameModeBase.generated.h"
/**
*
*/
UCLASS()
class STATICCITYA_API AStaticCityAGameModeBase : public AGameModeBase
{
GENERATED_BODY()
};
| [
"81230008+Suocixers@users.noreply.github.com"
] | 81230008+Suocixers@users.noreply.github.com |
ecae81941db72090c72a554b51b0d15c22e18042 | 9016e3870e9e06957f25e127b3f50225db4d65b4 | /src/net/third_party/quiche/src/quic/core/quic_connection_id.cc | 49e90b6bb3823d33b0c20840587b431668ec1b1a | [
"BSD-3-Clause"
] | permissive | bylond/naiveproxy | f0a30493e0662251247a87c73a1b73388ef16d1b | a04a8330a8bb0d0892259cf6d795271fbe6e6d0e | refs/heads/master | 2021-02-02T00:46:35.836722 | 2020-03-11T03:43:22 | 2020-03-11T03:43:22 | 243,525,007 | 1 | 0 | BSD-3-Clause | 2020-03-11T03:43:23 | 2020-02-27T13:23:59 | null | UTF-8 | C++ | false | false | 5,970 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <string>
#include "third_party/boringssl/src/include/openssl/siphash.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
namespace quic {
namespace {
// QuicConnectionIdHasher can be used to generate a stable connection ID hash
// function that will return the same value for two equal connection IDs for
// the duration of process lifetime. It is meant to be used as input to data
// structures that do not outlast process lifetime. A new key is generated once
// per process to prevent attackers from crafting connection IDs in such a way
// that they always land in the same hash bucket.
class QuicConnectionIdHasher {
public:
inline QuicConnectionIdHasher()
: QuicConnectionIdHasher(QuicRandom::GetInstance()) {}
explicit inline QuicConnectionIdHasher(QuicRandom* random) {
random->RandBytes(&sip_hash_key_, sizeof(sip_hash_key_));
}
inline size_t Hash(const char* input, size_t input_len) const {
return static_cast<size_t>(SIPHASH_24(
sip_hash_key_, reinterpret_cast<const uint8_t*>(input), input_len));
}
private:
uint64_t sip_hash_key_[2];
};
} // namespace
QuicConnectionId::QuicConnectionId() : QuicConnectionId(nullptr, 0) {}
QuicConnectionId::QuicConnectionId(const char* data, uint8_t length) {
static_assert(kQuicMaxConnectionIdAllVersionsLength <=
std::numeric_limits<uint8_t>::max(),
"kQuicMaxConnectionIdAllVersionsLength too high");
if (length > kQuicMaxConnectionIdAllVersionsLength) {
QUIC_BUG << "Attempted to create connection ID of length "
<< static_cast<int>(length);
length = kQuicMaxConnectionIdAllVersionsLength;
}
length_ = length;
if (length_ == 0) {
return;
}
if (length_ <= sizeof(data_short_)) {
memcpy(data_short_, data, length_);
return;
}
data_long_ = reinterpret_cast<char*>(malloc(length_));
CHECK_NE(nullptr, data_long_);
memcpy(data_long_, data, length_);
}
QuicConnectionId::~QuicConnectionId() {
if (length_ > sizeof(data_short_)) {
free(data_long_);
data_long_ = nullptr;
}
}
QuicConnectionId::QuicConnectionId(const QuicConnectionId& other)
: QuicConnectionId(other.data(), other.length()) {}
QuicConnectionId& QuicConnectionId::operator=(const QuicConnectionId& other) {
set_length(other.length());
memcpy(mutable_data(), other.data(), length_);
return *this;
}
const char* QuicConnectionId::data() const {
if (length_ <= sizeof(data_short_)) {
return data_short_;
}
return data_long_;
}
char* QuicConnectionId::mutable_data() {
if (length_ <= sizeof(data_short_)) {
return data_short_;
}
return data_long_;
}
uint8_t QuicConnectionId::length() const {
return length_;
}
void QuicConnectionId::set_length(uint8_t length) {
if (length > kQuicMaxConnectionIdAllVersionsLength) {
QUIC_BUG << "Attempted to set connection ID length to "
<< static_cast<int>(length);
length = kQuicMaxConnectionIdAllVersionsLength;
}
char temporary_data[sizeof(data_short_)];
if (length > sizeof(data_short_)) {
if (length_ <= sizeof(data_short_)) {
// Copy data from data_short_ to data_long_.
memcpy(temporary_data, data_short_, length_);
data_long_ = reinterpret_cast<char*>(malloc(length));
CHECK_NE(nullptr, data_long_);
memcpy(data_long_, temporary_data, length_);
} else {
// Resize data_long_.
char* realloc_result =
reinterpret_cast<char*>(realloc(data_long_, length));
CHECK_NE(nullptr, realloc_result);
data_long_ = realloc_result;
}
} else if (length_ > sizeof(data_short_)) {
// Copy data from data_long_ to data_short_.
memcpy(temporary_data, data_long_, length);
free(data_long_);
data_long_ = nullptr;
memcpy(data_short_, temporary_data, length);
}
length_ = length;
}
bool QuicConnectionId::IsEmpty() const {
return length_ == 0;
}
size_t QuicConnectionId::Hash() const {
static const QuicConnectionIdHasher hasher = QuicConnectionIdHasher();
return hasher.Hash(data(), length_);
}
std::string QuicConnectionId::ToString() const {
if (IsEmpty()) {
return std::string("0");
}
return QuicTextUtils::HexEncode(data(), length_);
}
std::ostream& operator<<(std::ostream& os, const QuicConnectionId& v) {
os << v.ToString();
return os;
}
bool QuicConnectionId::operator==(const QuicConnectionId& v) const {
return length_ == v.length_ && memcmp(data(), v.data(), length_) == 0;
}
bool QuicConnectionId::operator!=(const QuicConnectionId& v) const {
return !(v == *this);
}
bool QuicConnectionId::operator<(const QuicConnectionId& v) const {
if (length_ < v.length_) {
return true;
}
if (length_ > v.length_) {
return false;
}
return memcmp(data(), v.data(), length_) < 0;
}
QuicConnectionId EmptyQuicConnectionId() {
return QuicConnectionId();
}
static_assert(kQuicDefaultConnectionIdLength == sizeof(uint64_t),
"kQuicDefaultConnectionIdLength changed");
static_assert(kQuicDefaultConnectionIdLength == PACKET_8BYTE_CONNECTION_ID,
"kQuicDefaultConnectionIdLength changed");
} // namespace quic
| [
"kizdiv@gmail.com"
] | kizdiv@gmail.com |
9f9c7a4fab4dae069fe26bfc1d1b3e4469da9c85 | 188b490b8e93afda9da16790b8896f233ab27aa1 | /tensorflow/lite/delegates/gpu/common/tasks/conv_weights_converter.cc | bdf4be256bce4f0f60b260e7f51158936d34617b | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | NobuoTsukamoto/tensorflow | d7a7f2ade3c776aa88caad14ce8c1b0cd3de8f12 | 705e1684593327dae7b1e71087d5c0f97f6e9b25 | refs/heads/master | 2022-08-07T16:06:26.075258 | 2022-06-21T22:02:11 | 2022-06-21T22:02:11 | 200,446,660 | 0 | 1 | Apache-2.0 | 2019-08-04T03:50:49 | 2019-08-04T03:50:48 | null | UTF-8 | C++ | false | false | 8,722 | cc | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
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.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/common/tasks/conv_weights_converter.h"
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include "tensorflow/lite/delegates/gpu/common/task/util.h"
namespace tflite {
namespace gpu {
ConverterToConvWeights::ConverterToConvWeights(
const OperationDef& definition, const WeightsDescription& weights_desc)
: GPUOperation(definition), weights_desc_(weights_desc) {
code_ = GetConverterToConvWeightsCode();
}
std::string ConverterToConvWeights::GetConverterToConvWeightsCode() {
AddSrcTensor("src_tensor", definition_.src_tensors[0]);
args_.AddFloat("mask_x");
args_.AddFloat("mask_y");
args_.AddFloat("mask_z");
args_.AddFloat("mask_w");
args_.AddInt("out_ch");
args_.AddInt("out_ch_x4_groups");
args_.AddInt("in_ch");
args_.AddInt("in_ch_x4_groups");
args_.AddInt("kernel_width");
args_.AddInt("kernel_height");
args_.AddInt("kernel_spatial_size");
if (weights_desc_.layout == WeightsLayout::kOICustomSpatialI4O4 ||
weights_desc_.layout == WeightsLayout::kOICustomSpatialO4I4) {
std::vector<int32_t> remap(weights_desc_.spatial_remap.size());
for (int i = 0; i < remap.size(); ++i) {
remap[i] = weights_desc_.spatial_remap[i];
}
BufferDescriptor desc;
desc.element_type = DataType::INT32;
desc.element_size = 1;
desc.memory_type = MemoryType::GLOBAL;
desc.size = remap.size() * sizeof(int32_t);
desc.data.resize(desc.size);
std::memcpy(desc.data.data(), remap.data(), desc.size);
args_.AddObject("spatial_remap",
std::make_unique<BufferDescriptor>(std::move(desc)));
}
std::string c;
c += "MAIN_FUNCTION($0) {\n";
c += " int O = GLOBAL_ID_0;\n";
c += " int I = GLOBAL_ID_1;\n";
c += " int spatial_linear = GLOBAL_ID_2;\n";
c += " if (O >= args.out_ch_x4_groups) return;\n";
c += " if (I >= args.in_ch_x4_groups) return;\n";
c += " if (spatial_linear >= args.kernel_spatial_size) return;\n";
if (weights_desc_.layout == WeightsLayout::kOICustomSpatialI4O4 ||
weights_desc_.layout == WeightsLayout::kOICustomSpatialO4I4) {
c += " int linear_remap = args.spatial_remap.Read(spatial_linear);\n";
c += " int W = linear_remap % args.kernel_width;\n";
c += " int H = linear_remap / args.kernel_width;\n";
} else {
c += " int W = spatial_linear % args.kernel_width;\n";
c += " int H = spatial_linear / args.kernel_width;\n";
}
// W and H is src coordinates, spatial_linear is dst coordinate
c += " FLT4 v0 = INIT_FLT4(0.0f);\n";
c += " FLT4 v1 = INIT_FLT4(0.0f);\n";
c += " FLT4 v2 = INIT_FLT4(0.0f);\n";
c += " FLT4 v3 = INIT_FLT4(0.0f);\n";
// OHWI as BHWC: Read(WHSB) - Read(WHIO)
c += " if (O * 4 < args.out_ch) {\n";
c += " v0 = args.src_tensor.Read(W, H, I, O * 4);\n";
c += " }\n";
c += " if (O * 4 + 1 < args.out_ch) {\n";
c += " v1 = args.src_tensor.Read(W, H, I, O * 4 + 1);\n";
c += " }\n";
c += " if (O * 4 + 2 < args.out_ch) {\n";
c += " v2 = args.src_tensor.Read(W, H, I, O * 4 + 2);\n";
c += " }\n";
c += " if (O * 4 + 3 < args.out_ch) {\n";
c += " v3 = args.src_tensor.Read(W, H, I, O * 4 + 3);\n";
c += " }\n";
c += " if (I == args.src_tensor.Slices() - 1) {\n";
c += " FLT4 mask = INIT_FLT4v4(args.mask_x, args.mask_y, args.mask_z, "
"args.mask_w);\n";
c += " v0 *= mask;\n";
c += " v1 *= mask;\n";
c += " v2 *= mask;\n";
c += " v3 *= mask;\n";
c += " }\n";
const bool need_transpose = weights_desc_.IsI4O4();
if (need_transpose) {
c += " FLT4 r0 = INIT_FLT4v4(v0.x, v1.x, v2.x, v3.x);\n";
c += " FLT4 r1 = INIT_FLT4v4(v0.y, v1.y, v2.y, v3.y);\n";
c += " FLT4 r2 = INIT_FLT4v4(v0.z, v1.z, v2.z, v3.z);\n";
c += " FLT4 r3 = INIT_FLT4v4(v0.w, v1.w, v2.w, v3.w);\n";
} else {
c += " FLT4 r0 = v0;\n";
c += " FLT4 r1 = v1;\n";
c += " FLT4 r2 = v2;\n";
c += " FLT4 r3 = v3;\n";
}
if (weights_desc_.layout ==
WeightsLayout::k2DX4I4YIsSpatialIAndXIsOOGroupO4 ||
weights_desc_.layout ==
WeightsLayout::k2DX4O4YIsSpatialIAndXIsOOGroupI4) {
// Writing to 4X Textures 2D
AddDstTensor("dst_tensor0", definition_.dst_tensors[0]);
AddDstTensor("dst_tensor1", definition_.dst_tensors[1]);
AddDstTensor("dst_tensor2", definition_.dst_tensors[2]);
AddDstTensor("dst_tensor3", definition_.dst_tensors[3]);
c += " int yc = spatial_linear * args.in_ch_x4_groups + I;\n";
c += " args.dst_tensor0.Write2D(r0, O, yc);\n";
c += " args.dst_tensor1.Write2D(r1, O, yc);\n";
c += " args.dst_tensor2.Write2D(r2, O, yc);\n";
c += " args.dst_tensor3.Write2D(r3, O, yc);\n";
c += "}\n";
} else {
// Writing to linear buffer
AddDstTensor("dst_tensor", definition_.dst_tensors[0]);
c += " int OUTPUT_GROUP_SIZE = " +
std::to_string(weights_desc_.GetOutputGroupSize()) + ";\n";
c += " int d_index = (O * 4) / (OUTPUT_GROUP_SIZE * 4);\n";
c += " int k_index = ((O * 4) % (OUTPUT_GROUP_SIZE * 4)) / 4;\n";
std::string index;
if (weights_desc_.layout == WeightsLayout::kOICustomSpatialI4O4 ||
weights_desc_.layout == WeightsLayout::kOICustomSpatialO4I4) {
index =
"(d_index * args.in_ch_x4_groups + I) * args.kernel_spatial_size + "
"spatial_linear";
} else if (weights_desc_.layout == WeightsLayout::kOSpatialIOGroupI4O4 ||
weights_desc_.layout == WeightsLayout::kOSpatialIOGroupO4I4) {
index =
"(d_index * args.kernel_spatial_size + spatial_linear) * "
"args.in_ch_x4_groups + I";
}
c += " int dst_offset = (" + index + ") * OUTPUT_GROUP_SIZE + k_index;\n";
c += " args.dst_tensor.WriteLinear(r0, dst_offset * 4 + 0);\n";
c += " args.dst_tensor.WriteLinear(r1, dst_offset * 4 + 1);\n";
c += " args.dst_tensor.WriteLinear(r2, dst_offset * 4 + 2);\n";
c += " args.dst_tensor.WriteLinear(r3, dst_offset * 4 + 3);\n";
c += "}\n";
}
return c;
}
OHWI ConverterToConvWeights::GetWeightsSize() const {
const int output_channels = src_[0]->Batch();
const int input_channels = src_[0]->Channels();
const int kernel_width = src_[0]->Width();
const int kernel_height = src_[0]->Height();
return OHWI(output_channels, kernel_height, kernel_width, input_channels);
}
absl::Status ConverterToConvWeights::BindArguments(ArgumentsBinder* args) {
const auto& weights_shape = GetWeightsSize();
const int output_channels_x4_groups = DivideRoundUp(
AlignByN(weights_shape.o, 4 * weights_desc_.GetOutputGroupSize()), 4);
RETURN_IF_ERROR(args->SetInt("out_ch", weights_shape.o));
RETURN_IF_ERROR(args->SetInt("out_ch_x4_groups", output_channels_x4_groups));
RETURN_IF_ERROR(args->SetInt("in_ch", weights_shape.i));
RETURN_IF_ERROR(
args->SetInt("in_ch_x4_groups", DivideRoundUp(weights_shape.i, 4)));
RETURN_IF_ERROR(args->SetInt("kernel_width", weights_shape.w));
RETURN_IF_ERROR(args->SetInt("kernel_height", weights_shape.h));
RETURN_IF_ERROR(
args->SetInt("kernel_spatial_size", weights_shape.w * weights_shape.h));
float4 mask = GetMaskForLastPlane(src_[0]->Channels());
RETURN_IF_ERROR(args->SetFloat("mask_x", mask.x));
RETURN_IF_ERROR(args->SetFloat("mask_y", mask.y));
RETURN_IF_ERROR(args->SetFloat("mask_z", mask.z));
return args->SetFloat("mask_w", mask.w);
}
int3 ConverterToConvWeights::GetGridSize() const {
const auto& weights_shape = GetWeightsSize();
const int out_group_size = weights_desc_.GetOutputGroupSize();
const int grid_x =
DivideRoundUp(AlignByN(weights_shape.o, 4 * out_group_size), 4);
const int grid_y = DivideRoundUp(weights_shape.i, 4);
const int grid_z = weights_shape.w * weights_shape.h;
return int3(grid_x, grid_y, grid_z);
}
ConverterToConvWeights CreateConverterToConvWeights(
const OperationDef& definition, const WeightsDescription& weights_desc) {
return ConverterToConvWeights(definition, weights_desc);
}
} // namespace gpu
} // namespace tflite
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
fa3b870462e1b9c6c6f8c49d2cd6f196fae1ef18 | b367fe5f0c2c50846b002b59472c50453e1629bc | /xbox_leak_may_2020/xbox trunk/xbox/private/atg/tools/xbrc/axisangle.cpp | d24d8075a75e808c298a2bc9e321b519abf6b493 | [] | no_license | sgzwiz/xbox_leak_may_2020 | 11b441502a659c8da8a1aa199f89f6236dd59325 | fd00b4b3b2abb1ea6ef9ac64b755419741a3af00 | refs/heads/master | 2022-12-23T16:14:54.706755 | 2020-09-27T18:24:48 | 2020-09-27T18:24:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,545 | cpp | //-----------------------------------------------------------------------------
//
// File: axisangle.cpp
// Copyright (C) 2001 Microsoft Corporation
// All rights reserved.
//
// Axis-angle curve to quaternion curve conversion.
//-----------------------------------------------------------------------------
#include "stdafx.h"
inline FLOAT Lerp(FLOAT A, FLOAT B, FLOAT fLerpValue)
{
return A + fLerpValue * (B - A);
}
//////////////////////////////////////////////////////////////////////
// Set quaternion keys to match axis/angle rotation, with reasonable precision.
//
// NOTE: The other alternative is to add axis/angle animated rotation
// to AnimRotate, but this makes the animation package more complex.
//
HRESULT MatchAxisAngleCurve(AnimRotate *pRotate, CONST D3DXVECTOR3 *pvAxis, CONST AnimCurve *pAngle, FLOAT feps)
{
// clear arrays and copy over the curve duration, etc.
if (pRotate->m_curve.m_rKeyTimes) delete pRotate->m_curve.m_rKeyTimes;
if (pRotate->m_curve.m_rKeys) delete pRotate->m_curve.m_rKeys;
pRotate->m_curve.m_fBegin = pAngle->m_fBegin;
pRotate->m_curve.m_fDurationInverse = pAngle->m_fDurationInverse;
pRotate->m_curve.m_KeyCount = 0;
pRotate->m_curve.m_KeySize = 4;
pRotate->m_curve.m_rKeyTimes = NULL;
pRotate->m_curve.m_rKeys = NULL;
// Set the quaternion directly if there's just one key
if (pAngle->m_KeyCount == 1)
{
pRotate->m_curve.m_KeyCount = 1;
pRotate->m_curve.m_rKeyTimes = new FLOAT [ 1 ];
pRotate->m_curve.m_rKeyTimes[0] = pAngle->m_rKeyTimes[0];
pRotate->m_curve.m_rKeys = new FLOAT [ 1 * 4 ];
D3DXQuaternionRotationAxis((D3DXQUATERNION *)pRotate->m_curve.m_rKeys, pvAxis, pAngle->m_rKeys[0] );
return S_OK;
}
// Scratch space
const int MAX_KEYS = 100;
if (pAngle->m_KeyCount > MAX_KEYS)
return E_NOTIMPL;
FLOAT rKeyTimes[MAX_KEYS];
D3DXQUATERNION rKeys[MAX_KEYS];
UINT KeyCount = 0;
// For each segment of the input curve, start by setting the quaternion keys
// to be equal to the input curve, then keep on increasing the number of samples
// until the desired precision is matched.
FLOAT fTime0 = pAngle->m_rKeyTimes[0];
FLOAT fAngle0 = pAngle->m_rKeys[0];
rKeyTimes[ 0 ] = fTime0;
D3DXQuaternionRotationAxis(&rKeys[0], pvAxis, fAngle0);
KeyCount = 1;
CONST UINT nSample = 10; // intermediate samples to test quality of match
CONST FLOAT fLerpSampleScale = 1.f / (nSample - 1);
CONST FLOAT fFractionMin = 1e-6f;
for (UINT iKeyAngle = 1; iKeyAngle < pAngle->m_KeyCount; iKeyAngle++)
{
FLOAT fFraction = 1.f; // start with whole interval
try_again: // goto makes restarting from within for-loop easier
if (KeyCount >= MAX_KEYS)
return E_NOTIMPL; // too many keys needed to get desired precision
FLOAT fTime1 = Lerp(fTime0, pAngle->m_rKeyTimes[ iKeyAngle ], fFraction);
FLOAT fAngle1 = Lerp(fAngle0, pAngle->m_rKeys[ iKeyAngle ], fFraction);
rKeyTimes[ KeyCount ] = fTime1;
D3DXQuaternionRotationAxis(&rKeys[ KeyCount ], pvAxis, fAngle1);
// Check the error at a few intermediate points
for (UINT iSample = 1; iSample < nSample; iSample++)
{
FLOAT fLerp = (FLOAT)iSample * fLerpSampleScale;
FLOAT fAngle = fAngle0 + fLerp * (fAngle1 - fAngle0);
D3DXQUATERNION A;
D3DXQuaternionRotationAxis(&A, pvAxis, fAngle);
D3DXQUATERNION B;
D3DXQuaternionSlerp(&B, &rKeys[ KeyCount - 1 ], &rKeys[ KeyCount ], fLerp);
D3DXQUATERNION C = B - A;
FLOAT fError = D3DXQuaternionLengthSq(&C);
if (fError > feps)
{
fFraction *= 0.5f; // try again with a smaller fraction
if (fFraction < fFractionMin)
return E_FAIL; // Could not find a good quaternion key, no matter how small the fraction.
goto try_again;
}
}
// Error was small enough at all the intermediate points, so keep the key
KeyCount++;
fTime0 = fTime1;
fAngle0 = fAngle1;
if (fFraction < 1.f)
{
fFraction = 1.f;
goto try_again; // try again to span all the way to current key
}
}
// Copy keys to quaternion curve
pRotate->m_curve.m_KeyCount = KeyCount;
pRotate->m_curve.m_KeySize = 4;
pRotate->m_curve.m_rKeyTimes = new FLOAT [ KeyCount ];
pRotate->m_curve.m_rKeys = new FLOAT [ KeyCount * 4 ];
if (pRotate->m_curve.m_rKeyTimes == NULL
|| pRotate->m_curve.m_rKeys == NULL)
return E_OUTOFMEMORY;
memcpy(pRotate->m_curve.m_rKeyTimes, rKeyTimes, sizeof(FLOAT) * KeyCount );
memcpy(pRotate->m_curve.m_rKeys, rKeys, sizeof(FLOAT) * KeyCount * 4);
return S_OK;
}
| [
"benjamin.barratt@icloud.com"
] | benjamin.barratt@icloud.com |
efdfb3c1a9b66a57c1e89aa29a43a1bd4efc73a1 | 0379dd91363f38d8637ff242c1ce5d3595c9b549 | /windows_10_shared_source_kit/windows_10_shared_source_kit/unknown_version_2/Source/Tests/Graphics/Graphics/DirectX/Common/WGFTestFramework/D3DTest/C11DeviceExtras.cpp | 907c410e40ac4dd4f42e8634082bc48b58ae3f01 | [] | no_license | zhanglGitHub/windows_10_shared_source_kit | 14f25e6fff898733892d0b5cc23b2b88b04458d9 | 6784379b0023185027894efe6b97afee24ca77e0 | refs/heads/master | 2023-03-21T05:04:08.653859 | 2020-09-28T16:44:54 | 2020-09-28T16:44:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,249 | cpp | #include "pch.h"
#include "D3D11Wrapped.h"
#include "D3D11Convert.h"
HRESULT C11Device::ExecDeferredContext()
{
HRESULT hr;
ID3D11CommandList* pCommandList = NULL;
hr = m_pDeviceDeferredContext->FinishCommandList(TRUE, &pCommandList);
if (SUCCEEDED(hr))
{
m_pDeviceImmediateContext->ExecuteCommandList(pCommandList, TRUE);
SAFE_RELEASE(pCommandList);
}
return hr;
}
HRESULT C11Device::SwitchDeferredContext(bool bForceDisable)
{
HRESULT hr = S_OK;
bool enableDeferred = m_bUseDeferredContext;
if (bForceDisable)
enableDeferred = false;
else
{
int randval = rand() % 100;
if (randval < 10)
enableDeferred = !enableDeferred;
}
if (enableDeferred != m_bUseDeferredContext)
{
if (enableDeferred)
{
//nothing special to do here
m_bUseDeferredContext = true;
}
else
{
// flush & execute our existing deferred context state
hr = ExecDeferredContext();
m_bUseDeferredContext = false;
}
}
return hr;
}
HRESULT C11Device::CreateTexture2DFromSwapChain( IDXGISwapChain **ppSwapChain, CTexture2D ** ppTexture2D )
{
assert( m_pDevice != NULL );
assert( ppSwapChain != NULL );
HRESULT hr = S_OK;
if ( ppTexture2D )
{
ID3D11Texture2D * pTexture2D10 = NULL;
hr = (*ppSwapChain)->GetBuffer( 0, __uuidof( ID3D11Texture2D ), (void **) &pTexture2D10 );
*ppTexture2D = new C11Texture2D( pTexture2D10 );
(*ppTexture2D)->AddRef();
}
return hr;
}
HRESULT C11Device::CreateDebug( CDebug ** ppDebug )
{
assert( m_pDevice != NULL );
assert( ppDebug != NULL );
HRESULT hr = S_OK;
if ( ppDebug )
{
ID3D11Debug * ppDebug10 = NULL;
hr = m_pDevice->QueryInterface(__uuidof( ID3D11Debug ), (void **) &ppDebug10 );
*ppDebug = new C11Debug( ppDebug10 );
(*ppDebug)->AddRef();
}
return hr;
}
HRESULT C11Device::CreateInfoQueue( CInfoQueue ** ppInfoQueue )
{
assert( m_pDevice != NULL );
assert( ppInfoQueue != NULL );
HRESULT hr = S_OK;
if ( ppInfoQueue )
{
ID3D11InfoQueue * ppInfoQueue10 = NULL;
hr = m_pDevice->QueryInterface(__uuidof( ID3D11InfoQueue ), (void **) &ppInfoQueue10 );
*ppInfoQueue = new C11InfoQueue( ppInfoQueue10 );
(*ppInfoQueue)->AddRef();
}
return hr;
}
HRESULT C11Device::CreateMultithread( CMultithread ** ppMultithread )
{
assert( m_pDevice != NULL );
assert( ppMultithread != NULL );
HRESULT hr = S_OK;
if ( ppMultithread )
{
/*ID3D11Multithread * ppMultithread10 = NULL;
hr = m_pDevice->QueryInterface(__uuidof( ID3D11Multithread ), (void **) &ppMultithread10 );
*ppMultithread = new C11Multithread( ppMultithread10 );
(*ppMultithread)->AddRef();*/
*ppMultithread = NULL;
hr = S_OK;
}
return hr;
}
HRESULT C11Device::CreateSwitchToRef( CSwitchToRef ** ppSwitchToRef )
{
assert( m_pDevice != NULL );
assert( ppSwitchToRef != NULL );
HRESULT hr = S_OK;
if ( ppSwitchToRef )
{
ID3D11SwitchToRef * ppSwitchToRef10 = NULL;
hr = m_pDevice->QueryInterface(__uuidof( ID3D11SwitchToRef ), (void **) &ppSwitchToRef10 );
*ppSwitchToRef = new C11SwitchToRef( ppSwitchToRef10 );
(*ppSwitchToRef)->AddRef();
}
return hr;
}
void D3DWrapperConvertStruct( D3D_BLEND_DESC *d3d_blend_desc, D3D11_BLEND_DESC const *d3d_blend_desc_10 )
{
d3d_blend_desc->AlphaToCoverageEnable = d3d_blend_desc_10->AlphaToCoverageEnable;
for (int n = 0; n < 8; ++n)
{
d3d_blend_desc->BlendEnable[n] = d3d_blend_desc_10->RenderTarget[n].BlendEnable;
d3d_blend_desc->RenderTargetWriteMask[n] = d3d_blend_desc_10->RenderTarget[n].RenderTargetWriteMask;
}
D3DWrapperConvertEnum(&d3d_blend_desc->SrcBlend, d3d_blend_desc_10->RenderTarget[0].SrcBlend);
D3DWrapperConvertEnum(&d3d_blend_desc->DestBlend, d3d_blend_desc_10->RenderTarget[0].DestBlend);
D3DWrapperConvertEnum(&d3d_blend_desc->BlendOp, d3d_blend_desc_10->RenderTarget[0].BlendOp);
D3DWrapperConvertEnum(&d3d_blend_desc->SrcBlendAlpha, d3d_blend_desc_10->RenderTarget[0].SrcBlendAlpha);
D3DWrapperConvertEnum(&d3d_blend_desc->DestBlendAlpha, d3d_blend_desc_10->RenderTarget[0].DestBlendAlpha);
D3DWrapperConvertEnum(&d3d_blend_desc->BlendOpAlpha, d3d_blend_desc_10->RenderTarget[0].BlendOpAlpha);
}
void D3DWrapperConvertStruct( D3D11_BLEND_DESC *d3d_blend_desc_10, D3D_BLEND_DESC const *d3d_blend_desc )
{
d3d_blend_desc_10->AlphaToCoverageEnable = d3d_blend_desc->AlphaToCoverageEnable;
d3d_blend_desc_10->IndependentBlendEnable = TRUE;
for (int n = 0; n < 8; ++n)
{
d3d_blend_desc_10->RenderTarget[n].BlendEnable = d3d_blend_desc->BlendEnable[n];
d3d_blend_desc_10->RenderTarget[n].RenderTargetWriteMask = d3d_blend_desc->RenderTargetWriteMask[n];
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].SrcBlend, d3d_blend_desc->SrcBlend);
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].DestBlend, d3d_blend_desc->DestBlend);
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].BlendOp, d3d_blend_desc->BlendOp);
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].SrcBlendAlpha, d3d_blend_desc->SrcBlendAlpha);
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].DestBlendAlpha, d3d_blend_desc->DestBlendAlpha);
D3DWrapperConvertEnum(&d3d_blend_desc_10->RenderTarget[n].BlendOpAlpha, d3d_blend_desc->BlendOpAlpha);
}
}
void D3DWrapperConvertStruct( D3D_VIEWPORT *d3d_viewport, D3D11_VIEWPORT const *d3d_viewport_10 )
{
d3d_viewport->TopLeftX = (INT)d3d_viewport_10->TopLeftX;
d3d_viewport->TopLeftY = (INT)d3d_viewport_10->TopLeftY;
d3d_viewport->Width = (INT)d3d_viewport_10->Width;
d3d_viewport->Height = (INT)d3d_viewport_10->Height;
d3d_viewport->MinDepth = d3d_viewport_10->MinDepth;
d3d_viewport->MaxDepth = d3d_viewport_10->MaxDepth;
}
void D3DWrapperConvertStruct( D3D11_VIEWPORT *d3d_viewport_10, D3D_VIEWPORT const *d3d_viewport )
{
d3d_viewport_10->TopLeftX = (FLOAT)d3d_viewport->TopLeftX;
d3d_viewport_10->TopLeftY = (FLOAT)d3d_viewport->TopLeftY;
d3d_viewport_10->Width = (FLOAT)d3d_viewport->Width;
d3d_viewport_10->Height = (FLOAT)d3d_viewport->Height;
d3d_viewport_10->MinDepth = d3d_viewport->MinDepth;
d3d_viewport_10->MaxDepth = d3d_viewport->MaxDepth;
}
| [
"benjamin.barratt@icloud.com"
] | benjamin.barratt@icloud.com |
00c9a02e333eb412f0ad0539cd13b5d7ac5a7172 | c7c2491fc6d4f961bf41dfa3db85e8968f376439 | /R113-edu/b.cpp | bf50eb991a1b263fb8e6b6d17d78f2f86c1abbec | [
"Apache-2.0"
] | permissive | patwadeepak/codeforces | c924c50264bd8b80b6f271e3b223f1cbf6ad643d | 5da8c79ad6f27a4a2436d19fc8cbf274ecd452e2 | refs/heads/main | 2023-08-14T01:28:59.593075 | 2021-09-24T18:13:39 | 2021-09-24T18:13:39 | 340,672,864 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 250 | cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
string s;
cin >> s;
vector<vector<char>> table(n, vector<char>(n, 'X'));
}
int main() {
int t; cin >> t;
while(t--) solve();
} | [
"patwa.deepak@gmail.com"
] | patwa.deepak@gmail.com |
ebfa22bd882d80bc0647eb7a6438e30c19292df0 | 3970f1a70df104f46443480d1ba86e246d8f3b22 | /vimrid-viewer/src/ui/TextControl.h | 0e16889b20b9b34438d37ad1c05d252c9bde5861 | [] | no_license | zhan2016/vimrid | 9f8ea8a6eb98153300e6f8c1264b2c042c23ee22 | 28ae31d57b77df883be3b869f6b64695df441edb | refs/heads/master | 2021-01-20T16:24:36.247136 | 2009-07-28T18:32:31 | 2009-07-28T18:32:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 891 | h | /* TODO: Short description of file.
*
* TODO: Write detailed information.
*
* Created: 02-May-2009
* Author: Nick Bolton (njb4@aber.ac.uk)
*/
#ifndef TEXTCONTROL_H_
#define TEXTCONTROL_H_
#include "Control.h"
#include <string>
namespace vimrid
{
namespace ui
{
class TextControl: public Control
{
public:
TextControl(const std::string &text);
virtual ~TextControl();
virtual void Update();
virtual void Render();
VColour4F GetTextColour() const;
void SetTextColour(const VColour4F &textColour) { mTextColour = textColour; }
virtual void OnSelectPress();
virtual void OnSelectRelease();
virtual void OnSelectReset();
const std::string &GetText() const { return mText; }
void SetText(const std::string &text) { mText = text; }
private:
std::string mText;
void* mFont;
VPoint2f mTextOffset;
VColour4F mTextColour;
};
}
}
#endif // TEXTCONTROL_H_
| [
"nick@synergy-project.org"
] | nick@synergy-project.org |
29b21d70c5ab10fc84aa89ff70cfdf148ec45285 | e1cd6c8fccdc7bed50d64e9f0767c16b3f5a5038 | /week-10/Darts/game.h | 80721ac61b5428ae90deaefab3fa23db7e4b10c7 | [] | no_license | green-fox-academy/laszland | 4fd2428fc95083f0a61b47c34759b392ad2990ed | 6acf9c774dc07d838b5400bb3313ed1044827b16 | refs/heads/master | 2020-07-23T12:39:16.484793 | 2020-01-29T09:29:17 | 2020-01-29T09:29:17 | 207,557,491 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 322 | h | #ifndef DARTS_GAME_H
#define DARTS_GAME_H
#include "player.h"
#include <iostream>
#include <vector>
class game {
public:
void setNumberOfPlayers(int numberOfPlayers);
static int getNumberOfPlayers() const;
private:
int _numberOfPlayers;
std::vector<player*> _listOfPlayers;
};
#endif //DARTS_GAME_H
| [
"laszlo.roland.kiss@gmail.com"
] | laszlo.roland.kiss@gmail.com |
362bc1ec02bda484e318c87534a74b22e45098e3 | 083ad05ab9296d1b8d45fe583b89581d7767b189 | /test/RtSawTooth.cpp | c4947b6b7b4f5ea5b8734e0fc1a9dd726813226e | [
"MIT"
] | permissive | liamwhan/rtaudiojs | f62977529c563d72d4bb343da97c738e8c1c7702 | beb7d00ac9e2b9e2d3e71f833c3687590414437e | refs/heads/master | 2021-09-03T12:53:58.803389 | 2018-01-09T08:15:13 | 2018-01-09T08:15:13 | 115,500,261 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,117 | cpp | #include "../lib/rtaudio/RtAudio.h"
#include <iostream>
#include <cstdlib>
#ifndef __MATH_LONG_DOUBLE_CONSTANTS
#define __MATH_LONG_DOUBLE_CONSTANTS
#endif
#include <math.h>
static const double TAU = (double) M_PI * 2.0;
static const double A = 1.0;
static const double F = 400.0;
static unsigned int sampleRate = 44100;
static unsigned int bufferFrames = 256; // 256 sample frames
static unsigned int nChannels = 2;
// Two-channel sawtooth wave generator.
int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
double streamTime, RtAudioStreamStatus status, void *userData )
{
unsigned int i, j;
double *buffer = (double *) outputBuffer;
// double *lastValues = (double *) userData;
if ( status )
std::cout << "Stream underflow detected!" << std::endl;
// Write interleaved audio data.
for ( i=0; i<nBufferFrames; i++ ) {
for ( j=0; j<2; j++ ) {
double sample = (A * sin((TAU * F) * (streamTime * i)));
std::cout << sample << std::endl;
// *buffer++ = lastValues[j];
*buffer++ = sample;
}
}
return 0;
}
int main()
{
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 0 );
}
RtAudio::StreamParameters parameters;
parameters.deviceId = dac.getDefaultOutputDevice();
parameters.nChannels = 2;
parameters.firstChannel = 0;
double data[2];
try {
dac.openStream( ¶meters, NULL, RTAUDIO_FLOAT64,
sampleRate, &bufferFrames, &saw, (void *)&data );
dac.startStream();
}
catch ( RtAudioError& e ) {
e.printMessage();
exit( 0 );
}
char input;
std::cout << "\nPlaying ... press <enter> to quit.\n";
std::cin.get( input );
try {
// Stop the stream
dac.stopStream();
}
catch (RtAudioError& e) {
e.printMessage();
}
if ( dac.isStreamOpen() ) dac.closeStream();
return 0;
} | [
"liam.whan@gmail.com"
] | liam.whan@gmail.com |
3d100d7ab3a0d4fa3c3c36a103fa3fffcc4f0d86 | a7ea7b9eb9f0ad06f770f4a27ddff3154cf34723 | /cpp03/ex04/SuperTrap.hpp | 021e305af322bd043c8ae445b196c09705bd0e76 | [] | no_license | DianeHemi/Modules_CPP | a73a2898236ffcb6cc4db7eafae968daa1de10d8 | c8387ea75edd7298b7998fb3acb5965d666a3270 | refs/heads/main | 2023-05-13T01:10:51.968652 | 2021-06-09T10:29:14 | 2021-06-09T10:29:14 | 375,312,477 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,401 | hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* SuperTrap.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dchampda <dchampda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/04/08 18:04:59 by dchampda #+# #+# */
/* Updated: 2021/04/08 18:05:00 by dchampda ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SUPERTRAP_HPP
# define SUPERTRAP_HPP
# include <iostream>
# include <string>
# include "FragTrap.hpp"
# include "NinjaTrap.hpp"
class SuperTrap : public FragTrap, public NinjaTrap {
public:
SuperTrap();
SuperTrap( std::string name );
SuperTrap( SuperTrap const & src );
~SuperTrap();
SuperTrap & operator=( SuperTrap const & rhs );
std::string getName() const;
void rangedAttack( std::string const & target ) const;
void meleeAttack( std::string const & target ) const;
};
#endif
| [
"noreply@github.com"
] | DianeHemi.noreply@github.com |
a9e2884b181f52dbae6144dcfe1854a792b7bf0d | 3606b813bd7354cacac1e2bbbd3fdc3048fafaf5 | /Sanal 3-B Lego Oyunu/stdafx.h | adb6dbb4cd6e60b71c1f7be5c7fd0d0c03634327 | [] | no_license | alihansultan/bitirme | 2ece4b22e625d08ddc5fbfd62bb4e29d190595cc | aadf01b7c4ecaeee0bfed1b803fc73e15d07e83c | refs/heads/main | 2023-05-18T22:54:29.089433 | 2021-06-13T21:35:44 | 2021-06-13T21:35:44 | 376,638,510 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 288 | h | #pragma once
#include "targetver.h"
#include <stdio.h>
#include <iostream>
#include <tchar.h>
#include <ctime>
#include <Windows.h>
#include <GL/glew.h>
#include <gl/glut.h>
#include <vector>
#include <math.h>
#include <mmsystem.h>
#include <SDL.h>
#include <process.h>
| [
"noreply@github.com"
] | alihansultan.noreply@github.com |
9b6f970eab37c9270e396a058a6fda5c165edc93 | 4a2b210df0e5a91199c5e8d53a06c0435318928b | /main.cpp | 8295abd6309e6e4f0f8a90e7b230ff0cba351b60 | [] | no_license | Meleus/HW | 3ec966379dbefbec625fbd978628afede3a2225e | 4422a19cc48ea8d71920cd10c930d835e071d8b4 | refs/heads/master | 2020-09-15T08:25:46.729031 | 2020-03-13T06:50:14 | 2020-03-13T06:50:14 | 223,393,875 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 140 | cpp | #include <stdio.h>
#include "funca.h"
int main(){
show();
printf("lung good team\n");
printf("Hello World!\n");
return 0;
}
| [
"noreply@github.com"
] | Meleus.noreply@github.com |
5bde512acb877727409ad32af684585689571adf | 3a7225540a6d94ad9cf3ac65e5bfbae0c39764f1 | /Src/TNRSModules/MotionModule/src/HeadControl/HeadControl.cpp | fb0831a6b4e4b25c8bc37c8ae13f2a30dcf977c1 | [
"BSD-3-Clause"
] | permissive | saifullah3396/team-nust-robocup | e885f9856aef52f688927fc5bf3534c708a90823 | 2da710731ff758d164e048b407dd1601aa1bc421 | refs/heads/master | 2020-03-25T19:25:07.766123 | 2018-10-16T10:49:59 | 2018-10-16T10:49:59 | 144,081,847 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,306 | cpp | /**
* @file MotionModule/src/HeadControl/HeadControl.cpp
*
* This file implements the class HeadControl
*
* @author <A href="mailto:saifullah3396@gmail.com">Saifullah</A>
* @date 20 Nov 2017
*/
#include "MotionModule/include/HeadControl/HeadControl.h"
#include "MotionModule/include/HeadControl/Types/HeadTargetTrack.h"
#include "MotionModule/include/HeadControl/Types/HeadTargetSearch.h"
template <typename Scalar>
boost::shared_ptr<HeadControl<Scalar> > HeadControl<Scalar>::getType(
MotionModule* motionModule, const BehaviorConfigPtr& cfg)
{
HeadControl<Scalar>* hc;
switch (cfg->type) {
case (unsigned) MBHeadControlTypes::HEAD_TARGET_TRACK:
hc = new HeadTargetTrack<Scalar>(motionModule, cfg); break;
case (unsigned) MBHeadControlTypes::HEAD_TARGET_SEARCH:
hc = new HeadTargetSearch<Scalar>(motionModule, cfg); break;
default: hc = new HeadTargetTrack<Scalar>(motionModule, cfg); break;
}
return boost::shared_ptr<HeadControl<Scalar> >(hc);
}
template <typename Scalar>
bool HeadControl<Scalar>::findTarget(
const HeadTargetTypes& targetType,
Point_<Scalar>& targetXY,
Scalar& targetZ) throw (BehaviorException)
{
try {
if (targetType == HeadTargetTypes::BALL) {
auto& ballInfo = IVAR(BallInfo, MotionModule::ballInfo);
if (ballInfo.found) {
targetXY = ballInfo.posRel;
targetZ = 0.05f;
return true;
} else {
return false;
}
} else if (targetType == HeadTargetTypes::GOAL) {
auto& goalInfo = IVAR(GoalInfo, MotionModule::goalInfo);
if (
goalInfo.found &&
goalInfo.leftPost.x > -50 &&
goalInfo.rightPost.x > -50)
{
targetXY = goalInfo.mid;
targetZ = 0.f;
return true;
} else {
return false;
}
} else if (targetType == HeadTargetTypes::LANDMARKS) {
if (IVAR(bool, MotionModule::landmarksFound)) {
targetZ = -1.f;
return true;
} else {
return false;
}
} else {
throw BehaviorException(this, "Undefined target type for HeadTargetSearch", false, EXC_INVALID_BEHAVIOR_SETUP);
}
} catch (BehaviorException& e) {
cout << e.what();
this->inBehavior = false;
return false;
}
}
template class HeadControl<MType>;
| [
"saifullah3396@gmail.com"
] | saifullah3396@gmail.com |
e2f76d26c1c27bd034043eb95dbc97a23b0e2ec9 | 09eaf2b22ad39d284eea42bad4756a39b34da8a2 | /ojs/codechef/jan18/rectangl/rectangl.cpp | 9e558ffdff811f5ce890bb71660f98907770ba8e | [] | no_license | victorsenam/treinos | 186b70c44b7e06c7c07a86cb6849636210c9fc61 | 72a920ce803a738e25b6fc87efa32b20415de5f5 | refs/heads/master | 2021-01-24T05:58:48.713217 | 2018-10-14T13:51:29 | 2018-10-14T13:51:29 | 41,270,007 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 359 | cpp | #include <bits/stdc++.h>
#define cout if (1) cout
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pii;
#define pb push_back
int main () {
int ts;
cin >> ts;
while (ts--) {
int a[4];
for (int i = 0; i < 4; i++)
cin >> a[i];
sort(a, a+4);
if (a[0] == a[1] && a[2] == a[3])
printf("YES\n");
else
printf("NO\n");
}
}
| [
"victorsenam@gmail.com"
] | victorsenam@gmail.com |
0137938d70cdfcceb86b269dd13d42fdc66f712c | 8720a4e6492f74d2ce589798734661f2e42538dc | /SK-Game-Engine/src/SK-Game-Engine/Debug/Profiler.h | b3ae77fcc574afbcde529b6c1a7c304c6fa147bf | [
"Apache-2.0"
] | permissive | StK1729/SK-Game-Engine | 378dc3da3efc81c2fb96f335fa89aa3558482451 | 3e411994fdcd29b1c8948718382b6b08dc1ed3ab | refs/heads/master | 2022-11-08T21:15:35.755902 | 2020-06-21T04:00:03 | 2020-06-21T04:00:03 | 248,624,504 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,242 | h | #pragma once
#include <string>
#include <chrono>
#include <algorithm>
#include <fstream>
#include <thread>
#include "SK-Game-Engine/Core/Core.h"
namespace SK_Game_Engine
{
struct ProfileResult
{
std::string Name;
long long Start, End;
uint32_t ThreadID;
};
struct ProfilerSession
{
std::string Name;
};
class Profiler
{
private:
ProfilerSession* m_CurrentSession;
std::ofstream m_OutputStream;
int m_ProfileCount;
public:
Profiler()
: m_CurrentSession(nullptr), m_ProfileCount(0)
{
}
void BeginSession(const std::string& name, const std::string& filepath = "results.json")
{
m_OutputStream.open(filepath);
WriteHeader();
m_CurrentSession = new ProfilerSession{ name };
}
void EndSession()
{
WriteFooter();
m_OutputStream.close();
delete m_CurrentSession;
m_CurrentSession = nullptr;
m_ProfileCount = 0;
}
void WriteProfile(const ProfileResult& result)
{
if (m_ProfileCount++ > 0)
m_OutputStream << ",";
std::string name = result.Name;
std::replace(name.begin(), name.end(), '"', '\'');
m_OutputStream << "{";
m_OutputStream << "\"cat\":\"function\",";
m_OutputStream << "\"dur\":" << (result.End - result.Start) << ',';
m_OutputStream << "\"name\":\"" << name << "\",";
m_OutputStream << "\"ph\":\"X\",";
m_OutputStream << "\"pid\":0,";
m_OutputStream << "\"tid\":" << result.ThreadID << ",";
m_OutputStream << "\"ts\":" << result.Start;
m_OutputStream << "}";
m_OutputStream.flush();
}
void WriteHeader()
{
m_OutputStream << "{\"otherData\": {},\"traceEvents\":[";
m_OutputStream.flush();
}
void WriteFooter()
{
m_OutputStream << "]}";
m_OutputStream.flush();
}
static Profiler& Get()
{
static Profiler instance;
return instance;
}
};
class Timer
{
public:
Timer(const char* name)
: m_Name(name), m_Stopped(false)
{
m_StartTimepoint = std::chrono::high_resolution_clock::now();
}
~Timer()
{
if (!m_Stopped)
Stop();
}
void Stop()
{
auto endTimepoint = std::chrono::high_resolution_clock::now();
long long start = std::chrono::time_point_cast<std::chrono::microseconds>(m_StartTimepoint).time_since_epoch().count();
long long end = std::chrono::time_point_cast<std::chrono::microseconds>(endTimepoint).time_since_epoch().count();
uint32_t threadID = std::hash<std::thread::id>{}(std::this_thread::get_id());
Profiler::Get().WriteProfile({ m_Name, start, end, threadID });
m_Stopped = true;
}
private:
const char* m_Name;
std::chrono::time_point<std::chrono::high_resolution_clock> m_StartTimepoint;
bool m_Stopped;
};
}
// #define SKGE_PROFILING
#ifdef SKGE_PROFILING
#define SKGE_PROFILING_BEGIN_SESSION(name, filepath) ::SK_Game_Engine::Profiler::Get().BeginSession(name, filepath)
#define SKGE_PROFILING_END_SESSION() ::SK_Game_Engine::Profiler::Get().EndSession()
#define SKGE_PROFILING_SCOPE(name) ::SK_Game_Engine::Timer CONCAT(timer, __LINE__)(name)
#define SKGE_PROFILING_FUNCTION() SKGE_PROFILING_SCOPE(__FUNCSIG__)
#else
#define SKGE_PROFILING_BEGIN_SESSION(name, filepath)
#define SKGE_PROFILING_END_SESSION()
#define SKGE_PROFILING_SCOPE(name)
#define SKGE_PROFILING_FUNCTION()
#endif | [
"stefan.kraljevic@gmail.com"
] | stefan.kraljevic@gmail.com |
3edc1c934db6d57664d8bc42bf134c400238e07f | 07e56c4aa723f5781f81283d8a46892fe7ba838e | /barrier.h | 548e496fc6012b8e7cfd3e4220f9730b47f48c8e | [
"BSD-3-Clause"
] | permissive | jplevyak/plib | 19d36ac8e8add21840bc25b09ff85f0478bf3e2f | 401f705bb349ffbdfe3053c849afd9851dd6ab16 | refs/heads/master | 2021-08-17T21:46:56.401314 | 2021-01-19T16:52:16 | 2021-01-19T16:52:16 | 752,693 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 661 | h | /* -*-Mode: c++;-*-
Copyright (c) 1994-2008 John Plevyak, All Rights Reserved
*/
#ifndef barrier_H
#define barrier_H
#include <pthread.h>
struct barrier_t {
pthread_mutex_t mutex;
pthread_cond_t cond;
int counter;
};
#define BARRIER_INITIALIZER \
{ PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 }
extern int barrier_init(barrier_t *barrier, int count);
extern int barrier_destroy(barrier_t *barrier);
extern int barrier_signal(barrier_t *barrier); // worker signals
extern int barrier_wait(barrier_t *barrier); // master waits
extern int barrier_signal_and_wait(barrier_t *barrier); // cooperative barrier
#endif
| [
"jplevyak@acm.org"
] | jplevyak@acm.org |
72b9229f42c6d2161246fd5bf49639b44db810db | e5655151d8673b00cc7eda76b1a897a46ec4e591 | /be/src/util/mem-info.h | 6ca17baf7b1bd2b86b901289906bce93e818f1f1 | [
"Apache-2.0"
] | permissive | mapr/impala | 870229dbfcb7e790e1571018d269d6a1e87259b4 | 2b626c8e9f4c666d23872c228cf43daae4c9acbb | refs/heads/v1.4.1-mapr | 2020-04-05T07:51:33.026765 | 2015-01-14T13:37:12 | 2015-01-14T13:37:12 | 12,654,740 | 2 | 6 | null | 2016-03-10T16:34:10 | 2013-09-06T21:13:27 | C++ | UTF-8 | C++ | false | false | 1,393 | h | // Copyright 2012 Cloudera Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef IMPALA_UTIL_MEM_INFO_H
#define IMPALA_UTIL_MEM_INFO_H
#include <string>
#include <boost/cstdint.hpp>
#include "common/logging.h"
namespace impala {
// Provides the amount of physical memory available.
// Populated from /proc/meminfo.
// TODO: Allow retrieving of cgroup memory limits,
// e.g., by checking /sys/fs/cgroup/memory/groupname/impala/memory.limit_in_bytes
// TODO: Combine mem-info, cpu-info and disk-info into hardware-info?
class MemInfo {
public:
// Initialize MemInfo.
static void Init();
// Get total physical memory in bytes (ignores cgroups memory limits).
static int64_t physical_mem() {
DCHECK(initialized_);
return physical_mem_;
}
static std::string DebugString();
private:
static bool initialized_;
static int64_t physical_mem_;
};
}
#endif
| [
"henry@cloudera.com"
] | henry@cloudera.com |
4504541148a173464a927da76ec32120d1d1f1ba | 6933553ab8c00777379f6bb2f4c1aaeee7a951aa | /Source/UnrealEnginePython/Public/PyActor.cpp | fa7766ccfa678b1a5c17fec0baffa9fcc945b15e | [
"MIT"
] | permissive | crispy4004/UnrealEnginePython | 78390fe23fd4ac8b75c514a8e038883ca2b8790b | ed6e079435b61c38f5018d29b2c04847cd2f0aee | refs/heads/master | 2021-01-21T03:25:42.710031 | 2016-08-24T15:34:57 | 2016-08-24T15:34:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,782 | cpp | #include "UnrealEnginePythonPrivatePCH.h"
#include "PyActor.h"
APyActor::APyActor()
{
PrimaryActorTick.bCanEverTick = true;
this->OnActorBeginOverlap.AddDynamic(this, &APyActor::PyOnActorBeginOverlap);
this->OnActorEndOverlap.AddDynamic(this, &APyActor::PyOnActorEndOverlap);
this->OnActorHit.AddDynamic(this, &APyActor::PyOnActorHit);
this->OnClicked.AddDynamic(this, &APyActor::PyOnActorClicked);
// pre-generate PyUObject (for performance)
ue_get_python_wrapper(this);
}
// Called when the game starts
void APyActor::BeginPlay()
{
Super::BeginPlay();
// ...
const TCHAR *blob = *PythonCode;
int ret = PyRun_SimpleString(TCHAR_TO_UTF8(blob));
UE_LOG(LogPython, Warning, TEXT("Python ret = %d"), ret);
if (ret) {
unreal_engine_py_log_error();
}
if (PythonModule.IsEmpty())
return;
PyObject *py_actor_module = PyImport_ImportModule(TCHAR_TO_UTF8(*PythonModule));
if (!py_actor_module) {
unreal_engine_py_log_error();
return;
}
#if WITH_EDITOR
// todo implement autoreload with a dictionary of module timestamps
py_actor_module = PyImport_ReloadModule(py_actor_module);
if (!py_actor_module) {
unreal_engine_py_log_error();
return;
}
#endif
if (PythonClass.IsEmpty())
return;
PyObject *py_actor_module_dict = PyModule_GetDict(py_actor_module);
PyObject *py_actor_class = PyDict_GetItemString(py_actor_module_dict, TCHAR_TO_UTF8(*PythonClass));
if (!py_actor_class) {
unreal_engine_py_log_error();
return;
}
py_actor_instance = PyObject_CallObject(py_actor_class, NULL);
if (!py_actor_instance) {
unreal_engine_py_log_error();
return;
}
PyObject *py_obj = (PyObject *) ue_get_python_wrapper(this);
if (py_obj) {
PyObject_SetAttrString(py_actor_instance, "uobject", py_obj);
}
else {
UE_LOG(LogPython, Error, TEXT("Unable to set 'uobject' field in actor wrapper class"));
}
PyObject *bp_ret = PyObject_CallMethod(py_actor_instance, "begin_play", NULL);
if (!bp_ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(bp_ret);
}
// Called every frame
void APyActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (!py_actor_instance)
return;
if (!PyObject_HasAttrString(py_actor_instance, "tick"))
return;
PyObject *ret = PyObject_CallMethod(py_actor_instance, "tick", "f", DeltaTime);
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
void APyActor::PyOnActorBeginOverlap(AActor *overlapped, AActor *other)
{
if (!py_actor_instance)
return;
PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_begin_overlap", "O", (PyObject *)ue_get_python_wrapper(other));
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
void APyActor::PyOnActorEndOverlap(AActor *overlapped, AActor *other)
{
if (!py_actor_instance)
return;
if (!PyObject_HasAttrString(py_actor_instance, "on_actor_end_overlap"))
return;
PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_end_overlap", "O", (PyObject *)ue_get_python_wrapper(other));
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
void APyActor::PyOnActorHit(AActor *self_actor, AActor *other, FVector impulse_normal, const FHitResult &hit)
{
if (!py_actor_instance)
return;
PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_hit", "O(fff)(fff)(fff)", (PyObject *)ue_get_python_wrapper(other), impulse_normal.X, impulse_normal.Y, impulse_normal.Z, hit.ImpactPoint.X, hit.ImpactPoint.Y, hit.ImpactPoint.Z, hit.ImpactNormal.X, hit.ImpactNormal.Y, hit.ImpactNormal.Z);
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
void APyActor::PyOnActorClicked(AActor *touched_actor, FKey button_pressed)
{
if (!py_actor_instance)
return;
PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_clicked", "Os", (PyObject *)ue_get_python_wrapper(touched_actor), TCHAR_TO_UTF8(*button_pressed.ToString()));
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
void APyActor::CallPythonActorMethod(FString method_name, FString args)
{
if (!py_actor_instance)
return;
PyObject *ret = nullptr;
if (args.IsEmpty()) {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), NULL);
}
else {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), "s", TCHAR_TO_UTF8(*args));
}
if (!ret) {
unreal_engine_py_log_error();
return;
}
Py_DECREF(ret);
}
bool APyActor::CallPythonActorMethodBool(FString method_name, FString args)
{
if (!py_actor_instance)
return false;
PyObject *ret = nullptr;
if (args.IsEmpty()) {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), NULL);
}
else {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), "s", TCHAR_TO_UTF8(*args));
}
if (!ret) {
unreal_engine_py_log_error();
return false;
}
if (PyObject_IsTrue(ret)) {
Py_DECREF(ret);
return true;
}
Py_DECREF(ret);
return false;
}
FString APyActor::CallPythonActorMethodString(FString method_name, FString args)
{
if (!py_actor_instance)
return FString();
PyObject *ret = nullptr;
if (args.IsEmpty()) {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), NULL);
}
else {
ret = PyObject_CallMethod(py_actor_instance, TCHAR_TO_UTF8(*method_name), "s", TCHAR_TO_UTF8(*args));
}
if (!ret) {
unreal_engine_py_log_error();
return FString();
}
PyObject *py_str = PyObject_Str(ret);
if (!py_str) {
Py_DECREF(ret);
return FString();
}
char *str_ret = PyUnicode_AsUTF8(py_str);
FString ret_fstring = FString(UTF8_TO_TCHAR(str_ret));
Py_DECREF(py_str);
return ret_fstring;
}
APyActor::~APyActor()
{
Py_XDECREF(py_actor_instance);
UE_LOG(LogPython, Warning, TEXT("Python AActor wrapper XDECREF'ed"));
} | [
"roberto@20tab.com"
] | roberto@20tab.com |
9eba5ae54ffae8c99dd59c8cfc28adaaea1c419d | 0a956f01996843087b55c7bea6f8ff8a8a2c6f0b | /Arduino/IR_remote/IR_remote.ino | c5c6a677b44b9a342c76f4491d32f97afd673da2 | [] | no_license | jnnorthway/Desktop-Remote | 4c0ed34dbfd66fd259606033daa032507c8b0ff5 | 91e9691fa449bc5de27ed8d838931d4538f80e9f | refs/heads/master | 2020-05-25T00:37:50.284188 | 2019-07-10T03:11:22 | 2019-07-10T03:11:22 | 187,536,775 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,762 | ino | #include <Adafruit_GFX.h>
#include <Adafruit_TFTLCD.h>
#include <TouchScreen.h>
#include <IRremote.h>
#include <Servo.h>
IRsend irsend;
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4
#define TS_MINX 108
#define TS_MINY 81
#define TS_MAXX 908
#define TS_MAXY 918
#define YP A3
#define XM A2
#define YM 9
#define XP 8
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF8C0// 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE3
#define WHITE 0xFFFF
#define GREY 0x4C12// 0xC618
#define RED1 0xF800
#define ORANGE1 0xFCA0
#define YELLOW1 0xFFE0
#define GREEN1 0x3FE0
#define LIGHTBLUE1 0x07FD
#define BLUE1 0x00DF
#define PURPLE1 0xE99F
#define PINK1 0xF816
#define WHITE1 0xFFFF
#define TURQUOISE1 0x07FF
#define TURQUOISE2 0x04D6
#define TURQUOISE3 0x034F
#define RED2 0xFB40
#define ORANGE2 0xFEC0
#define GREEN2 0x26A0
#define LIGHTBLUE2 0x067F
#define BLUE2 0x5C1F
#define PURPLE2 0xBA1F
#define PURPLE3 0xD81F
#define PINK2 0xF818
#define MINPRESSURE 5
#define MAXPRESSURE 1000
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 364);
void(* resetFunc) (void) = 0;
int res = 0;
void setbtn(){
tft.setCursor(40,25);
tft.setTextSize(3);
tft.setTextColor(WHITE);
tft.print("James' Remote");
tft.fillRect(30,90,100,100,GREY);
tft.drawRect(30,90,100,100,WHITE);
tft.setCursor(65,120);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("LED");
tft.fillRect(190,90,100,100,GREY);
tft.drawRect(190,90,100,100,WHITE);
tft.setCursor(200,120);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("Samsung");
}
void backBtn(){
//back
tft.fillRect(10,10,80,30,GREY);
tft.drawRect(10,10,80,30,WHITE);
tft.setCursor(15,18);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print(" BACK");
}
void samBtn(){
tft.fillRect(10,80,80,80,RED);
tft.drawRect(10,80,80,80,WHITE);
tft.setCursor(15,115);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("ON/OFF");
tft.fillRect(10,200,80,30,GREY);
tft.drawRect(10,200,80,30,WHITE);
tft.setCursor(15,208);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("Source");
tft.fillRect(127,10,106,70,GREY);
tft.drawRect(127,10,106,70,WHITE);
tft.setCursor(132,35);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print(" Vol UP");
tft.fillRect(127,160,106,70,GREY);
tft.drawRect(127,160,106,70,WHITE);
tft.setCursor(132,185);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("Vol DOWN");
tft.fillRect(150,107,60,30,GREY);
tft.drawRect(150,107,60,30,WHITE);
tft.setCursor(155,113);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("MUTE");
tft.fillRect(270,70,40,40,GREY);
tft.drawRect(270,70,40,40,WHITE);
tft.setCursor(280,77);
tft.setTextColor(BLACK);
tft.setTextSize(4);
tft.print("+");
tft.fillRect(270,130,40,40,GREY);
tft.drawRect(270,130,40,40,WHITE);
tft.setCursor(280,137);
tft.setTextColor(BLACK);
tft.setTextSize(4);
tft.print("-");
}
void ledBtn(){
tft.fillRect(10,50,80,80,RED);
tft.drawRect(10,50,80,80,WHITE);
tft.setCursor(15,85);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("ON/OFF");
tft.fillRect(20,140,60,40,GREY);
tft.drawRect(20,140,60,40,WHITE);
tft.setCursor(20,155);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print(" +");
tft.fillRect(20,190,60,40,GREY);
tft.drawRect(20,190,60,40,WHITE);
tft.setCursor(20,205);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print(" -");
tft.fillRect(110,90,85,85,YELLOW);
tft.drawRect(110,90,85,85,WHITE);
tft.setCursor(115,125);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print(" MODS");
//tft.fillRect(215,90,85,85,GREY);
tft.fillRect(215,90,28,28,RED1);
tft.fillRect(243,90,29,28,ORANGE1);
tft.fillRect(272,90,28,28,YELLOW1);
tft.fillRect(215,118,28,29,GREEN1);
tft.fillRect(243,118,29,29,TURQUOISE1);
tft.fillRect(272,118,28,29,BLUE1);
tft.fillRect(215,147,28,28,PURPLE1);
tft.fillRect(243,147,29,28,PINK1);
tft.fillRect(272,147,28,28,WHITE1);
tft.drawRect(215,90,85,85,WHITE1);
tft.setCursor(220,125);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("COLOUR");
}
void funcBtn(){
tft.fillRect(0,80,80,80,RED);
tft.drawRect(0,80,80,80,WHITE);
tft.setCursor(5,115);
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.print("ON/OFF");
tft.fillRect(0,160,80,80,GREY);
tft.drawRect(0,160,80,80,WHITE);
tft.setCursor(10,195);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("FLASH");
tft.fillRect(80,80,80,80,GREY);
tft.drawRect(80,80,80,80,WHITE);
tft.setCursor(90,115);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("FADE1");
tft.fillRect(80,160,80,80,GREY);
tft.drawRect(80,160,80,80,WHITE);
tft.setCursor(90,195);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("FADE2");
tft.fillRect(160,80,80,80,GREY);
tft.drawRect(160,80,80,80,WHITE);
tft.setCursor(170,115);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("JUMP1");
tft.fillRect(160,160,80,80,GREY);
tft.drawRect(160,160,80,80,WHITE);
tft.setCursor(170,195);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("JUMP2");
tft.fillRect(240,80,80,80,GREY);
tft.drawRect(240,80,80,80,WHITE);
tft.setCursor(250,115);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("QUICK");
tft.fillRect(240,160,80,80,GREY);
tft.drawRect(240,160,80,80,WHITE);
tft.setCursor(255,195);
tft.setTextColor(WHITE);
tft.setTextSize(2);
tft.print("SLOW");
}
void colourBtn(){
tft.fillRect(0,102,46,46,RED);
tft.drawRect(0,102,46,46,WHITE);
tft.setCursor(6,123);
tft.setTextColor(BLACK);
tft.setTextSize(1);
tft.print("ON/OFF");
tft.fillRect(0,148,46,46,RED1);
tft.drawRect(0,148,46,46,WHITE);
tft.fillRect(0,194,46,46,RED2);
tft.drawRect(0,194,46,46,WHITE);
tft.fillRect(46,102,45,46,ORANGE1);
tft.drawRect(46,102,45,46,WHITE);
tft.fillRect(46,148,45,46,ORANGE2);
tft.drawRect(46,148,45,46,WHITE);
tft.fillRect(46,194,45,46,YELLOW1);
tft.drawRect(46,194,45,46,WHITE);
tft.fillRect(91,102,46,46,GREEN1);
tft.drawRect(91,102,46,46,WHITE);
tft.fillRect(91,148,46,46,GREEN2);
tft.drawRect(91,148,46,46,WHITE);
tft.fillRect(91,194,46,46,TURQUOISE1);
tft.drawRect(91,194,46,46,WHITE);
tft.fillRect(137,102,46,46,TURQUOISE2);
tft.drawRect(137,102,46,46,WHITE);
tft.fillRect(137,148,46,46,TURQUOISE3);
tft.drawRect(137,148,46,46,WHITE);
tft.fillRect(137,194,46,46,BLUE1);
tft.drawRect(137,194,46,46,WHITE);
tft.fillRect(183,102,46,46,BLUE2);
tft.drawRect(183,102,46,46,WHITE);
tft.fillRect(183,148,46,46,PURPLE1);
tft.drawRect(183,148,46,46,WHITE);
tft.fillRect(183,194,46,46,PURPLE2);
tft.drawRect(183,194,46,46,WHITE);
tft.fillRect(229,102,45,46,PURPLE3);
tft.drawRect(229,102,45,46,WHITE);
tft.fillRect(229,148,45,46,WHITE1);
tft.drawRect(229,148,45,46,WHITE);
tft.fillRect(229,194,45,46,PINK1);
tft.drawRect(229,194,45,46,WHITE);
tft.fillRect(274,102,46,46,PINK2);
tft.drawRect(274,102,46,46,WHITE);
tft.fillRect(274,148,46,46,LIGHTBLUE1);
tft.drawRect(274,148,46,46,WHITE);
tft.fillRect(274,194,46,46,LIGHTBLUE2);
tft.drawRect(274,194,46,46,WHITE);
}
void coords(TSPoint p){
Serial.print("("); Serial.print(p.x);
Serial.print(", "); Serial.print(p.y);
Serial.println(")");
}
void mainmenu(){
if(res >= 20){
tft.fillScreen(WHITE);
tft.setCursor(40,110);
tft.setTextColor(BLACK);
tft.setTextSize(3);
tft.print("One Moment");
delay(500);
tft.print(".");
delay(500);
tft.print(".");
delay(500);
tft.print(".");
delay(1000);
resetFunc();
}
Serial.println("main");
bool m = true; //in menu
while(m == true){
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if(p.z > MINPRESSURE ){
p.x = map(p.x, TS_MAXX, TS_MINX, tft.width(), 0);
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0);
coords(p);
if(p.y>20 && p.y<100 && p.x>120 && p.x<260){
m = false;
LED();
}
if(p.y>140 && p.y<220 && p.x>120 && p.x<260){
m = false;
SAM();
}
tft.fillScreen(BLACK);
setbtn();
}
}
}
void LED(){
Serial.println("LED");
bool l = true;
tft.fillScreen(BLACK);
backBtn();
ledBtn();
while(l){
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if(p.z > MINPRESSURE ){
p.x = map(p.x, TS_MAXX, TS_MINX, tft.width(), 0);
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0);
coords(p);
if(p.y>20 && p.y<60 && p.x>10 && p.x<70){
Serial.println("Back");
//l = false;
res++;
mainmenu();
}
if(p.y>10 && p.y<70 && p.x>70 && p.x<180){
Serial.println("ON/OFF");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF02FD, 24);
delay(40);
}
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFFFFFF, 24);
delay(40);
}
}
if(p.y>15 && p.y<60 && p.x>195 && p.x<250){
Serial.println("Brightness UP");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF3AC5, 24);
delay(40);
}
}
if(p.y>15 && p.y<60 && p.x>260 && p.x<315){
Serial.println("Brightness DOWN");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFFBA45, 24);
delay(40);
}
}
if(p.y>80 && p.y<145 && p.x>125 && p.x<245){
Serial.println("FUNCTION");
FUNCTION();
}
if(p.y>160 && p.y<225 && p.x>125 && p.x<245){
Serial.println("COLOUR");
COLOUR();
}
}
}
}
void FUNCTION(){
bool F = true;
tft.fillScreen(BLACK);
backBtn();
funcBtn();
while(F){
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if(p.z > MINPRESSURE ){
p.x = map(p.x, TS_MAXX, TS_MINX, tft.width(), 0);
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0);
coords(p);
if(p.y>20 && p.y<60 && p.x>10 && p.x<70){
Serial.println("Back");
//F = false;
res++;
LED();
}
if(p.y>10 && p.y<70 && p.x>70 && p.x<180){
Serial.println("ON/OFF");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF02FD, 24);
delay(40);
}
}
if(p.y>15 && p.y<60 && p.x>195 && p.x<250){
Serial.println("Brightness UP");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF3AC5, 24);
delay(40);
}
}
if(p.y>15 && p.y<60 && p.x>260 && p.x<315){
Serial.println("Brightness DOWN");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFFBA45, 24);
delay(40);
}
}
}
}
}
void COLOUR(){
bool C = true;
tft.fillScreen(BLACK);
backBtn();
colourBtn();
while(C){
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if(p.z > MINPRESSURE ){
p.x = map(p.x, TS_MAXX, TS_MINX, tft.width(), 0);
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0);
coords(p);
if(p.y>20 && p.y<60 && p.x>10 && p.x<70){
Serial.println("Back");
//C = false;
res++;
LED();
}
if(p.y>0 && p.y<35 && p.x>140 && p.x<200){
Serial.println("ON/OFF");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF02FD, 24);
delay(40);
}
}
if(p.y>0 && p.y<35 && p.x>201 && p.x<260){
Serial.println("red-1");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFF3AC5, 24);
delay(40);
}
}
if(p.y>0 && p.y<35 && p.x>261 && p.x<320){
Serial.println("red-2");
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xFFBA45, 24);
delay(40);
}
}
}
}
}
void SAM(){
Serial.println("SAMSUNG");
bool s = true;
tft.fillScreen(BLACK);
backBtn();
samBtn();
while(s){
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
if(p.z > MINPRESSURE ){
p.x = map(p.x, TS_MAXX, TS_MINX, tft.width(), 0);
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0);
coords(p);
if(p.y>20 && p.y<60 && p.x>10 && p.x<70){
Serial.println("Back");
//s = false;
res++;
mainmenu();
}
if(p.y>10 && p.y<70 && p.x>110 && p.x<220){
Serial.println("ON/OFF");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CA807F, 32);
delay(40);
}
}
if(p.y>10 && p.y<70 && p.x>270 && p.x<310){
Serial.println("SOURCE");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CA8877, 32);
delay(40);
}
}
if(p.y>100 && p.y<175 && p.x>10 && p.x<110){
Serial.println("Volume UP");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CACC33, 32);
delay(40);
}
}
if(p.y>110 && p.y<160 && p.x>150 && p.x<190){
Serial.println("MUTE");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CA9C63, 32);
delay(40);
}
}
if(p.y>100 && p.y<175 && p.x>220 && p.x<310){
Serial.println("Volume DOWN");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CADC23, 32);
delay(40);
}
}
if(p.y>205 && p.y<235 && p.x>100 && p.x<150){
Serial.println("Tune UP");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CAC43B, 32);
delay(40);
}
}
if(p.y>205 && p.y<235 && p.x>180 && p.x<230){
Serial.println("Tune DOWN");
for (int i = 0; i < 3; i++) {
irsend.sendSAMSUNG(0xC2CAD42B, 32);
delay(40);
}
}
}
}
}
void setup(void) {
Serial.begin(9600);
Serial.println(F("TFT LCD test"));
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
Serial.println(F("Using Adafruit 2.4\" TFT Arduino Shield Pinout"));
#else
Serial.println(F("Using Adafruit 2.4\" TFT Breakout Board Pinout"));
#endif
tft.setRotation(3);
Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());
tft.reset();
uint16_t identifier = tft.readID();
if(identifier == 0x9325) {
Serial.println(F("Found ILI9325 LCD driver"));
} else if(identifier == 0x9328) {
Serial.println(F("Found ILI9328 LCD driver"));
} else if(identifier == 0x4535) {
Serial.println(F("Found LGDP4535 LCD driver"));
}else if(identifier == 0x7575) {
Serial.println(F("Found HX8347G LCD driver"));
} else if(identifier == 0x9341) {
Serial.println(F("Found ILI9341 LCD driver"));
} else if(identifier == 0x8357) {
Serial.println(F("Found HX8357D LCD driver"));
} else if(identifier==0x0101)
{
identifier=0x9341;
Serial.println(F("Found 0x9341 LCD driver"));
}else {
Serial.print(F("Unknown LCD driver chip: "));
Serial.println(identifier, HEX);
Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
Serial.println(F(" #define USE_ADAFRUIT_SHIELD_PINOUT"));
Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
Serial.println(F("If using the breakout board, it should NOT be #defined!"));
Serial.println(F("Also if using the breakout, double-check that all wiring"));
Serial.println(F("matches the tutorial."));
identifier=0x9341;
}
tft.begin(identifier);
tft.setRotation(3);
tft.fillScreen(BLACK);
setbtn();
}
void loop() {
unsigned long start = micros();
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
mainmenu();
}
| [
"jn.northway@gmail.com"
] | jn.northway@gmail.com |
5edf4faa4cc66d43f7c0485ed93d60312fce7a78 | 23e1116a76b8a914eb40463f91b4a97a1c7f2b29 | /gui/history/moveshistoryfullcomponent.h | a18939fa58da77652961f66a6cb80064bb59db42 | [
"MIT"
] | permissive | loloof64/ChessTrainingVsEngine | 6b69f16865a04095cc423319c8c31e49387d0904 | 6950b5f4adf6e6bc7745884f86f994e185c3ffb4 | refs/heads/master | 2023-02-17T12:08:29.678745 | 2021-01-15T19:49:29 | 2021-01-15T19:49:29 | 280,382,648 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 928 | h | #ifndef MOVESHISTORYFULLCOMPONENT_H
#define MOVESHISTORYFULLCOMPONENT_H
#include <QWidget>
#include <QVBoxLayout>
#include <QScrollArea>
#include "moveshistory.h"
#include "moveshistorybuttons.h"
namespace loloof64 {
class MovesHistoryFullComponent: public QWidget
{
Q_OBJECT
public:
MovesHistoryFullComponent(QWidget *parent = nullptr);
~MovesHistoryFullComponent();
MovesHistory* getMovesHistoryMainComponent() const;
MovesHistoryButtons* getButtonsZone() const;
void newGame(QString startPosition);
void addHistoryItem(HistoryItem item, bool gameFinished = false);
void commitHistoryNodeSelection();
private:
QVBoxLayout *_mainLayout;
QScrollArea * _mainZoneScrollArea;
MovesHistory *_historyZone;
MovesHistoryButtons *_buttonsZone;
};
}
#endif // MOVESHISTORYFULLCOMPONENT_H
| [
"laurent.bernabe@gmail.com"
] | laurent.bernabe@gmail.com |
a0b0d489bc186ce2a0fb3870f7b8c6e462ccdb6e | 413a64b3ea9562a295c24f91950c403346d7ad44 | /Source/kegerator.cpp | d7824c1ff3816125e44db1f234861644f6528d92 | [] | no_license | AntonPuko/Brewskey.Device | 9e0414c517305e6b4b9b80fcc722d1bd453552d1 | dbe112c0345d7ab559ec41b33036563934b0b7e7 | refs/heads/master | 2021-01-12T00:11:22.497831 | 2016-11-02T15:45:08 | 2016-11-02T15:45:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 703 | cpp | #include "application.h"
//#define DEBUG 100
//#define NDEF_DEBUG 1
#include "Display.h"
#include "LED.h"
#include "KegeratorState.h"
#include "NfcClient.h"
#include "Pins.h"
#include "Sensors.h"
#include "ServerLink.h"
#include "TOTP.h"
#include "WiFiSetup.h"
LED* led = new LED();
KegeratorState* state;
Display* display;
NfcClient* nfcClient;
void setup(void) {
RGB.control(true);
RGB.color(255, 255, 255);
display = new Display();
Serial.begin(115200);
Serial.println("Starting");
/*
while(!Serial.available()) {
Spark.process();
}
*/
nfcClient = new NfcClient();
state = new KegeratorState(display, nfcClient);
}
void loop(void) {
state->Tick();
}
| [
"jlkalberer@gmail.com"
] | jlkalberer@gmail.com |
7acc7ecdfb9183875a577ec6e4cb89bb5f116107 | 62f5d6c6049e429c5a1ee57202f6cb95d40946ad | /libtrans/stdafx.cpp | db2440efb5b1ce4ac5ba7901f94053d462a2f4b6 | [] | no_license | Troogle/lossless-to-itunes | db02b1f5357a309520195e43929e4481b1b32d0d | d945dfe7b5a7af30d272c14a36a07b3724918241 | refs/heads/master | 2021-01-25T12:01:38.598674 | 2015-04-14T20:29:38 | 2015-04-14T20:29:38 | 33,958,139 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 260 | cpp | // stdafx.cpp : 只包括标准包含文件的源文件
// libtrans.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
// TODO: 在 STDAFX.H 中
// 引用任何所需的附加头文件,而不是在此文件中引用
| [
"sqh1994@gmail.com"
] | sqh1994@gmail.com |
e41ab6ced50d939700f1346e68e04e7e90dff9ad | 1f8875e7d41c9b9c281c0435ba493036235714fb | /sample_opencv/cv2_10_videoproc.h | 6f609698fe9e69847835d5afba5fdb0838989404 | [] | no_license | viccwq/win_solution | 79d926f73c6f4b966ee7a8d593b0c53964f6e3ce | 479ce69943a8660fc647a3ed94b91fc3197f1b33 | refs/heads/master | 2021-01-11T06:52:00.313066 | 2017-05-27T03:26:25 | 2017-05-27T03:26:25 | 69,217,195 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,750 | h | #ifndef _CV2_10_VIDEOPROC_H
#define _CV2_10_VIDEOPROC_H
#include "comm_def_col.h"
class FrameProcessor
{
public:
virtual void process(Mat &src, Mat &dst) = 0;
protected:
private:
};
class VideoProc
{
public:
VideoProc():m_callIt(true),m_delay(0),m_fnumber(0),process(0),frameProcessor(0)
{}
void setFrameProcessor(void(*frameProcessCallBack)(Mat &, Mat &));
void setFrameProcessor(FrameProcessor *frameProcessorPtr);
void setFrameProcessorEnable(bool en);
bool setInput(string filename);
bool setOutput(const string &filename, int codec = 0);
void setFrameRate(int ms);
void displayInput(string wn);
void displayOutput(string wn);
void displayClear();
void run();
protected:
private:
VideoCapture m_capture;
VideoWriter m_witer;
//回调函数
void(*process)(Mat &, Mat &);
// the FrameProcessor interface
FrameProcessor *frameProcessor;
//回调标志
bool m_callIt;
//窗口
string m_winNameInput;
string m_winNameOutput;
int m_delay;
long m_fnumber;
};
class FeatureTraker:public FrameProcessor
{
public:
FeatureTraker():m_max_count(500),m_qlevel(0.01),m_min_dist(10.){}
void process(Mat &src, Mat &dst);
private:
Mat m_gray;
Mat m_gray_prev;
//跟踪的特征点
vector<Point2f> m_point;
vector<Point2f> m_point_prev;
//跟踪的点初始位置
vector<Point2f> m_initial;
vector<Point2f> m_features;
//最大特征数目
int m_max_count;
//特征检测中的质量等级
double m_qlevel;
//两点之间的最小距离
double m_min_dist;
//检测到的特征状态
vector<uchar> m_status;
//跟踪过程中的错误
vector<float> m_error;
};
#endif | [
"vic_cwq@163.com"
] | vic_cwq@163.com |
c9c39dca678a5be9a0d1cb82ef53b73835dd8b7e | e097f354adfa84fc71d10c2b97a525fd14389fee | /If else anidadas.cpp | 6203003888031e780eef8e9fe62bf2e2eea3fea1 | [] | no_license | JuanTricoli/Curso-C | bc2446e768bafbea67baa71678153f0f4971f375 | c9331c9da97064e977c754f3a27492bf06789379 | refs/heads/master | 2023-05-04T09:51:37.739605 | 2021-05-17T15:07:45 | 2021-05-17T15:07:45 | 368,228,095 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 395 | cpp | #include <stdio.h>
#include <iostream>
int main(){
int x;
printf("Introduce un numero entre 1 y 4: ");
scanf("%i",&x);
if(x == 1){
printf("Lunes\n");
}
else if(x == 2){
printf("Martes.\n");
}
else if(x == 3){
printf("Miercoles\n");
}
else if(x == 4){
printf("Jueves\n");
}
else{
printf("El numero introducido es incorrecto\n");
}
system ("pause");
return 0;
}
| [
"tricolijuan3@gmail.com"
] | tricolijuan3@gmail.com |
fb7d35de8902b7b46d1eb9c6fb44a7e03fb49352 | cf8ddfc720bf6451c4ef4fa01684327431db1919 | /SDK/ARKSurvivalEvolved_Direbear_Chibi_AnimBP_parameters.hpp | fde5dacd22ad4d30d908839f80a17dd48e5b93ce | [
"MIT"
] | permissive | git-Charlie/ARK-SDK | 75337684b11e7b9f668da1f15e8054052a3b600f | c38ca9925309516b2093ad8c3a70ed9489e1d573 | refs/heads/master | 2023-06-20T06:30:33.550123 | 2021-07-11T13:41:45 | 2021-07-11T13:41:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 728 | hpp | #pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_Direbear_Chibi_AnimBP_classes.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function Direbear_Chibi_AnimBP.Direbear_Chibi_AnimBP_C.ExecuteUbergraph_Direbear_Chibi_AnimBP
struct UDirebear_Chibi_AnimBP_C_ExecuteUbergraph_Direbear_Chibi_AnimBP_Params
{
int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"sergey.2bite@gmail.com"
] | sergey.2bite@gmail.com |
1806e8d3a8ee1297721dd80e5245175f6a01a978 | e888b5be2cf84875d8a4365af79cc86359af413d | /blink.ino | f5cf3606982fb3512f3c14c226ec9078ee2d1a7c | [] | no_license | tishtosh/blink | e4c49d010bf9717c3421886aefd541147dacf93a | 8d3ba87158a81e15a061e79982bb92abb384caba | refs/heads/master | 2020-12-25T15:08:43.906635 | 2016-07-02T22:15:59 | 2016-07-02T22:15:59 | 62,469,220 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 164 | ino | // ---
// --
// ---
//
//
void setup() {
pinMode(0, OUTPUT);
}
void loop() {
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(500);
}
| [
"craig@hayman.info"
] | craig@hayman.info |
0a4460a3f84f458d2560d95bc5380ec97b142a3c | d11235048abad36a8f09b5881c225074869aca71 | /include/thrust/detail/allocator/destroy_range.inl | 63fc1ec1f164adb948a99a47a94d2aca4248044b | [] | no_license | peu-oliveira/pibiti | 108057e196e7388a39916bf464d89d886d3e2cba | 7acfa9d173c7d2bd4d4406e030a8510ced8a3add | refs/heads/main | 2023-04-18T00:30:43.890808 | 2021-04-28T13:55:50 | 2021-04-28T13:55:50 | 306,166,539 | 1 | 0 | null | 2021-04-28T13:55:50 | 2020-10-21T22:54:45 | C | UTF-8 | C++ | false | false | 4,577 | inl | /*
* Copyright 2008-2013 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <thrust/detail/allocator/destroy_range.h>
#include <thrust/detail/allocator/allocator_traits.h>
#include <thrust/detail/type_traits/pointer_traits.h>
#include <thrust/for_each.h>
#include <memory>
namespace thrust
{
namespace detail
{
namespace allocator_traits_detail
{
// destroy_range has three cases:
// if Allocator has an effectful member function destroy:
// 1. destroy via the allocator
// else
// 2. if T has a non-trivial destructor, destroy the range without using the allocator
// 3. if T has a trivial destructor, do a no-op
template<typename Allocator, typename T>
struct has_effectful_member_destroy
: has_member_destroy<Allocator,T>
{};
// std::allocator::destroy's only effect is to invoke its argument's destructor
template<typename U, typename T>
struct has_effectful_member_destroy<std::allocator<U>, T>
: thrust::detail::false_type
{};
// case 1: Allocator has an effectful 1-argument member function "destroy"
template<typename Allocator, typename Pointer>
struct enable_if_destroy_range_case1
: thrust::detail::enable_if<
has_effectful_member_destroy<
Allocator,
typename pointer_element<Pointer>::type
>::value
>
{};
// case 2: Allocator has no member function "destroy", but T has a non-trivial destructor
template<typename Allocator, typename Pointer>
struct enable_if_destroy_range_case2
: thrust::detail::enable_if<
!has_effectful_member_destroy<
Allocator,
typename pointer_element<Pointer>::type
>::value &&
!has_trivial_destructor<
typename pointer_element<Pointer>::type
>::value
>
{};
// case 3: Allocator has no member function "destroy", and T has a trivial destructor
template<typename Allocator, typename Pointer>
struct enable_if_destroy_range_case3
: thrust::detail::enable_if<
!has_effectful_member_destroy<
Allocator,
typename pointer_element<Pointer>::type
>::value &&
has_trivial_destructor<
typename pointer_element<Pointer>::type
>::value
>
{};
template<typename Allocator>
struct destroy_via_allocator
{
Allocator &a;
__host__ __device__
destroy_via_allocator(Allocator &a)
: a(a)
{}
template<typename T>
inline __host__ __device__
void operator()(T &x)
{
allocator_traits<Allocator>::destroy(a, &x);
}
};
// destroy_range case 1: destroy via allocator
template<typename Allocator, typename Pointer, typename Size>
__host__ __device__
typename enable_if_destroy_range_case1<Allocator,Pointer>::type
destroy_range(Allocator &a, Pointer p, Size n)
{
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, destroy_via_allocator<Allocator>(a));
}
// we must prepare for His coming
struct gozer
{
__thrust_exec_check_disable__
template<typename T>
inline __host__ __device__
void operator()(T &x)
{
x.~T();
}
};
// destroy_range case 2: destroy without the allocator
template<typename Allocator, typename Pointer, typename Size>
__host__ __device__
typename enable_if_destroy_range_case2<Allocator,Pointer>::type
destroy_range(Allocator &a, Pointer p, Size n)
{
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, gozer());
}
// destroy_range case 3: no-op
template<typename Allocator, typename Pointer, typename Size>
__host__ __device__
typename enable_if_destroy_range_case3<Allocator,Pointer>::type
destroy_range(Allocator &, Pointer, Size)
{
// no op
}
} // end allocator_traits_detail
template<typename Allocator, typename Pointer, typename Size>
__host__ __device__
void destroy_range(Allocator &a, Pointer p, Size n)
{
return allocator_traits_detail::destroy_range(a,p,n);
}
} // end detail
} // end thrust
| [
"pepeuguimaraes@gmail.com"
] | pepeuguimaraes@gmail.com |
256feb7f4cd2b003430d8e790e88e24dd6bb0ed9 | 9cdd509af6b6efae2f2f54275410186e7a74c9d8 | /GraphicsDX11/Project2/source/GameComponent.cpp | b68544d9d4fbd91eb3f5619bc48643dec35a8d4a | [] | no_license | xmmt/dxframework | dcaa3d6a5a23b770afdbe71d0e73926e6fb6241f | a5820c283102540e40a96bb636959b96e6f682e0 | refs/heads/main | 2023-08-15T05:40:08.897538 | 2021-10-05T22:34:55 | 2021-10-05T22:34:55 | 368,342,326 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 146 | cpp | #include <GameComponent.hpp>
using namespace GraphicsFramework;
GameComponent::GameComponent(Renderer& renderer)
: renderer_{ renderer } {
} | [
"mkmax472@gmail.com"
] | mkmax472@gmail.com |
60bc36f838758a822b95633e52b6b1af31810008 | a5b594d91611130df0430272ed9932e9a530dd85 | /Practica 2/ArkanoidError.h | 85ef49a9e4bb3f5fcadfbe47ddfab884c71ba062 | [] | no_license | Dankgard/TPV_Practica1 | 8b24b1236936103a86143315c986c4644d5301d0 | d2621161f46d9117066d565fc3b3b441592f2a57 | refs/heads/master | 2020-04-02T04:08:44.800363 | 2019-08-08T13:31:07 | 2019-08-08T13:31:07 | 154,002,075 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 162 | h | #pragma once
#include <string>
#include <stdexcept>
class ArkanoidError : public std::logic_error {
protected:
public:
using std::logic_error::logic_error;
}; | [
"dangar18@ucm.es"
] | dangar18@ucm.es |
9a45ddf7aa4fdcfc8a27be676aaac695a7fe012d | ee5034b63c9aef64268f2cbbaf9012f195b42463 | /examples/3way_panned/main.cpp | f27f3cfdbe786a7c7e55ae02f8ef9e6e2b567164 | [
"MIT"
] | permissive | oncontroltech/gtkmm4_docs | dc7ffb0dfc9e3b0543ad43bbd87b790f9d23bbbe | dcee3a0f1189443deb1b3ee2c0b11187c0c1fc3f | refs/heads/master | 2023-07-26T04:51:56.842833 | 2021-09-13T12:40:14 | 2021-09-13T12:40:14 | 399,783,698 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 338 | cpp | #include "mainwindow.hpp"
#include <gtkmm/application.h>
int main(int argc, char *argv[])
{
Glib::RefPtr<Gtk::Application> app =
Gtk::Application::create("org.gtkmm.example.3way_panned");
//Shows the window and returns when it is closed.
return app->make_window_and_run<MainWindow>(argc, argv);
} | [
"pedro.vicente@oncontrol-tech.com"
] | pedro.vicente@oncontrol-tech.com |
51dd5d5bfa06396f5b070276e5d6386c5dd248b3 | 0fbda432a8c6a99f8f7ff06bcd1dd5e5e9b28570 | /base/timer/timer.cc | f19dbd7ea3027c249fe259d4d044958e12f593fa | [] | no_license | akwewak/mp4player | ce19340c6f73958295bf8d7ef86ac23b32fae688 | f7dfb8d4a0452be22614a8f4594691072b11bdd1 | refs/heads/main | 2023-08-04T03:13:14.678683 | 2021-09-14T07:21:08 | 2021-09-14T07:21:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,225 | cc | #include <memory>
#include "base/timer/timer.h"
#include "base/message_loop/message_loop.h"
#include <event2/event.h>
namespace base {
Timer::Timer(bool is_repeating)
: is_repeating_(is_repeating),
event_(nullptr) {
}
Timer::~Timer() {
Stop();
if (event_) {
event_free(event_);
event_ = nullptr;
}
}
void Timer::Start(std::unique_ptr<QueuedTask> task,
const TimeDelta &delay) {
Stop();
struct event_base *ev = MessageLoop::current()->base();
if (!ev) return;
int event_mask = is_repeating_ ? EV_PERSIST : 0;
if (!event_) {
event_ = event_new(ev, -1, EV_TIMEOUT | event_mask, &Timer::RunTimer, this);
} else {
event_assign(event_, ev, -1, EV_TIMEOUT | event_mask, &Timer::RunTimer, this);
}
timeval tv = {static_cast<__time_t>(delay.InSeconds()),
static_cast<__suseconds_t>(delay.InMicroseconds() % Time::kMicrosecondsPerSecond)};
event_add(event_, &tv);
task_ = std::move(task);
}
void Timer::Stop() {
if (event_) {
event_del(event_);
}
task_.reset();
}
void Timer::RunTimer(evutil_socket_t listener, short event, void *arg) {
auto timer = reinterpret_cast<Timer *>(arg);
timer->task_->Run();
}
} // namespace base
| [
"55817663+housekeeper-software@users.noreply.github.com"
] | 55817663+housekeeper-software@users.noreply.github.com |
fa10980ca4862cbf8d76d226e2eed100eb49779d | 06051ef9e6300453c0252a5003137c27d8826731 | /FlockApp/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.h | 086db7d191f0e3d56481685121c871e17800071a | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"MIT"
] | permissive | SLRAM/FlockApp | 1094b27f05396d37a3ab40e98f9693090d241c51 | fa2ad512e05693889ebc1d13228d0553d8139602 | refs/heads/master | 2021-06-26T12:52:19.368404 | 2020-11-24T21:33:12 | 2020-11-24T21:33:12 | 179,102,553 | 2 | 1 | MIT | 2020-02-06T18:08:21 | 2019-04-02T15:03:49 | Swift | UTF-8 | C++ | false | false | 9,143 | h | /*
* Copyright 2018 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_
#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_
#include <cstdint>
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h"
#include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h"
#include "Firestore/core/src/firebase/firestore/core/query.h"
#include "Firestore/core/src/firebase/firestore/model/database_id.h"
#include "Firestore/core/src/firebase/firestore/model/document.h"
#include "Firestore/core/src/firebase/firestore/model/document_key.h"
#include "Firestore/core/src/firebase/firestore/model/field_mask.h"
#include "Firestore/core/src/firebase/firestore/model/field_value.h"
#include "Firestore/core/src/firebase/firestore/model/maybe_document.h"
#include "Firestore/core/src/firebase/firestore/model/mutation.h"
#include "Firestore/core/src/firebase/firestore/model/no_document.h"
#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h"
#include "Firestore/core/src/firebase/firestore/nanopb/reader.h"
#include "Firestore/core/src/firebase/firestore/nanopb/writer.h"
#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
#include "Firestore/core/src/firebase/firestore/util/status.h"
#include "absl/base/attributes.h"
#include "absl/strings/string_view.h"
namespace firebase {
namespace firestore {
namespace local {
class LocalSerializer;
}
namespace remote {
template <typename T>
T* MakeArray(size_t count) {
return reinterpret_cast<T*>(calloc(count, sizeof(T)));
}
/**
* @brief Converts internal model objects to their equivalent protocol buffer
* form, and protocol buffer objects to their equivalent bytes.
*
* Methods starting with "Encode" convert from a model object to a nanopb
* protocol buffer, and methods starting with "Decode" convert from a nanopb
* protocol buffer to a model object
*
* For encoded messages, FreeNanopbMessage() must be called on the returned
* nanopb proto buffer or a memory leak will occur.
*
* All errors that occur during serialization are fatal.
*
* All deserialization methods (that can fail) take a nanopb::Reader parameter
* whose status will be set to failed upon an error. Callers must check this
* before using the returned value via `reader->status()`. A deserialization
* method might fail if a protocol buffer is missing a critical field or has a
* value we can't interpret. On error, the return value from a deserialization
* method is unspecified.
*/
class Serializer {
public:
/**
* @param database_id Must remain valid for the lifetime of this Serializer
* object.
*/
explicit Serializer(
const firebase::firestore::model::DatabaseId& database_id);
/**
* Encodes the string to nanopb bytes.
*
* This method allocates memory; the caller is responsible for freeing it.
* Typically, the returned value will be added to a pointer field within a
* nanopb proto struct. Calling pb_release() on the resulting struct will
* cause all proto fields to be freed.
*/
static pb_bytes_array_t* EncodeString(const std::string& str);
/**
* Decodes the nanopb bytes to a std::string. If the input pointer is null,
* then this method will return an empty string.
*/
static std::string DecodeString(const pb_bytes_array_t* str);
/**
* Encodes the std::vector to nanopb bytes. If the input vector is empty, then
* the resulting return bytes will have length 0 (but will otherwise be valid,
* i.e. not null.)
*
* This method allocates memory; the caller is responsible for freeing it.
* Typically, the returned value will be added to a pointer field within a
* nanopb proto struct. Calling pb_release() on the resulting struct will
* cause all proto fields to be freed.
*/
static pb_bytes_array_t* EncodeBytes(const std::vector<uint8_t>& bytes);
/**
* Decodes the nanopb bytes to a std::vector. If the input pointer is null,
* then this method will return an empty vector.
*/
static std::vector<uint8_t> DecodeBytes(const pb_bytes_array_t* bytes);
/**
* Release memory allocated by the Encode* methods that return protos.
*
* This essentially wraps calls to nanopb's pb_release() method.
*/
static void FreeNanopbMessage(const pb_field_t fields[], void* dest_struct);
/**
* @brief Converts the FieldValue model passed into bytes.
*/
static google_firestore_v1_Value EncodeFieldValue(
const model::FieldValue& field_value);
/**
* @brief Converts from nanopb proto to the model FieldValue format.
*/
// TODO(rsgowman): Once the proto is read, the only thing the reader object is
// used for is error handling. This seems questionable. We probably need to
// rework error handling. Again. But we'll defer that for now and continue
// just passing the reader object.
static model::FieldValue DecodeFieldValue(
nanopb::Reader* reader, const google_firestore_v1_Value& proto);
/**
* Encodes the given document key as a fully qualified name. This includes the
* databaseId associated with this Serializer and the key path.
*/
std::string EncodeKey(
const firebase::firestore::model::DocumentKey& key) const;
/**
* Decodes the given document key from a fully qualified name.
*/
firebase::firestore::model::DocumentKey DecodeKey(
nanopb::Reader* reader, absl::string_view name) const;
/**
* @brief Converts the Document (i.e. key/value) into bytes.
*/
google_firestore_v1_Document EncodeDocument(
const model::DocumentKey& key, const model::ObjectValue& value) const;
/**
* @brief Converts from nanopb proto to the model Document format.
*/
std::unique_ptr<model::MaybeDocument> DecodeMaybeDocument(
nanopb::Reader* reader,
const google_firestore_v1_BatchGetDocumentsResponse& response) const;
google_firestore_v1_Write EncodeMutation(
const model::Mutation& mutation) const;
std::unique_ptr<model::Mutation> DecodeMutation(
nanopb::Reader* reader, const google_firestore_v1_Write& mutation) const;
static google_firestore_v1_Precondition EncodePrecondition(
const model::Precondition& precondition);
static model::Precondition DecodePrecondition(
nanopb::Reader* reader,
const google_firestore_v1_Precondition& precondition);
static google_firestore_v1_DocumentMask EncodeDocumentMask(
const model::FieldMask& mask);
static model::FieldMask DecodeDocumentMask(
const google_firestore_v1_DocumentMask& mask);
/**
* @brief Converts the Query into bytes, representing a
* firestore::v1::Target::QueryTarget.
*/
google_firestore_v1_Target_QueryTarget EncodeQueryTarget(
const core::Query& query) const;
std::unique_ptr<model::Document> DecodeDocument(
nanopb::Reader* reader, const google_firestore_v1_Document& proto) const;
static void EncodeObjectMap(const model::ObjectValue::Map& object_value_map,
uint32_t map_tag,
uint32_t key_tag,
uint32_t value_tag);
static google_protobuf_Timestamp EncodeVersion(
const model::SnapshotVersion& version);
static google_protobuf_Timestamp EncodeTimestamp(
const Timestamp& timestamp_value);
static model::SnapshotVersion DecodeSnapshotVersion(
nanopb::Reader* reader, const google_protobuf_Timestamp& proto);
static Timestamp DecodeTimestamp(
nanopb::Reader* reader, const google_protobuf_Timestamp& timestamp_proto);
static core::Query DecodeQueryTarget(
nanopb::Reader* reader,
const google_firestore_v1_Target_QueryTarget& proto);
private:
std::unique_ptr<model::Document> DecodeFoundDocument(
nanopb::Reader* reader,
const google_firestore_v1_BatchGetDocumentsResponse& response) const;
std::unique_ptr<model::NoDocument> DecodeMissingDocument(
nanopb::Reader* reader,
const google_firestore_v1_BatchGetDocumentsResponse& response) const;
static void EncodeFieldsEntry(const model::ObjectValue::Map::value_type& kv,
uint32_t key_tag,
uint32_t value_tag);
std::string EncodeQueryPath(const model::ResourcePath& path) const;
const model::DatabaseId& database_id_;
const std::string database_name_;
};
} // namespace remote
} // namespace firestore
} // namespace firebase
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_
| [
"stephier2290@gmail.com"
] | stephier2290@gmail.com |
68a40b473cbf0db931ac8158716b3d91896cf2fc | cc6ce271d2a761aea8c0751915bd26ff35ec8904 | /arr_manip.cpp | 8d879b4b063c8b777d3ad420a4c1a94e24ced1e1 | [] | no_license | roopkathasamanta/Hackerrank-Solutions | d972e1b848c4f515cf0ff08d9ba22cb9a2089408 | 5c8b87179454222e9de854b63ea85e572175c9e6 | refs/heads/master | 2020-04-17T00:47:46.573671 | 2019-02-08T19:59:30 | 2019-02-08T19:59:30 | 166,062,686 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 507 | cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
long int n,m,a,b,k,max = 0, x = 0;
cin >> n >> m;
long int *arr = new long int[n+1]();
for(long int i=0; i<m; i++)
{
cin >> a >> b >> k;
arr[a] += k;
if((b+1)<=n)
arr[b+1] -= k;
}
for(long int i=1; i<=n; i++)
{
x = x + arr[i];
if(max<x)
max=x;
}
cout<<max;
return 0;
}
| [
"noreply@github.com"
] | roopkathasamanta.noreply@github.com |
8d5800ab92bd0fe9ad8069a6bae27218c7219e12 | a4c1fd414fb25a15118724192ff5520dbee49e99 | /Implementation/1-input_output/4 - Lendo PC do sensor (OpenNI Grabber)/src/main.cpp | 59f41cfa7c1db5fd01d8439f242885bd91f8d84b | [] | no_license | shike1239/KinectFramework | cfe8fc1c4cd44b984d31774ad001ccee7d21933f | bed739f40f6677c697ecbdbd63288055d63bf5d9 | refs/heads/master | 2021-09-13T15:04:45.385563 | 2018-05-01T14:07:22 | 2018-05-01T14:07:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,084 | cpp | ///Standard includes
#include <iostream>
#include <string>
#include <pcl/io/pcd_io.h>
///Custom includes
#include "IO.h"
#include "Processing.h"
#include "Viewer.h"
using namespace std;
using namespace pcl;
typedef pcl::PointXYZRGBA PointT;
int main(){
PointCloud<PointT>::Ptr cloudA(new PointT);
IO<PXYZRGBA> io;
string path;
cout<<"Informe o caminho para o arquivo PCD 1:" << endl;
cin>>path;
io.readFromPCD(path,cloudA);
io.grabSingleFrameSensor();
PointCloud<PointT>::Ptr cloudB = io.getCloud_ptr();
pcl::PointCloud<PointT>::Ptr cloud1 (new pcl::PointCloud<PointT>);
pcl::PointCloud<PointT>::Ptr cloud2 (new pcl::PointCloud<PointT>);
PointCloud<PointT>::Ptr cloudC(new PointCloud<PointT>);
*cloudC = *cloudA + *cloudB;
//Processing<PXYZRGBA>::simpleConcatenate(cloudA,cloudB,cloudC);
string newPath = "FinalCloud.pcd";
io.writeToPCD(newPath,cloudC);
Viewer<PXYZRGBA> viewer;
viewer.addCloud(cloudC);
viewer.showExternalCloud(cloudC);
while(true){
viewer.Spin();
}
return 0;
}
| [
"josuerocha@me.com"
] | josuerocha@me.com |
9e9f96b209d46cbb7db5f33bfa871a7ba52111ef | a9e308c81c27a80c53c899ce806d6d7b4a9bbbf3 | /engine/xray/animation/sources/animation_player.cpp | 0df43c01435cf980c9dd3dcec31defcc5c124ea4 | [] | no_license | NikitaNikson/xray-2_0 | 00d8e78112d7b3d5ec1cb790c90f614dc732f633 | 82b049d2d177aac15e1317cbe281e8c167b8f8d1 | refs/heads/master | 2023-06-25T16:51:26.243019 | 2020-09-29T15:49:23 | 2020-09-29T15:49:23 | 390,966,305 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 302 | cpp | ////////////////////////////////////////////////////////////////////////////
// Created : 16.02.2010
// Author : Konstantin Slipchenko
// Copyright (C) GSC Game World - 2010
////////////////////////////////////////////////////////////////////////////
#include "pch.h"
#include "animation_player.h"
| [
"loxotron@bk.ru"
] | loxotron@bk.ru |
572828138e13b77e361240101c4f60a0b1feea95 | 57e69bfa22cde406cb5de0dfcce7f2f8ce0bdc03 | /range_sum_query.cpp | 140b49fe971279090260b16c35d95503a205ade9 | [] | no_license | apoorva-dave/practice-questions | 8cdbc5c30f009e9e686cf74b4a138a3499c0129b | 85ec30bbae4b7133c28c86a251a2f06bee4a4e0c | refs/heads/master | 2021-12-01T04:29:27.599835 | 2021-11-22T10:42:24 | 2021-11-22T10:42:24 | 235,604,747 | 9 | 4 | null | 2020-09-30T18:47:56 | 2020-01-22T15:38:45 | C++ | UTF-8 | C++ | false | false | 549 | cpp | class NumArray {
private:
vector <int> data;
public:
NumArray(vector<int>& nums) {
data = nums;
for(int i=1;i<data.size();i++)
{
data[i] = data[i-1] + data[i];
}
}
int sumRange(int i, int j) {
if(i>0)
return (data[j]-data[i-1]);
else
return (data[j]);
}
};
/**
* Your NumArray object will be instantiated and called as such:
* NumArray* obj = new NumArray(nums);
* int param_1 = obj->sumRange(i,j);
*/ | [
"apoorvadave1995@gmail.com"
] | apoorvadave1995@gmail.com |
c1786098dc604d3d7795653b0a00fd398c70ebbe | 6babce8baf0b7c137185d134dcb350a3f0193e02 | /Classes/Vehicle.h | 5f9317b386bfac8669b279f36342e6c9fd97f82b | [
"Apache-2.0"
] | permissive | liemvu/TrafficDodge | 78eafed42a5882be561e0fdc372621f4742a35d6 | d3412ea31d05e6eae8061d6c588f1d7a46234c10 | refs/heads/master | 2020-05-18T18:04:57.628780 | 2014-04-26T16:21:42 | 2014-04-26T16:21:42 | 19,181,861 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,030 | h | //
// Vehicle.h
// VNTraffic
//
// Created by William Vo on 4/25/14.
//
//
#ifndef __VNTraffic__Vehicle__
#define __VNTraffic__Vehicle__
#include "GameSprite.h"
enum {
kVehicleType1,
kVehicleType2,
kVehicleType3,
kVehicleType4,
kVehicleType5,
};
class Vehicle : public GameSprite {
public:
Vehicle();
~Vehicle();
CC_SYNTHESIZE(int, _type, Type);
CC_SYNTHESIZE(int, _line, Line);
CC_SYNTHESIZE(float, _speed, Speed);
CC_SYNTHESIZE(float, _mark, Mark);
static Vehicle * create();
void reset();
virtual void update(float dt);
inline float bottom() {
return _position.y - _height;
}
inline float top() {
return _position.y;
}
virtual void draw(Renderer *renderer, const kmMat4& transform, bool transformUpdated);
protected:
void onDraw(const kmMat4 &transform, bool transformUpdated);
CustomCommand _customCommand;
private:
void initVehicle();
};
#endif /* defined(__VNTraffic__Vehicle__) */
| [
"liemvouy@gmail.com"
] | liemvouy@gmail.com |
016028ad10d6924d146699b1b32e0dba260bc27c | d70ea70f36eee8a37aa0c5608db118ac13b6c116 | /src/Math/Vector/Vector3.h | 7c7c9040d27d723275b13eec1471c1b69a7a79be | [] | no_license | the-iron-ryan/OpenGL-Playground | 2344cf4a2e183fca240d8b92d714d4088eac8413 | fba4b15a68f45096432020fe7935cc46ea1e362d | refs/heads/master | 2023-04-14T20:34:18.049038 | 2021-05-04T23:22:15 | 2021-05-04T23:22:15 | 261,974,794 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,181 | h | #ifndef ENGINE_VECTOR_3
#define ENGINE_VECTOR_3
#include <iostream>
namespace Math
{
struct Vector3
{
float x;
float y;
float z;
explicit Vector3(float xVal = 0.0f, float yVal = 0.0f, float zVal = 0.0f) : x(xVal), y(yVal), z(zVal) {}
inline Vector3& operator+=(const Vector3 &vec1);
inline Vector3& operator-=(const Vector3 &vec1);
inline Vector3& operator*=(float scalar);
inline Vector3& operator/=(float scalar);
inline Vector3& operator&=(const Vector3 &vec);
inline Vector3 Cross(const Vector3 &vec);
inline Vector3& CrossEquals(const Vector3 &vec);
inline float & operator[](int index);
inline float operator[](int index) const;
};
inline Vector3 operator+(const Vector3 &vec1, const Vector3 &vec2);
inline Vector3 operator-(const Vector3 &vec1, const Vector3 &vec2);
inline Vector3 operator*(float scalar, const Vector3 &vec2);
inline Vector3 operator*(const Vector3 &vec2, float scalar);
inline Vector3 operator&(const Vector3 &vec1, const Vector3 &vec2);
inline float operator*(const Vector3 &vec1, const Vector3 &vec2);
inline std::ostream& operator<<(std::ostream& os, const Vector3& vector);
#include "Vector3.inl"
}
#endif
| [
"ryandougherty25@gmail.com"
] | ryandougherty25@gmail.com |
d3c1fd592a394b7152ead4a058b464c303ef5744 | 878ca47b232081d27390e7bd9d02826b41bc070c | /Lab_2_5/Lab_1_5/Source.cpp | 0a2eaf1a18d06a2adb9f721f5cac0d218ad07139 | [] | no_license | laurashcherbak/cpp_oop | 6efd8b68156a79f4e27ba1d70b51946bfec2c887 | a693421f1cfb83fb2db93d4c1fb88ac38cd6f34d | refs/heads/master | 2023-04-25T03:16:19.012303 | 2021-05-19T07:38:43 | 2021-05-19T07:38:43 | 343,200,561 | 0 | 0 | null | 2021-04-19T17:56:04 | 2021-02-28T19:54:18 | C++ | UTF-8 | C++ | false | false | 2,572 | cpp | //////////////////////////////////////////////////////////////////////////////
// Source.cpp
#include <iostream>
#include "Student.h"
using namespace std;
int main()
{
cout << " : Lab 2.5 - Output : ";
cout << " : constructors : " << endl;
cout << "Student *a0 = new Student(); : " << endl;
Student* a0 = new Student();
cout << (*a0) << endl;
cout << "(*a0).Display(); : " << endl;
(*a0).Display();
cout << endl;
cout << "Student a1; : " << endl;
Student a1;
//a1.Display();
cout << a1 << endl;
cout << "Student a2(1); : " << endl;
Student a2(1);
cout << a2 << endl;
cout << "Student c0(2, \"Sidorova\"); : " << endl;
Student c0(2, "Sidorova");
cout << c0 << endl;
cout << "Student c(1, \"Sidorova\", 22, 'F', 60.5); : " << endl;
Student c(1, "Sidorova", 22, 'F', 60.5);
cout << c << endl;
cout << "Student d(c); : " << endl;
Student d(c);
cout << d << endl;
cout << endl;
cout << " : operator increment/decrement : " << endl;
cout << "++c : " << endl << ++c << endl;
cout << " c : " << endl << c << endl;
cout << " c++ : " << endl << c++ << endl;
cout << " c : " << endl << c << endl;
cout << "--c : " << endl << --c << endl;
cout << " c : " << endl << c << endl;
cout << " c-- : " << endl << c-- << endl;
cout << " c : " << endl << c << endl;
cout << endl;
cout << " : operator Type() : " << endl;
cout << "string(c) : " << endl << string(c) << endl;
cout << endl;
cout << " : operator input/output : " << endl;
Student g1, g2, g3;
cin >> g1 >> g2 >> g3;
cout << g1 << endl << g2 << endl << g3 << endl;
cout << " : operator = : " << endl;
g3 = g2 = c;
cout << " g3 : " << endl << c << endl;
cout << " g2 : " << endl << c << endl;
cout << " c : " << endl << c << endl;
cout << endl;
cout << " : Size = " << sizeof(c) << endl;
system("pause");
cout << " : Lab 1.5 - Output : ";
Student s;
s.Read();
s.Display();
Man m = s.GetMan();
string name;
int age;
double weight;
cout << "Enter New Student Name = ? ";
cin >> name;
m.SetName(name);
cout << "Enter New Student Age = ? ";
cin >> age;
m.SetAge(age);
cout << "Enter New Student Weight = ? ";
cin >> weight;
m.SetWeight(weight);
s.SetMan(m);
cout << "Student information changed : " << endl << s.toString() << endl;
int course;
cout << "Enter New Course = ? ";
cin >> course;
s.SetCourse(course);
cout << "Student information changed : " << endl << s.toString() << endl;
cout << "Increment Course...";
s.IncCourse();
cout << endl << "Course changed to : " << endl << s.GetCourse() << endl;
system("pause");
return 0;
}
| [
"laura.shcherbak@gmail.com"
] | laura.shcherbak@gmail.com |
06bf68af1e1cbd7ba2524c73980b8b9f762c3ded | c6ba59cc5ef68f70db430a3b43fececce12a2675 | /PAT/1005.SpellItRight/Solution.cpp | 8704c6648d403637831bb58c7af2ffaf5ef6f178 | [] | no_license | 0Kelvins/LeetCode | ef59f6111e8eb9b8286bf81bd02ffaf0e0351cb5 | 8aafd1ed8a0d57aad45f2fafc178fb001a7096ca | refs/heads/master | 2022-10-23T18:33:07.018470 | 2022-08-04T05:42:26 | 2022-08-04T05:42:26 | 110,679,725 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 652 | cpp | /**
* 1005 Spell It Right
*/
#include <iostream>
#include <vector>
using namespace std;
int main()
{
string n;
cin >> n;
int nlen = n.size(), sum = 0;
for (int i = 0; i < nlen; i++)
sum += n[i] - '0';
string numbers[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
vector<int> nums;
while (sum)
{
nums.push_back(sum % 10);
sum /= 10;
}
int numsSize = nums.size();
for (int i = numsSize - 1; i > 0; i--)
cout << numbers[nums[i]] << " ";
if (numsSize)
cout << numbers[nums[0]];
else
cout << "zero";
return 0;
} | [
"554961401@qq.com"
] | 554961401@qq.com |
078df03aa8bbe03cac12fbc8848f04437d4a5fb1 | c475cd8531a94ffae69cc92371d41531dbbddb6c | /Projects/bullet3-2.89/Extras/ConvexDecomposition/cd_wavefront.cpp | b3308096487e0a00097ffc58cf260032d1a67dcb | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown",
"Zlib"
] | permissive | WolfireGames/overgrowth | 72d3dd29cbd7254337265c29f8de3e5c32400114 | 594a2a4f9da0855304ee8cd5335d042f8e954ce1 | refs/heads/main | 2023-08-15T19:36:56.156578 | 2023-05-17T08:17:53 | 2023-05-17T08:20:36 | 467,448,492 | 2,264 | 245 | Apache-2.0 | 2023-05-09T07:29:58 | 2022-03-08T09:38:54 | C++ | UTF-8 | C++ | false | false | 19,238 | cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
/*----------------------------------------------------------------------
Copyright (c) 2004 Open Dynamics Framework Group
www.physicstools.org
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 Open Dynamics Framework Group 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 INTEL 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.
-----------------------------------------------------------------------*/
// http://codesuppository.blogspot.com
//
// mailto: jratcliff@infiniplex.net
//
// http://www.amillionpixels.us
//
#include "float_math.h"
#include "cd_wavefront.h"
using namespace ConvexDecomposition;
/*----------------------------------------------------------------------
Copyright (c) 2004 Open Dynamics Framework Group
www.physicstools.org
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 Open Dynamics Framework Group 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 INTEL 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 <vector>
namespace ConvexDecomposition
{
typedef std::vector<int> IntVector;
typedef std::vector<float> FloatVector;
#if defined(__APPLE__) || defined(__CELLOS_LV2__)
#define stricmp(a, b) strcasecmp((a), (b))
#endif
/*******************************************************************/
/******************** InParser.h ********************************/
/*******************************************************************/
class InPlaceParserInterface
{
public:
virtual ~InPlaceParserInterface(){};
virtual int ParseLine(int lineno, int argc, const char **argv) = 0; // return TRUE to continue parsing, return FALSE to abort parsing process
};
enum SeparatorType
{
ST_DATA, // is data
ST_HARD, // is a hard separator
ST_SOFT, // is a soft separator
ST_EOS // is a comment symbol, and everything past this character should be ignored
};
class InPlaceParser
{
public:
InPlaceParser(void)
{
Init();
}
InPlaceParser(char *data, int len)
{
Init();
SetSourceData(data, len);
}
InPlaceParser(const char *fname)
{
Init();
SetFile(fname);
}
~InPlaceParser(void);
void Init(void)
{
mQuoteChar = 34;
mData = 0;
mLen = 0;
mMyAlloc = false;
for (int i = 0; i < 256; i++)
{
mHard[i] = ST_DATA;
mHardString[i * 2] = i;
mHardString[i * 2 + 1] = 0;
}
mHard[0] = ST_EOS;
mHard[32] = ST_SOFT;
mHard[9] = ST_SOFT;
mHard[13] = ST_SOFT;
mHard[10] = ST_SOFT;
}
void SetFile(const char *fname); // use this file as source data to parse.
void SetSourceData(char *data, int len)
{
mData = data;
mLen = len;
mMyAlloc = false;
};
int Parse(InPlaceParserInterface *callback); // returns true if entire file was parsed, false if it aborted for some reason
int ProcessLine(int lineno, char *line, InPlaceParserInterface *callback);
const char **GetArglist(char *source, int &count); // convert source string into an arg list, this is a destructive parse.
void SetHardSeparator(char c) // add a hard separator
{
mHard[(int)c] = ST_HARD;
}
void SetHard(char c) // add a hard separator
{
mHard[(int)c] = ST_HARD;
}
void SetCommentSymbol(char c) // comment character, treated as 'end of string'
{
mHard[(int)c] = ST_EOS;
}
void ClearHardSeparator(char c)
{
mHard[(int)c] = ST_DATA;
}
void DefaultSymbols(void); // set up default symbols for hard separator and comment symbol of the '#' character.
bool EOS(char c)
{
if (mHard[(int)c] == ST_EOS)
{
return true;
}
return false;
}
void SetQuoteChar(char c)
{
mQuoteChar = c;
}
private:
inline char *AddHard(int &argc, const char **argv, char *foo);
inline bool IsHard(char c);
inline char *SkipSpaces(char *foo);
inline bool IsWhiteSpace(char c);
inline bool IsNonSeparator(char c); // non separator, neither hard nor soft
bool mMyAlloc; // whether or not *I* allocated the buffer and am responsible for deleting it.
char *mData; // ascii data to parse.
int mLen; // length of data
SeparatorType mHard[256];
char mHardString[256 * 2];
char mQuoteChar;
};
/*******************************************************************/
/******************** InParser.cpp ********************************/
/*******************************************************************/
void InPlaceParser::SetFile(const char *fname)
{
if (mMyAlloc)
{
free(mData);
}
mData = 0;
mLen = 0;
mMyAlloc = false;
FILE *fph = fopen(fname, "rb");
if (fph)
{
fseek(fph, 0L, SEEK_END);
mLen = ftell(fph);
fseek(fph, 0L, SEEK_SET);
if (mLen)
{
mData = (char *)malloc(sizeof(char) * (mLen + 1));
int ok = fread(mData, mLen, 1, fph);
if (!ok)
{
free(mData);
mData = 0;
}
else
{
mData[mLen] = 0; // zero byte terminate end of file marker.
mMyAlloc = true;
}
}
fclose(fph);
}
}
InPlaceParser::~InPlaceParser(void)
{
if (mMyAlloc)
{
free(mData);
}
}
#define MAXARGS 512
bool InPlaceParser::IsHard(char c)
{
return mHard[(int)c] == ST_HARD;
}
char *InPlaceParser::AddHard(int &argc, const char **argv, char *foo)
{
while (IsHard(*foo))
{
const char *hard = &mHardString[*foo * 2];
if (argc < MAXARGS)
{
argv[argc++] = hard;
}
foo++;
}
return foo;
}
bool InPlaceParser::IsWhiteSpace(char c)
{
return mHard[(int)c] == ST_SOFT;
}
char *InPlaceParser::SkipSpaces(char *foo)
{
while (!EOS(*foo) && IsWhiteSpace(*foo)) foo++;
return foo;
}
bool InPlaceParser::IsNonSeparator(char c)
{
if (!IsHard(c) && !IsWhiteSpace(c) && c != 0) return true;
return false;
}
int InPlaceParser::ProcessLine(int lineno, char *line, InPlaceParserInterface *callback)
{
int ret = 0;
const char *argv[MAXARGS];
int argc = 0;
char *foo = line;
while (!EOS(*foo) && argc < MAXARGS)
{
foo = SkipSpaces(foo); // skip any leading spaces
if (EOS(*foo)) break;
if (*foo == mQuoteChar) // if it is an open quote
{
foo++;
if (argc < MAXARGS)
{
argv[argc++] = foo;
}
while (!EOS(*foo) && *foo != mQuoteChar) foo++;
if (!EOS(*foo))
{
*foo = 0; // replace close quote with zero byte EOS
foo++;
}
}
else
{
foo = AddHard(argc, argv, foo); // add any hard separators, skip any spaces
if (IsNonSeparator(*foo)) // add non-hard argument.
{
bool quote = false;
if (*foo == mQuoteChar)
{
foo++;
quote = true;
}
if (argc < MAXARGS)
{
argv[argc++] = foo;
}
if (quote)
{
while (*foo && *foo != mQuoteChar) foo++;
if (*foo) *foo = 32;
}
// continue..until we hit an eos ..
while (!EOS(*foo)) // until we hit EOS
{
if (IsWhiteSpace(*foo)) // if we hit a space, stomp a zero byte, and exit
{
*foo = 0;
foo++;
break;
}
else if (IsHard(*foo)) // if we hit a hard separator, stomp a zero byte and store the hard separator argument
{
const char *hard = &mHardString[*foo * 2];
*foo = 0;
if (argc < MAXARGS)
{
argv[argc++] = hard;
}
foo++;
break;
}
foo++;
} // end of while loop...
}
}
}
if (argc)
{
ret = callback->ParseLine(lineno, argc, argv);
}
return ret;
}
int InPlaceParser::Parse(InPlaceParserInterface *callback) // returns true if entire file was parsed, false if it aborted for some reason
{
assert(callback);
if (!mData) return 0;
int ret = 0;
int lineno = 0;
char *foo = mData;
char *begin = foo;
while (*foo)
{
if (*foo == 10 || *foo == 13)
{
lineno++;
*foo = 0;
if (*begin) // if there is any data to parse at all...
{
int v = ProcessLine(lineno, begin, callback);
if (v) ret = v;
}
foo++;
if (*foo == 10) foo++; // skip line feed, if it is in the carraige-return line-feed format...
begin = foo;
}
else
{
foo++;
}
}
lineno++; // lasst line.
int v = ProcessLine(lineno, begin, callback);
if (v) ret = v;
return ret;
}
void InPlaceParser::DefaultSymbols(void)
{
SetHardSeparator(',');
SetHardSeparator('(');
SetHardSeparator(')');
SetHardSeparator('=');
SetHardSeparator('[');
SetHardSeparator(']');
SetHardSeparator('{');
SetHardSeparator('}');
SetCommentSymbol('#');
}
const char **InPlaceParser::GetArglist(char *line, int &count) // convert source string into an arg list, this is a destructive parse.
{
const char **ret = 0;
const char *argv[MAXARGS];
int argc = 0;
char *foo = line;
while (!EOS(*foo) && argc < MAXARGS)
{
foo = SkipSpaces(foo); // skip any leading spaces
if (EOS(*foo)) break;
if (*foo == mQuoteChar) // if it is an open quote
{
foo++;
if (argc < MAXARGS)
{
argv[argc++] = foo;
}
while (!EOS(*foo) && *foo != mQuoteChar) foo++;
if (!EOS(*foo))
{
*foo = 0; // replace close quote with zero byte EOS
foo++;
}
}
else
{
foo = AddHard(argc, argv, foo); // add any hard separators, skip any spaces
if (IsNonSeparator(*foo)) // add non-hard argument.
{
bool quote = false;
if (*foo == mQuoteChar)
{
foo++;
quote = true;
}
if (argc < MAXARGS)
{
argv[argc++] = foo;
}
if (quote)
{
while (*foo && *foo != mQuoteChar) foo++;
if (*foo) *foo = 32;
}
// continue..until we hit an eos ..
while (!EOS(*foo)) // until we hit EOS
{
if (IsWhiteSpace(*foo)) // if we hit a space, stomp a zero byte, and exit
{
*foo = 0;
foo++;
break;
}
else if (IsHard(*foo)) // if we hit a hard separator, stomp a zero byte and store the hard separator argument
{
const char *hard = &mHardString[*foo * 2];
*foo = 0;
if (argc < MAXARGS)
{
argv[argc++] = hard;
}
foo++;
break;
}
foo++;
} // end of while loop...
}
}
}
count = argc;
if (argc)
{
ret = argv;
}
return ret;
}
/*******************************************************************/
/******************** Geometry.h ********************************/
/*******************************************************************/
class GeometryVertex
{
public:
float mPos[3];
float mNormal[3];
float mTexel[2];
};
class GeometryInterface
{
public:
virtual void NodeTriangle(const GeometryVertex *v1, const GeometryVertex *v2, const GeometryVertex *v3) {}
virtual ~GeometryInterface() {}
};
/*******************************************************************/
/******************** Obj.h ********************************/
/*******************************************************************/
class OBJ : public InPlaceParserInterface
{
public:
int LoadMesh(const char *fname, GeometryInterface *callback);
int ParseLine(int lineno, int argc, const char **argv); // return TRUE to continue parsing, return FALSE to abort parsing process
private:
void getVertex(GeometryVertex &v, const char *face) const;
FloatVector mVerts;
FloatVector mTexels;
FloatVector mNormals;
GeometryInterface *mCallback;
};
/*******************************************************************/
/******************** Obj.cpp ********************************/
/*******************************************************************/
int OBJ::LoadMesh(const char *fname, GeometryInterface *iface)
{
int ret = 0;
mVerts.clear();
mTexels.clear();
mNormals.clear();
mCallback = iface;
InPlaceParser ipp(fname);
ipp.Parse(this);
return ret;
}
//static const char * GetArg(const char **argv,int i,int argc)
//{
// const char * ret = 0;
// if ( i < argc ) ret = argv[i];
// return ret;
//}
void OBJ::getVertex(GeometryVertex &v, const char *face) const
{
v.mPos[0] = 0;
v.mPos[1] = 0;
v.mPos[2] = 0;
v.mTexel[0] = 0;
v.mTexel[1] = 0;
v.mNormal[0] = 0;
v.mNormal[1] = 1;
v.mNormal[2] = 0;
int index = atoi(face) - 1;
const char *texel = strstr(face, "/");
if (texel)
{
int tindex = atoi(texel + 1) - 1;
if (tindex >= 0 && tindex < (int)(mTexels.size() / 2))
{
const float *t = &mTexels[tindex * 2];
v.mTexel[0] = t[0];
v.mTexel[1] = t[1];
}
const char *normal = strstr(texel + 1, "/");
if (normal)
{
int nindex = atoi(normal + 1) - 1;
if (nindex >= 0 && nindex < (int)(mNormals.size() / 3))
{
const float *n = &mNormals[nindex * 3];
v.mNormal[0] = n[0];
v.mNormal[1] = n[1];
v.mNormal[2] = n[2];
}
}
}
if (index >= 0 && index < (int)(mVerts.size() / 3))
{
const float *p = &mVerts[index * 3];
v.mPos[0] = p[0];
v.mPos[1] = p[1];
v.mPos[2] = p[2];
}
}
int OBJ::ParseLine(int lineno, int argc, const char **argv) // return TRUE to continue parsing, return FALSE to abort parsing process
{
int ret = 0;
if (argc >= 1)
{
const char *foo = argv[0];
if (*foo != '#')
{
if (strcmp(argv[0], "v") == 0 && argc == 4)
//if ( stricmp(argv[0],"v") == 0 && argc == 4 )
{
float vx = (float)atof(argv[1]);
float vy = (float)atof(argv[2]);
float vz = (float)atof(argv[3]);
mVerts.push_back(vx);
mVerts.push_back(vy);
mVerts.push_back(vz);
}
else if (strcmp(argv[0], "vt") == 0 && argc == 3)
// else if ( stricmp(argv[0],"vt") == 0 && argc == 3 )
{
float tx = (float)atof(argv[1]);
float ty = (float)atof(argv[2]);
mTexels.push_back(tx);
mTexels.push_back(ty);
}
// else if ( stricmp(argv[0],"vn") == 0 && argc == 4 )
else if (strcmp(argv[0], "vn") == 0 && argc == 4)
{
float normalx = (float)atof(argv[1]);
float normaly = (float)atof(argv[2]);
float normalz = (float)atof(argv[3]);
mNormals.push_back(normalx);
mNormals.push_back(normaly);
mNormals.push_back(normalz);
}
// else if ( stricmp(argv[0],"f") == 0 && argc >= 4 )
else if (strcmp(argv[0], "f") == 0 && argc >= 4)
{
GeometryVertex v[32];
int vcount = argc - 1;
for (int i = 1; i < argc; i++)
{
getVertex(v[i - 1], argv[i]);
}
// need to generate a normal!
#if 0 // not currently implemented
if ( mNormals.empty() )
{
Vector3d<float> p1( v[0].mPos );
Vector3d<float> p2( v[1].mPos );
Vector3d<float> p3( v[2].mPos );
Vector3d<float> n;
n.ComputeNormal(p3,p2,p1);
for (int i=0; i<vcount; i++)
{
v[i].mNormal[0] = n.x;
v[i].mNormal[1] = n.y;
v[i].mNormal[2] = n.z;
}
}
#endif
mCallback->NodeTriangle(&v[0], &v[1], &v[2]);
if (vcount >= 3) // do the fan
{
for (int i = 2; i < (vcount - 1); i++)
{
mCallback->NodeTriangle(&v[0], &v[i], &v[i + 1]);
}
}
}
}
}
return ret;
}
class BuildMesh : public GeometryInterface
{
public:
int getIndex(const float *p)
{
int vcount = mVertices.size() / 3;
if (vcount > 0)
{
//New MS STL library checks indices in debug build, so zero causes an assert if it is empty.
const float *v = &mVertices[0];
for (int i = 0; i < vcount; i++)
{
if (v[0] == p[0] && v[1] == p[1] && v[2] == p[2]) return i;
v += 3;
}
}
mVertices.push_back(p[0]);
mVertices.push_back(p[1]);
mVertices.push_back(p[2]);
return vcount;
}
virtual void NodeTriangle(const GeometryVertex *v1, const GeometryVertex *v2, const GeometryVertex *v3)
{
mIndices.push_back(getIndex(v1->mPos));
mIndices.push_back(getIndex(v2->mPos));
mIndices.push_back(getIndex(v3->mPos));
}
const FloatVector &GetVertices(void) const { return mVertices; };
const IntVector &GetIndices(void) const { return mIndices; };
private:
FloatVector mVertices;
IntVector mIndices;
};
WavefrontObj::WavefrontObj(void)
{
mVertexCount = 0;
mTriCount = 0;
mIndices = 0;
mVertices = 0;
}
WavefrontObj::~WavefrontObj(void)
{
delete[] mIndices;
delete[] mVertices;
}
unsigned int WavefrontObj::loadObj(const char *fname) // load a wavefront obj returns number of triangles that were loaded. Data is persists until the class is destructed.
{
unsigned int ret = 0;
delete[] mVertices;
mVertices = 0;
delete[] mIndices;
mIndices = 0;
mVertexCount = 0;
mTriCount = 0;
BuildMesh bm;
OBJ obj;
obj.LoadMesh(fname, &bm);
const FloatVector &vlist = bm.GetVertices();
const IntVector &indices = bm.GetIndices();
if (vlist.size())
{
mVertexCount = vlist.size() / 3;
mVertices = new float[mVertexCount * 3];
memcpy(mVertices, &vlist[0], sizeof(float) * mVertexCount * 3);
mTriCount = indices.size() / 3;
mIndices = new int[mTriCount * 3 * sizeof(int)];
memcpy(mIndices, &indices[0], sizeof(int) * mTriCount * 3);
ret = mTriCount;
}
return ret;
}
} // namespace ConvexDecomposition
| [
"max@autious.net"
] | max@autious.net |
ac92f04374e108738882fbffb05e1384e51d6a52 | 62e564401e2f933d610056564d8d8463e5b5d95f | /programs/db/db_row_list.h | 735ea1365379bd6efca6077e3460f510099f958f | [] | no_license | SvenMichaelKlose/ptk | 1eb1b465eb3c5789d0935c276e70b7343738e9e2 | 8272f88c589b6d5db2031fdadff34eeeebf7df5d | refs/heads/master | 2022-05-01T22:19:43.501700 | 2022-04-15T02:22:34 | 2022-04-15T02:22:34 | 17,663,577 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 699 | h | // $Id: db_row_list.h,v 1.1.1.1 2000/09/30 13:42:09 sven Exp $
// $Source: /home/cvsroot/ptk/programs/db/db_row_list.h,v $
//--------------------------------------------------------------------------
// List of row editors with labeled border,
//
// (c)1999 Sven Klose
//--------------------------------------------------------------------------
#ifndef _radb_db_row_list_H
#define _radb_db_row_list_H
#include "dbi.h"
#include "layout.h"
#include "tkScrollField.h"
class db_row_list : public tkScrollField
{
vector<dbForm*>* _forms;
lmTable* _maintab;
public:
db_row_list(dbi*, vector<dbForm*>*);
virtual void update();
#ifdef DEBUG
virtual void dump(ofstream& o);
#endif
};
#endif
| [
"pixel@copei.de"
] | pixel@copei.de |
7bbf663ac07292dd3338ab13284434f01b060f23 | a7764174fb0351ea666faa9f3b5dfe304390a011 | /inc/TransferBRep_BinderOfShape.hxx | 85a71a06a50d92200e8de47db751bf42bc548f37 | [] | no_license | uel-dataexchange/Opencascade_uel | f7123943e9d8124f4fa67579e3cd3f85cfe52d91 | 06ec93d238d3e3ea2881ff44ba8c21cf870435cd | refs/heads/master | 2022-11-16T07:40:30.837854 | 2020-07-08T01:56:37 | 2020-07-08T01:56:37 | 276,290,778 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,817 | hxx | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _TransferBRep_BinderOfShape_HeaderFile
#define _TransferBRep_BinderOfShape_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_TransferBRep_BinderOfShape_HeaderFile
#include <Handle_TransferBRep_BinderOfShape.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _Transfer_Binder_HeaderFile
#include <Transfer_Binder.hxx>
#endif
#ifndef _Handle_Standard_Type_HeaderFile
#include <Handle_Standard_Type.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
class Transfer_TransferFailure;
class TopoDS_Shape;
class TransferBRep_ShapeInfo;
class Standard_Type;
class TransferBRep_BinderOfShape : public Transfer_Binder {
public:
Standard_EXPORT TransferBRep_BinderOfShape();
Standard_EXPORT TransferBRep_BinderOfShape(const TopoDS_Shape& res);
Standard_EXPORT Handle_Standard_Type ResultType() const;
Standard_EXPORT Standard_CString ResultTypeName() const;
Standard_EXPORT void SetResult(const TopoDS_Shape& res) ;
Standard_EXPORT const TopoDS_Shape& Result() const;
Standard_EXPORT TopoDS_Shape& CResult() ;
DEFINE_STANDARD_RTTI(TransferBRep_BinderOfShape)
protected:
private:
TopoDS_Shape theres;
};
// other Inline functions and methods (like "C++: function call" methods)
#endif
| [
"shoka.sho2@excel.co.jp"
] | shoka.sho2@excel.co.jp |
4b2e29ec3efa76855536a4f3ce1e92ed34780fee | 4d614b26ba821263ae8dad5a3fd192b3d78c0bb0 | /Purgatory/Temp/StagingArea/Data/il2cppOutput/UnityEngine.AudioModule.cpp | 3eaca88bae6ffcc882f1d87e11e6beea594528f8 | [] | no_license | gigsabyte/UCSC-Generative-Design | c40fdc7dd246087d29f4636679e3fbfb31ff6f55 | d4b91cd3f21a7913d3b4c0a09604b051b6e0a600 | refs/heads/master | 2020-06-10T23:27:30.717735 | 2019-08-16T00:40:39 | 2019-08-16T00:40:39 | 193,787,596 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 114,303 | cpp | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
struct VirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename T1>
struct VirtActionInvoker1
{
typedef void (*Action)(void*, T1, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
template <typename R, typename T1, typename T2, typename T3>
struct VirtFuncInvoker3
{
typedef R (*Func)(void*, T1, T2, T3, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
return ((Func)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2>
struct VirtActionInvoker2
{
typedef void (*Action)(void*, T1, T2, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method);
}
};
struct GenericVirtActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename T1>
struct GenericVirtActionInvoker1
{
typedef void (*Action)(void*, T1, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
template <typename R, typename T1, typename T2, typename T3>
struct GenericVirtFuncInvoker3
{
typedef R (*Func)(void*, T1, T2, T3, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2>
struct GenericVirtActionInvoker2
{
typedef void (*Action)(void*, T1, T2, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method);
}
};
struct InterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename T1>
struct InterfaceActionInvoker1
{
typedef void (*Action)(void*, T1, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
template <typename R, typename T1, typename T2, typename T3>
struct InterfaceFuncInvoker3
{
typedef R (*Func)(void*, T1, T2, T3, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
return ((Func)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2>
struct InterfaceActionInvoker2
{
typedef void (*Action)(void*, T1, T2, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method);
}
};
struct GenericInterfaceActionInvoker0
{
typedef void (*Action)(void*, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename T1>
struct GenericInterfaceActionInvoker1
{
typedef void (*Action)(void*, T1, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
template <typename R, typename T1, typename T2, typename T3>
struct GenericInterfaceFuncInvoker3
{
typedef R (*Func)(void*, T1, T2, T3, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2>
struct GenericInterfaceActionInvoker2
{
typedef void (*Action)(void*, T1, T2, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method);
}
};
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4;
// System.Delegate
struct Delegate_t;
// System.DelegateData
struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE;
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
// System.IAsyncResult
struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// System.Single[]
struct SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5;
// System.String
struct String_t;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
// UnityEngine.AudioClip
struct AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051;
// UnityEngine.AudioClip/PCMReaderCallback
struct PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB;
// UnityEngine.AudioClip/PCMSetPositionCallback
struct PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801;
// UnityEngine.AudioSettings/AudioConfigurationChangeHandler
struct AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926;
// UnityEngine.AudioSource
struct AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C;
// UnityEngine.Experimental.Audio.AudioSampleProvider
struct AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913;
// UnityEngine.Experimental.Audio.AudioSampleProvider/ConsumeSampleFramesNativeFunction
struct ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D;
// UnityEngine.Experimental.Audio.AudioSampleProvider/SampleFramesHandler
struct SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF;
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0;
IL2CPP_EXTERN_C RuntimeClass* AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Boolean_tB53F6830F670160873277339AA58F15CAED4399C_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* GC_tC1D7BD74E8F44ECCEF5CD2B5D84BFF9AAE02D01D_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Int32_t585191389E07734F19F3156FF88FB3EF4800D102_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* IntPtr_t_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C const uint32_t AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AudioConfigurationChangeHandler_BeginInvoke_mB0B0ACF6281B999FA11037CA130CA3C72BEC7827_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AudioSampleProvider_Dispose_mA11D514354EDA94E8B6AA83B726DF85169C8E29A_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t AudioSettings_InvokeOnAudioConfigurationChanged_m8D251791C6A402B12E93C22F43475DE3033FC8E7_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t ConsumeSampleFramesNativeFunction_BeginInvoke_mCFD45D186107B1FD87B1A492904CBCF49DDA28CB_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t PCMSetPositionCallback_BeginInvoke_m88CDF70D75854621CA69ED3D53CD53B8206A5093_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t SampleFramesHandler_BeginInvoke_mE516B77CCC50738663D10DDD2D7BDB4391FDFF92_MetadataUsageId;
struct Delegate_t_marshaled_com;
struct Delegate_t_marshaled_pinvoke;
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86;
struct SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5;
IL2CPP_EXTERN_C_BEGIN
IL2CPP_EXTERN_C_END
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// <Module>
struct U3CModuleU3E_t2E16431D825A5D233BFED659B3C516DAB0AC0286
{
public:
public:
};
// System.Object
struct Il2CppArrayBounds;
// System.Array
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
// UnityEngine.AudioSettings
struct AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31 : public RuntimeObject
{
public:
public:
};
struct AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_StaticFields
{
public:
// UnityEngine.AudioSettings_AudioConfigurationChangeHandler UnityEngine.AudioSettings::OnAudioConfigurationChanged
AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * ___OnAudioConfigurationChanged_0;
public:
inline static int32_t get_offset_of_OnAudioConfigurationChanged_0() { return static_cast<int32_t>(offsetof(AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_StaticFields, ___OnAudioConfigurationChanged_0)); }
inline AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * get_OnAudioConfigurationChanged_0() const { return ___OnAudioConfigurationChanged_0; }
inline AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 ** get_address_of_OnAudioConfigurationChanged_0() { return &___OnAudioConfigurationChanged_0; }
inline void set_OnAudioConfigurationChanged_0(AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * value)
{
___OnAudioConfigurationChanged_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___OnAudioConfigurationChanged_0), (void*)value);
}
};
// UnityEngine.Experimental.Audio.AudioSampleProvider
struct AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 : public RuntimeObject
{
public:
// UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction UnityEngine.Experimental.Audio.AudioSampleProvider::m_ConsumeSampleFramesNativeFunction
ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * ___m_ConsumeSampleFramesNativeFunction_0;
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider::<id>k__BackingField
uint32_t ___U3CidU3Ek__BackingField_1;
// System.UInt16 UnityEngine.Experimental.Audio.AudioSampleProvider::<trackIndex>k__BackingField
uint16_t ___U3CtrackIndexU3Ek__BackingField_2;
// UnityEngine.Object UnityEngine.Experimental.Audio.AudioSampleProvider::<owner>k__BackingField
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___U3CownerU3Ek__BackingField_3;
// System.UInt16 UnityEngine.Experimental.Audio.AudioSampleProvider::<channelCount>k__BackingField
uint16_t ___U3CchannelCountU3Ek__BackingField_4;
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider::<sampleRate>k__BackingField
uint32_t ___U3CsampleRateU3Ek__BackingField_5;
// UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler UnityEngine.Experimental.Audio.AudioSampleProvider::sampleFramesAvailable
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * ___sampleFramesAvailable_6;
// UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler UnityEngine.Experimental.Audio.AudioSampleProvider::sampleFramesOverflow
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * ___sampleFramesOverflow_7;
public:
inline static int32_t get_offset_of_m_ConsumeSampleFramesNativeFunction_0() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___m_ConsumeSampleFramesNativeFunction_0)); }
inline ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * get_m_ConsumeSampleFramesNativeFunction_0() const { return ___m_ConsumeSampleFramesNativeFunction_0; }
inline ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D ** get_address_of_m_ConsumeSampleFramesNativeFunction_0() { return &___m_ConsumeSampleFramesNativeFunction_0; }
inline void set_m_ConsumeSampleFramesNativeFunction_0(ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * value)
{
___m_ConsumeSampleFramesNativeFunction_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_ConsumeSampleFramesNativeFunction_0), (void*)value);
}
inline static int32_t get_offset_of_U3CidU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___U3CidU3Ek__BackingField_1)); }
inline uint32_t get_U3CidU3Ek__BackingField_1() const { return ___U3CidU3Ek__BackingField_1; }
inline uint32_t* get_address_of_U3CidU3Ek__BackingField_1() { return &___U3CidU3Ek__BackingField_1; }
inline void set_U3CidU3Ek__BackingField_1(uint32_t value)
{
___U3CidU3Ek__BackingField_1 = value;
}
inline static int32_t get_offset_of_U3CtrackIndexU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___U3CtrackIndexU3Ek__BackingField_2)); }
inline uint16_t get_U3CtrackIndexU3Ek__BackingField_2() const { return ___U3CtrackIndexU3Ek__BackingField_2; }
inline uint16_t* get_address_of_U3CtrackIndexU3Ek__BackingField_2() { return &___U3CtrackIndexU3Ek__BackingField_2; }
inline void set_U3CtrackIndexU3Ek__BackingField_2(uint16_t value)
{
___U3CtrackIndexU3Ek__BackingField_2 = value;
}
inline static int32_t get_offset_of_U3CownerU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___U3CownerU3Ek__BackingField_3)); }
inline Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * get_U3CownerU3Ek__BackingField_3() const { return ___U3CownerU3Ek__BackingField_3; }
inline Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 ** get_address_of_U3CownerU3Ek__BackingField_3() { return &___U3CownerU3Ek__BackingField_3; }
inline void set_U3CownerU3Ek__BackingField_3(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * value)
{
___U3CownerU3Ek__BackingField_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CownerU3Ek__BackingField_3), (void*)value);
}
inline static int32_t get_offset_of_U3CchannelCountU3Ek__BackingField_4() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___U3CchannelCountU3Ek__BackingField_4)); }
inline uint16_t get_U3CchannelCountU3Ek__BackingField_4() const { return ___U3CchannelCountU3Ek__BackingField_4; }
inline uint16_t* get_address_of_U3CchannelCountU3Ek__BackingField_4() { return &___U3CchannelCountU3Ek__BackingField_4; }
inline void set_U3CchannelCountU3Ek__BackingField_4(uint16_t value)
{
___U3CchannelCountU3Ek__BackingField_4 = value;
}
inline static int32_t get_offset_of_U3CsampleRateU3Ek__BackingField_5() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___U3CsampleRateU3Ek__BackingField_5)); }
inline uint32_t get_U3CsampleRateU3Ek__BackingField_5() const { return ___U3CsampleRateU3Ek__BackingField_5; }
inline uint32_t* get_address_of_U3CsampleRateU3Ek__BackingField_5() { return &___U3CsampleRateU3Ek__BackingField_5; }
inline void set_U3CsampleRateU3Ek__BackingField_5(uint32_t value)
{
___U3CsampleRateU3Ek__BackingField_5 = value;
}
inline static int32_t get_offset_of_sampleFramesAvailable_6() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___sampleFramesAvailable_6)); }
inline SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * get_sampleFramesAvailable_6() const { return ___sampleFramesAvailable_6; }
inline SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF ** get_address_of_sampleFramesAvailable_6() { return &___sampleFramesAvailable_6; }
inline void set_sampleFramesAvailable_6(SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * value)
{
___sampleFramesAvailable_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___sampleFramesAvailable_6), (void*)value);
}
inline static int32_t get_offset_of_sampleFramesOverflow_7() { return static_cast<int32_t>(offsetof(AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913, ___sampleFramesOverflow_7)); }
inline SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * get_sampleFramesOverflow_7() const { return ___sampleFramesOverflow_7; }
inline SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF ** get_address_of_sampleFramesOverflow_7() { return &___sampleFramesOverflow_7; }
inline void set_sampleFramesOverflow_7(SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * value)
{
___sampleFramesOverflow_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___sampleFramesOverflow_7), (void*)value);
}
};
// System.Boolean
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
{
public:
// System.Boolean System.Boolean::m_value
bool ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
inline bool get_m_value_0() const { return ___m_value_0; }
inline bool* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(bool value)
{
___m_value_0 = value;
}
};
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
{
public:
// System.String System.Boolean::TrueString
String_t* ___TrueString_5;
// System.String System.Boolean::FalseString
String_t* ___FalseString_6;
public:
inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
inline String_t* get_TrueString_5() const { return ___TrueString_5; }
inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
inline void set_TrueString_5(String_t* value)
{
___TrueString_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value);
}
inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
inline String_t* get_FalseString_6() const { return ___FalseString_6; }
inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
inline void set_FalseString_6(String_t* value)
{
___FalseString_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value);
}
};
// System.Int32
struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); }
inline int32_t get_m_value_0() const { return ___m_value_0; }
inline int32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int32_t value)
{
___m_value_0 = value;
}
};
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
// System.Single
struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1
{
public:
// System.Single System.Single::m_value
float ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); }
inline float get_m_value_0() const { return ___m_value_0; }
inline float* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(float value)
{
___m_value_0 = value;
}
};
// System.UInt32
struct UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B
{
public:
// System.UInt32 System.UInt32::m_value
uint32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B, ___m_value_0)); }
inline uint32_t get_m_value_0() const { return ___m_value_0; }
inline uint32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(uint32_t value)
{
___m_value_0 = value;
}
};
// System.UInt64
struct UInt64_tA02DF3B59C8FC4A849BD207DA11038CC64E4CB4E
{
public:
// System.UInt64 System.UInt64::m_value
uint64_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt64_tA02DF3B59C8FC4A849BD207DA11038CC64E4CB4E, ___m_value_0)); }
inline uint64_t get_m_value_0() const { return ___m_value_0; }
inline uint64_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(uint64_t value)
{
___m_value_0 = value;
}
};
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017
{
public:
union
{
struct
{
};
uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1];
};
public:
};
// System.Delegate
struct Delegate_t : public RuntimeObject
{
public:
// System.IntPtr System.Delegate::method_ptr
Il2CppMethodPointer ___method_ptr_0;
// System.IntPtr System.Delegate::invoke_impl
intptr_t ___invoke_impl_1;
// System.Object System.Delegate::m_target
RuntimeObject * ___m_target_2;
// System.IntPtr System.Delegate::method
intptr_t ___method_3;
// System.IntPtr System.Delegate::delegate_trampoline
intptr_t ___delegate_trampoline_4;
// System.IntPtr System.Delegate::extra_arg
intptr_t ___extra_arg_5;
// System.IntPtr System.Delegate::method_code
intptr_t ___method_code_6;
// System.Reflection.MethodInfo System.Delegate::method_info
MethodInfo_t * ___method_info_7;
// System.Reflection.MethodInfo System.Delegate::original_method_info
MethodInfo_t * ___original_method_info_8;
// System.DelegateData System.Delegate::data
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
// System.Boolean System.Delegate::method_is_virtual
bool ___method_is_virtual_10;
public:
inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); }
inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; }
inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; }
inline void set_method_ptr_0(Il2CppMethodPointer value)
{
___method_ptr_0 = value;
}
inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); }
inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; }
inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; }
inline void set_invoke_impl_1(intptr_t value)
{
___invoke_impl_1 = value;
}
inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); }
inline RuntimeObject * get_m_target_2() const { return ___m_target_2; }
inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; }
inline void set_m_target_2(RuntimeObject * value)
{
___m_target_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_target_2), (void*)value);
}
inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); }
inline intptr_t get_method_3() const { return ___method_3; }
inline intptr_t* get_address_of_method_3() { return &___method_3; }
inline void set_method_3(intptr_t value)
{
___method_3 = value;
}
inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); }
inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; }
inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; }
inline void set_delegate_trampoline_4(intptr_t value)
{
___delegate_trampoline_4 = value;
}
inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); }
inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; }
inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; }
inline void set_extra_arg_5(intptr_t value)
{
___extra_arg_5 = value;
}
inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); }
inline intptr_t get_method_code_6() const { return ___method_code_6; }
inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; }
inline void set_method_code_6(intptr_t value)
{
___method_code_6 = value;
}
inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); }
inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; }
inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; }
inline void set_method_info_7(MethodInfo_t * value)
{
___method_info_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___method_info_7), (void*)value);
}
inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); }
inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; }
inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; }
inline void set_original_method_info_8(MethodInfo_t * value)
{
___original_method_info_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___original_method_info_8), (void*)value);
}
inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; }
inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value)
{
___data_9 = value;
Il2CppCodeGenWriteBarrier((void**)(&___data_9), (void*)value);
}
inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); }
inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; }
inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; }
inline void set_method_is_virtual_10(bool value)
{
___method_is_virtual_10 = value;
}
};
// Native definition for P/Invoke marshalling of System.Delegate
struct Delegate_t_marshaled_pinvoke
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// Native definition for COM marshalling of System.Delegate
struct Delegate_t_marshaled_com
{
intptr_t ___method_ptr_0;
intptr_t ___invoke_impl_1;
Il2CppIUnknown* ___m_target_2;
intptr_t ___method_3;
intptr_t ___delegate_trampoline_4;
intptr_t ___extra_arg_5;
intptr_t ___method_code_6;
MethodInfo_t * ___method_info_7;
MethodInfo_t * ___original_method_info_8;
DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9;
int32_t ___method_is_virtual_10;
};
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Object::m_CachedPtr
intptr_t ___m_CachedPtr_0;
public:
inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); }
inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
inline void set_m_CachedPtr_0(intptr_t value)
{
___m_CachedPtr_0 = value;
}
};
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields
{
public:
// System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
public:
inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
{
___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
// UnityEngine.Playables.PlayableHandle
struct PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182
{
public:
// System.IntPtr UnityEngine.Playables.PlayableHandle::m_Handle
intptr_t ___m_Handle_0;
// System.UInt32 UnityEngine.Playables.PlayableHandle::m_Version
uint32_t ___m_Version_1;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182, ___m_Handle_0)); }
inline intptr_t get_m_Handle_0() const { return ___m_Handle_0; }
inline intptr_t* get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(intptr_t value)
{
___m_Handle_0 = value;
}
inline static int32_t get_offset_of_m_Version_1() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182, ___m_Version_1)); }
inline uint32_t get_m_Version_1() const { return ___m_Version_1; }
inline uint32_t* get_address_of_m_Version_1() { return &___m_Version_1; }
inline void set_m_Version_1(uint32_t value)
{
___m_Version_1 = value;
}
};
struct PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_StaticFields
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Playables.PlayableHandle::m_Null
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Null_2;
public:
inline static int32_t get_offset_of_m_Null_2() { return static_cast<int32_t>(offsetof(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_StaticFields, ___m_Null_2)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Null_2() const { return ___m_Null_2; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Null_2() { return &___m_Null_2; }
inline void set_m_Null_2(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Null_2 = value;
}
};
// UnityEngine.Playables.PlayableOutputHandle
struct PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922
{
public:
// System.IntPtr UnityEngine.Playables.PlayableOutputHandle::m_Handle
intptr_t ___m_Handle_0;
// System.UInt32 UnityEngine.Playables.PlayableOutputHandle::m_Version
uint32_t ___m_Version_1;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922, ___m_Handle_0)); }
inline intptr_t get_m_Handle_0() const { return ___m_Handle_0; }
inline intptr_t* get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(intptr_t value)
{
___m_Handle_0 = value;
}
inline static int32_t get_offset_of_m_Version_1() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922, ___m_Version_1)); }
inline uint32_t get_m_Version_1() const { return ___m_Version_1; }
inline uint32_t* get_address_of_m_Version_1() { return &___m_Version_1; }
inline void set_m_Version_1(uint32_t value)
{
___m_Version_1 = value;
}
};
struct PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922_StaticFields
{
public:
// UnityEngine.Playables.PlayableOutputHandle UnityEngine.Playables.PlayableOutputHandle::m_Null
PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 ___m_Null_2;
public:
inline static int32_t get_offset_of_m_Null_2() { return static_cast<int32_t>(offsetof(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922_StaticFields, ___m_Null_2)); }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 get_m_Null_2() const { return ___m_Null_2; }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 * get_address_of_m_Null_2() { return &___m_Null_2; }
inline void set_m_Null_2(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 value)
{
___m_Null_2 = value;
}
};
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value)
{
___delegates_11 = value;
Il2CppCodeGenWriteBarrier((void**)(&___delegates_11), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke
{
Delegate_t_marshaled_pinvoke** ___delegates_11;
};
// Native definition for COM marshalling of System.MulticastDelegate
struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com
{
Delegate_t_marshaled_com** ___delegates_11;
};
// UnityEngine.Audio.AudioClipPlayable
struct AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioClipPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
// UnityEngine.Audio.AudioMixerPlayable
struct AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F
{
public:
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioMixerPlayable::m_Handle
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F, ___m_Handle_0)); }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 value)
{
___m_Handle_0 = value;
}
};
// UnityEngine.Audio.AudioPlayableOutput
struct AudioPlayableOutput_tD2671908FEE2832112E8A3B611089A2558A4DA6B
{
public:
// UnityEngine.Playables.PlayableOutputHandle UnityEngine.Audio.AudioPlayableOutput::m_Handle
PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 ___m_Handle_0;
public:
inline static int32_t get_offset_of_m_Handle_0() { return static_cast<int32_t>(offsetof(AudioPlayableOutput_tD2671908FEE2832112E8A3B611089A2558A4DA6B, ___m_Handle_0)); }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 get_m_Handle_0() const { return ___m_Handle_0; }
inline PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 * get_address_of_m_Handle_0() { return &___m_Handle_0; }
inline void set_m_Handle_0(PlayableOutputHandle_t0D0C9D8ACC1A4061BD4EAEB61F3EE0357052F922 value)
{
___m_Handle_0 = value;
}
};
// UnityEngine.AudioClip
struct AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
// UnityEngine.AudioClip_PCMReaderCallback UnityEngine.AudioClip::m_PCMReaderCallback
PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * ___m_PCMReaderCallback_4;
// UnityEngine.AudioClip_PCMSetPositionCallback UnityEngine.AudioClip::m_PCMSetPositionCallback
PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * ___m_PCMSetPositionCallback_5;
public:
inline static int32_t get_offset_of_m_PCMReaderCallback_4() { return static_cast<int32_t>(offsetof(AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051, ___m_PCMReaderCallback_4)); }
inline PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * get_m_PCMReaderCallback_4() const { return ___m_PCMReaderCallback_4; }
inline PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB ** get_address_of_m_PCMReaderCallback_4() { return &___m_PCMReaderCallback_4; }
inline void set_m_PCMReaderCallback_4(PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * value)
{
___m_PCMReaderCallback_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_PCMReaderCallback_4), (void*)value);
}
inline static int32_t get_offset_of_m_PCMSetPositionCallback_5() { return static_cast<int32_t>(offsetof(AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051, ___m_PCMSetPositionCallback_5)); }
inline PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * get_m_PCMSetPositionCallback_5() const { return ___m_PCMSetPositionCallback_5; }
inline PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 ** get_address_of_m_PCMSetPositionCallback_5() { return &___m_PCMSetPositionCallback_5; }
inline void set_m_PCMSetPositionCallback_5(PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * value)
{
___m_PCMSetPositionCallback_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_PCMSetPositionCallback_5), (void*)value);
}
};
// UnityEngine.Component
struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// System.AsyncCallback
struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.AudioClip_PCMReaderCallback
struct PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.AudioClip_PCMSetPositionCallback
struct PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.AudioSettings_AudioConfigurationChangeHandler
struct AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Behaviour
struct Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8 : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621
{
public:
public:
};
// UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction
struct ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler
struct SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.AudioBehaviour
struct AudioBehaviour_tC612EC4E17A648A5C568621F3FBF1DBD773C71C7 : public Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8
{
public:
public:
};
// UnityEngine.AudioListener
struct AudioListener_tE3E1467B84A4AFD509947B44A7C8ACFB67FF2099 : public AudioBehaviour_tC612EC4E17A648A5C568621F3FBF1DBD773C71C7
{
public:
public:
};
// UnityEngine.AudioSource
struct AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C : public AudioBehaviour_tC612EC4E17A648A5C568621F3FBF1DBD773C71C7
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// System.Single[]
struct SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5 : public RuntimeArray
{
public:
ALIGN_FIELD (8) float m_Items[1];
public:
inline float GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline float* GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, float value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
}
inline float GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline float* GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, float value)
{
m_Items[index] = value;
}
};
// System.Delegate[]
struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Delegate_t * m_Items[1];
public:
inline Delegate_t * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Delegate_t ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, Delegate_t * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
inline Delegate_t * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Delegate_t ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
};
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioClipPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1 (AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Playables.PlayableHandle::op_Equality(UnityEngine.Playables.PlayableHandle,UnityEngine.Playables.PlayableHandle)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF (PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 p0, PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 p1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Audio.AudioClipPlayable::Equals(UnityEngine.Audio.AudioClipPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0 (AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * __this, AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C ___other0, const RuntimeMethod* method);
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D (AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Audio.AudioMixerPlayable::Equals(UnityEngine.Audio.AudioMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4 (AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * __this, AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F ___other0, const RuntimeMethod* method);
// System.Void UnityEngine.AudioClip/PCMReaderCallback::Invoke(System.Single[])
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMReaderCallback_Invoke_m7B101820DB35BEFC8D2724DF96900367863B93B6 (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* ___data0, const RuntimeMethod* method);
// System.Void UnityEngine.AudioClip/PCMSetPositionCallback::Invoke(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMSetPositionCallback_Invoke_m8EA4736B43191A8E6F95E1548AFF124519EC533C (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, int32_t ___position0, const RuntimeMethod* method);
// System.Void UnityEngine.AudioSettings/AudioConfigurationChangeHandler::Invoke(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioConfigurationChangeHandler_Invoke_m62D72B397E1DC117C8C92A450D2C86C535A2BF49 (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, bool ___deviceWasChanged0, const RuntimeMethod* method);
// System.Void UnityEngine.AudioSource::SetPitch(UnityEngine.AudioSource,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * ___source0, float ___pitch1, const RuntimeMethod* method);
// System.Void UnityEngine.AudioSource::PlayHelper(UnityEngine.AudioSource,System.UInt64)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * ___source0, uint64_t ___delay1, const RuntimeMethod* method);
// System.Void UnityEngine.AudioSource::Stop(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, bool ___stopOneShots0, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::set_owner(UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_set_owner_m21FC4073346BFBE33E2B1567ECEC8ECD373B3069 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___value0, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::Dispose()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_Dispose_mA11D514354EDA94E8B6AA83B726DF85169C8E29A (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method);
// System.Void System.Object::Finalize()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380 (RuntimeObject * __this, const RuntimeMethod* method);
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider::get_id()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR uint32_t AudioSampleProvider_get_id_m9E16910C6A2335F87E6B257D3059A8BBC8D7253A (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InternalSetScriptingPtr(System.UInt32,UnityEngine.Experimental.Audio.AudioSampleProvider)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9 (uint32_t ___providerId0, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * ___provider1, const RuntimeMethod* method);
// UnityEngine.Object UnityEngine.Experimental.Audio.AudioSampleProvider::get_owner()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * AudioSampleProvider_get_owner_m822057CE02CF8664D7BF569CDB41D8EB154251FE (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * p1, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InternalRemove(System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11 (uint32_t ___providerId0, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::set_id(System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_set_id_mB98E8435407CAD305BBEAA91B18CBC12562DFAF9 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, uint32_t ___value0, const RuntimeMethod* method);
// System.Void System.GC::SuppressFinalize(System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GC_SuppressFinalize_m037319A9B95A5BA437E806DE592802225EE5B425 (RuntimeObject * p0, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider/SampleFramesHandler::Invoke(UnityEngine.Experimental.Audio.AudioSampleProvider,System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SampleFramesHandler_Invoke_m52F0148F680B36E04A7F850E617FBEF1CA9809FD (SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * __this, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * ___provider0, uint32_t ___sampleFrameCount1, const RuntimeMethod* method);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioClipPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1 (AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000d;
}
IL_000d:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * _thisAdjusted = reinterpret_cast<AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C *>(__this + 1);
return AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Audio.AudioClipPlayable::Equals(UnityEngine.Audio.AudioClipPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0 (AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * __this, AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1((AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AudioClipPlayable_GetHandle_mEE8F62E9DA2A0DDDB064A9AA2391909C425CB3B1((AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0019;
}
IL_0019:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0_AdjustorThunk (RuntimeObject * __this, AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C ___other0, const RuntimeMethod* method)
{
AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C * _thisAdjusted = reinterpret_cast<AudioClipPlayable_t6094311F945E65BC29F85B23A81E8426D596553C *>(__this + 1);
return AudioClipPlayable_Equals_mEB47B5F2E1C643D403FA916C8961F117593DCFC0(_thisAdjusted, ___other0, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Playables.PlayableHandle UnityEngine.Audio.AudioMixerPlayable::GetHandle()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D (AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * __this, const RuntimeMethod* method)
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 V_0;
memset((&V_0), 0, sizeof(V_0));
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = __this->get_m_Handle_0();
V_0 = L_0;
goto IL_000d;
}
IL_000d:
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * _thisAdjusted = reinterpret_cast<AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F *>(__this + 1);
return AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D(_thisAdjusted, method);
}
// System.Boolean UnityEngine.Audio.AudioMixerPlayable::Equals(UnityEngine.Audio.AudioMixerPlayable)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4 (AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * __this, AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F ___other0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
{
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_0 = AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D((AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F *)__this, /*hidden argument*/NULL);
PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182 L_1 = AudioMixerPlayable_GetHandle_mDBC7135DF653E0E19675B6694EA89958E609587D((AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F *)(&___other0), /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(PlayableHandle_t9D3B4E540D4413CED81DDD6A24C5373BEFA1D182_il2cpp_TypeInfo_var);
bool L_2 = PlayableHandle_op_Equality_mBA774AE123AF794A1EB55148206CDD52DAFA42DF(L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
goto IL_0019;
}
IL_0019:
{
bool L_3 = V_0;
return L_3;
}
}
IL2CPP_EXTERN_C bool AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4_AdjustorThunk (RuntimeObject * __this, AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F ___other0, const RuntimeMethod* method)
{
AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F * _thisAdjusted = reinterpret_cast<AudioMixerPlayable_t2C445EB39F9111CCFF7E2E1F813B22007862FA9F *>(__this + 1);
return AudioMixerPlayable_Equals_m6B84D1A5AEDEAAE12AEFB77319B2662506ABC9C4(_thisAdjusted, ___other0, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.AudioClip::InvokePCMReaderCallback_Internal(System.Single[])
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioClip_InvokePCMReaderCallback_Internal_mF087FCAD425EAC299C1156BA809DC535D00757F9 (AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051 * __this, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* ___data0, const RuntimeMethod* method)
{
{
PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * L_0 = __this->get_m_PCMReaderCallback_4();
if (!L_0)
{
goto IL_0018;
}
}
{
PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * L_1 = __this->get_m_PCMReaderCallback_4();
SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* L_2 = ___data0;
PCMReaderCallback_Invoke_m7B101820DB35BEFC8D2724DF96900367863B93B6(L_1, L_2, /*hidden argument*/NULL);
}
IL_0018:
{
return;
}
}
// System.Void UnityEngine.AudioClip::InvokePCMSetPositionCallback_Internal(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioClip_InvokePCMSetPositionCallback_Internal_mBB8265A5BFF660F8AF39718DDB193319AB7EFA6F (AudioClip_tCC3C35F579203CE2601243585AB3D6953C3BA051 * __this, int32_t ___position0, const RuntimeMethod* method)
{
{
PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * L_0 = __this->get_m_PCMSetPositionCallback_5();
if (!L_0)
{
goto IL_0018;
}
}
{
PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * L_1 = __this->get_m_PCMSetPositionCallback_5();
int32_t L_2 = ___position0;
PCMSetPositionCallback_Invoke_m8EA4736B43191A8E6F95E1548AFF124519EC533C(L_1, L_2, /*hidden argument*/NULL);
}
IL_0018:
{
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
IL2CPP_EXTERN_C void DelegatePInvokeWrapper_PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* ___data0, const RuntimeMethod* method)
{
typedef void (DEFAULT_CALL *PInvokeFunc)(float*);
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Marshaling of parameter '___data0' to native representation
float* ____data0_marshaled = NULL;
if (___data0 != NULL)
{
____data0_marshaled = reinterpret_cast<float*>((___data0)->GetAddressAtUnchecked(0));
}
// Native function invocation
il2cppPInvokeFunc(____data0_marshaled);
}
// System.Void UnityEngine.AudioClip_PCMReaderCallback::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMReaderCallback__ctor_mF9EB2467704F5E13196BBA93F41FA275AC5432F6 (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.AudioClip_PCMReaderCallback::Invoke(System.Single[])
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMReaderCallback_Invoke_m7B101820DB35BEFC8D2724DF96900367863B93B6 (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* ___data0, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 1)
{
// open
typedef void (*FunctionPointerType) (SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___data0, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___data0, targetMethod);
}
}
else if (___parameterCount != 1)
{
// open
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker0::Invoke(targetMethod, ___data0);
else
GenericVirtActionInvoker0::Invoke(targetMethod, ___data0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___data0);
else
VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___data0);
}
}
else
{
typedef void (*FunctionPointerType) (SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___data0, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___data0, targetMethod);
}
else if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker1< SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* >::Invoke(targetMethod, targetThis, ___data0);
else
GenericVirtActionInvoker1< SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* >::Invoke(targetMethod, targetThis, ___data0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker1< SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___data0);
else
VirtActionInvoker1< SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___data0);
}
}
else
{
typedef void (*FunctionPointerType) (void*, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5*, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___data0, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.AudioClip_PCMReaderCallback::BeginInvoke(System.Single[],System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* PCMReaderCallback_BeginInvoke_m94035E11B2B9BD6114EF3D7F4B7E367572E7AE1F (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, SingleU5BU5D_tA7139B7CAA40EAEF9178E2C386C8A5993754FDD5* ___data0, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback1, RuntimeObject * ___object2, const RuntimeMethod* method)
{
void *__d_args[2] = {0};
__d_args[0] = ___data0;
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback1, (RuntimeObject*)___object2);
}
// System.Void UnityEngine.AudioClip_PCMReaderCallback::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMReaderCallback_EndInvoke_m6730FD7DFD7246F137C437BC470F995D6C75E15B (PCMReaderCallback_t9B87AB13DCD37957B045554BF28A57697E6B8EFB * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
IL2CPP_EXTERN_C void DelegatePInvokeWrapper_PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, int32_t ___position0, const RuntimeMethod* method)
{
typedef void (DEFAULT_CALL *PInvokeFunc)(int32_t);
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Native function invocation
il2cppPInvokeFunc(___position0);
}
// System.Void UnityEngine.AudioClip_PCMSetPositionCallback::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMSetPositionCallback__ctor_m31EA578C3CCFDFC9335B8C67353878AEE4B3905F (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.AudioClip_PCMSetPositionCallback::Invoke(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMSetPositionCallback_Invoke_m8EA4736B43191A8E6F95E1548AFF124519EC533C (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, int32_t ___position0, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 1)
{
// open
typedef void (*FunctionPointerType) (int32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___position0, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, int32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___position0, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (int32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___position0, targetMethod);
}
else if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker1< int32_t >::Invoke(targetMethod, targetThis, ___position0);
else
GenericVirtActionInvoker1< int32_t >::Invoke(targetMethod, targetThis, ___position0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker1< int32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___position0);
else
VirtActionInvoker1< int32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___position0);
}
}
else
{
typedef void (*FunctionPointerType) (void*, int32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___position0, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.AudioClip_PCMSetPositionCallback::BeginInvoke(System.Int32,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* PCMSetPositionCallback_BeginInvoke_m88CDF70D75854621CA69ED3D53CD53B8206A5093 (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, int32_t ___position0, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback1, RuntimeObject * ___object2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (PCMSetPositionCallback_BeginInvoke_m88CDF70D75854621CA69ED3D53CD53B8206A5093_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
void *__d_args[2] = {0};
__d_args[0] = Box(Int32_t585191389E07734F19F3156FF88FB3EF4800D102_il2cpp_TypeInfo_var, &___position0);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback1, (RuntimeObject*)___object2);
}
// System.Void UnityEngine.AudioClip_PCMSetPositionCallback::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void PCMSetPositionCallback_EndInvoke_mB711E23CFD370348A1680B281A3DFE04F970792C (PCMSetPositionCallback_t092ED33043C0279B5E4D343EBCBD516CEF260801 * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.AudioSettings::InvokeOnAudioConfigurationChanged(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSettings_InvokeOnAudioConfigurationChanged_m8D251791C6A402B12E93C22F43475DE3033FC8E7 (bool ___deviceWasChanged0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AudioSettings_InvokeOnAudioConfigurationChanged_m8D251791C6A402B12E93C22F43475DE3033FC8E7_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * L_0 = ((AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_StaticFields*)il2cpp_codegen_static_fields_for(AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_il2cpp_TypeInfo_var))->get_OnAudioConfigurationChanged_0();
if (!L_0)
{
goto IL_0016;
}
}
{
AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * L_1 = ((AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_StaticFields*)il2cpp_codegen_static_fields_for(AudioSettings_t77B5D69F704CF3B710B0B6970BB62A4BF25A5B31_il2cpp_TypeInfo_var))->get_OnAudioConfigurationChanged_0();
bool L_2 = ___deviceWasChanged0;
AudioConfigurationChangeHandler_Invoke_m62D72B397E1DC117C8C92A450D2C86C535A2BF49(L_1, L_2, /*hidden argument*/NULL);
}
IL_0016:
{
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
IL2CPP_EXTERN_C void DelegatePInvokeWrapper_AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, bool ___deviceWasChanged0, const RuntimeMethod* method)
{
typedef void (DEFAULT_CALL *PInvokeFunc)(int32_t);
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Native function invocation
il2cppPInvokeFunc(static_cast<int32_t>(___deviceWasChanged0));
}
// System.Void UnityEngine.AudioSettings_AudioConfigurationChangeHandler::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioConfigurationChangeHandler__ctor_mF9399769D5BB18D740774B9E3129958868BD6D9A (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.AudioSettings_AudioConfigurationChangeHandler::Invoke(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioConfigurationChangeHandler_Invoke_m62D72B397E1DC117C8C92A450D2C86C535A2BF49 (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, bool ___deviceWasChanged0, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 1)
{
// open
typedef void (*FunctionPointerType) (bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___deviceWasChanged0, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___deviceWasChanged0, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___deviceWasChanged0, targetMethod);
}
else if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker1< bool >::Invoke(targetMethod, targetThis, ___deviceWasChanged0);
else
GenericVirtActionInvoker1< bool >::Invoke(targetMethod, targetThis, ___deviceWasChanged0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker1< bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___deviceWasChanged0);
else
VirtActionInvoker1< bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___deviceWasChanged0);
}
}
else
{
typedef void (*FunctionPointerType) (void*, bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___deviceWasChanged0, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.AudioSettings_AudioConfigurationChangeHandler::BeginInvoke(System.Boolean,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* AudioConfigurationChangeHandler_BeginInvoke_mB0B0ACF6281B999FA11037CA130CA3C72BEC7827 (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, bool ___deviceWasChanged0, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback1, RuntimeObject * ___object2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AudioConfigurationChangeHandler_BeginInvoke_mB0B0ACF6281B999FA11037CA130CA3C72BEC7827_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
void *__d_args[2] = {0};
__d_args[0] = Box(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_il2cpp_TypeInfo_var, &___deviceWasChanged0);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback1, (RuntimeObject*)___object2);
}
// System.Void UnityEngine.AudioSettings_AudioConfigurationChangeHandler::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioConfigurationChangeHandler_EndInvoke_mBB53599C34E3944D3A1DD71EFD2D73AF105CF830 (AudioConfigurationChangeHandler_t8E0E05D0198D95B5412DC716F87D97020EF54926 * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.AudioSource::SetPitch(UnityEngine.AudioSource,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * ___source0, float ___pitch1, const RuntimeMethod* method)
{
typedef void (*AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *, float);
static AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::SetPitch(UnityEngine.AudioSource,System.Single)");
_il2cpp_icall_func(___source0, ___pitch1);
}
// System.Void UnityEngine.AudioSource::PlayHelper(UnityEngine.AudioSource,System.UInt64)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * ___source0, uint64_t ___delay1, const RuntimeMethod* method)
{
typedef void (*AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *, uint64_t);
static AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::PlayHelper(UnityEngine.AudioSource,System.UInt64)");
_il2cpp_icall_func(___source0, ___delay1);
}
// System.Void UnityEngine.AudioSource::Stop(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, bool ___stopOneShots0, const RuntimeMethod* method)
{
typedef void (*AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *, bool);
static AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::Stop(System.Boolean)");
_il2cpp_icall_func(__this, ___stopOneShots0);
}
// System.Single UnityEngine.AudioSource::get_volume()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float AudioSource_get_volume_mBD65DB423F0520CDCB935CC593565343965A4CB0 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, const RuntimeMethod* method)
{
typedef float (*AudioSource_get_volume_mBD65DB423F0520CDCB935CC593565343965A4CB0_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *);
static AudioSource_get_volume_mBD65DB423F0520CDCB935CC593565343965A4CB0_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_get_volume_mBD65DB423F0520CDCB935CC593565343965A4CB0_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::get_volume()");
float retVal = _il2cpp_icall_func(__this);
return retVal;
}
// System.Void UnityEngine.AudioSource::set_volume(System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_set_volume_mF1757D70EE113871724334D13F70EF1ED033BA06 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, float ___value0, const RuntimeMethod* method)
{
typedef void (*AudioSource_set_volume_mF1757D70EE113871724334D13F70EF1ED033BA06_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *, float);
static AudioSource_set_volume_mF1757D70EE113871724334D13F70EF1ED033BA06_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_set_volume_mF1757D70EE113871724334D13F70EF1ED033BA06_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::set_volume(System.Single)");
_il2cpp_icall_func(__this, ___value0);
}
// System.Void UnityEngine.AudioSource::set_pitch(System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_set_pitch_mAB8F8CDB21A3139D3471784FEE9DBFA4CEDEE2E0 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, float ___value0, const RuntimeMethod* method)
{
{
float L_0 = ___value0;
AudioSource_SetPitch_mB65EF59C56A49FD68CD3361B2C34E07F89F1244B(__this, L_0, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.AudioSource::Play()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_Play_m0BA206481892AA4AF7DB2900A0B0805076516164 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, const RuntimeMethod* method)
{
{
AudioSource_PlayHelper_m361C17B583E05D2A5FA0F03BD7CD98D74FBF83AC(__this, (((int64_t)((int64_t)0))), /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.AudioSource::Stop()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSource_Stop_m488F7AA7F7067DE3EC92CEE3413E86C2E5940200 (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, const RuntimeMethod* method)
{
{
AudioSource_Stop_mD3712B98BC6DBEA9CEEF778CE9CCB8DBA62F47A8(__this, (bool)1, /*hidden argument*/NULL);
return;
}
}
// System.Boolean UnityEngine.AudioSource::get_isPlaying()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool AudioSource_get_isPlaying_m5112A878573652681F40C82F0D8103C999978F3C (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C * __this, const RuntimeMethod* method)
{
typedef bool (*AudioSource_get_isPlaying_m5112A878573652681F40C82F0D8103C999978F3C_ftn) (AudioSource_t5196F862B4E60F404613361C90D87FBDD041E93C *);
static AudioSource_get_isPlaying_m5112A878573652681F40C82F0D8103C999978F3C_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSource_get_isPlaying_m5112A878573652681F40C82F0D8103C999978F3C_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::get_isPlaying()");
bool retVal = _il2cpp_icall_func(__this);
return retVal;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::Finalize()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_Finalize_mACCDEE1F5F0F602DC35AE68875EB8DB16830544C (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method)
{
Exception_t * __last_unhandled_exception = 0;
NO_UNUSED_WARNING (__last_unhandled_exception);
Exception_t * __exception_local = 0;
NO_UNUSED_WARNING (__exception_local);
void* __leave_targets_storage = alloca(sizeof(int32_t) * 1);
il2cpp::utils::LeaveTargetStack __leave_targets(__leave_targets_storage);
NO_UNUSED_WARNING (__leave_targets);
{
}
IL_0001:
try
{ // begin try (depth: 1)
AudioSampleProvider_set_owner_m21FC4073346BFBE33E2B1567ECEC8ECD373B3069(__this, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
AudioSampleProvider_Dispose_mA11D514354EDA94E8B6AA83B726DF85169C8E29A(__this, /*hidden argument*/NULL);
IL2CPP_LEAVE(0x1A, FINALLY_0013);
} // end try (depth: 1)
catch(Il2CppExceptionWrapper& e)
{
__last_unhandled_exception = (Exception_t *)e.ex;
goto FINALLY_0013;
}
FINALLY_0013:
{ // begin finally (depth: 1)
Object_Finalize_m4015B7D3A44DE125C5FE34D7276CD4697C06F380(__this, /*hidden argument*/NULL);
IL2CPP_END_FINALLY(19)
} // end finally (depth: 1)
IL2CPP_CLEANUP(19)
{
IL2CPP_JUMP_TBL(0x1A, IL_001a)
IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *)
}
IL_001a:
{
return;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::Dispose()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_Dispose_mA11D514354EDA94E8B6AA83B726DF85169C8E29A (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (AudioSampleProvider_Dispose_mA11D514354EDA94E8B6AA83B726DF85169C8E29A_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
uint32_t L_0 = AudioSampleProvider_get_id_m9E16910C6A2335F87E6B257D3059A8BBC8D7253A(__this, /*hidden argument*/NULL);
if (!L_0)
{
goto IL_003d;
}
}
{
uint32_t L_1 = AudioSampleProvider_get_id_m9E16910C6A2335F87E6B257D3059A8BBC8D7253A(__this, /*hidden argument*/NULL);
AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9(L_1, (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *)NULL, /*hidden argument*/NULL);
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * L_2 = AudioSampleProvider_get_owner_m822057CE02CF8664D7BF569CDB41D8EB154251FE(__this, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_3 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_2, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_3)
{
goto IL_0035;
}
}
{
uint32_t L_4 = AudioSampleProvider_get_id_m9E16910C6A2335F87E6B257D3059A8BBC8D7253A(__this, /*hidden argument*/NULL);
AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11(L_4, /*hidden argument*/NULL);
}
IL_0035:
{
AudioSampleProvider_set_id_mB98E8435407CAD305BBEAA91B18CBC12562DFAF9(__this, 0, /*hidden argument*/NULL);
}
IL_003d:
{
IL2CPP_RUNTIME_CLASS_INIT(GC_tC1D7BD74E8F44ECCEF5CD2B5D84BFF9AAE02D01D_il2cpp_TypeInfo_var);
GC_SuppressFinalize_m037319A9B95A5BA437E806DE592802225EE5B425(__this, /*hidden argument*/NULL);
return;
}
}
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider::get_id()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR uint32_t AudioSampleProvider_get_id_m9E16910C6A2335F87E6B257D3059A8BBC8D7253A (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method)
{
uint32_t V_0 = 0;
{
uint32_t L_0 = __this->get_U3CidU3Ek__BackingField_1();
V_0 = L_0;
goto IL_000c;
}
IL_000c:
{
uint32_t L_1 = V_0;
return L_1;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::set_id(System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_set_id_mB98E8435407CAD305BBEAA91B18CBC12562DFAF9 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, uint32_t ___value0, const RuntimeMethod* method)
{
{
uint32_t L_0 = ___value0;
__this->set_U3CidU3Ek__BackingField_1(L_0);
return;
}
}
// UnityEngine.Object UnityEngine.Experimental.Audio.AudioSampleProvider::get_owner()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * AudioSampleProvider_get_owner_m822057CE02CF8664D7BF569CDB41D8EB154251FE (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, const RuntimeMethod* method)
{
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * V_0 = NULL;
{
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * L_0 = __this->get_U3CownerU3Ek__BackingField_3();
V_0 = L_0;
goto IL_000c;
}
IL_000c:
{
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * L_1 = V_0;
return L_1;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::set_owner(UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_set_owner_m21FC4073346BFBE33E2B1567ECEC8ECD373B3069 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___value0, const RuntimeMethod* method)
{
{
Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * L_0 = ___value0;
__this->set_U3CownerU3Ek__BackingField_3(L_0);
return;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InvokeSampleFramesAvailable(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InvokeSampleFramesAvailable_m7604AAF1AC01473A29DCDAD1AEC06165504BE832 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, int32_t ___sampleFrameCount0, const RuntimeMethod* method)
{
{
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * L_0 = __this->get_sampleFramesAvailable_6();
if (!L_0)
{
goto IL_0019;
}
}
{
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * L_1 = __this->get_sampleFramesAvailable_6();
int32_t L_2 = ___sampleFrameCount0;
SampleFramesHandler_Invoke_m52F0148F680B36E04A7F850E617FBEF1CA9809FD(L_1, __this, L_2, /*hidden argument*/NULL);
}
IL_0019:
{
return;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InvokeSampleFramesOverflow(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InvokeSampleFramesOverflow_mC81A014388E535569EF02E3DA6B9831B0FB8A8D4 (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * __this, int32_t ___droppedSampleFrameCount0, const RuntimeMethod* method)
{
{
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * L_0 = __this->get_sampleFramesOverflow_7();
if (!L_0)
{
goto IL_0019;
}
}
{
SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * L_1 = __this->get_sampleFramesOverflow_7();
int32_t L_2 = ___droppedSampleFrameCount0;
SampleFramesHandler_Invoke_m52F0148F680B36E04A7F850E617FBEF1CA9809FD(L_1, __this, L_2, /*hidden argument*/NULL);
}
IL_0019:
{
return;
}
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InternalRemove(System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11 (uint32_t ___providerId0, const RuntimeMethod* method)
{
typedef void (*AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11_ftn) (uint32_t);
static AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSampleProvider_InternalRemove_m3CD8E2D57A6DC5522C71436A854926C346CEBF11_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Experimental.Audio.AudioSampleProvider::InternalRemove(System.UInt32)");
_il2cpp_icall_func(___providerId0);
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider::InternalSetScriptingPtr(System.UInt32,UnityEngine.Experimental.Audio.AudioSampleProvider)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9 (uint32_t ___providerId0, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * ___provider1, const RuntimeMethod* method)
{
typedef void (*AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9_ftn) (uint32_t, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *);
static AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (AudioSampleProvider_InternalSetScriptingPtr_m018841DA2C6D92E2322F1D041E4C88A054991AF9_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Experimental.Audio.AudioSampleProvider::InternalSetScriptingPtr(System.UInt32,UnityEngine.Experimental.Audio.AudioSampleProvider)");
_il2cpp_icall_func(___providerId0, ___provider1);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
IL2CPP_EXTERN_C uint32_t DelegatePInvokeWrapper_ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D (ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * __this, uint32_t ___providerId0, intptr_t ___interleavedSampleFrames1, uint32_t ___sampleFrameCount2, const RuntimeMethod* method)
{
typedef uint32_t (CDECL *PInvokeFunc)(uint32_t, intptr_t, uint32_t);
PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method));
// Native function invocation
uint32_t returnValue = il2cppPInvokeFunc(___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2);
return returnValue;
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ConsumeSampleFramesNativeFunction__ctor_m10D2C92ADC2CC0F2731CC790036CF84E7E6E97F6 (ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction::Invoke(System.UInt32,System.IntPtr,System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR uint32_t ConsumeSampleFramesNativeFunction_Invoke_mA644FB7343047BEC754D81AC2AFABDC300DF5D74 (ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * __this, uint32_t ___providerId0, intptr_t ___interleavedSampleFrames1, uint32_t ___sampleFrameCount2, const RuntimeMethod* method)
{
uint32_t result = 0;
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 3)
{
// open
typedef uint32_t (*FunctionPointerType) (uint32_t, intptr_t, uint32_t, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2, targetMethod);
}
else
{
// closed
typedef uint32_t (*FunctionPointerType) (void*, uint32_t, intptr_t, uint32_t, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (targetThis == NULL)
{
typedef uint32_t (*FunctionPointerType) (uint32_t, intptr_t, uint32_t, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2, targetMethod);
}
else if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
result = GenericInterfaceFuncInvoker3< uint32_t, uint32_t, intptr_t, uint32_t >::Invoke(targetMethod, targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2);
else
result = GenericVirtFuncInvoker3< uint32_t, uint32_t, intptr_t, uint32_t >::Invoke(targetMethod, targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
result = InterfaceFuncInvoker3< uint32_t, uint32_t, intptr_t, uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2);
else
result = VirtFuncInvoker3< uint32_t, uint32_t, intptr_t, uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2);
}
}
else
{
typedef uint32_t (*FunctionPointerType) (void*, uint32_t, intptr_t, uint32_t, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(targetThis, ___providerId0, ___interleavedSampleFrames1, ___sampleFrameCount2, targetMethod);
}
}
}
return result;
}
// System.IAsyncResult UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction::BeginInvoke(System.UInt32,System.IntPtr,System.UInt32,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* ConsumeSampleFramesNativeFunction_BeginInvoke_mCFD45D186107B1FD87B1A492904CBCF49DDA28CB (ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * __this, uint32_t ___providerId0, intptr_t ___interleavedSampleFrames1, uint32_t ___sampleFrameCount2, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback3, RuntimeObject * ___object4, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (ConsumeSampleFramesNativeFunction_BeginInvoke_mCFD45D186107B1FD87B1A492904CBCF49DDA28CB_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
void *__d_args[4] = {0};
__d_args[0] = Box(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B_il2cpp_TypeInfo_var, &___providerId0);
__d_args[1] = Box(IntPtr_t_il2cpp_TypeInfo_var, &___interleavedSampleFrames1);
__d_args[2] = Box(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B_il2cpp_TypeInfo_var, &___sampleFrameCount2);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback3, (RuntimeObject*)___object4);
}
// System.UInt32 UnityEngine.Experimental.Audio.AudioSampleProvider_ConsumeSampleFramesNativeFunction::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR uint32_t ConsumeSampleFramesNativeFunction_EndInvoke_m4F91AA6FC2DFEF1495E3BA8D7BF1098C9E043711 (ConsumeSampleFramesNativeFunction_tC1E0B1BFCF2C3D7F87D66FCFA2022369327D931D * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
RuntimeObject *__result = il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
return *(uint32_t*)UnBox ((RuntimeObject*)__result);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SampleFramesHandler__ctor_mFDA0769E55F136D1B8EC8AA4B40EF43069934EB5 (SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method)
{
__this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1));
__this->set_method_3(___method1);
__this->set_m_target_2(___object0);
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler::Invoke(UnityEngine.Experimental.Audio.AudioSampleProvider,System.UInt32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SampleFramesHandler_Invoke_m52F0148F680B36E04A7F850E617FBEF1CA9809FD (SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * __this, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * ___provider0, uint32_t ___sampleFrameCount1, const RuntimeMethod* method)
{
DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11();
Delegate_t** delegatesToInvoke;
il2cpp_array_size_t length;
if (delegateArrayToInvoke != NULL)
{
length = delegateArrayToInvoke->max_length;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0));
}
else
{
length = 1;
delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this);
}
for (il2cpp_array_size_t i = 0; i < length; i++)
{
Delegate_t* currentDelegate = delegatesToInvoke[i];
Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0();
RuntimeObject* targetThis = currentDelegate->get_m_target_2();
RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3());
if (!il2cpp_codegen_method_is_virtual(targetMethod))
{
il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod);
}
bool ___methodIsStatic = MethodIsStatic(targetMethod);
int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod);
if (___methodIsStatic)
{
if (___parameterCount == 2)
{
// open
typedef void (*FunctionPointerType) (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___provider0, ___sampleFrameCount1, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___provider0, ___sampleFrameCount1, targetMethod);
}
}
else if (___parameterCount != 2)
{
// open
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker1< uint32_t >::Invoke(targetMethod, ___provider0, ___sampleFrameCount1);
else
GenericVirtActionInvoker1< uint32_t >::Invoke(targetMethod, ___provider0, ___sampleFrameCount1);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker1< uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___provider0, ___sampleFrameCount1);
else
VirtActionInvoker1< uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___provider0, ___sampleFrameCount1);
}
}
else
{
typedef void (*FunctionPointerType) (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___provider0, ___sampleFrameCount1, targetMethod);
}
}
else
{
// closed
if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___provider0, ___sampleFrameCount1, targetMethod);
}
else if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker2< AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t >::Invoke(targetMethod, targetThis, ___provider0, ___sampleFrameCount1);
else
GenericVirtActionInvoker2< AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t >::Invoke(targetMethod, targetThis, ___provider0, ___sampleFrameCount1);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker2< AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___provider0, ___sampleFrameCount1);
else
VirtActionInvoker2< AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___provider0, ___sampleFrameCount1);
}
}
else
{
typedef void (*FunctionPointerType) (void*, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 *, uint32_t, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___provider0, ___sampleFrameCount1, targetMethod);
}
}
}
}
// System.IAsyncResult UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler::BeginInvoke(UnityEngine.Experimental.Audio.AudioSampleProvider,System.UInt32,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* SampleFramesHandler_BeginInvoke_mE516B77CCC50738663D10DDD2D7BDB4391FDFF92 (SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * __this, AudioSampleProvider_tD5B209D07C5F1D4714F92069F4071068B9BC6913 * ___provider0, uint32_t ___sampleFrameCount1, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback2, RuntimeObject * ___object3, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (SampleFramesHandler_BeginInvoke_mE516B77CCC50738663D10DDD2D7BDB4391FDFF92_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
void *__d_args[3] = {0};
__d_args[0] = ___provider0;
__d_args[1] = Box(UInt32_t4980FA09003AFAAB5A6E361BA2748EA9A005709B_il2cpp_TypeInfo_var, &___sampleFrameCount1);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback2, (RuntimeObject*)___object3);
}
// System.Void UnityEngine.Experimental.Audio.AudioSampleProvider_SampleFramesHandler::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SampleFramesHandler_EndInvoke_mF5305B3BA179CE3C49836790DE3FEB02EB088D28 (SampleFramesHandler_t5179C92AFBB393A85144E9134A862C161726F6AF * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"gbachtel@ucsc.edu"
] | gbachtel@ucsc.edu |
d8589c38420b23df064a6e8633994dbb96d8bcba | 1098b0e92ed560784d0f1e3fe6a580dcdd11d72c | /19年/19.3.10A.cpp | 0cf2e32b8f19ba1675945c09f73583e3ea6e07ef | [] | no_license | kyle-one/ACM | c7f10b36c610c2f23cbc2fe8c4ec227b5b51067f | 3877c7a3803cb06bf071557e4531ea8df88e48ba | refs/heads/master | 2021-06-22T10:58:13.811179 | 2020-12-09T05:38:12 | 2020-12-09T05:38:12 | 158,163,972 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 314 | cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void)
{
int i,j,n,m,k,sum=0,flag=0;
while(scanf("%d%d",&m,&k)!=EOF&&(m!=0||k!=0))
{
sum=0;
flag=0;
while(m>0)
{
sum++;
flag++;
m--;
if(flag>=k)
{
flag=0;
m++;
}
}
printf("%d\n",sum);
}
}
| [
"993841271@qq.com"
] | 993841271@qq.com |
ebad1b46d4cfa353df427be535f869f8c19ceb5b | a96cbdb9aa0d96bc420f0847a8753a6d3f36bc3a | /Lesson_14/Sample8.cpp | f8391197f6c5090fe6b110f2a9f29335ae29da35 | [] | no_license | KamonohashiPerry/cplusplus | e1901842e8a9b711a39c86557d81e9cc42e8b2ab | 970a73df4526c011b9098fcfeb67beab345d71b4 | refs/heads/master | 2023-02-06T16:48:21.376905 | 2020-12-27T06:37:22 | 2020-12-27T06:37:22 | 291,221,882 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 997 | cpp | #include <iostream>
using namespace std;
// Base1クラスの宣言
class Base1{
protected:
int bs1;
public:
Base1(int b1=0){bs1=b1;}
void showBs1();
};
// Base2クラスの宣言
class Base2{
protected:
int bs2;
public:
Base2(int b2=0){bs2=b2;}
void showBs2();
};
// Derivedクラスの宣言 2つのクラスから派生している
class Derived : public Base1, public Base2{
protected:
int dr;
public:
Derived(int d=0){dr=d;}
void showDr();
};
// Base1クラスメンバ関数の定義
void Base1::showBs1()
{
cout << "bs1は" << bs1 << "です。\n";
}
// Base2クラスメンバ関数の定義
void Base2::showBs2()
{
cout << "bs2は" << bs2 << "です。\n";
}
// Derivedクラスメンバ関数の定義
void Derived::showDr()
{
cout << "drは" << dr << "です。\n";
}
int main()
{
Derived drv;
drv.showBs1();
drv.showBs2();
drv.showDr();
return 0;
}
| [
"economics.teru@gmail.com"
] | economics.teru@gmail.com |
262b1d4c3cf6b51683af5bc5357045c053539ed5 | ed360f5c5bd1d351ab648fc0b3d798fbe74d81fa | /RTKBASE/optionssauvepoints.cpp | 8cbae341fd2bf5c8e9d6df43f9c030232404bae6 | [] | no_license | tymiles003/RTKLIB_Touchscreen_GUI | af7a87c47be769840b310492678d8d91e63b9c76 | 7278bffe4430f600458be5f5516fcea78cfbed3c | refs/heads/master | 2020-03-11T03:39:19.995916 | 2018-04-15T23:05:45 | 2018-04-15T23:05:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,555 | cpp | // RTKBASE is a GUI interface for RTKLIB made for the Raspberry pî and a touchscreen
// Copyright (C) 2016
// David ENSG PPMD-2016 (first rtkbase release)
// Francklin N'guyen van <francklin2@wanadoo.fr>
// Sylvain Poulain <sylvain.poulain@giscan.com>
// Vladimir ENSG PPMD-2017 (editable configuration)
// Saif Aati ENSG PPMD-2018 (post processing)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "optionssauvepoints.h"
#include "ui_optionssauvepoints.h"
#include <QFileDialog>
#include <QTextStream>
#include <QFile>
optionssauvepoints::optionssauvepoints(QString filePath,QString pointName, int nummeas, float cyclen, int oldpoint,QString EPSG,QWidget *parent) :
QDialog(parent),
ui(new Ui::optionssauvepoints)
{
ui->setupUi(this);
ui->FilepathLine->setText(filePath);
ui->PointnameLine->setText(pointName);
ui->NummeasBox->setEditText(QString::number(nummeas));
ui->CyclenBox->setEditText(QString::number(cyclen));
ui->OldpointBox->setCurrentIndex(oldpoint);
ui->EPSG_comboBox->setCurrentText(EPSG);
QObject::connect(ui->CancelButton,SIGNAL(clicked()),this,SLOT(Cancel()));
QObject::connect(ui->SaveButton,SIGNAL(clicked()),this,SLOT(Save()));
QObject::connect(ui->FilepathButton,SIGNAL(clicked()),this,SLOT(ChoixFilepath()));
}
optionssauvepoints::~optionssauvepoints()
{
delete ui;
}
void optionssauvepoints::Cancel()
{
this->close();
}
void optionssauvepoints::Save()
{
QStringList options = QStringList();
options<<ui->FilepathLine->text();
options<<ui->PointnameLine->text();
options<<ui->NummeasBox->currentText();
options<<ui->CyclenBox->currentText();
options<<QString::number(ui->OldpointBox->currentIndex());
options<<ui->EPSG_comboBox->currentText();
emit SaveOptions(options);
QFile sauveOptionFile(QString("../RTKBASE/data/SauveOptions"));
QTextStream flux(&sauveOptionFile);
sauveOptionFile.open(QFile::ReadWrite|QFile::Truncate);
flux<<qSetFieldWidth(20)<<left<<"filepath"<<qSetFieldWidth(0)<<"="<<ui->FilepathLine->text()<<endl;
flux<<qSetFieldWidth(20)<<left<<"pointname"<<qSetFieldWidth(0)<<"="<<ui->PointnameLine->text()<<endl;
flux<<qSetFieldWidth(20)<<left<<"nummeas"<<qSetFieldWidth(0)<<"="<<ui->NummeasBox->currentText()<<endl;
flux<<qSetFieldWidth(20)<<left<<"cyclen"<<qSetFieldWidth(0)<<"="<<ui->CyclenBox->currentText()<<endl;
flux<<qSetFieldWidth(20)<<left<<"oldpoint"<<qSetFieldWidth(0)<<"="<<ui->OldpointBox->currentIndex()<<endl;
flux<<qSetFieldWidth(20)<<left<<"EPSG"<<qSetFieldWidth(0)<<"="<<ui->EPSG_comboBox->currentText()<<endl;
sauveOptionFile.close();
this->close();
}
void optionssauvepoints::ChoixFilepath()
{
QString filePath = QFileDialog::getSaveFileName(this,tr("Measure File"),"../RTKBASE/PointsFiles",tr("Text Files (*.txt);;All Files (*)"));
if (filePath!="") ui->FilepathLine->setText(filePath);
}
| [
"francklin2@wanadoo.fr"
] | francklin2@wanadoo.fr |
71d9e8bd05f4304d6e78bd2c9cb880ab63b9a073 | 172d4822dfb15ed4af76d9bbc11d259eabd7018c | /Main.cpp | 56b09d87e3b782f9b4b0020a7bdd7d69a25b3ae9 | [] | no_license | davide-belfiori/parallel_image_processing | 9003240e787c8c75ef2f55c24af3cf83ed269c46 | b95cbaef4b32a1ea53defb76b9231404c0ccfdb6 | refs/heads/main | 2023-02-20T15:00:44.266018 | 2021-01-24T21:20:33 | 2021-01-24T21:20:33 | 326,945,178 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 23,224 | cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <chrono>
#include <fstream>
#include <streambuf>
#include <filesystem>
#include "lyra/lyra.hpp"
#include "CImg.h"
#include "CL/cl.hpp"
#include "FreeImage/FreeImage.h"
using namespace cimg_library;
FIBITMAP* GenericLoader(const char* lpszPathName, FREE_IMAGE_FORMAT &fif, int flag) {
// check the file signature and deduce its format
// (the second argument is currently not used by FreeImage)
fif = FreeImage_GetFileType(lpszPathName, 0);
if (fif == FIF_UNKNOWN) {
// no signature ?
// try to guess the file format from the file extension
fif = FreeImage_GetFIFFromFilename(lpszPathName);
}
// check that the plugin has reading capabilities ...
if ((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) {
// ok, let's load the file
FIBITMAP *dib = FreeImage_Load(fif, lpszPathName, flag);
// unless a bad file format, we are done !
return dib;
}
return NULL;
}
float* loadImageData(std::string filename, int& width, int& height) {
FIBITMAP *dib = NULL;
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
dib = GenericLoader(filename.data(), fif, 0);
if (dib == NULL) {
std::cout << "Cannot open " << filename.data();
exit(2);
}
else {
float*output = NULL;
if (fif != FIF_BMP) {
dib = FreeImage_ConvertTo32Bits(dib);
dib = FreeImage_GetChannel(dib, FICC_RED);
}
if (dib != NULL) {
height = FreeImage_GetHeight(dib);
width = FreeImage_GetWidth(dib);
output = (float*)malloc(width*height * sizeof(float));
int pindex = 0;
for (int y = height - 1; y >= 0; y--) {
BYTE *bits = (BYTE *)FreeImage_GetScanLine(dib, y);
for (int x = 0; x < width; x++) {
float val = (float)bits[x];
output[pindex] = val;
pindex++;
}
}
}
return output;
}
return NULL;
}
// Display image on the screen
void show_img(CImg<> img, const char* wname = "") {
CImgDisplay main_disp(img, wname);
while (!main_disp.is_closed()) {
main_disp.wait();
}
}
void fill_zero(float* data, int width, int hieght) {
for (int i = 0; i < width * hieght; i++) {
data[i] = 0.0f;
}
}
std::string read_kernel_code(const char* filename) {
std::ifstream in(filename, std::ios::in | std::ios::binary);
if (in)
{
std::string contents;
in.seekg(0, std::ios::end);
contents.reserve(in.tellg());
in.seekg(0, std::ios::beg);
contents.assign((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
in.close();
return(contents);
}
std::cout << "Error reading kernel file, check if " << filename << "exists" << std::endl;
exit(3);
}
std::string get_rotation_kernel_code() {
return read_kernel_code("kernel/rot_filter.cl");
}
std::string get_convolution_kernel_code() {
return read_kernel_code("kernel/conv_filter.cl");
}
// Print information about OpenCL platforms and devices
void query_devices() {
std::vector<cl::Platform> all_Platform;
cl::Platform::get(&all_Platform);
if (all_Platform.size() > 0) {
int platform_id = 0;
int device_id = 0;
std::cout << "Number of Platforms: " << all_Platform.size() << std::endl;
for (std::vector<cl::Platform>::iterator it = all_Platform.begin(); it != all_Platform.end(); ++it) {
cl::Platform platform(*it);
std::cout << "Platform ID: " << platform_id++ << std::endl;
std::cout << "Platform Name: " << platform.getInfo<CL_PLATFORM_NAME>() << std::endl;
std::cout << "Platform Vendor: " << platform.getInfo<CL_PLATFORM_VENDOR>() << std::endl;
std::vector<cl::Device> devices;
platform.getDevices(CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_CPU, &devices);
for (std::vector<cl::Device>::iterator it2 = devices.begin(); it2 != devices.end(); ++it2) {
cl::Device device(*it2);
std::cout << "\tDevice " << device_id++ << ": " << std::endl;
std::cout << "\t\tDevice Name: " << device.getInfo<CL_DEVICE_NAME>() << std::endl;
std::cout << "\t\tDevice Type: " << device.getInfo<CL_DEVICE_TYPE>();
std::cout << " (GPU: " << CL_DEVICE_TYPE_GPU << ", CPU: " << CL_DEVICE_TYPE_CPU << ")" << std::endl;
std::cout << "\t\tDevice Vendor: " << device.getInfo<CL_DEVICE_VENDOR>() << std::endl;
std::cout << "\t\tDevice Max Compute Units: " << device.getInfo<CL_DEVICE_MAX_COMPUTE_UNITS>() << std::endl;
std::cout << "\t\tDevice Global Memory: " << device.getInfo<CL_DEVICE_GLOBAL_MEM_SIZE>() << std::endl;
std::cout << "\t\tDevice Max Clock Frequency: " << device.getInfo<CL_DEVICE_MAX_CLOCK_FREQUENCY>() << std::endl;
std::cout << "\t\tDevice Max Allocateable Memory: " << device.getInfo<CL_DEVICE_MAX_MEM_ALLOC_SIZE>() << std::endl;
std::cout << "\t\tDevice Local Memory: " << device.getInfo<CL_DEVICE_LOCAL_MEM_SIZE>() << std::endl;
std::cout << "\t\tDevice Available: " << device.getInfo< CL_DEVICE_AVAILABLE>() << std::endl;
}
std::cout << std::endl;
}
}
else {
std::cout << "No OpenCL platform available" << std::endl;
}
}
// Return number of available OprnCL devices
int count_available_devices() {
std::vector<cl::Platform> all_Platform;
cl::Platform::get(&all_Platform);
int count = 0;
if (all_Platform.size() > 0) {
for (std::vector<cl::Platform>::iterator it = all_Platform.begin(); it != all_Platform.end(); ++it) {
cl::Platform platform(*it);
std::vector<cl::Device> devices;
platform.getDevices(CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_CPU, &devices);
for (int i = 0; i < (int) devices.size(); i++) {
if (devices[i].getInfo< CL_DEVICE_AVAILABLE>()) {
count++;
}
}
}
}
return count;
}
// Check if device with requested ID is avalilable
bool is_device_available(int plat_id, int dev_id) {
std::vector<cl::Platform> all_Platform;
cl::Platform::get(&all_Platform);
if (all_Platform.size() > 0) {
if (plat_id >= 0 && plat_id < (int) all_Platform.size()) {
cl::Platform platform = all_Platform[plat_id];
std::vector<cl::Device> all_devices;
platform.getDevices(CL_DEVICE_TYPE_ALL, &all_devices);
if (dev_id >= 0 && dev_id < (int) all_devices.size()) {
return all_devices[dev_id].getInfo< CL_DEVICE_AVAILABLE>();
}
}
}
return false;
}
// ROTAZIONE SEQUENZIALE
void rotate(float* image, int width, int height,
float theta, float* output) {
float cos_t = cos(theta);
float sin_t = sin(theta);
float a = width / 2.0f;
float b = height / 2.0f;
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
// applichimao le equazioni di rotazione
float target_x = ((float)j - a) * cos_t - ((float)i - b) * sin_t + a;
float target_y = ((float)j - a) * sin_t + ((float)i - b) * cos_t + b;
// verifichiamo se le nuove coordinate rientrano nei limiti dell'immagine
if ((target_x >= 0.0f) && (target_x < (float)width) &&
(target_y >= 0.0f) && (target_y < (float)height)) {
// scriviamo il risultato
output[i * width + j] = image[(int)target_y * width + (int)target_x];
}
}
}
}
// CONVOLUZIONE SEQUENZIALE
float apply_filter(float* image, int width, int height,
float* filter, int filter_size, int y, int x) {
float new_pixel = 0.0f;
int half_filter_size = filter_size / 2;
int y_coord = 0;
int x_coord = 0;
int filterIndex = 0;
for (int i = -half_filter_size; i <= half_filter_size; i++) {
y_coord = std::min(height - 1, std::max(y + i, 0));
for (int j = -half_filter_size; j <= half_filter_size; j++) {
x_coord = std::min(width - 1, std::max(x + j, 0));
float srcPx = image[y_coord * width + x_coord];
new_pixel += srcPx * filter[filterIndex];
filterIndex++;
}
}
return std::min(255.0f, std::max(new_pixel, 0.0f));
}
void convolution2D(float* image, int width, int height,
float* filter, int filter_size, float* output) {
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
// calcolo e scrittura del nuovo pixel
float new_pixel = apply_filter(image, width, height, filter, filter_size, i, j);
output[i * width + j] = new_pixel;
}
}
}
// ROTAZIONE PARALLELA
void p_rotate(float* image, int width, int height, float theta, float* output, int platform_id = 0, int dev_id = 0, bool verbose = true) {
// otteniamo le piattaforme disponibili sulla macchina
std::vector<cl::Platform> all_Platform;
cl::Platform::get(&all_Platform);
cl::Platform platform;
if (platform_id < 0 || platform_id >= (int) all_Platform.size()) {
if (verbose)
std::cout << "Platform ID " << platform_id << " not found, using default" << std::endl;
platform = all_Platform[0];
}
else {
if(verbose)
std::cout << "Using platform ID " << platform_id << std::endl;
platform = all_Platform[platform_id];
}
// otteniamo tutti i dispositivi della piattaforma
std::vector<cl::Device> all_devices;
platform.getDevices(CL_DEVICE_TYPE_ALL, &all_devices);
// selezioniamo il primo dispositivo disponibile
cl::Device dev;
if (dev_id < 0 || dev_id >= (int) all_devices.size()) {
if (verbose)
std::cout << "Device ID " << dev_id << " not found, using default" << std::endl;
dev = all_devices[0];
}
else {
if (verbose)
std::cout << "Using device ID " << dev_id << std::endl;
dev = all_devices[dev_id];
}
cl::Context context({ dev });
cl::Program::Sources sources;
std::string src_code = get_rotation_kernel_code();
sources.push_back({ src_code.c_str(), src_code.length() });
cl::Program program(context, sources);
program.build({ dev });
// dichiariamo che l'immagine ha un solo canale
// e che i pixel hanno valori di tipo float
cl::ImageFormat image_format(CL_R, CL_FLOAT);
// buffer per l'immagine sorgente
cl::Image2D inputImage(context,
CL_MEM_READ_ONLY, image_format,
width, height,
0, NULL);
// buffer per l'immagine destinazione
cl::Image2D outputImage(context,
CL_MEM_WRITE_ONLY, image_format,
width, height,
0, NULL);
cl::CommandQueue queue(context, dev);
cl::size_t<3> origin;
origin[0] = 0;
origin[1] = 0;
origin[2] = 0;
cl::size_t<3> region;
region[0] = width;
region[1] = height;
region[2] = 1;
queue.enqueueWriteImage(inputImage, CL_TRUE, origin, region,
width * sizeof(float),
0, image);
cl::Kernel kernel(program, "rot_filter");
kernel.setArg(0, inputImage);
kernel.setArg(1, outputImage);
kernel.setArg(2, theta);
kernel.setArg(3, width);
kernel.setArg(4, height);
queue.enqueueNDRangeKernel(kernel, cl::NullRange,
cl::NDRange(width, height),
cl::NullRange);
queue.finish();
queue.enqueueReadImage(outputImage, CL_TRUE,
origin, region,
width * sizeof(float), 0,
(void*)output);
}
// CONVOLUZIONE PARALLELA
void p_convolution2D(float* image, int width, int height, float* filter, int filter_size, float* output, int platform_id = 0, int dev_id = 0, bool verbose = true) {
// otteniamo le piattaforme disponibili sulla macchina
std::vector<cl::Platform> all_Platform;
cl::Platform::get(&all_Platform);
cl::Platform platform;
if (platform_id < 0 || platform_id >= (int) all_Platform.size()) {
if (verbose)
std::cout << "Platform ID " << platform_id << " not found, using default" << std::endl;
platform = all_Platform[0];
}
else {
if (verbose)
std::cout << "Using platform ID " << platform_id << std::endl;
platform = all_Platform[platform_id];
}
// otteniamo tutti i dispositivi della piattaforma
std::vector<cl::Device> all_devices;
platform.getDevices(CL_DEVICE_TYPE_ALL, &all_devices);
// selezioniamo il primo dispositivo disponibile
cl::Device dev;
if (dev_id < 0 || dev_id >= (int) all_devices.size()) {
if (verbose)
std::cout << "Device ID " << dev_id << " not found, using default" << std::endl;
dev = all_devices[0];
}
else {
if (verbose)
std::cout << "Using device ID " << dev_id << std::endl;
dev = all_devices[dev_id];
}
cl::Context context({ dev });
cl::Program::Sources sources;
std::string src_code = get_convolution_kernel_code();
sources.push_back({ src_code.c_str(), src_code.length() });
cl::Program program(context, sources);
program.build({ dev });
cl::ImageFormat image_format(CL_R, CL_FLOAT);
// buffer immagini
cl::Image2D inputImage(context,
CL_MEM_READ_ONLY, image_format,
width, height,
0, NULL);
cl::Image2D outputImage(context,
CL_MEM_WRITE_ONLY, image_format,
width, height,
0, NULL);
// buffer filtro
cl::Buffer filter_buffer(context, CL_MEM_READ_WRITE,
sizeof(float) * filter_size*filter_size);
cl::CommandQueue queue(context, dev);
cl::size_t<3> origin;
origin[0] = 0;
origin[1] = 0;
origin[2] = 0;
cl::size_t<3> region;
region[0] = width;
region[1] = height;
region[2] = 1;
// riempimento buffer immagine sorgente
queue.enqueueWriteImage(inputImage, CL_TRUE, origin, region,
width * sizeof(float), 0, image);
// riempimento buffer filtro
queue.enqueueWriteBuffer(filter_buffer, CL_TRUE, 0,
sizeof(float) * filter_size*filter_size,
filter);
cl::Kernel kernel(program, "conv_filter");
kernel.setArg(0, inputImage);
kernel.setArg(1, outputImage);
kernel.setArg(2, filter_buffer);
kernel.setArg(3, filter_size);
queue.enqueueNDRangeKernel(kernel, cl::NullRange,
cl::NDRange(width, height),
cl::NullRange);
queue.finish();
queue.enqueueReadImage(outputImage, CL_TRUE,
origin, region,
width * sizeof(float), 0,
(void*)output);
}
float sobel[9] = { -1, 0, 1,
-2, 0, 2,
-1, 0, 1 };
// BENCHMARK FUNCTIONS
void benchmark_rotation(std::vector<std::string> filenames, int platform_id = 0, int dev_id = 0) {
std::cout << "ROTATION Benchmark Result (time expressed in seconds) \n\n";
std::cout << "***************************************************************************\n\n";
std::cout << " Image (image size) --> Sequential Execution Time || Parallel Execution Time \n\n";
std::cout << "***************************************************************************\n\n";
for (int i = 0; i < (int) filenames.size(); i++) {
std::string filename = filenames[i];
int width = 0;
int height = 0;
float* image = loadImageData(filename, width, height);
if (image != NULL) {
float* output = (float*)malloc(sizeof(float) * width * height);
fill_zero(output, width, height);
// Sequential Execution
auto t1 = std::chrono::high_resolution_clock::now();
rotate(image, width, height, M_PI_4, output);
auto t2 = std::chrono::high_resolution_clock::now();
float exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
std::cout << filename << " (" << width << " x " << height << ") --> " << exec_time;
// Parallel Execution
t1 = std::chrono::high_resolution_clock::now();
p_rotate(image, width, height, M_PI_4, output, platform_id, dev_id, false);
t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
std::cout << " || " << exec_time << "\n";
}
else {
std::cerr << "Error in reading " << filename.data() << std::endl;
}
}
}
void benchmark_convolution(std::vector<std::string> filenames, int platform_id = 0, int dev_id = 0) {
std::cout << "CONVOLUTION Benchmark Result (time expressed in seconds) \n\n";
std::cout << "***************************************************************************\n\n";
std::cout << " Image (image size) --> Sequential Execution Time || Parallel Execution Time \n\n";
std::cout << "***************************************************************************\n\n";
for (int i = 0; i < (int)filenames.size(); i++) {
std::string filename = filenames[i];
int width = 0;
int height = 0;
float* image = loadImageData(filename, width, height);
if (image != NULL) {
float* output = (float*)malloc(sizeof(float) * width * height);
fill_zero(output, width, height);
// Sequential Execution
auto t1 = std::chrono::high_resolution_clock::now();
convolution2D(image, width, height, sobel, 3, output);
auto t2 = std::chrono::high_resolution_clock::now();
float exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
std::cout << filename << " (" << width << " x " << height << ") --> " << exec_time;
// Parallel Execution
t1 = std::chrono::high_resolution_clock::now();
p_convolution2D(image, width, height, sobel, 3, output, platform_id, dev_id, false);
t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
std::cout << " || " << exec_time << "\n";
}
else {
std::cerr << "Error in reading " << filename.data() << std::endl;
}
}
}
// CLI COMMAD DEFINITION
struct rotation_cmd {
std::string rot_target = "";
float deg = 90.0f;
bool parallel = false;
std::string dst_filename = "";
bool show_help = true;
int plat_id = 0;
int dev_id = 0;
rotation_cmd(lyra::cli &cli) {
cli.add_argument(
lyra::command("rotate", [this](const lyra::group & g) { this->run(g); })
.help("Rotate given image")
.add_argument(lyra::help(show_help))
.add_argument(lyra::arg(rot_target, "image").required())
.add_argument(lyra::opt(deg,"degrees")
.name("-d")
.name("--deg")
.optional()
.help("Rotation degrees (default = 90°)"))
.add_argument(lyra::opt(parallel)
.name("-p")
.optional()
.help("Perform parallel rotation"))
.add_argument(lyra::opt(plat_id, "platform id")
.name("--plat-id")
.optional()
.help("OpenCL platform ID"))
.add_argument(lyra::opt(dev_id, "device id")
.name("--dev-id")
.optional()
.help("OpenCL device ID"))
.add_argument(lyra::opt(dst_filename, "path")
.name("--save")
.optional()
.help("Save rotation result"))
);
}
void run(const lyra::group & g) {
float exec_time = 0.0f;
int width = 0;
int height = 0;
float* image = loadImageData(rot_target, width, height);
if(image == NULL){
std::cerr << "Error in reading input file" << std::endl;
exit(2);
}
float* output = (float*)malloc(sizeof(float) * width * height);
fill_zero(output, width, height);
float rad = deg * M_PI / 180;
if (parallel) {
if (count_available_devices() <= 0) {
std::cout << "No OpenCL devices available, cannot perform parallel operation" << std::endl;
exit(11);
}
auto t1 = std::chrono::high_resolution_clock::now();
p_rotate(image, width, height, rad, output, plat_id, dev_id);
auto t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
}
else {
auto t1 = std::chrono::high_resolution_clock::now();
rotate(image, width, height, rad, output);
auto t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
}
std::cout << "Image size = " << width << " x " << height << std::endl;
std::cout << "Execution time: " << exec_time << " s" << std::endl;
CImg<float> result(output, width, height, 1, 1);
if (dst_filename != "") {
result.save(dst_filename.data());
}
else {
show_img(result, "Rotation Result");
}
}
};
struct filter_cmd {
std::string filter_target = "";
bool parallel = false;
std::string dst_filename = "";
bool show_help = true;
int plat_id = 0;
int dev_id = 0;
filter_cmd(lyra::cli &cli) {
cli.add_argument(
lyra::command("filter", [this](const lyra::group & g) { this->run(g); })
.help("Filter given image")
.add_argument(lyra::help(show_help))
.add_argument(lyra::arg(filter_target, "image").required())
.add_argument(lyra::opt(parallel)
.name("-p")
.optional()
.help("Perform parallel filtering"))
.add_argument(lyra::opt(plat_id, "platform id")
.name("--plat-id")
.optional()
.help("OpenCL platform ID"))
.add_argument(lyra::opt(dev_id, "device id")
.name("--dev-id")
.optional()
.help("OpenCL device ID"))
.add_argument(lyra::opt(dst_filename, "path")
.name("--save")
.optional()
.help("Save filter result"))
);
}
void run(const lyra::group & g) {
float exec_time = 0.0f;
int width = 0;
int height = 0;
float* image = loadImageData(filter_target, width, height);
if (image == NULL) {
std::cerr << "Error in reading input file" << std::endl;
exit(2);
}
float* output = (float*)malloc(sizeof(float) * width * height);
fill_zero(output, width, height);
if (parallel) {
if (count_available_devices() <= 0) {
std::cout << "No OpenCL devices available, cannot perform parallel operation" << std::endl;
exit(11);
}
auto t1 = std::chrono::high_resolution_clock::now();
p_convolution2D(image, width, height, sobel, 3, output, plat_id, dev_id);
auto t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
}
else {
auto t1 = std::chrono::high_resolution_clock::now();
convolution2D(image, width, height, sobel, 3, output);
auto t2 = std::chrono::high_resolution_clock::now();
exec_time = std::chrono::duration_cast<std::chrono::duration<float>>(t2 - t1).count();
}
std::cout << "Image size = " << width << " x " << height << std::endl;
std::cout << "Execution time: " << exec_time << " s" <<std::endl;
CImg<float> result(output, width, height, 1, 1);
if (dst_filename != "") {
result.save(dst_filename.data());
}
else {
show_img(result, "Filter Result");
}
}
};
struct benchmark_cmd {
std::vector<std::string> benchmark_images;
int plat_id = 0;
int dev_id = 0;
benchmark_cmd(lyra::cli &cli) {
cli.add_argument(
lyra::command("benchmark", [this](const lyra::group & g) { this->run(g); })
.help("Perform execution time comparison between sequential and parallel approach to rotation and convolution")
.add_argument(lyra::opt(plat_id, "platform id")
.name("--plat-id")
.optional()
.help("OpenCL platform ID"))
.add_argument(lyra::opt(dev_id, "device id")
.name("--dev-id")
.optional()
.help("OpenCL device ID"))
.add_argument(lyra::arg(benchmark_images, "images").required()));
}
void run(const lyra::group & g) {
if (!is_device_available(plat_id, dev_id)) {
std::cout << "Device ID " << dev_id << " not available for Platform ID " << plat_id << std::endl;
std::cout << "Please check available devices using 'oclinfo' command" << std::endl;
exit(10);
}
benchmark_rotation(benchmark_images, plat_id, dev_id);
std::cout << "\n\n";
benchmark_convolution(benchmark_images, plat_id, dev_id);
}
};
struct query_cmd {
query_cmd(lyra::cli &cli) {
cli.add_argument(
lyra::command("oclinfo", [this](const lyra::group & g) { this->run(g); })
.help("Show information about OpenCL platforms and devices available on this machine"));
}
void run(const lyra::group & g) {
query_devices();
}
};
int main(int argc, const char** args) {
auto cli = lyra::cli();
bool show_help = false;
cli.add_argument(lyra::help(show_help));
rotation_cmd rot_cmd{ cli };
filter_cmd filter_cmd{ cli };
benchmark_cmd benchmark_cmd { cli };
query_cmd q_cmd{ cli };
auto result = cli.parse({ argc, args });
if (!result)
{
std::cerr << "Error in command line: " << result.errorMessage() << std::endl;
exit(1);
}
if (show_help) {
std::cout << cli;
}
exit(0);
}
| [
"davidebelfiori@gmail.com"
] | davidebelfiori@gmail.com |
953b58b38e8b2db5d0de70cd11c1855425b20f26 | 6f998bc0963dc3dfc140475a756b45d18a712a1e | /PS_LevelEditor/LevelEditor/Renderer/PS Engine/PS/States/CAudioOptionsStates.h | 8c6b6b0728af3cc54a28b281629edf375260d372 | [] | no_license | iomeone/PudgeNSludge | d4062529053c4c6d31430e74be20e86f9d04e126 | 55160d94f9ef406395d26a60245df1ca3166b08d | refs/heads/master | 2021-06-11T09:45:04.035247 | 2016-05-25T05:57:08 | 2016-05-25T05:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,902 | h | /////////////////////////////////////////////////////////////////////////////////////////////////////
// Class Name: CAudioOptionsState
// Purpose: To control audio levels for our game
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef CAUDIOOPTIONSSTATE_H_
#define CAUDIOOPTIONSSTATE_H_
#include "IGameState.h"
#include "../../Utilities/MathLib/vec2.h"
enum eAUDIO_ITEMS{ AUDIO_SFX, AUDIO_MUSIC, AUDIO_DIALOGUE, AUDIO_EXIT };
#define AMENU_MIN_X 0.374065f
#define AMENU_MAX_X 0.855362f
#define ASFX_MIN_Y 0.710723f
#define ASFX_MAX_Y 0.940150f
#define AMUSIC_MIN_Y 0.431421f
#define AMUSIC_MAX_Y 0.638404f
#define ADIALOGUE_MIN_Y 0.162095f
#define ADIALOGUE_MAX_Y 0.384040f
#define AEXIT_MIN_Y 0.0f
#define AEXIT_MAX_Y 0.099751f
#define ASLIDER_WIDTH 0.030f
#define ASLIDER_HEIGHT 0.075f
#define ASLIDER_BAR_WIDTH 0.4255f
#define ASLIDER_MAX 0.8105f
#define ASLIDER_MIN 0.385f
#define ASLIDER_DOWN_WIDTH 0.025f
#define ASLIDER_DOWN_HEIGHT 0.070f
#define ASLIDER_DOWN_MAX 0.81f
#define ASLIDER_DOWN_MIN 0.3845f
#define ASLIDER_SFX_POSY 0.725f
#define ASLIDER_MUSIC_POSY 0.456f
#define ASLIDER_DIALOGUE_POSY 0.184f
class CGame;
class CInputManager;
class CAudioManager;
__declspec(align(32))
class CAudioOptionsState : public IGameState
{
private:
static CAudioOptionsState* m_pInstance;
CGame* m_pGame;
CInputManager* m_pInput;
CAudioManager* m_pAudio;
float m_fPlayTimer;
int m_nCurrentlySelected;
LPDIRECT3DTEXTURE9 m_lpCurrentSelection;
//TEXTURES TO RENDER
// Backgrounds
LPDIRECT3DTEXTURE9 m_lpOptionsAudioSound;
LPDIRECT3DTEXTURE9 m_lpOptionsAudioMusic;
LPDIRECT3DTEXTURE9 m_lpOptionsAudioDiag;
LPDIRECT3DTEXTURE9 m_lpOptionsAudioExit;
LPDIRECT3DTEXTURE9 m_lpOptionsSlider;
LPDIRECT3DTEXTURE9 m_nReticle;
// mouse vector
D3DXVECTOR4 _mousePos;
// SFX slider position
vec2f m_fSFXSliderPosVec;
// Music slider position
vec2f m_fMusicSliderPosVec;
// Dialogue slider position
vec2f m_fDialogueSliderPosVec;
bool m_bPrevDown;
private:
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: COptionsState
// Purpose: Default Constructor.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
CAudioOptionsState();
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: ~COptionsState
// Purpose: Default Destructor.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
~CAudioOptionsState();
////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: COptionsState Copy Constructor
// Purpose: Default copy constructor.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
CAudioOptionsState( const CAudioOptionsState& obj );
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: operator =
// Purpose: Assignment Operator.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
CAudioOptionsState& operator = ( const CAudioOptionsState& obj);
public:
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: GetInstance
// Purpose: Returns the instance of the Main Menu.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
static CAudioOptionsState* GetInstance ();
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: DeleteInstance
// Purpose: Deletes the instance of the Main Menu.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
static void DeleteInstance ();
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: Init
// Purpose: Initializes the state.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
void Init(void);
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: Shutdown
// Purpose: Shuts down the state.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
void Shutdown();
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: Update
// Purpose: Updates the state.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
void Update(float fTime);
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: Input
// Purpose: Gets input to update the state.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
bool Input();
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name: Render
// Purpose: Render the state.
// Original Author: Rueben Massey
// Creation Date: 5/30/2012
// Last Modification By:
// Last Modification Date:
/////////////////////////////////////////////////////////////////////////////////////////////////////
void Render();
};
#endif // CAUDIOOPTIONSSTATE_H_ | [
"ethanthecrazy@gmail.com"
] | ethanthecrazy@gmail.com |
fcd5510a2bac81ffe6b089d4b634c01a7afff845 | 26b9c425005930d600c67eee5979b26a38ec8f7f | /src/arduino/rotery_encoder_graph/rotery_encoder_graph.ino | a8648e30e6933f809f0fe7a37bc3e85202b708b1 | [] | no_license | dmccreary/moving-rainbow | c32f7a8473cf507d72c93f903b60b4fce48264e4 | c8bb924381052736102fbbdd9a99efe2bbd5ecd7 | refs/heads/master | 2023-08-03T05:45:52.642240 | 2023-08-01T19:52:45 | 2023-08-01T19:52:45 | 25,079,415 | 15 | 9 | null | 2019-03-13T01:10:51 | 2014-10-11T13:37:23 | C++ | UTF-8 | C++ | false | false | 1,829 | ino | //From bildr article: http://bildr.org/2012/08/rotary-encoder-arduino/
// these pins cannot be changed. Pins 2 and 3 are the interrupt pins
int encoderPin1 = 2;
int encoderPin2 = 3;
volatile int lastEncoded = 0;
volatile long encoderValue = 0;
volatile long newValue4 = 0; // 1/4 the value of the encoder
long lastencoderValue = 0;
int lastMSB = 0;
int lastLSB = 0;
void setup() {
Serial.begin (9600);
pinMode(encoderPin1, INPUT);
pinMode(encoderPin2, INPUT);
digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
digitalWrite(encoderPin2, HIGH); //turn pullup resistor on
//call updateEncoder() when any high/low changed seen
//on interrupt 0 (pin 2), or interrupt 1 (pin 3)
attachInterrupt(0, updateEncoder, CHANGE);
attachInterrupt(1, updateEncoder, CHANGE);
}
void loop(){
// this gets a new click every 4th change in value - cuts down noise
if (newValue4 != encoderValue / 4) {
/*
Serial.print("e=");
Serial.print(encoderValue);
Serial.print(" n4=");
Serial.print(newValue4);
Serial.print(" e/4=");
Serial.println(encoderValue / 4);
*/
for (int i=0; i<=abs(newValue4); i++) {
Serial.print("=");
}
Serial.println("");
newValue4 = encoderValue / 4;
}
}
void updateEncoder(){
int MSB = digitalRead(encoderPin1); //MSB = most significant bit
int LSB = digitalRead(encoderPin2); //LSB = least significant bit
int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
int sum = (lastEncoded << 2) | encoded; //adding it to the previous encoded value
if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;
lastEncoded = encoded; //store this value for next time
}
| [
"dan.mccreary@gmail.com"
] | dan.mccreary@gmail.com |
f26fa5816c0dc0ca549dcb919ffc21669d1fa900 | b137f5bb9d3b77266f46073bc2da72bf445854d6 | /o56_apr23_cellsales.cpp | d4fadf549ba17aa2eb2357401b7f3f5e7dc0f985 | [] | no_license | killzdesu/cpp-archive | 307fa05be71618f2a64b3c852078eef88696da86 | 70f62a7bbc2f3398ac28818849841f18b1145f91 | refs/heads/master | 2023-04-08T20:16:57.460572 | 2021-04-20T06:23:31 | 2021-04-20T06:23:31 | 359,705,314 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,352 | cpp | #define fi first
#define se second
#define REP(_x, _y) for(_x=0;_x<_y;_x++)
#define REPI(_x, _y) for(_x=1;_x<=_y;_x++)
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define ll long long
#define EL printf("\n");
#define DB if(DBG)printf
#define IT iterator
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<map>
#include<queue>
#include<algorithm>
#include<vector>
#include<iostream>
#include<cmath>
using namespace std;
int DBG=1;
int i, n, k, N, M, K;
struct trip{
int x, y, z;
trip(){}
trip(int a, int b, int c){
x = a; y = b; z = c;
}
bool operator < (const trip &b) const{
if(x!=b.x)return x > b.x;
if(x!=b.y)return y > b.y;
return z > b.z;
}
}T[100010];
struct tree{
int val;
int lo, hi;
};
struct segment_tree{
tree m[100010*6];
void init(int key, int lo, int hi){
m[key].val = -1;
m[key].lo = lo;
m[key].hi = hi;
if(lo == hi-1)return;
init(key*2, lo, (lo+hi)/2);
init(key*2+1, (lo+hi)/2, hi);
}
void update(int key, int t, int val){
//if(m[key].lo <= t and t < )
if(m[key].lo > t or t >= m[key].hi) return;
if(m[key].lo == m[key].hi-1){
m[key].val = val;
return;
}
update(key*2, t, val);
update(key*2+1, t, val);
m[key].val = max(m[key*2].val, m[key*2+1].val);
}
int query(int key, int lo, int hi){
if(m[key].hi <= lo or hi <= m[key].lo) return -2e9;
if(lo <= m[key].lo and m[key].hi <= hi) return m[key].val;
return max(query(key*2, lo, hi), query(key*2+1, lo, hi));
}
void trav(int key){
printf("%d %d %d\n", m[key].lo, m[key].hi, m[key].val);
if(m[key].lo == m[key].hi-1) return;
trav(key*2);
trav(key*2+1);
}
}sg;
vector<int> z;
int main(){
int a, b, c, d;
cin >> N;
REP(a, N){
scanf("%d %d %d", &T[a].x, &T[a].y, &T[a].z);
z.pb(T[a].y);
}
sort(z.begin(), z.end());
z.resize(distance(z.begin(), unique(z.begin(), z.end())));
sg.init(1, 0, z.size());
sort(T, T+N);
REP(a, N){
c = distance(z.begin(), lower_bound(z.begin(), z.end(), T[a].y));
d = sg.query(1, c, z.size());
if(d >= T[a].z) k++;
sg.update(1, c, max(T[a].z, sg.query(1, c, c+1)));
}
cout << k;
return 0;
}
| [
"killzdesu@gmail.com"
] | killzdesu@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.