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 905
values | visit_date
timestamp[us]date 2015-08-09 11:21:18
2023-09-06 10:45:07
| revision_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-17 19:19:19
| committer_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-06 06:22:19
| github_id
int64 3.89k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us]date 2012-06-07 00:51:45
2023-09-14 21:58:39
⌀ | gha_created_at
timestamp[us]date 2008-03-27 23:40:48
2023-08-21 23:17:38
⌀ | gha_language
stringclasses 141
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 115
values | content
stringlengths 3
10.4M
| authors
listlengths 1
1
| author_id
stringlengths 0
158
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e241d36fa09ce2aac38ea4d209fc9c21b507691f
|
8567438779e6af0754620a25d379c348e4cd5a5d
|
/services/video_capture/test/mock_device_factory.cc
|
8fe10777a5fe125f199056825add7aad03ff3dca
|
[
"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
| 2,744
|
cc
|
// Copyright 2016 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 "base/memory/ptr_util.h"
#include "services/video_capture/test/mock_device_factory.h"
namespace {
// Report a single hard-coded supported format to clients.
media::VideoCaptureFormat kSupportedFormat(gfx::Size(),
25.0f,
media::PIXEL_FORMAT_I420,
media::PIXEL_STORAGE_CPU);
class RawPointerVideoCaptureDevice : public media::VideoCaptureDevice {
public:
explicit RawPointerVideoCaptureDevice(media::VideoCaptureDevice* device)
: device_(device) {}
// media::VideoCaptureDevice:
void AllocateAndStart(const media::VideoCaptureParams& params,
std::unique_ptr<Client> client) override {
device_->AllocateAndStart(params, std::move(client));
}
void RequestRefreshFrame() override { device_->RequestRefreshFrame(); }
void StopAndDeAllocate() override { device_->StopAndDeAllocate(); }
void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override {
device_->GetPhotoCapabilities(std::move(callback));
}
void SetPhotoOptions(media::mojom::PhotoSettingsPtr settings,
SetPhotoOptionsCallback callback) override {
device_->SetPhotoOptions(std::move(settings), std::move(callback));
}
void TakePhoto(TakePhotoCallback callback) override {
device_->TakePhoto(std::move(callback));
}
private:
media::VideoCaptureDevice* device_;
};
} // anonymous namespace
namespace video_capture {
MockDeviceFactory::MockDeviceFactory() = default;
MockDeviceFactory::~MockDeviceFactory() = default;
void MockDeviceFactory::AddMockDevice(
media::VideoCaptureDevice* device,
const media::VideoCaptureDeviceDescriptor& descriptor) {
devices_[descriptor] = std::move(device);
}
std::unique_ptr<media::VideoCaptureDevice> MockDeviceFactory::CreateDevice(
const media::VideoCaptureDeviceDescriptor& device_descriptor) {
if (devices_.find(device_descriptor) == devices_.end())
return nullptr;
return base::MakeUnique<RawPointerVideoCaptureDevice>(
devices_[device_descriptor]);
}
void MockDeviceFactory::GetDeviceDescriptors(
media::VideoCaptureDeviceDescriptors* device_descriptors) {
for (const auto& entry : devices_)
device_descriptors->push_back(entry.first);
}
void MockDeviceFactory::GetSupportedFormats(
const media::VideoCaptureDeviceDescriptor& device_descriptor,
media::VideoCaptureFormats* supported_formats) {
supported_formats->push_back(kSupportedFormat);
}
} // namespace video_capture
|
[
"hedonist.ky@gmail.com"
] |
hedonist.ky@gmail.com
|
80ddd28f23029c7a03fdb5e21ad5932e5d7b78bc
|
e6a786a977ed0798c677950a4ade5346731e93c4
|
/src/Magnum/OpenDdl/Implementation/Parsers.h
|
278072b4bec1f4f08e38496ba6c1a9cb32a9672b
|
[
"MIT"
] |
permissive
|
theg4sh/magnum-plugins
|
fcc10f46b70dc7bf2bc1c74caf469bcfcfdb323c
|
e07bc2e579145ce1d4ef7411cf92284d7377132c
|
refs/heads/master
| 2020-04-12T10:33:26.073191
| 2018-12-14T21:08:08
| 2018-12-14T21:08:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,741
|
h
|
#ifndef Magnum_OpenDdl_Implementation_parsers_h
#define Magnum_OpenDdl_Implementation_parsers_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <string>
#include <tuple>
#include <Corrade/Containers/ArrayView.h>
#include <Magnum/Magnum.h>
#include "Magnum/OpenDdl/OpenDdl.h"
namespace Magnum { namespace OpenDdl { namespace Implementation {
enum class InternalPropertyType: UnsignedByte;
enum class ParseErrorType: UnsignedInt {
NoError,
InvalidEscapeSequence,
InvalidIdentifier,
InvalidName,
InvalidCharacterLiteral,
InvalidLiteral,
InvalidPropertyValue,
InvalidSubArraySize,
LiteralOutOfRange,
ExpectedIdentifier,
ExpectedName,
ExpectedLiteral,
ExpectedSeparator,
ExpectedListStart,
ExpectedListEnd,
ExpectedArraySizeEnd,
ExpectedPropertyValue,
ExpectedPropertyAssignment,
ExpectedPropertyListEnd
};
Debug& operator<<(Debug& debug, ParseErrorType value);
struct ParseError {
/*implicit*/ constexpr ParseError(): error{ParseErrorType::NoError}, type{}, position{} {}
/*implicit*/ constexpr ParseError(ParseErrorType error, Type type, const char* position = nullptr): error{error}, type{type}, position{position} {}
/*implicit*/ constexpr ParseError(ParseErrorType error, const char* position = nullptr): error{error}, type{}, position{position} {}
ParseErrorType error;
Type type;
const char* position;
};
bool equals(Containers::ArrayView<const char> a, Containers::ArrayView<const char> b);
template<std::size_t size> const char* findLastOf(Containers::ArrayView<const char> data, const char(&characters)[size]) {
for(const char* c = data.end(); c != data.begin(); --c)
for(std::size_t i = 0; i != size - 1; ++i)
if(*(c - 1) == characters[i]) return c - 1;
return data.begin();
}
const char* whitespace(Containers::ArrayView<const char> data);
std::pair<const char*, char> escapedChar(Containers::ArrayView<const char> data, ParseError& error);
const char* escapedUnicode(Containers::ArrayView<const char> data, std::string& out, ParseError& error);
const char* identifier(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, bool> boolLiteral(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, char> characterLiteral(Containers::ArrayView<const char> data, ParseError& error);
template<class T> std::tuple<const char*, T, Int> integralLiteral(Containers::ArrayView<const char> data, std::string& buffer, ParseError& error);
template<class T> std::pair<const char*, T> floatingPointLiteral(Containers::ArrayView<const char> data, std::string& buffer, ParseError& error);
std::pair<const char*, std::string> stringLiteral(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, std::string> nameLiteral(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, Containers::ArrayView<const char>> referenceLiteral(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, Type> possiblyTypeLiteral(Containers::ArrayView<const char> data);
std::pair<const char*, Type> typeLiteral(Containers::ArrayView<const char> data, ParseError& error);
std::pair<const char*, InternalPropertyType> propertyValue(Containers::ArrayView<const char> data, bool& boolValue, Int& integerValue, Float& floatingPointValue, std::string& stringValue, Containers::ArrayView<const char>& referenceValue, Type& typeValue, std::string& buffer, ParseError& error);
}}}
#endif
|
[
"mosra@centrum.cz"
] |
mosra@centrum.cz
|
7c39885b0cc7202bd60fdb576f7188731ba00e0f
|
b771b54b2186263770066aab1ab474b945640033
|
/src/apps/run_experiments/src/verifier_action_generator.hpp
|
1e7828867c4734ebf10e3fc059a456ccc20214c4
|
[
"MIT"
] |
permissive
|
boazsade/machine_learinig_models
|
d13228ac64ab5547c312505be6147d41a81e6523
|
eb1f9eda0e4e25a6d028b25682dfb20628a20624
|
refs/heads/master
| 2020-04-13T01:36:08.251215
| 2018-12-23T12:37:55
| 2018-12-23T12:37:55
| 162,878,744
| 2
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,364
|
hpp
|
#include "apps/run_experiments/verifiers_action.h"
#include "apps/run_experiments/verifiers_task.h"
#include "libs/scores_evaluation/verifiers.h"
#include "libs/scores_evaluation/verifier_types.h"
#include "libs/model_datatypes/model_types_io.h"
#include "logging.h"
//namespace detail
//{
namespace
{
inline verify_action::action_type::result_type
generate(verify_action::action_type::arg_type type)
{
switch (type) {
case MSE:
return verify_action::action_type::result_type{MSE_test{}};
case log_loss:
return verify_action::action_type::result_type{logistic_loss{}};
case AUC_ROC_t:
return verify_action::action_type::result_type{AUC_ROC{}};
case kalmogorov_smirnov:
return verify_action::action_type::result_type{kalmogorov_smirnov_test{}};
case confusion_matric:
return verify_action::action_type::result_type{confusion_matric_test{}};
}
}
} // end of local namespace
verify_action::action_type::result_type
preform_action(actions::model_type mtype, verify_action::action_type::arg_type vrt)
{
if (is_supported(vrt, mtype)) {
return generate(vrt);
} else {
LOG_WARNING<<"no support for model type "<<mtype<<" and experiment type "<<vrt;
return verify_action::action_type::result_type{null_verifier{}};
}
}
//} // end of namespace detail
|
[
"boaz.sade@binah.ai"
] |
boaz.sade@binah.ai
|
aa2759212d6c1383a3e23b2f533d157e420423b4
|
ab189df4ab3389184422ffdc8193dc6f4477a646
|
/taccCore/FParse.cpp
|
87cabbd416774d0eea36cddb5ecbce1d772c897e
|
[] |
no_license
|
gottafixthat/tacc
|
cfe10b2db0436afbec528c44cd1b3eeb44117675
|
da5bb6393ae02a6b4f99bdb1b05de92b60e722d6
|
refs/heads/master
| 2021-01-25T04:02:28.248364
| 2015-09-04T22:49:25
| 2015-09-04T22:49:25
| 41,939,578
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 22,302
|
cpp
|
/*
** $Id$
**
***************************************************************************
**
** FParse - Generic file parsing routines.
**
***************************************************************************
** Written by R. Marc Lewis,
** (C)opyright 1998-2000, R. Marc Lewis and Blarg! Oline Services, Inc.
** All Rights Reserved.
**
** Unpublished work. No portion of this file may be reproduced in whole
** or in part by any means, electronic or otherwise, without the express
** written consent of Blarg! Online Services and R. Marc Lewis.
***************************************************************************
** $Log: FParse.cpp,v $
** Revision 1.1.1.1 2002/09/29 18:45:14 marc
**
**
**
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include "FParse.h"
FParser::FParser()
{
strcpy(openStr, "{");
strcpy(closeStr, "}");
openStrLen = 1;
closeStrLen = 1;
strcpy(fPath, "");
stripComments = true;
myPID = getpid();
}
FParser::~FParser()
{
#ifdef DEBUG
_dumpDebugInfo();
#endif
}
/*
** set - Sets a simpleVar.
*/
void FParser::set(const char *key, const char *val, bool escQuotes)
{
if (escQuotes) {
string tmpStr;
tmpStr = val;
string::size_type startpos = 0;
while ((startpos = tmpStr.find("\"", startpos)) != string::npos) {
tmpStr.replace(startpos, 1, """);
}
storeVar(simpleVars, key, tmpStr.c_str());
} else {
storeVar(simpleVars, key, val);
}
}
/*
** get - Gets a simpleVar.
*/
const char *FParser::get(const char *key)
{
__gnu_cxx::FPStringDict::iterator it = simpleVars.find(key);
if (it != simpleVars.end()) return simpleVars[key].c_str();
else return "";
}
/*
** addRow - Adds a new list row and sets it to be our current one.
*/
void FParser::addRow(const char *listName)
{
__gnu_cxx::FPStringDict *tmpDict = new __gnu_cxx::FPStringDict;
lists[listName].push_back(*tmpDict);
strcpy(curListName, listName);
}
/*
** addColumn - Sets a column value for the current list.
*/
void FParser::addColumn(const char *key, const char *val)
{
// Because the STL list.end() returns one past the end, i.e.
// where the next push_back() call will insert the item, we need
// to decrement our iterator in order to get the actual last item.
// Kind of stupid that they would do it that way, but hey...
__gnu_cxx::FPStringList::iterator it = lists[curListName].end();
it--;
__gnu_cxx::FPStringDict& curMap = *it;
storeVar(curMap, key, val);
}
/*
** reset - Clears all simple and list variables.
*/
void FParser::reset()
{
simpleVars.clear();
lists.clear();
}
/*
** setOpenCloseMarkers - Sets the seperators that identify variables and
** commands.
*/
void FParser::setVariableMarkers(const char *newOpen, const char *newClose)
{
strcpy(openStr, newOpen);
strcpy(closeStr, newClose);
openStrLen = strlen(openStr);
closeStrLen = strlen(closeStr);
}
/*
** setStripComments - Toggles whether or not we will strip comments
** out of the source file.
*/
void FParser::setStripComments(bool newVal)
{
stripComments = newVal;
}
/*
** setPath - Sets the default path for BHTML files.
*/
void FParser::setPath(const char *newPath)
{
strcpy(fPath, newPath);
}
/*
** dumpFile - This dumps a .bhtml file located in 'fPath' and sends it
** to the specified file (default = stdout).
** It does this without parsing it.
*/
int FParser::dumpFile(const char *fName, FILE *outfp)
{
FILE *fp;
int retVal = 1;
string fullPath;
if (strlen(fPath) && fName[0] != '/') {
fullPath = fPath;
fullPath += "/";
}
fullPath += fName;
fp = fopen(fullPath.c_str(), "r");
if (fp) {
int bufsize = 65536;
char *buffer = new char[65536];
while(fgets(buffer, bufsize - 1, fp) != NULL) {
// Check for comments in the file. Skip them.
if (buffer[0] != '#' || !stripComments) {
fprintf(outfp, "%s", buffer);
}
}
fclose(fp);
} else {
retVal = 0;
}
return retVal;
}
/*
** parseFile - This parses a .bhtml file located in 'fPath' and sends it
** to the specified file (default = stdout).
** This is the workhorse of the BCGI library.
*/
void FParser::parseFile(const char *fName, FILE *outfp)
{
string parsed;
// Load the file into our string, or return.
if (!loadFile(fName, parsed)) return;
// Okay, start parsing it...
parseBlock(parsed);
fprintf(outfp, "%s", parsed.c_str());
}
/*
** parseFileToMem - This parses a .bhtml file located in 'fPath' and sends it
** to the specified file (default = stdout).
** This is the workhorse of the BCGI library.
*/
char *FParser::parseFileToMem(const char *fName)
{
string parsed;
// Load the file into our string, or return.
if (!loadFile(fName, parsed)) return "";
// Okay, start parsing it...
parseBlock(parsed);
// Now, allocate the buffer for our return.
char *retStr = new char[strlen(parsed.c_str())+1024];
strcpy(retStr, parsed.c_str());
return retStr;
}
/*
** parseBlock - This is the member function that does all of the actual
** work. It will call itself recursively until the entire
** block has been parsed.
*/
void FParser::parseBlock(string &block)
{
string::size_type startpos = 0;
string::size_type endpos = 0;
string::size_type tmppos = 0;
while ((startpos = block.find(openStr, startpos)) != string::npos) {
// fprintf(stderr, "Star pos = '%d'\n", startpos);
endpos = block.find(closeStr, startpos+openStrLen);
// fprintf(stderr, "startpos = '%d', endpos = '%d'\n", startpos, endpos);
if (endpos != string::npos) {
char tmpVarName[4096];
string varName;
string varVal;
// Got the relative position of the item in the string.
// Get the variable name, and delete it from the sting.
varName = block.substr(startpos+openStrLen, endpos-startpos-closeStrLen);
// fprintf(stderr, "Found Variable '%s'\n", varName.c_str());
// Check for lists, if's, etc.
tmppos = varName.find(" ");
if (tmppos != string::npos) {
string action;
string modifier;
action = varName.substr(0, tmppos);
modifier = varName.substr(tmppos+openStrLen, varName.length() - tmppos);
// We now have an action and a modifier. Do something
// with it.
if (!action.compare("List")) {
// Hey, its a list. Extract the block between {List name}
// and {EndList name}
string::size_type listendpos;
string listBlock;
string endListTag;
endListTag = openStr;
endListTag += "EndList ";
endListTag += modifier.c_str();
endListTag += closeStr;
listendpos = block.find(endListTag.c_str(), endpos);
if (listendpos != string::npos) {
listBlock = block.substr(endpos+closeStrLen, listendpos-closeStrLen-endpos);
parseListBlock(listBlock, modifier.c_str());
// Now, replace the entire list block with our parsed
// list block.
block.replace(startpos, listendpos-startpos+endListTag.length(), listBlock);
} else {
// No EndList found. Remove the reference
block.replace(startpos, endpos-startpos+1, "");
}
} else if (!action.compare("if")) {
// Hey, its an if statement. Extract the block between
// {if Variable} and {endif Variable}
string::size_type listendpos;
string listBlock;
string endListTag;
endListTag = openStr;
endListTag += "endif ";
endListTag += modifier.c_str();
endListTag += closeStr;
listendpos = block.find(endListTag.c_str(), endpos);
if (listendpos != string::npos) {
listBlock = block.substr(endpos+closeStrLen, listendpos-closeStrLen-endpos);
// Now, check if the variable both exists and
// has a value. If both are true, then we will
// parse this block.
__gnu_cxx::FPStringDict::iterator it = simpleVars.find(modifier.c_str());
if (it != simpleVars.end()) {
varVal = simpleVars[modifier.c_str()];
if (strlen(varVal.c_str())) {
// It exists and has a value. Parse this
// block
parseBlock(listBlock);
} else {
listBlock = "";
}
} else {
// If test failed, clear the listBlock
listBlock = "";
}
// Now, replace the entire list block with our parsed
// list block.
block.replace(startpos, listendpos-startpos+endListTag.length(), listBlock);
} else {
// No EndList found. Remove the reference
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
} else {
// Bogus action. Remove it.
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
} else {
strcpy(tmpVarName, varName.c_str());
__gnu_cxx::FPStringDict::iterator it = simpleVars.find(tmpVarName);
if (it != simpleVars.end()) {
varVal = simpleVars[tmpVarName];
block.replace(startpos, endpos-startpos+closeStrLen, varVal.c_str());
} else {
// Unknown variable, ignore it.
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
}
} else {
// Bogus variable. Lose the opening '{'
block.replace(startpos, openStrLen, "");
}
}
}
/*
** parseListBlock - Takes a list name, and a block, and does replacments
** on each variable found for each element in a list.
*/
void FParser::parseListBlock(string &sourceblock, const char *listName)
{
if (!lists[listName].empty()) {
// This list is valid and has data in it.
string::size_type startpos = 0;
string::size_type endpos = 0;
string::size_type tmppos = 0;
string doneblock;
string block;
__gnu_cxx::FPStringList::iterator it = lists[listName].begin();
while (it != lists[listName].end()) {
__gnu_cxx::FPStringDict& curMap = *it;
block = sourceblock;
while ((startpos = block.find(openStr, startpos)) != string::npos) {
endpos = block.find(closeStr, startpos+openStrLen);
if (endpos != string::npos) {
string varName;
string varVal;
// Got the relative position of the item in the string.
// Get the variable name, and delete it from the sting.
varName = block.substr(startpos+openStrLen, endpos-startpos-closeStrLen);
// Check to make sure it is a list variable
tmppos = varName.find(":");
if (tmppos != string::npos) {
string action;
string modifier;
action = varName.substr(0, tmppos);
modifier = varName.substr(tmppos+1, varName.length() - tmppos);
// We now have an action and a modifier. Do something
// with it.
if (!action.compare(listName)) {
// Hey, its in our list. Replace it.
varVal = curMap[modifier.c_str()];
// if (!varVal.length()) log(CGI_WARNING, "Encountered unknown variable '%s'", modifier.c_str());
block.replace(startpos, endpos-startpos+closeStrLen, varVal.c_str());
}
} else {
tmppos = varName.find(" ");
if (tmppos != string::npos) {
string action;
string modifier;
action = varName.substr(0, tmppos);
modifier = varName.substr(tmppos+1, varName.length() - tmppos);
// We now have an action and a modifier. Do something
// with it.
if (!action.compare("List")) {
// Hey, its a list. Extract the block between {List name}
// and {EndList name}
string::size_type listendpos;
string listBlock;
string endListTag;
endListTag = openStr;
endListTag += "EndList ";
endListTag += modifier.c_str();
endListTag += closeStr;
listendpos = block.find(endListTag.c_str(), endpos);
if (listendpos != string::npos) {
listBlock = block.substr(endpos+closeStrLen, listendpos-closeStrLen-endpos);
parseListBlock(listBlock, modifier.c_str());
// Now, replace the entire list block with our parsed
// list block.
block.replace(startpos, listendpos-startpos+endListTag.length(), listBlock);
} else {
// No EndList found. Remove the reference
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
} else if (!action.compare("if")) {
// Hey, its an if statement. Extract the block between
// {if Variable} and {endif Variable}
string::size_type listendpos;
string listBlock;
string endListTag;
endListTag = openStr;
endListTag += "endif ";
endListTag += modifier.c_str();
endListTag += closeStr;
listendpos = block.find(endListTag.c_str(), endpos);
if (listendpos != string::npos) {
listBlock = block.substr(endpos+closeStrLen, listendpos-closeStrLen-endpos);
// Now, check if the variable both exists and
// has a value. If both are true, then we will
// parse this block.
__gnu_cxx::FPStringDict::iterator it = simpleVars.find(modifier.c_str());
if (it != simpleVars.end()) {
varVal = simpleVars[modifier.c_str()];
if (strlen(varVal.c_str())) {
// It exists and has a value. Parse this
// block
parseBlock(listBlock);
} else {
listBlock = "";
}
} else {
// If test failed, clear the listBlock
listBlock = "";
}
// Now, replace the entire list block with our parsed
// list block.
block.replace(startpos, listendpos-startpos+endListTag.length(), listBlock);
} else {
// No EndList found. Remove the reference
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
} else {
// Bogus action. Remove it.
block.replace(startpos, endpos-startpos+closeStrLen, "");
}
} else {
// No ':' or ' ' in it, global variable.
varVal = simpleVars[varName.c_str()];
// if (!varVal.length()) log(CGI_WARNING, "Encountered unknown variable '%s'", varName.c_str());
block.replace(startpos, endpos-startpos+closeStrLen, varVal.c_str());
}
}
}
}
// parseblock = "List parsed.";
doneblock += block;
it++;
}
sourceblock = doneblock;
} else {
// log(CGI_WARNING, "List '%s' not found or empty", listName);
sourceblock = "";
}
}
/*
** loadFile - Loads a file into a string. Returns 1 on success, 0 on
** failure. It appends the file to the end of the string so
** this function can be called repeatedly on the same string,
** causing the string to grow.
*/
int FParser::loadFile(const char *fName, string &dest)
{
int retVal = 1;
FILE *fp;
string fullPath;
if (strlen(fPath) && fName[0] != '/') {
fullPath = fPath;
fullPath += "/";
}
fullPath += fName;
fp = fopen(fullPath.c_str(), "r");
if (fp) {
int bufsize = 65536;
char *buffer = new char[65536];
while(fgets(buffer, bufsize - 1, fp) != NULL) {
// Check for comments in the file. Skip them.
if (buffer[0] != '#') {
dest += buffer;
} else {
// Check for an include file...
if (!strncasecmp(buffer, "#include", 8)) {
string tmpFName = buffer;
// Extract the file name and drop the trailing \n
tmpFName.erase(0, strlen("#include "));
tmpFName.erase(tmpFName.length() - 1, 1);
loadFile(tmpFName.c_str(), dest);
} else if (!stripComments) {
dest += buffer;
}
}
}
fclose(fp);
} else {
fprintf(stderr, "FParser::loadFile - Unable to load file '%s'\n", fullPath.c_str());
retVal = 0;
}
return retVal;
}
/*
** storeVar - Allocates space for a variable and inserts it into
** the passed in list.
*/
void FParser::storeVar(__gnu_cxx::FPStringDict &dict, const char *key, const char *val)
{
// A test. If we have this key in the map already, delete it.
__gnu_cxx::FPStringDict::iterator it = dict.find(key);
if (it != dict.end()) {
dict.erase(key);
}
if (val && strlen(val)) {
char *tmpKey = new char[strlen(key)+16];
char *tmpVal = new char[strlen(val)+16];
strcpy(tmpKey, key);
strcpy(tmpVal, val);
dict[tmpKey] = tmpVal;
} else {
char *tmpKey = new char[strlen(key)+16];
strcpy(tmpKey, key);
dict[tmpKey] = "";
}
}
/*
** FPSplitString - Splits a string into a hash_map, keyed on an int.
** This will allow us to use a for() loop to walk through
** a split string.
** It will return the number of split items.
*/
int FParser::_FPSplitString(const char *src, const char *delim, __gnu_cxx::FPIntDict &map)
{
int entryCount = 0;
char *workStr;
char *tmpStr;
char *part;
if (!strlen(src)) return 0;
workStr = new char[strlen(src)+1024];
strcpy(workStr, src);
part = strsep(&workStr, delim);
while (part != NULL) {
tmpStr = new char[strlen(part)+16];
strcpy(tmpStr, part);
map[entryCount++] = tmpStr;
part = strsep(&workStr, delim);
}
return entryCount;
}
/*
** dumpDebugInfo - Dumps out all of our maps and lists to stderr.
*/
void FParser::_dumpDebugInfo()
{
fprintf(stderr, "\nBCGI Debug Info\n\n");
fprintf(stderr, "simpleVars:\t%d elements\n", simpleVars.size());
/*
StringDict::iterator it = simpleVars.begin();
while (it != simpleVars.end()) {
fprintf(stderr, "\tData = %s\n", (*it).Data);
it++;
}
*/
fprintf(stderr, "\n");
}
|
[
"marc@innovotel.com"
] |
marc@innovotel.com
|
c8e17fdee9f43650dcdf4eb7b44b5e16fe52913f
|
bbac388eb6b53daec63190e2f271a18fe9bfb163
|
/abc203/AChinchirorin.cpp
|
55ae33593230cc4adcdae73aa97518f0f66d32a9
|
[] |
no_license
|
tatsumack/atcoder
|
8d94cf29160b6553b0c089cb795c54efd3fb0f7b
|
fbe1e1eab80c4c0680ec046acdc6214426b19650
|
refs/heads/master
| 2023-06-17T23:09:54.056132
| 2021-07-04T13:03:59
| 2021-07-04T13:03:59
| 124,963,709
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 865
|
cpp
|
#include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)
using namespace std;
class AChinchirorin {
public:
void solve(std::istream& cin, std::ostream& cout) {
int a, b, c;
cin >> a >> b >> c;
if (a == b) {
cout << c << endl;
return;
}
if (c == b) {
cout << a << endl;
return;
}
if (c == a) {
cout << b << endl;
return;
}
cout << 0 << endl;
}
};
|
[
"tatsu.mack@gmail.com"
] |
tatsu.mack@gmail.com
|
c57fa325d783d806db56609f35e311190fc428be
|
24f26275ffcd9324998d7570ea9fda82578eeb9e
|
/third_party/blink/renderer/core/svg/svg_animate_transform_element.cc
|
e1a894240c9c1d6655b58dd71fe3b94fc8ddd79f
|
[
"BSD-3-Clause",
"LGPL-2.0-only",
"BSD-2-Clause",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-2.0-only",
"LicenseRef-scancode-other-copyleft"
] |
permissive
|
Vizionnation/chromenohistory
|
70a51193c8538d7b995000a1b2a654e70603040f
|
146feeb85985a6835f4b8826ad67be9195455402
|
refs/heads/master
| 2022-12-15T07:02:54.461083
| 2019-10-25T15:07:06
| 2019-10-25T15:07:06
| 217,557,501
| 2
| 1
|
BSD-3-Clause
| 2022-11-19T06:53:07
| 2019-10-25T14:58:54
| null |
UTF-8
|
C++
| false
| false
| 3,245
|
cc
|
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "third_party/blink/renderer/core/svg/svg_animate_transform_element.h"
#include "third_party/blink/renderer/core/svg/properties/svg_animated_property.h"
#include "third_party/blink/renderer/core/svg/svg_transform_list.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
namespace blink {
SVGAnimateTransformElement::SVGAnimateTransformElement(Document& document)
: SVGAnimateElement(svg_names::kAnimateTransformTag, document),
transform_type_(SVGTransformType::kUnknown) {}
bool SVGAnimateTransformElement::HasValidTarget() const {
if (!SVGAnimateElement::HasValidTarget())
return false;
if (GetAttributeType() == kAttributeTypeCSS)
return false;
return type_ == kAnimatedTransformList;
}
void SVGAnimateTransformElement::ResolveTargetProperty() {
DCHECK(targetElement());
target_property_ = targetElement()->PropertyFromAttribute(AttributeName());
type_ = target_property_ ? target_property_->GetType() : kAnimatedUnknown;
// <animateTransform> only animates AnimatedTransformList.
// http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
if (type_ != kAnimatedTransformList)
type_ = kAnimatedUnknown;
// Because of the syntactic mismatch between the CSS and SVGProperty
// representations, disallow CSS animations of transforms. Support for that
// is better added to the <animate> element since the <animateTransform>
// element is deprecated and quirky. (We also reject this case via
// hasValidAttributeType above.)
css_property_id_ = CSSPropertyID::kInvalid;
}
SVGPropertyBase* SVGAnimateTransformElement::CreatePropertyForAnimation(
const String& value) const {
DCHECK(IsAnimatingSVGDom());
return MakeGarbageCollected<SVGTransformList>(transform_type_, value);
}
void SVGAnimateTransformElement::ParseAttribute(
const AttributeModificationParams& params) {
if (params.name == svg_names::kTypeAttr) {
transform_type_ = ParseTransformType(params.new_value);
if (transform_type_ == SVGTransformType::kMatrix)
transform_type_ = SVGTransformType::kUnknown;
return;
}
SVGAnimateElement::ParseAttribute(params);
}
} // namespace blink
|
[
"rjkroege@chromium.org"
] |
rjkroege@chromium.org
|
7930b8e24d3e7d610b2a9f62b3bddb8775cbbcae
|
0eac383dec54bc49681b18be17d43f2b93fe5a0b
|
/h264_video_decoder_demo/H264VUI.h
|
011d8b670a77fb11cba1889559c2e946323d799b
|
[] |
no_license
|
hellowanda/h264_video_decoder_demo
|
e3fec6dcc97e1fc43524a20d76eb01ee9d118e53
|
357e5ddfe8817023ebafae08dd7d01d7aae55e5b
|
refs/heads/master
| 2023-04-11T17:44:28.016740
| 2021-05-01T09:22:38
| 2021-05-01T09:22:38
| null | 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 2,229
|
h
|
//
// H264VUI.h
// h264_video_decoder_demo
//
// Created by: 386520874@qq.com
// Date: 2019.09.01 - 2021.02.14
//
#ifndef __H264_VUI_H__
#define __H264_VUI_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <string>
#include "Bitstream.h"
#include "H264HrdParameters.h"
class CH264VUI
{
public:
int32_t aspect_ratio_info_present_flag;
int32_t aspect_ratio_idc;
int32_t sar_width;
int32_t sar_height;
int32_t overscan_info_present_flag;
int32_t overscan_appropriate_flag;
int32_t video_signal_type_present_flag;
int32_t video_format;
int32_t video_full_range_flag;
int32_t colour_description_present_flag;
int32_t colour_primaries;
int32_t transfer_characteristics;
int32_t matrix_coefficients;
int32_t chroma_loc_info_present_flag;
int32_t chroma_sample_loc_type_top_field;
int32_t chroma_sample_loc_type_bottom_field;
int32_t timing_info_present_flag;
int32_t num_units_in_tick; //the number of time units of a clock operating at the frequency time_scale Hz that corresponds to one increment (called a clock tick) of a clock tick counter.
int32_t time_scale; //the number of time units that pass in one second.
int32_t fixed_frame_rate_flag;
int32_t nal_hrd_parameters_present_flag;
int32_t vcl_hrd_parameters_present_flag;
int32_t low_delay_hrd_flag;
int32_t pic_struct_present_flag;
int32_t bitstream_restriction_flag;
int32_t motion_vectors_over_pic_boundaries_flag;
int32_t max_bytes_per_pic_denom;
int32_t max_bits_per_mb_denom;
int32_t log2_max_mv_length_horizontal;
int32_t log2_max_mv_length_vertical;
int32_t max_num_reorder_frames; //indicates an upper bound for the number of frames buffers, in the decoded picture buffer (DPB). 大于等于2表示含有B帧
int32_t max_dec_frame_buffering;
CHrdParameters m_hrd_parameter_nal;
CHrdParameters m_hrd_parameter_vcl;
public:
CH264VUI();
~CH264VUI();
int printInfo();
int vui_parameters(CBitstream &bs);
};
#endif //__H264_VUI_H__
|
[
"386520874@qq.com"
] |
386520874@qq.com
|
16dcfd859604e26fc17c04ec6fefb9912c84bd40
|
21a1e3fa9372be9c3cee4129fe3d836f499517d9
|
/.theano/compiledir_Linux-3.16--generic-x86_64-with-debian-jessie-sid-x86_64-2.7.10-64/tmptHC6Fu/mod.cpp
|
5a697cb4442d81fc62c560638ac1cd1bf470947a
|
[] |
no_license
|
ejake/tensor-factorization
|
1d26ba4fcdbc9816439d39e738c8c0efdb95cd57
|
0a82ed55b872d42c78d0be373003e154c477b8b2
|
refs/heads/master
| 2020-05-22T06:43:25.459028
| 2017-03-07T17:44:26
| 2017-03-07T17:44:26
| 64,168,262
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 55,654
|
cpp
|
#include <Python.h>
#include <iostream>
#include "theano_mod_helper.h"
#include <math.h>
#include <numpy/arrayobject.h>
#include <numpy/arrayscalars.h>
#include <iostream>
#include <time.h>
#include <sys/time.h>
//////////////////////
//// Support Code
//////////////////////
extern "C"
{
void xerbla_(char*, void *);
/***********/
/* Level 1 */
/***********/
/* Single Precision */
void srot_(const int*, float *, const int*, float *, const int*, const float *, const float *);
void srotg_(float *,float *,float *,float *);
void srotm_( const int*, float *, const int*, float *, const int*, const float *);
void srotmg_(float *,float *,float *,const float *, float *);
void sswap_( const int*, float *, const int*, float *, const int*);
void scopy_( const int*, const float *, const int*, float *, const int*);
void saxpy_( const int*, const float *, const float *, const int*, float *, const int*);
float sdot_(const int*, const float *, const int*, const float *, const int*);
void sdot_sub_(const int*, const float *, const int*, const float *, const int*, float *);
void sdsdot_sub_( const int*, const float *, const float *, const int*, const float *, const int*, float *);
void sscal_( const int*, const float *, float *, const int*);
void snrm2_sub_( const int*, const float *, const int*, float *);
void sasum_sub_( const int*, const float *, const int*, float *);
void isamax_sub_( const int*, const float * , const int*, const int*);
/* Double Precision */
void drot_(const int*, double *, const int*, double *, const int*, const double *, const double *);
void drotg_(double *,double *,double *,double *);
void drotm_( const int*, double *, const int*, double *, const int*, const double *);
void drotmg_(double *,double *,double *,const double *, double *);
void dswap_( const int*, double *, const int*, double *, const int*);
void dcopy_( const int*, const double *, const int*, double *, const int*);
void daxpy_( const int*, const double *, const double *, const int*, double *, const int*);
void dswap_( const int*, double *, const int*, double *, const int*);
double ddot_(const int*, const double *, const int*, const double *, const int*);
void dsdot_sub_(const int*, const float *, const int*, const float *, const int*, double *);
void ddot_sub_( const int*, const double *, const int*, const double *, const int*, double *);
void dscal_( const int*, const double *, double *, const int*);
void dnrm2_sub_( const int*, const double *, const int*, double *);
void dasum_sub_( const int*, const double *, const int*, double *);
void idamax_sub_( const int*, const double * , const int*, const int*);
/* Single Complex Precision */
void cswap_( const int*, void *, const int*, void *, const int*);
void ccopy_( const int*, const void *, const int*, void *, const int*);
void caxpy_( const int*, const void *, const void *, const int*, void *, const int*);
void cswap_( const int*, void *, const int*, void *, const int*);
void cdotc_sub_( const int*, const void *, const int*, const void *, const int*, void *);
void cdotu_sub_( const int*, const void *, const int*, const void *, const int*, void *);
void cscal_( const int*, const void *, void *, const int*);
void icamax_sub_( const int*, const void *, const int*, const int*);
void csscal_( const int*, const float *, void *, const int*);
void scnrm2_sub_( const int*, const void *, const int*, float *);
void scasum_sub_( const int*, const void *, const int*, float *);
/* Double Complex Precision */
void zswap_( const int*, void *, const int*, void *, const int*);
void zcopy_( const int*, const void *, const int*, void *, const int*);
void zaxpy_( const int*, const void *, const void *, const int*, void *, const int*);
void zswap_( const int*, void *, const int*, void *, const int*);
void zdotc_sub_( const int*, const void *, const int*, const void *, const int*, void *);
void zdotu_sub_( const int*, const void *, const int*, const void *, const int*, void *);
void zdscal_( const int*, const double *, void *, const int*);
void zscal_( const int*, const void *, void *, const int*);
void dznrm2_sub_( const int*, const void *, const int*, double *);
void dzasum_sub_( const int*, const void *, const int*, double *);
void izamax_sub_( const int*, const void *, const int*, const int*);
/***********/
/* Level 2 */
/***********/
/* Single Precision */
void sgemv_(char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void sgbmv_(char*, const int*, const int*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void ssymv_(char*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void ssbmv_(char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void sspmv_(char*, const int*, const float *, const float *, const float *, const int*, const float *, float *, const int*);
void strmv_( char*, char*, char*, const int*, const float *, const int*, float *, const int*);
void stbmv_( char*, char*, char*, const int*, const int*, const float *, const int*, float *, const int*);
void strsv_( char*, char*, char*, const int*, const float *, const int*, float *, const int*);
void stbsv_( char*, char*, char*, const int*, const int*, const float *, const int*, float *, const int*);
void stpmv_( char*, char*, char*, const int*, const float *, float *, const int*);
void stpsv_( char*, char*, char*, const int*, const float *, float *, const int*);
void sger_( const int*, const int*, const float *, const float *, const int*, const float *, const int*, float *, const int*);
void ssyr_(char*, const int*, const float *, const float *, const int*, float *, const int*);
void sspr_(char*, const int*, const float *, const float *, const int*, float *);
void sspr2_(char*, const int*, const float *, const float *, const int*, const float *, const int*, float *);
void ssyr2_(char*, const int*, const float *, const float *, const int*, const float *, const int*, float *, const int*);
/* Double Precision */
void dgemv_(char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dgbmv_(char*, const int*, const int*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dsymv_(char*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dsbmv_(char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dspmv_(char*, const int*, const double *, const double *, const double *, const int*, const double *, double *, const int*);
void dtrmv_( char*, char*, char*, const int*, const double *, const int*, double *, const int*);
void dtbmv_( char*, char*, char*, const int*, const int*, const double *, const int*, double *, const int*);
void dtrsv_( char*, char*, char*, const int*, const double *, const int*, double *, const int*);
void dtbsv_( char*, char*, char*, const int*, const int*, const double *, const int*, double *, const int*);
void dtpmv_( char*, char*, char*, const int*, const double *, double *, const int*);
void dtpsv_( char*, char*, char*, const int*, const double *, double *, const int*);
void dger_( const int*, const int*, const double *, const double *, const int*, const double *, const int*, double *, const int*);
void dsyr_(char*, const int*, const double *, const double *, const int*, double *, const int*);
void dspr_(char*, const int*, const double *, const double *, const int*, double *);
void dspr2_(char*, const int*, const double *, const double *, const int*, const double *, const int*, double *);
void dsyr2_(char*, const int*, const double *, const double *, const int*, const double *, const int*, double *, const int*);
/* Single Complex Precision */
void cgemv_(char*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void cgbmv_(char*, const int*, const int*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void chemv_(char*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void chbmv_(char*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void chpmv_(char*, const int*, const void *, const void *, const void *, const int*, const void *, void *, const int*);
void ctrmv_( char*, char*, char*, const int*, const void *, const int*, void *, const int*);
void ctbmv_( char*, char*, char*, const int*, const int*, const void *, const int*, void *, const int*);
void ctpmv_( char*, char*, char*, const int*, const void *, void *, const int*);
void ctrsv_( char*, char*, char*, const int*, const void *, const int*, void *, const int*);
void ctbsv_( char*, char*, char*, const int*, const int*, const void *, const int*, void *, const int*);
void ctpsv_( char*, char*, char*, const int*, const void *, void *,const int*);
void cgerc_( const int*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void cgeru_( const int*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void cher_(char*, const int*, const float *, const void *, const int*, void *, const int*);
void cher2_(char*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void chpr_(char*, const int*, const float *, const void *, const int*, void *);
void chpr2_(char*, const int*, const float *, const void *, const int*, const void *, const int*, void *);
/* Double Complex Precision */
void zgemv_(char*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void zgbmv_(char*, const int*, const int*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void zhemv_(char*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void zhbmv_(char*, const int*, const int*, const void *, const void *, const int*, const void *, const int*, const void *, void *, const int*);
void zhpmv_(char*, const int*, const void *, const void *, const void *, const int*, const void *, void *, const int*);
void ztrmv_( char*, char*, char*, const int*, const void *, const int*, void *, const int*);
void ztbmv_( char*, char*, char*, const int*, const int*, const void *, const int*, void *, const int*);
void ztpmv_( char*, char*, char*, const int*, const void *, void *, const int*);
void ztrsv_( char*, char*, char*, const int*, const void *, const int*, void *, const int*);
void ztbsv_( char*, char*, char*, const int*, const int*, const void *, const int*, void *, const int*);
void ztpsv_( char*, char*, char*, const int*, const void *, void *,const int*);
void zgerc_( const int*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void zgeru_( const int*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void zher_(char*, const int*, const double *, const void *, const int*, void *, const int*);
void zher2_(char*, const int*, const void *, const void *, const int*, const void *, const int*, void *, const int*);
void zhpr_(char*, const int*, const double *, const void *, const int*, void *);
void zhpr2_(char*, const int*, const double *, const void *, const int*, const void *, const int*, void *);
/***********/
/* Level 3 */
/***********/
/* Single Precision */
void sgemm_(char*, char*, const int*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void ssymm_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void ssyrk_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, float *, const int*);
void ssyr2k_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void strmm_(char*, char*, char*, char*, const int*, const int*, const float *, const float *, const int*, float *, const int*);
void strsm_(char*, char*, char*, char*, const int*, const int*, const float *, const float *, const int*, float *, const int*);
/* Double Precision */
void dgemm_(char*, char*, const int*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dsymm_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dsyrk_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, double *, const int*);
void dsyr2k_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void dtrmm_(char*, char*, char*, char*, const int*, const int*, const double *, const double *, const int*, double *, const int*);
void dtrsm_(char*, char*, char*, char*, const int*, const int*, const double *, const double *, const int*, double *, const int*);
/* Single Complex Precision */
void cgemm_(char*, char*, const int*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void csymm_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void chemm_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void csyrk_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, float *, const int*);
void cherk_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, float *, const int*);
void csyr2k_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void cher2k_(char*, char*, const int*, const int*, const float *, const float *, const int*, const float *, const int*, const float *, float *, const int*);
void ctrmm_(char*, char*, char*, char*, const int*, const int*, const float *, const float *, const int*, float *, const int*);
void ctrsm_(char*, char*, char*, char*, const int*, const int*, const float *, const float *, const int*, float *, const int*);
/* Double Complex Precision */
void zgemm_(char*, char*, const int*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void zsymm_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void zhemm_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void zsyrk_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, double *, const int*);
void zherk_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, double *, const int*);
void zsyr2k_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void zher2k_(char*, char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int*);
void ztrmm_(char*, char*, char*, char*, const int*, const int*, const double *, const double *, const int*, double *, const int*);
void ztrsm_(char*, char*, char*, char*, const int*, const int*, const double *, const double *, const int*, double *, const int*);
}
#ifndef MOD
#define MOD %
#endif
static double time_time() // a time function like time.time()
{
struct timeval tv;
gettimeofday(&tv, 0);
return (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
}
namespace {
struct __struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2 {
PyObject* __ERROR;
PyObject* storage_V3;
PyObject* storage_V5;
PyObject* storage_V7;
PyObject* storage_V1;
__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2() {
// This is only somewhat safe because we:
// 1) Are not a virtual class
// 2) Do not use any virtual classes in the members
// 3) Deal with mostly POD and pointers
// If this changes, we would have to revise this, but for
// now I am tired of chasing segfaults because
// initialization code had an error and some pointer has
// a junk value.
memset(this, 0, sizeof(*this));
}
~__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2(void) {
cleanup();
}
int init(PyObject* __ERROR, PyObject* storage_V3, PyObject* storage_V5, PyObject* storage_V7, PyObject* storage_V1) {
Py_XINCREF(storage_V3);
Py_XINCREF(storage_V5);
Py_XINCREF(storage_V7);
Py_XINCREF(storage_V1);
this->storage_V3 = storage_V3;
this->storage_V5 = storage_V5;
this->storage_V7 = storage_V7;
this->storage_V1 = storage_V1;
this->__ERROR = __ERROR;
return 0;
}
void cleanup(void) {
__label_1:
double __DUMMY_1;
__label_3:
double __DUMMY_3;
__label_5:
double __DUMMY_5;
__label_7:
double __DUMMY_7;
__label_10:
double __DUMMY_10;
Py_XDECREF(this->storage_V3);
Py_XDECREF(this->storage_V5);
Py_XDECREF(this->storage_V7);
Py_XDECREF(this->storage_V1);
}
int run(void) {
int __failure = 0;
PyObject* py_V1;
PyArrayObject* V1;
typedef npy_float64 dtype_V1;
PyObject* py_V3;
PyArrayObject* V3;
typedef npy_float64 dtype_V3;
PyObject* py_V5;
PyArrayObject* V5;
typedef npy_float64 dtype_V5;
PyObject* py_V7;
PyArrayObject* V7;
typedef npy_float64 dtype_V7;
{
py_V1 = PyList_GET_ITEM(storage_V1, 0);
{Py_XINCREF(py_V1);}
if (py_V1 == Py_None)
{
V1 = NULL;
}
else
{
V1 = NULL;
if (py_V1 == Py_None) {
// We can either fail here or set V1 to NULL and rely on Ops
// using tensors to handle the NULL case, but if they fail to do so
// they'll end up with nasty segfaults, so this is public service.
PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
{
__failure = 2;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_2;}
}
if (!PyArray_Check(py_V1)) {
PyErr_SetString(PyExc_ValueError, "expected an ndarray");
{
__failure = 2;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_2;}
}
// We expect NPY_FLOAT64
if (!PyArray_ISALIGNED((PyArrayObject*) py_V1)) {
PyArrayObject * tmp = (PyArrayObject*) py_V1;
PyErr_Format(PyExc_NotImplementedError,
"expected an aligned array of type %ld "
"(NPY_FLOAT64), got non-aligned array of type %ld"
" with %ld dimensions, with 3 last dims "
"%ld, %ld, %ld"
" and 3 last strides %ld %ld, %ld.",
(long int) NPY_FLOAT64,
(long int) PyArray_TYPE((PyArrayObject*) py_V1),
(long int) PyArray_NDIM(tmp),
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
);
{
__failure = 2;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_2;}
}
// This is a TypeError to be consistent with DEBUG_MODE
// Note: DEBUG_MODE also tells the name of the container
if (PyArray_TYPE((PyArrayObject*) py_V1) != NPY_FLOAT64) {
PyErr_Format(PyExc_TypeError,
"expected type_num %d (NPY_FLOAT64) got %d",
NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V1));
{
__failure = 2;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_2;}
}
V1 = (PyArrayObject*)(py_V1);
Py_XINCREF(V1);
}
{
py_V3 = PyList_GET_ITEM(storage_V3, 0);
{Py_XINCREF(py_V3);}
V3 = NULL;
if (py_V3 == Py_None) {
// We can either fail here or set V3 to NULL and rely on Ops
// using tensors to handle the NULL case, but if they fail to do so
// they'll end up with nasty segfaults, so this is public service.
PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
{
__failure = 4;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_4;}
}
if (!PyArray_Check(py_V3)) {
PyErr_SetString(PyExc_ValueError, "expected an ndarray");
{
__failure = 4;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_4;}
}
// We expect NPY_FLOAT64
if (!PyArray_ISALIGNED((PyArrayObject*) py_V3)) {
PyArrayObject * tmp = (PyArrayObject*) py_V3;
PyErr_Format(PyExc_NotImplementedError,
"expected an aligned array of type %ld "
"(NPY_FLOAT64), got non-aligned array of type %ld"
" with %ld dimensions, with 3 last dims "
"%ld, %ld, %ld"
" and 3 last strides %ld %ld, %ld.",
(long int) NPY_FLOAT64,
(long int) PyArray_TYPE((PyArrayObject*) py_V3),
(long int) PyArray_NDIM(tmp),
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
);
{
__failure = 4;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_4;}
}
// This is a TypeError to be consistent with DEBUG_MODE
// Note: DEBUG_MODE also tells the name of the container
if (PyArray_TYPE((PyArrayObject*) py_V3) != NPY_FLOAT64) {
PyErr_Format(PyExc_TypeError,
"expected type_num %d (NPY_FLOAT64) got %d",
NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V3));
{
__failure = 4;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_4;}
}
V3 = (PyArrayObject*)(py_V3);
Py_XINCREF(V3);
{
py_V5 = PyList_GET_ITEM(storage_V5, 0);
{Py_XINCREF(py_V5);}
V5 = NULL;
if (py_V5 == Py_None) {
// We can either fail here or set V5 to NULL and rely on Ops
// using tensors to handle the NULL case, but if they fail to do so
// they'll end up with nasty segfaults, so this is public service.
PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
{
__failure = 6;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_6;}
}
if (!PyArray_Check(py_V5)) {
PyErr_SetString(PyExc_ValueError, "expected an ndarray");
{
__failure = 6;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_6;}
}
// We expect NPY_FLOAT64
if (!PyArray_ISALIGNED((PyArrayObject*) py_V5)) {
PyArrayObject * tmp = (PyArrayObject*) py_V5;
PyErr_Format(PyExc_NotImplementedError,
"expected an aligned array of type %ld "
"(NPY_FLOAT64), got non-aligned array of type %ld"
" with %ld dimensions, with 3 last dims "
"%ld, %ld, %ld"
" and 3 last strides %ld %ld, %ld.",
(long int) NPY_FLOAT64,
(long int) PyArray_TYPE((PyArrayObject*) py_V5),
(long int) PyArray_NDIM(tmp),
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
);
{
__failure = 6;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_6;}
}
// This is a TypeError to be consistent with DEBUG_MODE
// Note: DEBUG_MODE also tells the name of the container
if (PyArray_TYPE((PyArrayObject*) py_V5) != NPY_FLOAT64) {
PyErr_Format(PyExc_TypeError,
"expected type_num %d (NPY_FLOAT64) got %d",
NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V5));
{
__failure = 6;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_6;}
}
V5 = (PyArrayObject*)(py_V5);
Py_XINCREF(V5);
{
py_V7 = PyList_GET_ITEM(storage_V7, 0);
{Py_XINCREF(py_V7);}
V7 = NULL;
if (py_V7 == Py_None) {
// We can either fail here or set V7 to NULL and rely on Ops
// using tensors to handle the NULL case, but if they fail to do so
// they'll end up with nasty segfaults, so this is public service.
PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
{
__failure = 8;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_8;}
}
if (!PyArray_Check(py_V7)) {
PyErr_SetString(PyExc_ValueError, "expected an ndarray");
{
__failure = 8;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_8;}
}
// We expect NPY_FLOAT64
if (!PyArray_ISALIGNED((PyArrayObject*) py_V7)) {
PyArrayObject * tmp = (PyArrayObject*) py_V7;
PyErr_Format(PyExc_NotImplementedError,
"expected an aligned array of type %ld "
"(NPY_FLOAT64), got non-aligned array of type %ld"
" with %ld dimensions, with 3 last dims "
"%ld, %ld, %ld"
" and 3 last strides %ld %ld, %ld.",
(long int) NPY_FLOAT64,
(long int) PyArray_TYPE((PyArrayObject*) py_V7),
(long int) PyArray_NDIM(tmp),
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
(long int) PyArray_NDIM(tmp) >= 3 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
(long int) PyArray_NDIM(tmp) >= 2 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
(long int) PyArray_NDIM(tmp) >= 1 ?
PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
);
{
__failure = 8;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_8;}
}
// This is a TypeError to be consistent with DEBUG_MODE
// Note: DEBUG_MODE also tells the name of the container
if (PyArray_TYPE((PyArrayObject*) py_V7) != NPY_FLOAT64) {
PyErr_Format(PyExc_TypeError,
"expected type_num %d (NPY_FLOAT64) got %d",
NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V7));
{
__failure = 8;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_8;}
}
V7 = (PyArrayObject*)(py_V7);
Py_XINCREF(V7);
{
// Op class Dot22Scalar
int unit = 0;
int type_num = PyArray_DESCR(V3)->type_num;
int type_size = PyArray_DESCR(V3)->elsize; // in bytes
npy_intp* Nx = PyArray_DIMS(V3);
npy_intp* Ny = PyArray_DIMS(V5);
npy_intp* Nz = 0; //PyArray_DIMS(V1);
npy_intp* Sx = PyArray_STRIDES(V3);
npy_intp* Sy = PyArray_STRIDES(V5);
npy_intp* Sz = 0; //PyArray_STRIDES(V1);
//strides for x, y, z in dimensions 0, 1
int sx_0, sx_1, sy_0, sy_1, sz_0, sz_1;
if (PyArray_NDIM(V3) != 2) {
PyErr_Format(PyExc_NotImplementedError,
"rank(x) != 2. rank(x) is %d.",
PyArray_NDIM(V3));
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
if (PyArray_NDIM(V5) != 2) {
PyErr_Format(PyExc_NotImplementedError,
"rank(y) != 2. rank(y) is %d.", PyArray_NDIM(V5));
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
if (V1 && PyArray_NDIM(V1) != 2) {
PyErr_Format(PyExc_NotImplementedError,
"rank(z) != 2. rank(z) is %d.", PyArray_NDIM(V1));
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
if ((NULL == V1)
|| (PyArray_DIMS(V1)[0] != PyArray_DIMS(V3)[0])
|| (PyArray_DIMS(V1)[1] != PyArray_DIMS(V5)[1]))
{
if (NULL != V1) Py_XDECREF(V1);
npy_intp dims[2];
dims[0] = PyArray_DIMS(V3)[0];
dims[1] = PyArray_DIMS(V5)[1];
V1 = (PyArrayObject*)PyArray_SimpleNew(2, dims,
PyArray_TYPE(V3));
//fprintf(stderr, "Dot Allocating %i %i\n", dims[0], dims[1]);
if(!V1) {
PyErr_SetString(PyExc_MemoryError,
"failed to alloc dot22 output");
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;}
}
}
Nz = PyArray_DIMS(V1);
Sz = PyArray_STRIDES(V1);
if ((PyArray_DESCR(V3)->type_num != NPY_DOUBLE)
&& (PyArray_DESCR(V3)->type_num != NPY_FLOAT))
{PyErr_SetString(PyExc_NotImplementedError, "type(x) is not double or float"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};}
if ((PyArray_DESCR(V5)->type_num != NPY_DOUBLE)
&& (PyArray_DESCR(V5)->type_num != NPY_FLOAT))
{PyErr_SetString(PyExc_NotImplementedError, "type(y) is not double or float"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};}
if ((PyArray_DESCR(V1)->type_num != NPY_DOUBLE)
&& (PyArray_DESCR(V1)->type_num != NPY_FLOAT))
{PyErr_SetString(PyExc_NotImplementedError, "type(z) is not double or float"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};}
if ((PyArray_DESCR(V3)->type_num != PyArray_DESCR(V5)->type_num)
||(PyArray_DESCR(V3)->type_num != PyArray_DESCR(V1)->type_num))
{ PyErr_SetString(PyExc_NotImplementedError, "type(x), type(y), type(z) are not all the same"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;}; }
if ((PyArray_DESCR(V7)->type_num != NPY_DOUBLE)
&& (PyArray_DESCR(V7)->type_num != NPY_FLOAT))
{PyErr_SetString(PyExc_NotImplementedError,
"type(a) is not double or float"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};}
if (Nx[0] != Nz[0])
{
PyErr_Format(PyExc_ValueError,
"Shape mismatch: x has %ld rows but z has %ld rows",
(long int)Nx[0], (long int)Nz[0]);
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
if (Nx[1] != Ny[0])
{
PyErr_Format(PyExc_ValueError,
"Shape mismatch: x has %ld cols (and %ld rows) but y has %ld rows (and %ld cols)",
(long int)Nx[1], (long int)Nx[0], (long int)Ny[0], (long int)Ny[1]);
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
if (Ny[1] != Nz[1])
{
PyErr_Format(PyExc_ValueError,
"Shape mismatch: y has %ld cols but z has %ld cols",
(long int)Ny[1], (long int)Nz[1]);
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
}
// We must not raise an error when Nx[1] == 0. This would disable cases
// that numpy.dot accept.
/*
If some matrices are not contiguous on either dimensions,
or have invalid strides, copy their content into a contiguous one
*/
if ((Sx[0] < 1) || (Sx[1] < 1) || (Sx[0] MOD type_size) || (Sx[1] MOD type_size)
|| ((Sx[0] != type_size) && (Sx[1] != type_size)))
{
PyArrayObject * _x_copy = (PyArrayObject *) PyArray_Copy(V3);
if (!_x_copy)
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;}
Py_XDECREF(V3);
V3 = _x_copy;
Sx = PyArray_STRIDES(V3);
}
if ((Sy[0] < 1) || (Sy[1] < 1) || (Sy[0] MOD type_size) || (Sy[1] MOD type_size)
|| ((Sy[0] != type_size) && (Sy[1] != type_size)))
{
PyArrayObject * _y_copy = (PyArrayObject *) PyArray_Copy(V5);
if (!_y_copy)
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;}
Py_XDECREF(V5);
V5 = _y_copy;
Sy = PyArray_STRIDES(V5);
}
if ((Sz[0] < 1) || (Sz[1] < 1) || (Sz[0] MOD type_size) || (Sz[1] MOD type_size)
|| ((Sz[0] != type_size) && (Sz[1] != type_size)))
{
PyArrayObject * _z_copy = (PyArrayObject *) PyArray_Copy(V1);
if (!_z_copy)
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;}
Py_XDECREF(V1);
V1 = _z_copy;
Sz = PyArray_STRIDES(V1);
}
/*
encode the stride structure of _x,_y,_zout into a single integer
*/
unit |= ((Sx[1] == type_size || Nx[1]==1) ? 0x0 : (Sx[0] == type_size || Nx[0]==1) ? 0x1 : 0x2) << 8;
unit |= ((Sy[1] == type_size || Ny[1]==1) ? 0x0 : (Sy[0] == type_size || Ny[0]==1) ? 0x1 : 0x2) << 4;
unit |= ((Sz[1] == type_size || Nz[1]==1) ? 0x0 : (Sz[0] == type_size || Nz[0]==1) ? 0x1 : 0x2) << 0;
/* create appropriate strides for malformed matrices that are row or column
* vectors, or empty matrices.
* In that case, the value of the stride does not really matter, but
* some versions of BLAS insist that:
* - they are not smaller than the number of elements in the array,
* - they are not 0.
*/
sx_0 = (Nx[0] > 1) ? Sx[0]/type_size : (Nx[1] + 1);
sx_1 = (Nx[1] > 1) ? Sx[1]/type_size : (Nx[0] + 1);
sy_0 = (Ny[0] > 1) ? Sy[0]/type_size : (Ny[1] + 1);
sy_1 = (Ny[1] > 1) ? Sy[1]/type_size : (Ny[0] + 1);
sz_0 = (Nz[0] > 1) ? Sz[0]/type_size : (Nz[1] + 1);
sz_1 = (Nz[1] > 1) ? Sz[1]/type_size : (Nz[0] + 1);
switch (type_num)
{
case NPY_FLOAT:
{
#define REAL float
float a = (PyArray_DESCR(V7)->type_num == NPY_FLOAT)
? (REAL)(((float*)PyArray_DATA(V7))[0])
: (REAL)(((double*)PyArray_DATA(V7))[0]);
#undef REAL
float b = 0.0;
float* x = (float*)PyArray_DATA(V3);
float* y = (float*)PyArray_DATA(V5);
float* z = (float*)PyArray_DATA(V1);
char N = 'N';
char T = 'T';
int Nz0 = Nz[0], Nz1 = Nz[1], Nx1 = Nx[1];
//std::cerr << (unit/256) MOD 16 << (unit / 16) MOD 16 << unit MOD 16<< '\n';
//double t0 = time_time();
switch(unit)
{
case 0x000: sgemm_(&N, &N, &Nz1, &Nz0, &Nx1, &a, y, &sy_0, x, &sx_0, &b, z, &sz_0); break;
case 0x100: sgemm_(&N, &T, &Nz1, &Nz0, &Nx1, &a, y, &sy_0, x, &sx_1, &b, z, &sz_0); break;
case 0x010: sgemm_(&T, &N, &Nz1, &Nz0, &Nx1, &a, y, &sy_1, x, &sx_0, &b, z, &sz_0); break;
case 0x110: sgemm_(&T, &T, &Nz1, &Nz0, &Nx1, &a, y, &sy_1, x, &sx_1, &b, z, &sz_0); break;
case 0x001: sgemm_(&T, &T, &Nz0, &Nz1, &Nx1, &a, x, &sx_0, y, &sy_0, &b, z, &sz_1); break;
case 0x101: sgemm_(&N, &T, &Nz0, &Nz1, &Nx1, &a, x, &sx_1, y, &sy_0, &b, z, &sz_1); break;
case 0x011: sgemm_(&T, &N, &Nz0, &Nz1, &Nx1, &a, x, &sx_0, y, &sy_1, &b, z, &sz_1); break;
case 0x111: sgemm_(&N, &N, &Nz0, &Nz1, &Nx1, &a, x, &sx_1, y, &sy_1, &b, z, &sz_1); break;
default: PyErr_SetString(PyExc_ValueError, "some matrix has no unit stride"); {
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
};
//fprintf(stderr, "Calling sgemm %i %i %i %i took %f\n", unit, Nz1, Nz0, Nx1, time_time() - t0);
}
break;
case NPY_DOUBLE:
{
#define REAL double
double a = (PyArray_DESCR(V7)->type_num == NPY_FLOAT)
? (REAL)(((float*)PyArray_DATA(V7))[0])
: (REAL)(((double*)PyArray_DATA(V7))[0]);
#undef REAL
double b = 0.0;
double* x = (double*)PyArray_DATA(V3);
double* y = (double*)PyArray_DATA(V5);
double* z = (double*)PyArray_DATA(V1);
char N = 'N';
char T = 'T';
int Nz0 = Nz[0], Nz1 = Nz[1], Nx1 = Nx[1];
//std::cerr << (unit/256) MOD 16 << (unit / 16) MOD 16 << unit MOD 16<< '\n';
//double t0 = time_time();
//fprintf(stderr, "unit=%x N= %i %i %i S = %i %i %i %i %i %i\n", unit,
//Nz1, Nz0, Nx1,
//sy_0, sy_1,
//sx_0, sx_1,
//sz_0, sz_1
//);
switch(unit)
{
case 0x000: dgemm_(&N, &N, &Nz1, &Nz0, &Nx1, &a, y,
&sy_0, x, &sx_0, &b, z, &sz_0); break;
case 0x100: dgemm_(&N, &T, &Nz1, &Nz0, &Nx1, &a, y,
&sy_0, x, &sx_1, &b, z, &sz_0); break;
case 0x010: dgemm_(&T, &N, &Nz1, &Nz0, &Nx1, &a, y,
&sy_1, x, &sx_0, &b, z, &sz_0); break;
case 0x110: dgemm_(&T, &T, &Nz1, &Nz0, &Nx1, &a, y,
&sy_1, x, &sx_1, &b, z, &sz_0); break;
case 0x001: dgemm_(&T, &T, &Nz0, &Nz1, &Nx1, &a, x,
&sx_0, y, &sy_0, &b, z, &sz_1); break;
case 0x101: dgemm_(&N, &T, &Nz0, &Nz1, &Nx1, &a, x,
&sx_1, y, &sy_0, &b, z, &sz_1); break;
case 0x011: dgemm_(&T, &N, &Nz0, &Nz1, &Nx1, &a, x,
&sx_0, y, &sy_1, &b, z, &sz_1); break;
case 0x111: dgemm_(&N, &N, &Nz0, &Nz1, &Nx1, &a, x,
&sx_1, y, &sy_1, &b, z, &sz_1); break;
default: PyErr_SetString(PyExc_ValueError,
"some matrix has no unit stride");
{
__failure = 9;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_9;};
};
//fprintf(stderr, "Calling dgemm %i %i %i %i took %f\n",
// unit, Nz1, Nz0, Nx1, time_time()- t0);
}
break;
}
__label_9:
double __DUMMY_9;
}
__label_8:
if (V7) {
Py_XDECREF(V7);
}
{Py_XDECREF(py_V7);}
double __DUMMY_8;
}
__label_6:
if (V5) {
Py_XDECREF(V5);
}
{Py_XDECREF(py_V5);}
double __DUMMY_6;
}
__label_4:
if (V3) {
Py_XDECREF(V3);
}
{Py_XDECREF(py_V3);}
double __DUMMY_4;
}
__label_2:
if (!__failure) {
{Py_XDECREF(py_V1);}
if (!V1) {
Py_INCREF(Py_None);
py_V1 = Py_None;
}
else if ((void*)py_V1 != (void*)V1) {
py_V1 = (PyObject*)V1;
}
{Py_XINCREF(py_V1);}
if (V1 && !PyArray_ISALIGNED((PyArrayObject*) py_V1)) {
PyErr_Format(PyExc_NotImplementedError,
"c_sync: expected an aligned array, got non-aligned array of type %ld"
" with %ld dimensions, with 3 last dims "
"%ld, %ld, %ld"
" and 3 last strides %ld %ld, %ld.",
(long int) PyArray_TYPE((PyArrayObject*) py_V1),
(long int) PyArray_NDIM(V1),
(long int) PyArray_NDIM(V1) >= 3 ?
PyArray_DIMS(V1)[PyArray_NDIM(V1)-3] : -1,
(long int) PyArray_NDIM(V1) >= 2 ?
PyArray_DIMS(V1)[PyArray_NDIM(V1)-2] : -1,
(long int) PyArray_NDIM(V1) >= 1 ?
PyArray_DIMS(V1)[PyArray_NDIM(V1)-1] : -1,
(long int) PyArray_NDIM(V1) >= 3 ?
PyArray_STRIDES(V1)[PyArray_NDIM(V1)-3] : -1,
(long int) PyArray_NDIM(V1) >= 2 ?
PyArray_STRIDES(V1)[PyArray_NDIM(V1)-2] : -1,
(long int) PyArray_NDIM(V1) >= 1 ?
PyArray_STRIDES(V1)[PyArray_NDIM(V1)-1] : -1
);
{
__failure = 2;
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError,
"Unexpected error in an Op's C code. "
"No Python exception was set.");
}
goto __label_2;}
}
PyObject* old = PyList_GET_ITEM(storage_V1, 0);
{Py_XINCREF(py_V1);}
PyList_SET_ITEM(storage_V1, 0, py_V1);
{Py_XDECREF(old);}
}
if (V1) {
Py_XDECREF(V1);
}
{Py_XDECREF(py_V1);}
double __DUMMY_2;
}
if (__failure) {
// When there is a failure, this code puts the exception
// in __ERROR.
PyObject* err_type = NULL;
PyObject* err_msg = NULL;
PyObject* err_traceback = NULL;
PyErr_Fetch(&err_type, &err_msg, &err_traceback);
if (!err_type) {err_type = Py_None;Py_INCREF(Py_None);}
if (!err_msg) {err_msg = Py_None; Py_INCREF(Py_None);}
if (!err_traceback) {err_traceback = Py_None; Py_INCREF(Py_None);}
PyObject* old_err_type = PyList_GET_ITEM(__ERROR, 0);
PyObject* old_err_msg = PyList_GET_ITEM(__ERROR, 1);
PyObject* old_err_traceback = PyList_GET_ITEM(__ERROR, 2);
PyList_SET_ITEM(__ERROR, 0, err_type);
PyList_SET_ITEM(__ERROR, 1, err_msg);
PyList_SET_ITEM(__ERROR, 2, err_traceback);
{Py_XDECREF(old_err_type);}
{Py_XDECREF(old_err_msg);}
{Py_XDECREF(old_err_traceback);}
}
// The failure code is returned to index what code block failed.
return __failure;
}
};
}
static int __struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2_executor(__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2* self) {
return self->run();
}
static void __struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2_destructor(void* executor, void* self) {
delete ((__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2*)self);
}
//////////////////////
//// Functions
//////////////////////
static PyObject * instantiate(PyObject * self, PyObject *argtuple) {
assert(PyTuple_Check(argtuple));
if (5 != PyTuple_Size(argtuple)){
PyErr_Format(PyExc_TypeError, "Wrong number of arguments, expected 5, got %i", (int)PyTuple_Size(argtuple));
return NULL;
}
__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2* struct_ptr = new __struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2();
if (struct_ptr->init( PyTuple_GET_ITEM(argtuple, 0),PyTuple_GET_ITEM(argtuple, 1),PyTuple_GET_ITEM(argtuple, 2),PyTuple_GET_ITEM(argtuple, 3),PyTuple_GET_ITEM(argtuple, 4) ) != 0) {
delete struct_ptr;
return NULL;
}
PyObject* thunk = PyCObject_FromVoidPtrAndDesc((void*)(&__struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2_executor), struct_ptr, __struct_compiled_op_87b8c156d6744fd0f0e7e131a852cdd2_destructor);
return thunk; }
//////////////////////
//// Module init
//////////////////////
static PyMethodDef MyMethods[] = {
{"instantiate", instantiate, METH_VARARGS, "undocumented"} ,
{NULL, NULL, 0, NULL}
};
PyMODINIT_FUNC init87b8c156d6744fd0f0e7e131a852cdd2(void){
import_array();
(void) Py_InitModule("87b8c156d6744fd0f0e7e131a852cdd2", MyMethods);
}
|
[
"rajaquep@gmail.com"
] |
rajaquep@gmail.com
|
2bed5c7ed77176db7fef2b7f04215161c59383a6
|
eeedb4ed8dfdd61e2f643e0e2460aef798476694
|
/src/opeq.cpp
|
0befc506f12c0c19a024e0bedde1770bf7a02032
|
[] |
no_license
|
ParkSeungwon/progs
|
7849b36697179260e7dd1d620a6132e81d4da6e6
|
bc4280b1176da5f7b32549b1d108adc34b0f48e7
|
refs/heads/master
| 2022-03-24T11:05:00.242822
| 2019-12-14T09:54:18
| 2019-12-14T09:54:18
| 198,050,876
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 218
|
cpp
|
#include<iostream>
using namespace std;
class A
{
public:
int i;
A& operator=(int k) {
i = k;
}
};
class B : public A
{
public:
B(int a) {
A::operator=(a);
cout << i;
}
};
int main()
{
A a;
B b(3);
}
|
[
"zezeon@msn.com"
] |
zezeon@msn.com
|
ce9c7f0edfb96f76a122dc5ccfd1ce921d188242
|
86221af671fb3a667f6855fe54b0faf7d9786468
|
/GSP420OpenGLEngine/Vector2D.hpp
|
58207ff05a229ff57b4dc2008d882466fc32c949
|
[] |
no_license
|
b-estivens/GSP420OpenGLEngine
|
912e3b6bbca440d98b3bec7c8fdaef792aef2e74
|
b86f5eddaab013c30109235fee3717efd62b0833
|
refs/heads/master
| 2021-01-18T03:02:01.259838
| 2015-11-08T20:51:13
| 2015-11-08T20:51:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,817
|
hpp
|
#pragma once
template <class t>
class Vector2D
{
public:
t x;
t y;
Vector2D(void): x(0),y(0){}
Vector2D(t x_,t y_):x(x_),y(y_){}
~Vector2D(void){}
Vector2D operator -(Vector2D other)
{
Vector2D ret = *this;
ret.x -= other.x;
ret.y -= other.y;
return ret;
}
Vector2D operator +(Vector2D other)
{
Vector2D ret = *this;
ret.x += other.x;
ret.y += other.y;
return ret;
}
Vector2D operator *(Vector2D other)
{
Vector2D ret = *this;
ret.x *= other.x;
ret.y *= other.y;
return ret;
}
Vector2D operator /(Vector2D other)
{
Vector2D ret = *this;
ret.x /= other.x;
ret.y /= other.y;
return ret;
}
Vector2D operator =(Vector2D other)
{
x = other.x;
y = other.y;
return *this;
}
Vector2D operator -=(Vector2D other)
{
x -= other.x;
y -= other.y;
return *this;
}
Vector2D operator +=(Vector2D other)
{
x += other.x;
y += other.y;
return *this;
}
Vector2D operator *=(Vector2D other)
{
x *= other.x;
y *= other.y;
return *this;
}
Vector2D operator /=(Vector2D other)
{
x /= other.x;
y /= other.y;
return *this;
}
Vector2D operator -(t scalor)
{
Vector2D ret = *this;
ret.x -= scalor;
ret.y -= scalor;
return ret;
}
Vector2D operator +(t scalor)
{
Vector2D ret = *this;
ret.x += scalor;
ret.y += scalor;
return ret;
}
Vector2D operator *(t scalor)
{
Vector2D ret = *this;
ret.x *= scalor;
ret.y *= scalor;
return ret;
}
Vector2D operator /(t scalor)
{
Vector2D ret = *this;
ret.x /= scalor;
ret.y /= scalor;
return ret;
}
Vector2D operator -=(t scalor)
{
x -= scalor;
y -= scalor;
return *this;
}
Vector2D operator +=(t scalor)
{
x += scalor;
y += scalor;
return *this;
}
Vector2D operator *=(t scalor)
{
x *= scalor;
y *= scalor;
return *this;
}
Vector2D operator /=(t scalor)
{
x /= scalor;
y /= scalor;
return *this;
}
Vector2D operator =(t scalor)
{
x = scalor;
y = scalor;
return *this;
}
void rotate(Vector2D origin,float angle /*radians*/)
{
Vector2D p(*this);
float s = sin(angle);
float c = cos(angle);
// translate point back to origin:
p.x -= origin.x;
p.y -= origin.y;
// rotate point
float xnew = p.x * c - p.y * s;
float ynew = p.x * s + p.y * c;
// translate point back:
p.x = xnew + origin.x;
p.y = ynew + origin.y;
x = p.x;
y = p.y;
}
t magnitude()
{
return sqrt((x*x) + (y*y));
}
void normalize()
{
t mag = magnitude();
*this /= mag;
}
};
typedef Vector2D<int> Vec2I;
typedef Vector2D<float> Vec2F;
typedef Vector2D<double> Vec2D;
|
[
"jcopela4@gmail.com"
] |
jcopela4@gmail.com
|
ff61bf579a1935d1a0e970ea9b296891c50a7c12
|
d15bdaddab59d1cfea76790004cbad3e5f0c2c55
|
/batkin/devel_isolated/path_server/include/path_server/SetPathNameRequest.h
|
ad8ff64309add24f29bf424c03d0018e2449428a
|
[] |
no_license
|
gychen-n/robot
|
4265a1ff469d22550b6b537d1c81aa846ee7641a
|
0663a33aea2c2de9e3ac5863307619091e5b5959
|
refs/heads/main
| 2023-04-10T13:32:06.623682
| 2021-04-16T00:41:04
| 2021-04-16T00:41:04
| 358,431,232
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,272
|
h
|
// Generated by gencpp from file path_server/SetPathNameRequest.msg
// DO NOT EDIT!
#ifndef PATH_SERVER_MESSAGE_SETPATHNAMEREQUEST_H
#define PATH_SERVER_MESSAGE_SETPATHNAMEREQUEST_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
namespace path_server
{
template <class ContainerAllocator>
struct SetPathNameRequest_
{
typedef SetPathNameRequest_<ContainerAllocator> Type;
SetPathNameRequest_()
: path_name() {
}
SetPathNameRequest_(const ContainerAllocator& _alloc)
: path_name(_alloc) {
(void)_alloc;
}
typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _path_name_type;
_path_name_type path_name;
typedef boost::shared_ptr< ::path_server::SetPathNameRequest_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::path_server::SetPathNameRequest_<ContainerAllocator> const> ConstPtr;
}; // struct SetPathNameRequest_
typedef ::path_server::SetPathNameRequest_<std::allocator<void> > SetPathNameRequest;
typedef boost::shared_ptr< ::path_server::SetPathNameRequest > SetPathNameRequestPtr;
typedef boost::shared_ptr< ::path_server::SetPathNameRequest const> SetPathNameRequestConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::path_server::SetPathNameRequest_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::path_server::SetPathNameRequest_<ContainerAllocator> >::stream(s, "", v);
return s;
}
} // namespace path_server
namespace ros
{
namespace message_traits
{
// BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': False}
// {'std_msgs': ['/opt/ros/kinetic/share/std_msgs/cmake/../msg']}
// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']
template <class ContainerAllocator>
struct IsFixedSize< ::path_server::SetPathNameRequest_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::path_server::SetPathNameRequest_<ContainerAllocator> const>
: FalseType
{ };
template <class ContainerAllocator>
struct IsMessage< ::path_server::SetPathNameRequest_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::path_server::SetPathNameRequest_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::path_server::SetPathNameRequest_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::path_server::SetPathNameRequest_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::path_server::SetPathNameRequest_<ContainerAllocator> >
{
static const char* value()
{
return "3572e731ca915997319cdf3e8b7f260b";
}
static const char* value(const ::path_server::SetPathNameRequest_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0x3572e731ca915997ULL;
static const uint64_t static_value2 = 0x319cdf3e8b7f260bULL;
};
template<class ContainerAllocator>
struct DataType< ::path_server::SetPathNameRequest_<ContainerAllocator> >
{
static const char* value()
{
return "path_server/SetPathNameRequest";
}
static const char* value(const ::path_server::SetPathNameRequest_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::path_server::SetPathNameRequest_<ContainerAllocator> >
{
static const char* value()
{
return "string path_name\n\
";
}
static const char* value(const ::path_server::SetPathNameRequest_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::path_server::SetPathNameRequest_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.path_name);
}
ROS_DECLARE_ALLINONE_SERIALIZER
}; // struct SetPathNameRequest_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::path_server::SetPathNameRequest_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::path_server::SetPathNameRequest_<ContainerAllocator>& v)
{
s << indent << "path_name: ";
Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.path_name);
}
};
} // namespace message_operations
} // namespace ros
#endif // PATH_SERVER_MESSAGE_SETPATHNAMEREQUEST_H
|
[
"gyc@autolabor-host.autolabor-domain"
] |
gyc@autolabor-host.autolabor-domain
|
0d551cb930d449b0b2af7dac0bdd1edd6379ded4
|
454e66cae3bdf850f9a014265a4bdc1813fe8a8d
|
/src/snark/libsnark/algebra/evaluation_domain/evaluation_domain.tcc
|
8e3ea7a625b4795371e4acef0247bd6cd562f177
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"AGPL-3.0-only"
] |
permissive
|
interbiznw/BTCP-Rebase
|
c97921a26b03e6358afbe8642d5acba7c1729781
|
3d3f3471018a28835426fe423465899f39f81f77
|
refs/heads/master
| 2020-04-01T06:05:42.515957
| 2018-10-18T03:59:13
| 2018-10-18T03:59:13
| 131,097,839
| 0
| 0
|
MIT
| 2018-10-14T02:40:21
| 2018-04-26T03:59:31
|
C++
|
UTF-8
|
C++
| false
| false
| 3,494
|
tcc
|
/** @file
*****************************************************************************
Imeplementation of interfaces for evaluation domains.
See evaluation_domain.hpp .
We currently implement, and select among, three types of domains:
- "basic radix-2": the domain has size m = 2^k and consists of the m-th roots of unity
- "extended radix-2": the domain has size m = 2^{k+1} and consists of "the m-th roots of unity" union "a coset"
- "step radix-2": the domain has size m = 2^k + 2^r and consists of "the 2^k-th roots of unity" union "a coset of 2^r-th roots of unity"
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
*****************************************************************************/
#ifndef EVALUATION_DOMAIN_TCC_
#define EVALUATION_DOMAIN_TCC_
#include <cassert>
#include "algebra/fields/field_utils.hpp"
#include "algebra/evaluation_domain/domains/basic_radix2_domain.hpp"
namespace libsnark {
template<typename FieldT>
std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t min_size)
{
assert(min_size > 1);
const size_t log_min_size = log2(min_size);
assert(log_min_size <= (FieldT::s+1));
std::shared_ptr<evaluation_domain<FieldT> > result;
if (min_size == (1u << log_min_size))
{
if (log_min_size == FieldT::s+1)
{
if (!inhibit_profiling_info)
{
print_indent(); printf("* Selected domain: extended_radix2\n");
}
assert(0);
}
else
{
if (!inhibit_profiling_info)
{
print_indent(); printf("* Selected domain: basic_radix2\n");
}
result.reset(new basic_radix2_domain<FieldT>(min_size));
}
}
else
{
const size_t big = 1ul<<(log2(min_size)-1);
const size_t small = min_size - big;
const size_t rounded_small = (1ul<<log2(small));
if (big == rounded_small)
{
if (log2(big + rounded_small) < FieldT::s+1)
{
if (!inhibit_profiling_info)
{
print_indent(); printf("* Selected domain: basic_radix2\n");
}
result.reset(new basic_radix2_domain<FieldT>(big + rounded_small));
}
else
{
if (!inhibit_profiling_info)
{
print_indent(); printf("* Selected domain: extended_radix2\n");
}
assert(0);
}
}
else
{
if (!inhibit_profiling_info)
{
print_indent(); printf("* Selected domain: step_radix2\n");
}
assert(0);
}
}
return result;
}
template<typename FieldT>
FieldT lagrange_eval(const size_t m, const std::vector<FieldT> &domain, const FieldT &t, const size_t idx)
{
assert(m == domain.size());
assert(idx < m);
FieldT num = FieldT::one();
FieldT denom = FieldT::one();
for (size_t k = 0; k < m; ++k)
{
if (k == idx)
{
continue;
}
num *= t - domain[k];
denom *= domain[idx] - domain[k];
}
return num * denom.inverse();
}
} // libsnark
#endif // EVALUATION_DOMAIN_TCC_
|
[
"jc@jc"
] |
jc@jc
|
6759bbae92a8ec29c421a446c82b6b7a23c086da
|
26d51ff6ecadb944b4b5a9bd2facd81dd0bf3a33
|
/Methods/liczby_pierwsze.cpp
|
8df5c156dc8c7c3a15ee3588fcb5a9265d7c68f9
|
[] |
no_license
|
PiotrK21/Spoj
|
2afded8c69cb9ce081e75848e70bf65f09a55344
|
f16f1c9071730a22bec96f55eacd5201db20e8b5
|
refs/heads/master
| 2020-03-29T23:35:57.320687
| 2018-09-26T19:55:48
| 2018-09-26T19:55:48
| 150,480,056
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 845
|
cpp
|
#include <iostream>
#include <math.h>
#include "zadania.h"
using namespace std;
void pierwsza(int x)
{
if((x%((int)sqrt(x))==0 && x>3) || x==1) cout <<"NIE"<<endl;
else if(x==2 || x==3) cout <<"TAK"<<endl;
else
{
int liczba = sqrt(x);
int j=0;
while(x%(liczba-j)!=0)
{
if((liczba-(j+1))==1)
{
cout<<"TAK"<<endl;
return;
}
else j++;
}
cout <<"NIE"<<endl;
}
}
void Liczby_pierwsze()
{
int n;
unsigned int *tab;
cin >> n;
tab = new unsigned int [n];
for(int i=0; i<n; i++)
{
cin >> tab[i];
}
for(int i=0; i<n; i++)
{
pierwsza(tab[i]);
}
/*for(int i=0; i<n; i++)
{
cout << tab[i] << endl;
}*/
delete [] tab;
}
|
[
"piotrek0309@vp.pl"
] |
piotrek0309@vp.pl
|
67587ef795b958edad86b0040b0eacb3e2de42c0
|
32fee513cd946f175dbf065aa014e57f6da6c56c
|
/TCP/TCP/serverwidget.h
|
4a3cf583996cbb7c48de42e638f5388a5488a959
|
[] |
no_license
|
HhTtLllL/qt
|
d329e38ebc16740965cc02331d8e34a8499da223
|
85702f20b9ada5e5bc97c3b56fba16a0d71acda3
|
refs/heads/master
| 2021-02-12T09:40:27.252739
| 2020-05-28T17:48:41
| 2020-05-28T17:48:41
| 244,582,947
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 565
|
h
|
#ifndef SERVERWIDGET_H
#define SERVERWIDGET_H
#include <QWidget>
#include <QTcpServer> //监听套接字
#include <QTcpSocket> //通信套接字
namespace Ui {
class ServerWidget;
}
class ServerWidget : public QWidget
{
Q_OBJECT
public:
explicit ServerWidget(QWidget *parent = nullptr);
~ServerWidget();
private slots:
void on_buttonSend_clicked();
void on_buttonClose_clicked();
private:
Ui::ServerWidget *ui;
QTcpServer *tcpServer; //监听套接字
QTcpSocket * tcpSocket; //通信套接字
};
#endif // SERVERWIDGET_H
|
[
"1430249706@qq.com"
] |
1430249706@qq.com
|
96b12ce7100015723d7332e108dd6f5ee207dd92
|
df7fb26cf3143294b61bc5274c5f62e91f304730
|
/Library/Il2cppBuildCache/iOS/il2cppOutput/UnityEngine.AudioModule_Attr.cpp
|
ffa53d8c7335c83b088e9d866eec6e68fca1748f
|
[] |
no_license
|
noguchi-no/symbolchange
|
cd088c9b5472f069d9615f83f2a113eb5fb721ec
|
adbdf20831837d2bde8af589e57282a6438e6685
|
refs/heads/master
| 2023-08-28T05:04:12.470790
| 2021-10-24T12:08:46
| 2021-10-24T12:08:46
| 412,973,648
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 129,714
|
cpp
|
#include "pch-cpp.hpp"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <limits>
#include <stdint.h>
// System.Char[]
struct CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34;
// System.Type[]
struct TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755;
// System.Reflection.Binder
struct Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30;
// System.Runtime.CompilerServices.CompilationRelaxationsAttribute
struct CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF;
// System.Runtime.CompilerServices.CompilerGeneratedAttribute
struct CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C;
// System.Diagnostics.DebuggableAttribute
struct DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B;
// System.Diagnostics.DebuggerBrowsableAttribute
struct DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53;
// UnityEngine.Internal.DefaultValueAttribute
struct DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122;
// UnityEngine.Internal.ExcludeFromDocsAttribute
struct ExcludeFromDocsAttribute_tF2E270E47DCFC0F0F22FA6D71B95FF71B08703B8;
// System.Runtime.CompilerServices.ExtensionAttribute
struct ExtensionAttribute_t917F3F92E717DC8B2D7BC03967A9790B1B8EF7CC;
// System.Runtime.CompilerServices.InternalsVisibleToAttribute
struct InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C;
// System.Reflection.MemberFilter
struct MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81;
// UnityEngine.Bindings.NativeHeaderAttribute
struct NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C;
// UnityEngine.Bindings.NativeTypeAttribute
struct NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9;
// UnityEngine.Bindings.NotNullAttribute
struct NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC;
// UnityEngine.RequireComponent
struct RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91;
// UnityEngine.Scripting.RequiredByNativeCodeAttribute
struct RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20;
// System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
struct RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80;
// UnityEngine.Bindings.StaticAccessorAttribute
struct StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA;
// System.String
struct String_t;
// System.Type
struct Type_t;
// UnityEngine.UnityEngineModuleAssembly
struct UnityEngineModuleAssembly_t33CB058FDDDC458E384578147D6027BB1EC86CFF;
// System.Void
struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5;
IL2CPP_EXTERN_C const RuntimeType* Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1_0_0_0_var;
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
// System.Object
// System.Attribute
struct Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71 : public RuntimeObject
{
public:
public:
};
// System.Reflection.MemberInfo
struct MemberInfo_t : public RuntimeObject
{
public:
public:
};
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value);
}
};
// System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_com
{
};
// System.Boolean
struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37
{
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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37, ___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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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.Runtime.CompilerServices.CompilationRelaxationsAttribute
struct CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Int32 System.Runtime.CompilerServices.CompilationRelaxationsAttribute::m_relaxations
int32_t ___m_relaxations_0;
public:
inline static int32_t get_offset_of_m_relaxations_0() { return static_cast<int32_t>(offsetof(CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF, ___m_relaxations_0)); }
inline int32_t get_m_relaxations_0() const { return ___m_relaxations_0; }
inline int32_t* get_address_of_m_relaxations_0() { return &___m_relaxations_0; }
inline void set_m_relaxations_0(int32_t value)
{
___m_relaxations_0 = value;
}
};
// System.Runtime.CompilerServices.CompilerGeneratedAttribute
struct CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
public:
};
// UnityEngine.Internal.DefaultValueAttribute
struct DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Object UnityEngine.Internal.DefaultValueAttribute::DefaultValue
RuntimeObject * ___DefaultValue_0;
public:
inline static int32_t get_offset_of_DefaultValue_0() { return static_cast<int32_t>(offsetof(DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122, ___DefaultValue_0)); }
inline RuntimeObject * get_DefaultValue_0() const { return ___DefaultValue_0; }
inline RuntimeObject ** get_address_of_DefaultValue_0() { return &___DefaultValue_0; }
inline void set_DefaultValue_0(RuntimeObject * value)
{
___DefaultValue_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___DefaultValue_0), (void*)value);
}
};
// System.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA : public ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52
{
public:
public:
};
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_com
{
};
// UnityEngine.Internal.ExcludeFromDocsAttribute
struct ExcludeFromDocsAttribute_tF2E270E47DCFC0F0F22FA6D71B95FF71B08703B8 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
public:
};
// System.Runtime.CompilerServices.ExtensionAttribute
struct ExtensionAttribute_t917F3F92E717DC8B2D7BC03967A9790B1B8EF7CC : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
public:
};
// 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.Runtime.CompilerServices.InternalsVisibleToAttribute
struct InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String System.Runtime.CompilerServices.InternalsVisibleToAttribute::_assemblyName
String_t* ____assemblyName_0;
// System.Boolean System.Runtime.CompilerServices.InternalsVisibleToAttribute::_allInternalsVisible
bool ____allInternalsVisible_1;
public:
inline static int32_t get_offset_of__assemblyName_0() { return static_cast<int32_t>(offsetof(InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C, ____assemblyName_0)); }
inline String_t* get__assemblyName_0() const { return ____assemblyName_0; }
inline String_t** get_address_of__assemblyName_0() { return &____assemblyName_0; }
inline void set__assemblyName_0(String_t* value)
{
____assemblyName_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&____assemblyName_0), (void*)value);
}
inline static int32_t get_offset_of__allInternalsVisible_1() { return static_cast<int32_t>(offsetof(InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C, ____allInternalsVisible_1)); }
inline bool get__allInternalsVisible_1() const { return ____allInternalsVisible_1; }
inline bool* get_address_of__allInternalsVisible_1() { return &____allInternalsVisible_1; }
inline void set__allInternalsVisible_1(bool value)
{
____allInternalsVisible_1 = value;
}
};
// UnityEngine.Bindings.NativeHeaderAttribute
struct NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String UnityEngine.Bindings.NativeHeaderAttribute::<Header>k__BackingField
String_t* ___U3CHeaderU3Ek__BackingField_0;
public:
inline static int32_t get_offset_of_U3CHeaderU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C, ___U3CHeaderU3Ek__BackingField_0)); }
inline String_t* get_U3CHeaderU3Ek__BackingField_0() const { return ___U3CHeaderU3Ek__BackingField_0; }
inline String_t** get_address_of_U3CHeaderU3Ek__BackingField_0() { return &___U3CHeaderU3Ek__BackingField_0; }
inline void set_U3CHeaderU3Ek__BackingField_0(String_t* value)
{
___U3CHeaderU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CHeaderU3Ek__BackingField_0), (void*)value);
}
};
// UnityEngine.Bindings.NotNullAttribute
struct NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String UnityEngine.Bindings.NotNullAttribute::<Exception>k__BackingField
String_t* ___U3CExceptionU3Ek__BackingField_0;
public:
inline static int32_t get_offset_of_U3CExceptionU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC, ___U3CExceptionU3Ek__BackingField_0)); }
inline String_t* get_U3CExceptionU3Ek__BackingField_0() const { return ___U3CExceptionU3Ek__BackingField_0; }
inline String_t** get_address_of_U3CExceptionU3Ek__BackingField_0() { return &___U3CExceptionU3Ek__BackingField_0; }
inline void set_U3CExceptionU3Ek__BackingField_0(String_t* value)
{
___U3CExceptionU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CExceptionU3Ek__BackingField_0), (void*)value);
}
};
// UnityEngine.RequireComponent
struct RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Type UnityEngine.RequireComponent::m_Type0
Type_t * ___m_Type0_0;
// System.Type UnityEngine.RequireComponent::m_Type1
Type_t * ___m_Type1_1;
// System.Type UnityEngine.RequireComponent::m_Type2
Type_t * ___m_Type2_2;
public:
inline static int32_t get_offset_of_m_Type0_0() { return static_cast<int32_t>(offsetof(RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91, ___m_Type0_0)); }
inline Type_t * get_m_Type0_0() const { return ___m_Type0_0; }
inline Type_t ** get_address_of_m_Type0_0() { return &___m_Type0_0; }
inline void set_m_Type0_0(Type_t * value)
{
___m_Type0_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_Type0_0), (void*)value);
}
inline static int32_t get_offset_of_m_Type1_1() { return static_cast<int32_t>(offsetof(RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91, ___m_Type1_1)); }
inline Type_t * get_m_Type1_1() const { return ___m_Type1_1; }
inline Type_t ** get_address_of_m_Type1_1() { return &___m_Type1_1; }
inline void set_m_Type1_1(Type_t * value)
{
___m_Type1_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_Type1_1), (void*)value);
}
inline static int32_t get_offset_of_m_Type2_2() { return static_cast<int32_t>(offsetof(RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91, ___m_Type2_2)); }
inline Type_t * get_m_Type2_2() const { return ___m_Type2_2; }
inline Type_t ** get_address_of_m_Type2_2() { return &___m_Type2_2; }
inline void set_m_Type2_2(Type_t * value)
{
___m_Type2_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_Type2_2), (void*)value);
}
};
// UnityEngine.Scripting.RequiredByNativeCodeAttribute
struct RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String UnityEngine.Scripting.RequiredByNativeCodeAttribute::<Name>k__BackingField
String_t* ___U3CNameU3Ek__BackingField_0;
// System.Boolean UnityEngine.Scripting.RequiredByNativeCodeAttribute::<Optional>k__BackingField
bool ___U3COptionalU3Ek__BackingField_1;
// System.Boolean UnityEngine.Scripting.RequiredByNativeCodeAttribute::<GenerateProxy>k__BackingField
bool ___U3CGenerateProxyU3Ek__BackingField_2;
public:
inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20, ___U3CNameU3Ek__BackingField_0)); }
inline String_t* get_U3CNameU3Ek__BackingField_0() const { return ___U3CNameU3Ek__BackingField_0; }
inline String_t** get_address_of_U3CNameU3Ek__BackingField_0() { return &___U3CNameU3Ek__BackingField_0; }
inline void set_U3CNameU3Ek__BackingField_0(String_t* value)
{
___U3CNameU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CNameU3Ek__BackingField_0), (void*)value);
}
inline static int32_t get_offset_of_U3COptionalU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20, ___U3COptionalU3Ek__BackingField_1)); }
inline bool get_U3COptionalU3Ek__BackingField_1() const { return ___U3COptionalU3Ek__BackingField_1; }
inline bool* get_address_of_U3COptionalU3Ek__BackingField_1() { return &___U3COptionalU3Ek__BackingField_1; }
inline void set_U3COptionalU3Ek__BackingField_1(bool value)
{
___U3COptionalU3Ek__BackingField_1 = value;
}
inline static int32_t get_offset_of_U3CGenerateProxyU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20, ___U3CGenerateProxyU3Ek__BackingField_2)); }
inline bool get_U3CGenerateProxyU3Ek__BackingField_2() const { return ___U3CGenerateProxyU3Ek__BackingField_2; }
inline bool* get_address_of_U3CGenerateProxyU3Ek__BackingField_2() { return &___U3CGenerateProxyU3Ek__BackingField_2; }
inline void set_U3CGenerateProxyU3Ek__BackingField_2(bool value)
{
___U3CGenerateProxyU3Ek__BackingField_2 = value;
}
};
// System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
struct RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Boolean System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::m_wrapNonExceptionThrows
bool ___m_wrapNonExceptionThrows_0;
public:
inline static int32_t get_offset_of_m_wrapNonExceptionThrows_0() { return static_cast<int32_t>(offsetof(RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80, ___m_wrapNonExceptionThrows_0)); }
inline bool get_m_wrapNonExceptionThrows_0() const { return ___m_wrapNonExceptionThrows_0; }
inline bool* get_address_of_m_wrapNonExceptionThrows_0() { return &___m_wrapNonExceptionThrows_0; }
inline void set_m_wrapNonExceptionThrows_0(bool value)
{
___m_wrapNonExceptionThrows_0 = value;
}
};
// UnityEngine.UnityEngineModuleAssembly
struct UnityEngineModuleAssembly_t33CB058FDDDC458E384578147D6027BB1EC86CFF : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
public:
};
// System.Void
struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5
{
public:
union
{
struct
{
};
uint8_t Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5__padding[1];
};
public:
};
// System.Reflection.BindingFlags
struct BindingFlags_tAAAB07D9AC588F0D55D844E51D7035E96DF94733
{
public:
// System.Int32 System.Reflection.BindingFlags::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(BindingFlags_tAAAB07D9AC588F0D55D844E51D7035E96DF94733, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Bindings.CodegenOptions
struct CodegenOptions_t2D0BDBDCEFA8EC8B714E6F9E84A55557343398FA
{
public:
// System.Int32 UnityEngine.Bindings.CodegenOptions::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(CodegenOptions_t2D0BDBDCEFA8EC8B714E6F9E84A55557343398FA, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Diagnostics.DebuggerBrowsableState
struct DebuggerBrowsableState_t2A824ECEB650CFABB239FD0918FCC88A09B45091
{
public:
// System.Int32 System.Diagnostics.DebuggerBrowsableState::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(DebuggerBrowsableState_t2A824ECEB650CFABB239FD0918FCC88A09B45091, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.RuntimeTypeHandle
struct RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9
{
public:
// System.IntPtr System.RuntimeTypeHandle::value
intptr_t ___value_0;
public:
inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9, ___value_0)); }
inline intptr_t get_value_0() const { return ___value_0; }
inline intptr_t* get_address_of_value_0() { return &___value_0; }
inline void set_value_0(intptr_t value)
{
___value_0 = value;
}
};
// UnityEngine.Bindings.StaticAccessorType
struct StaticAccessorType_tFA86A321ADAC16A48DF7FC82F8FBBE5F71D2DC4C
{
public:
// System.Int32 UnityEngine.Bindings.StaticAccessorType::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(StaticAccessorType_tFA86A321ADAC16A48DF7FC82F8FBBE5F71D2DC4C, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Diagnostics.DebuggableAttribute/DebuggingModes
struct DebuggingModes_t279D5B9C012ABA935887CB73C5A63A1F46AF08A8
{
public:
// System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(DebuggingModes_t279D5B9C012ABA935887CB73C5A63A1F46AF08A8, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Diagnostics.DebuggableAttribute
struct DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Diagnostics.DebuggableAttribute/DebuggingModes System.Diagnostics.DebuggableAttribute::m_debuggingModes
int32_t ___m_debuggingModes_0;
public:
inline static int32_t get_offset_of_m_debuggingModes_0() { return static_cast<int32_t>(offsetof(DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B, ___m_debuggingModes_0)); }
inline int32_t get_m_debuggingModes_0() const { return ___m_debuggingModes_0; }
inline int32_t* get_address_of_m_debuggingModes_0() { return &___m_debuggingModes_0; }
inline void set_m_debuggingModes_0(int32_t value)
{
___m_debuggingModes_0 = value;
}
};
// System.Diagnostics.DebuggerBrowsableAttribute
struct DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.Diagnostics.DebuggerBrowsableState System.Diagnostics.DebuggerBrowsableAttribute::state
int32_t ___state_0;
public:
inline static int32_t get_offset_of_state_0() { return static_cast<int32_t>(offsetof(DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53, ___state_0)); }
inline int32_t get_state_0() const { return ___state_0; }
inline int32_t* get_address_of_state_0() { return &___state_0; }
inline void set_state_0(int32_t value)
{
___state_0 = value;
}
};
// UnityEngine.Bindings.NativeTypeAttribute
struct NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String UnityEngine.Bindings.NativeTypeAttribute::<Header>k__BackingField
String_t* ___U3CHeaderU3Ek__BackingField_0;
// System.String UnityEngine.Bindings.NativeTypeAttribute::<IntermediateScriptingStructName>k__BackingField
String_t* ___U3CIntermediateScriptingStructNameU3Ek__BackingField_1;
// UnityEngine.Bindings.CodegenOptions UnityEngine.Bindings.NativeTypeAttribute::<CodegenOptions>k__BackingField
int32_t ___U3CCodegenOptionsU3Ek__BackingField_2;
public:
inline static int32_t get_offset_of_U3CHeaderU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9, ___U3CHeaderU3Ek__BackingField_0)); }
inline String_t* get_U3CHeaderU3Ek__BackingField_0() const { return ___U3CHeaderU3Ek__BackingField_0; }
inline String_t** get_address_of_U3CHeaderU3Ek__BackingField_0() { return &___U3CHeaderU3Ek__BackingField_0; }
inline void set_U3CHeaderU3Ek__BackingField_0(String_t* value)
{
___U3CHeaderU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CHeaderU3Ek__BackingField_0), (void*)value);
}
inline static int32_t get_offset_of_U3CIntermediateScriptingStructNameU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9, ___U3CIntermediateScriptingStructNameU3Ek__BackingField_1)); }
inline String_t* get_U3CIntermediateScriptingStructNameU3Ek__BackingField_1() const { return ___U3CIntermediateScriptingStructNameU3Ek__BackingField_1; }
inline String_t** get_address_of_U3CIntermediateScriptingStructNameU3Ek__BackingField_1() { return &___U3CIntermediateScriptingStructNameU3Ek__BackingField_1; }
inline void set_U3CIntermediateScriptingStructNameU3Ek__BackingField_1(String_t* value)
{
___U3CIntermediateScriptingStructNameU3Ek__BackingField_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CIntermediateScriptingStructNameU3Ek__BackingField_1), (void*)value);
}
inline static int32_t get_offset_of_U3CCodegenOptionsU3Ek__BackingField_2() { return static_cast<int32_t>(offsetof(NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9, ___U3CCodegenOptionsU3Ek__BackingField_2)); }
inline int32_t get_U3CCodegenOptionsU3Ek__BackingField_2() const { return ___U3CCodegenOptionsU3Ek__BackingField_2; }
inline int32_t* get_address_of_U3CCodegenOptionsU3Ek__BackingField_2() { return &___U3CCodegenOptionsU3Ek__BackingField_2; }
inline void set_U3CCodegenOptionsU3Ek__BackingField_2(int32_t value)
{
___U3CCodegenOptionsU3Ek__BackingField_2 = value;
}
};
// UnityEngine.Bindings.StaticAccessorAttribute
struct StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA : public Attribute_t037CA9D9F3B742C063DB364D2EEBBF9FC5772C71
{
public:
// System.String UnityEngine.Bindings.StaticAccessorAttribute::<Name>k__BackingField
String_t* ___U3CNameU3Ek__BackingField_0;
// UnityEngine.Bindings.StaticAccessorType UnityEngine.Bindings.StaticAccessorAttribute::<Type>k__BackingField
int32_t ___U3CTypeU3Ek__BackingField_1;
public:
inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_0() { return static_cast<int32_t>(offsetof(StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA, ___U3CNameU3Ek__BackingField_0)); }
inline String_t* get_U3CNameU3Ek__BackingField_0() const { return ___U3CNameU3Ek__BackingField_0; }
inline String_t** get_address_of_U3CNameU3Ek__BackingField_0() { return &___U3CNameU3Ek__BackingField_0; }
inline void set_U3CNameU3Ek__BackingField_0(String_t* value)
{
___U3CNameU3Ek__BackingField_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___U3CNameU3Ek__BackingField_0), (void*)value);
}
inline static int32_t get_offset_of_U3CTypeU3Ek__BackingField_1() { return static_cast<int32_t>(offsetof(StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA, ___U3CTypeU3Ek__BackingField_1)); }
inline int32_t get_U3CTypeU3Ek__BackingField_1() const { return ___U3CTypeU3Ek__BackingField_1; }
inline int32_t* get_address_of_U3CTypeU3Ek__BackingField_1() { return &___U3CTypeU3Ek__BackingField_1; }
inline void set_U3CTypeU3Ek__BackingField_1(int32_t value)
{
___U3CTypeU3Ek__BackingField_1 = value;
}
};
// System.Type
struct Type_t : public MemberInfo_t
{
public:
// System.RuntimeTypeHandle System.Type::_impl
RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 ____impl_9;
public:
inline static int32_t get_offset_of__impl_9() { return static_cast<int32_t>(offsetof(Type_t, ____impl_9)); }
inline RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 get__impl_9() const { return ____impl_9; }
inline RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 * get_address_of__impl_9() { return &____impl_9; }
inline void set__impl_9(RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 value)
{
____impl_9 = value;
}
};
struct Type_t_StaticFields
{
public:
// System.Reflection.MemberFilter System.Type::FilterAttribute
MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterAttribute_0;
// System.Reflection.MemberFilter System.Type::FilterName
MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterName_1;
// System.Reflection.MemberFilter System.Type::FilterNameIgnoreCase
MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterNameIgnoreCase_2;
// System.Object System.Type::Missing
RuntimeObject * ___Missing_3;
// System.Char System.Type::Delimiter
Il2CppChar ___Delimiter_4;
// System.Type[] System.Type::EmptyTypes
TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* ___EmptyTypes_5;
// System.Reflection.Binder System.Type::defaultBinder
Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * ___defaultBinder_6;
public:
inline static int32_t get_offset_of_FilterAttribute_0() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterAttribute_0)); }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterAttribute_0() const { return ___FilterAttribute_0; }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterAttribute_0() { return &___FilterAttribute_0; }
inline void set_FilterAttribute_0(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value)
{
___FilterAttribute_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterAttribute_0), (void*)value);
}
inline static int32_t get_offset_of_FilterName_1() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterName_1)); }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterName_1() const { return ___FilterName_1; }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterName_1() { return &___FilterName_1; }
inline void set_FilterName_1(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value)
{
___FilterName_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterName_1), (void*)value);
}
inline static int32_t get_offset_of_FilterNameIgnoreCase_2() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterNameIgnoreCase_2)); }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterNameIgnoreCase_2() const { return ___FilterNameIgnoreCase_2; }
inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterNameIgnoreCase_2() { return &___FilterNameIgnoreCase_2; }
inline void set_FilterNameIgnoreCase_2(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value)
{
___FilterNameIgnoreCase_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FilterNameIgnoreCase_2), (void*)value);
}
inline static int32_t get_offset_of_Missing_3() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Missing_3)); }
inline RuntimeObject * get_Missing_3() const { return ___Missing_3; }
inline RuntimeObject ** get_address_of_Missing_3() { return &___Missing_3; }
inline void set_Missing_3(RuntimeObject * value)
{
___Missing_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Missing_3), (void*)value);
}
inline static int32_t get_offset_of_Delimiter_4() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Delimiter_4)); }
inline Il2CppChar get_Delimiter_4() const { return ___Delimiter_4; }
inline Il2CppChar* get_address_of_Delimiter_4() { return &___Delimiter_4; }
inline void set_Delimiter_4(Il2CppChar value)
{
___Delimiter_4 = value;
}
inline static int32_t get_offset_of_EmptyTypes_5() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___EmptyTypes_5)); }
inline TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* get_EmptyTypes_5() const { return ___EmptyTypes_5; }
inline TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755** get_address_of_EmptyTypes_5() { return &___EmptyTypes_5; }
inline void set_EmptyTypes_5(TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* value)
{
___EmptyTypes_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___EmptyTypes_5), (void*)value);
}
inline static int32_t get_offset_of_defaultBinder_6() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___defaultBinder_6)); }
inline Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * get_defaultBinder_6() const { return ___defaultBinder_6; }
inline Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 ** get_address_of_defaultBinder_6() { return &___defaultBinder_6; }
inline void set_defaultBinder_6(Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * value)
{
___defaultBinder_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___defaultBinder_6), (void*)value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// System.Void System.Runtime.CompilerServices.InternalsVisibleToAttribute::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9 (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * __this, String_t* ___assemblyName0, const RuntimeMethod* method);
// System.Void UnityEngine.UnityEngineModuleAssembly::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnityEngineModuleAssembly__ctor_m76C129AC6AA438BE601F5279EE9EB599BEF90AF9 (UnityEngineModuleAssembly_t33CB058FDDDC458E384578147D6027BB1EC86CFF * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CompilationRelaxationsAttribute__ctor_mAC3079EBC4EEAB474EED8208EF95DB39C922333B (CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF * __this, int32_t ___relaxations0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.ExtensionAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ExtensionAttribute__ctor_mB331519C39C4210259A248A4C629DF934937C1FA (ExtensionAttribute_t917F3F92E717DC8B2D7BC03967A9790B1B8EF7CC * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void RuntimeCompatibilityAttribute__ctor_m551DDF1438CE97A984571949723F30F44CF7317C (RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 * __this, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::set_WrapNonExceptionThrows(System.Boolean)
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void RuntimeCompatibilityAttribute_set_WrapNonExceptionThrows_m8562196F90F3EBCEC23B5708EE0332842883C490_inline (RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 * __this, bool ___value0, const RuntimeMethod* method);
// System.Void System.Diagnostics.DebuggableAttribute::.ctor(System.Diagnostics.DebuggableAttribute/DebuggingModes)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DebuggableAttribute__ctor_m7FF445C8435494A4847123A668D889E692E55550 (DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B * __this, int32_t ___modes0, const RuntimeMethod* method);
// System.Void UnityEngine.Bindings.NativeHeaderAttribute::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76 (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * __this, String_t* ___header0, const RuntimeMethod* method);
// System.Void UnityEngine.Bindings.StaticAccessorAttribute::.ctor(System.String,UnityEngine.Bindings.StaticAccessorType)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706 (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * __this, String_t* ___name0, int32_t ___type1, const RuntimeMethod* method);
// System.Void System.Diagnostics.DebuggerBrowsableAttribute::.ctor(System.Diagnostics.DebuggerBrowsableState)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5 (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * __this, int32_t ___state0, const RuntimeMethod* method);
// System.Void System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35 (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Scripting.RequiredByNativeCodeAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5 (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.RequireComponent::.ctor(System.Type)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void RequireComponent__ctor_m5EC89D3D22D7D880E1B88A5C9FADF1FBDC713EE4 (RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 * __this, Type_t * ___requiredComponent0, const RuntimeMethod* method);
// System.Void UnityEngine.Bindings.NotNullAttribute::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NotNullAttribute__ctor_m7F7AF5B61F69FAA7091CD36347D6A0FA186CB8A5 (NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC * __this, String_t* ___exception0, const RuntimeMethod* method);
// System.Void UnityEngine.Internal.ExcludeFromDocsAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ExcludeFromDocsAttribute__ctor_mFA14E76D8A30ED8CA3ADCDA83BE056E54753825D (ExcludeFromDocsAttribute_tF2E270E47DCFC0F0F22FA6D71B95FF71B08703B8 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Internal.DefaultValueAttribute::.ctor(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DefaultValueAttribute__ctor_m7A9877491C22E8CDCFDAD240D04156D4FAE7D6C6 (DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122 * __this, String_t* ___value0, const RuntimeMethod* method);
// System.Void UnityEngine.Bindings.NativeTypeAttribute::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeTypeAttribute__ctor_m733B0901353DC860C82DA57F7B33C30D2394938F (NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Bindings.NativeTypeAttribute::set_Header(System.String)
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void NativeTypeAttribute_set_Header_m8985D6BB07D335B2C835232D2D29DB34BF3E5C4D_inline (NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 * __this, String_t* ___value0, const RuntimeMethod* method);
static void UnityEngine_AudioModule_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[0];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x33"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[1];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x32"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[2];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x31"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[3];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x30"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[4];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x39"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[5];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x35"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[6];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x38"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[7];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x36"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[8];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x35"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[9];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x34"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[10];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x33"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[11];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x32"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[12];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x31"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[13];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x30\x37"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[14];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x36"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[15];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x37"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[16];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x38"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[17];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x41\x75\x64\x69\x6F\x2E\x44\x53\x50\x47\x72\x61\x70\x68"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[18];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x41\x75\x64\x69\x6F\x2E\x54\x65\x73\x74\x73"), NULL);
}
{
UnityEngineModuleAssembly_t33CB058FDDDC458E384578147D6027BB1EC86CFF * tmp = (UnityEngineModuleAssembly_t33CB058FDDDC458E384578147D6027BB1EC86CFF *)cache->attributes[19];
UnityEngineModuleAssembly__ctor_m76C129AC6AA438BE601F5279EE9EB599BEF90AF9(tmp, NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[20];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x34"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[21];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x41\x6E\x61\x6C\x79\x74\x69\x63\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[22];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x43\x6C\x6F\x75\x64"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[23];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x53\x75\x62\x73\x79\x73\x74\x65\x6D\x2E\x52\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6F\x6E"), NULL);
}
{
CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF * tmp = (CompilationRelaxationsAttribute_t661FDDC06629BDA607A42BD660944F039FE03AFF *)cache->attributes[24];
CompilationRelaxationsAttribute__ctor_mAC3079EBC4EEAB474EED8208EF95DB39C922333B(tmp, 8LL, NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[25];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x48\x6F\x74\x52\x65\x6C\x6F\x61\x64\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[26];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x4E\x65\x74\x77\x6F\x72\x6B\x69\x6E\x67"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[27];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x49\x6D\x61\x67\x65\x43\x6F\x6E\x76\x65\x72\x73\x69\x6F\x6E\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[28];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x4A\x53\x4F\x4E\x53\x65\x72\x69\x61\x6C\x69\x7A\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[29];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x65\x72\x72\x61\x69\x6E\x50\x68\x79\x73\x69\x63\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[30];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x65\x72\x72\x61\x69\x6E\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[31];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x4C\x53\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[32];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x75\x62\x73\x79\x73\x74\x65\x6D\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[33];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x75\x62\x73\x74\x61\x6E\x63\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[34];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x74\x72\x65\x61\x6D\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[35];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x70\x72\x69\x74\x65\x53\x68\x61\x70\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[36];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x70\x72\x69\x74\x65\x4D\x61\x73\x6B\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[37];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x63\x72\x65\x65\x6E\x43\x61\x70\x74\x75\x72\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[38];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x52\x75\x6E\x74\x69\x6D\x65\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\x4F\x6E\x4C\x6F\x61\x64\x4D\x61\x6E\x61\x67\x65\x72\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x65\x72\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[39];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x72\x6F\x66\x69\x6C\x65\x72\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[40];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x68\x79\x73\x69\x63\x73\x32\x44\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[41];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x68\x79\x73\x69\x63\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[42];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x61\x72\x74\x69\x63\x6C\x65\x53\x79\x73\x74\x65\x6D\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[43];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x4C\x6F\x63\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[44];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x49\x6E\x70\x75\x74\x4C\x65\x67\x61\x63\x79\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[45];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x43\x6C\x6F\x75\x64\x2E\x53\x65\x72\x76\x69\x63\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[46];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x44\x65\x76\x2E\x30\x30\x35"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[47];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x44\x65\x76\x2E\x30\x30\x34"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[48];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x44\x65\x76\x2E\x30\x30\x33"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[49];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x6E\x61\x6C\x79\x74\x69\x63\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[50];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x42\x75\x72\x73\x74\x2E\x45\x64\x69\x74\x6F\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[51];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x45\x6E\x74\x69\x74\x69\x65\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[52];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x50\x65\x72\x66\x6F\x72\x6D\x61\x6E\x63\x65\x54\x65\x73\x74\x73\x2E\x52\x75\x6E\x74\x69\x6D\x65\x54\x65\x73\x74\x52\x75\x6E\x6E\x65\x72\x2E\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[53];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x54\x69\x6D\x65\x6C\x69\x6E\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[54];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x4E\x65\x74\x77\x6F\x72\x6B\x69\x6E\x67\x2E\x54\x72\x61\x6E\x73\x70\x6F\x72\x74"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[55];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73\x2E\x45\x64\x69\x74\x6F\x72\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[56];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73\x2E\x45\x64\x69\x74\x6F\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[57];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73\x47\x61\x6D\x65\x4F\x62\x6A\x65\x63\x74\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[58];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x64\x76\x65\x72\x74\x69\x73\x65\x6D\x65\x6E\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[59];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[60];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x52\x75\x6E\x74\x69\x6D\x65\x54\x65\x73\x74\x73\x2E\x41\x6C\x6C\x49\x6E\x31\x52\x75\x6E\x6E\x65\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[61];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x64\x69\x74\x6F\x72\x2E\x55\x49\x42\x75\x69\x6C\x64\x65\x72\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[62];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x32\x44\x2E\x53\x70\x72\x69\x74\x65\x2E\x45\x64\x69\x74\x6F\x72\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[63];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x32\x44\x2E\x53\x70\x72\x69\x74\x65\x2E\x45\x64\x69\x74\x6F\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[64];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x57\x69\x6E\x64\x6F\x77\x73\x4D\x52\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[65];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x47\x6F\x6F\x67\x6C\x65\x41\x52\x2E\x55\x6E\x69\x74\x79\x4E\x61\x74\x69\x76\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[66];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x70\x61\x74\x69\x61\x6C\x54\x72\x61\x63\x6B\x69\x6E\x67"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[67];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x41\x73\x73\x65\x6D\x62\x6C\x79\x2D\x43\x53\x68\x61\x72\x70\x2D\x66\x69\x72\x73\x74\x70\x61\x73\x73\x2D\x74\x65\x73\x74\x61\x62\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[68];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x41\x73\x73\x65\x6D\x62\x6C\x79\x2D\x43\x53\x68\x61\x72\x70\x2D\x74\x65\x73\x74\x61\x62\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[69];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x55\x49\x2E\x42\x75\x69\x6C\x64\x65\x72\x2E\x45\x64\x69\x74\x6F\x72\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[70];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x75\x72\x63\x68\x61\x73\x69\x6E\x67"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[71];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x65\x73\x74\x52\x75\x6E\x6E\x65\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[72];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[73];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x44\x65\x76\x2E\x30\x30\x32"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[74];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x44\x65\x76\x2E\x30\x30\x31"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[75];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x32\x34"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[76];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x32\x33"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[77];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x32\x32"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[78];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x32\x31"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[79];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x32\x30"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[80];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x72\x6E\x61\x6C\x41\x50\x49\x45\x6E\x67\x69\x6E\x65\x42\x72\x69\x64\x67\x65\x2E\x30\x31\x39"), NULL);
}
{
ExtensionAttribute_t917F3F92E717DC8B2D7BC03967A9790B1B8EF7CC * tmp = (ExtensionAttribute_t917F3F92E717DC8B2D7BC03967A9790B1B8EF7CC *)cache->attributes[81];
ExtensionAttribute__ctor_mB331519C39C4210259A248A4C629DF934937C1FA(tmp, NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[82];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x43\x6F\x6C\x6C\x65\x63\x74\x69\x6F\x6E\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[83];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x43\x6F\x72\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[84];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x75\x63\x67\x2E\x51\x6F\x53"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[85];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x52\x75\x6E\x74\x69\x6D\x65\x54\x65\x73\x74\x73\x2E\x46\x72\x61\x6D\x65\x77\x6F\x72\x6B"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[86];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x52\x75\x6E\x74\x69\x6D\x65\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[87];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x65\x73\x74\x73\x2E\x46\x72\x61\x6D\x65\x77\x6F\x72\x6B"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[88];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x65\x73\x74\x73\x2E\x54\x69\x6D\x65\x6C\x69\x6E\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[89];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x65\x73\x74\x73\x2E\x55\x6E\x69\x74\x79\x41\x6E\x61\x6C\x79\x74\x69\x63\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[90];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[91];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x52\x75\x6E\x74\x69\x6D\x65\x54\x65\x73\x74\x73\x2E\x46\x72\x61\x6D\x65\x77\x6F\x72\x6B\x2E\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[92];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x44\x65\x70\x6C\x6F\x79\x6D\x65\x6E\x74\x54\x65\x73\x74\x73\x2E\x53\x65\x72\x76\x69\x63\x65\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[93];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x42\x75\x72\x73\x74"), NULL);
}
{
RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 * tmp = (RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 *)cache->attributes[94];
RuntimeCompatibilityAttribute__ctor_m551DDF1438CE97A984571949723F30F44CF7317C(tmp, NULL);
RuntimeCompatibilityAttribute_set_WrapNonExceptionThrows_m8562196F90F3EBCEC23B5708EE0332842883C490_inline(tmp, true, NULL);
}
{
DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B * tmp = (DebuggableAttribute_tA8054EBD0FC7511695D494B690B5771658E3191B *)cache->attributes[95];
DebuggableAttribute__ctor_m7FF445C8435494A4847123A668D889E692E55550(tmp, 263LL, NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[96];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x68\x61\x72\x65\x64\x49\x6E\x74\x65\x72\x6E\x61\x6C\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[97];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x55\x49\x2E\x42\x75\x69\x6C\x64\x65\x72\x2E\x45\x64\x69\x74\x6F\x72"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[98];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x53\x34\x56\x52\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[99];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x53\x35\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[100];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x53\x35\x56\x52\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[101];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x4E\x45\x54\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[102];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73\x4E\x61\x74\x69\x76\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[103];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x65\x78\x74\x43\x6F\x72\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[104];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x56\x46\x58\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[105];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x43\x6F\x6E\x6E\x65\x63\x74\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[106];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x43\x75\x72\x6C\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[107];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x54\x65\x73\x74\x50\x72\x6F\x74\x6F\x63\x6F\x6C\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[108];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x53\x34\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[109];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x57\x65\x62\x52\x65\x71\x75\x65\x73\x74\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[110];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x57\x65\x62\x52\x65\x71\x75\x65\x73\x74\x54\x65\x78\x74\x75\x72\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[111];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x56\x65\x68\x69\x63\x6C\x65\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[112];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x49\x6E\x70\x75\x74\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[113];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x56\x69\x64\x65\x6F\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[114];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x57\x69\x6E\x64\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[115];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x73\x73\x65\x74\x42\x75\x6E\x64\x6C\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[116];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x43\x6C\x6F\x74\x68\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[117];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x47\x61\x6D\x65\x43\x65\x6E\x74\x65\x72\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[118];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x49\x4D\x47\x55\x49\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[119];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[120];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x57\x65\x62\x52\x65\x71\x75\x65\x73\x74\x41\x75\x64\x69\x6F\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[121];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x58\x62\x6F\x78\x4F\x6E\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[122];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x2E\x41\x75\x64\x69\x6F\x2E\x44\x53\x50\x47\x72\x61\x70\x68\x2E\x54\x65\x73\x74\x73"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[123];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x56\x52\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[124];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x43\x6F\x72\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[125];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x49\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[126];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x63\x63\x65\x73\x73\x69\x62\x69\x6C\x69\x74\x79\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[127];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x6E\x64\x72\x6F\x69\x64\x4A\x4E\x49\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[128];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[129];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x75\x64\x69\x6F\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[130];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x44\x53\x50\x47\x72\x61\x70\x68\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[131];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x44\x69\x72\x65\x63\x74\x6F\x72\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[132];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x47\x49\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[133];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x47\x72\x69\x64\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[134];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x53\x77\x69\x74\x63\x68\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[135];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x65\x78\x74\x52\x65\x6E\x64\x65\x72\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[136];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x49\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[137];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6D\x62\x72\x61\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[138];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x41\x6E\x61\x6C\x79\x74\x69\x63\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[139];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x57\x65\x62\x52\x65\x71\x75\x65\x73\x74\x41\x73\x73\x65\x74\x42\x75\x6E\x64\x6C\x65\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[140];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x6E\x69\x74\x79\x57\x65\x62\x52\x65\x71\x75\x65\x73\x74\x57\x57\x57\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[141];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x58\x52\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[142];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x41\x52\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[143];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x43\x72\x61\x73\x68\x52\x65\x70\x6F\x72\x74\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[144];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x50\x65\x72\x66\x6F\x72\x6D\x61\x6E\x63\x65\x52\x65\x70\x6F\x72\x74\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[145];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x55\x49\x45\x6C\x65\x6D\x65\x6E\x74\x73\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
{
InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C * tmp = (InternalsVisibleToAttribute_t1D9772A02892BAC440952F880A43C257E6C3E68C *)cache->attributes[146];
InternalsVisibleToAttribute__ctor_m420071A75DCEEC72356490C64B4B0B9270DA32B9(tmp, il2cpp_codegen_string_new_wrapper("\x55\x6E\x69\x74\x79\x45\x6E\x67\x69\x6E\x65\x2E\x54\x69\x6C\x65\x6D\x61\x70\x4D\x6F\x64\x75\x6C\x65"), NULL);
}
}
static void AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[0];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[1];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x47\x65\x74\x41\x75\x64\x69\x6F\x4D\x61\x6E\x61\x67\x65\x72\x28\x29"), 0LL, NULL);
}
}
static void AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator_OnAudioConfigurationChanged(CustomAttributesCache* cache)
{
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[0];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[1];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator_AudioSettings_InvokeOnAudioConfigurationChanged_m2CBD1FC39E7AE46E07E777990310D1DC40FB980E(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
static void Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_U3CmuteStateU3Ek__BackingField(CustomAttributesCache* cache)
{
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[0];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[1];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_OnMuteStateChanged(CustomAttributesCache* cache)
{
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[0];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[1];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
}
static void Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_get_muteState_m692B429F6C1592C72DCCDCD2A00BF126BC51F6EF(CustomAttributesCache* cache)
{
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[0];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_set_muteState_mA43DEFC30F87157C7E0030B009DD8C8D0CC422F6(CustomAttributesCache* cache)
{
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[0];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_InvokeOnMuteStateChanged_m89C9E4AE29FB7A0140E6F73F1A00B54351548664(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
static void AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[0];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x43\x6C\x69\x70\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[1];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
}
static void AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_m_PCMReaderCallback(CustomAttributesCache* cache)
{
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[0];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[1];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
}
static void AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_m_PCMSetPositionCallback(CustomAttributesCache* cache)
{
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[0];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[1];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
}
static void AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_AudioClip_InvokePCMReaderCallback_Internal_m9CB2976CDC2C73A92479F8C11C30B17FAA05751F(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
static void AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_AudioClip_InvokePCMSetPositionCallback_Internal_m9F3ACF3A244349568C0D0D1D40EE72EF013FB45D(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
static void AudioListener_t03B51B434A263F9AFD07AC8AA5CB4FE6402252A3_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1_0_0_0_var);
s_Il2CppMethodInitialized = true;
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[0];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x4C\x69\x73\x74\x65\x6E\x65\x72\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
{
RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 * tmp = (RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 *)cache->attributes[1];
RequireComponent__ctor_m5EC89D3D22D7D880E1B88A5C9FADF1FBDC713EE4(tmp, il2cpp_codegen_type_get_object(Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1_0_0_0_var), NULL);
}
}
static void AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1_0_0_0_var);
s_Il2CppMethodInitialized = true;
}
{
RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 * tmp = (RequireComponent_tEDA546F9722B8874DA9658BDAB821BA49647FC91 *)cache->attributes[0];
RequireComponent__ctor_m5EC89D3D22D7D880E1B88A5C9FADF1FBDC713EE4(tmp, il2cpp_codegen_type_get_object(Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1_0_0_0_var), NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[1];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x53\x6F\x75\x72\x63\x65\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
}
static void AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShotHelper_m989E9F333532DABFDD15BD685D69252379476BA2____source0(CustomAttributesCache* cache)
{
{
NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC * tmp = (NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC *)cache->attributes[0];
NotNullAttribute__ctor_m7F7AF5B61F69FAA7091CD36347D6A0FA186CB8A5(tmp, il2cpp_codegen_string_new_wrapper("\x41\x72\x67\x75\x6D\x65\x6E\x74\x4E\x75\x6C\x6C\x45\x78\x63\x65\x70\x74\x69\x6F\x6E"), NULL);
}
}
static void AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShotHelper_m989E9F333532DABFDD15BD685D69252379476BA2____clip1(CustomAttributesCache* cache)
{
{
NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC * tmp = (NotNullAttribute_t22E59D8061EE39B8A3F837C2245240C2466382FC *)cache->attributes[0];
NotNullAttribute__ctor_m7F7AF5B61F69FAA7091CD36347D6A0FA186CB8A5(tmp, il2cpp_codegen_string_new_wrapper("\x4E\x75\x6C\x6C\x45\x78\x63\x65\x70\x74\x69\x6F\x6E\x4F\x62\x6A\x65\x63\x74"), NULL);
}
}
static void AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShot_mA90B136041A61C30909301D45D0315088CA7D796(CustomAttributesCache* cache)
{
{
ExcludeFromDocsAttribute_tF2E270E47DCFC0F0F22FA6D71B95FF71B08703B8 * tmp = (ExcludeFromDocsAttribute_tF2E270E47DCFC0F0F22FA6D71B95FF71B08703B8 *)cache->attributes[0];
ExcludeFromDocsAttribute__ctor_mFA14E76D8A30ED8CA3ADCDA83BE056E54753825D(tmp, NULL);
}
}
static void AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShot_mBFCD838C503CE4334501C9864C091FE0061CF024____volumeScale1(CustomAttributesCache* cache)
{
{
DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122 * tmp = (DefaultValueAttribute_tC16686567591630447D94937AF74EF53DC158122 *)cache->attributes[0];
DefaultValueAttribute__ctor_m7A9877491C22E8CDCFDAD240D04156D4FAE7D6C6(tmp, il2cpp_codegen_string_new_wrapper("\x31\x2E\x30\x46"), NULL);
}
}
static void AudioClipPlayable_t3574B22284CE09FDEAD15BD18D66C4A21D59FA5F_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[1];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x43\x6C\x69\x70\x50\x6C\x61\x79\x61\x62\x6C\x65\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[2];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x52\x75\x6E\x74\x69\x6D\x65\x2F\x44\x69\x72\x65\x63\x74\x6F\x72\x2F\x43\x6F\x72\x65\x2F\x48\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x68"), NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[3];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x44\x69\x72\x65\x63\x74\x6F\x72\x2F\x41\x75\x64\x69\x6F\x43\x6C\x69\x70\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x68"), NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[4];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x43\x6C\x69\x70\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
}
static void AudioMixerPlayable_t80531461F1E238E237D7BB2BAE7E031ABDE95C4A_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[1];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x4D\x69\x78\x65\x72\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[2];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x44\x69\x72\x65\x63\x74\x6F\x72\x2F\x41\x75\x64\x69\x6F\x4D\x69\x78\x65\x72\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x68"), NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[3];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x52\x75\x6E\x74\x69\x6D\x65\x2F\x44\x69\x72\x65\x63\x74\x6F\x72\x2F\x43\x6F\x72\x65\x2F\x48\x50\x6C\x61\x79\x61\x62\x6C\x65\x2E\x68"), NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[4];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x4D\x69\x78\x65\x72\x50\x6C\x61\x79\x61\x62\x6C\x65\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
}
static void AudioPlayableOutput_t9809407FDE5B55DD34088A665C8C53346AC76EE8_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[0];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x44\x69\x72\x65\x63\x74\x6F\x72\x2F\x41\x75\x64\x69\x6F\x50\x6C\x61\x79\x61\x62\x6C\x65\x4F\x75\x74\x70\x75\x74\x2E\x68"), NULL);
}
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[1];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[2];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x41\x75\x64\x69\x6F\x53\x6F\x75\x72\x63\x65\x2E\x68"), NULL);
}
{
NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C * tmp = (NativeHeaderAttribute_t7F0E4B53790AA75CDB4C44E6D644267F8FE3066C *)cache->attributes[3];
NativeHeaderAttribute__ctor_m0E83F29C5939F185D6E90541591802EB2845FD76(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x50\x6C\x61\x79\x61\x62\x6C\x65\x4F\x75\x74\x70\x75\x74\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[4];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x50\x6C\x61\x79\x61\x62\x6C\x65\x4F\x75\x74\x70\x75\x74\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
}
static void AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
{
{
NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 * tmp = (NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 *)cache->attributes[0];
NativeTypeAttribute__ctor_m733B0901353DC860C82DA57F7B33C30D2394938F(tmp, NULL);
NativeTypeAttribute_set_Header_m8985D6BB07D335B2C835232D2D29DB34BF3E5C4D_inline(tmp, il2cpp_codegen_string_new_wrapper("\x4D\x6F\x64\x75\x6C\x65\x73\x2F\x41\x75\x64\x69\x6F\x2F\x50\x75\x62\x6C\x69\x63\x2F\x53\x63\x72\x69\x70\x74\x42\x69\x6E\x64\x69\x6E\x67\x73\x2F\x41\x75\x64\x69\x6F\x53\x61\x6D\x70\x6C\x65\x50\x72\x6F\x76\x69\x64\x65\x72\x2E\x62\x69\x6E\x64\x69\x6E\x67\x73\x2E\x68"), NULL);
}
{
StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA * tmp = (StaticAccessorAttribute_t7A16FF0FA31E38510BBC8BCA5AE56C3E67D5A2BA *)cache->attributes[1];
StaticAccessorAttribute__ctor_m0C3215256AEFAEFDDCBCD2BA9AA579CDBB230706(tmp, il2cpp_codegen_string_new_wrapper("\x41\x75\x64\x69\x6F\x53\x61\x6D\x70\x6C\x65\x50\x72\x6F\x76\x69\x64\x65\x72\x42\x69\x6E\x64\x69\x6E\x67\x73"), 2LL, NULL);
}
}
static void AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_sampleFramesAvailable(CustomAttributesCache* cache)
{
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[0];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[1];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_sampleFramesOverflow(CustomAttributesCache* cache)
{
{
DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 * tmp = (DebuggerBrowsableAttribute_t2FA4793AD1982F5150E07D26822ED5953CD90F53 *)cache->attributes[0];
DebuggerBrowsableAttribute__ctor_mAA8BCC1E418754685F320B14A08AC226E76346E5(tmp, 0LL, NULL);
}
{
CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C * tmp = (CompilerGeneratedAttribute_t39106AB982658D7A94C27DEF3C48DB2F5F7CD75C *)cache->attributes[1];
CompilerGeneratedAttribute__ctor_m9DC3E4E2DA76FE93948D44199213E2E924DCBE35(tmp, NULL);
}
}
static void AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_AudioSampleProvider_InvokeSampleFramesAvailable_mE6689CFA13C0621F305F389FEEE4D543B71BF236(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
static void AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_AudioSampleProvider_InvokeSampleFramesOverflow_m998BEADD2A2B4BEF0906A31108B6DC486411CC78(CustomAttributesCache* cache)
{
{
RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 * tmp = (RequiredByNativeCodeAttribute_t855401D3C2EF3B44F4F1C3EE2DCD361CFC358D20 *)cache->attributes[0];
RequiredByNativeCodeAttribute__ctor_m97C095D1EE6AAB2894AE7E8B2F07D9B47CB8F8B5(tmp, NULL);
}
}
IL2CPP_EXTERN_C const CustomAttributesCacheGenerator g_UnityEngine_AudioModule_AttributeGenerators[];
const CustomAttributesCacheGenerator g_UnityEngine_AudioModule_AttributeGenerators[28] =
{
AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator,
AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator,
AudioListener_t03B51B434A263F9AFD07AC8AA5CB4FE6402252A3_CustomAttributesCacheGenerator,
AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator,
AudioClipPlayable_t3574B22284CE09FDEAD15BD18D66C4A21D59FA5F_CustomAttributesCacheGenerator,
AudioMixerPlayable_t80531461F1E238E237D7BB2BAE7E031ABDE95C4A_CustomAttributesCacheGenerator,
AudioPlayableOutput_t9809407FDE5B55DD34088A665C8C53346AC76EE8_CustomAttributesCacheGenerator,
AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator,
AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator_OnAudioConfigurationChanged,
Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_U3CmuteStateU3Ek__BackingField,
Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_OnMuteStateChanged,
AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_m_PCMReaderCallback,
AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_m_PCMSetPositionCallback,
AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_sampleFramesAvailable,
AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_sampleFramesOverflow,
AudioSettings_t1941E7DE9FEF65F7742713EB862D3025244FCB08_CustomAttributesCacheGenerator_AudioSettings_InvokeOnAudioConfigurationChanged_m2CBD1FC39E7AE46E07E777990310D1DC40FB980E,
Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_get_muteState_m692B429F6C1592C72DCCDCD2A00BF126BC51F6EF,
Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_set_muteState_mA43DEFC30F87157C7E0030B009DD8C8D0CC422F6,
Mobile_t9F8A04EF1ADC739B4107A38F0103CB72ECD23F5E_CustomAttributesCacheGenerator_Mobile_InvokeOnMuteStateChanged_m89C9E4AE29FB7A0140E6F73F1A00B54351548664,
AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_AudioClip_InvokePCMReaderCallback_Internal_m9CB2976CDC2C73A92479F8C11C30B17FAA05751F,
AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE_CustomAttributesCacheGenerator_AudioClip_InvokePCMSetPositionCallback_Internal_m9F3ACF3A244349568C0D0D1D40EE72EF013FB45D,
AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShot_mA90B136041A61C30909301D45D0315088CA7D796,
AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_AudioSampleProvider_InvokeSampleFramesAvailable_mE6689CFA13C0621F305F389FEEE4D543B71BF236,
AudioSampleProvider_tD8B613D55D09D6CE86B851A5D8F33560FFCC705B_CustomAttributesCacheGenerator_AudioSampleProvider_InvokeSampleFramesOverflow_m998BEADD2A2B4BEF0906A31108B6DC486411CC78,
AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShotHelper_m989E9F333532DABFDD15BD685D69252379476BA2____source0,
AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShotHelper_m989E9F333532DABFDD15BD685D69252379476BA2____clip1,
AudioSource_tC4BF65AF8CDCAA63724BB3CA59A7A29249269E6B_CustomAttributesCacheGenerator_AudioSource_PlayOneShot_mBFCD838C503CE4334501C9864C091FE0061CF024____volumeScale1,
UnityEngine_AudioModule_CustomAttributesCacheGenerator,
};
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void RuntimeCompatibilityAttribute_set_WrapNonExceptionThrows_m8562196F90F3EBCEC23B5708EE0332842883C490_inline (RuntimeCompatibilityAttribute_tFF99AB2963098F9CBCD47A20D9FD3D51C17C1C80 * __this, bool ___value0, const RuntimeMethod* method)
{
{
bool L_0 = ___value0;
__this->set_m_wrapNonExceptionThrows_0(L_0);
return;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void NativeTypeAttribute_set_Header_m8985D6BB07D335B2C835232D2D29DB34BF3E5C4D_inline (NativeTypeAttribute_t7A71B541B18D0BA1A9889E05D36CAC56CF9F48D9 * __this, String_t* ___value0, const RuntimeMethod* method)
{
{
String_t* L_0 = ___value0;
__this->set_U3CHeaderU3Ek__BackingField_0(L_0);
return;
}
}
|
[
"hal3152haru@gmail.com"
] |
hal3152haru@gmail.com
|
2af47cdcb1556d6e5368afd910eb6c4e5f3784da
|
fdb1e74102edccd4922f5192f7b930ad4c5709c0
|
/P2PSharer/FlagMgr.cpp
|
9315e9d28df00e2564677912658e6d44e2e1380f
|
[] |
no_license
|
foxbryant88/P2PSharer
|
3799c1127ffcb80160cec7106e4610de065b392e
|
95c9fb4baeee811e72820bed99115182a9158f54
|
refs/heads/master
| 2020-06-01T04:36:55.724338
| 2015-10-18T23:07:55
| 2015-10-18T23:07:55
| 40,537,709
| 1
| 1
| null | null | null | null |
GB18030
|
C++
| false
| false
| 1,746
|
cpp
|
#include "stdafx.h"
#include "FlagMgr.h"
CFlagMgr::CFlagMgr()
{
}
CFlagMgr::~CFlagMgr()
{
}
//根据格式字符串及后缀返回标记
acl::string CFlagMgr::GetFlag(const char *formatstr, const char *suffix)
{
acl::string flag;
flag.format(formatstr, suffix);
return flag;
}
//循环检查标记是否为1
//成功返回true 否则false
bool CFlagMgr::WaitFlagIs1(const acl::string &flag)
{
#define WAIT_RETRY 100
for (int i = 0; i < WAIT_RETRY; i++)
{
if (m_mapFlags[flag] == 1)
{
return true;
}
Sleep(20);
}
return false;
}
//循环检查标记是否为1
//成功返回true 否则false
bool CFlagMgr::WaitFlagIs2(const acl::string &flag)
{
#define WAIT_RETRY 100
for (int i = 0; i < WAIT_RETRY; i++)
{
if (m_mapFlags[flag] == 2)
{
return true;
}
Sleep(20);
}
return false;
}
//检查标记是否为1
//成功返回true 否则false
bool CFlagMgr::CheckFlag(const acl::string &flag)
{
return m_mapFlags[flag] == 1;
}
//设置标记为指定值
void CFlagMgr::SetFlag(acl::string &flag, byte val)
{
m_lockFlag.lock();
m_mapFlags[flag] = val;
m_lockFlag.unlock();
}
//设置标记为指定值
void CFlagMgr::SetFlag(const char *formatstr, const char *suffix, byte val)
{
acl::string flag;
flag.format(formatstr, suffix);
m_lockFlag.lock();
m_mapFlags[flag] = val;
m_lockFlag.unlock();
}
//移除标记
void CFlagMgr::RMFlag(acl::string &flag)
{
std::map<acl::string, byte>::iterator itFlag = m_mapFlags.find(flag);
if (itFlag != m_mapFlags.end())
{
m_lockFlag.lock();
m_mapFlags.erase(itFlag);
m_lockFlag.unlock();
}
}
//移除标记
void CFlagMgr::RMFlag(const char *formatstr, const char *suffix)
{
acl::string flag;
flag.format(formatstr, suffix);
RMFlag(flag);
}
|
[
"307065422@qq.com"
] |
307065422@qq.com
|
d5fac623c7a9084493b375d8e806ce542c548d86
|
1095fbf5b641aa6031dded2087a667a46a0eb4de
|
/QTSync/QTSync/orderedhashtree.h
|
1773ed16b44deec069341b151e85fec9c7dbee3b
|
[] |
no_license
|
chosemove/University-of-homework
|
139e7c27ef6055b584f967108dc0257cccbec1ac
|
c2d7a64abf1c2b6b912f1949b10b272e56a8885d
|
refs/heads/master
| 2023-04-14T03:37:42.631656
| 2021-04-20T12:58:14
| 2021-04-20T12:58:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,770
|
h
|
#ifndef ORDEREDHASHTREE_H
#define ORDEREDHASHTREE_H
#include<QString>
#include<QByteArray>
#include<QCryptographicHash>
#include<QStringList>
/*用五元组<p, h, Parent, FistChild, NextSibling>表示。其中,p表示该
节点对应的文件相对路径,h表示该节点存储的Hash值,Parent, FistChild和NextSibling分别
代表该节点在OHT中的父节点、头子孙节点和后继兄弟节点。*/
struct HashNode
{
QString path; //该节点对应的文件相对路径
QByteArray h; //Hash值
HashNode *Parent; //代表该节点在OHT中的父节点
HashNode *FistChild; //头子孙节点
HashNode *NextSibling; //后继兄弟节点
HashNode()
{
Parent=NULL;
FistChild=NULL;
NextSibling=NULL;
}
//重载运算符
bool operator ==(HashNode *other)
{
if(path==other->path&&h==other->h&&Parent==other->Parent
&&FistChild==other->FistChild&&NextSibling==other->NextSibling)
return true;
return false;
}
};
class Ordered_Hash_Tree
{
public:
Ordered_Hash_Tree(QString path);
~Ordered_Hash_Tree();
//采取递归的方法做
HashNode *Build_OHT(QString absPath,QString Relativepath);
void sortTree(HashNode *rn,HashNode *node);//对树进行排序
void clear(HashNode *node);
void ResetTree(QString path);//重新修改树
void Rebuild();//再次建树,不过对原来的目录
HashNode *getRN();//得到根节点
QString abspath;//记录绝对路径
QStringList paths;//记录文件夹下所有目录或者文件的路径,是绝对路径,方便文件监视器
private:
HashNode *RN; //有序哈希树的根节点
};
#endif // ORDEREDHASHTREE_H
|
[
"1767508581@qq.com"
] |
1767508581@qq.com
|
8ba5bcddd8bf2a2955d4279835dff3a29c8b0083
|
700dc3170fddbdf6eb53ff39a0b29749e7645a39
|
/developerspage.h
|
9d54db9d5d12639dde13d0afbaa44cf8b468a3c8
|
[] |
no_license
|
pseudoPixels/digitalDiary
|
6e2e40c86e1d58eb153889c2470c4466718116b6
|
dad14aa70f819370111ee5747c1a734c15180f65
|
refs/heads/master
| 2020-04-05T06:22:39.567534
| 2018-11-08T02:06:26
| 2018-11-08T02:06:26
| 156,635,831
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 632
|
h
|
#ifndef DEVELOPERSPAGE_H
#define DEVELOPERSPAGE_H
#include <QPainter>
#include <QDialog>
namespace Ui {
class developersPage;
}
class developersPage : public QDialog {
Q_OBJECT
public:
developersPage(QWidget *parent = 0);
~developersPage();
protected:
void changeEvent(QEvent *e);
void paintEvent(QPaintEvent *e){
QPainter painter(this);
QImage image("image/160.PNG","PNG");
painter.drawImage(.1,.1,image);
}
private:
Ui::developersPage *ui;
private slots:
void on_pushButton_clicked();
};
#endif // DEVELOPERSPAGE_H
|
[
"golam.mostaeen@usask.ca"
] |
golam.mostaeen@usask.ca
|
67030e81b8e1ce7426eb9027be95386282092861
|
2e84219d54933602544672f83435e1ce5227b57e
|
/Library/Il2cppBuildCache/UWP/x64/il2cppOutput/UnityEngine.TerrainModule.cpp
|
fdd72ee0bbbd0c273fe7fd36791c0ec06231a4bc
|
[] |
no_license
|
six519/2_gay_dogs_run
|
b2ea27c72c9713c1826a8fe14b9a5cbe6777cbd7
|
d795fc921212691b5e8575eca2538e8916ced0e4
|
refs/heads/main
| 2023-06-12T22:23:11.197120
| 2021-07-03T09:07:43
| 2021-07-03T09:07:43
| 371,247,319
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 272,699
|
cpp
|
#include "pch-cpp.hpp"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <limits>
#include <stdint.h>
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);
}
};
template <typename T1, typename T2, typename T3>
struct VirtActionInvoker3
{
typedef void (*Action)(void*, T1, T2, T3, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2, typename T3, typename T4>
struct VirtActionInvoker4
{
typedef void (*Action)(void*, T1, T2, T3, T4, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2, T3 p3, T4 p4)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, p4, invokeData.method);
}
};
template <typename R>
struct VirtFuncInvoker0
{
typedef R (*Func)(void*, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
return ((Func)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename R, typename T1>
struct VirtFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj);
return ((Func)invokeData.methodPtr)(obj, p1, 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);
}
};
template <typename T1, typename T2, typename T3>
struct GenericVirtActionInvoker3
{
typedef void (*Action)(void*, T1, T2, T3, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2, typename T3, typename T4>
struct GenericVirtActionInvoker4
{
typedef void (*Action)(void*, T1, T2, T3, T4, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3, T4 p4)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, p4, invokeData.method);
}
};
template <typename R>
struct GenericVirtFuncInvoker0
{
typedef R (*Func)(void*, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename R, typename T1>
struct GenericVirtFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, p1, 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);
}
};
template <typename T1, typename T2, typename T3>
struct InterfaceActionInvoker3
{
typedef void (*Action)(void*, T1, T2, T3, const RuntimeMethod*);
static inline void 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);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2, typename T3, typename T4>
struct InterfaceActionInvoker4
{
typedef void (*Action)(void*, T1, T2, T3, T4, const RuntimeMethod*);
static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2, T3 p3, T4 p4)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, p4, invokeData.method);
}
};
template <typename R>
struct InterfaceFuncInvoker0
{
typedef R (*Func)(void*, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
return ((Func)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename R, typename T1>
struct InterfaceFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1)
{
const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface);
return ((Func)invokeData.methodPtr)(obj, p1, 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);
}
};
template <typename T1, typename T2, typename T3>
struct GenericInterfaceActionInvoker3
{
typedef void (*Action)(void*, T1, T2, T3, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method);
}
};
template <typename T1, typename T2, typename T3, typename T4>
struct GenericInterfaceActionInvoker4
{
typedef void (*Action)(void*, T1, T2, T3, T4, const RuntimeMethod*);
static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2, T3 p3, T4 p4)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
((Action)invokeData.methodPtr)(obj, p1, p2, p3, p4, invokeData.method);
}
};
template <typename R>
struct GenericInterfaceFuncInvoker0
{
typedef R (*Func)(void*, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, invokeData.method);
}
};
template <typename R, typename T1>
struct GenericInterfaceFuncInvoker1
{
typedef R (*Func)(void*, T1, const RuntimeMethod*);
static inline R Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1)
{
VirtualInvokeData invokeData;
il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData);
return ((Func)invokeData.methodPtr)(obj, p1, invokeData.method);
}
};
// System.Collections.Generic.Dictionary`2<System.Int32,System.Object>
struct Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F;
// System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725;
// System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>
struct Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C;
// System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C;
// System.Collections.Generic.IEqualityComparer`1<System.Int32>
struct IEqualityComparer_1_t62010156673DE1460AB1D1CEBE5DCD48665E1A38;
// System.Collections.Generic.IEqualityComparer`1<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord>
struct IEqualityComparer_1_tA69FAEE2FF62FD94D03621391FBBAA1F820E8B92;
// System.Collections.Generic.Dictionary`2/KeyCollection<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct KeyCollection_t749DBEFA13BA24F77DF2C12137D5331F541F3B15;
// System.Collections.Generic.Dictionary`2/KeyCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>
struct KeyCollection_t7A3E9764F18C1DE44C90DF9D411158787E20A943;
// System.Collections.Generic.Dictionary`2/KeyCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC;
// System.Collections.Generic.Dictionary`2/ValueCollection<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct ValueCollection_tF5A29AA52483C44A9B166F23F45001565015B4EB;
// System.Collections.Generic.Dictionary`2/ValueCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct ValueCollection_tA937879944B4CC06877A7FDB0FD1D2B941D9221B;
// System.Collections.Generic.Dictionary`2/Entry<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>[]
struct EntryU5BU5D_t8F8773833E17C6A0E66C03DDD293977F035F44EC;
// System.Collections.Generic.Dictionary`2/Entry<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>[]
struct EntryU5BU5D_tAFCE4E7A6A0D15A8B29BA1FBF1D4C566393DA40C;
// System.Char[]
struct CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34;
// System.Delegate[]
struct DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8;
// System.Int32[]
struct Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32;
// UnityEngine.Terrain[]
struct TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57;
// System.AsyncCallback
struct AsyncCallback_tA7921BEF974919C46FF8F9D9867C567B200BB0EA;
// UnityEngine.Behaviour
struct Behaviour_t1A3DDDCF73B4627928FBFE02ED52B7251777DBD9;
// UnityEngine.Component
struct Component_t62FBC8D2420DA4BE9037AFE430740F6B3EECA684;
// System.Delegate
struct Delegate_t;
// System.DelegateData
struct DelegateData_t17DD30660E330C49381DAA99F934BE75CB11F288;
// System.IAsyncResult
struct IAsyncResult_tC9F97BF36FCF122D29D3101D80642278297BF370;
// System.Reflection.MethodInfo
struct MethodInfo_t;
// UnityEngine.Object
struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A;
// System.String
struct String_t;
// UnityEngine.Terrain
struct Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836;
// UnityEngine.TerrainData
struct TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4;
// UnityEngine.Transform
struct Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1;
// System.Void
struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5;
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback
struct HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0;
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback
struct TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0
struct U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1
struct U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainGroups
struct TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap
struct TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0
struct U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter
struct TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7;
IL2CPP_EXTERN_C RuntimeClass* Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_Add_m267342D40CFF0F8B5BAD87A5CE00E3909531BD96_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_Add_mE1C4F9D19A66168F6DAD8690E89CDB2A36353F0D_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_ContainsKey_mAB645E14BEA5777BD44ADAE7A50A6F0A8093BC9C_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_GetEnumerator_m147C3BB4ED736CEA41232F46C074D6B974011AA4_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_GetEnumerator_m2FABB49D216C87FA099BA346CB5CD03DCD24C952_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_TryGetValue_m98F72F5729EC6BC5A95E45EE02F330D48C274FE8_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2__ctor_mCCBF2E85C3037B87300EF879DD1791B4EB6DD230_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2__ctor_mE808665E6AFDBF2A2BA8A0F50089B72EE98DBBA1_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_get_Count_mFA499FD6C7C49BC3D70E56F18B385FC96BB1122D_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Dictionary_2_get_Keys_mAE2D87453C7973972A5637C6F4EAD27613692826_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_Dispose_m07DC0EE5F0A8163D940559D768B774000D6D38AB_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_Dispose_m1F1794448E1C1BD96E362C46BA0DB16B018D57E4_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_Dispose_mAC047D3AE663114F2D8DFDA994E2C9D78A3E9EB0_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_MoveNext_m0CCC05F07B62FCEE6591F765FC15D804D05BAD28_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_MoveNext_m5380371A16E1990E23859EED5F3C2F1843B39B38_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_MoveNext_m821A025A3826D2405C49130607D842500F1ECEF4_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_get_Current_m13B3FF8E2918832E70E30374C13E9939E9AA3894_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_get_Current_mB812E91C3669D0EE3EACF5F58E0A9BBD03D43711_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* Enumerator_get_Current_mF013CBBAC5FC4D1B2E4A4DF551C8FE254F675FC3_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* KeyCollection_GetEnumerator_m6405FB5505A9993F393EA3F5C33A46514043AA2A_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* KeyValuePair_2_get_Key_mE6C14010B6C03B4E060CEF852A6F22FDC4713D0E_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* KeyValuePair_2_get_Value_m011C84EFA22A68B46C33DD7DF651E3B2A65D0A8E_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* U3CU3Ec__DisplayClass4_0_U3CCreateFromPlacementU3Eb__0_mA0E2295171D220FA7ABA12660D2CB357BC721653_RuntimeMethod_var;
IL2CPP_EXTERN_C const RuntimeMethod* U3CU3Ec__DisplayClass4_1_U3CCollectTerrainsU3Eb__0_m539C07F9B8F371A9E9C09A8AFD003DD4163C7810_RuntimeMethod_var;
struct Delegate_t_marshaled_com;
struct Delegate_t_marshaled_pinvoke;
struct DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8;
struct TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57;
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_t1E32A317E34BC1FD0A7614BD67748813CD043632
{
public:
public:
};
// System.Object
// System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 : public RuntimeObject
{
public:
// System.Int32[] System.Collections.Generic.Dictionary`2::buckets
Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* ___buckets_0;
// System.Collections.Generic.Dictionary`2/Entry<TKey,TValue>[] System.Collections.Generic.Dictionary`2::entries
EntryU5BU5D_t8F8773833E17C6A0E66C03DDD293977F035F44EC* ___entries_1;
// System.Int32 System.Collections.Generic.Dictionary`2::count
int32_t ___count_2;
// System.Int32 System.Collections.Generic.Dictionary`2::version
int32_t ___version_3;
// System.Int32 System.Collections.Generic.Dictionary`2::freeList
int32_t ___freeList_4;
// System.Int32 System.Collections.Generic.Dictionary`2::freeCount
int32_t ___freeCount_5;
// System.Collections.Generic.IEqualityComparer`1<TKey> System.Collections.Generic.Dictionary`2::comparer
RuntimeObject* ___comparer_6;
// System.Collections.Generic.Dictionary`2/KeyCollection<TKey,TValue> System.Collections.Generic.Dictionary`2::keys
KeyCollection_t749DBEFA13BA24F77DF2C12137D5331F541F3B15 * ___keys_7;
// System.Collections.Generic.Dictionary`2/ValueCollection<TKey,TValue> System.Collections.Generic.Dictionary`2::values
ValueCollection_tF5A29AA52483C44A9B166F23F45001565015B4EB * ___values_8;
// System.Object System.Collections.Generic.Dictionary`2::_syncRoot
RuntimeObject * ____syncRoot_9;
public:
inline static int32_t get_offset_of_buckets_0() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___buckets_0)); }
inline Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* get_buckets_0() const { return ___buckets_0; }
inline Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32** get_address_of_buckets_0() { return &___buckets_0; }
inline void set_buckets_0(Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* value)
{
___buckets_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___buckets_0), (void*)value);
}
inline static int32_t get_offset_of_entries_1() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___entries_1)); }
inline EntryU5BU5D_t8F8773833E17C6A0E66C03DDD293977F035F44EC* get_entries_1() const { return ___entries_1; }
inline EntryU5BU5D_t8F8773833E17C6A0E66C03DDD293977F035F44EC** get_address_of_entries_1() { return &___entries_1; }
inline void set_entries_1(EntryU5BU5D_t8F8773833E17C6A0E66C03DDD293977F035F44EC* value)
{
___entries_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___entries_1), (void*)value);
}
inline static int32_t get_offset_of_count_2() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___count_2)); }
inline int32_t get_count_2() const { return ___count_2; }
inline int32_t* get_address_of_count_2() { return &___count_2; }
inline void set_count_2(int32_t value)
{
___count_2 = value;
}
inline static int32_t get_offset_of_version_3() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___version_3)); }
inline int32_t get_version_3() const { return ___version_3; }
inline int32_t* get_address_of_version_3() { return &___version_3; }
inline void set_version_3(int32_t value)
{
___version_3 = value;
}
inline static int32_t get_offset_of_freeList_4() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___freeList_4)); }
inline int32_t get_freeList_4() const { return ___freeList_4; }
inline int32_t* get_address_of_freeList_4() { return &___freeList_4; }
inline void set_freeList_4(int32_t value)
{
___freeList_4 = value;
}
inline static int32_t get_offset_of_freeCount_5() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___freeCount_5)); }
inline int32_t get_freeCount_5() const { return ___freeCount_5; }
inline int32_t* get_address_of_freeCount_5() { return &___freeCount_5; }
inline void set_freeCount_5(int32_t value)
{
___freeCount_5 = value;
}
inline static int32_t get_offset_of_comparer_6() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___comparer_6)); }
inline RuntimeObject* get_comparer_6() const { return ___comparer_6; }
inline RuntimeObject** get_address_of_comparer_6() { return &___comparer_6; }
inline void set_comparer_6(RuntimeObject* value)
{
___comparer_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___comparer_6), (void*)value);
}
inline static int32_t get_offset_of_keys_7() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___keys_7)); }
inline KeyCollection_t749DBEFA13BA24F77DF2C12137D5331F541F3B15 * get_keys_7() const { return ___keys_7; }
inline KeyCollection_t749DBEFA13BA24F77DF2C12137D5331F541F3B15 ** get_address_of_keys_7() { return &___keys_7; }
inline void set_keys_7(KeyCollection_t749DBEFA13BA24F77DF2C12137D5331F541F3B15 * value)
{
___keys_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___keys_7), (void*)value);
}
inline static int32_t get_offset_of_values_8() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ___values_8)); }
inline ValueCollection_tF5A29AA52483C44A9B166F23F45001565015B4EB * get_values_8() const { return ___values_8; }
inline ValueCollection_tF5A29AA52483C44A9B166F23F45001565015B4EB ** get_address_of_values_8() { return &___values_8; }
inline void set_values_8(ValueCollection_tF5A29AA52483C44A9B166F23F45001565015B4EB * value)
{
___values_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___values_8), (void*)value);
}
inline static int32_t get_offset_of__syncRoot_9() { return static_cast<int32_t>(offsetof(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725, ____syncRoot_9)); }
inline RuntimeObject * get__syncRoot_9() const { return ____syncRoot_9; }
inline RuntimeObject ** get_address_of__syncRoot_9() { return &____syncRoot_9; }
inline void set__syncRoot_9(RuntimeObject * value)
{
____syncRoot_9 = value;
Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_9), (void*)value);
}
};
// System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C : public RuntimeObject
{
public:
// System.Int32[] System.Collections.Generic.Dictionary`2::buckets
Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* ___buckets_0;
// System.Collections.Generic.Dictionary`2/Entry<TKey,TValue>[] System.Collections.Generic.Dictionary`2::entries
EntryU5BU5D_tAFCE4E7A6A0D15A8B29BA1FBF1D4C566393DA40C* ___entries_1;
// System.Int32 System.Collections.Generic.Dictionary`2::count
int32_t ___count_2;
// System.Int32 System.Collections.Generic.Dictionary`2::version
int32_t ___version_3;
// System.Int32 System.Collections.Generic.Dictionary`2::freeList
int32_t ___freeList_4;
// System.Int32 System.Collections.Generic.Dictionary`2::freeCount
int32_t ___freeCount_5;
// System.Collections.Generic.IEqualityComparer`1<TKey> System.Collections.Generic.Dictionary`2::comparer
RuntimeObject* ___comparer_6;
// System.Collections.Generic.Dictionary`2/KeyCollection<TKey,TValue> System.Collections.Generic.Dictionary`2::keys
KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * ___keys_7;
// System.Collections.Generic.Dictionary`2/ValueCollection<TKey,TValue> System.Collections.Generic.Dictionary`2::values
ValueCollection_tA937879944B4CC06877A7FDB0FD1D2B941D9221B * ___values_8;
// System.Object System.Collections.Generic.Dictionary`2::_syncRoot
RuntimeObject * ____syncRoot_9;
public:
inline static int32_t get_offset_of_buckets_0() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___buckets_0)); }
inline Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* get_buckets_0() const { return ___buckets_0; }
inline Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32** get_address_of_buckets_0() { return &___buckets_0; }
inline void set_buckets_0(Int32U5BU5D_t70F1BDC14B1786481B176D6139A5E3B87DC54C32* value)
{
___buckets_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___buckets_0), (void*)value);
}
inline static int32_t get_offset_of_entries_1() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___entries_1)); }
inline EntryU5BU5D_tAFCE4E7A6A0D15A8B29BA1FBF1D4C566393DA40C* get_entries_1() const { return ___entries_1; }
inline EntryU5BU5D_tAFCE4E7A6A0D15A8B29BA1FBF1D4C566393DA40C** get_address_of_entries_1() { return &___entries_1; }
inline void set_entries_1(EntryU5BU5D_tAFCE4E7A6A0D15A8B29BA1FBF1D4C566393DA40C* value)
{
___entries_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___entries_1), (void*)value);
}
inline static int32_t get_offset_of_count_2() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___count_2)); }
inline int32_t get_count_2() const { return ___count_2; }
inline int32_t* get_address_of_count_2() { return &___count_2; }
inline void set_count_2(int32_t value)
{
___count_2 = value;
}
inline static int32_t get_offset_of_version_3() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___version_3)); }
inline int32_t get_version_3() const { return ___version_3; }
inline int32_t* get_address_of_version_3() { return &___version_3; }
inline void set_version_3(int32_t value)
{
___version_3 = value;
}
inline static int32_t get_offset_of_freeList_4() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___freeList_4)); }
inline int32_t get_freeList_4() const { return ___freeList_4; }
inline int32_t* get_address_of_freeList_4() { return &___freeList_4; }
inline void set_freeList_4(int32_t value)
{
___freeList_4 = value;
}
inline static int32_t get_offset_of_freeCount_5() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___freeCount_5)); }
inline int32_t get_freeCount_5() const { return ___freeCount_5; }
inline int32_t* get_address_of_freeCount_5() { return &___freeCount_5; }
inline void set_freeCount_5(int32_t value)
{
___freeCount_5 = value;
}
inline static int32_t get_offset_of_comparer_6() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___comparer_6)); }
inline RuntimeObject* get_comparer_6() const { return ___comparer_6; }
inline RuntimeObject** get_address_of_comparer_6() { return &___comparer_6; }
inline void set_comparer_6(RuntimeObject* value)
{
___comparer_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___comparer_6), (void*)value);
}
inline static int32_t get_offset_of_keys_7() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___keys_7)); }
inline KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * get_keys_7() const { return ___keys_7; }
inline KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC ** get_address_of_keys_7() { return &___keys_7; }
inline void set_keys_7(KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * value)
{
___keys_7 = value;
Il2CppCodeGenWriteBarrier((void**)(&___keys_7), (void*)value);
}
inline static int32_t get_offset_of_values_8() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ___values_8)); }
inline ValueCollection_tA937879944B4CC06877A7FDB0FD1D2B941D9221B * get_values_8() const { return ___values_8; }
inline ValueCollection_tA937879944B4CC06877A7FDB0FD1D2B941D9221B ** get_address_of_values_8() { return &___values_8; }
inline void set_values_8(ValueCollection_tA937879944B4CC06877A7FDB0FD1D2B941D9221B * value)
{
___values_8 = value;
Il2CppCodeGenWriteBarrier((void**)(&___values_8), (void*)value);
}
inline static int32_t get_offset_of__syncRoot_9() { return static_cast<int32_t>(offsetof(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C, ____syncRoot_9)); }
inline RuntimeObject * get__syncRoot_9() const { return ____syncRoot_9; }
inline RuntimeObject ** get_address_of__syncRoot_9() { return &____syncRoot_9; }
inline void set__syncRoot_9(RuntimeObject * value)
{
____syncRoot_9 = value;
Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_9), (void*)value);
}
};
// System.Collections.Generic.Dictionary`2/KeyCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC : public RuntimeObject
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/KeyCollection::dictionary
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * ___dictionary_0;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC, ___dictionary_0)); }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
};
struct Il2CppArrayBounds;
// System.Array
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value);
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks
struct TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0 : public RuntimeObject
{
public:
public:
};
struct TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields
{
public:
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback UnityEngine.Experimental.TerrainAPI.TerrainCallbacks::heightmapChanged
HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * ___heightmapChanged_0;
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback UnityEngine.Experimental.TerrainAPI.TerrainCallbacks::textureChanged
TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * ___textureChanged_1;
public:
inline static int32_t get_offset_of_heightmapChanged_0() { return static_cast<int32_t>(offsetof(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields, ___heightmapChanged_0)); }
inline HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * get_heightmapChanged_0() const { return ___heightmapChanged_0; }
inline HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 ** get_address_of_heightmapChanged_0() { return &___heightmapChanged_0; }
inline void set_heightmapChanged_0(HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * value)
{
___heightmapChanged_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___heightmapChanged_0), (void*)value);
}
inline static int32_t get_offset_of_textureChanged_1() { return static_cast<int32_t>(offsetof(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields, ___textureChanged_1)); }
inline TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * get_textureChanged_1() const { return ___textureChanged_1; }
inline TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F ** get_address_of_textureChanged_1() { return &___textureChanged_1; }
inline void set_textureChanged_1(TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * value)
{
___textureChanged_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___textureChanged_1), (void*)value);
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility
struct TerrainUtility_tDDD67DE494266AFC6E82B297619E3B84DF2CF37D : public RuntimeObject
{
public:
public:
};
// System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_com
{
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0
struct U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 : public RuntimeObject
{
public:
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0::onlyAutoConnectedTerrains
bool ___onlyAutoConnectedTerrains_0;
public:
inline static int32_t get_offset_of_onlyAutoConnectedTerrains_0() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8, ___onlyAutoConnectedTerrains_0)); }
inline bool get_onlyAutoConnectedTerrains_0() const { return ___onlyAutoConnectedTerrains_0; }
inline bool* get_address_of_onlyAutoConnectedTerrains_0() { return &___onlyAutoConnectedTerrains_0; }
inline void set_onlyAutoConnectedTerrains_0(bool value)
{
___onlyAutoConnectedTerrains_0 = value;
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1
struct U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 : public RuntimeObject
{
public:
// UnityEngine.Terrain UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1::t
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___t_0;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0 UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1::CS$<>8__locals1
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * ___CSU24U3CU3E8__locals1_1;
public:
inline static int32_t get_offset_of_t_0() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696, ___t_0)); }
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * get_t_0() const { return ___t_0; }
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 ** get_address_of_t_0() { return &___t_0; }
inline void set_t_0(Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * value)
{
___t_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___t_0), (void*)value);
}
inline static int32_t get_offset_of_CSU24U3CU3E8__locals1_1() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696, ___CSU24U3CU3E8__locals1_1)); }
inline U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * get_CSU24U3CU3E8__locals1_1() const { return ___CSU24U3CU3E8__locals1_1; }
inline U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 ** get_address_of_CSU24U3CU3E8__locals1_1() { return &___CSU24U3CU3E8__locals1_1; }
inline void set_CSU24U3CU3E8__locals1_1(U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * value)
{
___CSU24U3CU3E8__locals1_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___CSU24U3CU3E8__locals1_1), (void*)value);
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0
struct U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F : public RuntimeObject
{
public:
// System.Int32 UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0::groupID
int32_t ___groupID_0;
public:
inline static int32_t get_offset_of_groupID_0() { return static_cast<int32_t>(offsetof(U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F, ___groupID_0)); }
inline int32_t get_groupID_0() const { return ___groupID_0; }
inline int32_t* get_address_of_groupID_0() { return &___groupID_0; }
inline void set_groupID_0(int32_t value)
{
___groupID_0 = value;
}
};
// System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>
struct KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0
{
public:
// TKey System.Collections.Generic.KeyValuePair`2::key
int32_t ___key_0;
// TValue System.Collections.Generic.KeyValuePair`2::value
RuntimeObject * ___value_1;
public:
inline static int32_t get_offset_of_key_0() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0, ___key_0)); }
inline int32_t get_key_0() const { return ___key_0; }
inline int32_t* get_address_of_key_0() { return &___key_0; }
inline void set_key_0(int32_t value)
{
___key_0 = value;
}
inline static int32_t get_offset_of_value_1() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0, ___value_1)); }
inline RuntimeObject * get_value_1() const { return ___value_1; }
inline RuntimeObject ** get_address_of_value_1() { return &___value_1; }
inline void set_value_1(RuntimeObject * value)
{
___value_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___value_1), (void*)value);
}
};
// System.Collections.Generic.KeyValuePair`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9
{
public:
// TKey System.Collections.Generic.KeyValuePair`2::key
int32_t ___key_0;
// TValue System.Collections.Generic.KeyValuePair`2::value
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * ___value_1;
public:
inline static int32_t get_offset_of_key_0() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9, ___key_0)); }
inline int32_t get_key_0() const { return ___key_0; }
inline int32_t* get_address_of_key_0() { return &___key_0; }
inline void set_key_0(int32_t value)
{
___key_0 = value;
}
inline static int32_t get_offset_of_value_1() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9, ___value_1)); }
inline TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * get_value_1() const { return ___value_1; }
inline TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 ** get_address_of_value_1() { return &___value_1; }
inline void set_value_1(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * value)
{
___value_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___value_1), (void*)value);
}
};
// System.Boolean
struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37
{
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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37, ___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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_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.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA : public ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52
{
public:
public:
};
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_com
{
};
// System.Int32
struct Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046
{
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_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046, ___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;
}
};
// UnityEngine.RectInt
struct RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49
{
public:
// System.Int32 UnityEngine.RectInt::m_XMin
int32_t ___m_XMin_0;
// System.Int32 UnityEngine.RectInt::m_YMin
int32_t ___m_YMin_1;
// System.Int32 UnityEngine.RectInt::m_Width
int32_t ___m_Width_2;
// System.Int32 UnityEngine.RectInt::m_Height
int32_t ___m_Height_3;
public:
inline static int32_t get_offset_of_m_XMin_0() { return static_cast<int32_t>(offsetof(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49, ___m_XMin_0)); }
inline int32_t get_m_XMin_0() const { return ___m_XMin_0; }
inline int32_t* get_address_of_m_XMin_0() { return &___m_XMin_0; }
inline void set_m_XMin_0(int32_t value)
{
___m_XMin_0 = value;
}
inline static int32_t get_offset_of_m_YMin_1() { return static_cast<int32_t>(offsetof(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49, ___m_YMin_1)); }
inline int32_t get_m_YMin_1() const { return ___m_YMin_1; }
inline int32_t* get_address_of_m_YMin_1() { return &___m_YMin_1; }
inline void set_m_YMin_1(int32_t value)
{
___m_YMin_1 = value;
}
inline static int32_t get_offset_of_m_Width_2() { return static_cast<int32_t>(offsetof(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49, ___m_Width_2)); }
inline int32_t get_m_Width_2() const { return ___m_Width_2; }
inline int32_t* get_address_of_m_Width_2() { return &___m_Width_2; }
inline void set_m_Width_2(int32_t value)
{
___m_Width_2 = value;
}
inline static int32_t get_offset_of_m_Height_3() { return static_cast<int32_t>(offsetof(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49, ___m_Height_3)); }
inline int32_t get_m_Height_3() const { return ___m_Height_3; }
inline int32_t* get_address_of_m_Height_3() { return &___m_Height_3; }
inline void set_m_Height_3(int32_t value)
{
___m_Height_3 = value;
}
};
// System.Single
struct Single_tE07797BA3C98D4CA9B5A19413C19A76688AB899E
{
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_tE07797BA3C98D4CA9B5A19413C19A76688AB899E, ___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;
}
};
// UnityEngine.Vector2
struct Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9
{
public:
// System.Single UnityEngine.Vector2::x
float ___x_0;
// System.Single UnityEngine.Vector2::y
float ___y_1;
public:
inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9, ___x_0)); }
inline float get_x_0() const { return ___x_0; }
inline float* get_address_of_x_0() { return &___x_0; }
inline void set_x_0(float value)
{
___x_0 = value;
}
inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9, ___y_1)); }
inline float get_y_1() const { return ___y_1; }
inline float* get_address_of_y_1() { return &___y_1; }
inline void set_y_1(float value)
{
___y_1 = value;
}
};
struct Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields
{
public:
// UnityEngine.Vector2 UnityEngine.Vector2::zeroVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___zeroVector_2;
// UnityEngine.Vector2 UnityEngine.Vector2::oneVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___oneVector_3;
// UnityEngine.Vector2 UnityEngine.Vector2::upVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___upVector_4;
// UnityEngine.Vector2 UnityEngine.Vector2::downVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___downVector_5;
// UnityEngine.Vector2 UnityEngine.Vector2::leftVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___leftVector_6;
// UnityEngine.Vector2 UnityEngine.Vector2::rightVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___rightVector_7;
// UnityEngine.Vector2 UnityEngine.Vector2::positiveInfinityVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___positiveInfinityVector_8;
// UnityEngine.Vector2 UnityEngine.Vector2::negativeInfinityVector
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___negativeInfinityVector_9;
public:
inline static int32_t get_offset_of_zeroVector_2() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___zeroVector_2)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_zeroVector_2() const { return ___zeroVector_2; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_zeroVector_2() { return &___zeroVector_2; }
inline void set_zeroVector_2(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___zeroVector_2 = value;
}
inline static int32_t get_offset_of_oneVector_3() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___oneVector_3)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_oneVector_3() const { return ___oneVector_3; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_oneVector_3() { return &___oneVector_3; }
inline void set_oneVector_3(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___oneVector_3 = value;
}
inline static int32_t get_offset_of_upVector_4() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___upVector_4)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_upVector_4() const { return ___upVector_4; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_upVector_4() { return &___upVector_4; }
inline void set_upVector_4(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___upVector_4 = value;
}
inline static int32_t get_offset_of_downVector_5() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___downVector_5)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_downVector_5() const { return ___downVector_5; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_downVector_5() { return &___downVector_5; }
inline void set_downVector_5(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___downVector_5 = value;
}
inline static int32_t get_offset_of_leftVector_6() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___leftVector_6)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_leftVector_6() const { return ___leftVector_6; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_leftVector_6() { return &___leftVector_6; }
inline void set_leftVector_6(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___leftVector_6 = value;
}
inline static int32_t get_offset_of_rightVector_7() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___rightVector_7)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_rightVector_7() const { return ___rightVector_7; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_rightVector_7() { return &___rightVector_7; }
inline void set_rightVector_7(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___rightVector_7 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___positiveInfinityVector_8)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_positiveInfinityVector_8() const { return ___positiveInfinityVector_8; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_positiveInfinityVector_8() { return &___positiveInfinityVector_8; }
inline void set_positiveInfinityVector_8(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___positiveInfinityVector_8 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_9() { return static_cast<int32_t>(offsetof(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9_StaticFields, ___negativeInfinityVector_9)); }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 get_negativeInfinityVector_9() const { return ___negativeInfinityVector_9; }
inline Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * get_address_of_negativeInfinityVector_9() { return &___negativeInfinityVector_9; }
inline void set_negativeInfinityVector_9(Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 value)
{
___negativeInfinityVector_9 = value;
}
};
// UnityEngine.Vector3
struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E
{
public:
// System.Single UnityEngine.Vector3::x
float ___x_2;
// System.Single UnityEngine.Vector3::y
float ___y_3;
// System.Single UnityEngine.Vector3::z
float ___z_4;
public:
inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___x_2)); }
inline float get_x_2() const { return ___x_2; }
inline float* get_address_of_x_2() { return &___x_2; }
inline void set_x_2(float value)
{
___x_2 = value;
}
inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___y_3)); }
inline float get_y_3() const { return ___y_3; }
inline float* get_address_of_y_3() { return &___y_3; }
inline void set_y_3(float value)
{
___y_3 = value;
}
inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___z_4)); }
inline float get_z_4() const { return ___z_4; }
inline float* get_address_of_z_4() { return &___z_4; }
inline void set_z_4(float value)
{
___z_4 = value;
}
};
struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields
{
public:
// UnityEngine.Vector3 UnityEngine.Vector3::zeroVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___zeroVector_5;
// UnityEngine.Vector3 UnityEngine.Vector3::oneVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oneVector_6;
// UnityEngine.Vector3 UnityEngine.Vector3::upVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___upVector_7;
// UnityEngine.Vector3 UnityEngine.Vector3::downVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___downVector_8;
// UnityEngine.Vector3 UnityEngine.Vector3::leftVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___leftVector_9;
// UnityEngine.Vector3 UnityEngine.Vector3::rightVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___rightVector_10;
// UnityEngine.Vector3 UnityEngine.Vector3::forwardVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___forwardVector_11;
// UnityEngine.Vector3 UnityEngine.Vector3::backVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___backVector_12;
// UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___positiveInfinityVector_13;
// UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___negativeInfinityVector_14;
public:
inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___zeroVector_5)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_zeroVector_5() const { return ___zeroVector_5; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_zeroVector_5() { return &___zeroVector_5; }
inline void set_zeroVector_5(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___zeroVector_5 = value;
}
inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___oneVector_6)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oneVector_6() const { return ___oneVector_6; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oneVector_6() { return &___oneVector_6; }
inline void set_oneVector_6(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___oneVector_6 = value;
}
inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___upVector_7)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_upVector_7() const { return ___upVector_7; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_upVector_7() { return &___upVector_7; }
inline void set_upVector_7(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___upVector_7 = value;
}
inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___downVector_8)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_downVector_8() const { return ___downVector_8; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_downVector_8() { return &___downVector_8; }
inline void set_downVector_8(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___downVector_8 = value;
}
inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___leftVector_9)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_leftVector_9() const { return ___leftVector_9; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_leftVector_9() { return &___leftVector_9; }
inline void set_leftVector_9(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___leftVector_9 = value;
}
inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___rightVector_10)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_rightVector_10() const { return ___rightVector_10; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_rightVector_10() { return &___rightVector_10; }
inline void set_rightVector_10(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___rightVector_10 = value;
}
inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___forwardVector_11)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_forwardVector_11() const { return ___forwardVector_11; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_forwardVector_11() { return &___forwardVector_11; }
inline void set_forwardVector_11(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___forwardVector_11 = value;
}
inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___backVector_12)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_backVector_12() const { return ___backVector_12; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_backVector_12() { return &___backVector_12; }
inline void set_backVector_12(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___backVector_12 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___positiveInfinityVector_13)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; }
inline void set_positiveInfinityVector_13(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___positiveInfinityVector_13 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___negativeInfinityVector_14)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; }
inline void set_negativeInfinityVector_14(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___negativeInfinityVector_14 = value;
}
};
// System.Void
struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5
{
public:
union
{
struct
{
};
uint8_t Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5__padding[1];
};
public:
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainGroups
struct TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 : public Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725
{
public:
public:
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord
struct TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901
{
public:
// System.Int32 UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord::tileX
int32_t ___tileX_0;
// System.Int32 UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord::tileZ
int32_t ___tileZ_1;
public:
inline static int32_t get_offset_of_tileX_0() { return static_cast<int32_t>(offsetof(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901, ___tileX_0)); }
inline int32_t get_tileX_0() const { return ___tileX_0; }
inline int32_t* get_address_of_tileX_0() { return &___tileX_0; }
inline void set_tileX_0(int32_t value)
{
___tileX_0 = value;
}
inline static int32_t get_offset_of_tileZ_1() { return static_cast<int32_t>(offsetof(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901, ___tileZ_1)); }
inline int32_t get_tileZ_1() const { return ___tileZ_1; }
inline int32_t* get_address_of_tileZ_1() { return &___tileZ_1; }
inline void set_tileZ_1(int32_t value)
{
___tileZ_1 = value;
}
};
// System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>
struct Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::dictionary
Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::version
int32_t ___version_1;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::index
int32_t ___index_2;
// System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::current
KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 ___current_3;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::getEnumeratorRetType
int32_t ___getEnumeratorRetType_4;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C, ___dictionary_0)); }
inline Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_version_1() { return static_cast<int32_t>(offsetof(Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C, ___version_1)); }
inline int32_t get_version_1() const { return ___version_1; }
inline int32_t* get_address_of_version_1() { return &___version_1; }
inline void set_version_1(int32_t value)
{
___version_1 = value;
}
inline static int32_t get_offset_of_index_2() { return static_cast<int32_t>(offsetof(Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C, ___index_2)); }
inline int32_t get_index_2() const { return ___index_2; }
inline int32_t* get_address_of_index_2() { return &___index_2; }
inline void set_index_2(int32_t value)
{
___index_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C, ___current_3)); }
inline KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 get_current_3() const { return ___current_3; }
inline KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 * get_address_of_current_3() { return &___current_3; }
inline void set_current_3(KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___value_1), (void*)NULL);
}
inline static int32_t get_offset_of_getEnumeratorRetType_4() { return static_cast<int32_t>(offsetof(Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C, ___getEnumeratorRetType_4)); }
inline int32_t get_getEnumeratorRetType_4() const { return ___getEnumeratorRetType_4; }
inline int32_t* get_address_of_getEnumeratorRetType_4() { return &___getEnumeratorRetType_4; }
inline void set_getEnumeratorRetType_4(int32_t value)
{
___getEnumeratorRetType_4 = value;
}
};
// System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>
struct Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::dictionary
Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::version
int32_t ___version_1;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::index
int32_t ___index_2;
// System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::current
KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 ___current_3;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::getEnumeratorRetType
int32_t ___getEnumeratorRetType_4;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C, ___dictionary_0)); }
inline Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_version_1() { return static_cast<int32_t>(offsetof(Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C, ___version_1)); }
inline int32_t get_version_1() const { return ___version_1; }
inline int32_t* get_address_of_version_1() { return &___version_1; }
inline void set_version_1(int32_t value)
{
___version_1 = value;
}
inline static int32_t get_offset_of_index_2() { return static_cast<int32_t>(offsetof(Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C, ___index_2)); }
inline int32_t get_index_2() const { return ___index_2; }
inline int32_t* get_address_of_index_2() { return &___index_2; }
inline void set_index_2(int32_t value)
{
___index_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C, ___current_3)); }
inline KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 get_current_3() const { return ___current_3; }
inline KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 * get_address_of_current_3() { return &___current_3; }
inline void set_current_3(KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___value_1), (void*)NULL);
}
inline static int32_t get_offset_of_getEnumeratorRetType_4() { return static_cast<int32_t>(offsetof(Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C, ___getEnumeratorRetType_4)); }
inline int32_t get_getEnumeratorRetType_4() const { return ___getEnumeratorRetType_4; }
inline int32_t* get_address_of_getEnumeratorRetType_4() { return &___getEnumeratorRetType_4; }
inline void set_getEnumeratorRetType_4(int32_t value)
{
___getEnumeratorRetType_4 = value;
}
};
// System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>
struct Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::dictionary
Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::index
int32_t ___index_1;
// System.Int32 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::version
int32_t ___version_2;
// TKey System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::currentKey
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___currentKey_3;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9, ___dictionary_0)); }
inline Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9, ___index_1)); }
inline int32_t get_index_1() const { return ___index_1; }
inline int32_t* get_address_of_index_1() { return &___index_1; }
inline void set_index_1(int32_t value)
{
___index_1 = value;
}
inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9, ___version_2)); }
inline int32_t get_version_2() const { return ___version_2; }
inline int32_t* get_address_of_version_2() { return &___version_2; }
inline void set_version_2(int32_t value)
{
___version_2 = value;
}
inline static int32_t get_offset_of_currentKey_3() { return static_cast<int32_t>(offsetof(Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9, ___currentKey_3)); }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 get_currentKey_3() const { return ___currentKey_3; }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * get_address_of_currentKey_3() { return &___currentKey_3; }
inline void set_currentKey_3(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 value)
{
___currentKey_3 = value;
}
};
// System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::dictionary
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::index
int32_t ___index_1;
// System.Int32 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::version
int32_t ___version_2;
// TKey System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator::currentKey
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___currentKey_3;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E, ___dictionary_0)); }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_index_1() { return static_cast<int32_t>(offsetof(Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E, ___index_1)); }
inline int32_t get_index_1() const { return ___index_1; }
inline int32_t* get_address_of_index_1() { return &___index_1; }
inline void set_index_1(int32_t value)
{
___index_1 = value;
}
inline static int32_t get_offset_of_version_2() { return static_cast<int32_t>(offsetof(Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E, ___version_2)); }
inline int32_t get_version_2() const { return ___version_2; }
inline int32_t* get_address_of_version_2() { return &___version_2; }
inline void set_version_2(int32_t value)
{
___version_2 = value;
}
inline static int32_t get_offset_of_currentKey_3() { return static_cast<int32_t>(offsetof(Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E, ___currentKey_3)); }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 get_currentKey_3() const { return ___currentKey_3; }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * get_address_of_currentKey_3() { return &___currentKey_3; }
inline void set_currentKey_3(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 value)
{
___currentKey_3 = value;
}
};
// System.Collections.Generic.KeyValuePair`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>
struct KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551
{
public:
// TKey System.Collections.Generic.KeyValuePair`2::key
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key_0;
// TValue System.Collections.Generic.KeyValuePair`2::value
RuntimeObject * ___value_1;
public:
inline static int32_t get_offset_of_key_0() { return static_cast<int32_t>(offsetof(KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551, ___key_0)); }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 get_key_0() const { return ___key_0; }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * get_address_of_key_0() { return &___key_0; }
inline void set_key_0(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 value)
{
___key_0 = value;
}
inline static int32_t get_offset_of_value_1() { return static_cast<int32_t>(offsetof(KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551, ___value_1)); }
inline RuntimeObject * get_value_1() const { return ___value_1; }
inline RuntimeObject ** get_address_of_value_1() { return &___value_1; }
inline void set_value_1(RuntimeObject * value)
{
___value_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___value_1), (void*)value);
}
};
// System.Collections.Generic.KeyValuePair`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD
{
public:
// TKey System.Collections.Generic.KeyValuePair`2::key
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key_0;
// TValue System.Collections.Generic.KeyValuePair`2::value
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___value_1;
public:
inline static int32_t get_offset_of_key_0() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD, ___key_0)); }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 get_key_0() const { return ___key_0; }
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * get_address_of_key_0() { return &___key_0; }
inline void set_key_0(TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 value)
{
___key_0 = value;
}
inline static int32_t get_offset_of_value_1() { return static_cast<int32_t>(offsetof(KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD, ___value_1)); }
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * get_value_1() const { return ___value_1; }
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 ** get_address_of_value_1() { return &___value_1; }
inline void set_value_1(Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * value)
{
___value_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___value_1), (void*)value);
}
};
// 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_t17DD30660E330C49381DAA99F934BE75CB11F288 * ___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_t17DD30660E330C49381DAA99F934BE75CB11F288 * get_data_9() const { return ___data_9; }
inline DelegateData_t17DD30660E330C49381DAA99F934BE75CB11F288 ** get_address_of_data_9() { return &___data_9; }
inline void set_data_9(DelegateData_t17DD30660E330C49381DAA99F934BE75CB11F288 * 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_t17DD30660E330C49381DAA99F934BE75CB11F288 * ___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_t17DD30660E330C49381DAA99F934BE75CB11F288 * ___data_9;
int32_t ___method_is_virtual_10;
};
// UnityEngine.Object
struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A : 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_tF2F3778131EFF286AF62B7B013A170F95A91571A, ___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_tF2F3778131EFF286AF62B7B013A170F95A91571A_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_tF2F3778131EFF286AF62B7B013A170F95A91571A_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_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
// UnityEngine.TerrainData/BoundaryValueType
struct BoundaryValueType_t5B5317FD7A95A68B0FA9B3DD30EB5CF9E3E6883D
{
public:
// System.Int32 UnityEngine.TerrainData/BoundaryValueType::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(BoundaryValueType_t5B5317FD7A95A68B0FA9B3DD30EB5CF9E3E6883D, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/ErrorCode
struct ErrorCode_t5533C7D1F39FAA2C0E95C82A736DF461B0B2FCE6
{
public:
// System.Int32 UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/ErrorCode::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ErrorCode_t5533C7D1F39FAA2C0E95C82A736DF461B0B2FCE6, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>
struct Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::dictionary
Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::version
int32_t ___version_1;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::index
int32_t ___index_2;
// System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::current
KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 ___current_3;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::getEnumeratorRetType
int32_t ___getEnumeratorRetType_4;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6, ___dictionary_0)); }
inline Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_version_1() { return static_cast<int32_t>(offsetof(Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6, ___version_1)); }
inline int32_t get_version_1() const { return ___version_1; }
inline int32_t* get_address_of_version_1() { return &___version_1; }
inline void set_version_1(int32_t value)
{
___version_1 = value;
}
inline static int32_t get_offset_of_index_2() { return static_cast<int32_t>(offsetof(Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6, ___index_2)); }
inline int32_t get_index_2() const { return ___index_2; }
inline int32_t* get_address_of_index_2() { return &___index_2; }
inline void set_index_2(int32_t value)
{
___index_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6, ___current_3)); }
inline KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 get_current_3() const { return ___current_3; }
inline KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 * get_address_of_current_3() { return &___current_3; }
inline void set_current_3(KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___value_1), (void*)NULL);
}
inline static int32_t get_offset_of_getEnumeratorRetType_4() { return static_cast<int32_t>(offsetof(Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6, ___getEnumeratorRetType_4)); }
inline int32_t get_getEnumeratorRetType_4() const { return ___getEnumeratorRetType_4; }
inline int32_t* get_address_of_getEnumeratorRetType_4() { return &___getEnumeratorRetType_4; }
inline void set_getEnumeratorRetType_4(int32_t value)
{
___getEnumeratorRetType_4 = value;
}
};
// System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>
struct Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99
{
public:
// System.Collections.Generic.Dictionary`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::dictionary
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * ___dictionary_0;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::version
int32_t ___version_1;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::index
int32_t ___index_2;
// System.Collections.Generic.KeyValuePair`2<TKey,TValue> System.Collections.Generic.Dictionary`2/Enumerator::current
KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD ___current_3;
// System.Int32 System.Collections.Generic.Dictionary`2/Enumerator::getEnumeratorRetType
int32_t ___getEnumeratorRetType_4;
public:
inline static int32_t get_offset_of_dictionary_0() { return static_cast<int32_t>(offsetof(Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99, ___dictionary_0)); }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * get_dictionary_0() const { return ___dictionary_0; }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C ** get_address_of_dictionary_0() { return &___dictionary_0; }
inline void set_dictionary_0(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * value)
{
___dictionary_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___dictionary_0), (void*)value);
}
inline static int32_t get_offset_of_version_1() { return static_cast<int32_t>(offsetof(Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99, ___version_1)); }
inline int32_t get_version_1() const { return ___version_1; }
inline int32_t* get_address_of_version_1() { return &___version_1; }
inline void set_version_1(int32_t value)
{
___version_1 = value;
}
inline static int32_t get_offset_of_index_2() { return static_cast<int32_t>(offsetof(Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99, ___index_2)); }
inline int32_t get_index_2() const { return ___index_2; }
inline int32_t* get_address_of_index_2() { return &___index_2; }
inline void set_index_2(int32_t value)
{
___index_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99, ___current_3)); }
inline KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD get_current_3() const { return ___current_3; }
inline KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD * get_address_of_current_3() { return &___current_3; }
inline void set_current_3(KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier((void**)&(((&___current_3))->___value_1), (void*)NULL);
}
inline static int32_t get_offset_of_getEnumeratorRetType_4() { return static_cast<int32_t>(offsetof(Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99, ___getEnumeratorRetType_4)); }
inline int32_t get_getEnumeratorRetType_4() const { return ___getEnumeratorRetType_4; }
inline int32_t* get_address_of_getEnumeratorRetType_4() { return &___getEnumeratorRetType_4; }
inline void set_getEnumeratorRetType_4(int32_t value)
{
___getEnumeratorRetType_4 = value;
}
};
// UnityEngine.Component
struct Component_t62FBC8D2420DA4BE9037AFE430740F6B3EECA684 : public Object_tF2F3778131EFF286AF62B7B013A170F95A91571A
{
public:
public:
};
// System.MulticastDelegate
struct MulticastDelegate_t : public Delegate_t
{
public:
// System.Delegate[] System.MulticastDelegate::delegates
DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* ___delegates_11;
public:
inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); }
inline DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* get_delegates_11() const { return ___delegates_11; }
inline DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8** get_address_of_delegates_11() { return &___delegates_11; }
inline void set_delegates_11(DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* 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.TerrainData
struct TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 : public Object_tF2F3778131EFF286AF62B7B013A170F95A91571A
{
public:
public:
};
struct TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields
{
public:
// System.Int32 UnityEngine.TerrainData::k_MaximumResolution
int32_t ___k_MaximumResolution_4;
// System.Int32 UnityEngine.TerrainData::k_MinimumDetailResolutionPerPatch
int32_t ___k_MinimumDetailResolutionPerPatch_5;
// System.Int32 UnityEngine.TerrainData::k_MaximumDetailResolutionPerPatch
int32_t ___k_MaximumDetailResolutionPerPatch_6;
// System.Int32 UnityEngine.TerrainData::k_MaximumDetailPatchCount
int32_t ___k_MaximumDetailPatchCount_7;
// System.Int32 UnityEngine.TerrainData::k_MaximumDetailsPerRes
int32_t ___k_MaximumDetailsPerRes_8;
// System.Int32 UnityEngine.TerrainData::k_MinimumAlphamapResolution
int32_t ___k_MinimumAlphamapResolution_9;
// System.Int32 UnityEngine.TerrainData::k_MaximumAlphamapResolution
int32_t ___k_MaximumAlphamapResolution_10;
// System.Int32 UnityEngine.TerrainData::k_MinimumBaseMapResolution
int32_t ___k_MinimumBaseMapResolution_11;
// System.Int32 UnityEngine.TerrainData::k_MaximumBaseMapResolution
int32_t ___k_MaximumBaseMapResolution_12;
public:
inline static int32_t get_offset_of_k_MaximumResolution_4() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumResolution_4)); }
inline int32_t get_k_MaximumResolution_4() const { return ___k_MaximumResolution_4; }
inline int32_t* get_address_of_k_MaximumResolution_4() { return &___k_MaximumResolution_4; }
inline void set_k_MaximumResolution_4(int32_t value)
{
___k_MaximumResolution_4 = value;
}
inline static int32_t get_offset_of_k_MinimumDetailResolutionPerPatch_5() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MinimumDetailResolutionPerPatch_5)); }
inline int32_t get_k_MinimumDetailResolutionPerPatch_5() const { return ___k_MinimumDetailResolutionPerPatch_5; }
inline int32_t* get_address_of_k_MinimumDetailResolutionPerPatch_5() { return &___k_MinimumDetailResolutionPerPatch_5; }
inline void set_k_MinimumDetailResolutionPerPatch_5(int32_t value)
{
___k_MinimumDetailResolutionPerPatch_5 = value;
}
inline static int32_t get_offset_of_k_MaximumDetailResolutionPerPatch_6() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumDetailResolutionPerPatch_6)); }
inline int32_t get_k_MaximumDetailResolutionPerPatch_6() const { return ___k_MaximumDetailResolutionPerPatch_6; }
inline int32_t* get_address_of_k_MaximumDetailResolutionPerPatch_6() { return &___k_MaximumDetailResolutionPerPatch_6; }
inline void set_k_MaximumDetailResolutionPerPatch_6(int32_t value)
{
___k_MaximumDetailResolutionPerPatch_6 = value;
}
inline static int32_t get_offset_of_k_MaximumDetailPatchCount_7() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumDetailPatchCount_7)); }
inline int32_t get_k_MaximumDetailPatchCount_7() const { return ___k_MaximumDetailPatchCount_7; }
inline int32_t* get_address_of_k_MaximumDetailPatchCount_7() { return &___k_MaximumDetailPatchCount_7; }
inline void set_k_MaximumDetailPatchCount_7(int32_t value)
{
___k_MaximumDetailPatchCount_7 = value;
}
inline static int32_t get_offset_of_k_MaximumDetailsPerRes_8() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumDetailsPerRes_8)); }
inline int32_t get_k_MaximumDetailsPerRes_8() const { return ___k_MaximumDetailsPerRes_8; }
inline int32_t* get_address_of_k_MaximumDetailsPerRes_8() { return &___k_MaximumDetailsPerRes_8; }
inline void set_k_MaximumDetailsPerRes_8(int32_t value)
{
___k_MaximumDetailsPerRes_8 = value;
}
inline static int32_t get_offset_of_k_MinimumAlphamapResolution_9() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MinimumAlphamapResolution_9)); }
inline int32_t get_k_MinimumAlphamapResolution_9() const { return ___k_MinimumAlphamapResolution_9; }
inline int32_t* get_address_of_k_MinimumAlphamapResolution_9() { return &___k_MinimumAlphamapResolution_9; }
inline void set_k_MinimumAlphamapResolution_9(int32_t value)
{
___k_MinimumAlphamapResolution_9 = value;
}
inline static int32_t get_offset_of_k_MaximumAlphamapResolution_10() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumAlphamapResolution_10)); }
inline int32_t get_k_MaximumAlphamapResolution_10() const { return ___k_MaximumAlphamapResolution_10; }
inline int32_t* get_address_of_k_MaximumAlphamapResolution_10() { return &___k_MaximumAlphamapResolution_10; }
inline void set_k_MaximumAlphamapResolution_10(int32_t value)
{
___k_MaximumAlphamapResolution_10 = value;
}
inline static int32_t get_offset_of_k_MinimumBaseMapResolution_11() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MinimumBaseMapResolution_11)); }
inline int32_t get_k_MinimumBaseMapResolution_11() const { return ___k_MinimumBaseMapResolution_11; }
inline int32_t* get_address_of_k_MinimumBaseMapResolution_11() { return &___k_MinimumBaseMapResolution_11; }
inline void set_k_MinimumBaseMapResolution_11(int32_t value)
{
___k_MinimumBaseMapResolution_11 = value;
}
inline static int32_t get_offset_of_k_MaximumBaseMapResolution_12() { return static_cast<int32_t>(offsetof(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields, ___k_MaximumBaseMapResolution_12)); }
inline int32_t get_k_MaximumBaseMapResolution_12() const { return ___k_MaximumBaseMapResolution_12; }
inline int32_t* get_address_of_k_MaximumBaseMapResolution_12() { return &___k_MaximumBaseMapResolution_12; }
inline void set_k_MaximumBaseMapResolution_12(int32_t value)
{
___k_MaximumBaseMapResolution_12 = value;
}
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap
struct TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 : public RuntimeObject
{
public:
// UnityEngine.Vector3 UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::m_patchSize
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___m_patchSize_0;
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/ErrorCode UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::m_errorCode
int32_t ___m_errorCode_1;
// System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain> UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::m_terrainTiles
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * ___m_terrainTiles_2;
public:
inline static int32_t get_offset_of_m_patchSize_0() { return static_cast<int32_t>(offsetof(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453, ___m_patchSize_0)); }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_m_patchSize_0() const { return ___m_patchSize_0; }
inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_m_patchSize_0() { return &___m_patchSize_0; }
inline void set_m_patchSize_0(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value)
{
___m_patchSize_0 = value;
}
inline static int32_t get_offset_of_m_errorCode_1() { return static_cast<int32_t>(offsetof(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453, ___m_errorCode_1)); }
inline int32_t get_m_errorCode_1() const { return ___m_errorCode_1; }
inline int32_t* get_address_of_m_errorCode_1() { return &___m_errorCode_1; }
inline void set_m_errorCode_1(int32_t value)
{
___m_errorCode_1 = value;
}
inline static int32_t get_offset_of_m_terrainTiles_2() { return static_cast<int32_t>(offsetof(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453, ___m_terrainTiles_2)); }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * get_m_terrainTiles_2() const { return ___m_terrainTiles_2; }
inline Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C ** get_address_of_m_terrainTiles_2() { return &___m_terrainTiles_2; }
inline void set_m_terrainTiles_2(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * value)
{
___m_terrainTiles_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_terrainTiles_2), (void*)value);
}
};
// System.AsyncCallback
struct AsyncCallback_tA7921BEF974919C46FF8F9D9867C567B200BB0EA : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Behaviour
struct Behaviour_t1A3DDDCF73B4627928FBFE02ED52B7251777DBD9 : public Component_t62FBC8D2420DA4BE9037AFE430740F6B3EECA684
{
public:
public:
};
// UnityEngine.Transform
struct Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 : public Component_t62FBC8D2420DA4BE9037AFE430740F6B3EECA684
{
public:
public:
};
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback
struct HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback
struct TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter
struct TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 : public MulticastDelegate_t
{
public:
public:
};
// UnityEngine.Terrain
struct Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 : public Behaviour_t1A3DDDCF73B4627928FBFE02ED52B7251777DBD9
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// UnityEngine.Terrain[]
struct TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * m_Items[1];
public:
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 ** 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, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
};
// System.Delegate[]
struct DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8 : 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);
}
};
// System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::ContainsKey(!0)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Dictionary_2_ContainsKey_mE6DB9458466D0F98B67E2C6CAEFABBF9576AC4D7_gshared (Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * __this, int32_t ___key0, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::Add(!0,!1)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Dictionary_2_Add_m39BC00F21EE9459BB8DEF5479F95F79C5C740682_gshared (Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * __this, int32_t ___key0, RuntimeObject * ___value1, const RuntimeMethod* method);
// System.Int32 System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::get_Count()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Dictionary_2_get_Count_m12374F2F6F3D2DE9CBF98D3BD63CBB0DA19C69C5_gshared (Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * __this, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::GetEnumerator()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C Dictionary_2_GetEnumerator_m17437D82A5AF502166F10DD12B5C5830DDB95444_gshared (Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * __this, const RuntimeMethod* method);
// System.Collections.Generic.KeyValuePair`2<!0,!1> System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::get_Current()
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 Enumerator_get_Current_mE5033FC555E7BC63DDC919B903A8A305C3AADBEB_gshared_inline (Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C * __this, const RuntimeMethod* method);
// !1 System.Collections.Generic.KeyValuePair`2<System.Int32,System.Object>::get_Value()
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR RuntimeObject * KeyValuePair_2_get_Value_mC1E2EFCF98529D0550A547CF87C6EAB6821741BF_gshared_inline (KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 * __this, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::GetEnumerator()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6 Dictionary_2_GetEnumerator_m42E0EB162F4066A0FB7F3A2A02C8CC0318A39399_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, const RuntimeMethod* method);
// System.Collections.Generic.KeyValuePair`2<!0,!1> System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::get_Current()
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 Enumerator_get_Current_m23B8CC855231000EC661C87C6F73B91516A0DC30_gshared_inline (Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6 * __this, const RuntimeMethod* method);
// !0 System.Collections.Generic.KeyValuePair`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::get_Key()
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 KeyValuePair_2_get_Key_m212B0FE7898E52C6B11FD6DD2C01E618B497E2AD_gshared_inline (KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 * __this, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::MoveNext()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Enumerator_MoveNext_m0715DCFF0F848F5E633EB00D96EFD56764336D83_gshared (Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6 * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::Dispose()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Enumerator_Dispose_mD481D9AD8B5BA10E0F7D4C5FE195450387A2D77F_gshared (Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6 * __this, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::MoveNext()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Enumerator_MoveNext_mEEAA9A380252BB2F9B2403853F4C00F2F643ADC4_gshared (Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,System.Object>::Dispose()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Enumerator_Dispose_m7567E65C01E35A09AD2AD4814D708A8E76469D31_gshared (Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<System.Int32,System.Object>::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Dictionary_2__ctor_mE7F9D51201F5A72BF4995CA0F3F0E866DB21E638_gshared (Dictionary_2_tE1E5B6327FFA2C7AE34A69E0011815C914771C2F * __this, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::TryGetValue(!0,!1&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Dictionary_2_TryGetValue_mCCC44A3A72C551AAFFAC85CBF1112F4AECA55E1C_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key0, RuntimeObject ** ___value1, const RuntimeMethod* method);
// System.Int32 System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::get_Count()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Dictionary_2_get_Count_mAD01C6490D7FB912583AA3512A48322E17DE103A_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Dictionary_2__ctor_mAA4C8F456AA58EC1FB154441680BCFAA27AD6183_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::Add(!0,!1)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Dictionary_2_Add_mF229F30CFDA8329990CF5541CC1C2D4E1E6E32DC_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key0, RuntimeObject * ___value1, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/KeyCollection<!0,!1> System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::get_Keys()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR KeyCollection_t7A3E9764F18C1DE44C90DF9D411158787E20A943 * Dictionary_2_get_Keys_mC4EA837159240291D78B6A50F7FFB1079128A54A_gshared (Dictionary_2_tBF9E2338C61ABCF5ED32053F509AFB44385F774C * __this, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2/KeyCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::GetEnumerator()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9 KeyCollection_GetEnumerator_m86D73466A076A57AF442E78EA6DA84CA56459CE1_gshared (KeyCollection_t7A3E9764F18C1DE44C90DF9D411158787E20A943 * __this, const RuntimeMethod* method);
// !0 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::get_Current()
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 Enumerator_get_Current_m3B16C98F89532B1B1779AEA703E89F4C00B89023_gshared_inline (Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9 * __this, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::MoveNext()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Enumerator_MoveNext_mE8A672309D0D29E63163309C18A5DAA83FC9DB33_gshared (Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9 * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,System.Object>::Dispose()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Enumerator_Dispose_m7DA7AE89AA8C789574C279CA9A741A2D41D5B3D1_gshared (Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Behaviour::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Behaviour__ctor_mCACD3614226521EA607B0F3640C0FAC7EACCBCE0 (Behaviour_t1A3DDDCF73B4627928FBFE02ED52B7251777DBD9 * __this, const RuntimeMethod* method);
// UnityEngine.Terrain[] UnityEngine.TerrainData::get_users()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback::Invoke(UnityEngine.Terrain,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HeightmapChangedCallback_Invoke_m24BDB8F85D5AC1B4B183E8C698905E3281CB4489 (HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___heightRegion1, bool ___synched2, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback::Invoke(UnityEngine.Terrain,System.String,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextureChangedCallback_Invoke_mC92D41CF0240EA1783C1A1816696EA19895F5569 (TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, String_t* ___textureName1, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___texelRegion2, bool ___synched3, const RuntimeMethod* method);
// System.Void UnityEngine.Object::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m4DCF5CDB32C2C69290894101A81F473865169279 (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * __this, const RuntimeMethod* method);
// System.Void UnityEngine.TerrainData::Internal_Create(UnityEngine.TerrainData)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * ___terrainData0, const RuntimeMethod* method);
// System.Void UnityEngine.TerrainData::get_size_Injected(UnityEngine.Vector3&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * ___ret0, const RuntimeMethod* method);
// System.Int32 UnityEngine.TerrainData::GetBoundaryValue(UnityEngine.TerrainData/BoundaryValueType)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C (int32_t ___type0, const RuntimeMethod* method);
// UnityEngine.Terrain[] UnityEngine.Terrain::get_activeTerrains()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9 (const RuntimeMethod* method);
// System.Void UnityEngine.Terrain::SetNeighbors(UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___left0, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___top1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___right2, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___bottom3, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_0__ctor_m857F329AF653D7F052DCF0BE6511BFE40CD13653 (U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility::HasValidTerrains()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainUtility_HasValidTerrains_mA6E2D0BE718C6B58CD4C1400C910CBF73AF3172D (const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainGroups::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainGroups__ctor_mA9F11D4BE52D80563D0D31788BA80C8F5381FFB1 (TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_1__ctor_m2B5F521527B39BE091B856058F67DC7E3DE4B345 (U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Terrain::get_allowAutoConnect()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method);
// System.Int32 UnityEngine.Terrain::get_groupingID()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::ContainsKey(!0)
inline bool Dictionary_2_ContainsKey_mAB645E14BEA5777BD44ADAE7A50A6F0A8093BC9C (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * __this, int32_t ___key0, const RuntimeMethod* method)
{
return (( bool (*) (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 *, int32_t, const RuntimeMethod*))Dictionary_2_ContainsKey_mE6DB9458466D0F98B67E2C6CAEFABBF9576AC4D7_gshared)(__this, ___key0, method);
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainFilter__ctor_m6A1F2AE7CF7A3B502AFBCB351B615EBBE942B838 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method);
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::CreateFromPlacement(UnityEngine.Terrain,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * TerrainMap_CreateFromPlacement_mBF5B980BA13C9390739DFEA1644596CA54D44337 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___originTerrain0, TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * ___filter1, bool ___fullValidation2, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::Add(!0,!1)
inline void Dictionary_2_Add_m267342D40CFF0F8B5BAD87A5CE00E3909531BD96 (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * __this, int32_t ___key0, TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * ___value1, const RuntimeMethod* method)
{
(( void (*) (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 *, int32_t, TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *, const RuntimeMethod*))Dictionary_2_Add_m39BC00F21EE9459BB8DEF5479F95F79C5C740682_gshared)(__this, ___key0, ___value1, method);
}
// System.Int32 System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::get_Count()
inline int32_t Dictionary_2_get_Count_mFA499FD6C7C49BC3D70E56F18B385FC96BB1122D (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * __this, const RuntimeMethod* method)
{
return (( int32_t (*) (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 *, const RuntimeMethod*))Dictionary_2_get_Count_m12374F2F6F3D2DE9CBF98D3BD63CBB0DA19C69C5_gshared)(__this, method);
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility::ClearConnectivity()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainUtility_ClearConnectivity_mC50EAA8DA06ED94944F6168505271B127389EC5A (const RuntimeMethod* method);
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainGroups UnityEngine.Experimental.TerrainAPI.TerrainUtility::CollectTerrains(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * TerrainUtility_CollectTerrains_m4630246A7274A15FB2AE8C13E653E8B73C129F9B (bool ___onlyAutoConnectedTerrains0, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::GetEnumerator()
inline Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C Dictionary_2_GetEnumerator_m2FABB49D216C87FA099BA346CB5CD03DCD24C952 (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * __this, const RuntimeMethod* method)
{
return (( Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C (*) (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 *, const RuntimeMethod*))Dictionary_2_GetEnumerator_m17437D82A5AF502166F10DD12B5C5830DDB95444_gshared)(__this, method);
}
// System.Collections.Generic.KeyValuePair`2<!0,!1> System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::get_Current()
inline KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 Enumerator_get_Current_mF013CBBAC5FC4D1B2E4A4DF551C8FE254F675FC3_inline (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C * __this, const RuntimeMethod* method)
{
return (( KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 (*) (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *, const RuntimeMethod*))Enumerator_get_Current_mE5033FC555E7BC63DDC919B903A8A305C3AADBEB_gshared_inline)(__this, method);
}
// !1 System.Collections.Generic.KeyValuePair`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::get_Value()
inline TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * KeyValuePair_2_get_Value_m011C84EFA22A68B46C33DD7DF651E3B2A65D0A8E_inline (KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 * __this, const RuntimeMethod* method)
{
return (( TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * (*) (KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 *, const RuntimeMethod*))KeyValuePair_2_get_Value_mC1E2EFCF98529D0550A547CF87C6EAB6821741BF_gshared_inline)(__this, method);
}
// System.Collections.Generic.Dictionary`2/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::GetEnumerator()
inline Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 Dictionary_2_GetEnumerator_m147C3BB4ED736CEA41232F46C074D6B974011AA4 (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, const RuntimeMethod* method)
{
return (( Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, const RuntimeMethod*))Dictionary_2_GetEnumerator_m42E0EB162F4066A0FB7F3A2A02C8CC0318A39399_gshared)(__this, method);
}
// System.Collections.Generic.KeyValuePair`2<!0,!1> System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::get_Current()
inline KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD Enumerator_get_Current_mB812E91C3669D0EE3EACF5F58E0A9BBD03D43711_inline (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 * __this, const RuntimeMethod* method)
{
return (( KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD (*) (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *, const RuntimeMethod*))Enumerator_get_Current_m23B8CC855231000EC661C87C6F73B91516A0DC30_gshared_inline)(__this, method);
}
// !0 System.Collections.Generic.KeyValuePair`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::get_Key()
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 KeyValuePair_2_get_Key_mE6C14010B6C03B4E060CEF852A6F22FDC4713D0E_inline (KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD * __this, const RuntimeMethod* method)
{
return (( TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 (*) (KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD *, const RuntimeMethod*))KeyValuePair_2_get_Key_m212B0FE7898E52C6B11FD6DD2C01E618B497E2AD_gshared_inline)(__this, method);
}
// UnityEngine.Terrain UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::GetTerrain(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::MoveNext()
inline bool Enumerator_MoveNext_m0CCC05F07B62FCEE6591F765FC15D804D05BAD28 (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 * __this, const RuntimeMethod* method)
{
return (( bool (*) (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *, const RuntimeMethod*))Enumerator_MoveNext_m0715DCFF0F848F5E633EB00D96EFD56764336D83_gshared)(__this, method);
}
// System.Void System.Collections.Generic.Dictionary`2/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::Dispose()
inline void Enumerator_Dispose_m07DC0EE5F0A8163D940559D768B774000D6D38AB (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 * __this, const RuntimeMethod* method)
{
(( void (*) (Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *, const RuntimeMethod*))Enumerator_Dispose_mD481D9AD8B5BA10E0F7D4C5FE195450387A2D77F_gshared)(__this, method);
}
// System.Boolean System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::MoveNext()
inline bool Enumerator_MoveNext_m5380371A16E1990E23859EED5F3C2F1843B39B38 (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C * __this, const RuntimeMethod* method)
{
return (( bool (*) (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *, const RuntimeMethod*))Enumerator_MoveNext_mEEAA9A380252BB2F9B2403853F4C00F2F643ADC4_gshared)(__this, method);
}
// System.Void System.Collections.Generic.Dictionary`2/Enumerator<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::Dispose()
inline void Enumerator_Dispose_m1F1794448E1C1BD96E362C46BA0DB16B018D57E4 (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C * __this, const RuntimeMethod* method)
{
(( void (*) (Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *, const RuntimeMethod*))Enumerator_Dispose_m7567E65C01E35A09AD2AD4814D708A8E76469D31_gshared)(__this, method);
}
// System.Void System.Object::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405 (RuntimeObject * __this, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<System.Int32,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap>::.ctor()
inline void Dictionary_2__ctor_mE808665E6AFDBF2A2BA8A0F50089B72EE98DBBA1 (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 * __this, const RuntimeMethod* method)
{
(( void (*) (Dictionary_2_t8BE99204247C1C97B2675C8E9AB2B482BADCD725 *, const RuntimeMethod*))Dictionary_2__ctor_mE7F9D51201F5A72BF4995CA0F3F0E866DB21E638_gshared)(__this, method);
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord::.ctor(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155 (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::TryGetValue(!0,!1&)
inline bool Dictionary_2_TryGetValue_m98F72F5729EC6BC5A95E45EE02F330D48C274FE8 (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key0, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 ** ___value1, const RuntimeMethod* method)
{
return (( bool (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 , Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 **, const RuntimeMethod*))Dictionary_2_TryGetValue_mCCC44A3A72C551AAFFAC85CBF1112F4AECA55E1C_gshared)(__this, ___key0, ___value1, method);
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_0__ctor_mF6CE52C3D202B71510907E3EDCA198C369468888 (U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Equality_mEE9EC7EB5C7DC3E95B94AB904E1986FC4D566D54 (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___x0, Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___y1, const RuntimeMethod* method);
// UnityEngine.TerrainData UnityEngine.Terrain::get_terrainData()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method);
// UnityEngine.Transform UnityEngine.Component::get_transform()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F (Component_t62FBC8D2420DA4BE9037AFE430740F6B3EECA684 * __this, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Transform::get_position()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341 (Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * __this, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.TerrainData::get_size()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Vector2::.ctor(System.Single,System.Single)
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Vector2__ctor_m9F1F2D5EB5D1FF7091BB527AC8A72CBB309D115E_inline (Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * __this, float ___x0, float ___y1, const RuntimeMethod* method);
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::CreateFromPlacement(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * TerrainMap_CreateFromPlacement_m8BCE09C1C736432F61D78CED8868DC43F9CCD25D (Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___gridOrigin0, Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___gridSize1, TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * ___filter2, bool ___fullValidation3, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap__ctor_m0A16A2E6ED5C4EFB2F87D72A5665EF7C4E62F761 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::Invoke(UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainFilter_Invoke_m48E69E662BC21917E57559702D1F9D94E4F762F7 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, const RuntimeMethod* method);
// System.Int32 UnityEngine.Mathf::RoundToInt(System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Mathf_RoundToInt_m56850BDF60FF9E3441CE57E5EFEFEF36EDCDE6DD (float ___f0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::TryToAddTerrain(System.Int32,System.Int32,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainMap_TryToAddTerrain_m49A7085766F102EADE7E4A29259232F399735C61 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain2, const RuntimeMethod* method);
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/ErrorCode UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::Validate()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TerrainMap_Validate_m9CD6FAF70E4F90C896BF25F083BC0A7F21C8FA56 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, const RuntimeMethod* method);
// System.Int32 System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::get_Count()
inline int32_t Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27 (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, const RuntimeMethod* method)
{
return (( int32_t (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, const RuntimeMethod*))Dictionary_2_get_Count_mAD01C6490D7FB912583AA3512A48322E17DE103A_gshared)(__this, method);
}
// System.Void System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::.ctor()
inline void Dictionary_2__ctor_mCCBF2E85C3037B87300EF879DD1791B4EB6DD230 (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, const RuntimeMethod* method)
{
(( void (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, const RuntimeMethod*))Dictionary_2__ctor_mAA4C8F456AA58EC1FB154441680BCFAA27AD6183_gshared)(__this, method);
}
// System.Boolean UnityEngine.Vector3::op_Inequality(UnityEngine.Vector3,UnityEngine.Vector3)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Vector3_op_Inequality_m15190A795B416EB699E69E6190DE6F1C1F208710 (Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___lhs0, Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___rhs1, const RuntimeMethod* method);
// System.Void System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::Add(!0,!1)
inline void Dictionary_2_Add_mE1C4F9D19A66168F6DAD8690E89CDB2A36353F0D (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 ___key0, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___value1, const RuntimeMethod* method)
{
(( void (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 , Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*))Dictionary_2_Add_mF229F30CFDA8329990CF5541CC1C2D4E1E6E32DC_gshared)(__this, ___key0, ___value1, method);
}
// System.Boolean UnityEngine.Object::op_Inequality(UnityEngine.Object,UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Inequality_mE1F187520BD83FB7D86A6D850710C4D42B864E90 (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___x0, Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___y1, const RuntimeMethod* method);
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::AddTerrainInternal(System.Int32,System.Int32,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap_AddTerrainInternal_m82F62E3018D1D2A6E48FB7361DB6531F0E9BEB79 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___x0, int32_t ___z1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain2, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Implicit(UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Implicit_mC8214E4F028CC2F036CC82BDB81D102A02893499 (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A * ___exists0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Mathf::Approximately(System.Single,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55 (float ___a0, float ___b1, const RuntimeMethod* method);
// System.Collections.Generic.Dictionary`2/KeyCollection<!0,!1> System.Collections.Generic.Dictionary`2<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::get_Keys()
inline KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * Dictionary_2_get_Keys_mAE2D87453C7973972A5637C6F4EAD27613692826 (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * __this, const RuntimeMethod* method)
{
return (( KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * (*) (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *, const RuntimeMethod*))Dictionary_2_get_Keys_mC4EA837159240291D78B6A50F7FFB1079128A54A_gshared)(__this, method);
}
// System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<!0,!1> System.Collections.Generic.Dictionary`2/KeyCollection<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::GetEnumerator()
inline Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E KeyCollection_GetEnumerator_m6405FB5505A9993F393EA3F5C33A46514043AA2A (KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * __this, const RuntimeMethod* method)
{
return (( Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E (*) (KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC *, const RuntimeMethod*))KeyCollection_GetEnumerator_m86D73466A076A57AF442E78EA6DA84CA56459CE1_gshared)(__this, method);
}
// !0 System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::get_Current()
inline TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 Enumerator_get_Current_m13B3FF8E2918832E70E30374C13E9939E9AA3894_inline (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E * __this, const RuntimeMethod* method)
{
return (( TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 (*) (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *, const RuntimeMethod*))Enumerator_get_Current_m3B16C98F89532B1B1779AEA703E89F4C00B89023_gshared_inline)(__this, method);
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::ValidateTerrain(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap_ValidateTerrain_mFE264FDE78C3D68285943250BC9FABAC89D85764 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method);
// System.Boolean System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::MoveNext()
inline bool Enumerator_MoveNext_m821A025A3826D2405C49130607D842500F1ECEF4 (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E * __this, const RuntimeMethod* method)
{
return (( bool (*) (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *, const RuntimeMethod*))Enumerator_MoveNext_mE8A672309D0D29E63163309C18A5DAA83FC9DB33_gshared)(__this, method);
}
// System.Void System.Collections.Generic.Dictionary`2/KeyCollection/Enumerator<UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TileCoord,UnityEngine.Terrain>::Dispose()
inline void Enumerator_Dispose_mAC047D3AE663114F2D8DFDA994E2C9D78A3E9EB0 (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E * __this, const RuntimeMethod* method)
{
(( void (*) (Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *, const RuntimeMethod*))Enumerator_Dispose_m7DA7AE89AA8C789574C279CA9A741A2D41D5B3D1_gshared)(__this, 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.TerrainData UnityEngine.Terrain::get_terrainData()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method)
{
typedef TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * (*Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41_ftn) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *);
static Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Terrain::get_terrainData()");
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * icallRetVal = _il2cpp_icall_func(__this);
return icallRetVal;
}
// System.Boolean UnityEngine.Terrain::get_allowAutoConnect()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method)
{
typedef bool (*Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67_ftn) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *);
static Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Terrain::get_allowAutoConnect()");
bool icallRetVal = _il2cpp_icall_func(__this);
return icallRetVal;
}
// System.Int32 UnityEngine.Terrain::get_groupingID()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method)
{
typedef int32_t (*Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9_ftn) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *);
static Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Terrain::get_groupingID()");
int32_t icallRetVal = _il2cpp_icall_func(__this);
return icallRetVal;
}
// System.Void UnityEngine.Terrain::SetNeighbors(UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___left0, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___top1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___right2, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___bottom3, const RuntimeMethod* method)
{
typedef void (*Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F_ftn) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *);
static Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Terrain::SetNeighbors(UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain,UnityEngine.Terrain)");
_il2cpp_icall_func(__this, ___left0, ___top1, ___right2, ___bottom3);
}
// UnityEngine.Terrain[] UnityEngine.Terrain::get_activeTerrains()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9 (const RuntimeMethod* method)
{
typedef TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* (*Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9_ftn) ();
static Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Terrain::get_activeTerrains()");
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* icallRetVal = _il2cpp_icall_func();
return icallRetVal;
}
// System.Void UnityEngine.Terrain::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Terrain__ctor_m3E411CBA0F2F20E56475F1755B7AEDF0C9F57464 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * __this, const RuntimeMethod* method)
{
{
Behaviour__ctor_mCACD3614226521EA607B0F3640C0FAC7EACCBCE0(__this, /*hidden argument*/NULL);
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
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks::InvokeHeightmapChangedCallback(UnityEngine.TerrainData,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainCallbacks_InvokeHeightmapChangedCallback_m394735D1416B00373916335213992D011D5FDA86 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * ___terrainData0, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___heightRegion1, bool ___synched2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* V_1 = NULL;
int32_t V_2 = 0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_3 = NULL;
{
HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * L_0 = ((TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields*)il2cpp_codegen_static_fields_for(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var))->get_heightmapChanged_0();
V_0 = (bool)((!(((RuntimeObject*)(HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 *)L_0) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0);
bool L_1 = V_0;
if (!L_1)
{
goto IL_0037;
}
}
{
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_2 = ___terrainData0;
NullCheck(L_2);
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_3;
L_3 = TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F(L_2, /*hidden argument*/NULL);
V_1 = L_3;
V_2 = 0;
goto IL_0030;
}
IL_001a:
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_4 = V_1;
int32_t L_5 = V_2;
NullCheck(L_4);
int32_t L_6 = L_5;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_7 = (L_4)->GetAt(static_cast<il2cpp_array_size_t>(L_6));
V_3 = L_7;
HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * L_8 = ((TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields*)il2cpp_codegen_static_fields_for(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var))->get_heightmapChanged_0();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_9 = V_3;
RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 L_10 = ___heightRegion1;
bool L_11 = ___synched2;
NullCheck(L_8);
HeightmapChangedCallback_Invoke_m24BDB8F85D5AC1B4B183E8C698905E3281CB4489(L_8, L_9, L_10, L_11, /*hidden argument*/NULL);
int32_t L_12 = V_2;
V_2 = ((int32_t)il2cpp_codegen_add((int32_t)L_12, (int32_t)1));
}
IL_0030:
{
int32_t L_13 = V_2;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_14 = V_1;
NullCheck(L_14);
if ((((int32_t)L_13) < ((int32_t)((int32_t)((int32_t)(((RuntimeArray*)L_14)->max_length))))))
{
goto IL_001a;
}
}
{
}
IL_0037:
{
return;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks::InvokeTextureChangedCallback(UnityEngine.TerrainData,System.String,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainCallbacks_InvokeTextureChangedCallback_m10A2EFE8E490EC932777717717CC61709FCA3307 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * ___terrainData0, String_t* ___textureName1, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___texelRegion2, bool ___synched3, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* V_1 = NULL;
int32_t V_2 = 0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_3 = NULL;
{
TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * L_0 = ((TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields*)il2cpp_codegen_static_fields_for(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var))->get_textureChanged_1();
V_0 = (bool)((!(((RuntimeObject*)(TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F *)L_0) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0);
bool L_1 = V_0;
if (!L_1)
{
goto IL_0038;
}
}
{
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_2 = ___terrainData0;
NullCheck(L_2);
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_3;
L_3 = TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F(L_2, /*hidden argument*/NULL);
V_1 = L_3;
V_2 = 0;
goto IL_0031;
}
IL_001a:
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_4 = V_1;
int32_t L_5 = V_2;
NullCheck(L_4);
int32_t L_6 = L_5;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_7 = (L_4)->GetAt(static_cast<il2cpp_array_size_t>(L_6));
V_3 = L_7;
TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * L_8 = ((TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_StaticFields*)il2cpp_codegen_static_fields_for(TerrainCallbacks_tF292CB70850DEF93A2AFD0005B4FF75C7FC8ECD0_il2cpp_TypeInfo_var))->get_textureChanged_1();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_9 = V_3;
String_t* L_10 = ___textureName1;
RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 L_11 = ___texelRegion2;
bool L_12 = ___synched3;
NullCheck(L_8);
TextureChangedCallback_Invoke_mC92D41CF0240EA1783C1A1816696EA19895F5569(L_8, L_9, L_10, L_11, L_12, /*hidden argument*/NULL);
int32_t L_13 = V_2;
V_2 = ((int32_t)il2cpp_codegen_add((int32_t)L_13, (int32_t)1));
}
IL_0031:
{
int32_t L_14 = V_2;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_15 = V_1;
NullCheck(L_15);
if ((((int32_t)L_14) < ((int32_t)((int32_t)((int32_t)(((RuntimeArray*)L_15)->max_length))))))
{
goto IL_001a;
}
}
{
}
IL_0038:
{
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
// System.Int32 UnityEngine.TerrainData::GetBoundaryValue(UnityEngine.TerrainData/BoundaryValueType)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C (int32_t ___type0, const RuntimeMethod* method)
{
typedef int32_t (*TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C_ftn) (int32_t);
static TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TerrainData::GetBoundaryValue(UnityEngine.TerrainData/BoundaryValueType)");
int32_t icallRetVal = _il2cpp_icall_func(___type0);
return icallRetVal;
}
// System.Void UnityEngine.TerrainData::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData__ctor_m09DE788EE93388ACD3E80CB586FC2ED551B66ED7 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
Object__ctor_m4DCF5CDB32C2C69290894101A81F473865169279(__this, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var);
TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424(__this, /*hidden argument*/NULL);
return;
}
}
// System.Void UnityEngine.TerrainData::Internal_Create(UnityEngine.TerrainData)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * ___terrainData0, const RuntimeMethod* method)
{
typedef void (*TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424_ftn) (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 *);
static TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TerrainData_Internal_Create_mA483D4EF29C637A9855A8825AB257DC97374A424_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TerrainData::Internal_Create(UnityEngine.TerrainData)");
_il2cpp_icall_func(___terrainData0);
}
// UnityEngine.Vector3 UnityEngine.TerrainData::get_size()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method)
{
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E V_0;
memset((&V_0), 0, sizeof(V_0));
{
TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64(__this, (Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E *)(&V_0), /*hidden argument*/NULL);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_0 = V_0;
return L_0;
}
}
// System.Single UnityEngine.TerrainData::GetAlphamapResolutionInternal()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float TerrainData_GetAlphamapResolutionInternal_mB3D8631E512C887B38CE96496428B803C3837CCB (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method)
{
typedef float (*TerrainData_GetAlphamapResolutionInternal_mB3D8631E512C887B38CE96496428B803C3837CCB_ftn) (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 *);
static TerrainData_GetAlphamapResolutionInternal_mB3D8631E512C887B38CE96496428B803C3837CCB_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TerrainData_GetAlphamapResolutionInternal_mB3D8631E512C887B38CE96496428B803C3837CCB_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TerrainData::GetAlphamapResolutionInternal()");
float icallRetVal = _il2cpp_icall_func(__this);
return icallRetVal;
}
// UnityEngine.Terrain[] UnityEngine.TerrainData::get_users()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, const RuntimeMethod* method)
{
typedef TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* (*TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F_ftn) (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 *);
static TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TerrainData_get_users_m4BBC80BD0296525664EB84FE7DD6F1ABAE1CAF0F_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TerrainData::get_users()");
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* icallRetVal = _il2cpp_icall_func(__this);
return icallRetVal;
}
// System.Void UnityEngine.TerrainData::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData__cctor_m64E6CF88BD21FC182D29D169EBCA04D965C46517 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
{
int32_t L_0;
L_0 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(0, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumResolution_4(L_0);
int32_t L_1;
L_1 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(1, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MinimumDetailResolutionPerPatch_5(L_1);
int32_t L_2;
L_2 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(2, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumDetailResolutionPerPatch_6(L_2);
int32_t L_3;
L_3 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(3, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumDetailPatchCount_7(L_3);
int32_t L_4;
L_4 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(4, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumDetailsPerRes_8(L_4);
int32_t L_5;
L_5 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(5, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MinimumAlphamapResolution_9(L_5);
int32_t L_6;
L_6 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(6, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumAlphamapResolution_10(L_6);
int32_t L_7;
L_7 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(7, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MinimumBaseMapResolution_11(L_7);
int32_t L_8;
L_8 = TerrainData_GetBoundaryValue_mDDB33647E2918B15F5499701A647695B8EF9763C(8, /*hidden argument*/NULL);
((TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_StaticFields*)il2cpp_codegen_static_fields_for(TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4_il2cpp_TypeInfo_var))->set_k_MaximumBaseMapResolution_12(L_8);
return;
}
}
// System.Void UnityEngine.TerrainData::get_size_Injected(UnityEngine.Vector3&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64 (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * __this, Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * ___ret0, const RuntimeMethod* method)
{
typedef void (*TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64_ftn) (TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 *, Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E *);
static TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (TerrainData_get_size_Injected_m181495692C7B755ACD1D7F7F115A2CE8DC6A9E64_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.TerrainData::get_size_Injected(UnityEngine.Vector3&)");
_il2cpp_icall_func(__this, ___ret0);
}
#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.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility::HasValidTerrains()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainUtility_HasValidTerrains_mA6E2D0BE718C6B58CD4C1400C910CBF73AF3172D (const RuntimeMethod* method)
{
bool V_0 = false;
int32_t G_B3_0 = 0;
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_0;
L_0 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
if (!L_0)
{
goto IL_0013;
}
}
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_1;
L_1 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
NullCheck(L_1);
G_B3_0 = ((!(((uint32_t)(((RuntimeArray*)L_1)->max_length)) <= ((uint32_t)0)))? 1 : 0);
goto IL_0014;
}
IL_0013:
{
G_B3_0 = 0;
}
IL_0014:
{
V_0 = (bool)G_B3_0;
goto IL_0017;
}
IL_0017:
{
bool L_2 = V_0;
return L_2;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility::ClearConnectivity()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainUtility_ClearConnectivity_mC50EAA8DA06ED94944F6168505271B127389EC5A (const RuntimeMethod* method)
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* V_0 = NULL;
int32_t V_1 = 0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_2 = NULL;
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_0;
L_0 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
V_0 = L_0;
V_1 = 0;
goto IL_001f;
}
IL_000c:
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_1 = V_0;
int32_t L_2 = V_1;
NullCheck(L_1);
int32_t L_3 = L_2;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_4 = (L_1)->GetAt(static_cast<il2cpp_array_size_t>(L_3));
V_2 = L_4;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_5 = V_2;
NullCheck(L_5);
Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F(L_5, (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *)NULL, (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *)NULL, (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *)NULL, (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *)NULL, /*hidden argument*/NULL);
int32_t L_6 = V_1;
V_1 = ((int32_t)il2cpp_codegen_add((int32_t)L_6, (int32_t)1));
}
IL_001f:
{
int32_t L_7 = V_1;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_8 = V_0;
NullCheck(L_8);
if ((((int32_t)L_7) < ((int32_t)((int32_t)((int32_t)(((RuntimeArray*)L_8)->max_length))))))
{
goto IL_000c;
}
}
{
return;
}
}
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainGroups UnityEngine.Experimental.TerrainAPI.TerrainUtility::CollectTerrains(System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * TerrainUtility_CollectTerrains_m4630246A7274A15FB2AE8C13E653E8B73C129F9B (bool ___onlyAutoConnectedTerrains0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_Add_m267342D40CFF0F8B5BAD87A5CE00E3909531BD96_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_ContainsKey_mAB645E14BEA5777BD44ADAE7A50A6F0A8093BC9C_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_get_Count_mFA499FD6C7C49BC3D70E56F18B385FC96BB1122D_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&U3CU3Ec__DisplayClass4_1_U3CCollectTerrainsU3Eb__0_m539C07F9B8F371A9E9C09A8AFD003DD4163C7810_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * V_0 = NULL;
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * V_1 = NULL;
bool V_2 = false;
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * V_3 = NULL;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* V_4 = NULL;
int32_t V_5 = 0;
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * V_6 = NULL;
bool V_7 = false;
bool V_8 = false;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * V_9 = NULL;
bool V_10 = false;
int32_t G_B6_0 = 0;
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * G_B18_0 = NULL;
{
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * L_0 = (U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 *)il2cpp_codegen_object_new(U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8_il2cpp_TypeInfo_var);
U3CU3Ec__DisplayClass4_0__ctor_m857F329AF653D7F052DCF0BE6511BFE40CD13653(L_0, /*hidden argument*/NULL);
V_0 = L_0;
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * L_1 = V_0;
bool L_2 = ___onlyAutoConnectedTerrains0;
NullCheck(L_1);
L_1->set_onlyAutoConnectedTerrains_0(L_2);
bool L_3;
L_3 = TerrainUtility_HasValidTerrains_mA6E2D0BE718C6B58CD4C1400C910CBF73AF3172D(/*hidden argument*/NULL);
V_2 = (bool)((((int32_t)L_3) == ((int32_t)0))? 1 : 0);
bool L_4 = V_2;
if (!L_4)
{
goto IL_0021;
}
}
{
V_3 = (TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 *)NULL;
goto IL_00f5;
}
IL_0021:
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_5 = (TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 *)il2cpp_codegen_object_new(TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288_il2cpp_TypeInfo_var);
TerrainGroups__ctor_mA9F11D4BE52D80563D0D31788BA80C8F5381FFB1(L_5, /*hidden argument*/NULL);
V_1 = L_5;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_6;
L_6 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
V_4 = L_6;
V_5 = 0;
goto IL_00db;
}
IL_0037:
{
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_7 = (U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 *)il2cpp_codegen_object_new(U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696_il2cpp_TypeInfo_var);
U3CU3Ec__DisplayClass4_1__ctor_m2B5F521527B39BE091B856058F67DC7E3DE4B345(L_7, /*hidden argument*/NULL);
V_6 = L_7;
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_8 = V_6;
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * L_9 = V_0;
NullCheck(L_8);
L_8->set_CSU24U3CU3E8__locals1_1(L_9);
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_10 = V_6;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_11 = V_4;
int32_t L_12 = V_5;
NullCheck(L_11);
int32_t L_13 = L_12;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_14 = (L_11)->GetAt(static_cast<il2cpp_array_size_t>(L_13));
NullCheck(L_10);
L_10->set_t_0(L_14);
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_15 = V_6;
NullCheck(L_15);
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * L_16 = L_15->get_CSU24U3CU3E8__locals1_1();
NullCheck(L_16);
bool L_17 = L_16->get_onlyAutoConnectedTerrains_0();
if (!L_17)
{
goto IL_0072;
}
}
{
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_18 = V_6;
NullCheck(L_18);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_19 = L_18->get_t_0();
NullCheck(L_19);
bool L_20;
L_20 = Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67(L_19, /*hidden argument*/NULL);
G_B6_0 = ((((int32_t)L_20) == ((int32_t)0))? 1 : 0);
goto IL_0073;
}
IL_0072:
{
G_B6_0 = 0;
}
IL_0073:
{
V_7 = (bool)G_B6_0;
bool L_21 = V_7;
if (!L_21)
{
goto IL_007b;
}
}
{
goto IL_00d5;
}
IL_007b:
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_22 = V_1;
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_23 = V_6;
NullCheck(L_23);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_24 = L_23->get_t_0();
NullCheck(L_24);
int32_t L_25;
L_25 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_24, /*hidden argument*/NULL);
NullCheck(L_22);
bool L_26;
L_26 = Dictionary_2_ContainsKey_mAB645E14BEA5777BD44ADAE7A50A6F0A8093BC9C(L_22, L_25, /*hidden argument*/Dictionary_2_ContainsKey_mAB645E14BEA5777BD44ADAE7A50A6F0A8093BC9C_RuntimeMethod_var);
V_8 = (bool)((((int32_t)L_26) == ((int32_t)0))? 1 : 0);
bool L_27 = V_8;
if (!L_27)
{
goto IL_00d4;
}
}
{
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_28 = V_6;
NullCheck(L_28);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_29 = L_28->get_t_0();
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_30 = V_6;
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_31 = (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 *)il2cpp_codegen_object_new(TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7_il2cpp_TypeInfo_var);
TerrainFilter__ctor_m6A1F2AE7CF7A3B502AFBCB351B615EBBE942B838(L_31, L_30, (intptr_t)((intptr_t)U3CU3Ec__DisplayClass4_1_U3CCollectTerrainsU3Eb__0_m539C07F9B8F371A9E9C09A8AFD003DD4163C7810_RuntimeMethod_var), /*hidden argument*/NULL);
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_32;
L_32 = TerrainMap_CreateFromPlacement_mBF5B980BA13C9390739DFEA1644596CA54D44337(L_29, L_31, (bool)1, /*hidden argument*/NULL);
V_9 = L_32;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_33 = V_9;
V_10 = (bool)((!(((RuntimeObject*)(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)L_33) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0);
bool L_34 = V_10;
if (!L_34)
{
goto IL_00d3;
}
}
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_35 = V_1;
U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * L_36 = V_6;
NullCheck(L_36);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_37 = L_36->get_t_0();
NullCheck(L_37);
int32_t L_38;
L_38 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_37, /*hidden argument*/NULL);
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_39 = V_9;
NullCheck(L_35);
Dictionary_2_Add_m267342D40CFF0F8B5BAD87A5CE00E3909531BD96(L_35, L_38, L_39, /*hidden argument*/Dictionary_2_Add_m267342D40CFF0F8B5BAD87A5CE00E3909531BD96_RuntimeMethod_var);
}
IL_00d3:
{
}
IL_00d4:
{
}
IL_00d5:
{
int32_t L_40 = V_5;
V_5 = ((int32_t)il2cpp_codegen_add((int32_t)L_40, (int32_t)1));
}
IL_00db:
{
int32_t L_41 = V_5;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_42 = V_4;
NullCheck(L_42);
if ((((int32_t)L_41) < ((int32_t)((int32_t)((int32_t)(((RuntimeArray*)L_42)->max_length))))))
{
goto IL_0037;
}
}
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_43 = V_1;
NullCheck(L_43);
int32_t L_44;
L_44 = Dictionary_2_get_Count_mFA499FD6C7C49BC3D70E56F18B385FC96BB1122D(L_43, /*hidden argument*/Dictionary_2_get_Count_mFA499FD6C7C49BC3D70E56F18B385FC96BB1122D_RuntimeMethod_var);
if (L_44)
{
goto IL_00f1;
}
}
{
G_B18_0 = ((TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 *)(NULL));
goto IL_00f2;
}
IL_00f1:
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_45 = V_1;
G_B18_0 = L_45;
}
IL_00f2:
{
V_3 = G_B18_0;
goto IL_00f5;
}
IL_00f5:
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_46 = V_3;
return L_46;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility::AutoConnect()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainUtility_AutoConnect_m8526A29E63B328915E516505E3195637A1F100EF (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_GetEnumerator_m147C3BB4ED736CEA41232F46C074D6B974011AA4_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_GetEnumerator_m2FABB49D216C87FA099BA346CB5CD03DCD24C952_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_Dispose_m07DC0EE5F0A8163D940559D768B774000D6D38AB_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_Dispose_m1F1794448E1C1BD96E362C46BA0DB16B018D57E4_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_MoveNext_m0CCC05F07B62FCEE6591F765FC15D804D05BAD28_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_MoveNext_m5380371A16E1990E23859EED5F3C2F1843B39B38_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_get_Current_mB812E91C3669D0EE3EACF5F58E0A9BBD03D43711_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_get_Current_mF013CBBAC5FC4D1B2E4A4DF551C8FE254F675FC3_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&KeyValuePair_2_get_Key_mE6C14010B6C03B4E060CEF852A6F22FDC4713D0E_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&KeyValuePair_2_get_Value_m011C84EFA22A68B46C33DD7DF651E3B2A65D0A8E_RuntimeMethod_var);
s_Il2CppMethodInitialized = true;
}
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * V_0 = NULL;
bool V_1 = false;
bool V_2 = false;
Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C V_3;
memset((&V_3), 0, sizeof(V_3));
KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 V_4;
memset((&V_4), 0, sizeof(V_4));
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * V_5 = NULL;
Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 V_6;
memset((&V_6), 0, sizeof(V_6));
KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD V_7;
memset((&V_7), 0, sizeof(V_7));
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 V_8;
memset((&V_8), 0, sizeof(V_8));
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_9 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_10 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_11 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_12 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_13 = NULL;
Exception_t * __last_unhandled_exception = 0;
il2cpp::utils::ExceptionSupportStack<int32_t, 2> __leave_targets;
{
bool L_0;
L_0 = TerrainUtility_HasValidTerrains_mA6E2D0BE718C6B58CD4C1400C910CBF73AF3172D(/*hidden argument*/NULL);
V_1 = (bool)((((int32_t)L_0) == ((int32_t)0))? 1 : 0);
bool L_1 = V_1;
if (!L_1)
{
goto IL_0012;
}
}
{
goto IL_013a;
}
IL_0012:
{
TerrainUtility_ClearConnectivity_mC50EAA8DA06ED94944F6168505271B127389EC5A(/*hidden argument*/NULL);
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_2;
L_2 = TerrainUtility_CollectTerrains_m4630246A7274A15FB2AE8C13E653E8B73C129F9B((bool)1, /*hidden argument*/NULL);
V_0 = L_2;
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_3 = V_0;
V_2 = (bool)((((RuntimeObject*)(TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 *)L_3) == ((RuntimeObject*)(RuntimeObject *)NULL))? 1 : 0);
bool L_4 = V_2;
if (!L_4)
{
goto IL_002c;
}
}
{
goto IL_013a;
}
IL_002c:
{
TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * L_5 = V_0;
NullCheck(L_5);
Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C L_6;
L_6 = Dictionary_2_GetEnumerator_m2FABB49D216C87FA099BA346CB5CD03DCD24C952(L_5, /*hidden argument*/Dictionary_2_GetEnumerator_m2FABB49D216C87FA099BA346CB5CD03DCD24C952_RuntimeMethod_var);
V_3 = L_6;
}
IL_0034:
try
{ // begin try (depth: 1)
{
goto IL_011d;
}
IL_0039:
{
KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 L_7;
L_7 = Enumerator_get_Current_mF013CBBAC5FC4D1B2E4A4DF551C8FE254F675FC3_inline((Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *)(&V_3), /*hidden argument*/Enumerator_get_Current_mF013CBBAC5FC4D1B2E4A4DF551C8FE254F675FC3_RuntimeMethod_var);
V_4 = L_7;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_8;
L_8 = KeyValuePair_2_get_Value_m011C84EFA22A68B46C33DD7DF651E3B2A65D0A8E_inline((KeyValuePair_2_t4D2678F5DF760772ED05557D6F41001894311AD9 *)(&V_4), /*hidden argument*/KeyValuePair_2_get_Value_m011C84EFA22A68B46C33DD7DF651E3B2A65D0A8E_RuntimeMethod_var);
V_5 = L_8;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_9 = V_5;
NullCheck(L_9);
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_10 = L_9->get_m_terrainTiles_2();
NullCheck(L_10);
Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 L_11;
L_11 = Dictionary_2_GetEnumerator_m147C3BB4ED736CEA41232F46C074D6B974011AA4(L_10, /*hidden argument*/Dictionary_2_GetEnumerator_m147C3BB4ED736CEA41232F46C074D6B974011AA4_RuntimeMethod_var);
V_6 = L_11;
}
IL_005b:
try
{ // begin try (depth: 2)
{
goto IL_00ff;
}
IL_0060:
{
KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD L_12;
L_12 = Enumerator_get_Current_mB812E91C3669D0EE3EACF5F58E0A9BBD03D43711_inline((Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *)(&V_6), /*hidden argument*/Enumerator_get_Current_mB812E91C3669D0EE3EACF5F58E0A9BBD03D43711_RuntimeMethod_var);
V_7 = L_12;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_13;
L_13 = KeyValuePair_2_get_Key_mE6C14010B6C03B4E060CEF852A6F22FDC4713D0E_inline((KeyValuePair_2_t41025882EB77BC66901763733CF9F6733F84B2CD *)(&V_7), /*hidden argument*/KeyValuePair_2_get_Key_mE6C14010B6C03B4E060CEF852A6F22FDC4713D0E_RuntimeMethod_var);
V_8 = L_13;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_14 = V_5;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_15 = V_8;
int32_t L_16 = L_15.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_17 = V_8;
int32_t L_18 = L_17.get_tileZ_1();
NullCheck(L_14);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_19;
L_19 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(L_14, L_16, L_18, /*hidden argument*/NULL);
V_9 = L_19;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_20 = V_5;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_21 = V_8;
int32_t L_22 = L_21.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_23 = V_8;
int32_t L_24 = L_23.get_tileZ_1();
NullCheck(L_20);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_25;
L_25 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(L_20, ((int32_t)il2cpp_codegen_subtract((int32_t)L_22, (int32_t)1)), L_24, /*hidden argument*/NULL);
V_10 = L_25;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_26 = V_5;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_27 = V_8;
int32_t L_28 = L_27.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_29 = V_8;
int32_t L_30 = L_29.get_tileZ_1();
NullCheck(L_26);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_31;
L_31 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(L_26, ((int32_t)il2cpp_codegen_add((int32_t)L_28, (int32_t)1)), L_30, /*hidden argument*/NULL);
V_11 = L_31;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_32 = V_5;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_33 = V_8;
int32_t L_34 = L_33.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_35 = V_8;
int32_t L_36 = L_35.get_tileZ_1();
NullCheck(L_32);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_37;
L_37 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(L_32, L_34, ((int32_t)il2cpp_codegen_add((int32_t)L_36, (int32_t)1)), /*hidden argument*/NULL);
V_12 = L_37;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_38 = V_5;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_39 = V_8;
int32_t L_40 = L_39.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_41 = V_8;
int32_t L_42 = L_41.get_tileZ_1();
NullCheck(L_38);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_43;
L_43 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(L_38, L_40, ((int32_t)il2cpp_codegen_subtract((int32_t)L_42, (int32_t)1)), /*hidden argument*/NULL);
V_13 = L_43;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_44 = V_9;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_45 = V_10;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_46 = V_12;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_47 = V_11;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_48 = V_13;
NullCheck(L_44);
Terrain_SetNeighbors_m8D84FD4852DE0F39C99BF04E6D4363C1869BF59F(L_44, L_45, L_46, L_47, L_48, /*hidden argument*/NULL);
}
IL_00ff:
{
bool L_49;
L_49 = Enumerator_MoveNext_m0CCC05F07B62FCEE6591F765FC15D804D05BAD28((Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *)(&V_6), /*hidden argument*/Enumerator_MoveNext_m0CCC05F07B62FCEE6591F765FC15D804D05BAD28_RuntimeMethod_var);
if (L_49)
{
goto IL_0060;
}
}
IL_010b:
{
IL2CPP_LEAVE(0x11C, FINALLY_010d);
}
} // end try (depth: 2)
catch(Il2CppExceptionWrapper& e)
{
__last_unhandled_exception = (Exception_t *)e.ex;
goto FINALLY_010d;
}
FINALLY_010d:
{ // begin finally (depth: 2)
Enumerator_Dispose_m07DC0EE5F0A8163D940559D768B774000D6D38AB((Enumerator_t602CC79896470B03AE89FC5C57383F716CFEFB99 *)(&V_6), /*hidden argument*/Enumerator_Dispose_m07DC0EE5F0A8163D940559D768B774000D6D38AB_RuntimeMethod_var);
IL2CPP_END_FINALLY(269)
} // end finally (depth: 2)
IL2CPP_CLEANUP(269)
{
IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *)
IL2CPP_JUMP_TBL(0x11C, IL_011c)
}
IL_011c:
{
}
IL_011d:
{
bool L_50;
L_50 = Enumerator_MoveNext_m5380371A16E1990E23859EED5F3C2F1843B39B38((Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *)(&V_3), /*hidden argument*/Enumerator_MoveNext_m5380371A16E1990E23859EED5F3C2F1843B39B38_RuntimeMethod_var);
if (L_50)
{
goto IL_0039;
}
}
IL_0129:
{
IL2CPP_LEAVE(0x13A, FINALLY_012b);
}
} // end try (depth: 1)
catch(Il2CppExceptionWrapper& e)
{
__last_unhandled_exception = (Exception_t *)e.ex;
goto FINALLY_012b;
}
FINALLY_012b:
{ // begin finally (depth: 1)
Enumerator_Dispose_m1F1794448E1C1BD96E362C46BA0DB16B018D57E4((Enumerator_t97F91102C6E0DCF3B950AF7DDC5CA42AAB7C429C *)(&V_3), /*hidden argument*/Enumerator_Dispose_m1F1794448E1C1BD96E362C46BA0DB16B018D57E4_RuntimeMethod_var);
IL2CPP_END_FINALLY(299)
} // end finally (depth: 1)
IL2CPP_CLEANUP(299)
{
IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *)
IL2CPP_JUMP_TBL(0x13A, IL_013a)
}
IL_013a:
{
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
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HeightmapChangedCallback__ctor_mB63473491843FCAFE4EC51977A276DF20F11B1D0 (HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * __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.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback::Invoke(UnityEngine.Terrain,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HeightmapChangedCallback_Invoke_m24BDB8F85D5AC1B4B183E8C698905E3281CB4489 (HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___heightRegion1, bool ___synched2, const RuntimeMethod* method)
{
DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* 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 void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___heightRegion1, ___synched2, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, ___heightRegion1, ___synched2, targetMethod);
}
}
else if (___parameterCount != 3)
{
// open
if (il2cpp_codegen_method_is_virtual(targetMethod) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker2< RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, ___terrain0, ___heightRegion1, ___synched2);
else
GenericVirtActionInvoker2< RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, ___terrain0, ___heightRegion1, ___synched2);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker2< RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___terrain0, ___heightRegion1, ___synched2);
else
VirtActionInvoker2< RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___terrain0, ___heightRegion1, ___synched2);
}
}
else
{
typedef void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___heightRegion1, ___synched2, targetMethod);
}
}
else
{
// closed
if (targetThis != NULL && 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))
GenericInterfaceActionInvoker3< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, targetThis, ___terrain0, ___heightRegion1, ___synched2);
else
GenericVirtActionInvoker3< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, targetThis, ___terrain0, ___heightRegion1, ___synched2);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker3< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___terrain0, ___heightRegion1, ___synched2);
else
VirtActionInvoker3< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___terrain0, ___heightRegion1, ___synched2);
}
}
else
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___heightRegion1, ___synched2, targetMethod);
}
else
{
typedef void (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, ___heightRegion1, ___synched2, targetMethod);
}
}
}
}
}
// System.IAsyncResult UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback::BeginInvoke(UnityEngine.Terrain,UnityEngine.RectInt,System.Boolean,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* HeightmapChangedCallback_BeginInvoke_m590DAC8F14CB6AC982D6FE89C27ACF10CFA17E05 (HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___heightRegion1, bool ___synched2, AsyncCallback_tA7921BEF974919C46FF8F9D9867C567B200BB0EA * ___callback3, RuntimeObject * ___object4, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
void *__d_args[4] = {0};
__d_args[0] = ___terrain0;
__d_args[1] = Box(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49_il2cpp_TypeInfo_var, &___heightRegion1);
__d_args[2] = Box(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_il2cpp_TypeInfo_var, &___synched2);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback3, (RuntimeObject*)___object4);;
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/HeightmapChangedCallback::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HeightmapChangedCallback_EndInvoke_m015EB6B241A8FC17A0870FC57A1048520DCEB1E0 (HeightmapChangedCallback_tB00DA531F9C32468E88700A5C2D55E05189E0FA0 * __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.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextureChangedCallback__ctor_m7086172D805BDFEFEF9901EAC1C78904DBB63D29 (TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * __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.TerrainAPI.TerrainCallbacks/TextureChangedCallback::Invoke(UnityEngine.Terrain,System.String,UnityEngine.RectInt,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextureChangedCallback_Invoke_mC92D41CF0240EA1783C1A1816696EA19895F5569 (TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, String_t* ___textureName1, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___texelRegion2, bool ___synched3, const RuntimeMethod* method)
{
DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* 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 == 4)
{
// open
typedef void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___textureName1, ___texelRegion2, ___synched3, targetMethod);
}
else
{
// closed
typedef void (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3, targetMethod);
}
}
else if (___parameterCount != 4)
{
// open
if (il2cpp_codegen_method_is_virtual(targetMethod) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
GenericInterfaceActionInvoker3< String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
else
GenericVirtActionInvoker3< String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker3< String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
else
VirtActionInvoker3< String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
}
}
else
{
typedef void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___textureName1, ___texelRegion2, ___synched3, targetMethod);
}
}
else
{
// closed
if (targetThis != NULL && 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))
GenericInterfaceActionInvoker4< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
else
GenericVirtActionInvoker4< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(targetMethod, targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
InterfaceActionInvoker4< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
else
VirtActionInvoker4< Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3);
}
}
else
{
if (targetThis == NULL)
{
typedef void (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(___terrain0, ___textureName1, ___texelRegion2, ___synched3, targetMethod);
}
else
{
typedef void (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, String_t*, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 , bool, const RuntimeMethod*);
((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, ___textureName1, ___texelRegion2, ___synched3, targetMethod);
}
}
}
}
}
// System.IAsyncResult UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback::BeginInvoke(UnityEngine.Terrain,System.String,UnityEngine.RectInt,System.Boolean,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* TextureChangedCallback_BeginInvoke_mE19FD540CF24CED1C990B54DE4A84A270C5BA37C (TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, String_t* ___textureName1, RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49 ___texelRegion2, bool ___synched3, AsyncCallback_tA7921BEF974919C46FF8F9D9867C567B200BB0EA * ___callback4, RuntimeObject * ___object5, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
void *__d_args[5] = {0};
__d_args[0] = ___terrain0;
__d_args[1] = ___textureName1;
__d_args[2] = Box(RectInt_tE7B8105A280C1AC73A4157ED41F9B86C9BD91E49_il2cpp_TypeInfo_var, &___texelRegion2);
__d_args[3] = Box(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_il2cpp_TypeInfo_var, &___synched3);
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback4, (RuntimeObject*)___object5);;
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainCallbacks/TextureChangedCallback::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TextureChangedCallback_EndInvoke_mE86E8C09F0F8EB087F90979A86270204AB551B84 (TextureChangedCallback_tD8BA8EA99CC9FA597E4AA143944720822EFB7D9F * __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.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_0::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_0__ctor_m857F329AF653D7F052DCF0BE6511BFE40CD13653 (U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * __this, const RuntimeMethod* method)
{
{
Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405(__this, /*hidden argument*/NULL);
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
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_1__ctor_m2B5F521527B39BE091B856058F67DC7E3DE4B345 (U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * __this, const RuntimeMethod* method)
{
{
Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405(__this, /*hidden argument*/NULL);
return;
}
}
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/<>c__DisplayClass4_1::<CollectTerrains>b__0(UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool U3CU3Ec__DisplayClass4_1_U3CCollectTerrainsU3Eb__0_m539C07F9B8F371A9E9C09A8AFD003DD4163C7810 (U3CU3Ec__DisplayClass4_1_t4628C2311DC3CEECE17200D3AD3113D667B36696 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___x0, const RuntimeMethod* method)
{
int32_t G_B4_0 = 0;
int32_t G_B6_0 = 0;
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_0 = ___x0;
NullCheck(L_0);
int32_t L_1;
L_1 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_0, /*hidden argument*/NULL);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_2 = __this->get_t_0();
NullCheck(L_2);
int32_t L_3;
L_3 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_2, /*hidden argument*/NULL);
if ((!(((uint32_t)L_1) == ((uint32_t)L_3))))
{
goto IL_002b;
}
}
{
U3CU3Ec__DisplayClass4_0_t3074FF30377E883DD9C65B310F07325DB61E1EA8 * L_4 = __this->get_CSU24U3CU3E8__locals1_1();
NullCheck(L_4);
bool L_5 = L_4->get_onlyAutoConnectedTerrains_0();
if (!L_5)
{
goto IL_0028;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_6 = ___x0;
NullCheck(L_6);
bool L_7;
L_7 = Terrain_get_allowAutoConnect_mC1B0AC480E9AA5E33EDF412E8F9AA3EB4832BA67(L_6, /*hidden argument*/NULL);
G_B4_0 = ((int32_t)(L_7));
goto IL_0029;
}
IL_0028:
{
G_B4_0 = 1;
}
IL_0029:
{
G_B6_0 = G_B4_0;
goto IL_002c;
}
IL_002b:
{
G_B6_0 = 0;
}
IL_002c:
{
return (bool)G_B6_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.Experimental.TerrainAPI.TerrainUtility/TerrainGroups::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainGroups__ctor_mA9F11D4BE52D80563D0D31788BA80C8F5381FFB1 (TerrainGroups_t7252F67656E98D75852FF5CE365E82AB2ADB9288 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2__ctor_mE808665E6AFDBF2A2BA8A0F50089B72EE98DBBA1_RuntimeMethod_var);
s_Il2CppMethodInitialized = true;
}
{
Dictionary_2__ctor_mE808665E6AFDBF2A2BA8A0F50089B72EE98DBBA1(__this, /*hidden argument*/Dictionary_2__ctor_mE808665E6AFDBF2A2BA8A0F50089B72EE98DBBA1_RuntimeMethod_var);
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
// UnityEngine.Terrain UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::GetTerrain(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_TryGetValue_m98F72F5729EC6BC5A95E45EE02F330D48C274FE8_RuntimeMethod_var);
s_Il2CppMethodInitialized = true;
}
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_0 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_1 = NULL;
{
V_0 = (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *)NULL;
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_0 = __this->get_m_terrainTiles_2();
int32_t L_1 = ___tileX0;
int32_t L_2 = ___tileZ1;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_3;
memset((&L_3), 0, sizeof(L_3));
TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155((&L_3), L_1, L_2, /*hidden argument*/NULL);
NullCheck(L_0);
bool L_4;
L_4 = Dictionary_2_TryGetValue_m98F72F5729EC6BC5A95E45EE02F330D48C274FE8(L_0, L_3, (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 **)(&V_0), /*hidden argument*/Dictionary_2_TryGetValue_m98F72F5729EC6BC5A95E45EE02F330D48C274FE8_RuntimeMethod_var);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_5 = V_0;
V_1 = L_5;
goto IL_001c;
}
IL_001c:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_6 = V_1;
return L_6;
}
}
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::CreateFromPlacement(UnityEngine.Terrain,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * TerrainMap_CreateFromPlacement_mBF5B980BA13C9390739DFEA1644596CA54D44337 (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___originTerrain0, TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * ___filter1, bool ___fullValidation2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&U3CU3Ec__DisplayClass4_0_U3CCreateFromPlacementU3Eb__0_mA0E2295171D220FA7ABA12660D2CB357BC721653_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * V_0 = NULL;
float V_1 = 0.0f;
float V_2 = 0.0f;
float V_3 = 0.0f;
float V_4 = 0.0f;
bool V_5 = false;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * V_6 = NULL;
bool V_7 = false;
bool V_8 = false;
int32_t G_B4_0 = 0;
{
U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * L_0 = (U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F *)il2cpp_codegen_object_new(U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F_il2cpp_TypeInfo_var);
U3CU3Ec__DisplayClass4_0__ctor_mF6CE52C3D202B71510907E3EDCA198C369468888(L_0, /*hidden argument*/NULL);
V_0 = L_0;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_1;
L_1 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
if (!L_1)
{
goto IL_001f;
}
}
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_2;
L_2 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
NullCheck(L_2);
if (!(((RuntimeArray*)L_2)->max_length))
{
goto IL_001f;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_3 = ___originTerrain0;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_4;
L_4 = Object_op_Equality_mEE9EC7EB5C7DC3E95B94AB904E1986FC4D566D54(L_3, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
G_B4_0 = ((int32_t)(L_4));
goto IL_0020;
}
IL_001f:
{
G_B4_0 = 1;
}
IL_0020:
{
V_5 = (bool)G_B4_0;
bool L_5 = V_5;
if (!L_5)
{
goto IL_002e;
}
}
{
V_6 = (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)NULL;
goto IL_00cb;
}
IL_002e:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_6 = ___originTerrain0;
NullCheck(L_6);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_7;
L_7 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_6, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_8;
L_8 = Object_op_Equality_mEE9EC7EB5C7DC3E95B94AB904E1986FC4D566D54(L_7, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
V_7 = L_8;
bool L_9 = V_7;
if (!L_9)
{
goto IL_0048;
}
}
{
V_6 = (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)NULL;
goto IL_00cb;
}
IL_0048:
{
U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * L_10 = V_0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_11 = ___originTerrain0;
NullCheck(L_11);
int32_t L_12;
L_12 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_11, /*hidden argument*/NULL);
NullCheck(L_10);
L_10->set_groupID_0(L_12);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_13 = ___originTerrain0;
NullCheck(L_13);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_14;
L_14 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_13, /*hidden argument*/NULL);
NullCheck(L_14);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_15;
L_15 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_14, /*hidden argument*/NULL);
float L_16 = L_15.get_x_2();
V_1 = L_16;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_17 = ___originTerrain0;
NullCheck(L_17);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_18;
L_18 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_17, /*hidden argument*/NULL);
NullCheck(L_18);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_19;
L_19 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_18, /*hidden argument*/NULL);
float L_20 = L_19.get_z_4();
V_2 = L_20;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_21 = ___originTerrain0;
NullCheck(L_21);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_22;
L_22 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_21, /*hidden argument*/NULL);
NullCheck(L_22);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_23;
L_23 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_22, /*hidden argument*/NULL);
float L_24 = L_23.get_x_2();
V_3 = L_24;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_25 = ___originTerrain0;
NullCheck(L_25);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_26;
L_26 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_25, /*hidden argument*/NULL);
NullCheck(L_26);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_27;
L_27 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_26, /*hidden argument*/NULL);
float L_28 = L_27.get_z_4();
V_4 = L_28;
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_29 = ___filter1;
V_8 = (bool)((((RuntimeObject*)(TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 *)L_29) == ((RuntimeObject*)(RuntimeObject *)NULL))? 1 : 0);
bool L_30 = V_8;
if (!L_30)
{
goto IL_00b1;
}
}
{
U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * L_31 = V_0;
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_32 = (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 *)il2cpp_codegen_object_new(TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7_il2cpp_TypeInfo_var);
TerrainFilter__ctor_m6A1F2AE7CF7A3B502AFBCB351B615EBBE942B838(L_32, L_31, (intptr_t)((intptr_t)U3CU3Ec__DisplayClass4_0_U3CCreateFromPlacementU3Eb__0_mA0E2295171D220FA7ABA12660D2CB357BC721653_RuntimeMethod_var), /*hidden argument*/NULL);
___filter1 = L_32;
}
IL_00b1:
{
float L_33 = V_1;
float L_34 = V_2;
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_35;
memset((&L_35), 0, sizeof(L_35));
Vector2__ctor_m9F1F2D5EB5D1FF7091BB527AC8A72CBB309D115E_inline((&L_35), L_33, L_34, /*hidden argument*/NULL);
float L_36 = V_3;
float L_37 = V_4;
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_38;
memset((&L_38), 0, sizeof(L_38));
Vector2__ctor_m9F1F2D5EB5D1FF7091BB527AC8A72CBB309D115E_inline((&L_38), L_36, L_37, /*hidden argument*/NULL);
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_39 = ___filter1;
bool L_40 = ___fullValidation2;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_41;
L_41 = TerrainMap_CreateFromPlacement_m8BCE09C1C736432F61D78CED8868DC43F9CCD25D(L_35, L_38, L_39, L_40, /*hidden argument*/NULL);
V_6 = L_41;
goto IL_00cb;
}
IL_00cb:
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_42 = V_6;
return L_42;
}
}
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::CreateFromPlacement(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter,System.Boolean)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * TerrainMap_CreateFromPlacement_m8BCE09C1C736432F61D78CED8868DC43F9CCD25D (Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___gridOrigin0, Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 ___gridSize1, TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * ___filter2, bool ___fullValidation3, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * V_0 = NULL;
float V_1 = 0.0f;
float V_2 = 0.0f;
bool V_3 = false;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * V_4 = NULL;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* V_5 = NULL;
int32_t V_6 = 0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_7 = NULL;
bool V_8 = false;
bool V_9 = false;
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E V_10;
memset((&V_10), 0, sizeof(V_10));
int32_t V_11 = 0;
int32_t V_12 = 0;
bool V_13 = false;
int32_t G_B3_0 = 0;
int32_t G_B11_0 = 0;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * G_B21_0 = NULL;
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_0;
L_0 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
if (!L_0)
{
goto IL_0013;
}
}
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_1;
L_1 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
NullCheck(L_1);
G_B3_0 = ((((int32_t)(((RuntimeArray*)L_1)->max_length)) == ((int32_t)0))? 1 : 0);
goto IL_0014;
}
IL_0013:
{
G_B3_0 = 1;
}
IL_0014:
{
V_3 = (bool)G_B3_0;
bool L_2 = V_3;
if (!L_2)
{
goto IL_0020;
}
}
{
V_4 = (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)NULL;
goto IL_0102;
}
IL_0020:
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_3 = (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)il2cpp_codegen_object_new(TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453_il2cpp_TypeInfo_var);
TerrainMap__ctor_m0A16A2E6ED5C4EFB2F87D72A5665EF7C4E62F761(L_3, /*hidden argument*/NULL);
V_0 = L_3;
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_4 = ___gridSize1;
float L_5 = L_4.get_x_0();
V_1 = ((float)((float)(1.0f)/(float)L_5));
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_6 = ___gridSize1;
float L_7 = L_6.get_y_1();
V_2 = ((float)((float)(1.0f)/(float)L_7));
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_8;
L_8 = Terrain_get_activeTerrains_m4F358455EB7630E59F2AB221B142A11B750D23F9(/*hidden argument*/NULL);
V_5 = L_8;
V_6 = 0;
goto IL_00d3;
}
IL_0050:
{
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_9 = V_5;
int32_t L_10 = V_6;
NullCheck(L_9);
int32_t L_11 = L_10;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_12 = (L_9)->GetAt(static_cast<il2cpp_array_size_t>(L_11));
V_7 = L_12;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_13 = V_7;
NullCheck(L_13);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_14;
L_14 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_13, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_15;
L_15 = Object_op_Equality_mEE9EC7EB5C7DC3E95B94AB904E1986FC4D566D54(L_14, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
V_8 = L_15;
bool L_16 = V_8;
if (!L_16)
{
goto IL_006d;
}
}
{
goto IL_00cd;
}
IL_006d:
{
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_17 = ___filter2;
if (!L_17)
{
goto IL_007a;
}
}
{
TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * L_18 = ___filter2;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_19 = V_7;
NullCheck(L_18);
bool L_20;
L_20 = TerrainFilter_Invoke_m48E69E662BC21917E57559702D1F9D94E4F762F7(L_18, L_19, /*hidden argument*/NULL);
G_B11_0 = ((int32_t)(L_20));
goto IL_007b;
}
IL_007a:
{
G_B11_0 = 1;
}
IL_007b:
{
V_9 = (bool)G_B11_0;
bool L_21 = V_9;
if (!L_21)
{
goto IL_00cc;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_22 = V_7;
NullCheck(L_22);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_23;
L_23 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_22, /*hidden argument*/NULL);
NullCheck(L_23);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_24;
L_24 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_23, /*hidden argument*/NULL);
V_10 = L_24;
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_25 = V_10;
float L_26 = L_25.get_x_2();
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_27 = ___gridOrigin0;
float L_28 = L_27.get_x_0();
float L_29 = V_1;
int32_t L_30;
L_30 = Mathf_RoundToInt_m56850BDF60FF9E3441CE57E5EFEFEF36EDCDE6DD(((float)il2cpp_codegen_multiply((float)((float)il2cpp_codegen_subtract((float)L_26, (float)L_28)), (float)L_29)), /*hidden argument*/NULL);
V_11 = L_30;
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_31 = V_10;
float L_32 = L_31.get_z_4();
Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 L_33 = ___gridOrigin0;
float L_34 = L_33.get_y_1();
float L_35 = V_2;
int32_t L_36;
L_36 = Mathf_RoundToInt_m56850BDF60FF9E3441CE57E5EFEFEF36EDCDE6DD(((float)il2cpp_codegen_multiply((float)((float)il2cpp_codegen_subtract((float)L_32, (float)L_34)), (float)L_35)), /*hidden argument*/NULL);
V_12 = L_36;
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_37 = V_0;
int32_t L_38 = V_11;
int32_t L_39 = V_12;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_40 = V_7;
NullCheck(L_37);
bool L_41;
L_41 = TerrainMap_TryToAddTerrain_m49A7085766F102EADE7E4A29259232F399735C61(L_37, L_38, L_39, L_40, /*hidden argument*/NULL);
}
IL_00cc:
{
}
IL_00cd:
{
int32_t L_42 = V_6;
V_6 = ((int32_t)il2cpp_codegen_add((int32_t)L_42, (int32_t)1));
}
IL_00d3:
{
int32_t L_43 = V_6;
TerrainU5BU5D_t3F6CC238FDF6EE231EDBF5ECD9C6CDE42F003C57* L_44 = V_5;
NullCheck(L_44);
if ((((int32_t)L_43) < ((int32_t)((int32_t)((int32_t)(((RuntimeArray*)L_44)->max_length))))))
{
goto IL_0050;
}
}
{
bool L_45 = ___fullValidation3;
V_13 = L_45;
bool L_46 = V_13;
if (!L_46)
{
goto IL_00ec;
}
}
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_47 = V_0;
NullCheck(L_47);
int32_t L_48;
L_48 = TerrainMap_Validate_m9CD6FAF70E4F90C896BF25F083BC0A7F21C8FA56(L_47, /*hidden argument*/NULL);
}
IL_00ec:
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_49 = V_0;
NullCheck(L_49);
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_50 = L_49->get_m_terrainTiles_2();
NullCheck(L_50);
int32_t L_51;
L_51 = Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27(L_50, /*hidden argument*/Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27_RuntimeMethod_var);
if ((((int32_t)L_51) > ((int32_t)0)))
{
goto IL_00fd;
}
}
{
G_B21_0 = ((TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 *)(NULL));
goto IL_00fe;
}
IL_00fd:
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_52 = V_0;
G_B21_0 = L_52;
}
IL_00fe:
{
V_4 = G_B21_0;
goto IL_0102;
}
IL_0102:
{
TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * L_53 = V_4;
return L_53;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap__ctor_m0A16A2E6ED5C4EFB2F87D72A5665EF7C4E62F761 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2__ctor_mCCBF2E85C3037B87300EF879DD1791B4EB6DD230_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
{
Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405(__this, /*hidden argument*/NULL);
__this->set_m_errorCode_1(0);
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_0 = (Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C *)il2cpp_codegen_object_new(Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C_il2cpp_TypeInfo_var);
Dictionary_2__ctor_mCCBF2E85C3037B87300EF879DD1791B4EB6DD230(L_0, /*hidden argument*/Dictionary_2__ctor_mCCBF2E85C3037B87300EF879DD1791B4EB6DD230_RuntimeMethod_var);
__this->set_m_terrainTiles_2(L_0);
return;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::AddTerrainInternal(System.Int32,System.Int32,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap_AddTerrainInternal_m82F62E3018D1D2A6E48FB7361DB6531F0E9BEB79 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___x0, int32_t ___z1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_Add_mE1C4F9D19A66168F6DAD8690E89CDB2A36353F0D_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27_RuntimeMethod_var);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
{
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_0 = __this->get_m_terrainTiles_2();
NullCheck(L_0);
int32_t L_1;
L_1 = Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27(L_0, /*hidden argument*/Dictionary_2_get_Count_m83CBEC6C5312F7F9158B9FDA00ACD5FDC0169F27_RuntimeMethod_var);
V_0 = (bool)((((int32_t)L_1) == ((int32_t)0))? 1 : 0);
bool L_2 = V_0;
if (!L_2)
{
goto IL_0026;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_3 = ___terrain2;
NullCheck(L_3);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_4;
L_4 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_3, /*hidden argument*/NULL);
NullCheck(L_4);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_5;
L_5 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_4, /*hidden argument*/NULL);
__this->set_m_patchSize_0(L_5);
goto IL_0052;
}
IL_0026:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_6 = ___terrain2;
NullCheck(L_6);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_7;
L_7 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_6, /*hidden argument*/NULL);
NullCheck(L_7);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_8;
L_8 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_7, /*hidden argument*/NULL);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_9 = __this->get_m_patchSize_0();
bool L_10;
L_10 = Vector3_op_Inequality_m15190A795B416EB699E69E6190DE6F1C1F208710(L_8, L_9, /*hidden argument*/NULL);
V_1 = L_10;
bool L_11 = V_1;
if (!L_11)
{
goto IL_0051;
}
}
{
int32_t L_12 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_12|(int32_t)4)));
}
IL_0051:
{
}
IL_0052:
{
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_13 = __this->get_m_terrainTiles_2();
int32_t L_14 = ___x0;
int32_t L_15 = ___z1;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_16;
memset((&L_16), 0, sizeof(L_16));
TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155((&L_16), L_14, L_15, /*hidden argument*/NULL);
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_17 = ___terrain2;
NullCheck(L_13);
Dictionary_2_Add_mE1C4F9D19A66168F6DAD8690E89CDB2A36353F0D(L_13, L_16, L_17, /*hidden argument*/Dictionary_2_Add_mE1C4F9D19A66168F6DAD8690E89CDB2A36353F0D_RuntimeMethod_var);
return;
}
}
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::TryToAddTerrain(System.Int32,System.Int32,UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainMap_TryToAddTerrain_m49A7085766F102EADE7E4A29259232F399735C61 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain2, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_2 = NULL;
bool V_3 = false;
bool V_4 = false;
bool V_5 = false;
{
V_0 = (bool)0;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_0 = ___terrain2;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_1;
L_1 = Object_op_Inequality_mE1F187520BD83FB7D86A6D850710C4D42B864E90(L_0, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
V_1 = L_1;
bool L_2 = V_1;
if (!L_2)
{
goto IL_0053;
}
}
{
int32_t L_3 = ___tileX0;
int32_t L_4 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_5;
L_5 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, L_3, L_4, /*hidden argument*/NULL);
V_2 = L_5;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_6 = V_2;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_7;
L_7 = Object_op_Inequality_mE1F187520BD83FB7D86A6D850710C4D42B864E90(L_6, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
V_3 = L_7;
bool L_8 = V_3;
if (!L_8)
{
goto IL_0044;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_9 = V_2;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_10 = ___terrain2;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_11;
L_11 = Object_op_Inequality_mE1F187520BD83FB7D86A6D850710C4D42B864E90(L_9, L_10, /*hidden argument*/NULL);
V_4 = L_11;
bool L_12 = V_4;
if (!L_12)
{
goto IL_0041;
}
}
{
int32_t L_13 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_13|(int32_t)1)));
}
IL_0041:
{
goto IL_0052;
}
IL_0044:
{
int32_t L_14 = ___tileX0;
int32_t L_15 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_16 = ___terrain2;
TerrainMap_AddTerrainInternal_m82F62E3018D1D2A6E48FB7361DB6531F0E9BEB79(__this, L_14, L_15, L_16, /*hidden argument*/NULL);
V_0 = (bool)1;
}
IL_0052:
{
}
IL_0053:
{
bool L_17 = V_0;
V_5 = L_17;
goto IL_0058;
}
IL_0058:
{
bool L_18 = V_5;
return L_18;
}
}
// System.Void UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::ValidateTerrain(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainMap_ValidateTerrain_mFE264FDE78C3D68285943250BC9FABAC89D85764 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
s_Il2CppMethodInitialized = true;
}
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_0 = NULL;
bool V_1 = false;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_2 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_3 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_4 = NULL;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * V_5 = NULL;
bool V_6 = false;
bool V_7 = false;
bool V_8 = false;
bool V_9 = false;
bool V_10 = false;
bool V_11 = false;
bool V_12 = false;
bool V_13 = false;
int32_t G_B5_0 = 0;
int32_t G_B12_0 = 0;
int32_t G_B19_0 = 0;
int32_t G_B26_0 = 0;
{
int32_t L_0 = ___tileX0;
int32_t L_1 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_2;
L_2 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, L_0, L_1, /*hidden argument*/NULL);
V_0 = L_2;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_3 = V_0;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_4;
L_4 = Object_op_Inequality_mE1F187520BD83FB7D86A6D850710C4D42B864E90(L_3, (Object_tF2F3778131EFF286AF62B7B013A170F95A91571A *)NULL, /*hidden argument*/NULL);
V_1 = L_4;
bool L_5 = V_1;
if (!L_5)
{
goto IL_026d;
}
}
{
int32_t L_6 = ___tileX0;
int32_t L_7 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_8;
L_8 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, ((int32_t)il2cpp_codegen_subtract((int32_t)L_6, (int32_t)1)), L_7, /*hidden argument*/NULL);
V_2 = L_8;
int32_t L_9 = ___tileX0;
int32_t L_10 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_11;
L_11 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, ((int32_t)il2cpp_codegen_add((int32_t)L_9, (int32_t)1)), L_10, /*hidden argument*/NULL);
V_3 = L_11;
int32_t L_12 = ___tileX0;
int32_t L_13 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_14;
L_14 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, L_12, ((int32_t)il2cpp_codegen_add((int32_t)L_13, (int32_t)1)), /*hidden argument*/NULL);
V_4 = L_14;
int32_t L_15 = ___tileX0;
int32_t L_16 = ___tileZ1;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_17;
L_17 = TerrainMap_GetTerrain_mF027E4E4677131A19CA44E9A22CCB89101145006(__this, L_15, ((int32_t)il2cpp_codegen_subtract((int32_t)L_16, (int32_t)1)), /*hidden argument*/NULL);
V_5 = L_17;
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_18 = V_2;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_19;
L_19 = Object_op_Implicit_mC8214E4F028CC2F036CC82BDB81D102A02893499(L_18, /*hidden argument*/NULL);
V_6 = L_19;
bool L_20 = V_6;
if (!L_20)
{
goto IL_00cf;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_21 = V_0;
NullCheck(L_21);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_22;
L_22 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_21, /*hidden argument*/NULL);
NullCheck(L_22);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_23;
L_23 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_22, /*hidden argument*/NULL);
float L_24 = L_23.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_25 = V_2;
NullCheck(L_25);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_26;
L_26 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_25, /*hidden argument*/NULL);
NullCheck(L_26);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_27;
L_27 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_26, /*hidden argument*/NULL);
float L_28 = L_27.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_29 = V_2;
NullCheck(L_29);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_30;
L_30 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_29, /*hidden argument*/NULL);
NullCheck(L_30);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_31;
L_31 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_30, /*hidden argument*/NULL);
float L_32 = L_31.get_x_2();
bool L_33;
L_33 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_24, ((float)il2cpp_codegen_add((float)L_28, (float)L_32)), /*hidden argument*/NULL);
if (!L_33)
{
goto IL_00b7;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_34 = V_0;
NullCheck(L_34);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_35;
L_35 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_34, /*hidden argument*/NULL);
NullCheck(L_35);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_36;
L_36 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_35, /*hidden argument*/NULL);
float L_37 = L_36.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_38 = V_2;
NullCheck(L_38);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_39;
L_39 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_38, /*hidden argument*/NULL);
NullCheck(L_39);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_40;
L_40 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_39, /*hidden argument*/NULL);
float L_41 = L_40.get_z_4();
bool L_42;
L_42 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_37, L_41, /*hidden argument*/NULL);
G_B5_0 = ((((int32_t)L_42) == ((int32_t)0))? 1 : 0);
goto IL_00b8;
}
IL_00b7:
{
G_B5_0 = 1;
}
IL_00b8:
{
V_7 = (bool)G_B5_0;
bool L_43 = V_7;
if (!L_43)
{
goto IL_00ce;
}
}
{
int32_t L_44 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_44|(int32_t)8)));
}
IL_00ce:
{
}
IL_00cf:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_45 = V_3;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_46;
L_46 = Object_op_Implicit_mC8214E4F028CC2F036CC82BDB81D102A02893499(L_45, /*hidden argument*/NULL);
V_8 = L_46;
bool L_47 = V_8;
if (!L_47)
{
goto IL_0156;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_48 = V_0;
NullCheck(L_48);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_49;
L_49 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_48, /*hidden argument*/NULL);
NullCheck(L_49);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_50;
L_50 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_49, /*hidden argument*/NULL);
float L_51 = L_50.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_52 = V_0;
NullCheck(L_52);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_53;
L_53 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_52, /*hidden argument*/NULL);
NullCheck(L_53);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_54;
L_54 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_53, /*hidden argument*/NULL);
float L_55 = L_54.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_56 = V_3;
NullCheck(L_56);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_57;
L_57 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_56, /*hidden argument*/NULL);
NullCheck(L_57);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_58;
L_58 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_57, /*hidden argument*/NULL);
float L_59 = L_58.get_x_2();
bool L_60;
L_60 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(((float)il2cpp_codegen_add((float)L_51, (float)L_55)), L_59, /*hidden argument*/NULL);
if (!L_60)
{
goto IL_013e;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_61 = V_0;
NullCheck(L_61);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_62;
L_62 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_61, /*hidden argument*/NULL);
NullCheck(L_62);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_63;
L_63 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_62, /*hidden argument*/NULL);
float L_64 = L_63.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_65 = V_3;
NullCheck(L_65);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_66;
L_66 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_65, /*hidden argument*/NULL);
NullCheck(L_66);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_67;
L_67 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_66, /*hidden argument*/NULL);
float L_68 = L_67.get_z_4();
bool L_69;
L_69 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_64, L_68, /*hidden argument*/NULL);
G_B12_0 = ((((int32_t)L_69) == ((int32_t)0))? 1 : 0);
goto IL_013f;
}
IL_013e:
{
G_B12_0 = 1;
}
IL_013f:
{
V_9 = (bool)G_B12_0;
bool L_70 = V_9;
if (!L_70)
{
goto IL_0155;
}
}
{
int32_t L_71 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_71|(int32_t)8)));
}
IL_0155:
{
}
IL_0156:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_72 = V_4;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_73;
L_73 = Object_op_Implicit_mC8214E4F028CC2F036CC82BDB81D102A02893499(L_72, /*hidden argument*/NULL);
V_10 = L_73;
bool L_74 = V_10;
if (!L_74)
{
goto IL_01e0;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_75 = V_0;
NullCheck(L_75);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_76;
L_76 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_75, /*hidden argument*/NULL);
NullCheck(L_76);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_77;
L_77 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_76, /*hidden argument*/NULL);
float L_78 = L_77.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_79 = V_4;
NullCheck(L_79);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_80;
L_80 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_79, /*hidden argument*/NULL);
NullCheck(L_80);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_81;
L_81 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_80, /*hidden argument*/NULL);
float L_82 = L_81.get_x_2();
bool L_83;
L_83 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_78, L_82, /*hidden argument*/NULL);
if (!L_83)
{
goto IL_01c8;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_84 = V_0;
NullCheck(L_84);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_85;
L_85 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_84, /*hidden argument*/NULL);
NullCheck(L_85);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_86;
L_86 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_85, /*hidden argument*/NULL);
float L_87 = L_86.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_88 = V_0;
NullCheck(L_88);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_89;
L_89 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_88, /*hidden argument*/NULL);
NullCheck(L_89);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_90;
L_90 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_89, /*hidden argument*/NULL);
float L_91 = L_90.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_92 = V_4;
NullCheck(L_92);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_93;
L_93 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_92, /*hidden argument*/NULL);
NullCheck(L_93);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_94;
L_94 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_93, /*hidden argument*/NULL);
float L_95 = L_94.get_z_4();
bool L_96;
L_96 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(((float)il2cpp_codegen_add((float)L_87, (float)L_91)), L_95, /*hidden argument*/NULL);
G_B19_0 = ((((int32_t)L_96) == ((int32_t)0))? 1 : 0);
goto IL_01c9;
}
IL_01c8:
{
G_B19_0 = 1;
}
IL_01c9:
{
V_11 = (bool)G_B19_0;
bool L_97 = V_11;
if (!L_97)
{
goto IL_01df;
}
}
{
int32_t L_98 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_98|(int32_t)8)));
}
IL_01df:
{
}
IL_01e0:
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_99 = V_5;
IL2CPP_RUNTIME_CLASS_INIT(Object_tF2F3778131EFF286AF62B7B013A170F95A91571A_il2cpp_TypeInfo_var);
bool L_100;
L_100 = Object_op_Implicit_mC8214E4F028CC2F036CC82BDB81D102A02893499(L_99, /*hidden argument*/NULL);
V_12 = L_100;
bool L_101 = V_12;
if (!L_101)
{
goto IL_026b;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_102 = V_0;
NullCheck(L_102);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_103;
L_103 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_102, /*hidden argument*/NULL);
NullCheck(L_103);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_104;
L_104 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_103, /*hidden argument*/NULL);
float L_105 = L_104.get_x_2();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_106 = V_5;
NullCheck(L_106);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_107;
L_107 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_106, /*hidden argument*/NULL);
NullCheck(L_107);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_108;
L_108 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_107, /*hidden argument*/NULL);
float L_109 = L_108.get_x_2();
bool L_110;
L_110 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_105, L_109, /*hidden argument*/NULL);
if (!L_110)
{
goto IL_0253;
}
}
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_111 = V_0;
NullCheck(L_111);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_112;
L_112 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_111, /*hidden argument*/NULL);
NullCheck(L_112);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_113;
L_113 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_112, /*hidden argument*/NULL);
float L_114 = L_113.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_115 = V_5;
NullCheck(L_115);
Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * L_116;
L_116 = Component_get_transform_mE8496EBC45BEB1BADB5F314960F1DF1C952FA11F(L_115, /*hidden argument*/NULL);
NullCheck(L_116);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_117;
L_117 = Transform_get_position_m40A8A9895568D56FFC687B57F30E8D53CB5EA341(L_116, /*hidden argument*/NULL);
float L_118 = L_117.get_z_4();
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_119 = V_5;
NullCheck(L_119);
TerrainData_tAD3780D3C4DE5B9BE122BECE6D08C4AE169ED2A4 * L_120;
L_120 = Terrain_get_terrainData_mDB60C324B3424339C3C9FA6CDF6DC1C9B47D6E41(L_119, /*hidden argument*/NULL);
NullCheck(L_120);
Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E L_121;
L_121 = TerrainData_get_size_mF68B76A49498AE26C506D77483EA81E4F816EB15(L_120, /*hidden argument*/NULL);
float L_122 = L_121.get_z_4();
bool L_123;
L_123 = Mathf_Approximately_mC2A3F657E3FD0CCAD4A4936CEE2F67D624A2AA55(L_114, ((float)il2cpp_codegen_add((float)L_118, (float)L_122)), /*hidden argument*/NULL);
G_B26_0 = ((((int32_t)L_123) == ((int32_t)0))? 1 : 0);
goto IL_0254;
}
IL_0253:
{
G_B26_0 = 1;
}
IL_0254:
{
V_13 = (bool)G_B26_0;
bool L_124 = V_13;
if (!L_124)
{
goto IL_026a;
}
}
{
int32_t L_125 = __this->get_m_errorCode_1();
__this->set_m_errorCode_1(((int32_t)((int32_t)L_125|(int32_t)8)));
}
IL_026a:
{
}
IL_026b:
{
}
IL_026d:
{
return;
}
}
// UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/ErrorCode UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap::Validate()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t TerrainMap_Validate_m9CD6FAF70E4F90C896BF25F083BC0A7F21C8FA56 (TerrainMap_tDD61065279F906812F404E67C65CB7F40CA49453 * __this, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Dictionary_2_get_Keys_mAE2D87453C7973972A5637C6F4EAD27613692826_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_Dispose_mAC047D3AE663114F2D8DFDA994E2C9D78A3E9EB0_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_MoveNext_m821A025A3826D2405C49130607D842500F1ECEF4_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Enumerator_get_Current_m13B3FF8E2918832E70E30374C13E9939E9AA3894_RuntimeMethod_var);
il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&KeyCollection_GetEnumerator_m6405FB5505A9993F393EA3F5C33A46514043AA2A_RuntimeMethod_var);
s_Il2CppMethodInitialized = true;
}
Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E V_0;
memset((&V_0), 0, sizeof(V_0));
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 V_1;
memset((&V_1), 0, sizeof(V_1));
int32_t V_2 = 0;
Exception_t * __last_unhandled_exception = 0;
il2cpp::utils::ExceptionSupportStack<int32_t, 1> __leave_targets;
{
Dictionary_2_t4990FF96A726883A9DEEF78473DD04BB3125158C * L_0 = __this->get_m_terrainTiles_2();
NullCheck(L_0);
KeyCollection_t35C4534DEF9EFE5AABB676279D2BD96D97E040EC * L_1;
L_1 = Dictionary_2_get_Keys_mAE2D87453C7973972A5637C6F4EAD27613692826(L_0, /*hidden argument*/Dictionary_2_get_Keys_mAE2D87453C7973972A5637C6F4EAD27613692826_RuntimeMethod_var);
NullCheck(L_1);
Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E L_2;
L_2 = KeyCollection_GetEnumerator_m6405FB5505A9993F393EA3F5C33A46514043AA2A(L_1, /*hidden argument*/KeyCollection_GetEnumerator_m6405FB5505A9993F393EA3F5C33A46514043AA2A_RuntimeMethod_var);
V_0 = L_2;
}
IL_0013:
try
{ // begin try (depth: 1)
{
goto IL_0032;
}
IL_0015:
{
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_3;
L_3 = Enumerator_get_Current_m13B3FF8E2918832E70E30374C13E9939E9AA3894_inline((Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *)(&V_0), /*hidden argument*/Enumerator_get_Current_m13B3FF8E2918832E70E30374C13E9939E9AA3894_RuntimeMethod_var);
V_1 = L_3;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_4 = V_1;
int32_t L_5 = L_4.get_tileX_0();
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_6 = V_1;
int32_t L_7 = L_6.get_tileZ_1();
TerrainMap_ValidateTerrain_mFE264FDE78C3D68285943250BC9FABAC89D85764(__this, L_5, L_7, /*hidden argument*/NULL);
}
IL_0032:
{
bool L_8;
L_8 = Enumerator_MoveNext_m821A025A3826D2405C49130607D842500F1ECEF4((Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *)(&V_0), /*hidden argument*/Enumerator_MoveNext_m821A025A3826D2405C49130607D842500F1ECEF4_RuntimeMethod_var);
if (L_8)
{
goto IL_0015;
}
}
IL_003b:
{
IL2CPP_LEAVE(0x4C, FINALLY_003d);
}
} // end try (depth: 1)
catch(Il2CppExceptionWrapper& e)
{
__last_unhandled_exception = (Exception_t *)e.ex;
goto FINALLY_003d;
}
FINALLY_003d:
{ // begin finally (depth: 1)
Enumerator_Dispose_mAC047D3AE663114F2D8DFDA994E2C9D78A3E9EB0((Enumerator_t98E92197A96F9CB97165498E8742DC9D7C602D7E *)(&V_0), /*hidden argument*/Enumerator_Dispose_mAC047D3AE663114F2D8DFDA994E2C9D78A3E9EB0_RuntimeMethod_var);
IL2CPP_END_FINALLY(61)
} // end finally (depth: 1)
IL2CPP_CLEANUP(61)
{
IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *)
IL2CPP_JUMP_TBL(0x4C, IL_004c)
}
IL_004c:
{
int32_t L_9 = __this->get_m_errorCode_1();
V_2 = L_9;
goto IL_0055;
}
IL_0055:
{
int32_t L_10 = V_2;
return L_10;
}
}
#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.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0::.ctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void U3CU3Ec__DisplayClass4_0__ctor_mF6CE52C3D202B71510907E3EDCA198C369468888 (U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * __this, const RuntimeMethod* method)
{
{
Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405(__this, /*hidden argument*/NULL);
return;
}
}
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/<>c__DisplayClass4_0::<CreateFromPlacement>b__0(UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool U3CU3Ec__DisplayClass4_0_U3CCreateFromPlacementU3Eb__0_mA0E2295171D220FA7ABA12660D2CB357BC721653 (U3CU3Ec__DisplayClass4_0_tBEB3CC092598F0D16C66B724FF1AE52EF06C0A8F * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___x0, const RuntimeMethod* method)
{
{
Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * L_0 = ___x0;
NullCheck(L_0);
int32_t L_1;
L_1 = Terrain_get_groupingID_m8390315914A192A424C890605D780E638F5E1CC9(L_0, /*hidden argument*/NULL);
int32_t L_2 = __this->get_groupID_0();
return (bool)((((int32_t)L_1) == ((int32_t)L_2))? 1 : 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.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::.ctor(System.Object,System.IntPtr)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TerrainFilter__ctor_m6A1F2AE7CF7A3B502AFBCB351B615EBBE942B838 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __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.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::Invoke(UnityEngine.Terrain)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainFilter_Invoke_m48E69E662BC21917E57559702D1F9D94E4F762F7 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, const RuntimeMethod* method)
{
bool result = false;
DelegateU5BU5D_t677D8FE08A5F99E8EE49150B73966CD6E9BF7DB8* 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 bool (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(___terrain0, targetMethod);
}
else
{
// closed
typedef bool (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, targetMethod);
}
}
else if (___parameterCount != 1)
{
// open
if (il2cpp_codegen_method_is_virtual(targetMethod) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this))
{
if (il2cpp_codegen_method_is_generic_instance(targetMethod))
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
result = GenericInterfaceFuncInvoker0< bool >::Invoke(targetMethod, ___terrain0);
else
result = GenericVirtFuncInvoker0< bool >::Invoke(targetMethod, ___terrain0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
result = InterfaceFuncInvoker0< bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___terrain0);
else
result = VirtFuncInvoker0< bool >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___terrain0);
}
}
else
{
typedef bool (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(___terrain0, targetMethod);
}
}
else
{
// closed
if (targetThis != NULL && 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))
result = GenericInterfaceFuncInvoker1< bool, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * >::Invoke(targetMethod, targetThis, ___terrain0);
else
result = GenericVirtFuncInvoker1< bool, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * >::Invoke(targetMethod, targetThis, ___terrain0);
}
else
{
if (il2cpp_codegen_method_is_interface_method(targetMethod))
result = InterfaceFuncInvoker1< bool, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___terrain0);
else
result = VirtFuncInvoker1< bool, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___terrain0);
}
}
else
{
if (targetThis == NULL)
{
typedef bool (*FunctionPointerType) (Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(___terrain0, targetMethod);
}
else
{
typedef bool (*FunctionPointerType) (void*, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 *, const RuntimeMethod*);
result = ((FunctionPointerType)targetMethodPointer)(targetThis, ___terrain0, targetMethod);
}
}
}
}
return result;
}
// System.IAsyncResult UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::BeginInvoke(UnityEngine.Terrain,System.AsyncCallback,System.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* TerrainFilter_BeginInvoke_m4C17FEFE5AE0498C9A88E63A7ABEA673CD31C949 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __this, Terrain_t2C0E3B3A2895E81446EFF4F5AFD601CF977D1836 * ___terrain0, AsyncCallback_tA7921BEF974919C46FF8F9D9867C567B200BB0EA * ___callback1, RuntimeObject * ___object2, const RuntimeMethod* method)
{
void *__d_args[2] = {0};
__d_args[0] = ___terrain0;
return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback1, (RuntimeObject*)___object2);;
}
// System.Boolean UnityEngine.Experimental.TerrainAPI.TerrainUtility/TerrainMap/TerrainFilter::EndInvoke(System.IAsyncResult)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool TerrainFilter_EndInvoke_m483F3A9363FE8FDF3B5022AE2C284ACE661857B0 (TerrainFilter_t1A8786164AA07CE2D019E2B70A3217FD0F4A46E7 * __this, RuntimeObject* ___result0, const RuntimeMethod* method)
{
RuntimeObject *__result = il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0);
return *(bool*)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.TerrainAPI.TerrainUtility/TerrainMap/TileCoord::.ctor(System.Int32,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155 (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method)
{
{
int32_t L_0 = ___tileX0;
__this->set_tileX_0(L_0);
int32_t L_1 = ___tileZ1;
__this->set_tileZ_1(L_1);
return;
}
}
IL2CPP_EXTERN_C void TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155_AdjustorThunk (RuntimeObject * __this, int32_t ___tileX0, int32_t ___tileZ1, const RuntimeMethod* method)
{
int32_t _offset = 1;
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 * _thisAdjusted = reinterpret_cast<TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 *>(__this + _offset);
TileCoord__ctor_m9EED41FD3E08320CDA102E34DC65236E5137F155(_thisAdjusted, ___tileX0, ___tileZ1, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Vector2__ctor_m9F1F2D5EB5D1FF7091BB527AC8A72CBB309D115E_inline (Vector2_tBB32F2736AEC229A7BFBCE18197EC0F6AC7EC2D9 * __this, float ___x0, float ___y1, const RuntimeMethod* method)
{
{
float L_0 = ___x0;
__this->set_x_0(L_0);
float L_1 = ___y1;
__this->set_y_1(L_1);
return;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 Enumerator_get_Current_mE5033FC555E7BC63DDC919B903A8A305C3AADBEB_gshared_inline (Enumerator_t1AD96AD2810CD9FF13D02CD49EC9D4D447C1485C * __this, const RuntimeMethod* method)
{
{
KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 L_0 = (KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 )__this->get_current_3();
return (KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 )L_0;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR RuntimeObject * KeyValuePair_2_get_Value_mC1E2EFCF98529D0550A547CF87C6EAB6821741BF_gshared_inline (KeyValuePair_2_t56E20A5489EE435FD8BBE3EFACF6219A626E04C0 * __this, const RuntimeMethod* method)
{
{
RuntimeObject * L_0 = (RuntimeObject *)__this->get_value_1();
return (RuntimeObject *)L_0;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 Enumerator_get_Current_m23B8CC855231000EC661C87C6F73B91516A0DC30_gshared_inline (Enumerator_t81F0095C2D5C396203071D667A6252EFAB3D76D6 * __this, const RuntimeMethod* method)
{
{
KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 L_0 = (KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 )__this->get_current_3();
return (KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 )L_0;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 KeyValuePair_2_get_Key_m212B0FE7898E52C6B11FD6DD2C01E618B497E2AD_gshared_inline (KeyValuePair_2_tCBAAE4FBE6091373C1916EE17527311382CF4551 * __this, const RuntimeMethod* method)
{
{
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_0 = (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 )__this->get_key_0();
return (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 )L_0;
}
}
IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 Enumerator_get_Current_m3B16C98F89532B1B1779AEA703E89F4C00B89023_gshared_inline (Enumerator_t914132A1A7488464276E36385DFE4C80616AB5E9 * __this, const RuntimeMethod* method)
{
{
TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 L_0 = (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 )__this->get_currentKey_3();
return (TileCoord_t491EABF2B90DFB255C8F7624FF5528F2DE2CC901 )L_0;
}
}
|
[
"ferdinandsilva@ferdinandsilva.com"
] |
ferdinandsilva@ferdinandsilva.com
|
d1258002362797474cab8b80b564e7bcf755da91
|
3bc95589dbd26f2857ebe9ffbfa3d07cd490defa
|
/src/qt/test/wallettests.cpp
|
eafaaec14482005c269f1b48305081ced32865b8
|
[
"MIT"
] |
permissive
|
perfectcoincore/perfectcoin
|
5e840973b09081845c38e26e0c6d95e95fae3389
|
32dcbae0df2798921a9752a1a1371141831f1adc
|
refs/heads/master
| 2020-03-21T13:30:48.489603
| 2018-06-27T06:07:32
| 2018-06-27T06:07:32
| 138,610,004
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,139
|
cpp
|
#include "wallettests.h"
#include "qt/perfectcoinamountfield.h"
#include "qt/callback.h"
#include "qt/optionsmodel.h"
#include "qt/platformstyle.h"
#include "qt/qvalidatedlineedit.h"
#include "qt/sendcoinsdialog.h"
#include "qt/sendcoinsentry.h"
#include "qt/transactiontablemodel.h"
#include "qt/transactionview.h"
#include "qt/walletmodel.h"
#include "test/test_perfectcoin.h"
#include "validation.h"
#include "wallet/wallet.h"
#include "qt/overviewpage.h"
#include "qt/receivecoinsdialog.h"
#include "qt/recentrequeststablemodel.h"
#include "qt/receiverequestdialog.h"
#include <QAbstractButton>
#include <QAction>
#include <QApplication>
#include <QCheckBox>
#include <QPushButton>
#include <QTimer>
#include <QVBoxLayout>
#include <QTextEdit>
#include <QListView>
#include <QDialogButtonBox>
namespace
{
//! Press "Ok" button in message box dialog.
void ConfirmMessage(QString* text = nullptr)
{
QTimer::singleShot(0, makeCallback([text](Callback* callback) {
for (QWidget* widget : QApplication::topLevelWidgets()) {
if (widget->inherits("QMessageBox")) {
QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);
if (text) *text = messageBox->text();
messageBox->defaultButton()->click();
}
}
delete callback;
}), SLOT(call()));
}
//! Press "Yes" or "Cancel" buttons in modal send confirmation dialog.
void ConfirmSend(QString* text = nullptr, bool cancel = false)
{
QTimer::singleShot(0, makeCallback([text, cancel](Callback* callback) {
for (QWidget* widget : QApplication::topLevelWidgets()) {
if (widget->inherits("SendConfirmationDialog")) {
SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget);
if (text) *text = dialog->text();
QAbstractButton* button = dialog->button(cancel ? QMessageBox::Cancel : QMessageBox::Yes);
button->setEnabled(true);
button->click();
}
}
delete callback;
}), SLOT(call()));
}
//! Send coins to address and return txid.
uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDestination& address, CAmount amount, bool rbf)
{
QVBoxLayout* entries = sendCoinsDialog.findChild<QVBoxLayout*>("entries");
SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(entries->itemAt(0)->widget());
entry->findChild<QValidatedLineEdit*>("payTo")->setText(QString::fromStdString(EncodeDestination(address)));
entry->findChild<PerfectCoinAmountField*>("payAmount")->setValue(amount);
sendCoinsDialog.findChild<QFrame*>("frameFee")
->findChild<QFrame*>("frameFeeSelection")
->findChild<QCheckBox*>("optInRBF")
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
uint256 txid;
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) {
if (status == CT_NEW) txid = hash;
}));
ConfirmSend();
QMetaObject::invokeMethod(&sendCoinsDialog, "on_sendButton_clicked");
return txid;
}
//! Find index of txid in transaction list.
QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
{
QString hash = QString::fromStdString(txid.ToString());
int rows = model.rowCount({});
for (int row = 0; row < rows; ++row) {
QModelIndex index = model.index(row, 0, {});
if (model.data(index, TransactionTableModel::TxHashRole) == hash) {
return index;
}
}
return {};
}
//! Request context menu (call method that is public in qt5, but protected in qt4).
void RequestContextMenu(QWidget* widget)
{
class Qt4Hack : public QWidget
{
public:
using QWidget::customContextMenuRequested;
};
static_cast<Qt4Hack*>(widget)->customContextMenuRequested({});
}
//! Invoke bumpfee on txid and check results.
void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
{
QTableView* table = view.findChild<QTableView*>("transactionView");
QModelIndex index = FindTx(*table->selectionModel()->model(), txid);
QVERIFY2(index.isValid(), "Could not find BumpFee txid");
// Select row in table, invoke context menu, and make sure bumpfee action is
// enabled or disabled as expected.
QAction* action = view.findChild<QAction*>("bumpFeeAction");
table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
action->setEnabled(expectDisabled);
RequestContextMenu(table);
QCOMPARE(action->isEnabled(), !expectDisabled);
action->setEnabled(true);
QString text;
if (expectError.empty()) {
ConfirmSend(&text, cancel);
} else {
ConfirmMessage(&text);
}
action->trigger();
QVERIFY(text.indexOf(QString::fromStdString(expectError)) != -1);
}
//! Simple qt wallet tests.
//
// Test widgets can be debugged interactively calling show() on them and
// manually running the event loop, e.g.:
//
// sendCoinsDialog.show();
// QEventLoop().exec();
//
// This also requires overriding the default minimal Qt platform:
//
// src/qt/test/test_perfectcoin-qt -platform xcb # Linux
// src/qt/test/test_perfectcoin-qt -platform windows # Windows
// src/qt/test/test_perfectcoin-qt -platform cocoa # macOS
void TestGUI()
{
// Set up wallet and chain with 105 blocks (5 mature blocks for spending).
TestChain100Setup test;
for (int i = 0; i < 5; ++i) {
test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey()));
}
bitdb.MakeMock();
std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat"));
CWallet wallet(std::move(dbw));
bool firstRun;
wallet.LoadWallet(firstRun);
{
LOCK(wallet.cs_wallet);
wallet.SetAddressBook(test.coinbaseKey.GetPubKey().GetID(), "", "receive");
wallet.AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
}
wallet.ScanForWalletTransactions(chainActive.Genesis(), nullptr, true);
wallet.SetBroadcastTransactions(true);
// Create widgets for sending coins and listing transactions.
std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other"));
SendCoinsDialog sendCoinsDialog(platformStyle.get());
TransactionView transactionView(platformStyle.get());
OptionsModel optionsModel;
WalletModel walletModel(platformStyle.get(), &wallet, &optionsModel);
sendCoinsDialog.setModel(&walletModel);
transactionView.setModel(&walletModel);
// Send two transactions, and verify they are added to transaction list.
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
QCOMPARE(transactionTableModel->rowCount({}), 105);
uint256 txid1 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 5 * COIN, false /* rbf */);
uint256 txid2 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 10 * COIN, true /* rbf */);
QCOMPARE(transactionTableModel->rowCount({}), 107);
QVERIFY(FindTx(*transactionTableModel, txid1).isValid());
QVERIFY(FindTx(*transactionTableModel, txid2).isValid());
// Call bumpfee. Test disabled, canceled, enabled, then failing cases.
BumpFee(transactionView, txid1, true /* expect disabled */, "not BIP 125 replaceable" /* expected error */, false /* cancel */);
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);
BumpFee(transactionView, txid2, true /* expect disabled */, "already bumped" /* expected error */, false /* cancel */);
// Check current balance on OverviewPage
OverviewPage overviewPage(platformStyle.get());
overviewPage.setWalletModel(&walletModel);
QLabel* balanceLabel = overviewPage.findChild<QLabel*>("labelBalance");
QString balanceText = balanceLabel->text();
int unit = walletModel.getOptionsModel()->getDisplayUnit();
CAmount balance = walletModel.getBalance();
QString balanceComparison = PerfectCoinUnits::formatWithUnit(unit, balance, false, PerfectCoinUnits::separatorAlways);
QCOMPARE(balanceText, balanceComparison);
// Check Request Payment button
ReceiveCoinsDialog receiveCoinsDialog(platformStyle.get());
receiveCoinsDialog.setModel(&walletModel);
RecentRequestsTableModel* requestTableModel = walletModel.getRecentRequestsTableModel();
// Label input
QLineEdit* labelInput = receiveCoinsDialog.findChild<QLineEdit*>("reqLabel");
labelInput->setText("TEST_LABEL_1");
// Amount input
PerfectCoinAmountField* amountInput = receiveCoinsDialog.findChild<PerfectCoinAmountField*>("reqAmount");
amountInput->setValue(1);
// Message input
QLineEdit* messageInput = receiveCoinsDialog.findChild<QLineEdit*>("reqMessage");
messageInput->setText("TEST_MESSAGE_1");
int initialRowCount = requestTableModel->rowCount({});
QPushButton* requestPaymentButton = receiveCoinsDialog.findChild<QPushButton*>("receiveButton");
requestPaymentButton->click();
for (QWidget* widget : QApplication::topLevelWidgets()) {
if (widget->inherits("ReceiveRequestDialog")) {
ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);
QTextEdit* rlist = receiveRequestDialog->QObject::findChild<QTextEdit*>("outUri");
QString paymentText = rlist->toPlainText();
QStringList paymentTextList = paymentText.split('\n');
QCOMPARE(paymentTextList.at(0), QString("Payment information"));
QVERIFY(paymentTextList.at(1).indexOf(QString("URI: perfectcoin:")) != -1);
QVERIFY(paymentTextList.at(2).indexOf(QString("Address:")) != -1);
QCOMPARE(paymentTextList.at(3), QString("Amount: 0.00000001 ") + QString::fromStdString(CURRENCY_UNIT));
QCOMPARE(paymentTextList.at(4), QString("Label: TEST_LABEL_1"));
QCOMPARE(paymentTextList.at(5), QString("Message: TEST_MESSAGE_1"));
}
}
// Clear button
QPushButton* clearButton = receiveCoinsDialog.findChild<QPushButton*>("clearButton");
clearButton->click();
QCOMPARE(labelInput->text(), QString(""));
QCOMPARE(amountInput->value(), CAmount(0));
QCOMPARE(messageInput->text(), QString(""));
// Check addition to history
int currentRowCount = requestTableModel->rowCount({});
QCOMPARE(currentRowCount, initialRowCount+1);
// Check Remove button
QTableView* table = receiveCoinsDialog.findChild<QTableView*>("recentRequestsView");
table->selectRow(currentRowCount-1);
QPushButton* removeRequestButton = receiveCoinsDialog.findChild<QPushButton*>("removeRequestButton");
removeRequestButton->click();
QCOMPARE(requestTableModel->rowCount({}), currentRowCount-1);
bitdb.Flush(true);
bitdb.Reset();
}
}
void WalletTests::walletTests()
{
TestGUI();
}
|
[
"webframes@gmail.com"
] |
webframes@gmail.com
|
d049a17ec8d305c1725bba226ced2d2c1c0cc244
|
0ee45b0f16f26d8746d77f921dcf1605ad7bfdc9
|
/lib/prod-dbg/ProductDebug.cpp
|
d92ae4f116a1a0a55a521685a09251595938f4ce
|
[
"MIT"
] |
permissive
|
chatelao/wiring-lora-skeleton
|
dcd9aaae40ba72a14a13a5750f2942a68a80b815
|
85e1fc19b99c4a46dee5295eee27db488b823e31
|
refs/heads/master
| 2020-04-28T15:19:16.358328
| 2019-02-28T17:30:54
| 2019-02-28T17:30:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 878
|
cpp
|
/*
* ProductDebug.cpp
*
* Created on: 14.06.2016
* Author: nid
*/
#include "ProductDebug.h"
#include <Arduino.h>
#include <Timer.h>
#include <SerialCommand.h>
#include <DbgCliNode.h>
#include <DbgCliTopic.h>
#include <DbgCliCommand.h>
#include <DbgTraceContext.h>
#include <DbgTracePort.h>
#include <DbgTraceLevel.h>
#include <DbgPrintConsole.h>
#include <DbgTraceOut.h>
#include <AppDebug.h>
#ifdef ESP8266
extern "C"
{
#include "user_interface.h"
}
#else
#include <RamUtils.h>
#endif
//-----------------------------------------------------------------------------
void setupProdDebugEnv()
{
setupDebugEnv();
Serial.println();
Serial.println("---------------------------------------------");
Serial.println("Hello from Wiring LoRaWan Skeleton Application!");
Serial.println("---------------------------------------------");
Serial.println();
}
|
[
"dieter.niklaus@gmx.net"
] |
dieter.niklaus@gmx.net
|
ac9f5c708a36c24a2d43abd544c38ff811d6b936
|
c42689414b1f6a828c9c6d35cb445691355e3e45
|
/Classes/UILayer/PowerManager.cpp
|
7dfb07f4be634c598bece22dbb8d71d9812c7aba
|
[] |
no_license
|
EMGAME/Sister
|
ddfd751b7e5feafd260c356d6874036ac4e2e238
|
33fa7c86c2669e016c2ead9b27aab100aa75aa81
|
refs/heads/master
| 2021-01-02T09:09:01.621004
| 2014-10-22T04:16:02
| 2014-10-22T04:16:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,376
|
cpp
|
//
// PowerManager.cpp
// Sister
//
// Created by 风飞逸 on 14-8-14.
//
//
#include "PowerManager.h"
static PowerManager* s_sharedPowerManager = nullptr;
PowerManager::PowerManager(){
setPowerNum(0);
}
PowerManager* PowerManager::getInstance(){
if (!s_sharedPowerManager)
{
s_sharedPowerManager = new PowerManager();
s_sharedPowerManager->init();
}
return s_sharedPowerManager;
}
void PowerManager::purge(){
CC_SAFE_RELEASE(s_sharedPowerManager);
}
bool PowerManager::init(){
bool bRet = false;
do{
setPowerNum(readPower());
bRet = true;
}while (0);
return bRet;
}
void PowerManager::restMgr(){
setPowerNum(0);
savePower();
}
void PowerManager::addPower(int number){
setPowerNum(getPowerNum()+number);
savePower();
}
void PowerManager::subPower(int number){
if (getPowerNum()-number >= 0) {
setPowerNum(getPowerNum()-number);
savePower();
}else{
return;
}
}
void PowerManager::savePower(){
CCUserDefault::getInstance()->setIntegerForKey("Power", getPowerNum());
}
int PowerManager::readPower(){
return CCUserDefault::getInstance()->getIntegerForKey("Power", 0);
}
void PowerManager::clickReducePower(){
subPower(1);
}
void PowerManager::initWithNumber(int number){
setPowerNum(number);
savePower();
}
|
[
"wangyaohua@yimankeji.com"
] |
wangyaohua@yimankeji.com
|
53e4258ebfba0be11cc79414e90c48bb5ecbc66c
|
d612992e0471f969d2c83bdf475ce768155d99f4
|
/inet/src/inet/visualizer/scene/NetworkNodeCanvasVisualization.h
|
92ac4f61d4ebcb9011f1f43ffecefb3cc4af977e
|
[] |
no_license
|
weinischThesis/simulte_veins
|
d4479406bd395bd2b6e630276d3a36c83de493e2
|
c652ac511610514219ee334bc3129eff658b8fb6
|
refs/heads/master
| 2020-04-15T06:11:02.666630
| 2019-04-22T16:21:54
| 2019-04-22T16:21:54
| 164,451,511
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,392
|
h
|
//
// Copyright (C) OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#ifndef __INET_NETWORKNODECANVASVISUALIZATION_H
#define __INET_NETWORKNODECANVASVISUALIZATION_H
#include "inet/common/figures/cPanelFigure.h"
#include "inet/visualizer/util/Displacement.h"
namespace inet {
namespace visualizer {
class INET_API NetworkNodeCanvasVisualization : public cGroupFigure
{
protected:
class INET_API Annotation {
public:
cFigure *figure;
cFigure::Rectangle bounds;
Displacement displacementHint;
double displacementPriority;
public:
Annotation(cFigure *figure, const cFigure::Point& size, Displacement displacement, double displacementPriority);
static bool compareDisplacementPriority(const Annotation& a1, const Annotation& a2);
};
protected:
cModule *networkNode = nullptr;
double annotationSpacing = NaN;
double displacementPenalty = NaN;
bool isLayoutInvalid = false;
cFigure::Rectangle submoduleBounds;
std::vector<Annotation> annotations;
cPanelFigure *annotationFigure = nullptr;
protected:
virtual void layout();
public:
NetworkNodeCanvasVisualization(cModule *networkNode, double annotationSpacing, double displacementPenalty);
virtual void refreshDisplay() override;
virtual void addAnnotation(cFigure *figure, cFigure::Point size, Displacement displacement = DISPLACEMENT_ANY, double displacementPriority = 0);
virtual void removeAnnotation(cFigure *figure);
virtual void setAnnotationSize(cFigure *figure, cFigure::Point size);
virtual void setAnnotationVisible(cFigure *figure, bool visible);
};
} // namespace visualizer
} // namespace inet
#endif // ifndef __INET_NETWORKNODECANVASVISUALIZATION_H
|
[
"christoph@weinisch.com"
] |
christoph@weinisch.com
|
3f39e7815a5119ef7d98d27399da99ee70ce689e
|
52505166e409b44caf7a0b144ef0c453b586fcee
|
/bug-detection/piccolo/sim/src/riscv.cc
|
6a54a0abf141fd69f7768d93d052fee85a5fc365
|
[] |
no_license
|
yuex1994/ASPDAC-tandem
|
fb090975c65edbdda68c19a8d7e7a5f0ff96bcb8
|
decdabc5743c2116d1fc0e339e434b9e13c430a8
|
refs/heads/master
| 2023-08-28T04:37:30.011721
| 2021-08-07T13:19:23
| 2021-08-07T13:19:30
| 419,089,461
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,740
|
cc
|
#include <riscv.h>
riscv::riscv() {
tandem_func[0] = &riscv::tandem_instr_BEQ;
tandem_func[1] = &riscv::tandem_instr_BNE;
tandem_func[2] = &riscv::tandem_instr_BLT;
tandem_func[3] = &riscv::tandem_instr_BLTU;
tandem_func[4] = &riscv::tandem_instr_BGE;
tandem_func[5] = &riscv::tandem_instr_BGEU;
tandem_func[6] = &riscv::tandem_instr_JAL;
tandem_func[7] = &riscv::tandem_instr_JALR;
tandem_func[8] = &riscv::tandem_instr_LW;
tandem_func[9] = &riscv::tandem_instr_LH;
tandem_func[10] = &riscv::tandem_instr_LB;
tandem_func[11] = &riscv::tandem_instr_LHU;
tandem_func[12] = &riscv::tandem_instr_LBU;
tandem_func[13] = &riscv::tandem_instr_SW;
tandem_func[14] = &riscv::tandem_instr_SH;
tandem_func[15] = &riscv::tandem_instr_SB;
tandem_func[16] = &riscv::tandem_instr_ADD;
tandem_func[17] = &riscv::tandem_instr_AND;
tandem_func[18] = &riscv::tandem_instr_OR;
tandem_func[19] = &riscv::tandem_instr_XOR;
tandem_func[20] = &riscv::tandem_instr_SLL;
tandem_func[21] = &riscv::tandem_instr_SRL;
tandem_func[22] = &riscv::tandem_instr_SUB;
tandem_func[23] = &riscv::tandem_instr_SRA;
tandem_func[24] = &riscv::tandem_instr_SLT;
tandem_func[25] = &riscv::tandem_instr_SLTU;
tandem_func[26] = &riscv::tandem_instr_ADDI;
tandem_func[27] = &riscv::tandem_instr_SLTI;
tandem_func[28] = &riscv::tandem_instr_SLTIU;
tandem_func[29] = &riscv::tandem_instr_ANDI;
tandem_func[30] = &riscv::tandem_instr_ORI;
tandem_func[31] = &riscv::tandem_instr_XORI;
tandem_func[32] = &riscv::tandem_instr_SLLI;
tandem_func[33] = &riscv::tandem_instr_SRLI;
tandem_func[34] = &riscv::tandem_instr_SRAI;
tandem_func[35] = &riscv::tandem_instr_LUI;
tandem_func[36] = &riscv::tandem_instr_AUIPC;
}
|
[
"anonymizeddac2020submission@gmail.com"
] |
anonymizeddac2020submission@gmail.com
|
51b0edf560984e0eb7f9d8981ae43b1f99b0345b
|
0d5e87d5b7ef260a721304b2b08444d299d29083
|
/Flucius 1.1/runner.cpp
|
ea6b0de4e66fc359177c09704400f1ce8a6f7e09
|
[] |
no_license
|
marsermd/Flucius
|
8264bec52c3b1175dff4bc7e2f3d0d6e7ee67b2e
|
d453eaecbb214cb7b8c1cd302010332657966d22
|
refs/heads/master
| 2021-05-25T11:22:53.850352
| 2021-04-19T17:39:37
| 2021-04-19T17:39:37
| 20,194,022
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,080
|
cpp
|
#include <stdio.h>
#include <stdlib.h>
#include <GL\glew.h>
#include <GLFW\glfw3.h>
#include <glm\glm.hpp>
#include <glm\gtc\type_ptr.hpp>
#include <cuda_profiler_api.h>
#include "shader.h"
#include "Camera.h"
#include "Grid.h"
#include "SimplePsystemDrawer.h"
#include "Scene.h"
struct Material
{
glm::vec3 color;
glm::vec4 ambient;
glm::vec4 diffuse;
glm::vec4 specular;
glm::vec4 emission;
GLfloat shininess;
};
void MaterialSetup(GLuint program, const Material &material)
{
GLuint colorID = glGetUniformLocation(program, "material.color");
glUniform3f(colorID, 0.0f, 0.0f, 0.8f);
glUniform4fv(glGetUniformLocation(program, "material.ambient"), 1, glm::value_ptr(material.ambient));
glUniform4fv(glGetUniformLocation(program, "material.diffuse"), 1, glm::value_ptr(material.diffuse));
glUniform4fv(glGetUniformLocation(program, "material.specular"), 1, glm::value_ptr(material.specular));
glUniform4fv(glGetUniformLocation(program, "material.emission"), 1, glm::value_ptr(material.emission));
glUniform1fv(glGetUniformLocation(program, "material.shininess"), 1, &material.shininess);
}
struct PointLight
{
glm::vec4 position;
glm::vec4 ambient;
glm::vec4 diffuse;
glm::vec4 specular;
glm::vec3 attenuation;
};
void PointLightSetup(GLuint program, const PointLight &light)
{
glUniform4fv(glGetUniformLocation(program, "light.position"), 1, glm::value_ptr(light.position));
glUniform4fv(glGetUniformLocation(program, "light.ambient"), 1, glm::value_ptr(light.ambient));
glUniform4fv(glGetUniformLocation(program, "light.diffuse"), 1, glm::value_ptr(light.diffuse));
glUniform4fv(glGetUniformLocation(program, "light.specular"), 1, glm::value_ptr(light.specular));
glUniform3fv(glGetUniformLocation(program, "light.attenuation"), 1, glm::value_ptr(light.attenuation));
}
GLFWwindow* window;
void openWindow(int width, int height) {
if (!glfwInit()) {
fprintf(stderr, "Failed to initialize GLFW\n");
exit(-1);
}
glfwWindowHint(GLFW_SAMPLES, 2); // 2x antialiasing
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // OpenGL 3.3
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
//GLFWmonitor * primary = glfwGetPrimaryMonitor();
window = glfwCreateWindow(width, height, "Flucius", NULL, NULL);
if (window == NULL) {
fprintf(stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n");
glfwTerminate();
exit(-1);
}
glfwMakeContextCurrent(window);
// Initialize GLEW
glewExperimental=true;
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
exit(-1);
}
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
}
void updatePsystemSettings(PSystem& pSystem, GLFWwindow* window)
{
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
{
pSystem.settings.setGravity(glm::vec3(0, 0, -10));
}
else if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)
{
pSystem.settings.setGravity(glm::vec3(0, 0, 10));
}
else if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS)
{
pSystem.settings.setGravity(glm::vec3(-10, 0, 0));
}
else if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS)
{
pSystem.settings.setGravity(glm::vec3(10, 0, 0));
}
else
{
pSystem.settings.setGravity(glm::vec3(0, -10, 0));
}
if (glfwGetKey(window, GLFW_KEY_E) == GLFW_PRESS)
{
pSystem.settings.viscosity = glm::clamp(pSystem.settings.viscosity - 0.02f, 0.0f, 1.0f);
}
if (glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS)
{
pSystem.settings.viscosity = glm::clamp(pSystem.settings.viscosity + 0.02f, 0.0f, 1.0f);
}
if (glfwGetKey(window, GLFW_KEY_T) == GLFW_PRESS)
{
pSystem.settings.iterationsCount = glm::clamp(pSystem.settings.iterationsCount - 1, 1, 10);
}
if (glfwGetKey(window, GLFW_KEY_Y) == GLFW_PRESS)
{
pSystem.settings.iterationsCount = glm::clamp(pSystem.settings.iterationsCount + 1, 1, 10);
}
}
int main() {
openWindow(1024, 768);
Material material;
material.color = glm::vec3(1.0, 1.0, 0.5);
material.ambient = glm::vec4(0.2f, 0.2f, 0.2f, 1.0f);
material.diffuse = glm::vec4(0.3f, 0.5f, 1.0f, 1.0f);
material.specular = glm::vec4(0.8f, 0.8f, 0.8f, 1.0f);
material.emission = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
material.shininess = 20.0f;
PointLight pointLight;
pointLight.position = glm::vec4(0.0f, 0.0f, 7.0f, 1.0f);
pointLight.ambient = glm::vec4(0.1f, 0.1f, 0.1f, 1.0f);
pointLight.diffuse = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
pointLight.specular = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
pointLight.attenuation = glm::vec3(0.2f, 0.0f, 0.02f);
GLuint programID = loadShaders("TransformVertexShader.vertexshader", "ColorFragmentShader.fragmentshader");
//display range : 0.1 unit <-> 100 units
Camera camera(window, glm::vec3(35, 20, 35), 130);
PSystem pSystem = PSystem(70.0f);
SimplePsystemDrawer pSystemDrawer = SimplePsystemDrawer(&pSystem);
//Grid pSystemGrid = Grid(&pSystem);
pSystem.setRenderer(&pSystemDrawer);
Scene scene(&camera, programID);
scene.registerObject(&pSystem);
Timer fpsTimer;
int frame = 0;
bool wasSpacePressed = false;
do {
camera.react();
glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glUseProgram(programID);
MaterialSetup(programID, material);
PointLightSetup(programID, pointLight);
scene.render();
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
frame = (frame + 1) % 10;
if (frame == 0) {
printf("fps = %.2f\n", 10.0f / fpsTimer.getDelta());
fpsTimer.step();
}
updatePsystemSettings(pSystem, window);
if (glfwGetKey(window, GLFW_KEY_SPACE) == GLFW_PRESS)
{
if (!wasSpacePressed)
{
pSystem.addParticleBox(glm::vec3(20, 50, 20), 10);
}
wasSpacePressed = true;
}
else
{
wasSpacePressed = false;
}
} // Check if the ESC key was pressed or the window was closed
while (glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && glfwWindowShouldClose(window) == 0);
cudaProfilerStop();
}
|
[
"mischapanin@gmail.com"
] |
mischapanin@gmail.com
|
4c77c4184a8f3097332e82f956a2ab3d9ac23f51
|
2b674dfad4f0c58d064421136a24301182e10920
|
/include/blaze-2.4/blazetest/src/mathtest/dynamicmatrix/ClassTest.cpp
|
6a245d0fa1ebd9962345244b6e0e8b7415c7517c
|
[
"BSD-3-Clause"
] |
permissive
|
adityaramesh/blaze_benchmark
|
6f57352a4d3f2de9a2b35956c2f2f31e7834c018
|
91a9bf4500fcc0e4c5ff435e80026e216deb5ad7
|
refs/heads/master
| 2020-04-10T01:41:42.341292
| 2015-08-26T14:06:30
| 2015-08-26T14:06:30
| 41,381,938
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 234,752
|
cpp
|
//=================================================================================================
/*!
// \file src/mathtest/dynamicmatrix/ClassTest.cpp
// \brief Source file for the DynamicMatrix class test
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development 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 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/CompressedMatrix.h>
#include <blaze/math/DiagonalMatrix.h>
#include <blaze/math/LowerMatrix.h>
#include <blaze/math/StaticMatrix.h>
#include <blaze/math/UpperMatrix.h>
#include <blaze/util/Complex.h>
#include <blaze/util/Random.h>
#include <blaze/util/UniqueArray.h>
#include <blazetest/mathtest/dynamicmatrix/ClassTest.h>
#include <blazetest/mathtest/RandomMaximum.h>
#include <blazetest/mathtest/RandomMinimum.h>
namespace blazetest {
namespace mathtest {
namespace dynamicmatrix {
//=================================================================================================
//
// CONSTRUCTORS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Constructor for the DynamicMatrix class test.
//
// \exception std::runtime_error Operation error detected.
*/
ClassTest::ClassTest()
{
testAlignment< char >( "char" );
testAlignment< signed char >( "signed char" );
testAlignment< unsigned char >( "unsigned char" );
testAlignment< wchar_t >( "wchar_t" );
testAlignment< short >( "short" );
testAlignment< unsigned short >( "unsigned short" );
testAlignment< int >( "int" );
testAlignment< unsigned int >( "unsigned int" );
testAlignment< float >( "float" );
testAlignment< double >( "double" );
testAlignment< complex<float> >( "complex<float>" );
testAlignment< complex<double> >( "complex<double>" );
testConstructors();
testAssignment();
testAddAssign();
testSubAssign();
testMultAssign();
testScaling();
testFunctionCall();
testIterator();
testNonZeros();
testReset();
testClear();
testResize();
testExtend();
testReserve();
testTranspose();
testSwap();
testIsDefault();
}
//*************************************************************************************************
//=================================================================================================
//
// TEST FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix constructors.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of all constructors of the DynamicMatrix class template.
// In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testConstructors()
{
//=====================================================================================
// Row-major default constructor
//=====================================================================================
// Default constructor
{
test_ = "Row-major DynamicMatrix default constructor";
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
//=====================================================================================
// Row-major size constructor
//=====================================================================================
{
test_ = "Row-major DynamicMatrix size constructor (0x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 0UL, 0UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix size constructor (0x4)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 0UL, 4UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 4UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix size constructor (3x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 0UL );
checkRows ( mat, 3UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix size constructor (3x4)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 4UL );
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
}
//=====================================================================================
// Row-major homogeneous initialization
//=====================================================================================
{
test_ = "Row-major DynamicMatrix homogeneous initialization constructor (0x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 0UL, 0UL, 2 );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix homogeneous initialization constructor (0x4)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 0UL, 4UL, 2 );
checkRows ( mat, 0UL );
checkColumns ( mat, 4UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix homogeneous initialization constructor (3x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 0UL, 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Row-major DynamicMatrix homogeneous initialization constructor (3x4)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 4UL, 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
checkNonZeros( mat, 12UL );
checkNonZeros( mat, 0UL, 4UL );
checkNonZeros( mat, 1UL, 4UL );
checkNonZeros( mat, 2UL, 4UL );
if( mat(0,0) != 2 || mat(0,1) != 2 || mat(0,2) != 2 || mat(0,3) != 2 ||
mat(1,0) != 2 || mat(1,1) != 2 || mat(1,2) != 2 || mat(1,3) != 2 ||
mat(2,0) != 2 || mat(2,1) != 2 || mat(2,2) != 2 || mat(2,3) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 2 2 2 )\n( 2 2 2 2 )\n( 2 2 2 2 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major array initialization
//=====================================================================================
{
test_ = "Row-major DynamicMatrix dynamic array initialization constructor";
blaze::UniqueArray<int> array( new int[6] );
array[0] = 1;
array[1] = 2;
array[2] = 3;
array[3] = 4;
array[4] = 5;
array[5] = 6;
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL, array.get() );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major DynamicMatrix static array initialization constructor";
const int array[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
blaze::DynamicMatrix<int,blaze::rowMajor> mat( array );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major copy constructor
//=====================================================================================
{
test_ = "Row-major DynamicMatrix copy constructor (0x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 0UL, 0UL );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( mat1 );
checkRows ( mat2, 0UL );
checkColumns ( mat2, 0UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Row-major DynamicMatrix copy constructor (0x3)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 0UL, 3UL );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( mat1 );
checkRows ( mat2, 0UL );
checkColumns ( mat2, 3UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Row-major DynamicMatrix copy constructor (2x0)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 0UL );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( mat1 );
checkRows ( mat2, 2UL );
checkColumns ( mat2, 0UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Row-major DynamicMatrix copy constructor (2x3)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( mat1 );
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 3UL );
checkNonZeros( mat2, 1UL, 3UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major default constructor
//=====================================================================================
{
test_ = "Column-major DynamicMatrix default constructor";
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
//=====================================================================================
// Column-major size constructor
//=====================================================================================
{
test_ = "Column-major DynamicMatrix size constructor (0x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 0UL, 0UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix size constructor (0x4)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 0UL, 4UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 4UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix size constructor (3x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 0UL );
checkRows ( mat, 3UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix size constructor (3x4)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 4UL );
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
}
//=====================================================================================
// Column-major homogeneous initialization
//=====================================================================================
{
test_ = "Column-major DynamicMatrix homogeneous initialization constructor (0x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 0UL, 0UL, 2 );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix homogeneous initialization constructor (0x4)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 0UL, 4UL, 2 );
checkRows ( mat, 0UL );
checkColumns ( mat, 4UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix homogeneous initialization constructor (3x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 0UL, 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
{
test_ = "Column-major DynamicMatrix homogeneous initialization constructor (3x4)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 4UL, 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
checkNonZeros( mat, 12UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
checkNonZeros( mat, 2UL, 3UL );
checkNonZeros( mat, 3UL, 3UL );
if( mat(0,0) != 2 || mat(0,1) != 2 || mat(0,2) != 2 || mat(0,3) != 2 ||
mat(1,0) != 2 || mat(1,1) != 2 || mat(1,2) != 2 || mat(1,3) != 2 ||
mat(2,0) != 2 || mat(2,1) != 2 || mat(2,2) != 2 || mat(2,3) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 2 2 2 )\n( 2 2 2 2 )\n( 2 2 2 2 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major array initialization
//=====================================================================================
{
test_ = "Column-major DynamicMatrix dynamic array initialization constructor";
blaze::UniqueArray<int> array( new int[6] );
array[0] = 1;
array[1] = 2;
array[2] = 3;
array[3] = 4;
array[4] = 5;
array[5] = 6;
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL, array.get() );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 3 || mat(0,2) != 5 ||
mat(1,0) != 2 || mat(1,1) != 4 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 3 5 )\n( 2 4 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major DynamicMatrix static array initialization constructor";
const int array[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
blaze::DynamicMatrix<int,blaze::columnMajor> mat( array );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major copy constructor
//=====================================================================================
{
test_ = "Column-major DynamicMatrix copy constructor (0x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 0UL, 0UL );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( mat1 );
checkRows ( mat2, 0UL );
checkColumns ( mat2, 0UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Column-major DynamicMatrix copy constructor (0x3)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 0UL, 3UL );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( mat1 );
checkRows ( mat2, 0UL );
checkColumns ( mat2, 3UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Column-major DynamicMatrix copy constructor (2x0)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 0UL );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( mat1 );
checkRows ( mat2, 2UL );
checkColumns ( mat2, 0UL );
checkNonZeros( mat2, 0UL );
}
{
test_ = "Column-major DynamicMatrix copy constructor (2x3)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( mat1 );
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Construction failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix assignment operators.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of all assignment operators of the DynamicMatrix class template.
// In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testAssignment()
{
//=====================================================================================
// Row-major homogeneous assignment
//=====================================================================================
{
test_ = "Row-major DynamicMatrix homogeneous assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 4UL );
mat = 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
checkNonZeros( mat, 12UL );
checkNonZeros( mat, 0UL, 4UL );
checkNonZeros( mat, 1UL, 4UL );
checkNonZeros( mat, 2UL, 4UL );
if( mat(0,0) != 2 || mat(0,1) != 2 || mat(0,2) != 2 || mat(0,3) != 2 ||
mat(1,0) != 2 || mat(1,1) != 2 || mat(1,2) != 2 || mat(1,3) != 2 ||
mat(2,0) != 2 || mat(2,1) != 2 || mat(2,2) != 2 || mat(2,3) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 2 2 2 )\n( 2 2 2 2 )\n( 2 2 2 2 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major array assignment
//=====================================================================================
{
test_ = "Row-major DynamicMatrix array assignment";
const int array[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
mat = array;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major copy assignment
//=====================================================================================
{
test_ = "Row-major DynamicMatrix copy assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 3UL );
checkNonZeros( mat2, 1UL, 3UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major DynamicMatrix copy assignment stress test";
typedef blaze::DynamicMatrix<int,blaze::rowMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::rowMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Row-major dense matrix assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix dense matrix assignment";
blaze::StaticMatrix<int,2UL,3UL,blaze::rowMajor> mat1;
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 3UL );
checkNonZeros( mat2, 1UL, 3UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix assignment stress test";
typedef blaze::DynamicMatrix<unsigned int,blaze::rowMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::rowMajor> mat1;
const unsigned int min( randmin );
const unsigned int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 3UL );
checkNonZeros( mat2, 1UL, 3UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix assignment stress test";
typedef blaze::DynamicMatrix<unsigned int,blaze::columnMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::rowMajor> mat1;
const unsigned int min( randmin );
const unsigned int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major sparse matrix assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = 3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 0 ||
mat2(1,0) != 3 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 0 )\n( 3 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix assignment stress test";
typedef blaze::CompressedMatrix<int,blaze::rowMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::rowMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = 3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 0 ||
mat2(1,0) != 3 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 0 )\n( 3 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix assignment stress test";
typedef blaze::CompressedMatrix<int,blaze::columnMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::rowMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major homogeneous assignment
//=====================================================================================
{
test_ = "Column-major DynamicMatrix homogeneous assigment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 4UL );
mat = 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkCapacity( mat, 12UL );
checkNonZeros( mat, 12UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
checkNonZeros( mat, 2UL, 3UL );
checkNonZeros( mat, 3UL, 3UL );
if( mat(0,0) != 2 || mat(0,1) != 2 || mat(0,2) != 2 || mat(0,3) != 2 ||
mat(1,0) != 2 || mat(1,1) != 2 || mat(1,2) != 2 || mat(1,3) != 2 ||
mat(2,0) != 2 || mat(2,1) != 2 || mat(2,2) != 2 || mat(2,3) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 2 2 2 )\n( 2 2 2 2 )\n( 2 2 2 2 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major array assignment
//=====================================================================================
{
test_ = "Column-major DynamicMatrix array initialization constructor";
const int array[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
mat = array;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major copy assignment
//=====================================================================================
{
test_ = "Column-major DynamicMatrix copy assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major DynamicMatrix copy assignment stress test";
typedef blaze::DynamicMatrix<int,blaze::columnMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::columnMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Column-major dense matrix assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix dense matrix assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix assignment stress test";
typedef blaze::DynamicMatrix<unsigned int,blaze::rowMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::columnMajor> mat1;
const unsigned int min( randmin );
const unsigned int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix assignment";
blaze::StaticMatrix<int,2UL,3UL,blaze::columnMajor> mat1;
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(0,2) = 3;
mat1(1,0) = 4;
mat1(1,1) = 5;
mat1(1,2) = 6;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 6UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 3 ||
mat2(1,0) != 4 || mat2(1,1) != 5 || mat2(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix assignment stress test";
typedef blaze::DynamicMatrix<unsigned int,blaze::columnMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::columnMajor> mat1;
const unsigned int min( randmin );
const unsigned int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major sparse matrix assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = 3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 1UL );
checkNonZeros( mat2, 2UL, 1UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 0 ||
mat2(1,0) != 3 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 0 )\n( 3 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix assignment stress test";
typedef blaze::CompressedMatrix<int,blaze::rowMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::columnMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = 3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2;
mat2 = mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 1UL );
checkNonZeros( mat2, 2UL, 1UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(0,2) != 0 ||
mat2(1,0) != 3 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 0 )\n( 3 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix assignment stress test";
typedef blaze::CompressedMatrix<int,blaze::columnMajor> RandomMatrixType;
blaze::DynamicMatrix<int,blaze::columnMajor> mat1;
const int min( randmin );
const int max( randmax );
for( size_t i=0UL; i<100UL; ++i )
{
const size_t rows ( blaze::rand<size_t>( 0UL, 10UL ) );
const size_t columns( blaze::rand<size_t>( 0UL, 10UL ) );
const RandomMatrixType mat2( blaze::rand<RandomMatrixType>( rows, columns, min, max ) );
mat1 = mat2;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL );
randomize( mat2 );
mat2 = mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix addition assignment operators.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the addition assignment operators of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testAddAssign()
{
//=====================================================================================
// Row-major dense matrix addition assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix dense matrix addition assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix addition assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major sparse matrix addition assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major dense matrix addition assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix dense matrix addition assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix addition assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major sparse matrix addition assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix addition assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix addition assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = -3;
mat1(1,2) = 4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 += mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix addition assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 += mat1;
if( mat1 != mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix subtraction assignment operators.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the subtraction assignment operators of the DynamicMatrix
// class template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testSubAssign()
{
//=====================================================================================
// Row-major dense matrix subtraction assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix dense matrix subtraction assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix subtraction assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix dense matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major sparse matrix subtraction assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix subtraction assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix subtraction assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major dense matrix subtraction assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix dense matrix subtraction assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix subtraction assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 0 );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix dense matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix dense matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major sparse matrix subtraction assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix subtraction assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix subtraction assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 2UL, 3UL, 4UL );
mat1(0,0) = -1;
mat1(0,1) = -2;
mat1(1,0) = 3;
mat1(1,2) = -4;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 3UL, 0 );
mat2(0,1) = -2;
mat2(0,2) = 6;
mat2(1,0) = 5;
mat2 -= mat1;
checkRows ( mat2, 2UL );
checkColumns ( mat2, 3UL );
checkCapacity( mat2, 6UL );
checkNonZeros( mat2, 4UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 0UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(0,2) != 6 ||
mat2(1,0) != 2 || mat2(1,1) != 0 || mat2(1,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 6 )\n( 2 0 4 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix subtraction assignment (lower)";
blaze::LowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix subtraction assignment (upper)";
blaze::UpperMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major/column-major DynamicMatrix sparse matrix subtraction assignment (diagonal)";
blaze::DiagonalMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> > mat1( 3UL );
randomize( mat1 );
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2 -= mat1;
if( mat1 != -mat2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n" << mat2 << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix multiplication assignment operators.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the multiplication assignment operators of the DynamicMatrix
// class template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testMultAssign()
{
//=====================================================================================
// Row-major dense matrix multiplication assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix dense matrix multiplication assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 3UL, 4UL, 0 );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix multiplication assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 3UL, 4UL, 0 );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major sparse matrix multiplication assignment
//=====================================================================================
{
test_ = "Row-major/row-major DynamicMatrix sparse matrix multiplication assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 3UL, 4UL, 5UL );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix multiplication assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 3UL, 4UL, 5UL );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 2UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major dense matrix multiplication assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix dense matrix multiplication assignment";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 3UL, 4UL, 0 );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 1UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 0UL );
checkNonZeros( mat2, 3UL, 3UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix dense matrix multiplication assignment";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 3UL, 4UL, 0 );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 1UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 0UL );
checkNonZeros( mat2, 3UL, 3UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major sparse matrix multiplication assignment
//=====================================================================================
{
test_ = "Column-major/row-major DynamicMatrix sparse matrix multiplication assignment";
blaze::CompressedMatrix<int,blaze::rowMajor> mat1( 3UL, 4UL, 5UL );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 1UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 0UL );
checkNonZeros( mat2, 3UL, 3UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major/column-major DynamicMatrix sparse matrix multiplication assignment";
blaze::CompressedMatrix<int,blaze::columnMajor> mat1( 3UL, 4UL, 5UL );
mat1(0,1) = 2;
mat1(1,0) = 1;
mat1(1,1) = 3;
mat1(1,3) = 4;
mat1(2,3) = 5;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 3UL, 3UL, 0 );
mat2(0,0) = 1;
mat2(0,2) = 2;
mat2(1,1) = 3;
mat2(2,0) = 4;
mat2(2,2) = 5;
mat2 *= mat1;
checkRows ( mat2, 3UL );
checkColumns ( mat2, 4UL );
checkNonZeros( mat2, 7UL );
checkNonZeros( mat2, 0UL, 1UL );
checkNonZeros( mat2, 1UL, 3UL );
checkNonZeros( mat2, 2UL, 0UL );
checkNonZeros( mat2, 3UL, 3UL );
if( mat2(0,0) != 0 || mat2(0,1) != 2 || mat2(0,2) != 0 || mat2(0,3) != 10 ||
mat2(1,0) != 3 || mat2(1,1) != 9 || mat2(1,2) != 0 || mat2(1,3) != 12 ||
mat2(2,0) != 0 || mat2(2,1) != 8 || mat2(2,2) != 0 || mat2(2,3) != 25 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 0 2 0 10 )\n( 3 9 0 12 )\n( 0 8 0 25 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of all DynamicMatrix (self-)scaling operations.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of all available ways to scale an instance of the DynamicMatrix
// class template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testScaling()
{
//=====================================================================================
// Row-major self-scaling (M*=s)
//=====================================================================================
{
test_ = "Row-major self-scaling (M*=s)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat *= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major self-scaling (M=M*s)
//=====================================================================================
{
test_ = "Row-major self-scaling (M=M*s)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat = mat * 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major self-scaling (M=s*M)
//=====================================================================================
{
test_ = "Row-major self-scaling (M=s*M)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat = 2 * mat;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major self-scaling (M/=s)
//=====================================================================================
{
test_ = "Row-major self-scaling (M/=s)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 2;
mat(2,0) = -4;
mat(2,2) = 6;
mat /= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 1 ||
mat(2,0) != -2 || mat(2,1) != 0 || mat(2,2) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 1 )\n( -2 0 3 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major self-scaling (M=M/s)
//=====================================================================================
{
test_ = "Row-major self-scaling (M=M/s)";
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 2;
mat(2,0) = -4;
mat(2,2) = 6;
mat = mat / 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 1 ||
mat(2,0) != -2 || mat(2,1) != 0 || mat(2,2) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 1 )\n( -2 0 3 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Row-major DynamicMatrix::scale()
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::scale() (int)";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 2UL );
mat(0,0) = 1;
mat(0,1) = 2;
mat(1,0) = 3;
mat(1,1) = 4;
mat(2,0) = 5;
mat(2,1) = 6;
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 ||
mat(1,0) != 3 || mat(1,1) != 4 ||
mat(2,0) != 5 || mat(2,1) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 )\n( 3 4 )\n( 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Integral scaling of the matrix
mat.scale( 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 2 || mat(0,1) != 4 ||
mat(1,0) != 6 || mat(1,1) != 8 ||
mat(2,0) != 10 || mat(2,1) != 12 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 4 )\n( 6 8 )\n( 10 12 )\n";
throw std::runtime_error( oss.str() );
}
// Floating point scaling of the matrix
mat.scale( 0.5 );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 ||
mat(1,0) != 3 || mat(1,1) != 4 ||
mat(2,0) != 5 || mat(2,1) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 )\n( 3 4 )\n( 5 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Row-major DynamicMatrix::scale() (complex)";
using blaze::complex;
blaze::DynamicMatrix<complex<float>,blaze::rowMajor> mat( 2UL, 2UL );
mat(0,0) = complex<float>( 1.0F, 0.0F );
mat(0,1) = complex<float>( 2.0F, 0.0F );
mat(1,0) = complex<float>( 3.0F, 0.0F );
mat(1,1) = complex<float>( 4.0F, 0.0F );
mat.scale( complex<float>( 3.0F, 0.0F ) );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 4UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
if( mat(0,0) != complex<float>( 3.0F, 0.0F ) || mat(0,1) != complex<float>( 6.0F, 0.0F ) ||
mat(1,0) != complex<float>( 9.0F, 0.0F ) || mat(1,1) != complex<float>( 12.0F, 0.0F ) ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( ( 3,0) ( 6,0)\n( 9,0) (12,0) )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major self-scaling (M*=s)
//=====================================================================================
{
test_ = "Column-major self-scaling (M*=s)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat *= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major self-scaling (M=M*s)
//=====================================================================================
{
test_ = "Column-major self-scaling (M=M*s)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat = mat * 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major self-scaling (M=s*M)
//=====================================================================================
{
test_ = "Column-major self-scaling (M=s*M)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 1;
mat(2,0) = -2;
mat(2,2) = 3;
mat = 2 * mat;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 2 ||
mat(2,0) != -4 || mat(2,1) != 0 || mat(2,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 2 )\n( -4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major self-scaling (M/=s)
//=====================================================================================
{
test_ = "Column-major self-scaling (M/=s)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 2;
mat(2,0) = -4;
mat(2,2) = 6;
mat /= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 1 ||
mat(2,0) != -2 || mat(2,1) != 0 || mat(2,2) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 1 )\n( -2 0 3 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major self-scaling (M=M/s)
//=====================================================================================
{
test_ = "Column-major self-scaling (M=M/s)";
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 3UL, 0 );
mat(1,2) = 2;
mat(2,0) = -4;
mat(2,2) = 6;
mat = mat / 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 1 ||
mat(2,0) != -2 || mat(2,1) != 0 || mat(2,2) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed self-scaling operation\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 1 )\n( -2 0 3 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major DynamicMatrix::scale()
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::scale() (int)";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 2UL );
mat(0,0) = 1;
mat(0,1) = 4;
mat(1,0) = 2;
mat(1,1) = 5;
mat(2,0) = 3;
mat(2,1) = 6;
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 4 ||
mat(1,0) != 2 || mat(1,1) != 5 ||
mat(2,0) != 3 || mat(2,1) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 4 )\n( 2 5 )\n( 3 6 )\n";
throw std::runtime_error( oss.str() );
}
// Integral scaling of the matrix
mat.scale( 2 );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 2 || mat(0,1) != 8 ||
mat(1,0) != 4 || mat(1,1) != 10 ||
mat(2,0) != 6 || mat(2,1) != 12 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 2 8 )\n( 4 10 )\n( 6 12 )\n";
throw std::runtime_error( oss.str() );
}
// Floating point scaling of the matrix
mat.scale( 0.5 );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 4 ||
mat(1,0) != 2 || mat(1,1) != 5 ||
mat(2,0) != 3 || mat(2,1) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 4 )\n( 2 5 )\n( 3 6 )\n";
throw std::runtime_error( oss.str() );
}
}
{
test_ = "Column-major DynamicMatrix::scale() (complex)";
using blaze::complex;
blaze::DynamicMatrix<complex<float>,blaze::columnMajor> mat( 2UL, 2UL );
mat(0,0) = complex<float>( 1.0F, 0.0F );
mat(0,1) = complex<float>( 2.0F, 0.0F );
mat(1,0) = complex<float>( 3.0F, 0.0F );
mat(1,1) = complex<float>( 4.0F, 0.0F );
mat.scale( complex<float>( 3.0F, 0.0F ) );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 4UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
if( mat(0,0) != complex<float>( 3.0F, 0.0F ) || mat(0,1) != complex<float>( 6.0F, 0.0F ) ||
mat(1,0) != complex<float>( 9.0F, 0.0F ) || mat(1,1) != complex<float>( 12.0F, 0.0F ) ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scale operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( ( 3,0) ( 6,0)\n( 9,0) (12,0) )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix function call operator.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of adding and accessing elements via the function call operator
// of the DynamicMatrix class template. In case an error is detected, a \a std::runtime_error
// exception is thrown.
*/
void ClassTest::testFunctionCall()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::operator()";
// Assignment to the element (2,1)
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 5UL, 0 );
mat(2,1) = 1;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 1UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(2,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 0 0 )\n( 0 0 0 0 0 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (1,4)
mat(1,4) = 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 2UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(1,4) != 2 || mat(2,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 0 0 )\n( 0 0 0 0 2 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (0,3)
mat(0,3) = 3;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(0,3) != 3 || mat(1,4) != 2 || mat(2,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (2,2)
mat(2,2) = 4;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,3) != 3 || mat(1,4) != 2 || mat(2,1) != 1 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 1 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Addition assignment to the element (2,1)
mat(2,1) += mat(0,3);
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,3) != 3 || mat(1,4) != 2 || mat(2,1) != 4 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Subtraction assignment to the element (1,0)
mat(1,0) -= mat(1,4);
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,3) != 3 || mat(1,0) != -2 || mat(1,4) != 2 || mat(2,1) != 4 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( -2 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Multiplication assignment to the element (0,3)
mat(0,3) *= -3;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,3) != -9 || mat(1,0) != -2 || mat(1,4) != 2 || mat(2,1) != 4 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 -3 0 )\n( -2 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Division assignment to the element (2,1)
mat(2,1) /= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,3) != -9 || mat(1,0) != -2 || mat(1,4) != 2 || mat(2,1) != 2 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 -3 0 )\n( -2 0 0 0 2 )\n( 0 2 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::operator()";
// Assignment to the element (2,1)
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 5UL, 0 );
mat(2,1) = 1;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 1UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 0UL );
checkNonZeros( mat, 3UL, 0UL );
checkNonZeros( mat, 4UL, 0UL );
if( mat(2,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 0 0 )\n( 0 0 0 0 0 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (1,4)
mat(1,4) = 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 2UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 0UL );
checkNonZeros( mat, 3UL, 0UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(2,1) != 1 || mat(1,4) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 0 0 )\n( 0 0 0 0 2 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (0,3)
mat(0,3) = 3;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 0UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(2,1) != 1 || mat(1,4) != 2 || mat(0,3) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 1 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Assignment to the element (2,2)
mat(2,2) = 4;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(2,1) != 1 || mat(1,4) != 2 || mat(0,3) != 3 || mat(2,2) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 1 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Addition assignment to the element (2,1)
mat(2,1) += mat(0,3);
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(2,1) != 4 || mat(2,2) != 4 || mat(0,3) != 3 || mat(1,4) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( 0 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Subtraction assignment to the element (1,0)
mat(1,0) -= mat(1,4);
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(1,0) != -2 || mat(2,1) != 4 || mat(2,2) != 4 || mat(0,3) != 3 || mat(1,4) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 3 0 )\n( -2 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Multiplication assignment to the element (0,3)
mat(0,3) *= -3;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(1,0) != -2 || mat(2,1) != 4 || mat(2,2) != 4 || mat(0,3) != -9 || mat(1,4) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 -9 0 )\n( -2 0 0 0 2 )\n( 0 4 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Division assignment to the element (2,1)
mat(2,1) /= 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 1UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 1UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 1UL );
if( mat(1,0) != -2 || mat(2,1) != 2 || mat(2,2) != 4 || mat(0,3) != -9 || mat(1,4) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Function call operator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 -9 0 )\n( -2 0 0 0 2 )\n( 0 2 4 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the DynamicMatrix iterator implementation.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the iterator implementation of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testIterator()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
typedef blaze::DynamicMatrix<int,blaze::rowMajor> MatrixType;
typedef MatrixType::Iterator Iterator;
typedef MatrixType::ConstIterator ConstIterator;
MatrixType mat( 3UL, 3UL, 0 );
mat(0,1) = 1;
mat(1,0) = -2;
mat(1,2) = -3;
mat(2,1) = 4;
mat(2,2) = 5;
// Testing the Iterator default constructor
{
test_ = "Row-major Iterator default constructor";
Iterator it = Iterator();
if( it != Iterator() ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator default constructor\n";
throw std::runtime_error( oss.str() );
}
}
// Testing the ConstIterator default constructor
{
test_ = "Row-major ConstIterator default constructor";
ConstIterator it = ConstIterator();
if( it != ConstIterator() ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator default constructor\n";
throw std::runtime_error( oss.str() );
}
}
// Testing conversion from Iterator to ConstIterator
{
test_ = "Row-major Iterator/ConstIterator conversion";
ConstIterator it( begin( mat, 1UL ) );
if( it == end( mat, 1UL ) || *it != -2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator conversion detected\n";
throw std::runtime_error( oss.str() );
}
}
// Counting the number of elements in 0th row via Iterator
{
test_ = "Row-major Iterator subtraction";
const size_t number( end( mat, 0UL ) - begin( mat, 0UL ) );
if( number != 3UL ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of elements detected\n"
<< " Details:\n"
<< " Number of elements : " << number << "\n"
<< " Expected number of elements: 3\n";
throw std::runtime_error( oss.str() );
}
}
// Counting the number of elements in 1st row via ConstIterator
{
test_ = "Row-major ConstIterator subtraction";
const size_t number( cend( mat, 1UL ) - cbegin( mat, 1UL ) );
if( number != 3UL ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of elements detected\n"
<< " Details:\n"
<< " Number of elements : " << number << "\n"
<< " Expected number of elements: 3\n";
throw std::runtime_error( oss.str() );
}
}
// Testing read-only access via ConstIterator
{
test_ = "Row-major read-only access via ConstIterator";
ConstIterator it ( cbegin( mat, 2UL ) );
ConstIterator end( cend( mat, 2UL ) );
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid initial iterator detected\n";
throw std::runtime_error( oss.str() );
}
++it;
if( it == end || *it != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator pre-increment failed\n";
throw std::runtime_error( oss.str() );
}
--it;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator pre-decrement failed\n";
throw std::runtime_error( oss.str() );
}
it++;
if( it == end || *it != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator post-increment failed\n";
throw std::runtime_error( oss.str() );
}
it--;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator post-decrement failed\n";
throw std::runtime_error( oss.str() );
}
it += 2UL;
if( it == end || *it != 5 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator addition assignment failed\n";
throw std::runtime_error( oss.str() );
}
it -= 2UL;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator subtraction assignment failed\n";
throw std::runtime_error( oss.str() );
}
it = it + 2UL;
if( it == end || *it != 5 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator/scalar addition failed\n";
throw std::runtime_error( oss.str() );
}
it = it - 2UL;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator/scalar subtraction failed\n";
throw std::runtime_error( oss.str() );
}
it = 3UL + it;
if( it != end ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scalar/iterator addition failed\n";
throw std::runtime_error( oss.str() );
}
}
// Testing assignment via Iterator
{
test_ = "Row-major assignment via Iterator";
int value = 7;
for( Iterator it=begin( mat, 2UL ); it!=end( mat, 2UL ); ++it ) {
*it = value++;
}
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 0 ||
mat(1,0) != -2 || mat(1,1) != 0 || mat(1,2) != -3 ||
mat(2,0) != 7 || mat(2,1) != 8 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 0 )\n( -2 0 -3 )\n( 7 8 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing addition assignment via Iterator
{
test_ = "Row-major addition assignment via Iterator";
int value = 4;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it += value++;
}
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 0 ||
mat(1,0) != 2 || mat(1,1) != 5 || mat(1,2) != 3 ||
mat(2,0) != 7 || mat(2,1) != 8 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 0 )\n( 2 5 3 )\n( 7 8 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing subtraction assignment via Iterator
{
test_ = "Row-major subtraction assignment via Iterator";
int value = 4;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it -= value++;
}
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 0 ||
mat(1,0) != -2 || mat(1,1) != 0 || mat(1,2) != -3 ||
mat(2,0) != 7 || mat(2,1) != 8 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 0 )\n( -2 0 -3 )\n( 7 8 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing multiplication assignment via Iterator
{
test_ = "Row-major multiplication assignment via Iterator";
int value = 2;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it *= value++;
}
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 0 ||
mat(1,0) != -4 || mat(1,1) != 0 || mat(1,2) != -12 ||
mat(2,0) != 7 || mat(2,1) != 8 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 0 )\n( -4 0 -12 )\n( 7 8 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing division assignment via Iterator
{
test_ = "Row-major division assignment via Iterator";
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it /= 2;
}
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 0 ||
mat(1,0) != -2 || mat(1,1) != 0 || mat(1,2) != -6 ||
mat(2,0) != 7 || mat(2,1) != 8 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Division assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 0 )\n( -2 0 -6 )\n( 7 8 9 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
typedef blaze::DynamicMatrix<int,blaze::columnMajor> MatrixType;
typedef MatrixType::Iterator Iterator;
typedef MatrixType::ConstIterator ConstIterator;
MatrixType mat( 3UL, 3UL, 0 );
mat(1,0) = 1;
mat(0,1) = -2;
mat(2,1) = -3;
mat(1,2) = 4;
mat(2,2) = 5;
// Testing the Iterator default constructor
{
test_ = "Column-major Iterator default constructor";
Iterator it = Iterator();
if( it != Iterator() ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator default constructor\n";
throw std::runtime_error( oss.str() );
}
}
// Testing the ConstIterator default constructor
{
test_ = "Column-major ConstIterator default constructor";
ConstIterator it = ConstIterator();
if( it != ConstIterator() ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator default constructor\n";
throw std::runtime_error( oss.str() );
}
}
// Testing conversion from Iterator to ConstIterator
{
test_ = "Column-major Iterator/ConstIterator conversion";
ConstIterator it( begin( mat, 1UL ) );
if( it == end( mat, 1UL ) || *it != -2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Failed iterator conversion detected\n";
throw std::runtime_error( oss.str() );
}
}
// Counting the number of elements in 0th column via Iterator
{
test_ = "Column-major Iterator subtraction";
const size_t number( end( mat, 0UL ) - begin( mat, 0UL ) );
if( number != 3UL ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of elements detected\n"
<< " Details:\n"
<< " Number of elements : " << number << "\n"
<< " Expected number of elements: 3\n";
throw std::runtime_error( oss.str() );
}
}
// Counting the number of elements in 1st row via ConstIterator
{
test_ = "Column-major ConstIterator subtraction";
const size_t number( cend( mat, 1UL ) - cbegin( mat, 1UL ) );
if( number != 3UL ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid number of elements detected\n"
<< " Details:\n"
<< " Number of elements : " << number << "\n"
<< " Expected number of elements: 3\n";
throw std::runtime_error( oss.str() );
}
}
// Testing read-only access via ConstIterator
{
test_ = "Column-major read-only access via ConstIterator";
ConstIterator it ( cbegin( mat, 2UL ) );
ConstIterator end( cend( mat, 2UL ) );
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid initial iterator detected\n";
throw std::runtime_error( oss.str() );
}
++it;
if( it == end || *it != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator pre-increment failed\n";
throw std::runtime_error( oss.str() );
}
--it;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator pre-decrement failed\n";
throw std::runtime_error( oss.str() );
}
it++;
if( it == end || *it != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator post-increment failed\n";
throw std::runtime_error( oss.str() );
}
it--;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator post-decrement failed\n";
throw std::runtime_error( oss.str() );
}
it += 2UL;
if( it == end || *it != 5 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator addition assignment failed\n";
throw std::runtime_error( oss.str() );
}
it -= 2UL;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator subtraction assignment failed\n";
throw std::runtime_error( oss.str() );
}
it = it + 2UL;
if( it == end || *it != 5 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator/scalar addition failed\n";
throw std::runtime_error( oss.str() );
}
it = it - 2UL;
if( it == end || *it != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Iterator/scalar subtraction failed\n";
throw std::runtime_error( oss.str() );
}
it = 3UL + it;
if( it != end ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Scalar/iterator addition failed\n";
throw std::runtime_error( oss.str() );
}
}
// Testing assignment via Iterator
{
test_ = "Column-major assignment via Iterator";
int value = 7;
for( Iterator it=begin( mat, 2UL ); it!=end( mat, 2UL ); ++it ) {
*it = value++;
}
if( mat(0,0) != 0 || mat(0,1) != -2 || mat(0,2) != 7 ||
mat(1,0) != 1 || mat(1,1) != 0 || mat(1,2) != 8 ||
mat(2,0) != 0 || mat(2,1) != -3 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 -2 7 )\n( 1 0 8 )\n( 0 -3 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing addition assignment via Iterator
{
test_ = "Column-major addition assignment via Iterator";
int value = 4;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it += value++;
}
if( mat(0,0) != 0 || mat(0,1) != 2 || mat(0,2) != 7 ||
mat(1,0) != 1 || mat(1,1) != 5 || mat(1,2) != 8 ||
mat(2,0) != 0 || mat(2,1) != 3 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Addition assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 2 7 )\n( 1 5 8 )\n( 0 3 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing subtraction assignment via Iterator
{
test_ = "Column-major subtraction assignment via Iterator";
int value = 4;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it -= value++;
}
if( mat(0,0) != 0 || mat(0,1) != -2 || mat(0,2) != 7 ||
mat(1,0) != 1 || mat(1,1) != 0 || mat(1,2) != 8 ||
mat(2,0) != 0 || mat(2,1) != -3 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Subtraction assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 -2 7 )\n( 1 0 8 )\n( 0 -3 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing multiplication assignment via Iterator
{
test_ = "Column-major multiplication assignment via Iterator";
int value = 2;
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it *= value++;
}
if( mat(0,0) != 0 || mat(0,1) != -4 || mat(0,2) != 7 ||
mat(1,0) != 1 || mat(1,1) != 0 || mat(1,2) != 8 ||
mat(2,0) != 0 || mat(2,1) != -12 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Multiplication assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 -2 7 )\n( 1 0 8 )\n( 0 -6 9 )\n";
throw std::runtime_error( oss.str() );
}
}
// Testing division assignment via Iterator
{
test_ = "Column-major division assignment via Iterator";
for( Iterator it=begin( mat, 1UL ); it!=end( mat, 1UL ); ++it ) {
*it /= 2;
}
if( mat(0,0) != 0 || mat(0,1) != -2 || mat(0,2) != 7 ||
mat(1,0) != 1 || mat(1,1) != 0 || mat(1,2) != 8 ||
mat(2,0) != 0 || mat(2,1) != -6 || mat(2,2) != 9 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Division assignment via iterator failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 -2 7 )\n( 1 0 8 )\n( 0 -6 9 )\n";
throw std::runtime_error( oss.str() );
}
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c nonZeros() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c nonZeros() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testNonZeros()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::nonZeros()";
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL, 0 );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 0UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 0UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL, 0 );
mat(0,1) = 1;
mat(0,2) = 2;
mat(1,1) = 3;
mat(1,2) = 0;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 1UL );
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 2 ||
mat(1,0) != 0 || mat(1,1) != 3 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 2 )\n( 0 3 0 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::nonZeros()";
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL, 0 );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 0UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 0UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL, 0 );
mat(0,1) = 1;
mat(0,2) = 2;
mat(1,1) = 3;
mat(1,2) = 0;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(0,0) != 0 || mat(0,1) != 1 || mat(0,2) != 2 ||
mat(1,0) != 0 || mat(1,1) != 3 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 1 2 )\n( 0 3 0 )\n";
throw std::runtime_error( oss.str() );
}
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c reset() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c reset() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testReset()
{
using blaze::reset;
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::reset()";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL );
mat(0,0) = 1;
mat(0,1) = 2;
mat(0,2) = 3;
mat(1,0) = 4;
mat(1,1) = 5;
mat(1,2) = 6;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting a single element
reset( mat(0,2) );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 0 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 0 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting row 1
reset( mat, 1UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 2UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 0UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 0 )\n( 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting the entire matrix
reset( mat );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 0UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 0UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::reset()";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL );
mat(0,0) = 1;
mat(0,1) = 2;
mat(0,2) = 3;
mat(1,0) = 4;
mat(1,1) = 5;
mat(1,2) = 6;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting a single element
reset( mat(0,2) );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 0 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 0 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting column 1
reset( mat, 1UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 3UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 4 || mat(1,1) != 0 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 0 )\n( 4 0 6 )\n";
throw std::runtime_error( oss.str() );
}
// Resetting the entire matrix
reset( mat );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 0UL );
checkNonZeros( mat, 0UL, 0UL );
checkNonZeros( mat, 1UL, 0UL );
checkNonZeros( mat, 2UL, 0UL );
if( mat(0,0) != 0 || mat(0,1) != 0 || mat(0,2) != 0 ||
mat(1,0) != 0 || mat(1,1) != 0 || mat(1,2) != 0 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Reset operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 0 0 0 )\n( 0 0 0 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c clear() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c clear() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testClear()
{
using blaze::clear;
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::clear()";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL );
mat(0,0) = 1;
mat(0,1) = 2;
mat(0,2) = 3;
mat(1,0) = 4;
mat(1,1) = 5;
mat(1,2) = 6;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Clearing a single element
clear( mat(0,2) );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 0 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Clear operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 0 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Clearing the matrix
clear( mat );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::clear()";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL );
mat(0,0) = 1;
mat(0,1) = 2;
mat(0,2) = 3;
mat(1,0) = 4;
mat(1,1) = 5;
mat(1,2) = 6;
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 6UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 3 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 3 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Clearing a single element
clear( mat(0,2) );
checkRows ( mat, 2UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 6UL );
checkNonZeros( mat, 5UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 1UL );
if( mat(0,0) != 1 || mat(0,1) != 2 || mat(0,2) != 0 ||
mat(1,0) != 4 || mat(1,1) != 5 || mat(1,2) != 6 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Clear operation failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 0 )\n( 4 5 6 )\n";
throw std::runtime_error( oss.str() );
}
// Clearing the matrix
clear( mat );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c resize() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c resize() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testResize()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::resize()";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Resizing to 0x3
mat.resize( 0UL, 3UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 0UL );
// Resizing to 5x0
mat.resize( 5UL, 0UL );
checkRows ( mat, 5UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Resizing to 2x1
mat.resize( 2UL, 1UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 1UL );
checkCapacity( mat, 2UL );
// Resizing to 3x2 and preserving the elements
mat(0,0) = 1;
mat(1,0) = 2;
mat.resize( 3UL, 2UL, true );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
if( mat(0,0) != 1 || mat(1,0) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Resizing the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 x )\n( 2 x )\n( x x )\n";
throw std::runtime_error( oss.str() );
}
// Resizing to 2x2 and preserving the elements
mat(0,1) = 3;
mat(1,1) = 4;
mat.resize( 2UL, 2UL, true );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 4UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 3 || mat(1,0) != 2 || mat(1,1) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Resizing the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 3 )\n( 2 4 )\n";
throw std::runtime_error( oss.str() );
}
// Resizing to 1x1
mat.resize( 1UL, 1UL );
checkRows ( mat, 1UL );
checkColumns ( mat, 1UL );
checkCapacity( mat, 1UL );
// Resizing to 0x0
mat.resize( 0UL, 0UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::resize()";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Resizing to 0x3
mat.resize( 0UL, 3UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 3UL );
checkNonZeros( mat, 0UL );
// Resizing to 5x0
mat.resize( 5UL, 0UL );
checkRows ( mat, 5UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Resizing to 2x1
mat.resize( 2UL, 1UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 1UL );
checkCapacity( mat, 2UL );
// Resizing to 3x2 and preserving the elements
mat(0,0) = 1;
mat(1,0) = 2;
mat.resize( 3UL, 2UL, true );
checkRows ( mat, 3UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 6UL );
if( mat(0,0) != 1 || mat(1,0) != 2 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Resizing the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 x )\n( 2 x )\n( x x )\n";
throw std::runtime_error( oss.str() );
}
// Resizing to 2x2 and preserving the elements
mat(0,1) = 3;
mat(1,1) = 4;
mat.resize( 2UL, 2UL, true );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 4UL );
checkNonZeros( mat, 4UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 3 || mat(1,0) != 2 || mat(1,1) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Resizing the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 3 )\n( 2 4 )\n";
throw std::runtime_error( oss.str() );
}
// Resizing to 1x1
mat.resize( 1UL, 1UL );
checkRows ( mat, 1UL );
checkColumns ( mat, 1UL );
checkCapacity( mat, 1UL );
// Resizing to 0x0
mat.resize( 0UL, 0UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c extend() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c extend() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testExtend()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::extend()";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Increasing the size of the matrix
mat.extend( 2UL, 2UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 3UL );
// Further increasing the size of the matrix and preserving the elements
mat(0,0) = 1;
mat(0,1) = 2;
mat(1,0) = 3;
mat(1,1) = 4;
mat.extend( 1UL, 1UL, true );
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 9UL );
if( mat(0,0) != 1 || mat(0,1) != 2 ||
mat(1,0) != 3 || mat(1,1) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Extending the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 x )\n( 3 4 x )\n( x x x )\n";
throw std::runtime_error( oss.str() );
}
// Further increasing the size of the matrix
mat.extend( 4UL, 10UL, false );
checkRows ( mat, 7UL );
checkColumns ( mat, 13UL );
checkCapacity( mat, 91UL );
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::extend()";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Increasing the size of the matrix
mat.extend( 2UL, 2UL );
checkRows ( mat, 2UL );
checkColumns ( mat, 2UL );
checkCapacity( mat, 3UL );
// Further increasing the size of the matrix and preserving the elements
mat(0,0) = 1;
mat(0,1) = 2;
mat(1,0) = 3;
mat(1,1) = 4;
mat.extend( 1UL, 1UL, true );
checkRows ( mat, 3UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 9UL );
if( mat(0,0) != 1 || mat(0,1) != 2 ||
mat(1,0) != 3 || mat(1,1) != 4 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Extending the matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 2 x )\n( 3 4 x )\n( x x x )\n";
throw std::runtime_error( oss.str() );
}
// Further increasing the size of the matrix
mat.extend( 4UL, 10UL, false );
checkRows ( mat, 7UL );
checkColumns ( mat, 13UL );
checkCapacity( mat, 91UL );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c reserve() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c reserve() member function of the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testReserve()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix::reserve()";
// Initialization check
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Increasing the capacity of the matrix
mat.reserve( 10UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkCapacity( mat, 10UL );
checkNonZeros( mat, 0UL );
// Further increasing the capacity of the matrix
mat.reserve( 20UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkCapacity( mat, 20UL );
checkNonZeros( mat, 0UL );
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix::reserve()";
// Initialization check
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkNonZeros( mat, 0UL );
// Increasing the capacity of the matrix
mat.reserve( 10UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkCapacity( mat, 10UL );
checkNonZeros( mat, 0UL );
// Further increasing the capacity of the matrix
mat.reserve( 20UL );
checkRows ( mat, 0UL );
checkColumns ( mat, 0UL );
checkCapacity( mat, 20UL );
checkNonZeros( mat, 0UL );
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c transpose() member function of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c transpose() member function of the DynamicMatrix
// class template. Additionally, it performs a test of self-transpose via the \c trans()
// function. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testTranspose()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major self-transpose via DynamicMatrix::transpose()";
// Self-transpose of a 3x5 matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 5UL, 0 );
mat(0,0) = 1;
mat(0,2) = 2;
mat(0,4) = 3;
mat(1,1) = 4;
mat(1,3) = 5;
mat(2,0) = 6;
mat(2,2) = 7;
mat(2,4) = 8;
mat.transpose();
checkRows ( mat, 5UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 6 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 ||
mat(2,0) != 2 || mat(2,1) != 0 || mat(2,2) != 7 ||
mat(3,0) != 0 || mat(3,1) != 5 || mat(3,2) != 0 ||
mat(4,0) != 3 || mat(4,1) != 0 || mat(4,2) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 6 )\n( 0 4 0 )\n( 2 0 7 )\n( 0 5 0 )\n( 3 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
// Self-transpose of a 5x3 matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 5UL, 3UL, 0 );
mat(0,0) = 1;
mat(0,2) = 6;
mat(1,1) = 4;
mat(2,0) = 2;
mat(2,2) = 7;
mat(3,1) = 5;
mat(4,0) = 3;
mat(4,2) = 8;
mat.transpose();
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 2 || mat(0,3) != 0 || mat(0,4) != 3 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 || mat(1,3) != 5 || mat(1,4) != 0 ||
mat(2,0) != 6 || mat(2,1) != 0 || mat(2,2) != 7 || mat(2,3) != 0 || mat(2,4) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 2 0 3 )\n( 0 4 0 5 0 )\n( 6 0 7 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Row-major self-transpose via trans()";
// Self-transpose of a 3x5 matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 5UL, 0 );
mat(0,0) = 1;
mat(0,2) = 2;
mat(0,4) = 3;
mat(1,1) = 4;
mat(1,3) = 5;
mat(2,0) = 6;
mat(2,2) = 7;
mat(2,4) = 8;
mat = trans( mat );
checkRows ( mat, 5UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 6 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 ||
mat(2,0) != 2 || mat(2,1) != 0 || mat(2,2) != 7 ||
mat(3,0) != 0 || mat(3,1) != 5 || mat(3,2) != 0 ||
mat(4,0) != 3 || mat(4,1) != 0 || mat(4,2) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 6 )\n( 0 4 0 )\n( 2 0 7 )\n( 0 5 0 )\n( 3 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
// Self-transpose of a 5x3 matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 5UL, 3UL, 0 );
mat(0,0) = 1;
mat(0,2) = 6;
mat(1,1) = 4;
mat(2,0) = 2;
mat(2,2) = 7;
mat(3,1) = 5;
mat(4,0) = 3;
mat(4,2) = 8;
mat = trans( mat );
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 2 || mat(0,3) != 0 || mat(0,4) != 3 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 || mat(1,3) != 5 || mat(1,4) != 0 ||
mat(2,0) != 6 || mat(2,1) != 0 || mat(2,2) != 7 || mat(2,3) != 0 || mat(2,4) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 2 0 3 )\n( 0 4 0 5 0 )\n( 6 0 7 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major self-transpose via DynamicMatrix::transpose()";
// Self-transpose of a 3x5 matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 5UL, 0 );
mat(0,0) = 1;
mat(0,2) = 2;
mat(0,4) = 3;
mat(1,1) = 4;
mat(1,3) = 5;
mat(2,0) = 6;
mat(2,2) = 7;
mat(2,4) = 8;
mat.transpose();
checkRows ( mat, 5UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 6 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 ||
mat(2,0) != 2 || mat(2,1) != 0 || mat(2,2) != 7 ||
mat(3,0) != 0 || mat(3,1) != 5 || mat(3,2) != 0 ||
mat(4,0) != 3 || mat(4,1) != 0 || mat(4,2) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 6 )\n( 0 4 0 )\n( 2 0 7 )\n( 0 5 0 )\n( 3 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
// Self-transpose of a 5x3 matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 5UL, 3UL, 0 );
mat(0,0) = 1;
mat(0,2) = 6;
mat(1,1) = 4;
mat(2,0) = 2;
mat(2,2) = 7;
mat(3,1) = 5;
mat(4,0) = 3;
mat(4,2) = 8;
mat.transpose();
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 2 || mat(0,3) != 0 || mat(0,4) != 3 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 || mat(1,3) != 5 || mat(1,4) != 0 ||
mat(2,0) != 6 || mat(2,1) != 0 || mat(2,2) != 7 || mat(2,3) != 0 || mat(2,4) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 2 0 3 )\n( 0 4 0 5 0 )\n( 6 0 7 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
}
{
test_ = "Column-major self-transpose via trans()";
// Self-transpose of a 3x5 matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 5UL, 0 );
mat(0,0) = 1;
mat(0,2) = 2;
mat(0,4) = 3;
mat(1,1) = 4;
mat(1,3) = 5;
mat(2,0) = 6;
mat(2,2) = 7;
mat(2,4) = 8;
mat = trans( mat );
checkRows ( mat, 5UL );
checkColumns ( mat, 3UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 3UL );
checkNonZeros( mat, 1UL, 2UL );
checkNonZeros( mat, 2UL, 3UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 6 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 ||
mat(2,0) != 2 || mat(2,1) != 0 || mat(2,2) != 7 ||
mat(3,0) != 0 || mat(3,1) != 5 || mat(3,2) != 0 ||
mat(4,0) != 3 || mat(4,1) != 0 || mat(4,2) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 6 )\n( 0 4 0 )\n( 2 0 7 )\n( 0 5 0 )\n( 3 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
// Self-transpose of a 5x3 matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 5UL, 3UL, 0 );
mat(0,0) = 1;
mat(0,2) = 6;
mat(1,1) = 4;
mat(2,0) = 2;
mat(2,2) = 7;
mat(3,1) = 5;
mat(4,0) = 3;
mat(4,2) = 8;
mat = trans( mat );
checkRows ( mat, 3UL );
checkColumns ( mat, 5UL );
checkCapacity( mat, 15UL );
checkNonZeros( mat, 8UL );
checkNonZeros( mat, 0UL, 2UL );
checkNonZeros( mat, 1UL, 1UL );
checkNonZeros( mat, 2UL, 2UL );
checkNonZeros( mat, 3UL, 1UL );
checkNonZeros( mat, 4UL, 2UL );
if( mat(0,0) != 1 || mat(0,1) != 0 || mat(0,2) != 2 || mat(0,3) != 0 || mat(0,4) != 3 ||
mat(1,0) != 0 || mat(1,1) != 4 || mat(1,2) != 0 || mat(1,3) != 5 || mat(1,4) != 0 ||
mat(2,0) != 6 || mat(2,1) != 0 || mat(2,2) != 7 || mat(2,3) != 0 || mat(2,4) != 8 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Initialization failed\n"
<< " Details:\n"
<< " Result:\n" << mat << "\n"
<< " Expected result:\n( 1 0 2 0 3 )\n( 0 4 0 5 0 )\n( 6 0 7 0 8 )\n";
throw std::runtime_error( oss.str() );
}
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c swap() functionality of the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c swap() function of the DynamicMatrix class template.
// In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testSwap()
{
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major DynamicMatrix swap";
blaze::DynamicMatrix<int,blaze::rowMajor> mat1( 2UL, 2UL );
mat1(0,0) = 1;
mat1(0,1) = 2;
mat1(1,0) = 0;
mat1(1,1) = 3;
blaze::DynamicMatrix<int,blaze::rowMajor> mat2( 2UL, 2UL );
mat2(0,0) = 4;
mat2(0,1) = 3;
mat2(1,0) = 2;
mat2(1,1) = 1;
swap( mat1, mat2 );
checkRows ( mat1, 2UL );
checkColumns ( mat1, 2UL );
checkCapacity( mat1, 4UL );
checkNonZeros( mat1, 4UL );
checkNonZeros( mat1, 0UL, 2UL );
checkNonZeros( mat1, 1UL, 2UL );
if( mat1(0,0) != 4 || mat1(0,1) != 3 || mat1(1,0) != 2 || mat1(1,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Swapping the first matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n( 4 3 )\n( 2 1 )\n";
throw std::runtime_error( oss.str() );
}
checkRows ( mat2, 2UL );
checkColumns ( mat2, 2UL );
checkCapacity( mat2, 4UL );
checkNonZeros( mat2, 3UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 1UL );
if( mat2(0,0) != 1 || mat2(0,1) != 2 || mat2(1,0) != 0 || mat2(1,1) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Swapping the second matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 2 )\n( 0 3 )\n";
throw std::runtime_error( oss.str() );
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major DynamicMatrix swap";
blaze::DynamicMatrix<int,blaze::columnMajor> mat1( 2UL, 2UL );
mat1(0,0) = 1;
mat1(0,1) = 0;
mat1(1,0) = 2;
mat1(1,1) = 3;
blaze::DynamicMatrix<int,blaze::columnMajor> mat2( 2UL, 2UL );
mat2(0,0) = 4;
mat2(0,1) = 2;
mat2(1,0) = 3;
mat2(1,1) = 1;
swap( mat1, mat2 );
checkRows ( mat1, 2UL );
checkColumns ( mat1, 2UL );
checkCapacity( mat1, 4UL );
checkNonZeros( mat1, 4UL );
checkNonZeros( mat1, 0UL, 2UL );
checkNonZeros( mat1, 1UL, 2UL );
if( mat1(0,0) != 4 || mat1(0,1) != 2 || mat1(1,0) != 3 || mat1(1,1) != 1 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Swapping the first matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat1 << "\n"
<< " Expected result:\n( 4 2 )\n( 3 1 )\n";
throw std::runtime_error( oss.str() );
}
checkRows ( mat2, 2UL );
checkColumns ( mat2, 2UL );
checkCapacity( mat2, 4UL );
checkNonZeros( mat2, 3UL );
checkNonZeros( mat2, 0UL, 2UL );
checkNonZeros( mat2, 1UL, 1UL );
if( mat2(0,0) != 1 || mat2(0,1) != 0 || mat2(1,0) != 2 || mat2(1,1) != 3 ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Swapping the second matrix failed\n"
<< " Details:\n"
<< " Result:\n" << mat2 << "\n"
<< " Expected result:\n( 1 0 )\n( 2 3 )\n";
throw std::runtime_error( oss.str() );
}
}
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Test of the \c isDefault() function with the DynamicMatrix class template.
//
// \return void
// \exception std::runtime_error Error detected.
//
// This function performs a test of the \c isDefault() function with the DynamicMatrix class
// template. In case an error is detected, a \a std::runtime_error exception is thrown.
*/
void ClassTest::testIsDefault()
{
using blaze::isDefault;
//=====================================================================================
// Row-major matrix tests
//=====================================================================================
{
test_ = "Row-major isDefault() function";
// isDefault with 0x0 matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat;
if( isDefault( mat ) != true ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
// isDefault with default matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 2UL, 3UL, 0 );
if( isDefault( mat(0,1) ) != true ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix element: " << mat(0,1) << "\n";
throw std::runtime_error( oss.str() );
}
if( isDefault( mat ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
// isDefault with non-default matrix
{
blaze::DynamicMatrix<int,blaze::rowMajor> mat( 3UL, 2UL, 0 );
mat(0,1) = 1;
if( isDefault( mat(0,1) ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix element: " << mat(0,1) << "\n";
throw std::runtime_error( oss.str() );
}
if( isDefault( mat ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
}
//=====================================================================================
// Column-major matrix tests
//=====================================================================================
{
test_ = "Column-major isDefault() function";
// isDefault with 0x0 matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat;
if( isDefault( mat ) != true ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
// isDefault with default matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 2UL, 3UL, 0 );
if( isDefault( mat(0,1) ) != true ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix element: " << mat(0,1) << "\n";
throw std::runtime_error( oss.str() );
}
if( isDefault( mat ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
// isDefault with non-default matrix
{
blaze::DynamicMatrix<int,blaze::columnMajor> mat( 3UL, 2UL, 0 );
mat(1,0) = 1;
if( isDefault( mat(1,0) ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix element: " << mat(1,0) << "\n";
throw std::runtime_error( oss.str() );
}
if( isDefault( mat ) != false ) {
std::ostringstream oss;
oss << " Test: " << test_ << "\n"
<< " Error: Invalid isDefault evaluation\n"
<< " Details:\n"
<< " Matrix:\n" << mat << "\n";
throw std::runtime_error( oss.str() );
}
}
}
}
//*************************************************************************************************
} // namespace dynamicmatrix
} // namespace mathtest
} // namespace blazetest
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running DynamicMatrix class test..." << std::endl;
try
{
RUN_DYNAMICMATRIX_CLASS_TEST;
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during DynamicMatrix class test:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
|
[
"_@adityaramesh.com"
] |
_@adityaramesh.com
|
42659f18c2b1d270ee301fff5a8fd1590bba123d
|
f354176c587e6c100b5198d33ed778c483fcd325
|
/uCXpresso.BLE/inc/class/pwm.h
|
97deebf88b7d8001fcde8842f7a95c268f051c39
|
[] |
no_license
|
chenjuichi/nano11uxx
|
1125e8a1bf3ad7889049c6ad481160100e6a7ce8
|
9242967cad6ef41fe2a472387afc6d407b91d5c1
|
refs/heads/master
| 2021-01-17T21:39:14.057448
| 2015-01-17T03:45:26
| 2015-01-17T03:45:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,507
|
h
|
/*
===============================================================================
Name : pwm.h
Author : uCXpresso
Version : v1.0.2
Date : 2014/5/19
Copyright : Copyright (C) www.embeda.com.tw
Description : PWM class
===============================================================================
History
---------+---------+--------------------------------------------+-------------
DATE | VERSION | DESCRIPTIONS | By
---------+---------+--------------------------------------------+-------------
2014/1/1 v1.0.0 First Edition for nano11Uxx Jason
2014/5/6 v1.0.1 Fully LOW level for duty-cycle zero. Jason
2014/5/19 v1.0.2 Add PWM Group Jason
===============================================================================
*/
#ifndef PWM_H_
#define PWM_H_
#include "class/peripheral.h"
/**PWM Channels
* \ingroup Enumerations
*/
typedef enum {
PWM1 = 1, ///< PWM1 (P20)
PWM2, ///< PWM2 (P21)
PWM3, ///< PWM3 (P22)
PWM4, ///< PWM4 (P23)
}PWM_CH_T;
/**PWM GROUP
* \ingroup Enumerations
*/
typedef enum {
PG_ALL = 0, ///< All group for PWM1, PWM2, PWM3, PWM4
PG_1, ///< PWM Group 1 for PWM1 and PWM2
PG_2 ///< PWM Group 2 for PWM3 and PWM4
}PWM_GROUP_T;
/*! \def Max frequency
*/
#define MAX_PWM_FREQUENCY KHZ(20) // 20KHz (period time: 50us +/- 5us)
/**Pulse-width modulated output.
* \class CPwm pwm.h "class/pwm.h"
* \ingroup Peripherals
*/
class CPwm: public CPeripheral {
public:
/**Constructs a CPwm object to connect to the specified PWM channel.
* \param ch ... are PWM_CH_T to specified a PWM channel to the object.
*
* \code
* Example:
* CPwm::period(0.02); // Set global PWM period time = 20ms
*
* CPwm servo(PWM1); // create a servo objecj
* servo.dutyCycle(0.8); // set servo object to 80% dutyCycle
* servo.enable(); // begin the servo PWM output
* \endcode
*/
CPwm(PWM_CH_T ch);
/**enable the PWM channel output
*/
virtual void enable();
/**disable of the PWM channel output
*/
virtual void disable();
/**Set the output duty-cycle, specified as a percentage (float)
*/
virtual void dutyCycle(float percentage); // 1.0=100% 0.5=50% ...
/**Set the PWM pulse-width, specified in seconds (float)
*/
virtual void pulseWidth(float sec); // 0.5=500ms 0.0005=500us ...
/*Return the current output duty-cycle setting, measured as a percentage (float)
*/
virtual float read();
/**Set output duty-cycle; inline function call to the member dutyCycle()
*/
inline void write(float percentage) {
dutyCycle(percentage);
}
/**A shorthand to call the member pulseWidth()
*/
inline void operator = (float sec) {
pulseWidth(sec);
}
/*A shorthand to retrieve the current output duty-cycle.
*/
inline operator float() {
return read();
}
/**A static member function.
* Set the PWM MAIN period (or frequency), specified in seconds (float).
*/
static void period(float sec, PWM_GROUP_T pg=PG_ALL);
static void frequency(uint32_t f, PWM_GROUP_T pg=PG_ALL);
/**inline functions for ARDUINO
*/
inline void begin() { enable(); }
inline void end() { disable(); }
/*! \cond PRIVATE */
virtual ~CPwm();
protected:
uint32_t m_flag;
uint32_t m_nPeriod;
uint8_t m_timer_num;
uint8_t m_match_num;
uint8_t m_ch;
void pin_func(bool pwm);
/*! \endcond */
};
#endif /* PWM_H_ */
|
[
"jason@embeda.com.tw"
] |
jason@embeda.com.tw
|
a13ae33f79a478bce7ff513ed2d0f47a8fe12b59
|
cf8ddfc720bf6451c4ef4fa01684327431db1919
|
/SDK/ARKSurvivalEvolved_DinoTamedInventoryComponent_Arthro_functions.cpp
|
f3386ea17836528cd75ae2539c7d95079a27ac82
|
[
"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
| 1,203
|
cpp
|
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_DinoTamedInventoryComponent_Arthro_parameters.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Functions
//---------------------------------------------------------------------------
// Function DinoTamedInventoryComponent_Arthro.DinoTamedInventoryComponent_Arthro_C.ExecuteUbergraph_DinoTamedInventoryComponent_Arthro
// ()
// Parameters:
// int EntryPoint (Parm, ZeroConstructor, IsPlainOldData)
void UDinoTamedInventoryComponent_Arthro_C::ExecuteUbergraph_DinoTamedInventoryComponent_Arthro(int EntryPoint)
{
static auto fn = UObject::FindObject<UFunction>("Function DinoTamedInventoryComponent_Arthro.DinoTamedInventoryComponent_Arthro_C.ExecuteUbergraph_DinoTamedInventoryComponent_Arthro");
UDinoTamedInventoryComponent_Arthro_C_ExecuteUbergraph_DinoTamedInventoryComponent_Arthro_Params params;
params.EntryPoint = EntryPoint;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
[
"sergey.2bite@gmail.com"
] |
sergey.2bite@gmail.com
|
fc937c33207b3a766a086ee3e70339ecd2b8a6b2
|
6c4897435128a2aeea0afb7b305d5d228422a644
|
/MyGui/build/debug/moc_dialog.cpp
|
63026c2e1c4bf3049b45be232efb6cf87a925115
|
[] |
no_license
|
jfdzar/QtTutorial
|
f8e75340fdeb4fa7a090e038833d024d735c2f06
|
b1daa0bdfef1b97715de2dd8619762663884d6bb
|
refs/heads/master
| 2021-01-22T05:16:37.882329
| 2015-09-14T20:33:32
| 2015-09-14T20:33:32
| 30,668,109
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,499
|
cpp
|
/****************************************************************************
** Meta object code from reading C++ file 'dialog.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.3.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../dialog.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'dialog.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.3.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_Dialog_t {
QByteArrayData data[1];
char stringdata[7];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_Dialog_t, stringdata) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_Dialog_t qt_meta_stringdata_Dialog = {
{
QT_MOC_LITERAL(0, 0, 6)
},
"Dialog"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_Dialog[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void Dialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject Dialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_Dialog.data,
qt_meta_data_Dialog, qt_static_metacall, 0, 0}
};
const QMetaObject *Dialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *Dialog::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Dialog.stringdata))
return static_cast<void*>(const_cast< Dialog*>(this));
return QDialog::qt_metacast(_clname);
}
int Dialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
QT_END_MOC_NAMESPACE
|
[
"jfdzar@gmail.com"
] |
jfdzar@gmail.com
|
8045c9c4fc3bee854a83ea54ef778dcb8c6ebbdf
|
311525f7de84975434f55c00b545ccf7fe3dcce6
|
/online/cf/567/chunga.cpp
|
984a1712a81580634aaca934bb102e9d7b9ac47f
|
[] |
no_license
|
fishy15/competitive_programming
|
60f485bc4022e41efb0b7d2e12d094213d074f07
|
d9bca2e6bea704f2bfe5a30e08aa0788be6a8022
|
refs/heads/master
| 2023-08-16T02:05:08.270992
| 2023-08-06T01:00:21
| 2023-08-06T01:00:21
| 171,861,737
| 29
| 5
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 760
|
cpp
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>
#define ll long long
#define ld long double
#define eps 1e-8
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f
// change if necessary
#define MAXN 1000000
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
ll x, y, z;
cin >> x >> y >> z;
ll ans = x / z + y / z;
x %= z;
y %= z;
if (z - max(x, y) <= min(x, y)) {
cout << ans + 1 << ' ' << z - max(x, y) << '\n';
} else {
cout << ans << ' ' << 0 << '\n';
}
return 0;
}
|
[
"aaryan.prakash3.14@gmail.com"
] |
aaryan.prakash3.14@gmail.com
|
8ca4bafba1d56ed583e53c5ed6b6261ec3f6323c
|
9386acb33a6c522ebbb79c4447b61b191860a87b
|
/include/sk/util/Items.hxx
|
0cc7924e25b62774f6dff9d594177e092b8190de
|
[
"MIT"
] |
permissive
|
stemkit-collection/stemkit-cpp
|
878fa2c74272127a8cf3ff9659ec9e39034bb4d8
|
dfa77d831f49916ba6d134f407a4dcd0983328f6
|
refs/heads/master
| 2020-04-19T08:58:17.402275
| 2019-02-04T20:16:47
| 2019-02-04T20:16:47
| 168,095,623
| 4
| 0
|
MIT
| 2019-01-30T04:49:32
| 2019-01-29T05:35:00
|
HTML
|
UTF-8
|
C++
| false
| false
| 2,401
|
hxx
|
/* vim: set sw=2:
* Copyright (c) 2010, Gennady Bystritsky <bystr@mac.com>
*
* Distributed under the MIT Licence.
* This is free software. See 'LICENSE' for details.
* You must read and accept the license prior to use.
*
* Author: Gennady Bystritsky
*/
#ifndef _SK_UTIL_ITEMS_HXX_
#define _SK_UTIL_ITEMS_HXX_
#include <sk/util/ArrayList.hxx>
#include <sk/util/String.h>
#include <sk/util/Mapper.h>
namespace sk {
namespace util {
template<typename T>
class Items
: public sk::util::ArrayList<T>::Copying
{
public:
Items();
Items(const sk::util::Items<T>& other);
explicit Items(const T& item);
virtual ~Items();
const T& first() const;
const T& last() const;
const T pop();
const T shift();
const sk::util::Items<T> slice(int start, int end) const;
const sk::util::Items<T> slice(int end) const;
const sk::util::Items<T> map(const sk::util::Mapper<const T>& mapper) const;
const sk::util::String join(const sk::util::String& prologue, const sk::util::String& separator) const;
const sk::util::String join(const sk::util::String& prologue, const sk::util::String& separator, const sk::util::String& epilogue) const;
const sk::util::String join(const sk::util::String& prologue, const sk::util::String& separator, const sk::util::Mapper<const T, const sk::util::String>& mapper) const;
const sk::util::String join(const sk::util::String& prologue, const sk::util::String& separator, const sk::util::String& epilogue, const sk::util::Mapper<const T, const sk::util::String>& mapper) const;
using sk::util::ArrayList<T>::Copying::join;
sk::util::Items<T> operator + (const T& item) const;
sk::util::Items<T> operator + (const sk::util::Items<T>& other) const;
sk::util::Items<T>& operator = (const sk::util::Items<T>& other);
sk::util::Items<T>& operator << (const T& item);
sk::util::Items<T>& operator << (const sk::util::Items<T>& other);
// sk::util::Object re-implementation.
const sk::util::Class getClass() const;
const sk::util::String toString() const;
const sk::util::String inspect() const;
private:
typedef typename sk::util::ArrayList<T>::Copying super_t;
struct Propagator;
};
}
}
#endif /* _SK_UTIL_ITEMS_HXX_ */
|
[
"gennady@bystr.com"
] |
gennady@bystr.com
|
1d66d50644e184a39804184270680e6b04418fda
|
82751ca8cd84cf2b2fbac850e33c162e9ec77960
|
/fish/mbed/LPCExpress/robotic_fish_6/ros_lib/control_msgs/JointTolerance.h
|
eefab4b996461c54817f8cd0d9ab69509f9225be
|
[
"MIT"
] |
permissive
|
arizonat/softroboticfish7
|
c4b1b3a866d42c04f7785088010ba0d6a173dc79
|
777fd37ff817e131106392a85f65c700198b0197
|
refs/heads/master
| 2022-12-13T02:59:16.290695
| 2022-11-28T21:01:03
| 2022-11-28T21:01:03
| 255,442,610
| 2
| 0
|
MIT
| 2020-04-13T21:11:31
| 2020-04-13T21:11:30
| null |
UTF-8
|
C++
| false
| false
| 6,084
|
h
|
#ifndef _ROS_control_msgs_JointTolerance_h
#define _ROS_control_msgs_JointTolerance_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace control_msgs
{
class JointTolerance : public ros::Msg
{
public:
const char* name;
double position;
double velocity;
double acceleration;
JointTolerance():
name(""),
position(0),
velocity(0),
acceleration(0)
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
uint32_t length_name = strlen(this->name);
memcpy(outbuffer + offset, &length_name, sizeof(uint32_t));
offset += 4;
memcpy(outbuffer + offset, this->name, length_name);
offset += length_name;
union {
double real;
uint64_t base;
} u_position;
u_position.real = this->position;
*(outbuffer + offset + 0) = (u_position.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_position.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_position.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_position.base >> (8 * 3)) & 0xFF;
*(outbuffer + offset + 4) = (u_position.base >> (8 * 4)) & 0xFF;
*(outbuffer + offset + 5) = (u_position.base >> (8 * 5)) & 0xFF;
*(outbuffer + offset + 6) = (u_position.base >> (8 * 6)) & 0xFF;
*(outbuffer + offset + 7) = (u_position.base >> (8 * 7)) & 0xFF;
offset += sizeof(this->position);
union {
double real;
uint64_t base;
} u_velocity;
u_velocity.real = this->velocity;
*(outbuffer + offset + 0) = (u_velocity.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_velocity.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_velocity.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_velocity.base >> (8 * 3)) & 0xFF;
*(outbuffer + offset + 4) = (u_velocity.base >> (8 * 4)) & 0xFF;
*(outbuffer + offset + 5) = (u_velocity.base >> (8 * 5)) & 0xFF;
*(outbuffer + offset + 6) = (u_velocity.base >> (8 * 6)) & 0xFF;
*(outbuffer + offset + 7) = (u_velocity.base >> (8 * 7)) & 0xFF;
offset += sizeof(this->velocity);
union {
double real;
uint64_t base;
} u_acceleration;
u_acceleration.real = this->acceleration;
*(outbuffer + offset + 0) = (u_acceleration.base >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (u_acceleration.base >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (u_acceleration.base >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (u_acceleration.base >> (8 * 3)) & 0xFF;
*(outbuffer + offset + 4) = (u_acceleration.base >> (8 * 4)) & 0xFF;
*(outbuffer + offset + 5) = (u_acceleration.base >> (8 * 5)) & 0xFF;
*(outbuffer + offset + 6) = (u_acceleration.base >> (8 * 6)) & 0xFF;
*(outbuffer + offset + 7) = (u_acceleration.base >> (8 * 7)) & 0xFF;
offset += sizeof(this->acceleration);
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t length_name;
memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t));
offset += 4;
for(unsigned int k= offset; k< offset+length_name; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_name-1]=0;
this->name = (char *)(inbuffer + offset-1);
offset += length_name;
union {
double real;
uint64_t base;
} u_position;
u_position.base = 0;
u_position.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
u_position.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
this->position = u_position.real;
offset += sizeof(this->position);
union {
double real;
uint64_t base;
} u_velocity;
u_velocity.base = 0;
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
u_velocity.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
this->velocity = u_velocity.real;
offset += sizeof(this->velocity);
union {
double real;
uint64_t base;
} u_acceleration;
u_acceleration.base = 0;
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
u_acceleration.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
this->acceleration = u_acceleration.real;
offset += sizeof(this->acceleration);
return offset;
}
const char * getType(){ return "control_msgs/JointTolerance"; };
const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; };
};
}
#endif
|
[
"cyndiac@mit.edu"
] |
cyndiac@mit.edu
|
b09acf9617033a841a88b238c8c4b315bd8930fa
|
4183b737d053f17a6e8a35b0e776074d03112598
|
/.vscode/cquery_cached_index/d@@vex prog@pros projects@project serpentine/src@display.cpp
|
0eb5a9cc0795f44d8234e1dcd82badece48a901b
|
[] |
no_license
|
bid-p/Project-Serpentine
|
633fe16fa3185862597c6e3d7ffdf3a800bd5e11
|
7530989ddf71f745e120762340800ee5af677c7d
|
refs/heads/master
| 2021-10-18T04:42:34.452246
| 2019-02-13T22:34:54
| 2019-02-13T22:34:54
| 155,278,086
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 16,013
|
cpp
|
#include "main.h"
LV_IMG_DECLARE(fieldResizedIMG);
LV_IMG_DECLARE(redNearIMG);
bool readyBtnExists = false;
lv_obj_t *titleLabel = lv_label_create(lv_scr_act(), NULL);
lv_obj_t *redNearBtn = lv_btn_create(lv_scr_act(), NULL);
//--
lv_obj_t *redNear1Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *redNear2Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *progSkillsBtn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *redFarBtn = lv_btn_create(lv_scr_act(), NULL);
//--
lv_obj_t *redFar1Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *redFar2Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *blueNearBtn = lv_btn_create(lv_scr_act(), NULL);
//--
lv_obj_t *blueNear1Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *blueNear2Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *blueFarBtn = lv_btn_create(lv_scr_act(), NULL);
//--
lv_obj_t *blueFar1Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *blueFar2Btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_t *fieldPic = lv_img_create(lv_scr_act(), NULL);
lv_style_t pathStyle;
lv_res_t readySelect(lv_obj_t *btn) {
// printf("READY\n");
switch (autonRoutine) {
case notSelected:
printf("NS\n");
break;
case progSkills:
printf("PS\n");
initProgSkills();
break;
case redNear1:
printf("RN1\n");
initRedNear1();
break;
case redNear2:
printf("RN2\n");
initRedNear2();
break;
case redFar1:
initRedFar1();
printf("RF1\n");
break;
case redFar2:
initRedFar2();
printf("RF2\n");
break;
case blueNear1:
initBlueNear1();
printf("BN1\n");
break;
case blueNear2:
initBlueNear2();
printf("BN2\n");
break;
case blueFar1:
initBlueFar1();
printf("BF1\n");
break;
case blueFar2:
initBlueFar2();
printf("BF2\n");
break;
}
lv_btn_set_state(btn, LV_BTN_STATE_INA);
// lv_scr_act();
return LV_RES_OK; /*Return OK if the button is not deleted*/
}
lv_res_t secondaryBtnToggle(lv_obj_t *btn) {
if (btn == redNear1Btn) {
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = redNear1;
displayRedNear1();
}
if (btn == redNear2Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = redNear2;
}
if (btn == progSkillsBtn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = progSkills;
}
if (btn == redFar1Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = redFar1;
}
if (btn == redFar2Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = redFar2;
}
if (btn == blueNear1Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = blueNear1;
}
if (btn == blueNear2Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = blueNear2;
}
if (btn == blueFar1Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar2Btn, LV_BTN_STATE_REL);
autonRoutine = blueFar1;
}
if (btn == blueFar2Btn) {
lv_btn_set_state(redNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(progSkillsBtn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(redFar2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear1Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueNear2Btn, LV_BTN_STATE_REL);
lv_btn_set_state(blueFar1Btn, LV_BTN_STATE_REL);
autonRoutine = blueFar2;
}
lv_img_set_src(fieldPic, &redNearIMG);
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL); /*Set toggled state*/
lv_obj_align(fieldPic, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, -2);
lv_obj_set_hidden(titleLabel, true);
// if (readyBtnExists == false) {
readyBtnExists = true;
lv_obj_t *readyBtn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_size(readyBtn, 200, 36);
lv_obj_t *readyBtnLabel = lv_label_create(readyBtn, NULL);
lv_label_set_text(readyBtnLabel, "Ready?");
lv_obj_align(readyBtn, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 1);
lv_btn_set_action(readyBtn, LV_BTN_ACTION_CLICK, readySelect);
// }
return LV_RES_OK; /*Return OK if the button is not deleted*/
}
lv_res_t mainBtnToggle(lv_obj_t *btn) {
lv_style_copy(&pathStyle, &lv_style_plain);
pathStyle.line.color = LV_COLOR_HEX(0x000000);
pathStyle.line.width = 6;
/* The button is released.
* Make something here */
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL); /*Set toggled state*/
if (btn == redNearBtn) {
lv_obj_set_hidden(redFar1Btn, true);
lv_obj_set_hidden(redFar2Btn, true);
lv_obj_set_hidden(blueNear1Btn, true);
lv_obj_set_hidden(blueNear2Btn, true);
lv_obj_set_hidden(blueFar1Btn, true);
lv_obj_set_hidden(blueFar2Btn, true);
// lv_img_set_src(fieldPic, &redNear1);
printf("Button Red Near Pressed\n");
lv_btn_set_state(redFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_obj_set_hidden(redNear1Btn, false);
lv_obj_set_hidden(redNear2Btn, false);
lv_obj_set_hidden(progSkillsBtn, false);
lv_obj_set_size(redNear1Btn, 40, 40);
lv_obj_t *redNear1BtnLabel = lv_label_create(redNear1Btn, NULL);
lv_label_set_text(redNear1BtnLabel, "1");
lv_obj_align(redNear1Btn, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 8, 0);
lv_btn_set_action(redNear1Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
lv_obj_set_size(redNear2Btn, 40, 40);
lv_obj_t *redNear2BtnLabel = lv_label_create(redNear2Btn, NULL);
lv_label_set_text(redNear2BtnLabel, "2");
lv_obj_align(redNear2Btn, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 50, 0);
lv_btn_set_action(redNear2Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
lv_obj_set_size(progSkillsBtn, 40, 40);
lv_obj_t *progSkillsBtnLabel = lv_label_create(progSkillsBtn, NULL);
lv_label_set_text(progSkillsBtnLabel, "PS");
lv_obj_align(progSkillsBtn, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 92, 0);
lv_btn_set_action(progSkillsBtn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
}
if (btn == redFarBtn) {
// lv_img_set_src(fieldPic, &redNear1);
lv_obj_set_hidden(redNear1Btn, true);
lv_obj_set_hidden(redNear2Btn, true);
lv_obj_set_hidden(progSkillsBtn, true);
lv_obj_set_hidden(blueNear1Btn, true);
lv_obj_set_hidden(blueNear2Btn, true);
lv_obj_set_hidden(blueFar1Btn, true);
lv_obj_set_hidden(blueFar2Btn, true);
printf("Button Red Far Pressed\n");
lv_btn_set_state(redNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_obj_set_hidden(redFar1Btn, false);
lv_obj_set_hidden(redFar2Btn, false);
// lv_cont_set_fit(redNear1Btn, true, true);
lv_obj_set_size(redFar1Btn, 40, 40);
lv_obj_t *redFar1BtnLabel = lv_label_create(redFar1Btn, NULL);
lv_label_set_text(redFar1BtnLabel, "1");
lv_obj_align(redFar1Btn, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 8, 0);
lv_btn_set_action(redFar1Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
lv_obj_set_size(redFar2Btn, 40, 40);
lv_obj_t *redFar2BtnLabel = lv_label_create(redFar2Btn, NULL);
lv_label_set_text(redFar2BtnLabel, "2");
lv_obj_align(redFar2Btn, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 92, 0);
lv_btn_set_action(redFar2Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
}
if (btn == blueNearBtn) {
lv_obj_set_hidden(redNear1Btn, true);
lv_obj_set_hidden(redNear2Btn, true);
lv_obj_set_hidden(progSkillsBtn, true);
lv_obj_set_hidden(redFar1Btn, true);
lv_obj_set_hidden(redFar2Btn, true);
lv_obj_set_hidden(blueFar1Btn, true);
lv_obj_set_hidden(blueFar2Btn, true);
printf("Button Blue Near Pressed\n");
lv_btn_set_state(redNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(redFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_obj_set_hidden(blueNear1Btn, false);
lv_obj_set_hidden(blueNear2Btn, false);
lv_obj_set_size(blueNear1Btn, 40, 40);
lv_obj_t *blueNear1BtnLabel = lv_label_create(blueNear1Btn, NULL);
lv_label_set_text(blueNear1BtnLabel, "1");
lv_obj_align(blueNear1Btn, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -92, 0);
lv_btn_set_action(blueNear1Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
lv_obj_set_size(blueNear2Btn, 40, 40);
lv_obj_t *blueNear2BtnLabel = lv_label_create(blueNear2Btn, NULL);
lv_label_set_text(blueNear2BtnLabel, "2");
lv_obj_align(blueNear2Btn, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -8, 0);
lv_btn_set_action(blueNear2Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
}
if (btn == blueFarBtn) {
lv_obj_set_hidden(redNear1Btn, true);
lv_obj_set_hidden(redNear2Btn, true);
lv_obj_set_hidden(progSkillsBtn, true);
lv_obj_set_hidden(redFar1Btn, true);
lv_obj_set_hidden(redFar2Btn, true);
lv_obj_set_hidden(blueNear1Btn, true);
lv_obj_set_hidden(blueNear2Btn, true);
printf("Button Blue Far Pressed\n");
lv_btn_set_state(redNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(redFarBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_btn_set_state(blueNearBtn, LV_BTN_STATE_REL); /*Set untoggled state*/
lv_obj_set_hidden(blueFar1Btn, false);
lv_obj_set_hidden(blueFar2Btn, false);
lv_obj_set_size(blueFar1Btn, 40, 40);
lv_obj_t *blueFar1BtnLabel = lv_label_create(blueFar1Btn, NULL);
lv_label_set_text(blueFar1BtnLabel, "1");
lv_obj_align(blueFar1Btn, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -92, 0);
lv_btn_set_action(blueFar1Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
lv_obj_set_size(blueFar2Btn, 40, 40);
lv_obj_t *blueFar2BtnLabel = lv_label_create(blueFar2Btn, NULL);
lv_label_set_text(blueFar2BtnLabel, "2");
lv_obj_align(blueFar2Btn, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -8, 0);
lv_btn_set_action(blueFar2Btn, LV_BTN_ACTION_CLICK, secondaryBtnToggle);
}
return LV_RES_OK; /*Return OK if the button is not deleted*/
}
void autonSelector() {
lv_scr_act();
lv_obj_set_hidden(redNear1Btn, true);
lv_obj_set_hidden(redNear2Btn, true);
lv_obj_set_hidden(progSkillsBtn, true);
lv_obj_set_hidden(redFar1Btn, true);
lv_obj_set_hidden(redFar2Btn, true);
lv_obj_set_hidden(blueNear1Btn, true);
lv_obj_set_hidden(blueNear2Btn, true);
lv_obj_set_hidden(blueFar1Btn, true);
lv_obj_set_hidden(blueFar2Btn, true);
lv_label_set_text(titleLabel, "Select Auton:");
lv_obj_align(titleLabel, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 5);
lv_cont_set_fit(redNearBtn, false, true);
lv_obj_t *redNearBtnLabel = lv_label_create(redNearBtn, NULL);
lv_label_set_text(redNearBtnLabel, "Red Near");
lv_obj_align(redNearBtn, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 8, 15);
lv_btn_set_action(redNearBtn, LV_BTN_ACTION_CLICK, mainBtnToggle);
lv_cont_set_fit(redFarBtn, false, true);
lv_obj_t *redFarBtnLabel = lv_label_create(redFarBtn, NULL);
lv_label_set_text(redFarBtnLabel, "Red Far");
lv_obj_align(redFarBtn, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 8, -15);
lv_btn_set_action(redFarBtn, LV_BTN_ACTION_CLICK, mainBtnToggle);
lv_cont_set_fit(blueNearBtn, false, true);
lv_obj_t *blueNearBtnLabel = lv_label_create(blueNearBtn, NULL);
lv_label_set_text(blueNearBtnLabel, "Blue Near");
lv_obj_align(blueNearBtn, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -8, 15);
lv_btn_set_action(blueNearBtn, LV_BTN_ACTION_CLICK, mainBtnToggle);
lv_cont_set_fit(blueFarBtn, false, true);
lv_obj_t *blueFarBtnLabel = lv_label_create(blueFarBtn, NULL);
lv_label_set_text(blueFarBtnLabel, "Blue Far");
lv_obj_align(blueFarBtn, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -8, -15);
lv_btn_set_action(blueFarBtn, LV_BTN_ACTION_CLICK, mainBtnToggle);
lv_img_set_src(fieldPic, &fieldResizedIMG);
lv_obj_align(fieldPic, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 25);
}
void lcdCode2() {
lv_scr_act();
/*Create an array for the points of the line*/
static lv_point_t line_points[] = {
{5, 5}, {70, 70}, {120, 10}, {180, 60}, {240, 10}};
static lv_style_t pathStyle;
lv_style_copy(&pathStyle, &lv_style_plain);
pathStyle.line.color = LV_COLOR_MAKE(0x2e, 0x3b, 0x75);
pathStyle.line.width = 5;
/*Create line with default style*/
lv_obj_t *line1;
line1 = lv_line_create(lv_scr_act(), NULL);
lv_line_set_style(line1, &pathStyle);
lv_line_set_points(line1, line_points, 5); /*Set the points*/
lv_obj_align(line1, NULL, LV_ALIGN_IN_TOP_MID, 0, 20);
}
void displayRedNear1() {
// path1
// static lv_point_t path1Points[] = {
// {0, 0}, {60, 0}, {20, 0}, {15, -60}, {20, 0}};
//
// lv_obj_t *path1 = lv_line_create(lv_scr_act(), NULL);
// lv_line_set_style(path1, &pathStyle);
// lv_line_set_points(path1, path1Points, 5);
// lv_obj_align(path1, fieldPic, LV_ALIGN_IN_TOP_LEFT, 16,
// 82); // set start point
}
|
[
"s2siddhu@gmail.com"
] |
s2siddhu@gmail.com
|
b2128b8678bcf7d0bc80ab2ae1cd204c671c9bd8
|
101ceac1ebf888cdf74232255c3c9ced561d9983
|
/goblin/goblin.2.8b18/lib_src/solveSymmTSP.cpp
|
705920df2d21f40e9415d7946652cb04b27916bf
|
[] |
no_license
|
hxn170230/AdvancedComputerNetworks
|
a38325f1893327a59566c80b0eb5321ce7493b07
|
45f35076a879a3f28400610119db1d6f170ac9f0
|
refs/heads/master
| 2020-12-03T00:12:23.595121
| 2017-07-02T03:41:25
| 2017-07-02T03:41:25
| 96,000,286
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 31,680
|
cpp
|
// This file forms part of the GOBLIN C++ Class Library.
//
// Initially written by Christian Fremuth-Paeger, May 2001
//
// Copying, compiling, distribution and modification
// of this source code is permitted only in accordance
// with the GOBLIN general licence information.
/// \file solveSymmTSP.cpp
/// \brief ATSP branch & bound and heuristic codes
#include "branchSymmTSP.h"
#include "sparseGraph.h"
#include "denseGraph.h"
#include "binaryHeap.h"
#include "dynamicQueue.h"
branchSymmTSP::branchSymmTSP(abstractGraph& _G,TNode _root,
abstractMixedGraph::TRelaxTSP method,int nCandidates) throw() :
branchNode<TArc,TFloat>(_G.M(),_G.Context()),
G(_G),root(_root),relaxationMethod(method)
{
if (nCandidates>=0 && G.IsDense())
{
SetCandidateGraph(nCandidates);
}
else
{
X = new graph(G,OPT_CLONE);
}
H = X->Investigate();
selected = 0;
depth = TArc(ceil(X->N()*log(double(X->N())*0.1)));
for (TNode v=0;v<G.N();v++) X->SetPotential(v,G.Pi(v));
for (TArc a=0;a<n;a++)
if (X->StartNode(2*a)==X->EndNode(2*a)) Lower(a);
for (TNode v=0;v<G.N();v++) CheckNode(v);
LogEntry(LOG_MEM,"(symmetric TSP)");
}
branchSymmTSP::branchSymmTSP(branchSymmTSP& Node) throw() :
branchNode<TArc,TFloat>(Node.G.M(),Node.Context(),Node.scheme), G(Node.G)
{
X = new graph(*Node.X,OPT_CLONE);
H = X->Investigate();
unfixed = Node.Unfixed();
selected = Node.selected;
root = Node.root;
depth = TArc(X->N()*log(double(X->N())*0.1));
for (TNode v=0;v<G.N();v++) X->SetPotential(v,Node.X->Pi(v));
for (TArc a=0;a<X->M();a++) X->SetSub(2*a,Node.X -> Sub(2*a));
objective = Node.Objective();
solved = true;
LogEntry(LOG_MEM,"(symmetric TSP)");
}
branchSymmTSP::~branchSymmTSP() throw()
{
X -> Close(H);
delete X;
LogEntry(LOG_MEM,"(symmetric TSP)");
}
void branchSymmTSP::SetCandidateGraph(int nCandidates) throw()
{
LogEntry(LOG_METH,"Constructing candidate graph...");
CT.SuppressLogging();
graph* Y = new graph(G,OPT_CLONE);
Y->Representation() -> SetCUCap(1);
Y -> InitSubgraph();
CT.RestoreLogging();
for (TNode v=0;v<G.N();v++)
{
if (G.Pred(v)!=NoArc)
{
TNode u = G.StartNode(G.Pred(v));
TNode w = G.EndNode(G.Pred(v));
Y -> SetSub(Y->Adjacency(u,w),1);
}
}
for (int i=0;i<20;i++)
{
CT.SuppressLogging();
TFloat ret = Y->TSP_HeuristicRandom();
CT.RestoreLogging();
if (ret<InfFloat)
{
for (TNode v=0;v<G.N();v++) Y -> SetSub(Y->Pred(v),1);
#if defined(_LOGGING_)
if (CT.logMeth>=2)
{
sprintf(CT.logBuffer,"Adding tour of length %g...",ret);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
if (ret<G.Length())
{
G.InitPredecessors();
for (TNode v=0;v<G.N();v++)
{
TArc a = Y->Pred(v);
TNode u = Y->StartNode(a);
TArc a2 = G.Adjacency(u,v);
G.SetPred(v,a2);
}
#if defined(_LOGGING_)
if (CT.logMeth>=2)
{
sprintf(CT.logBuffer,"...Saved to original graph");
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
}
}
}
binaryHeap<TArc,TFloat> Q(2*Y->M(),CT);
H = Y->Investigate();
for (TNode v=0;v<G.N();v++)
{
while (Y->Active(H,v))
{
TArc a = Y->Read(H,v);
Q.Insert(a,Y->Length(a));
}
int i = 0;
while (!Q.Empty())
{
TArc a = Q.Delete();
if (Y->Sub(a)==0 && (i<nCandidates || G.Sub(a)>0))
{
Y->SetSub(a,1);
i++;
}
}
}
Y->Close(H);
X = new graph(*Y,OPT_SUB);
X->Representation() -> SetCUCap(1);
n = unfixed = X->M();
if (CT.traceLevel==2) X -> Display();
CT.SuppressLogging();
delete Y;
CT.RestoreLogging();
if (CT.logRes)
{
sprintf(CT.logBuffer,"...Candidate subgraph has %ld arcs",X->M());
LogEntry(LOG_RES,CT.logBuffer);
}
}
unsigned long branchSymmTSP::Size() const throw()
{
return
sizeof(branchSymmTSP)
+ managedObject::Allocated()
+ branchNode<TArc,TFloat>::Allocated()
+ Allocated();
}
unsigned long branchSymmTSP::Allocated() const throw()
{
return 0;
}
TArc branchSymmTSP::SelectVariable() throw()
{
TArc ret0 = NoArc;
TFloat maxDiff = -InfFloat;
for (TNode v=0;v<X->N();v++)
{
TArc a0 = NoArc;
TArc a1 = NoArc;
TNode thisDegree = 0;
TNode fixedIncidences = 0;
X -> Reset(H,v);
while (X->Active(H,v) && fixedIncidences<2)
{
TArc a = X->Read(H,v);
if (X->Sub(a)==1)
{
thisDegree++;
if (X->LCap(a)==0)
{
if (a0==NoArc || X->Length(a)<X->Length(a0))
{
TArc aSwap = a0;
a0 = a;
a = aSwap;
}
if (a1==NoArc || X->Length(a)<X->Length(a1)) a1 = a;
}
else fixedIncidences++;
}
}
if (thisDegree<=2) continue;
// Now, we have fixedIncidences<2 and a1!=NoArc
// By using a big 'M', let fixed incidences dominate among the
// selection criteria.
if ( X->Length(a1)-X->Length(a0)+100000*fixedIncidences>maxDiff )
{
ret0 = a0;
maxDiff = X->Length(a1)-X->Length(a0)+100000*fixedIncidences;
}
}
if (ret0!=NoArc) return ret0>>1;
#if defined(_FAILSAVE_)
InternalError("SelectVariable","No branching variable found");
#endif
throw ERInternal();
}
branchNode<TArc,TFloat>::TBranchDir branchSymmTSP::DirectionConstructive(TArc a)
throw(ERRange)
{
#if defined(_FAILSAVE_)
if (a>=n) NoSuchArc("DirectionConstructive",a);
#endif
return RAISE_FIRST;
}
branchNode<TArc,TFloat>::TBranchDir branchSymmTSP::DirectionExhaustive(TArc a)
throw(ERRange)
{
#if defined(_FAILSAVE_)
if (a>=n) NoSuchArc("DirectionExhaustive",a);
#endif
return RAISE_FIRST;
}
branchNode<TNode,TFloat> *branchSymmTSP::Clone() throw()
{
return new branchSymmTSP(*this);
}
void branchSymmTSP::Raise(TArc a,bool recursive) throw(ERRange)
{
#if defined(_FAILSAVE_)
if (a>=n) NoSuchArc("Raise",a);
#endif
if (X->Sub(2*a)==0)
{
X -> SetSub(2*a,1);
if (objective!=InfFloat) solved = 0;
}
X->Representation() -> SetLCap(2*a,1);
unfixed--;
selected++;
if (recursive)
{
CheckNode(X->StartNode(2*a));
CheckNode(X->EndNode(2*a));
}
if (unfixed==0 && objective!=InfFloat) solved = 0;
}
void branchSymmTSP::Lower(TArc a,bool recursive) throw(ERRange)
{
#if defined(_FAILSAVE_)
if (a>=n) NoSuchArc("Lower",a);
#endif
if (X->Sub(2*a)==1)
{
X -> SetSub(2*a,0);
if (objective!=InfFloat) solved = 0;
}
X->Representation() -> SetUCap(2*a,0);
unfixed--;
if (recursive)
{
CheckNode(X->StartNode(2*a));
CheckNode(X->EndNode(2*a));
}
if (unfixed==0 && objective!=InfFloat) solved = 0;
}
void branchSymmTSP::CheckNode(TNode v) throw(ERRange)
{
#if defined(_FAILSAVE_)
if (v>=X->N()) NoSuchNode("CheckNode",v);
#endif
char fixedIncidences = 0;
X -> Reset(H,v);
while (X->Active(H,v) && fixedIncidences<=2)
{
TArc a2 = X->Read(H,v);
if (X->LCap(a2)==1) fixedIncidences++;
}
if (fixedIncidences>2)
{
// Fixed arcs cannot be extended to a Hamiltonian cycle
solved = 1;
objective = InfFloat;
}
if (fixedIncidences==2)
{
X -> Reset(H,v);
while (X->Active(H,v))
{
TArc a2 = X->Read(H,v);
if (X->LCap(a2)==0 && X->UCap(a2)==1)
{
Lower(a2>>1,false);
CheckNode(X->EndNode(a2));
}
}
return;
}
TArc a1 = NoArc;
TArc a2 = NoArc;
char incidences = 0;
X -> Reset(H,v);
while (incidences<3 && X->Active(H,v))
{
TArc a = X->Read(H,v);
if (X->UCap(a)==1)
{
incidences++;
if (X->LCap(a)==0)
{
if (a1==NoArc) a1 = a;
else if (a2==NoArc) a2 = a;
}
}
}
if (incidences<=2)
{
if (a1!=NoArc)
{
Raise(a1>>1,false);
CheckNode(X->EndNode(a1));
}
if (a2!=NoArc && X->UCap(a2)==1 && X->LCap(a2)==0)
{
Raise(a2>>1,false);
CheckNode(X->EndNode(a2));
}
}
}
TFloat branchSymmTSP::SolveRelaxation() throw()
{
for (TNode v=0;v<X->N();v++)
{
char fixedIncidences = 0;
X -> Reset(H,v);
while (X->Active(H,v) && fixedIncidences<3)
{
TArc a2 = X->Read(H,v);
if (X->LCap(a2)==1) fixedIncidences++;
}
if (fixedIncidences>2) return InfFloat;
}
CT.SuppressLogging();
if (X->CutNodes()!=X->DFS_BICONNECTED)
{
CT.RestoreLogging();
return InfFloat;
}
TFloat objective = InfFloat;
try
{
objective = X->MinTree(X->MST_DEFAULT,X->MST_ONE_CYCLE_REDUCED,root);
if ( scheme != NULL
&& relaxationMethod >= X->TSP_RELAX_FAST
&& scheme->nIterations > 1
&& unfixed > 0
&& scheme->SearchState() != scheme->INITIAL_DFS
&& objective < scheme->savedObjective-1+CT.epsilon
)
{
// Apply subgradient optimization for most effective pruning
X -> InitSubgraph();
X -> ReleasePredecessors();
TFloat upperBound = scheme->savedObjective;
objective = X->TSP_SubOpt1Tree(relaxationMethod,root,upperBound,true);
X -> MinTree(X->MST_DEFAULT,X->MST_ONE_CYCLE_REDUCED,root);
}
}
catch (ERRejected)
{
CT.RestoreLogging();
return InfFloat;
}
CT.RestoreLogging();
if (unfixed==0 && !Feasible()) return InfFloat;
return objective;
}
bool branchSymmTSP::Feasible() throw()
{
CT.SuppressLogging();
bool feasible = (X->ExtractCycles()!=NoNode);
if (!feasible) X -> ReleaseDegrees();
CT.RestoreLogging();
return feasible;
}
TFloat branchSymmTSP::LocalSearch() throw()
{
TArc* predX = X->GetPredecessors();
TArc* predG = G.InitPredecessors();
for (TNode v=0;v<G.N();v++)
{
TArc a = predX[v];
TNode u = X->StartNode(a);
TArc a2 = G.Adjacency(u,v);
predG[v] = a2;
}
CT.SuppressLogging();
objective = G.TSP_LocalSearch(predG);
CT.RestoreLogging();
// It can happen that the found tour is better than every tour in
// the candidate graph
if (objective>=LowerBound(TimerTsp))
{
SetUpperBound(TimerTsp,objective);
}
else
{
SetUpperBound(TimerTsp,LowerBound(TimerTsp));
}
if (CT.traceLevel==3) G.Display();
return objective;
}
void branchSymmTSP::SaveSolution() throw()
{
}
TFloat abstractGraph::TSP_BranchAndBound(TRelaxTSP method,int nCandidates,
TNode root,TFloat upperBound) throw()
{
LogEntry(LOG_METH,"TSP branch and bound...");
OpenFold(ModTSP);
branchSymmTSP *masterNode = new branchSymmTSP(*this,root,method,nCandidates);
#if defined(_PROGRESS_)
SetProgressNext(1);
#endif
if (!GetPredecessors()) upperBound = InfFloat;
branchScheme<TArc,TFloat>::TSearchLevel level =
branchScheme<TArc,TFloat>::SEARCH_CONSTRUCT;
if (nCandidates<0)
{
level = branchScheme<TArc,TFloat>::SEARCH_EXHAUSTIVE;
}
else
{
// The candidate tours may have improved the original upper bound
upperBound = Length();
}
branchScheme<TArc,TFloat>* scheme =
new branchScheme<TNode,TFloat>(masterNode,upperBound,level);
TFloat ret = scheme->savedObjective;
CloseFold(ModTSP);
if (ret!=InfFloat)
{
SetUpperBound(TimerTsp,ret);
if (CT.logRes)
{
sprintf(CT.logBuffer,
"...Optimal tour has Length %g",ret);
LogEntry(LOG_RES,CT.logBuffer);
}
delete scheme;
return ret;
}
LogEntry(LOG_RES,"...Problem is infeasible");
delete scheme;
return InfFloat;
}
TFloat abstractGraph::TSP_SubOpt1Tree(TRelaxTSP method,TNode root,TFloat& bestUpper,bool branchAndBound)
throw(ERRange)
{
#if defined(_FAILSAVE_)
if (root>=n && root!=NoNode) NoSuchNode("TSP_SubOpt1Tree",root);
#endif
OpenFold(ModSubgradOptTSP,SHOW_TITLE);
#if defined(_PROGRESS_)
InitProgressCounter(1);
SetProgressNext(0);
#endif
TArc* pred = GetPredecessors();
TArc *bestTour = new TArc[n];
if (!pred) pred = InitPredecessors();
for (TNode v=0;v<n;v++) bestTour[v] = pred[v];
TFloat* potential = GetPotentials();
TFloat *bestPi = new TFloat[n];
TFloat maxPi = 0;
if (!potential)
{
potential = InitPotentials();
}
else
{
TFloat sum = 0;
for (TNode v=0;v<n;v++) sum += potential[v];
for (TNode v=0;v<n;v++)
{
potential[v] -= sum/n;
bestPi[v] = potential[v];
if (fabs(potential[v])>maxPi) maxPi = fabs(potential[v]);
}
LogEntry(LOG_METH,"Using existing potentials..");
}
TFloat* oldDeg = new TFloat[n];
TFloat bestLower = -InfFloat;
TFloat lastBound = -InfFloat;
TFloat gap = InfFloat;
TNode dev = n;
TNode bestDev = n;
unsigned int step = 0;
sprintf(CT.logBuffer,"Computing minimum %ld-tree...",root);
LogEntry(LOG_METH,CT.logBuffer);
CT.SuppressLogging();
TFloat thisBound = MinTree(MST_DEFAULT,MST_ONE_CYCLE_REDUCED,root);
CT.RestoreLogging();
if (method==TSP_RELAX_1TREE)
{
CloseFold(ModSubgradOptTSP);
for (TNode v=0;v<n;v++) pred[v] = bestTour[v];
delete[] bestTour;
delete[] bestPi;
if (CT.logRes && bestUpper!=InfFloat && thisBound!=-InfFloat)
{
sprintf(CT.logBuffer,"Found gap is [%g,%g] or %g percent",
ceil(thisBound),bestUpper,(bestUpper/ceil(thisBound)-1)*100);
LogEntry(LOG_RES,CT.logBuffer);
}
SetLowerBound(TimerTsp,ceil(thisBound-CT.epsilon));
return ceil(thisBound);
}
// Compute initial step length
TFloat t0 = fabs(thisBound/n);
if (maxPi>0) t0 = 0.3*t0+0.7*maxPi/10;
TFloat t = t0;
const TFloat tMin = 0.02;
TFloat *oldPi = new TFloat[n];
while (bestUpper+CT.epsilon>=ceil(bestLower-CT.epsilon)+1
&& t>tMin && dev>0 && step<5000
&& CT.SolverRunning())
{
step++;
#if defined(_PROGRESS_)
if (t>=t0)
{
SetProgressCounter(0);
}
else
{
SetProgressCounter( (log(t0/tMin)-log(t/tMin)) / log(t0/tMin) );
}
#endif
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,"Step number %d",step);
LogEntry(LOG_METH2,CT.logBuffer);
sprintf(CT.logBuffer,"Step length: %g",t);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
if (step>1)
{
sprintf(CT.logBuffer,"Computing minimum %ld-tree...",root);
LogEntry(LOG_METH,CT.logBuffer);
CT.SuppressLogging();
thisBound = MinTree(MST_DEFAULT,MST_ONE_CYCLE_REDUCED,root);
CT.RestoreLogging();
if (CT.logRes>=2)
{
sprintf(CT.logBuffer,"...Tree length is %g",thisBound);
LogEntry(LOG_RES2,CT.logBuffer);
}
}
dev = 0;
TFloat turn = 0;
TFloat normSqare1 = 0;
TFloat normSqare2 = 0;
for (TNode v=0;v<n;v++)
{
if (Deg(v)!=2) dev++;
TFloat oldDiff = potential[v]-oldPi[v];
oldPi[v] = potential[v];
if (step==1)
{
potential[v] = potential[v]+t*(Deg(v)-2);
oldDiff = 0;
}
else
{
potential[v] = potential[v]+t*(0.7*Deg(v)+0.3*oldDeg[v]-2);
}
TFloat newDiff = potential[v]-oldPi[v];
turn += oldDiff*newDiff;
normSqare1 += newDiff*newDiff;
normSqare2 += oldDiff*oldDiff;
}
if (fabs(normSqare1)>0.001 && fabs(normSqare2)>0.001)
{
turn /= sqrt(normSqare1*normSqare2);
}
else
{
// This includes step == 1
turn = 0;
}
#if defined(_LOGGING_)
if (CT.logMeth>=2)
{
sprintf(CT.logBuffer,"Nodes with incorrect degrees: %ld",dev);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
bool newGap = false;
if (thisBound>=InfFloat)
{
bestLower = bestUpper = InfFloat;
dev = 0;
LogEntry(LOG_RES,"Problem is infeasible");
break;
}
else if (thisBound>bestLower+CT.epsilon)
{
bestLower = thisBound;
if (!branchAndBound)
{
// Do not export the lower bound if the procedure was called
// for a branch&bound subproblem
SetLowerBound(TimerTsp,ceil(bestLower-CT.epsilon));
}
newGap = true;
for (TNode v=0;v<n;v++) bestPi[v] = potential[v];
}
if (!branchAndBound && (step==1 || dev<bestDev || dev<5+n/100))
{
sprintf(CT.logBuffer,"Transforming to Hamiltonian cycle...");
LogEntry(LOG_METH,CT.logBuffer);
bestDev = dev;
TFloat thisUpper = TSP_HeuristicTree(root);
if (thisUpper<bestUpper)
{
#if defined(_LOGGING_)
LogEntry(LOG_METH,"Saving tour...");
#endif
for (TNode v=0;v<n;v++) bestTour[v] = pred[v];
bestUpper = thisUpper;
SetUpperBound(TimerTsp,bestUpper);
newGap = true;
}
}
if (newGap)
{
gap = bestUpper/ceil(bestLower-CT.epsilon)-1;
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,"Gap decreases to %g percent",gap*100);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
}
InitDegrees();
TFloat *swapDeg = oldDeg;
oldDeg = sDeg;
sDeg = swapDeg;
if (method==TSP_RELAX_FAST)
{
if (turn<=0.1)
{
t *= 0.95;
}
else if (thisBound<=lastBound)
{
t *= 0.98;
}
if (newGap)
{
t *= 1.05;
}
}
else
{
if (turn<=-0.2)
{
t *= 0.96;
}
else if (thisBound<=lastBound)
{
t *= 0.99;
}
if (newGap)
{
t *= 1.15;
}
}
lastBound = thisBound;
}
for (TNode v=0;v<n;v++) potential[v] = bestPi[v];
delete[] oldPi;
delete[] bestPi;
delete[] sDeg;
sDeg = oldDeg;
for (TNode v=0;v<n;v++) pred[v] = bestTour[v];
delete[] bestTour;
if (CT.logMeth==1)
{
sprintf(CT.logBuffer,"Total number of iterations: %d",step);
LogEntry(LOG_METH,CT.logBuffer);
}
CloseFold(ModSubgradOptTSP);
if (CT.logRes && bestUpper!=InfFloat && bestLower!=-InfFloat)
{
sprintf(CT.logBuffer,"...Final gap is [%g,%g] or %g percent",
ceil(bestLower),bestUpper,gap*100);
LogEntry(LOG_RES,CT.logBuffer);
}
return bestLower;
}
TFloat denseGraph::TSP_Heuristic(THeurTSP method,TNode root) throw(ERRange,ERRejected)
{
#if defined(_FAILSAVE_)
if (root>=n && root!=NoNode) NoSuchNode("TSP_Heuristic",root);
#endif
OpenFold(ModTSP,NO_INDENT);
LogEntry(LOG_METH,"Computing heuristic tour...");
TFloat ret = InfFloat;
if (!CLCap() || MaxLCap()>0 || !CUCap() || MaxUCap()<1)
{
LogEntry(LOG_METH2,"...Non-trivial capacity bounds impose restrictions on the feasibility set");
ret = abstractGraph::TSP_Heuristic(method,root);
}
else
{
if (method==TSP_HEUR_DEFAULT) method = THeurTSP(CT.methHeurTSP);
switch (method)
{
case TSP_HEUR_RANDOM:
{
ret = TSP_HeuristicRandom();
break;
}
case TSP_HEUR_NEAREST:
case TSP_HEUR_FARTHEST:
{
ret = TSP_HeuristicInsert(method,root);
break;
}
case TSP_HEUR_TREE:
{
ret = TSP_HeuristicTree(root);
break;
}
case TSP_HEUR_CHRISTOFIDES:
{
ret = TSP_HeuristicChristofides(root);
break;
}
default:
{
UnknownOption("TSP_Heuristic",method);
}
}
}
CloseFold(ModTSP,NO_INDENT);
return ret;
}
TFloat abstractGraph::TSP_Heuristic(THeurTSP method,TNode root) throw(ERRange,ERRejected)
{
#if defined(_FAILSAVE_)
if (CLCap() && MaxLCap()>0)
Error(ERR_REJECTED,"TSP_Heuristic","Non-trivial lower bounds");
#endif
OpenFold(ModTSP,NO_INDENT);
LogEntry(LOG_METH,"Transforming to dense graph...");
denseGraph G(n,0,CT);
graphRepresentation* GR = G.Representation();
TFloat offset = 0;
TFloat undefLength = n*(fabs(MaxLength()+1));
if (CLength()) undefLength = 2*Length(0);
if (!CLCap() || MaxLCap()>0)
{
offset = undefLength;
LogEntry(LOG_METH2,"...Non-trivial lower bounds impose restrictions on the feasibility set");
}
TArc* pred = GetPredecessors();
TArc* predG = NULL;
if (pred)
{
predG = G.RawPredecessors();
for (TNode v=0;v<n;v++)
{
if (pred[v]!=NoArc) predG[v] = G.Adjacency(StartNode(pred[v]),EndNode(pred[v]));
}
}
else
{
pred = RawPredecessors();
}
for (TArc i=0;i<G.M();i++)
{
TArc a = Adjacency(G.StartNode(2*i),G.EndNode(2*i));
if (a!=NoArc && LCap(a)>0)
{
GR -> SetLength(2*i,Length(a));
}
else if (a!=NoArc && UCap(a)>=1)
{
GR -> SetLength(2*i,offset+Length(a));
}
else
{
GR -> SetLength(2*i,offset+undefLength);
}
}
if (Dim()>0)
{
TNode v = NoNode;
for (v=0;v<n;v++)
{
GR -> SetC(v,0,C(v,0));
GR -> SetC(v,1,C(v,1));
}
}
int swapSolve = CT.methSolve;
int swapSubgraph = CT.subgraph;
CT.methSolve = 1;
CT.subgraph = 0;
TFloat savedLowerBound = LowerBound(TimerTsp);
ResetBounds(TimerTsp);
G.TSP(root);
TFloat length = 0;
if (root==NoNode) root = 0;
TNode v = root;
while (true)
{
TNode u = G.StartNode(predG[v]);
TArc a = Adjacency(u,v);
if (a!=NoArc)
{
pred[v] = a;
length += Length(a);
}
else
{
length = InfFloat;
break;
}
v = u;
if (v==root) break;
}
CT.methSolve = swapSolve;
CT.subgraph = swapSubgraph;
ResetBounds(TimerTsp,savedLowerBound,InfFloat);
SetUpperBound(TimerTsp,length);
if (length<InfFloat)
{
if (CT.logRes)
{
sprintf(CT.logBuffer,"Tour has Length %g",length);
LogEntry(LOG_RES,CT.logBuffer);
}
}
else
{
LogEntry(LOG_RES,"Tour does not map to the original graph");
}
CloseFold(ModTSP,NO_INDENT);
return length;
}
TFloat abstractGraph::TSP_HeuristicChristofides(TNode r) throw(ERRange)
{
#if defined(_FAILSAVE_)
if (r>=n && r!=NoNode) NoSuchNode("TSP_HeuristicChristofides",r);
#endif
OpenFold(ModChristofides,SHOW_TITLE);
#if defined(_PROGRESS_)
InitProgressCounter(2+n);
SetProgressNext(1);
#endif
if (r==NoNode) r = TNode(CT.Rand(n));
MinTree(r);
TNode *map = new TNode[n];
TNode no = 0;
for (TNode v=0;v<n;v++)
{
if (((TArc)Deg(v))%2) map[v] = no++;
else map[v] = NoNode;
}
if (CT.logRes)
{
sprintf(CT.logBuffer,"Spanning tree has %ld odd vertices",no);
LogEntry(LOG_RES,CT.logBuffer);
}
LogEntry(LOG_METH,"Constructing matching problem...");
OpenFold();
denseGraph *G = new denseGraph(no,0,CT);
graphRepresentation* GR = G->Representation();
TNode *revmap = new TNode[no];
for (TNode u=0;u<n;u++)
{
if (map[u]!=NoNode)
{
revmap[map[u]] = u;
if (Dim()>=2)
{
GR -> SetC(map[u],0,C(u,0));
GR -> SetC(map[u],1,C(u,1));
}
for (TNode v=0;v<u;v++)
{
if (map[v]!=NoNode)
{
TArc a = Adjacency(u,v);
TArc a0 = G->Adjacency(map[u],map[v]);
GR -> SetLength(a0,(u==v) ? InfFloat : Length(a));
}
}
}
}
CloseFold();
Trace(1);
#if defined(_PROGRESS_)
SetProgressNext(n);
#endif
G -> MinCMatching(1);
Trace(n);
#if defined(_PROGRESS_)
SetProgressNext(1);
#endif
LogEntry(LOG_METH,"Constructing Eulerian cycle...");
OpenFold();
dynamicQueue<TArc,TFloat> Q(2*m,CT);
TNode root = r;
TNode u = root;
THandle H = Investigate();
THandle Ho = G->Investigate();
while (Q.Cardinality()<n-1+no/2)
{
if (Active(H,u))
{
// Add tree arc
TArc a = Read(H,u);
if (Sub(a)>0)
{
SetSub(a,0);
Q.Insert(a);
u = EndNode(a);
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,
"Adding arc %ld with end node %ld",a,u);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
}
}
else
{
TNode uo = map[u];
if (uo!=NoNode && G->Active(Ho,uo))
{
// Arc matching arc
TNode ao = G->Read(Ho,uo);
if (G->Sub(ao)>0)
{
G -> SetSub(ao,0);
TNode v = revmap[EndNode(ao)];
TArc a = Adjacency(u,v);
Q.Insert(a);
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,
"Adding arc %ld with end node %ld",a,v);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
u = v;
}
}
else
{
while (!Active(H,u) && (map[u]==NoNode || !G->Active(Ho,map[u])))
{
TArc a = Q.Delete();
Q.Insert(a);
u = EndNode(a);
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,
"Shifting arc %ld with end node %ld",a,u);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
}
root = u;
}
}
}
G -> Close(Ho);
Close(H);
CloseFold();
LogEntry(LOG_METH,"Extracting tour...");
OpenFold();
TArc* pred = InitPredecessors();
TNode last = root;
TFloat sum = 0;
while (!Q.Empty())
{
TArc a = Q.Delete();
TNode v = EndNode(a);
if (v!=root && pred[v]==NoArc)
{
a = Adjacency(last,v);
pred[v] = a;
last = v;
sum += Length(a);
}
}
TArc a = Adjacency(last,root);
pred[root] = a;
sum += Length(a);
CloseFold();
SetUpperBound(TimerTsp,sum);
if (CT.logRes)
{
sprintf(CT.logBuffer,"...Tour has length %g",sum);
LogEntry(LOG_RES,CT.logBuffer);
}
Trace(1);
delete G;
delete[] map;
delete[] revmap;
if (CT.methLocal==LOCAL_OPTIMIZE) sum = TSP_LocalSearch(pred);
CloseFold(ModChristofides);
return sum;
}
bool abstractGraph::TSP_2Exchange(TArc* pred,TFloat limit) throw(ERRejected)
{
#if defined(_FAILSAVE_)
if (!pred) Error(ERR_REJECTED,"TSP_2Exchange","Missing tour");
#endif
OpenFold(Mod2OptTSP);
TNode r = CT.Rand(n);
TNode v1 = r;
TArc a1 = pred[r];
TNode u1 = StartNode(a1);
while (u1!=r)
{
TNode v2 = StartNode(pred[u1]);
TArc a2 = pred[v2];
TNode u2 = StartNode(a2);
while (u2!=r && u2!=v1)
{
TArc a1prime = Adjacency(u1,u2);
TArc a2prime = Adjacency(v1,v2);
TFloat diff = InfFloat;
if (a1prime!=NoArc && a2prime!=NoArc)
diff = Length(a1prime)+Length(a2prime)
- Length(a1)-Length(a2);
if (diff<limit)
{
#if defined(_LOGGING_)
if (CT.logMeth>1)
{
sprintf(CT.logBuffer,
"Local improvement (%g units, 2-exchange)",-diff);
LogEntry(LOG_METH2,CT.logBuffer);
sprintf(CT.logBuffer,
"New tour: ... %ld %ld ... %ld %ld ...",
u1,u2,v1,v2);
LogEntry(LOG_METH2,CT.logBuffer);
}
#endif
TNode x = u2;
TArc a = pred[x];
// Flip arc directions
while (x!=v1)
{
TNode y = StartNode(a);
TArc an = pred[y];
pred[y] = (a^1);
x = y;
a = an;
}
pred[v2] = a2prime;
pred[u2] = a1prime;
Trace();
CloseFold(Mod2OptTSP);
return true;
}
v2 = u2;
a2 = pred[u2];
u2 = StartNode(a2);
}
v1 = u1;
a1 = pred[u1];
u1 = StartNode(a1);
}
CloseFold(Mod2OptTSP);
return false;
}
|
[
"hxn170230@utdallas.edu"
] |
hxn170230@utdallas.edu
|
a021d1f1c23853dc6ebec675bdd3e18754249f01
|
53e34b7eb1923f55038d9b2747f5e7dbee376253
|
/cabot_bt/plugins/action/change_param.cpp
|
669a0997a42ed50ce931c5f3fb76dd36726f7ea0
|
[
"MIT",
"LicenseRef-scancode-dco-1.1",
"Apache-2.0"
] |
permissive
|
qqsskk/cabot
|
fd5a2884a8eb401ab0953d7effad89cce1edbeab
|
b64468a71a29b5812088d99673403880f9d3edc0
|
refs/heads/main
| 2023-01-31T21:42:04.666344
| 2020-12-17T19:06:22
| 2020-12-17T19:06:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,740
|
cpp
|
// Copyright (c) 2020 Carnegie Mellon University
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <string>
#include <chrono>
#include <cmath>
#include <atomic>
#include <memory>
#include <deque>
#include "rcutils/allocator.h"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/parameter_map.hpp"
#include "rcl_yaml_param_parser/parser.h"
#include "rcl_yaml_param_parser/types.h"
#include "rcl_interfaces/msg/set_parameters_result.hpp"
#include "behaviortree_cpp_v3/action_node.h"
using namespace std::chrono_literals;
namespace cabot_bt
{
class ChangeParamAction : public BT::StatefulActionNode
{
public:
ChangeParamAction(
const std::string &action_name,
const BT::NodeConfiguration &conf)
: BT::StatefulActionNode(action_name, conf)
{
node_ = config().blackboard->get<rclcpp::Node::SharedPtr>("node");
if (getInput("node_name", remote_node_name_))
{
parameters_client_ = std::make_shared<rclcpp::AsyncParametersClient>(node_, remote_node_name_);
}
int count = 30;
RCLCPP_INFO(node_->get_logger(), "Waiting %s parameter server", remote_node_name_.c_str());
while (!parameters_client_->wait_for_service(1s))
{
if (count < 0)
{
parameters_client_ = nullptr;
break;
}
RCLCPP_INFO(node_->get_logger(), "service not available, waiting again...");
}
}
ChangeParamAction() = delete;
~ChangeParamAction()
{
RCLCPP_DEBUG(node_->get_logger(), "Shutting down ChangeParamAction BT node");
}
BT::NodeStatus onStart() override
{
if (!parameters_client_)
{
RCLCPP_INFO(node_->get_logger(), "Check node_name");
return BT::NodeStatus::FAILURE;
}
std::string param_name;
if (!getInput("param_name", param_name))
{
RCLCPP_INFO(node_->get_logger(), "param_name is missing");
return BT::NodeStatus::FAILURE;
}
std::string param_value;
if (!getInput("param_value", param_value))
{
RCLCPP_INFO(node_->get_logger(), "param_value is missing");
return BT::NodeStatus::FAILURE;
}
rcutils_allocator_t allocator = rcutils_get_default_allocator();
rcl_params_t *params_hdl = rcl_yaml_node_struct_init(allocator);
bool res = rcl_parse_yaml_value(remote_node_name_.c_str(),
param_name.c_str(),
param_value.c_str(), params_hdl);
if (!res)
{
RCLCPP_INFO(node_->get_logger(), "Coule not parse param_value %s", param_value.c_str());
return BT::NodeStatus::FAILURE;
}
rclcpp::ParameterMap map = rclcpp::parameter_map_from(params_hdl);
RCLCPP_INFO(node_->get_logger(), "Set parameters");
for (auto p : map[remote_node_name_])
{
RCLCPP_INFO(node_->get_logger(), "Param %s = %s", p.get_name().c_str(), p.value_to_string().c_str());
}
future_ = parameters_client_->set_parameters(map[remote_node_name_]);
running_ = true;
return BT::NodeStatus::RUNNING;
}
BT::NodeStatus onRunning() override
{
if (running_)
{
rclcpp::spin_some(node_);
if (future_.wait_for(std::chrono::milliseconds(1)) == std::future_status::ready)
{
RCLCPP_INFO(node_->get_logger(), "Success to set parameters");
running_ = false;
return BT::NodeStatus::SUCCESS;
}
RCLCPP_INFO(node_->get_logger(), "Waiting set parameters");
return BT::NodeStatus::RUNNING;
}
return BT::NodeStatus::FAILURE;
}
void onHalted() override
{
}
void logStuck(const std::string &msg) const
{
static std::string prev_msg;
if (msg == prev_msg)
{
return;
}
RCLCPP_INFO(node_->get_logger(), msg);
prev_msg = msg;
}
static BT::PortsList providedPorts()
{
return BT::PortsList{
BT::InputPort<std::string>("node_name", "node name"),
BT::InputPort<std::string>("param_name", "param name"),
BT::InputPort<std::string>("param_value", "param value"),
};
}
private:
// The node that will be used for any ROS operations
rclcpp::Node::SharedPtr node_;
rclcpp::AsyncParametersClient::SharedPtr parameters_client_;
std::string remote_node_name_;
bool running_;
BT::NodeStatus result_;
std::shared_future<std::vector<rcl_interfaces::msg::SetParametersResult>> future_;
};
} // namespace cabot_bt
#include "behaviortree_cpp_v3/bt_factory.h"
BT_REGISTER_NODES(factory)
{
factory.registerNodeType<cabot_bt::ChangeParamAction>("ChangeParam");
}
|
[
"daisukes@cmu.edu"
] |
daisukes@cmu.edu
|
588ca2073ab674f7966285c3c77abdb6bb4c7f13
|
c834f1c3ba7f922f6a6ff16aabd4d130d7678a2c
|
/Others/AP_Controller/source/driver/clock.cpp
|
49d5b5c1a75c4e8912e22af45d6170e011ea6ecc
|
[] |
no_license
|
Nkyoku/KIKS
|
d2fe67f9d19ffd48ed54b09d5827fd43626dbfd0
|
411520115265d0cc1ce16a0fa22bc398bb897123
|
refs/heads/master
| 2021-03-12T21:37:32.164099
| 2014-04-16T05:28:55
| 2014-04-16T05:28:55
| 17,817,877
| 1
| 0
| null | null | null | null |
SHIFT_JIS
|
C++
| false
| false
| 1,166
|
cpp
|
// クロック管理
#include "clock.h"
// クロックの初期化
void Clock_Init(void){
// 24MHz発振器を起動
PM.mcctrl = AVR32_PM_MCCTRL_OSC0EN_MASK | (AVR32_PM_MCCTRL_MCSEL_SLOW << AVR32_PM_MCCTRL_MCSEL);
PM.oscctrl0 = (AVR32_PM_OSCCTRL0_MODE_EXT_CLOCK << AVR32_PM_OSCCTRL0_MODE)
| (AVR32_PM_OSCCTRL0_STARTUP_16384_RCOSC << AVR32_PM_OSCCTRL0_STARTUP);
while(~PM.poscsr & AVR32_PM_POSCSR_OSC0RDY_MASK);
// PLLを起動 (24MHz -> DIV -> 12MHz -> PLL -> 96MHz -> DIV -> 48MHz)
PM.pll[0] = ((8-1) << AVR32_PM_PLLMUL) | (2 << AVR32_PM_PLLDIV) | (0b111 << AVR32_PM_PLLOPT)
| (0 << AVR32_PM_PLL0_PLLOSC) | AVR32_PM_PLLEN_MASK;
while(~PM.poscsr & AVR32_PM_POSCSR_LOCK0_MASK);
// クロック源をPLLに変更
FLASHC.FCR.fws = 1; // 1ウェイト
PM.mcctrl = AVR32_PM_MCCTRL_OSC0EN_MASK | (AVR32_PM_MCCTRL_MCSEL_PLL0 << AVR32_PM_MCCTRL_MCSEL);
PM.gcctrl[AVR32_PM_GCLK_USBB] = AVR32_PM_GCCTRL_CEN_MASK | AVR32_PM_GCCTRL_PLLSEL_MASK; // GCLK_USBBへクロック供給
// 不必要なモジュールへのクロック供給を止める
PM.hsbmask = 0b11111;
PM.pbamask = 0b01001100001111;
PM.pbbmask = 0b111;
}
|
[
"nkyoku@gmail.com"
] |
nkyoku@gmail.com
|
2836cc2ff90006c56dfc9d735f007da40e07ddc4
|
696e35ccdf167c3f6b1a7f5458406d3bb81987c9
|
/content/browser/renderer_host/frame_connector_delegate.h
|
b82851f6cadc756f83522395e540a0afb13a96ba
|
[
"BSD-3-Clause"
] |
permissive
|
mgh3326/iridium-browser
|
064e91a5e37f4e8501ea971483bd1c76297261c3
|
e7de6a434d2659f02e94917be364a904a442d2d0
|
refs/heads/master
| 2023-03-30T16:18:27.391772
| 2019-04-24T02:14:32
| 2019-04-24T02:14:32
| 183,128,065
| 0
| 0
|
BSD-3-Clause
| 2019-11-30T06:06:02
| 2019-04-24T02:04:51
| null |
UTF-8
|
C++
| false
| false
| 11,346
|
h
|
// 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.
#ifndef CONTENT_BROWSER_RENDERER_HOST_FRAME_CONNECTOR_DELEGATE_H_
#define CONTENT_BROWSER_RENDERER_HOST_FRAME_CONNECTOR_DELEGATE_H_
#include "base/time/time.h"
#include "cc/input/touch_action.h"
#include "components/viz/common/surfaces/local_surface_id_allocation.h"
#include "components/viz/host/hit_test/hit_test_query.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
#include "content/common/content_export.h"
#include "content/public/common/input_event_ack_state.h"
#include "content/public/common/screen_info.h"
#include "ui/gfx/geometry/rect.h"
#if defined(USE_AURA)
#include "services/ws/public/mojom/window_tree.mojom.h"
#endif
namespace blink {
class WebGestureEvent;
struct WebIntrinsicSizingInfo;
}
namespace cc {
class RenderFrameMetadata;
}
namespace viz {
class SurfaceId;
class SurfaceInfo;
} // namespace viz
namespace content {
class RenderWidgetHostViewBase;
class RenderWidgetHostViewChildFrame;
class WebCursor;
struct FrameVisualProperties;
//
// FrameConnectorDelegate
//
// An interface to be implemented by an object supplying platform semantics
// for a child frame.
//
// A RenderWidgetHostViewChildFrame, specified by a call to |SetView|, uses
// this interface to communicate renderer-originating messages such as mouse
// cursor changes or input event ACKs to its platform.
// CrossProcessFrameConnector implements this interface and coordinates with
// higher-level RenderWidgetHostViews to ensure that the underlying platform
// (e.g. Mac, Aura, Android) correctly reflects state from frames in multiple
// processes.
//
// RenderWidgetHostViewChildFrame also uses this interface to query relevant
// platform information, such as the size of the rect that the frame will draw
// into, and whether the view currently has keyboard focus.
class CONTENT_EXPORT FrameConnectorDelegate {
public:
virtual void SetView(RenderWidgetHostViewChildFrame* view);
// Returns the parent RenderWidgetHostView or nullptr if it doesn't have one.
virtual RenderWidgetHostViewBase* GetParentRenderWidgetHostView();
// Returns the view for the top-level frame under the same WebContents.
virtual RenderWidgetHostViewBase* GetRootRenderWidgetHostView();
// Notify the frame connector that the renderer process has terminated.
virtual void RenderProcessGone() {}
// Provide the SurfaceInfo to the embedder, which becomes a reference to the
// current view's Surface that is included in higher-level compositor
// frames.
virtual void FirstSurfaceActivation(const viz::SurfaceInfo& surface_info) {}
// Sends the given intrinsic sizing information from a sub-frame to
// its corresponding remote frame in the parent frame's renderer.
virtual void SendIntrinsicSizingInfoToParent(
const blink::WebIntrinsicSizingInfo&) {}
// Sends new resize parameters to the sub-frame's renderer.
void SynchronizeVisualProperties(
const viz::FrameSinkId& frame_sink_id,
const FrameVisualProperties& visual_properties);
// Return the size of the CompositorFrame to use in the child renderer.
const gfx::Size& local_frame_size_in_pixels() const {
return local_frame_size_in_pixels_;
}
// Return the size of the CompositorFrame to use in the child renderer in DIP.
// This is used to set the layout size of the child renderer.
const gfx::Size& local_frame_size_in_dip() const {
return local_frame_size_in_dip_;
}
// Return the rect in DIP that the RenderWidgetHostViewChildFrame's content
// will render into.
const gfx::Rect& screen_space_rect_in_dip() const {
return screen_space_rect_in_dip_;
}
// Return the rect in pixels that the RenderWidgetHostViewChildFrame's content
// will render into.
const gfx::Rect& screen_space_rect_in_pixels() const {
return screen_space_rect_in_pixels_;
}
// Return the latest capture sequence number of this delegate.
uint32_t capture_sequence_number() const { return capture_sequence_number_; }
// Request that the platform change the mouse cursor when the mouse is
// positioned over this view's content.
virtual void UpdateCursor(const WebCursor& cursor) {}
// Given a point in the current view's coordinate space, return the same
// point transformed into the coordinate space of the top-level view's
// coordinate space.
virtual gfx::PointF TransformPointToRootCoordSpace(
const gfx::PointF& point,
const viz::SurfaceId& surface_id);
// Given a point in the coordinate space of a different Surface, transform
// it into the coordinate space for this view (corresponding to
// local_surface_id).
// TransformPointToLocalCoordSpaceLegacy() can only transform points between
// surfaces where one is embedded (not necessarily directly) within the
// other, and will return false if this is not the case. For points that can
// be in sibling surfaces, they must first be converted to the root
// surface's coordinate space.
virtual bool TransformPointToLocalCoordSpaceLegacy(
const gfx::PointF& point,
const viz::SurfaceId& original_surface,
const viz::SurfaceId& local_surface_id,
gfx::PointF* transformed_point);
// Transform a point into the coordinate space of the root
// RenderWidgetHostView, for the current view's coordinate space.
// Returns false if |target_view| and |view_| do not have the same root
// RenderWidgetHostView.
virtual bool TransformPointToCoordSpaceForView(
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
const viz::SurfaceId& local_surface_id,
gfx::PointF* transformed_point,
viz::EventSource source = viz::EventSource::ANY);
// Pass acked touchpad pinch or double tap gesture events to the root view
// for processing.
virtual void ForwardAckedTouchpadZoomEvent(
const blink::WebGestureEvent& event,
InputEventAckState ack_result) {}
// Gesture events with unused scroll deltas must be bubbled to ancestors
// who may consume the delta.
virtual void BubbleScrollEvent(const blink::WebGestureEvent& event) {}
// Determines whether the root RenderWidgetHostView (and thus the current
// page) has focus.
virtual bool HasFocus();
// Cause the root RenderWidgetHostView to become focused.
virtual void FocusRootView() {}
// Locks the mouse. Returns true if mouse is locked.
virtual bool LockMouse();
// Unlocks the mouse if the mouse is locked.
virtual void UnlockMouse() {}
// Returns a rect that represents the intersection of the current view's
// content bounds with the top-level browser viewport.
const gfx::Rect& viewport_intersection_rect() const {
return viewport_intersection_rect_;
}
// Returns a rect in physical pixels that indicates the area of the current
// view's content bounds that should be rastered by the compositor.
const gfx::Rect& compositor_visible_rect() const {
return compositor_visible_rect_;
}
// Returns whether the current view may be occluded or distorted (e.g, with
// CSS opacity or transform) in the parent view.
bool occluded_or_obscured() const { return occluded_or_obscured_; }
// Returns the viz::LocalSurfaceIdAllocation propagated from the parent to be
// used by this child frame.
const viz::LocalSurfaceIdAllocation& local_surface_id_allocation() const {
return local_surface_id_allocation_;
}
// Returns the ScreenInfo propagated from the parent to be used by this
// child frame.
const ScreenInfo& screen_info() const { return screen_info_; }
void SetScreenInfoForTesting(const ScreenInfo& screen_info) {
screen_info_ = screen_info;
}
// Informs the parent the child will enter auto-resize mode, automatically
// resizing itself to the provided |min_size| and |max_size| constraints.
virtual void EnableAutoResize(const gfx::Size& min_size,
const gfx::Size& max_size);
// Turns off auto-resize mode.
virtual void DisableAutoResize();
// Determines whether the current view's content is inert, either because
// an HTMLDialogElement is being modally displayed in a higher-level frame,
// or because the inert attribute has been specified.
virtual bool IsInert() const;
// Returns the inherited effective touch action property that should be
// applied to any nested child RWHVCFs inside the caller RWHVCF.
virtual cc::TouchAction InheritedEffectiveTouchAction() const;
// Determines whether the RenderWidgetHostViewChildFrame is hidden due to
// a higher-level embedder being hidden. This is distinct from the
// RenderWidgetHostImpl being hidden, which is a property set when
// RenderWidgetHostView::Hide() is called on the current view.
virtual bool IsHidden() const;
// Determines whether the child frame should be render throttled, which
// happens when the entire rect is offscreen.
virtual bool IsThrottled() const;
virtual bool IsSubtreeThrottled() const;
// Called by RenderWidgetHostViewChildFrame to update the visibility of any
// nested child RWHVCFs inside it.
virtual void SetVisibilityForChildViews(bool visible) const {}
// Called to resize the child renderer's CompositorFrame.
// |local_frame_size| is in pixels if zoom-for-dsf is enabled, and in DIP
// if not.
virtual void SetLocalFrameSize(const gfx::Size& local_frame_size);
// Called to resize the child renderer. |screen_space_rect| is in pixels if
// zoom-for-dsf is enabled, and in DIP if not.
virtual void SetScreenSpaceRect(const gfx::Rect& screen_space_rect);
#if defined(USE_AURA)
// Embeds a WindowTreeClient in the parent. This results in the parent
// creating a window in the ui server so that this can render to the screen.
virtual void EmbedRendererWindowTreeClientInParent(
ws::mojom::WindowTreeClientPtr window_tree_client) {}
#endif
// Called by RenderWidgetHostViewChildFrame when the child frame has updated
// its visual properties and its viz::LocalSurfaceId has changed.
virtual void DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {}
bool has_size() const { return has_size_; }
protected:
explicit FrameConnectorDelegate(bool use_zoom_for_device_scale_factor);
virtual ~FrameConnectorDelegate() {}
// The RenderWidgetHostView for the frame. Initially NULL.
RenderWidgetHostViewChildFrame* view_ = nullptr;
// This is here rather than in the implementation class so that
// ViewportIntersection() can return a reference.
gfx::Rect viewport_intersection_rect_;
gfx::Rect compositor_visible_rect_;
bool occluded_or_obscured_ = false;
ScreenInfo screen_info_;
gfx::Size local_frame_size_in_dip_;
gfx::Size local_frame_size_in_pixels_;
gfx::Rect screen_space_rect_in_dip_;
gfx::Rect screen_space_rect_in_pixels_;
viz::LocalSurfaceIdAllocation local_surface_id_allocation_;
bool has_size_ = false;
const bool use_zoom_for_device_scale_factor_;
uint32_t capture_sequence_number_ = 0u;
FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewChildFrameZoomForDSFTest,
CompositorViewportPixelSize);
};
} // namespace content
#endif // CONTENT_BROWSER_RENDERER_HOST_FRAME_CONNECTOR_DELEGATE_H_
|
[
"commit-bot@chromium.org"
] |
commit-bot@chromium.org
|
6eb3c09de229bcbcb05cbb41ad19c6aee8bf34cf
|
9d4a6336eca4c4189fe42f71d5ea05bc5368f84d
|
/lab7/main.cpp
|
3b66f0a56d8917c35c6f7d0b0e7fd025152ba0cb
|
[] |
no_license
|
marelix2/grafika_cpp
|
fc146a8441fbbbaa525972706700a88031d4866a
|
1600664c09e28e4005e26de23e804a5cba675496
|
refs/heads/master
| 2021-05-08T00:51:29.655063
| 2017-11-20T00:38:08
| 2017-11-20T00:38:08
| 107,814,581
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,024
|
cpp
|
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
#include <iostream>
class Ff{
float firstDimX[12][3];
float firstDimY[12][3];
float secDimX[12][2];
float secDimY[12][2];
float d = 150;
public:
Ff(){
startUp2D();
secDim();
}
void startUp2D(){
firstDimX[0][0] = 200;
firstDimX[0][1] = 400;
firstDimX[0][2] = 50;
firstDimY[0][0] = 200;
firstDimY[0][1] = 200;
firstDimY[0][2] = 200;
firstDimX[1][0] = 400;
firstDimX[1][1] = 400;
firstDimX[1][2] = 50;
firstDimY[1][0] = 200;
firstDimY[1][1] = 300;
firstDimY[1][2] = 200;
firstDimX[2][0] = 400;
firstDimX[2][1] = 250;
firstDimX[2][2] = 50;
firstDimY[2][0] = 300;
firstDimY[2][1] = 300;
firstDimY[2][2] = 200;
firstDimX[3][0] = 250;
firstDimX[3][1] = 250;
firstDimX[3][2] = 50;
firstDimY[3][0] = 300;
firstDimY[3][1] = 400;
firstDimY[3][2] = 200;
firstDimX[4][0] = 250;
firstDimX[4][1] = 350;
firstDimX[4][2] = 50;
firstDimY[4][0] = 400;
firstDimY[4][1] = 400;
firstDimY[4][2] = 200;
firstDimX[5][0] = 350;
firstDimX[5][1] = 350;
firstDimX[5][2] = 50;
firstDimY[5][0] = 400;
firstDimY[5][1] = 500;
firstDimY[5][2] = 200;
firstDimX[6][0] = 350;
firstDimX[6][1] = 250;
firstDimX[6][2] = 50;
firstDimY[6][0] = 500;
firstDimY[6][1] = 500;
firstDimY[6][2] = 200;
firstDimX[7][0] = 250;
firstDimX[7][1] = 250;
firstDimX[7][2] = 50;
firstDimY[7][0] = 500;
firstDimY[7][1] = 600;
firstDimY[7][2] = 200;
firstDimX[8][0] = 250;
firstDimX[8][1] = 400;
firstDimX[8][2] = 50;
firstDimY[8][0] = 600;
firstDimY[8][1] = 600;
firstDimY[8][2] = 200;
firstDimX[9][0] = 400;
firstDimX[9][1] = 400;
firstDimX[9][2] = 50;
firstDimY[9][0] = 600;
firstDimY[9][1] = 700;
firstDimY[9][2] = 200;
firstDimX[10][0] = 400;
firstDimX[10][1] = 200;
firstDimX[10][2] = 50;
firstDimY[10][0] = 700;
firstDimY[10][1] = 700;
firstDimY[10][2] = 200;
firstDimX[11][0] = 200;
firstDimX[11][1] = 200;
firstDimX[11][2] = 50;
firstDimY[11][0] = 700;
firstDimY[11][1] = 200;
firstDimY[11][2] = 200;
}
void secDim(int dd){
d += dd;
for(int i = 0; i < 12; i++){
secDimX[i][0] = firstDimX[i][0] * (d / (firstDimX[i][2]+ d));
secDimX[i][1] = firstDimX[i][1] * (d / (firstDimX[i][2]+ d));
secDimY[i][0] = firstDimY[i][0] * (d / (firstDimY[i][2]+ d));
secDimY[i][1] = firstDimY[i][1] * (d / (firstDimY[i][2]+ d));
}
}
void secDim(){
for(int i = 0; i < 12; i++){
secDimX[i][0] = firstDimX[i][0] * (d / (firstDimX[i][2]+ d));
secDimX[i][1] = firstDimX[i][1] * (d / (firstDimX[i][2]+ d));
secDimY[i][0] = firstDimY[i][0] * (d / (firstDimY[i][2]+ d));
secDimY[i][1] = firstDimY[i][1] * (d / (firstDimY[i][2]+ d));
}
}
void printIn2D(){
for (int i=0;i<12;i++) line(screen,firstDimX[i][0],firstDimY[i][0],firstDimX[i][1],firstDimY[i][1],makecol(255,0,0));
}
void printIn3D(){
for (int i=0;i<12;i++) {
line(screen,firstDimX[i][0],firstDimY[i][0],firstDimX[i][1],firstDimY[i][1],makecol(255,0,0));
line(screen,secDimX[i][0],secDimY[i][0],secDimX[i][1],secDimY[i][1],makecol(255,0,0));
line(screen,firstDimX[i][1],firstDimY[i][1],secDimX[i][1],secDimY[i][1],makecol(255,0,0));
}
}
};
int main(int argc, char *argv[]){
int SCREEN_WIDTH = 800;
int SCREEN_HEIGHT = 800;
allegro_init();
install_keyboard();
srand(time(NULL));
set_color_depth(24);
if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0) != 0){
allegro_message("BLAD\n");
};
Ff ff;
while (!key[KEY_ESC]){
if (key[KEY_R]) {
clear_bitmap(screen);
ff.printIn2D();
}
if (key[KEY_S]) {
clear_bitmap(screen);
ff.printIn3D();
}
if (key[KEY_PLUS_PAD]) {
clear_bitmap(screen);
ff.secDim(10);
ff.printIn3D();
}
if (key[KEY_MINUS_PAD]) {
clear_bitmap(screen);
ff.secDim(-10);
ff.printIn3D();
}
}
allegro_exit();
return 0;
}
END_OF_MAIN();
|
[
"marelix2@gmail.com"
] |
marelix2@gmail.com
|
569a06aa3e8f0fd11153453e0e9686851f52eb07
|
1447861e661b5ba2e208db33726366b7e471cf5e
|
/runtime/windows/include/yat/memory/MemBuf.h
|
053709441903761e588d55f75d29ecb3895c35cf
|
[
"BSD-3-Clause"
] |
permissive
|
tango-controls/igorpro-binding
|
f8725d2e8e953442d517c22b97b4319d287b892b
|
d242bb3102fface2c526b786bceb6c88bb056f1c
|
refs/heads/master
| 2021-06-19T03:47:31.052114
| 2020-11-23T07:33:15
| 2020-11-23T07:33:15
| 75,382,824
| 0
| 1
|
BSD-3-Clause
| 2019-03-15T12:56:19
| 2016-12-02T09:49:10
|
C++
|
UTF-8
|
C++
| false
| false
| 14,477
|
h
|
//----------------------------------------------------------------------------
// Copyright (c) 2004-2015 Synchrotron SOLEIL
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the GNU Lesser Public License v3
// which accompanies this distribution, and is available at
// http://www.gnu.org/licenses/lgpl.html
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// YAT LIBRARY
//----------------------------------------------------------------------------
//
// Copyright (C) 2006-2014 The Tango Community
//
// Part of the code comes from the ACE Framework (asm bytes swaping code)
// see http://www.cs.wustl.edu/~schmidt/ACE.html for more about ACE
//
// The thread native implementation has been initially inspired by omniThread
// - the threading support library that comes with omniORB.
// see http://omniorb.sourceforge.net/ for more about omniORB.
// The YAT library 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 2 of the License, or (at your option)
// any later version.
//
// The YAT library 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.
//
// See COPYING file for license details
//
// Contact:
// Nicolas Leclercq
// Synchrotron SOLEIL
//------------------------------------------------------------------------------
/*!
* \author See AUTHORS file
*/
#ifndef __YAT_MEMBUF_H__
#define __YAT_MEMBUF_H__
#include <yat/CommonHeader.h>
namespace yat
{
//! \brief 32 bits CRC calculation.
//!
//! This function offers two usages :
//! - pulInitValue set to NULL value : CRC is calculated for the input buffer,
//! - pulInitValue NOT set to NULL : CRC is calculated for a set of buffers.
//! For example, with p1 & p2 two buffer pointers :
//! \n
//! uint32 ulCrc = 0xFFFFFFFFL;\n
//! ulCrc = crc( p1, uiP1Len, &ulCrc );\n
//! ulCrc = crc( p2, uiP2Len, &ulCrc );\n
//! ulCrc = ulCrc ^ 0xFFFFFFFFL; \n
//! \param pBuf Input buffer pointer.
//! \param uiLen Size of inputr buffer, in bytes.
//! \param pulInitValue Initial crc value.
uint32 crc( const byte *pBuf, uint32 uiLen, uint32 *pulInitValue = NULL );
//===========================================================================
// endian management
//===========================================================================
//! \brief Short value inversion : AB --\> BA
//! \param pS Short value to invert (in/out).
inline void invert_short(short *pS)
{
// AB -> BA
char *p = (char*)pS;
char c = *p;
*p = *(p+1);
*(p+1) = c;
}
//! \brief Long value inversion : ABCD --\> DCBA
//! \param pL Long value to invert (in/out).
inline void invert_long(long *pL)
{
// ABCD -> DCBA
char *p = (char*)pL;
char c = *p;
*p = *(p+3);
*(p+3) = c;
c = *(p+1);
*(p+1) = *(p+2);
*(p+2) = c;
}
//! \brief Float value inversion : ABCD --\> DCBA
//! \param pF Float value to invert (in/out).
inline void invert_float(float *pF)
{
// ABCD -> DCBA
invert_long((long*)pF);
}
//! \brief Double value inversion : ABCDEFGH --\> HGFEDCBA
//! \param pD Double value to invert (in/out).
inline void invert_double(double *pD)
{
// ABCDEFGH -> HGFEDCBA
char *p = (char*)pD;
char c = *p;
*p = *(p+7);
*(p+7) = c;
c = *(p+1);
*(p+1) = *(p+6);
*(p+6) = c;
c = *(p+2);
*(p+2) = *(p+5);
*(p+5) = c;
c = *(p+3);
*(p+3) = *(p+4);
*(p+4) = c;
}
//! \brief Integer64 value inversion : ABCDEFGH --\> HGFEDCBA
//! \param pi64 Integer64 value to invert (in/out).
inline void invert_int64(int64 *pi64)
{
// ABCDEFGH -> HGFEDCBA
invert_double((double*)pi64);
}
//===================================================================
// Constantes
//===================================================================
// Latest crypying version
#define REVCRYPT_LATEST_VERSION -1
#define VARLENGTH_CRYPT 2
#define OFFSET(type,field) \
(int)&(((type*)NULL)->field)
//===========================================================================
//! \class MemBuf
//! \brief Auto-sized binary buffer with cryptographic capabilities.
//!
//! This class provides a managed buffer with :
//! - auto memory re-allocation in case used binary blocs length exceeds the current
//! buffer capacity,
//! - insertion functions (including streaming functions) to fill the buffer,
//! - extraction functions (including streaming functions) to read the buffer,
//! - CRC calculation function.
//===========================================================================
class YAT_DECL MemBuf
{
public:
//! \brief Constructor.
//!
//! \param uiLenBuf Buffer capacity in bytes.
MemBuf(uint32 uiLenBuf=0) ;
//! \brief Copy Constructor.
//!
//! \param buf The source buffer.
MemBuf(const MemBuf& buf) ;
//! \brief Destructor
//!
//! Releases memory only if buffer is owned by this instance.
~MemBuf() ;
//! \brief Operator=.
//!
//! \param buf The source buffer.
MemBuf& operator=(const MemBuf& buf);
//! \brief Comparison operator.
//!
//! Returns true if buffers are equal, false otherwise.
//! \param mb The source buffer.
bool operator==(const MemBuf &mb) const;
//! \brief Attachment from an external buffer.
//!
//! \param pBuf Pointer to memory area to attach.
//! \param uiLen Memory area size.
//! \param bOwner If set to true, this instance will own the buffer.
void attach(char* pBuf, uint32 uiLen, bool bOwner = false);
//! \brief Returns the size of used binary blocks in the buffer, in bytes.
uint32 len() const { return m_uiLen; }
//! \brief Returns true if the buffer has no used binary block.
int is_empty() const { return m_uiLen==0; }
//! \brief Returns the buffer capacity in bytes (size of allocated storage space).
uint32 buf_len() const { return m_uiLenBuf; }
//! \brief Returns the buffer pointer.
char* buf() const { return m_pBuf; }
//! \brief Returns the buffer pointer in *bytes* data type.
byte *bytes() const { return (byte *)m_pBuf; }
//! \brief Returns the current read position of the buffer.
uint32 pos() const { return m_uiPos; }
//! \brief Sets new buffer capacity in bytes.
//!
//! \param ui New buffer capacity in bytes.
//! \remark If the specified capacity is greater than current capacity, memory is
//! reallocated for the buffer.
void set_len(uint32 ui);
//! \brief Reallocates the specified memory size for the buffer.
//!
//! \param uiNewLenBuf New buffer capacity in bytes.
//! \remark If the specified capacity is smaller than the size of
//! used binary blocks in the buffer, this function makes nothing.
void realloc(uint32 uiNewLenBuf);
//! \brief Adds a binary block in the buffer.
//!
//! Inserts a binary block of data at the end of the buffer.
//! \param p Pointer to the binary block to add.
//! \param uiNb Size of the binary block in bytes.
//! \remark If the block size is greater than the remaining capacity of the buffer,
//! memory is reallocated and the buffer capacity increased.
void put_bloc(const void* p, uint32 uiNb);
//! \brief Gets a binary block from the buffer.
//!
//! Reads the specified number of bytes from the current read position.\n
//! If the number of bytes to read is greater than the size of the
//! remaining binary blocks in buffer, returns (1) and does not fill \<p\>.
//! Returns (0) otherwise.
//! \param p Pointer to the binary block read from the buffer.
//! \param uiNb Number of bytes to read from the buffer.
//! \remark \<p\> must have been allocated before using this function.
int get_bloc(void* p, uint32 uiNb);
//! \brief Inserts a binary block in the buffer at given offset.
//!
//! Inserts a binary block of data at the specified position. The current data
//! at the specified position are moved after inserted data.
//! \param p Pointer to the binary block to insert.
//! \param uiNb Size of the binary block in bytes.
//! \param uiPos Position in bytes.
//! \remark If the block size is greater than the remaining capacity of the buffer,
//! memory is reallocated and the buffer capacity increased.
void insert_bloc(const void* p, uint32 uiNb, uint32 uiPos);
//! \brief Moves a part of the buffer.
//!
//! Copies a block of data from one position of the buffer to another.
//! \param uiDst Destination position in the buffer, in bytes.
//! \param uiSrc Source position in the buffer, in bytes.
//! \param uiSize Block size, in bytes.
void move_bloc(uint32 uiDst, uint32 uiSrc, uint32 uiSize);
//! \brief Sets current read position to the beginning of the buffer.
void rewind() { m_uiPos = 0; }
//! \brief Sets the current read position to specified offset.
//!
//! \param ui Read position in bytes.
void set_pos(uint32 ui)
{
//## ASSERT(ui <= m_uiLen)
m_uiPos = ui;
}
//! \brief Resets buffer without freeing memory.
void empty()
{
m_uiPos = 0 ;
m_uiLen = 0 ;
}
//! \brief Gives buffer ownership to *this* instance.
//!
//! \param bOwner If set to true, gives ownership to *this* instance.
void set_owner(bool bOwner) { m_bOwner = bOwner; }
//! \brief Gives buffer ownership to another instance.
//!
//! The ownership transfer is possible only if *this* instance owns the buffer.
//! Returns (-1) if *this* instance does not own the buffer, (0) otherwise.
//! \param pToHaveOwnership Pointer to the instance which gains the buffer ownership.
int give_ownership(MemBuf* pToHaveOwnership);
//! \brief Resets buffer with memory freeing.
//!
//! \remark Memory is deallocated if *this* instance owns the buffer.
void reset();
//! \brief Computes CRC on used binary blocks of the buffer.
//!
//! Returns a 32 bits CRC value.
uint32 get_crc() const;
//! \brief Gets pointer to current position.
char *cur_pointer() const { return (m_pBuf + m_uiPos); }
//! \brief Input stream function for a boolean value.
//! \param b Boolean value to add in buffer.
MemBuf& operator<<(bool b);
//! \brief Output stream function for a boolean value.
//! \param b Boolean value read from buffer.
MemBuf& operator>>(bool &b);
//! \brief Input stream function for a character value.
//! \param c Character value to add in buffer.
MemBuf& operator<<(char c);
//! \brief Output stream function for a character value.
//! \param c Character value read from buffer.
MemBuf& operator>>(char &c);
//! \brief Input stream function for a byte value.
//! \param uc Byte value to add in buffer.
MemBuf& operator<<(byte uc);
//! \brief Output stream function for a byte value.
//! \param uc Byte value read from buffer.
MemBuf& operator>>(byte &uc);
//! \brief Input stream function for an integer16 value.
//! \param s Integer16 value to add in buffer.
MemBuf& operator<<(int16 s);
//! \brief Output stream function for an integer16 value.
//! \param s Integer16 value read from buffer.
MemBuf& operator>>(int16 &s);
//! \brief Input stream function for an unsigned integer16 value.
//! \param us Unsigned integer16 value to add in buffer.
MemBuf& operator<<(uint16 us);
//! \brief Output stream function for an unsigned integer16 value.
//! \param us Unsigned integer16 value read from buffer.
MemBuf& operator>>(uint16 &us);
//! \brief Input stream function for an integer32 value.
//! \param l Integer32 value to add in buffer.
MemBuf& operator<<(int32 l);
//! \brief Output stream function for an integer32 value.
//! \param l Integer32 value read from buffer.
MemBuf& operator>>(int32 &l);
//! \brief Input stream function for an unsigned integer32 value.
//! \param ul Unsigned integer32 value to add in buffer.
MemBuf& operator<<(uint32 ul);
//! \brief Output stream function for an unsigned integer32 value.
//! \param ul Unsigned integer32 value read from buffer.
MemBuf& operator>>(uint32 &ul);
//! \brief Input stream function for an integer64 value.
//! \param i64 Integer64 value to add in buffer.
MemBuf& operator<<(int64 i64);
//! \brief Output stream function for an integer64 value.
//! \param i64 Integer64 value read from buffer.
MemBuf& operator>>(int64 &i64);
//! \brief Input stream function for an unsigned integer64 value.
//! \param i64 Unsigned integer64 value to add in buffer.
MemBuf& operator<<(uint64 i64);
//! \brief Output stream function for an unsigned integer64 value.
//! \param i64 Unsigned integer64 value read from buffer.
MemBuf& operator>>(uint64 &i64);
//! \brief Input stream function for a float value.
//! \param f Float value to add in buffer.
MemBuf& operator<<(float f);
//! \brief Output stream function for a float value.
//! \param f Float value read from buffer.
MemBuf& operator>>(float &f);
//! \brief Input stream function for a double value.
//! \param d Double value to add in buffer.
MemBuf& operator<<(double d);
//! \brief Output stream function for a double value.
//! \param d Double value read from buffer.
MemBuf& operator>>(double &d);
//! \brief Input stream function for a binary buffer.
//! \param psz Pointer to binary buffer to add in buffer.
MemBuf& operator<<(const char* psz);
//! \brief Input stream function for a string value.
//! \param string String value to add in buffer.
MemBuf& operator<<(const std::string& string);
//! \brief Output stream function for a string value.
//! \param string String value read from buffer.
MemBuf& operator>>(std::string& string);
//! \brief Input stream function for a MemBuf buffer.
//! \param membuf MemBuf buffer to add in buffer.
MemBuf& operator<<(const MemBuf& membuf);
private:
//- Read position
uint32 m_uiPos;
//- Size of used binary blocks in bytes.
uint32 m_uiLen;
//- Buffer capacity (allocated size) in bytes.
uint32 m_uiLenBuf;
//- Buffer pointer.
char* m_pBuf;
//- If true the instance owns the buffer.
bool m_bOwner;
//- Re-allocation function.
void realloc_with_margin(uint32 uiNewSize) ;
};
} // namespace
#endif // __MEMBUF_H___
|
[
"LECLERCQ@synchrotron-soleil.fr"
] |
LECLERCQ@synchrotron-soleil.fr
|
3a442f388380273df20857fadd477ada2aaa7917
|
0f60cd9ea6cb42cd2e89a19c0de2821395108c9b
|
/libtorrent/include/libtorrent/session_status.hpp
|
c862677d7d764fe614fb51293fead3d741d8b123
|
[
"MIT",
"BSD-3-Clause",
"Zlib",
"BSL-1.0"
] |
permissive
|
Stefanpop19/Libraries
|
b1dd683a2a2e491d63a523cdcda4fef30c72de6c
|
3a4eb74dc1f493fededfefacc69c16cd959e6f51
|
refs/heads/master
| 2020-03-26T23:28:36.365691
| 2018-05-22T08:20:16
| 2018-05-22T08:20:16
| 145,545,400
| 1
| 0
| null | 2018-08-21T10:04:17
| 2018-08-21T10:04:17
| null |
UTF-8
|
C++
| false
| false
| 8,804
|
hpp
|
/*
Copyright (c) 2006-2018, Arvid Norberg
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 author 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.
*/
#ifndef TORRENT_SESSION_STATUS_HPP_INCLUDED
#define TORRENT_SESSION_STATUS_HPP_INCLUDED
#include "libtorrent/config.hpp"
#include <vector>
#if TORRENT_ABI_VERSION == 1
// for dht_lookup and dht_routing_bucket
#include "libtorrent/alert_types.hpp"
#endif
namespace libtorrent {
#if TORRENT_ABI_VERSION == 1
// holds counters and gauges for the uTP sockets
// deprecated in 1.1 in favor of session_stats counters, which is a more
// flexible, extensible and performant mechanism for stats.
struct TORRENT_EXPORT utp_status
{
// gauges. These are snapshots of the number of
// uTP sockets in each respective state
int num_idle;
int num_syn_sent;
int num_connected;
int num_fin_sent;
int num_close_wait;
// These are monotonically increasing
// and cumulative counters for their respective event.
std::uint64_t packet_loss;
std::uint64_t timeout;
std::uint64_t packets_in;
std::uint64_t packets_out;
std::uint64_t fast_retransmit;
std::uint64_t packet_resend;
std::uint64_t samples_above_target;
std::uint64_t samples_below_target;
std::uint64_t payload_pkts_in;
std::uint64_t payload_pkts_out;
std::uint64_t invalid_pkts_in;
std::uint64_t redundant_pkts_in;
};
// contains session wide state and counters
// deprecated in 1.1 in favor of session_stats counters, which is a more
// flexible, extensible and performant mechanism for stats.
struct TORRENT_EXPORT session_status
{
// false as long as no incoming connections have been
// established on the listening socket. Every time you change the listen port, this will
// be reset to false.
bool has_incoming_connections;
// the total download and upload rates accumulated
// from all torrents. This includes bittorrent protocol, DHT and an estimated TCP/IP
// protocol overhead.
// deprecated, use session_stats_metrics "net.recv_bytes" + "net.recv_ip_overhead_bytes"
// they does include payload + protocol + ip overhead bytes
int upload_rate;
int download_rate;
// the total number of bytes downloaded and
// uploaded to and from all torrents. This also includes all the protocol overhead.
// deprecated, use session_stats_metrics "net.recv_bytes" + "net.recv_ip_overhead_bytes"
// they does include payload + protocol + ip overhead bytes
std::int64_t total_download;
std::int64_t total_upload;
// the rate of the payload
// down- and upload only.
// deprecated, use session_stats_metrics "net.recv_payload_bytes"
int payload_upload_rate;
// deprecated, use session_stats_metrics "net.sent_payload_bytes"
int payload_download_rate;
// the total transfers of payload
// only. The payload does not include the bittorrent protocol overhead, but only parts of the
// actual files to be downloaded.
// ``total_payload_download`` is deprecated, use session_stats_metrics
// "net.recv_payload_bytes" ``total_payload_upload`` is deprecated, use
// session_stats_metrics "net.sent_payload_bytes"
std::int64_t total_payload_download;
std::int64_t total_payload_upload;
// the estimated TCP/IP overhead in each direction.
int ip_overhead_upload_rate;
int ip_overhead_download_rate;
std::int64_t total_ip_overhead_download;
std::int64_t total_ip_overhead_upload;
// the upload and download rate used by DHT traffic. Also the total number
// of bytes sent and received to and from the DHT.
int dht_upload_rate;
int dht_download_rate;
std::int64_t total_dht_download;
std::int64_t total_dht_upload;
// the upload and download rate used by tracker traffic. Also the total number
// of bytes sent and received to and from trackers.
int tracker_upload_rate;
int tracker_download_rate;
std::int64_t total_tracker_download;
std::int64_t total_tracker_upload;
// the number of bytes that has been received more than once.
// This can happen if a request from a peer times out and is requested from a different
// peer, and then received again from the first one. To make this lower, increase the
// ``request_timeout`` and the ``piece_timeout`` in the session settings.
std::int64_t total_redundant_bytes;
// the number of bytes that was downloaded which later failed
// the hash-check.
std::int64_t total_failed_bytes;
// the total number of peer connections this session has. This includes
// incoming connections that still hasn't sent their handshake or outgoing connections
// that still hasn't completed the TCP connection. This number may be slightly higher
// than the sum of all peers of all torrents because the incoming connections may not
// be assigned a torrent yet.
int num_peers;
int num_dead_peers;
// the current number of unchoked peers.
int num_unchoked;
// the current allowed number of unchoked peers.
int allowed_upload_slots;
// the number of peers that are
// waiting for more bandwidth quota from the torrent rate limiter.
int up_bandwidth_queue;
int down_bandwidth_queue;
// count the number of
// bytes the connections are waiting for to be able to send and receive.
int up_bandwidth_bytes_queue;
int down_bandwidth_bytes_queue;
// tells the number of
// seconds until the next optimistic unchoke change and the start of the next
// unchoke interval. These numbers may be reset prematurely if a peer that is
// unchoked disconnects or becomes not interested.
int optimistic_unchoke_counter;
int unchoke_counter;
// the number of peers currently
// waiting on a disk write or disk read to complete before it receives or sends
// any more data on the socket. It'a a metric of how disk bound you are.
int disk_write_queue;
int disk_read_queue;
// only available when
// built with DHT support. They are all set to 0 if the DHT isn't running. When
// the DHT is running, ``dht_nodes`` is set to the number of nodes in the routing
// table. This number only includes *active* nodes, not cache nodes. The
// ``dht_node_cache`` is set to the number of nodes in the node cache. These nodes
// are used to replace the regular nodes in the routing table in case any of them
// becomes unresponsive.
// deprecated, use session_stats_metrics "dht.dht_nodes" and "dht.dht_nodes_cache"
int dht_nodes;
int dht_node_cache;
// the number of torrents tracked by the DHT at the moment.
int dht_torrents;
// an estimation of the total number of nodes in the DHT
// network.
std::int64_t dht_global_nodes;
// a vector of the currently running DHT lookups.
std::vector<dht_lookup> active_requests;
// contains information about every bucket in the DHT routing
// table.
std::vector<dht_routing_bucket> dht_routing_table;
// the number of nodes allocated dynamically for a
// particular DHT lookup. This represents roughly the amount of memory used
// by the DHT.
int dht_total_allocations;
// statistics on the uTP sockets.
utp_status utp_stats;
// the number of known peers across all torrents. These are not necessarily
// connected peers, just peers we know of.
int peerlist_size;
// the number of torrents in the
// session and the number of them that are currently paused, respectively.
int num_torrents;
int num_paused_torrents;
};
#endif // TORRENT_ABI_VERSION
}
#endif // TORRENT_SESSION_STATUS_HPP_INCLUDED
|
[
"linhao@matrix.space"
] |
linhao@matrix.space
|
fbdb4566d4d82e030e9f198d8eecf7553f8714ee
|
9ad7163ecf76ed95b37f2cccaaac21d4f653caaf
|
/include/libdungeon.hpp
|
c68e5937da28cc5aa723fea1af259dd2b3d1c986
|
[] |
no_license
|
skyethepinkcat/libdungeon
|
02a80ef595d269948a86d40887be74b484ba8360
|
ad4b7092530c86af8d30171ea20c3f678609a15e
|
refs/heads/master
| 2022-10-11T01:15:34.450295
| 2020-05-12T14:42:19
| 2020-05-12T14:42:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 97
|
hpp
|
#pragma once
#include "skyelib.hpp"
namespace libdungeon {
extern skyelib::toolkit tools;
}
|
[
"skye@skyenet.online"
] |
skye@skyenet.online
|
082a008126fcc6366d4d0718c1c0e327af83fd5a
|
e1c4dfe112bf2ec6e57ebff1c2e0f5342d1bc5ca
|
/LkUtil/LK/src/LK/Math/DDouble.cpp
|
9ffb778fc6149d67aba8d2b362ae65f00f35e3fb
|
[] |
no_license
|
Melody/LkNetwork
|
e8da6bac6d1aa432dab44e883110e14c146ce058
|
3edfce3e3a7d1cc1d0fe664d8dea0f2d292fb822
|
refs/heads/master
| 2021-01-10T16:23:05.305821
| 2016-04-10T10:03:31
| 2016-04-10T10:03:31
| 55,890,925
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,385
|
cpp
|
#include "stdafx.h"
#ifdef LK_MATH_DDOUBLE_
int LK::Math::DDouble::DefOutPrec = 6;
LK::Math::DDouble::DDouble(double val, double ep) : Exp(ep), Value(val)
{
if (val == 0)Exp = 0;
else if (val >= 1 || (val < 0.5&&val>-0.5) || val <= -1)
{
union
{
double dn;
unsigned long long un;
};
dn = val;
Exp += (long)((un >> 52) & 0x7ff) - 1022.0;
un = (un & 0x800fffffffffffff) | 0x3fe0000000000000;
Value = dn;
}
}
LK::Math::DDouble::DDouble(const std::string &str)
{
char const* pstr = str.c_str();
int i = 0;
while (pstr[i]) { if (pstr[i] == 'e' || pstr[i] == 'E')break; i++; }
double et = i < str.size() ? Strings::ToDouble(str.substr(i + 1, (int)str.size() - (i + 1))) : 0;
Value = Strings::ToDouble(str.substr(0, i));
Value = std::frexp(Value, &i);
Exp = i;
if (Value == 0)Exp = 0;
else
{
*this *= DDouble(10.0).Pow(et);
if (IsError())MakeError(MathError::InputOverflow);
}
}
LK::Math::DDouble::DDouble(double val) :Exp(0), Value(val)
{
if (val != 0 && (val >= 1 || (val < 0.5&&val>-0.5) || val <= -1))
{
union
{
unsigned long long un;
double dn;
};
dn = val;
Exp = long(((un >> 52) & 0x7ff) - 1022);
un = (un & 0x800fffffffffffff) | 0x3fe0000000000000;
Value = dn;
}
}
std::string LK::Math::DDouble::ToString(int len)const
{
if (IsError())
{
int ec = GetErrorCode();
if (ec > 0 || ec < -20)return "未初始化错误";
return MathError::description[-ec];
}
if (Equals0())return "0";
if (len < 0)Throw<std::invalid_argument>("指定长度小于0");
if (len > 24)len = 24;
DDouble ld = Abs();
int i = 62;
double rexp = 0;
if (ld.Exp > (double)MinValues::Int64&&ld.Exp < (double)MaxValues::Int64)//较小时使用精确计算法
{
while (i-- > 0)
if (ld >= _Exp10[i])
{
ld /= _Exp10[i];
rexp += 1LL << i;
}
i = 62;
while (i-- > 0)
if (ld <= DDouble(1.0) / _Exp10[i])
{
ld *= _Exp10[i];
rexp -= 1LL << i;
}
if (ld < DDouble(1.0)) { ld *= *_Exp10; rexp--; }
else if (ld >= DDouble(10.0)) { ld /= *_Exp10; rexp++; }
ld.Value = ld.ToDouble();
}
else//过大将使用对数计算
{
rexp = (ld.Ln() / Ln10).GetIntegerPart().ToDouble();
DDouble tv = ld / DDouble(10).Pow(rexp);
if (tv >= DDouble(10.0) || tv < DDouble(1.0)) { tv.Exp = 1; }
ld.Value = tv.ToDouble();
if (ld.Value < 1.0) { ld.Value *= 10.0; rexp--; }
else if (ld.Value >= 10.0) { ld.Value /= 10.0; rexp++; }
}
std::string str;
str.resize(64);
for (i = 0; i <= len; ++i)
{
str[i] = '0' + (wchar_t)ld.Value;
ld.Value = (ld.Value - (int)ld.Value) * 10;
}
str[len + 1] = 0;
if (str[len] >= '5')//进位
{
str[len] = 0;
for (i = len; i > 0; i--)
if (str[i - 1] < '9') { str[i - 1]++; break; }
else str[i - 1] = 0;
if (str[0] == 0) { str[0] = '1'; rexp++; }
}
else str[len] = 0;
while (len > 0 && (str[len] == 0 || str[len] == '0'))str[len--] = 0;
if (rexp<-4 || rexp>len + 4)//科学计数法,插入小数点,加上指数
{
i = 0;
if (str[1] != 0) {//有必要插入小数点
char tc = '.';
while (str[++i] != 0)
BigObject::Swap(tc, str[i]);
str[i] = tc;
}
str[++i] = 'e';
std::string ss=Strings::FromDouble((rexp > -1000000000000000000ll && rexp < 1000000000000000000ll ? (double)(long long)(rexp + (rexp >= 0 ? 0.5 : -0.5)) : rexp, 0));
++i;
for (int ii = 0; (str[i + ii] = ss[ii]) != 0; ++ii);
}
else if (rexp < 0)
{
for (i = len; i >= 0; --i)str[i - (long long)rexp + 1] = str[i];
str[len + 2 - (long long)rexp] = 0;
for (i = 0; i <= (long long)-rexp; ++i)str[i] = '0';
str[1] = '.';
}
else
{
for (i = 1; i <= rexp; ++i)if (i > len)str[i] = '0';
if (i > len)str[i] = 0;
else
{
for (i = len; i > rexp; --i)str[i + 1] = str[i];
str[len + 2] = 0;
str[(long long)rexp + 1] = '.';
}
}
if (Value < 0)//插入“-”号
{
i = 0;
char tc = '-';
while (str[i] != 0)
BigObject::Swap(tc, str[i++]);
str[i] = tc; str[i + 1] = 0;
}
str.resize(Strings::strlen(str.c_str()));
; return str;
}
LK::Math::DDouble LK::Math::operator+(const DDouble& dda, const DDouble& ddb)
{
if (dda.IsError())return dda;
if (ddb.IsError())return ddb;
if (dda.Value == 0) { return ddb; }
if (ddb.Value == 0) { return dda; }
DDouble ld1 = dda;
DDouble ld2 = ddb;
if ((ld1.Value < 0 && ld2.Value>0) || (ld1.Value > 0 && ld2.Value < 0)) { ld2.Value = -ld2.Value; return ld1 - ld2; }
if (ld1.Exp < ld2.Exp)BigObject::Swap(ld1, ld2);
if (ld1.Exp > ld2.Exp + 53)return ld1;
union
{
unsigned long long un;
double dn;
};
dn = ld2.Value;
un = (un & 0x800fffffffffffff) | (((unsigned long long)(ld2.Exp - ld1.Exp + 1022)) << 52);
ld1.Value += dn;
if (ld1.Value >= 1 || ld1.Value <= -1) {
ld1.Value /= 2; ld1.Exp += 1;
}
return ld1;
}
LK::Math::DDouble LK::Math::operator-(const DDouble& dda, const DDouble& ddb)
{
if (dda.IsError())return dda;
if (ddb.IsError())return ddb;
DDouble ld1 = dda;
DDouble ld2 = ddb;
if (ld1.Value == 0) { ld2.Value = -ld2.Value; return ld2; }
if (ld2.Value == 0) { return ld1; }
if ((ld1.Value < 0 && ld2.Value>0) || (ld1.Value > 0 && ld2.Value < 0)) { ld2.Value = -ld2.Value; return ld1 + ld2; }
if (ld1.Abs() < ld2.Abs()) {
BigObject::Swap(ld1.Exp, ld2.Exp); double v = -ld1.Value; ld1.Value = -ld2.Value; ld2.Value = v;
}
if (ld1.Exp > ld2.Exp + 53)return ld1;
union {
unsigned long long un;
double dn;
};
dn = ld2.Value;
un = (un & 0x800fffffffffffff) | ((unsigned long long)(ld2.Exp - ld1.Exp + 1022) << 52);
ld1.Value -= dn;
return DDouble(ld1.Value, ld1.Exp);
}
LK::Math::DDouble LK::Math::operator*(const DDouble& dda, const DDouble& ddb)
{
if (dda.IsError())return dda;
if (ddb.IsError())return ddb;
DDouble v;
v.Value = dda.Value * ddb.Value;
if (v.Value<0.5 && v.Value>-0.5)
{
v.Exp = dda.Exp + ddb.Exp - 1;
v.Value *= 2;
}
else
{
v.Exp = dda.Exp + ddb.Exp;
}
if (v.Exp > MaxValues::Double)return v.MakeError(MathError::MultiplyExpOverflow);
if (v.Exp < MinValues::Double)return 0;
return v;
}
LK::Math::DDouble LK::Math::operator/(const DDouble& dda, const DDouble& ddb)
{
if (dda.IsError())return dda;
if (ddb.IsError())return ddb;
if (ddb.Equals0())return DDouble(dda).MakeError(MathError::Divide0);
DDouble v;
v.Value = dda.Value / ddb.Value;
if (v.Value<1 && v.Value>-1)
v.Exp = dda.Exp - ddb.Exp;
else
{
v.Value /= 2;
v.Exp = dda.Exp - ddb.Exp + 1;
}
if (v.Exp > MaxValues::Double)return v.MakeError(MathError::DivideExpOverflow);
if (v.Exp < MinValues::Double)return 0;
return v;
}
LK::Math::DDouble LK::Math::operator%(const DDouble& dda, const DDouble& ddb)
{
if (dda.IsError())return dda;
if (ddb.IsError())return ddb;
if (ddb.Equals0())return DDouble(dda).MakeError(MathError::ModDivide0);
if (dda.Equals0())return 0;
DDouble d1 = dda.Abs(), d2 = ddb.Abs();
if (d1<d2)return dda;
return (dda / d2).GetDecimalPart()*d2;
}
bool LK::Math::DDouble::operator>(const DDouble& ld)const
{
if (Value > 0)
{
return ld.Value <= 0 || Exp > ld.Exp || (Exp == ld.Exp&&Value > ld.Value);
}
if (Value == 0)return ld.Value < 0;
return ld.Value < 0 && (Exp<ld.Exp || (Exp == ld.Exp&&Value>ld.Value));
}
bool LK::Math::DDouble::operator>=(const DDouble& ld)const
{
if (Value > 0)
{
return ld.Value <= 0 || Exp > ld.Exp || (Exp == ld.Exp&&Value >= ld.Value);
}
if (Value == 0)return ld.Value <= 0;
return ld.Value < 0 && (Exp < ld.Exp || (Exp == ld.Exp&&Value >= ld.Value));
}
LK::Math::DDouble LK::Math::DDouble::Abs()const
{
if (Value < 0)return -*this;
return *this;
}
LK::Math::DDouble LK::Math::DDouble::GetIntegerPart()const
{
if (Exp > 52)return *this;
if (Exp < 0)return 0;
return (double)(long long)ToDouble();
}
LK::Math::DDouble LK::Math::DDouble::GetDecimalPart()const
{
if (Exp > 52)return 0;
if (Exp <= 0)return *this;
return *this - (double)(long long)ToDouble();
}
LK::Math::DDouble LK::Math::DDouble::Sqrt()const
{
if (IsError())return *this;
if (Value < 0)return DDouble(*this).MakeError(MathError::SqrtLessThan0);
if (((int)Exp) & 1)return DDouble(std::sqrt(Value * 2), Exp / 2);
return DDouble(std::sqrt(Value), Exp / 2);
}
LK::Math::DDouble LK::Math::DDouble::Ln()const
{
if (IsError())return *this;
if (Value <= 0)return DDouble(*this).MakeError(MathError::LnLessOrEqual0);
return (Exp)*Ln2 + std::log(Value);
}
LK::Math::DDouble LK::Math::DDouble::Log2()const
{
if (IsError())return *this;
if (Value <= 0)return DDouble(*this).MakeError(MathError::LnLessOrEqual0);
return (Exp)+log(Value) * _1Ln2;
}
LK::Math::DDouble LK::Math::DDouble::Lg()const
{
if (IsError())return *this;
if (Value <= 0)return DDouble(*this).MakeError(MathError::LnLessOrEqual0);
return Exp*log(Value) * _1Ln10;
}
LK::Math::DDouble LK::Math::DDouble::Pow(LK::Math::DDouble x)const
{
if (IsError())return *this;
if (x.IsError())return x;
if (Value == 0) { if (x.Value > 0)return 0; else if (x.Value == 0) return DDouble(*this).MakeError(MathError::Pow00); }
if (Value > 0)
{
DDouble result = (x*(DDouble(Exp) + _1Ln2*DDouble(std::log(Value)))).Exp2();
if (result.IsError() || result.Exp > MaxValues::Double)return result.MakeError(MathError::PowExpOverflow);
if (result.Exp < MinValues::Double)return 0;
return result;
}
if (x.Value > 0)
{
DDouble result = -(x*(DDouble(Exp) + _1Ln2*DDouble(std::log(-Value)))).Exp2();
if (result.IsError() || result.Exp > MaxValues::Double)return result.MakeError(MathError::PowExpOverflow);
if (result.Exp < MinValues::Double)return 0;
return result;
}
if (x.GetDecimalPart().Equals0() && x.Exp < 53)//x为整数
{
if (1 & (unsigned long long)x.GetIntegerPart().ToDouble())
{
DDouble result = -(x*(DDouble(Exp) + _1Ln2*DDouble(std::log(-Value)))).Exp2();
if (result.IsError() || result.Exp > MaxValues::Double)return result.MakeError(MathError::PowExpOverflow);
if (result.Exp < MinValues::Double)return 0;
return result;
}
}
return DDouble(*this).MakeError(MathError::PowLessThan0);
}
LK::Math::DDouble LK::Math::DDouble::Exp2()const
{
if (IsError())return *this;
DDouble result = DDouble(std::pow(2, GetDecimalPart().ToDouble()), GetIntegerPart().ToDouble());
if (result.Exp > MaxValues::Double)return result.MakeError(MathError::Exp2Overflow);
if (result.Exp < MinValues::Double)return 0;
return result;
}
LK::Math::DDouble LK::Math::DDouble::Expe()const
{
if (IsError())return *this;
DDouble t = *this * _1Ln2;
if (t.IsError())return t.MakeError(MathError::ExpEOverflow);
return t.Exp2();
}
namespace LK {
namespace Math {
const DDouble* _DDoubleMakeExp10()
{
static DDouble exp10[64];
exp10[0] = 10.0;
int i = 0;
while (i < 62)
{
exp10[i + 1] = exp10[i] * exp10[i];
i++;
}
while (i++ < 62)
{
exp10[i] = exp10->Pow((double)(1ull << i));
}
return exp10;
}
const DDouble*const DDouble::_Exp10 = _DDoubleMakeExp10();
}
}
const LK::Math::DDouble LK::Math::DDouble::E = 2.718281828459045;
const LK::Math::DDouble LK::Math::DDouble::Pi = 3.141592653589793;
const LK::Math::DDouble LK::Math::DDouble::Ln2 = std::log(2.0);
const LK::Math::DDouble LK::Math::DDouble::_1Ln2 = 1 / std::log(2.0);
const LK::Math::DDouble LK::Math::DDouble::Ln10 = std::log(10.0);
const LK::Math::DDouble LK::Math::DDouble::_1Ln10 = 1 / std::log(10.0);
const LK::Math::DDouble LK::Math::DDouble::MaxValue = LK::Math::DDouble(0.5, MaxValues::Double);
const LK::Math::DDouble LK::Math::DDouble::MinValue = LK::Math::DDouble(-0.5, MaxValues::Double);
#endif
|
[
"guojiaqi2006@qq.com"
] |
guojiaqi2006@qq.com
|
b6d984d0ce4dbdaf41a849869e625ad7ec62f6d6
|
77861deda8b3046bdda221d3cb80b77e84b14523
|
/sse-sumbytes/int8_t/scalar.cpp
|
d59d1eda15c5048395de9b3b98396f6aeb8a092c
|
[
"BSD-2-Clause"
] |
permissive
|
WojciechMula/toys
|
b73f09212ca19f1e76bbf2afaa5ad2efcea95175
|
6110b59de45dc1ce44388b21c6437eff49a7655c
|
refs/heads/master
| 2023-08-18T12:54:25.919406
| 2023-08-05T09:20:14
| 2023-08-05T09:20:14
| 14,905,115
| 302
| 44
|
BSD-2-Clause
| 2020-04-17T17:10:42
| 2013-12-03T20:35:37
|
C++
|
UTF-8
|
C++
| false
| false
| 367
|
cpp
|
#include "scalar.h"
#include <numeric>
int32_t scalar_sumsignedbytes(int8_t* array, size_t size)
{
int32_t sum = 0;
// this loop might get vectorized
for (size_t i=0; i < size; i++)
sum += array[i];
return sum;
}
int32_t scalar_cpp_sumsignedbytes(int8_t* array, size_t size)
{
return std::accumulate(array, array + size, int32_t(0));
}
|
[
"wojciech_mula@poczta.onet.pl"
] |
wojciech_mula@poczta.onet.pl
|
1b4344478c5411ae71f24a1de62345a4fd17468c
|
704bad9ce1bf1703a20f15842c0c51228ed0dffe
|
/include/Updateable.h
|
2e367f4722ab50b7b752a128db25d3a8addee3f6
|
[
"MIT"
] |
permissive
|
SundeepK/Clone
|
5846a20e10d3110a1bd84a86208509687c0000f2
|
7386f8d6f9ebb49babdcc08c3bd5dda701e89e9b
|
refs/heads/master
| 2021-01-01T17:42:58.760839
| 2015-01-31T18:04:12
| 2015-01-31T18:04:12
| 19,470,044
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 226
|
h
|
#ifndef UPDATEABLE_H
#define UPDATEABLE_H
class Updateable
{
public:
Updateable();
virtual ~Updateable();
virtual void update(float dt) = 0;
protected:
private:
};
#endif // UPDATEABLE_H
|
[
"sundeepkahlon@hotmail.com"
] |
sundeepkahlon@hotmail.com
|
a0512141c26b2b6c66216a5b8498f22a9f56d69e
|
973ff99f109a482150cb90d7792a81f6cec44cde
|
/Librarys/Bohge/External/lua-5.2.2/Lua/lua_tinker.hpp
|
c4e6c2f849568ac0a92b72e7a1ae8035246c1415
|
[
"MIT"
] |
permissive
|
wangscript/Bohge_Engine
|
db90047141826ee5400400f658cd6f07e9bb87e4
|
32f828d26a1abb6e8f5c3f43904884a65fec576a
|
refs/heads/master
| 2020-12-24T09:44:55.555872
| 2014-04-25T16:49:24
| 2014-04-25T16:49:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 39,868
|
hpp
|
// lua_tinker.h
// LuaTinker - Simple and light C++ wrapper for Lua.
//
// Copyright (c) 2005-2007 Kwon-il Lee (zupet@hitel.net)
//
// please check Licence.txt file for licence and legal issues.
// modify by Lili for Lua5.2 version Thu Nov 15 17:47:06 CST 2012
#if !defined(_LUA_TINKER_H_)
#define _LUA_TINKER_H_
#include "lua.hpp"
#include <new>
#include <cassert>
#include <string.h>
#include <string>
#include <list>
namespace lua_tinker
{
// init LuaTinker
void init(lua_State *L);
void init_s64(lua_State *L);
void init_u64(lua_State *L);
// excution
void dofile(lua_State *L, const char *filename);
void dostring(lua_State *L, const char* buff);
void dobuffer(lua_State *L, const char* buff, size_t sz);
// debug helpers
void enum_stack(lua_State *L);
int on_error(lua_State *L);
void print_error(lua_State *L, const char* fmt, ...);
// dynamic type extention
struct lua_value
{
virtual void to_lua(lua_State *L) = 0;
};
// type trait
template<typename T> struct class_name;
struct table;
template<bool C, typename A, typename B> struct if_ {};
template<typename A, typename B> struct if_<true, A, B> { typedef A type; };
template<typename A, typename B> struct if_<false, A, B> { typedef B type; };
template<typename A>
struct is_ptr { static const bool value = false; };
template<typename A>
struct is_ptr<A*> { static const bool value = true; };
template<typename A>
struct is_ref { static const bool value = false; };
template<typename A>
struct is_ref<A&> { static const bool value = true; };
template<typename A>
struct remove_const { typedef A type; };
template<typename A>
struct remove_const<const A> { typedef A type; };
template<typename A>
struct base_type { typedef A type; };
template<typename A>
struct base_type<A*> { typedef A type; };
template<typename A>
struct base_type<A&> { typedef A type; };
template<typename A>
struct class_type { typedef typename remove_const<typename base_type<A>::type>::type type; };
/////////////////////////////////
enum { no = 1, yes = 2 };
typedef char (& no_type )[no];
typedef char (& yes_type)[yes];
struct int_conv_type { int_conv_type(int); };
no_type int_conv_tester (...);
yes_type int_conv_tester (int_conv_type);
no_type vfnd_ptr_tester (const volatile char *);
no_type vfnd_ptr_tester (const volatile short *);
no_type vfnd_ptr_tester (const volatile int *);
no_type vfnd_ptr_tester (const volatile long *);
no_type vfnd_ptr_tester (const volatile double *);
no_type vfnd_ptr_tester (const volatile float *);
no_type vfnd_ptr_tester (const volatile bool *);
yes_type vfnd_ptr_tester (const volatile void *);
template <typename T> T* add_ptr(T&);
template <bool C> struct bool_to_yesno { typedef no_type type; };
template <> struct bool_to_yesno<true> { typedef yes_type type; };
template <typename T>
struct is_enum
{
static T arg;
static const bool value = ( (sizeof(int_conv_tester(arg)) == sizeof(yes_type)) &&
(sizeof(vfnd_ptr_tester(add_ptr(arg))) == sizeof(yes_type)) );
};
/////////////////////////////////
// from lua
template<typename T>
struct void2val { static T invoke(void* input){ return *(T*)input; } };
template<typename T>
struct void2ptr { static T* invoke(void* input) { if (input == 0) return 0; else return (T*)input; } };
template<typename T>
struct void2ref { static T& invoke(void* input){ return *(T*)input; } };
template<typename T>
struct void2type
{
static T invoke(void* ptr)
{
return if_<is_ptr<T>::value
,void2ptr<typename base_type<T>::type>
,typename if_<is_ref<T>::value
,void2ref<typename base_type<T>::type>
,void2val<typename base_type<T>::type>
>::type
>::type::invoke(ptr);
}
};
struct user
{
user(void* p) : m_p(p) {}
virtual ~user() {}
void* m_p;
};
template<typename T>
struct user2type { static T invoke(lua_State *L, int index) { return void2type<T>::invoke(lua_touserdata(L, index)); } };
template<typename T>
struct lua2enum { static T invoke(lua_State *L, int index) { return (T)(int)lua_tonumber(L, index); } };
template<typename T>
struct lua2object
{
static T invoke(lua_State *L, int index)
{
if(lua_isnil(L,index))
{
return void2type<T>::invoke(0);
}
else if(!lua_isuserdata(L,index))
{
lua_pushstring(L, "no class at first argument. (forgot ':' expression ?)");
lua_error(L);
}
return void2type<T>::invoke(user2type<user*>::invoke(L,index)->m_p);
}
};
template<typename T>
T lua2type(lua_State *L, int index)
{
return if_<is_enum<T>::value
,lua2enum<T>
,lua2object<T>
>::type::invoke(L, index);
}
template<typename T>
struct val2user : user
{
val2user() : user(new T) {}
template<typename T1>
val2user(T1 t1) : user(new T(t1)) {}
template<typename T1, typename T2>
val2user(T1 t1, T2 t2) : user(new T(t1, t2)) {}
template<typename T1, typename T2, typename T3>
val2user(T1 t1, T2 t2, T3 t3) : user(new T(t1, t2, t3)) {}
template<typename T1, typename T2, typename T3, typename T4>
val2user(T1 t1, T2 t2, T3 t3, T4 t4) : user(new T(t1, t2, t3,t4)) {}
template<typename T1, typename T2, typename T3, typename T4, typename T5>
val2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) : user(new T(t1, t2, t3,t4,t5)) {}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
val2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) : user(new T(t1, t2, t3,t4,t5, t6)) {}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
val2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) : user(new T(t1, t2, t3,t4,t5, t6, t7)) {}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
val2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) : user(new T(t1, t2, t3,t4,t5, t6, t7, t8)) {}
~val2user() { delete ((T*)m_p); }
};
template<typename T>
struct ptr2user : user
{
ptr2user(T* t) : user((void*)t) {}
};
template<typename T>
struct ref2user : user
{
ref2user(T& t) : user(&t) {}
};
// to lua
template<typename T>
struct val2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(input); } };
template<typename T>
struct ptr2lua { static void invoke(lua_State *L, T* input){ if(input) new(lua_newuserdata(L, sizeof(ptr2user<T>))) ptr2user<T>(input); else lua_pushnil(L); } };
template<typename T>
struct ref2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(ref2user<T>))) ref2user<T>(input); } };
template<typename T>
struct enum2lua { static void invoke(lua_State *L, T val) { lua_pushnumber(L, (int)val); } };
template<typename T>
struct object2lua
{
static void invoke(lua_State *L, T val)
{
if_<is_ptr<T>::value
,ptr2lua<typename base_type<T>::type>
,typename if_<is_ref<T>::value
,ref2lua<typename base_type<T>::type>
,val2lua<typename base_type<T>::type>
>::type
>::type::invoke(L, val);
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
}
};
template<typename T>
void type2lua(lua_State *L, T val)
{
if_<is_enum<T>::value
,enum2lua<T>
,object2lua<T>
>::type::invoke(L, val);
}
// get value from cclosure
template<typename T>
T upvalue_(lua_State *L)
{
return user2type<T>::invoke(L, lua_upvalueindex(1));
}
// read a value from lua stack
template<typename T>
T read(lua_State *L, int index) { return lua2type<T>(L, index); }
template<> void read(lua_State *L, int index);
template<> bool read(lua_State *L, int index);
template<> char* read(lua_State *L, int index);
template<> char read(lua_State *L, int index);
template<> const char* read(lua_State *L, int index);
template<> unsigned char read(lua_State *L, int index);
template<> short read(lua_State *L, int index);
template<> unsigned short read(lua_State *L, int index);
template<> int read(lua_State *L, int index);
template<> unsigned int read(lua_State *L, int index);
template<> long read(lua_State *L, int index);
template<> unsigned long read(lua_State *L, int index);
template<> long long read(lua_State *L, int index);
template<> unsigned long long read(lua_State *L, int index);
template<> float read(lua_State *L, int index);
template<> double read(lua_State *L, int index);
template<> table read(lua_State *L, int index);
// push a value to lua stack
template<typename T>
void push(lua_State *L, T ret) { type2lua<T>(L, ret); }
template<> void push(lua_State *L, char ret);
template<> void push(lua_State *L, unsigned char ret);
template<> void push(lua_State *L, short ret);
template<> void push(lua_State *L, unsigned short ret);
template<> void push(lua_State *L, long ret);
template<> void push(lua_State *L, unsigned long ret);
template<> void push(lua_State *L, int ret);
template<> void push(lua_State *L, unsigned int ret);
template<> void push(lua_State *L, float ret);
template<> void push(lua_State *L, double ret);
template<> void push(lua_State *L, char* ret);
template<> void push(lua_State *L, const char* ret);
template<> void push(lua_State *L, bool ret);
template<> void push(lua_State *L, long long ret);
template<> void push(lua_State *L, unsigned long long ret);
template<> void push(lua_State *L, lua_value* ret);
template<> void push(lua_State *L, const table &ret);
// pop a value from lua stack
template<typename T>
T pop(lua_State *L) { T t = read<T>(L, -1); lua_pop(L, 1); return t; }
template<> void pop(lua_State *L);
template<> table pop(lua_State *L);
// functor {
template<typename RVal, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void, typename T6=void, typename T7=void, typename T8=void>
struct functor
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5,T6,T7)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5), read<T6>(L,6), read<T7>(L,7), read<T8>(L,8))); return 1; }
};
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
struct functor<RVal, T1, T2, T3, T4, T5, T6, T7>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5,T6,T7)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5), read<T6>(L,6), read<T7>(L,7))); return 1; }
};
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
struct functor<RVal, T1, T2, T3, T4, T5, T6>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5,T6)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5), read<T6>(L,6))); return 1; }
};
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5>
struct functor<RVal, T1, T2, T3, T4, T5>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5))); return 1; }
};
template<typename RVal, typename T1, typename T2, typename T3, typename T4>
struct functor<RVal,T1,T2,T3,T4>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4))); return 1; }
};
template<typename RVal, typename T1, typename T2, typename T3>
struct functor<RVal,T1,T2,T3>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3))); return 1; }
};
template<typename RVal, typename T1, typename T2>
struct functor<RVal,T1,T2>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2))); return 1; }
};
template<typename RVal, typename T1>
struct functor<RVal,T1>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1)>(L)(read<T1>(L,1))); return 1; }
};
template<typename RVal>
struct functor<RVal>
{
static int invoke(lua_State *L) { push(L,upvalue_<RVal(*)()>(L)()); return 1; }
};
// }
// functor return void 偏特化 {
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
struct functor<void, T1, T2, T3, T4, T5, T6, T7>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5), read<T6>(L,6), read<T7>(L,7)); return 0; }
};
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
struct functor<void, T1, T2, T3, T4, T5, T6>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5), read<T6>(L,6)); return 0; }
};
template<typename T1, typename T2, typename T3, typename T4, typename T5>
struct functor<void, T1, T2, T3, T4, T5>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5)); return 0; }
};
template<typename T1, typename T2, typename T3, typename T4>
struct functor<void, T1, T2, T3, T4>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4)); return 0; }
};
template<typename T1, typename T2, typename T3>
struct functor<void, T1, T2, T3>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3)); return 0; }
};
template<typename T1, typename T2>
struct functor<void, T1, T2>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2)); return 0; }
};
template<typename T1>
struct functor<void, T1>
{
static int invoke(lua_State *L) { upvalue_<void(*)(T1)>(L)(read<T1>(L,1)); return 0; }
};
template<>
struct functor<void>
{
static int invoke(lua_State *L) { upvalue_<void(*)()>(L)(); return 0; }
};
// }
// member variable
struct var_base
{
virtual void get(lua_State *L) = 0;
virtual void set(lua_State *L) = 0;
};
//T class V
template<typename Class, typename V>
struct mem_var : var_base
{
V Class::*_var;
mem_var(V Class::*val) : _var(val) {}
void get(lua_State *L) { push(L, read<Class*>(L,1)->*(_var)); }
void set(lua_State *L) { read<Class*>(L,1)->*(_var) = read<V>(L, 3); }
};
// member function {
template<typename RVal, typename T, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void, typename T6=void, typename T7=void, typename T8=void>
struct mem_functor
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5,T6,T7,T8)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7), read<T7>(L,8), read<T8>(L,9)));; return 1; }
};
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
struct mem_functor<RVal, T, T1, T2, T3, T4, T5, T6, T7>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5,T6,T7)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6), read<T6>(L,7), read<T7>(L,8)));; return 1; }
};
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
struct mem_functor<RVal, T, T1, T2, T3, T4, T5, T6>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5,T6)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6), read<T6>(L,7)));; return 1; }
};
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
struct mem_functor<RVal, T, T1, T2, T3, T4, T5>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)));; return 1; }
};
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
struct mem_functor<RVal,T,T1,T2,T3,T4>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5))); return 1; }
};
template<typename RVal, typename T, typename T1, typename T2, typename T3>
struct mem_functor<RVal,T,T1,T2,T3>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4))); return 1; }
};
template<typename RVal, typename T, typename T1, typename T2>
struct mem_functor<RVal,T,T1, T2>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3))); return 1; }
};
template<typename RVal, typename T, typename T1>
struct mem_functor<RVal,T,T1>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1)>(L))(read<T1>(L,2))); return 1; }
};
template<typename RVal, typename T>
struct mem_functor<RVal,T>
{
static int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)()>(L))()); return 1; }
}; //}
// member function return void 特化 {
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
struct mem_functor<void,T,T1,T2,T3,T4,T5,T6,T7,T8>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5,T6,T7,T8)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7),read<T7>(L,8),read<T8>(L,9)); return 0; }
};
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
struct mem_functor<void,T,T1,T2,T3,T4,T5,T6,T7>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5,T6,T7)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7),read<T7>(L,8)); return 0; }
};
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
struct mem_functor<void,T,T1,T2,T3,T4,T5,T6>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5,T6)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7)); return 0; }
};
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
struct mem_functor<void,T,T1,T2,T3,T4,T5>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)); return 0; }
};
template<typename T, typename T1, typename T2, typename T3, typename T4>
struct mem_functor<void,T,T1,T2,T3,T4>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5)); return 0; }
};
template<typename T, typename T1, typename T2, typename T3>
struct mem_functor<void,T,T1,T2,T3>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4)); return 0; }
};
template<typename T, typename T1, typename T2>
struct mem_functor<void,T,T1,T2>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3)); return 0; }
};
template<typename T, typename T1>
struct mem_functor<void,T,T1>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)(T1)>(L))(read<T1>(L,2)); return 0; }
};
template<typename T>
struct mem_functor<void,T>
{
static int invoke(lua_State *L) { (read<T*>(L,1)->*upvalue_<void(T::*)()>(L))(); return 0; }
}; //}
// push_functor 非成员函数 {
template<typename RVal>
void push_functor(lua_State *L, RVal (*func)())
{
lua_pushcclosure(L, functor<RVal>::invoke, 1);
}
template<typename RVal, typename T1>
void push_functor(lua_State *L, RVal (*func)(T1))
{
lua_pushcclosure(L, functor<RVal,T1>::invoke, 1);
}
template<typename RVal, typename T1, typename T2>
void push_functor(lua_State *L, RVal (*func)(T1,T2))
{
lua_pushcclosure(L, functor<RVal,T1,T2>::invoke, 1);
}
template<typename RVal, typename T1, typename T2, typename T3>
void push_functor(lua_State *L, RVal (*func)(T1,T2,T3))
{
lua_pushcclosure(L, functor<RVal,T1,T2,T3>::invoke, 1);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4>
void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4))
{
lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4>::invoke, 1);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5>
void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4,T5))
{
lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4,T5>::invoke, 1);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4,T5,T6))
{
lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4,T5,T6>::invoke, 1);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
void push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4,T5,T6,T7))
{
lua_pushcclosure(L, functor<RVal,T1,T2,T3,T4,T5,T6,T7>::invoke, 1);
}
// }
// 成员函数 {
template<typename RVal, typename T>
void push_functor(lua_State *L, RVal (T::*func)())
{
lua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1);
}
template<typename RVal, typename T>
void push_functor(lua_State *L, RVal (T::*func)() const)
{
lua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1);
}
template<typename RVal, typename T, typename T1>
void push_functor(lua_State *L, RVal (T::*func)(T1))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1);
}
template<typename RVal, typename T, typename T1>
void push_functor(lua_State *L, RVal (T::*func)(T1) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5,T6))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5,T6>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5,T6) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5,T6>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5,T6,T7))
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5,T6,T7>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5,T6,T7) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5,T6,T7>::invoke, 1);
}
template<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
void push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5,T6,T7,T8) const)
{
lua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5,T6,T7,T8>::invoke, 1);
}
//}
// constructor
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7),read<T7>(L,8));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6),read<T6>(L,7));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1, typename T2, typename T3, typename T4>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1, typename T2, typename T3>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1, typename T2>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T, typename T1>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2));
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
template<typename T>
int constructor(lua_State *L)
{
new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>();
push_meta(L, class_name<typename class_type<T>::type>::name());
lua_setmetatable(L, -2);
return 1;
}
// destroyer
template<typename T>
int destroyer(lua_State *L)
{
((user*)lua_touserdata(L, 1))->~user();
return 0;
}
//API warp for lua_getglobal
template <typename T>
T getglobal(lua_State *L, const char *name)
{
lua_getglobal(L, name);
return pop<T>(L);
}
//API warp for lua_setglobal
template <typename T>
void setglobal(lua_State *L, const char *name, T object)
{
push(L, object);
lua_setglobal(L, name);
}
// API register C functiong
template<typename F>
void def(lua_State* L, const char* name, F func)
{
lua_pushstring(L, name);
lua_pushlightuserdata(L, (void*)func);
push_functor(L, func);
lua_setglobal(L, name);
}
// API call lua func {
template<typename RVal>
RVal call(lua_State* L, const char* name)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
if(lua_pcall(L, 0, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1>
RVal call(lua_State* L, const char* name, T1 arg)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
//push(L, arg);
push<T1>(L, arg);
if(lua_pcall(L, 1, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L, name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
if(lua_pcall(L, 2, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
if(lua_pcall(L, 3, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
push(L, arg4);
if(lua_pcall(L, 4, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
push(L, arg4);
push(L, arg5);
if(lua_pcall(L, 5, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
push(L, arg4);
push(L, arg5);
push(L, arg6);
if(lua_pcall(L, 6, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
push(L, arg4);
push(L, arg5);
push(L, arg6);
push(L, arg7);
if(lua_pcall(L, 7, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
}
template<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
RVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
{
lua_pushcclosure(L, on_error, 0);
int errfunc = lua_gettop(L);
lua_getglobal(L,name);
if(lua_isfunction(L,-1))
{
push(L, arg1);
push(L, arg2);
push(L, arg3);
push(L, arg4);
push(L, arg5);
push(L, arg6);
push(L, arg7);
push(L, arg8);
if(lua_pcall(L, 8, 1, errfunc) != 0)
{
lua_pop(L, 1);
}
}
else
{
print_error(L, "lua_tinker::call() attempt to call global `%s' (not a function)", name);
}
lua_remove(L, -2);
return pop<RVal>(L);
} // }
// class helper
int meta_get(lua_State *L);
int meta_set(lua_State *L);
void push_meta(lua_State *L, const char* name);
template<typename T>
struct class_name
{
// global name
static const char* name(const char* name = NULL)
{
static char temp[256] = "";
if(name) strcpy(temp, name);
return temp;
}
};
// API class init impork C++ Class
template<typename T>
void class_add(lua_State* L, const char* name)
{
class_name<T>::name(name);
lua_newtable(L);
lua_pushstring(L, "__name");
lua_pushstring(L, name);
lua_rawset(L, -3);
lua_pushstring(L, "__index");
lua_pushcclosure(L, meta_get, 0);
lua_rawset(L, -3);
lua_pushstring(L, "__newindex");
lua_pushcclosure(L, meta_set, 0);
lua_rawset(L, -3);
lua_pushstring(L, "__gc");
lua_pushcclosure(L, destroyer<T>, 0);
lua_rawset(L, -3);
lua_setglobal(L, name);
}
// API Tinker Class Inheritence
template<typename T, typename P>
void class_inh(lua_State* L)
{
push_meta(L, class_name<T>::name());
if(lua_istable(L, -1))
{
lua_pushstring(L, "__parent");
push_meta(L, class_name<P>::name());
lua_rawset(L, -3);
}
lua_pop(L, 1);
}
// API Tinker Class Constructor
template<typename Class, typename F>
void class_con(lua_State* L,F func)
{
push_meta(L, class_name<Class>::name());
if(lua_istable(L, -1))
{
lua_newtable(L);
lua_pushstring(L, "__call");
lua_pushcclosure(L, func, 0);
lua_rawset(L, -3);
lua_setmetatable(L, -2);
}
lua_pop(L, 1);
}
// API Tinker Class Functions import C++ Class member func
template<typename Class, typename F>
void class_def(lua_State* L, const char* name, F func)
{
push_meta(L, class_name<Class>::name());
if(lua_istable(L, -1))
{
lua_pushstring(L, name);
new(lua_newuserdata(L,sizeof(F))) F(func);
push_functor(L, func);
lua_rawset(L, -3);
}
lua_pop(L, 1);
}
// API Tinker Class member Variables
template<typename T, typename BASE, typename VAR>
void class_mem(lua_State* L, const char* name, VAR BASE::*val)
{
push_meta(L, class_name<T>::name());
if(lua_istable(L, -1))
{
lua_pushstring(L, name);
new(lua_newuserdata(L,sizeof(mem_var<BASE,VAR>))) mem_var<BASE,VAR>(val);
lua_rawset(L, -3);
}
lua_pop(L, 1);
}
// Table Object on Stack
struct table_obj
{
table_obj(lua_State* L, int index);
~table_obj();
void inc_ref();
void dec_ref();
bool validate();
int size()
{
if (validate()) {
lua_pushinteger(m_L, luaL_len(m_L, m_index)); //only use in table here
return pop<int>(m_L);
} else {
return 0;
}
}
template<typename T>
void set(int index, T object)
{
if(validate())
{
lua_pushinteger(m_L, index);
push(m_L, object);
lua_settable(m_L, m_index);
}
}
template<typename T>
void set(const char* name, T object)
{
if(validate())
{
lua_pushstring(m_L, name);
push(m_L, object);
lua_settable(m_L, m_index);
}
}
//add by szd [2010/04/06]
template <typename T>
void rawset(int index, T object)
{
if (validate())
{
lua_pushinteger(m_L, index);
push(m_L, object);
lua_rawseti(m_L, m_index, index);
}
}
template <typename T>
void rawset(const char *name , T object)
{
if (validate())
{
lua_pushstring(m_L, name);
push(m_L, object);
lua_rawset(m_L, m_index);
}
}
template<typename T>
T get(int index)
{
assert(index<=size() && "lua_tinker::table_obj::get index should <= size()");
if(validate())
{
lua_pushinteger(m_L, index);
lua_gettable(m_L, m_index);
}
else
{
lua_pushnil(m_L);
}
return pop<T>(m_L);
}
template<typename T>
T get(const char* name)
{
if(validate())
{
lua_pushstring(m_L, name);
lua_gettable(m_L, m_index);
}
else
{
lua_pushnil(m_L);
}
return pop<T>(m_L);
}
template <typename T>
T rawget(int index)
{
assert(index<=size() && "lua_tinker::table_obj::get index should <= size()");
if (validate())
{
lua_rawgeti(m_L, m_index, index);
}
else
{
lua_pushnil(m_L);
}
return pop<T>(m_L);
}
template<typename T>
T rawget(const char* name)
{
if(validate())
{
lua_pushstring(m_L, name);
lua_rawget(m_L, m_index);
}
else
{
lua_pushnil(m_L);
}
return pop<T>(m_L);
}
int getIndex() const { return m_index;}
private:
lua_State* m_L;
int m_index;
const void* m_pointer;
int m_ref;
};
// Table Object Holder
struct table
{
table(lua_State* L, int index);
table(lua_State* L, const char* name);
// table(lua_State* L);
// table(const table& input);
~table();
template<typename T>
void set(int index, T object) const{ m_obj->set(index, object); }
template<typename T>
void set(const char* name, T object) const { m_obj->set(name, object); }
template<typename T>
void rawset(int index, T object) const { m_obj->rawset(index, object); }
template<typename T>
void rawset(const char* name, T object)const { m_obj->rawset(name, object); }
template<typename T>
T get(int index) const { return m_obj->get<T>(index); }
template<typename T>
T get(const char* name) const { return m_obj->get<T>(name); }
template<typename T>
T rawget(int index) const { return m_obj->rawget<T>(index); }
template<typename T>
T rawget(const char* name) const { return m_obj->rawget<T>(name); }
//////////////////////////////////////////////////////////////////////////
//NOTE size just return int key size, other type key not
int size() const
{
return m_obj->size();
}
bool empty() const
{
return m_obj->size() == 0;
}
int getIndex() const { return m_obj->getIndex(); }
private:
table_obj* m_obj;
};
} // namespace lua_tinker
#endif //_LUA_TINKER_H_
|
[
"bohge@163.com"
] |
bohge@163.com
|
e4fb3457f1ad11ea99503d2d4ef4627baeccf69a
|
7f69666290f669ced84fad1301e6b04cb55b1824
|
/assault cube internal/cheat/modules/health.cpp
|
e60a4ab7b446285c9972f2dcc63be03443d72199
|
[] |
no_license
|
epixelse/assault-cube-internal-hack
|
cb7af40faadfacd918feae691d50723550d313b9
|
41825a8087a07f0b91689415bc41361d46fe7f56
|
refs/heads/master
| 2023-08-15T05:40:53.901334
| 2021-10-16T14:15:22
| 2021-10-16T14:15:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 287
|
cpp
|
#include "modules.h"
#include "../engine/entity.h"
#include "../settings.h"
void modules::IniniteHealth() {
if (C_Settings->InfiniteHealth) {
LocalPlayer local_player;
if (local_player.Get()) {
local_player.SetHealth(1337 /*very cool hacking number ;--------DDDDDD*/);
}
}
}
|
[
"frshsteam@gmail.com"
] |
frshsteam@gmail.com
|
7c2bfd235a400c7c3959bc5aa74e9b8f73287632
|
888fe8ce72981e8d705a28fe774119dffda2a48c
|
/http-server/file.h
|
c3c47973817a9d936958469fcc1f7f64dec73f5b
|
[] |
no_license
|
wierton/sample-code-for-server
|
24ddc28aa7eb978b9086e94a2322bf76aeedae23
|
1f2efb29e91994ea92549df9bac333c47f2073b4
|
refs/heads/master
| 2021-05-11T23:15:43.205112
| 2018-02-27T14:11:47
| 2018-02-27T14:11:47
| 117,510,590
| 2
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 648
|
h
|
#ifndef FILE_H
#define FILE_H
#include <string>
#include <memory>
#include <cstdlib>
class File {
std::string filename;
std::shared_ptr<struct stat> file_status;
public:
File();
File(const std::string &filename);
// APIs
std::string file_suffix();
std::string readall();
size_t size();
bool is_exists();
bool is_file();
bool is_directory();
bool is_executable();
const std::string &fullpath();
std::string realpath();
};
using FilePtr = std::shared_ptr<File>;
class FileManager {
public:
static bool is_start_with_directory(const std::string &filename);
static FilePtr search_file(const std::string &filename);
};
#endif
|
[
"141242068@smail.nju.edu.cn"
] |
141242068@smail.nju.edu.cn
|
18b1d1404193cda1595c333bd824e63928b86993
|
7ae86f909b54b1b8e251ce85d9bbfa282e1d95e9
|
/101_ZoneServer/Quest/QuestManager.cpp
|
e662bea6595619fa61af604013b635208161d5ea
|
[] |
no_license
|
dai543103/ServerFramework-1
|
4a6195a698a28a0174479b346eca743c4186cf86
|
5e74916e9e5c9aeaba0462e19d1eb72f81b53991
|
refs/heads/master
| 2020-05-22T12:34:56.900722
| 2019-02-15T03:28:58
| 2019-02-15T03:28:58
| null | 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 22,723
|
cpp
|
#include "GameProtocol.hpp"
#include "LogAdapter.hpp"
#include "ErrorNumDef.hpp"
#include "Random.hpp"
#include "Kernel/ConfigManager.hpp"
#include "Kernel/GameRole.hpp"
#include "Kernel/UnitUtility.hpp"
#include "Kernel/GameEventManager.hpp"
#include "Kernel/ZoneOssLog.hpp"
#include "RepThings/RepThingsUtility.hpp"
#include "Resource/ResourceUtility.h"
#include "Reward/RewardUtility.h"
#include "QuestManager.h"
using namespace ServerLib;
static GameProtocolMsg stMsg;
CQuestManager::CQuestManager()
{
m_uiUin = 0;
m_vQuestData.clear();
//玩家奇遇任务过期时间
m_iAdventEndTime = 0;
//玩家奇遇任务获得的次数
m_iAdventNum = 0;
//玩家奇遇任务下次刷新时间
m_iAdventNextUpdateTime = 0;
//玩家每日任务下次刷新时间
m_iDailyNextUpdateTime = 0;
//玩家奇遇阶段总流水
m_iAdventUserCost = 0;
//玩家奇遇阶段总发炮
m_iAdventShootNum = 0;
//已领取的活跃度宝箱ID
m_vGetLivnessRewards.clear();
}
CQuestManager::~CQuestManager()
{
m_uiUin = 0;
m_vQuestData.clear();
//玩家奇遇任务过期时间
m_iAdventEndTime = 0;
//玩家奇遇任务获得的次数
m_iAdventNum = 0;
//玩家奇遇任务下次刷新时间
m_iAdventNextUpdateTime = 0;
//玩家每日任务下次刷新时间
m_iDailyNextUpdateTime = 0;
//玩家奇遇阶段总流水
m_iAdventUserCost = 0;
//玩家奇遇阶段总发炮
m_iAdventShootNum = 0;
//已领取的活跃度宝箱ID
m_vGetLivnessRewards.clear();
}
//初始化
int CQuestManager::Initialize()
{
return 0;
}
void CQuestManager::SetOwner(unsigned int uin)
{
m_uiUin = uin;
}
CGameRoleObj* CQuestManager::GetOwner()
{
return CUnitUtility::GetRoleByUin(m_uiUin);
}
//完成任务
int CQuestManager::FinQuest(int iQuestID)
{
QuestData* pstQuest = GetQuestByID(iQuestID);
if (!pstQuest || pstQuest->bIsFin)
{
//任务不存在或者已完成
LOGERROR("Failed to fin quest, invalid quest id %d, uin %u\n", iQuestID, m_uiUin);
return T_ZONE_PARA_ERROR;
}
BaseConfigManager& stBaseCfgMgr = CConfigManager::Instance()->GetBaseCfgMgr();
const QuestConfig* pstConfig = stBaseCfgMgr.GetQuestConfig(iQuestID);
if (!pstConfig)
{
//找不到配置
LOGERROR("Failed to get quest config, invalid quest id %d, uin %u\n", iQuestID, m_uiUin);
return T_ZONE_INVALID_CFG;
}
if (pstQuest->iNum < pstConfig->alParam[3])
{
//还未完成
LOGERROR("Failed to fin quest, need:real %lld:%lld, quest id %d, uin %u\n", pstConfig->alParam[3], pstQuest->iNum, iQuestID, m_uiUin);
return T_ZONE_PARA_ERROR;
}
static GameProtocolMsg stMsg;
CZoneMsgHelper::GenerateMsgHead(stMsg, MSGID_ZONE_QUESTCHANGE_NOTIFY);
Zone_QuestChange_Notify* pstNotify = stMsg.mutable_stbody()->mutable_m_stzone_questchange_notify();
//可以完成任务
int iRet = T_SERVER_SUCCESS;
switch (pstQuest->iType)
{
case QUEST_TYPE_NEW:
{
//完成新手任务,直接删除
DeleteQuest(iQuestID, *pstNotify->add_stchanges());
//领取奖励
iRet = GetQuestReward(iQuestID, pstQuest->iType ,pstConfig->astRewards, sizeof(pstConfig->astRewards)/sizeof(RewardConfig));
if (iRet)
{
LOGERROR("Failed to get quest reward, ret %d, uin %u, quest id %d\n", iRet, m_uiUin, iQuestID);
return iRet;
}
}
break;
case QUEST_TYPE_DAILY:
{
//完成每日任务
UpdateQuest(iQuestID, QUEST_CHANGE_FIN, 0, *pstNotify->add_stchanges());
//领取奖励
iRet = GetQuestReward(iQuestID, pstQuest->iType, pstConfig->astRewards, sizeof(pstConfig->astRewards) / sizeof(RewardConfig));
if (iRet)
{
LOGERROR("Failed to get quest reward, ret %d, uin %u, quest id %d\n", iRet, m_uiUin, iQuestID);
return iRet;
}
}
break;
case QUEST_TYPE_ACHIEVE:
{
//完成成就任务
if (pstConfig->iNextQuestID == 0)
{
//最后一个成就任务
UpdateQuest(iQuestID, QUEST_CHANGE_FIN, 0, *pstNotify->add_stchanges());
}
else
{
//成就任务完成度要继承
long8 iAchieveNum = pstQuest->iNum;
//删除成就任务
DeleteQuest(iQuestID, *pstNotify->add_stchanges());
//添加下一个任务
const QuestConfig* pstNextConfig = stBaseCfgMgr.GetQuestConfig(pstConfig->iNextQuestID);
if (!pstNextConfig)
{
LOGERROR("Failed to get quest config, quest id %d\n", pstConfig->iNextQuestID);
return T_ZONE_INVALID_CFG;
}
AddQuest(pstNextConfig->iID, pstNextConfig->iType, pstNextConfig->iNeedType, *pstNotify->add_stchanges(), iAchieveNum);
}
//领取奖励
iRet = GetQuestReward(iQuestID, pstQuest->iType, pstConfig->astRewards, sizeof(pstConfig->astRewards) / sizeof(RewardConfig));
if (iRet)
{
LOGERROR("Failed to get quest reward, ret %d, uin %u, quest id %d\n", iRet, m_uiUin, iQuestID);
return iRet;
}
}
break;
case QUEST_TYPE_ADVENTURE:
{
//完成奇遇任务
int iGunMultiple = (m_iAdventShootNum == 0) ? 0 : (m_iAdventUserCost/m_iAdventShootNum);
//删除奇遇任务
DeleteQuest(iQuestID, *(pstNotify->add_stchanges()));
m_iAdventEndTime = 0;
m_iAdventUserCost = 0;
m_iAdventShootNum = 0;
if (pstConfig->iNextQuestID != 0)
{
//有下一阶段,增加新的奇遇任务
const QuestConfig* pstNextConfig = stBaseCfgMgr.GetAdventQuestConfig(pstConfig->iNextQuestID);
if (!pstNextConfig)
{
LOGERROR("Failed to get quest config, quest id %d\n", pstConfig->iNextQuestID);
return T_ZONE_INVALID_CFG;
}
//增加奇遇任务
AddQuest(pstNextConfig->iID, pstNextConfig->iType, pstNextConfig->iNeedType, *pstNotify->add_stchanges());
m_iAdventEndTime = CTimeUtility::GetNowTime() + pstNextConfig->iCountdownTime;
}
else
{
//没有下一阶段
++m_iAdventNum;
}
//领取奇遇任务奖励
const AdventureRewardConfig* pstRewardConfig = stBaseCfgMgr.GetAdventureRewardConfig(pstConfig->iQuestIndex, iGunMultiple);
if (!pstRewardConfig)
{
LOGERROR("Failed to get adventure reward config, quest index %d, gun multiple %d, uin %u\n", pstConfig->iQuestIndex, iGunMultiple, m_uiUin);
return T_ZONE_INVALID_CFG;
}
//领取奖励
iRet = GetQuestReward(iQuestID, pstQuest->iType, pstRewardConfig->astRewards, sizeof(pstRewardConfig->astRewards) / sizeof(RewardConfig));
if (iRet)
{
LOGERROR("Failed to get quest reward, ret %d, uin %u, quest id %d\n", iRet, m_uiUin, iQuestID);
return iRet;
}
}
break;
default:
break;
}
pstNotify->set_iadventendtime(m_iAdventEndTime);
pstNotify->set_iadventnum(m_iAdventNum);
//推送任务变化的通知
CZoneMsgHelper::SendZoneMsgToRole(stMsg, GetOwner());
//完成任务
CGameEventManager::NotifyFinQuest(*GetOwner(), pstConfig->iType, pstConfig->iID);
return T_SERVER_SUCCESS;
}
//领取活跃度奖励
int CQuestManager::GetLivnessReward(int iRewardID)
{
//是否已经领取过
if (std::find(m_vGetLivnessRewards.begin(), m_vGetLivnessRewards.end(), iRewardID) != m_vGetLivnessRewards.end())
{
//已经领取过
LOGERROR("Failed to get livness reward, already get , uin %u, reward id %d\n", m_uiUin, iRewardID);
return T_ZONE_PARA_ERROR;
}
//读取配置
BaseConfigManager& stBaseCfgMgr = CConfigManager::Instance()->GetBaseCfgMgr();
const LivnessRewardConfig* pstLivenessConfig = stBaseCfgMgr.GetLivnessRewardConfig(iRewardID);
if (!pstLivenessConfig)
{
LOGERROR("Failed to get liveness config, id %d\n", iRewardID);
return T_ZONE_INVALID_CFG;
}
CGameRoleObj* pstRoleObj = GetOwner();
if (!pstRoleObj)
{
return T_ZONE_PARA_ERROR;
}
//活跃度是否满足
int iLivnessNum = pstRoleObj->GetResource(RESOURCE_TYPE_LIVENESS);
if (iLivnessNum < pstLivenessConfig->iLivnessNum)
{
//活跃度不满足
LOGERROR("Failed to get livness reward, livess num real:need %d:%d, uin %u\n", iLivnessNum, pstLivenessConfig->iLivnessNum, m_uiUin);
return T_ZONE_PARA_ERROR;
}
//领取奖励
const OpenBoxConfig* pstBoxConfig = stBaseCfgMgr.GetOpenBoxConfig(pstLivenessConfig->iBoxItemID);
if (!pstBoxConfig)
{
LOGERROR("Failed to get open box config, item id %d\n", pstLivenessConfig->iBoxItemID);
return T_ZONE_INVALID_CFG;
}
int iRet = CRewardUtility::GetReward(*pstRoleObj, 1, pstBoxConfig->astRewards, sizeof(pstBoxConfig->astRewards) / sizeof(RewardConfig), ITEM_CHANNEL_QUEST);
if (iRet)
{
LOGERROR("Failed to add open box item, ret %d, uin %u, box id %d\n", iRet, m_uiUin, pstBoxConfig->iID);
return iRet;
}
//打印运营日志 活跃度宝箱
for (unsigned i = 0; i < sizeof(pstBoxConfig->astRewards) / sizeof(RewardConfig); ++i)
{
//开活跃度宝箱之前对应 奖项的数量
long8 lOldNum = 0;
const RewardConfig& stRewardConfig = pstBoxConfig->astRewards[i];
switch (stRewardConfig.iType)
{
case REWARD_TYPE_RES:
{
lOldNum = pstRoleObj->GetResource(stRewardConfig.iType);
}
break;
case REWARD_TYPE_ITEM:
{
lOldNum = pstRoleObj->GetRepThingsManager().GetRepItemNum(stRewardConfig.iType);
}
break;
default:
break;
}
CZoneOssLog::TraceLiveness(pstRoleObj->GetUin(), pstRoleObj->GetChannel(), pstRoleObj->GetNickName(), pstBoxConfig->iID, stRewardConfig.iType,
stRewardConfig.iRewardID, lOldNum, lOldNum + stRewardConfig.iRewardNum);
}
//增加到已完成列表
m_vGetLivnessRewards.push_back(iRewardID);
return T_SERVER_SUCCESS;
}
//更新任务条件
int CQuestManager::OnQuestNeedChange(int iNeedType, int iParam1, int iParam2, int iParam3, int iParam4, int iExtraParam)
{
static GameProtocolMsg stMsg;
CZoneMsgHelper::GenerateMsgHead(stMsg, MSGID_ZONE_QUESTCHANGE_NOTIFY);
Zone_QuestChange_Notify* pstNotify = stMsg.mutable_stbody()->mutable_m_stzone_questchange_notify();
BaseConfigManager& stBaseCfgMgr = CConfigManager::Instance()->GetBaseCfgMgr();
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].bIsFin || m_vQuestData[i].iNeedType != iNeedType)
{
continue;
}
//是对应任务
const QuestConfig* pstQuestConfig = stBaseCfgMgr.GetQuestConfig(m_vQuestData[i].iQuestID);
if (!pstQuestConfig)
{
LOGERROR("Failed to get quest config, invalid quest id %d, uin %u\n", m_vQuestData[i].iQuestID, m_uiUin);
return T_ZONE_INVALID_CFG;
}
//判断是否满足条件
switch (iNeedType)
{
case QUEST_NEED_KILLFISH:
{
//捕鱼任务
if (pstQuestConfig->alParam[0] != 0 && (pstQuestConfig->alParam[0] & iParam1) == 0)
{
//不是对应房间模式
continue;
}
if (pstQuestConfig->alParam[1] != 0 && pstQuestConfig->alParam[1] != iParam2)
{
//不是对应房间ID
continue;
}
if (pstQuestConfig->alParam[2] > 100 && pstQuestConfig->alParam[2] != iParam3)
{
//鱼ID不匹配
continue;
}
else if (pstQuestConfig->alParam[2] <= 100 && pstQuestConfig->alParam[2] > 0 && iExtraParam!=pstQuestConfig->alParam[2])
{
//鱼类型不匹配
continue;
}
}
break;
case QUEST_NEED_GETFISHRES:
case QUEST_NEED_USESKILL:
case QUEST_NEED_FINQUEST:
case QUEST_NEED_GETITEM:
{
if ((pstQuestConfig->alParam[0] != 0 && (pstQuestConfig->alParam[0] & iParam1) == 0) ||
(pstQuestConfig->alParam[1] != 0 && pstQuestConfig->alParam[1] != iParam2) ||
(pstQuestConfig->alParam[2] != 0 && pstQuestConfig->alParam[2] != iParam3))
{
//不是对应房间模式
continue;
}
}
break;
case QUEST_NEED_CHANGEOPERA:
case QUEST_NEED_LOTTERY:
case QUEST_NEED_LOGINDAY:
case QUEST_NEED_ONLINETIME:
{
if ((pstQuestConfig->alParam[0] != 0 && pstQuestConfig->alParam[0] != iParam1) ||
(pstQuestConfig->alParam[1] != 0 && pstQuestConfig->alParam[1] != iParam2) ||
(pstQuestConfig->alParam[2] != 0 && pstQuestConfig->alParam[2] != iParam3))
{
//不是对应房间模式
continue;
}
}
default:
break;
}
//更新任务
UpdateQuest(m_vQuestData[i].iQuestID, QUEST_CHANGE_UPDATE, iParam4, *pstNotify->add_stchanges());
}
if (pstNotify->stchanges_size() != 0)
{
pstNotify->set_iadventendtime(m_iAdventEndTime);
pstNotify->set_iadventnum(m_iAdventNum);
CZoneMsgHelper::SendZoneMsgToRole(stMsg, GetOwner());
}
return T_SERVER_SUCCESS;
}
//发射子弹通知
void CQuestManager::OnShootBullet(int iGunID, int iCost)
{
BaseConfigManager& stBaseCfgMgr = CConfigManager::Instance()->GetBaseCfgMgr();
int iDayAdventureNum = stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_ADVENTURENUM);
if (m_iAdventNum >= iDayAdventureNum)
{
//当天奇遇任务次数用完
return;
}
//增加计数
m_iAdventShootNum += 1;
m_iAdventUserCost += iCost;
if (m_iAdventEndTime != 0)
{
//当前有奇遇任务
return;
}
//尝试领取新奇遇任务
if (m_iAdventNum == 0)
{
int iBulletMin = stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_ADVENTBULLETMIN);
int iBulletMax = stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_ADVENTBULLETMAX);
if (m_iAdventShootNum < iBulletMin || m_iAdventShootNum >= CRandomCalculator::GetRandomNumber(iBulletMin, iBulletMax))
{
return;
}
}
else
{
//第二次奇遇任务
if (CRandomCalculator::GetRandomInRangeTenThousand() >= stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_SECONDADVENTRATE))
{
return;
}
}
//领取奇遇任务
const QuestConfig* pstNextConfig = stBaseCfgMgr.GetAdventQuestConfig(START_ADVENTURE_QUEST);
if (!pstNextConfig)
{
LOGERROR("Failed to get adventure quest config, adventure quest id %d\n", START_ADVENTURE_QUEST);
return;
}
//增加奇遇任务
static GameProtocolMsg stMsg;
CZoneMsgHelper::GenerateMsgHead(stMsg, MSGID_ZONE_QUESTCHANGE_NOTIFY);
Zone_QuestChange_Notify* pstNotify = stMsg.mutable_stbody()->mutable_m_stzone_questchange_notify();
AddQuest(pstNextConfig->iID, pstNextConfig->iType, pstNextConfig->iNeedType, *pstNotify->add_stchanges());
m_iAdventEndTime = CTimeUtility::GetNowTime() + pstNextConfig->iCountdownTime;
CZoneMsgHelper::SendZoneMsgToRole(stMsg, GetOwner());
return;
}
//定时器
void CQuestManager::OnTick(int iTimeNow)
{
if (m_iAdventEndTime > iTimeNow && m_iAdventNextUpdateTime > iTimeNow && m_iDailyNextUpdateTime > iTimeNow)
{
//不需要更新
return;
}
ResetQuest(false);
return;
}
//更新任务到DB
void CQuestManager::UpdateQuestToDB(QUESTDBINFO& stQuestDBInfo)
{
stQuestDBInfo.Clear();
//任务数据
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
OneQuest* pstQuestInfo = stQuestDBInfo.add_stquestinfos();
pstQuestInfo->set_iquestid(m_vQuestData[i].iQuestID);
pstQuestInfo->set_iquesttype(m_vQuestData[i].iType);
pstQuestInfo->set_ineedtype(m_vQuestData[i].iNeedType);
pstQuestInfo->set_inum(m_vQuestData[i].iNum);
pstQuestInfo->set_bisfin(m_vQuestData[i].bIsFin);
}
//奇遇任务刷新数据
stQuestDBInfo.set_iadventureendtime(m_iAdventEndTime);
stQuestDBInfo.set_iadventurenum(m_iAdventNum);
stQuestDBInfo.set_iadventnextupdatetime(m_iAdventNextUpdateTime);
stQuestDBInfo.set_iadventusercost(m_iAdventUserCost);
stQuestDBInfo.set_iadventshootnum(m_iAdventShootNum);
//每日任务刷新数据
stQuestDBInfo.set_idailynextupdatetime(m_iDailyNextUpdateTime);
//已领取活跃度奖励ID
for (unsigned i = 0; i < m_vGetLivnessRewards.size(); ++i)
{
stQuestDBInfo.add_igetliverewardids(m_vGetLivnessRewards[i]);
}
return;
}
//从DB初始化任务
void CQuestManager::InitQuestFromDB(const QUESTDBINFO& stQuestDBInfo)
{
//任务数据
m_vQuestData.clear();
QuestData stQuest;
for (int i = 0; i < stQuestDBInfo.stquestinfos().size(); ++i)
{
stQuest.Reset();
stQuest.iQuestID = stQuestDBInfo.stquestinfos(i).iquestid();
stQuest.iType = stQuestDBInfo.stquestinfos(i).iquesttype();
stQuest.iNeedType = stQuestDBInfo.stquestinfos(i).ineedtype();
stQuest.iNum = stQuestDBInfo.stquestinfos(i).inum();
stQuest.bIsFin = stQuestDBInfo.stquestinfos(i).bisfin();
m_vQuestData.push_back(stQuest);
}
//奇遇任务刷新数据
m_iAdventEndTime = stQuestDBInfo.iadventureendtime();
m_iAdventNum = stQuestDBInfo.iadventurenum();
m_iAdventNextUpdateTime = stQuestDBInfo.iadventnextupdatetime();
m_iAdventUserCost = stQuestDBInfo.iadventusercost();
m_iAdventShootNum = stQuestDBInfo.iadventshootnum();
//每日任务刷新数据
m_iDailyNextUpdateTime = stQuestDBInfo.idailynextupdatetime();
//已领取活跃度奖励数据
m_vGetLivnessRewards.clear();
for (int i = 0; i < stQuestDBInfo.igetliverewardids_size(); ++i)
{
m_vGetLivnessRewards.push_back(stQuestDBInfo.igetliverewardids(i));
}
ResetQuest(true);
return;
}
//添加任务
void CQuestManager::AddQuest(int iQuestID, int iType, int iNeedType, QuestChange& stChangeInfo, long8 iNum)
{
QuestData stData;
stData.iQuestID = iQuestID;
stData.iType = iType;
stData.iNeedType = iNeedType;
stData.iNum = iNum;
stData.bIsFin = false;
m_vQuestData.push_back(stData);
stChangeInfo.set_iquestid(iQuestID);
stChangeInfo.set_ichangetype(QUEST_CHANGE_ADD);
stChangeInfo.set_inum(iNum);
return;
}
//更新任务
void CQuestManager::UpdateQuest(int iQuestID, int iChangeType, int iAddNum, QuestChange& stChangeInfo)
{
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].iQuestID != iQuestID)
{
continue;
}
m_vQuestData[i].iNum += iAddNum;
if (iChangeType == QUEST_CHANGE_FIN)
{
m_vQuestData[i].bIsFin = true;
}
stChangeInfo.set_iquestid(iQuestID);
stChangeInfo.set_ichangetype(iChangeType);
stChangeInfo.set_inum(m_vQuestData[i].iNum);
break;
}
return;
}
//删除任务
void CQuestManager::DeleteQuest(int iQuestID, QuestChange& stChangeInfo)
{
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].iQuestID == iQuestID)
{
m_vQuestData.erase(m_vQuestData.begin()+i);
break;
}
}
stChangeInfo.set_iquestid(iQuestID);
stChangeInfo.set_ichangetype(QUEST_CHANGE_DELETE);
return;
}
//获取任务
QuestData* CQuestManager::GetQuestByID(int iQuestID)
{
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].iQuestID == iQuestID)
{
return &m_vQuestData[i];
}
}
return NULL;
}
//领取任务奖励
int CQuestManager::GetQuestReward(int iQuestID, int iQuestType, const RewardConfig* pstRewardConfig, int iNum)
{
CGameRoleObj* pstRoleObj = GetOwner();
if (!pstRewardConfig || !pstRoleObj)
{
return T_ZONE_PARA_ERROR;
}
static GameProtocolMsg stMsg;
CZoneMsgHelper::GenerateMsgHead(stMsg, MSGID_ZONE_GETREWARD_NOTIFY);
Zone_GetReward_Notify* pstNotify = stMsg.mutable_stbody()->mutable_m_stzone_getreward_notify();
pstNotify->set_iquestid(iQuestID);
int iRet = T_SERVER_SUCCESS;
for (int i = 0; i < iNum; ++i)
{
switch (pstRewardConfig[i].iType)
{
case REWARD_TYPE_ITEM:
{
//道具
iRet = CRepThingsUtility::AddItemNum(*pstRoleObj, pstRewardConfig[i].iRewardID, pstRewardConfig[i].iRewardNum, ITEM_CHANNEL_QUEST);
if (iRet)
{
LOGERROR("Failed to get reward, ret %d, uin %u, quest id %d, reward id %d\n", iRet, m_uiUin, iQuestID, pstRewardConfig[i].iRewardID);
return iRet;
}
//打印运营日志
long8 lNewNum = pstRoleObj->GetRepThingsManager().GetRepItemNum(pstRewardConfig[i].iRewardID);
CZoneOssLog::TraceQuest(pstRoleObj->GetUin(), pstRoleObj->GetChannel(), pstRoleObj->GetNickName(), iQuestID, iQuestType, pstRewardConfig[i].iType, pstRewardConfig[i].iRewardID,
lNewNum - pstRewardConfig[i].iRewardNum, lNewNum);
RewardInfo* pstReward = pstNotify->add_strewards();
pstReward->set_itype(pstRewardConfig[i].iType);
pstReward->set_iid(pstRewardConfig[i].iRewardID);
pstReward->set_inum(pstRewardConfig[i].iRewardNum);
}
break;
case REWARD_TYPE_RES:
{
//资源
if(!CResourceUtility::AddUserRes(*pstRoleObj, pstRewardConfig[i].iRewardID, pstRewardConfig[i].iRewardNum))
{
LOGERROR("Failed to get reward, ret %d, uin %u, quest id %d, reward id %d\n", iRet, m_uiUin, iQuestID, pstRewardConfig[i].iRewardID);
return T_ZONE_INVALID_CFG;
}
//打印运营日志
long8 lNewResNum = pstRoleObj->GetResource(pstRewardConfig[i].iRewardID);
CZoneOssLog::TraceQuest(pstRoleObj->GetUin(), pstRoleObj->GetChannel(), pstRoleObj->GetNickName(), iQuestID, iQuestType, pstRewardConfig[i].iType, pstRewardConfig[i].iRewardID,
lNewResNum - pstRewardConfig[i].iRewardNum, lNewResNum);
RewardInfo* pstReward = pstNotify->add_strewards();
pstReward->set_itype(pstRewardConfig[i].iType);
pstReward->set_iid(pstRewardConfig[i].iRewardID);
pstReward->set_inum(pstRewardConfig[i].iRewardNum);
}
break;
default:
break;
}
}
if (pstNotify->strewards_size() != 0)
{
//推送通知
CZoneMsgHelper::SendZoneMsgToRole(stMsg, GetOwner());
}
return T_SERVER_SUCCESS;
}
//重置任务
void CQuestManager::ResetQuest(bool bIsInit)
{
int iTimeNow = CTimeUtility::GetNowTime();
int iNextDayNowTime = iTimeNow + 24 * 60 * 60;
BaseConfigManager& stBaseCfgMgr = CConfigManager::Instance()->GetBaseCfgMgr();
CZoneMsgHelper::GenerateMsgHead(stMsg, MSGID_ZONE_QUESTCHANGE_NOTIFY);
Zone_QuestChange_Notify* pstNotify = stMsg.mutable_stbody()->mutable_m_stzone_questchange_notify();
bool bSendNotify = false;
//日常任务
if (m_iDailyNextUpdateTime <= iTimeNow)
{
//重置日常任务
bSendNotify = true;
m_iDailyNextUpdateTime = CTimeUtility::GetTodayTime(iNextDayNowTime, stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_DAILYRESETTIME));
//刷新日常任务
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].iType != QUEST_TYPE_DAILY)
{
continue;
}
m_vQuestData[i].bIsFin = false;
m_vQuestData[i].iNum = 0;
QuestChange* pstOneChange = pstNotify->add_stchanges();
pstOneChange->set_iquestid(m_vQuestData[i].iQuestID);
pstOneChange->set_inum(m_vQuestData[i].iNum);
pstOneChange->set_ichangetype(QUEST_CHANGE_UPDATE);
}
//刷新活跃度宝箱
m_vGetLivnessRewards.clear();
//重置活跃度
CResourceUtility::AddUserRes(*GetOwner(), RESOURCE_TYPE_LIVENESS, -GetOwner()->GetResource(RESOURCE_TYPE_LIVENESS));
}
//奇遇任务
if (m_iAdventNextUpdateTime <= iTimeNow)
{
//重置奇遇任务次数
bSendNotify = true;
m_iAdventNextUpdateTime = CTimeUtility::GetTodayTime(iNextDayNowTime, stBaseCfgMgr.GetGlobalConfig(GLOBAL_TYPE_ADVENTRESETTIME));
//刷新奇遇任务次数
m_iAdventNum = 0;
}
if (m_iAdventEndTime!=0 && m_iAdventEndTime<=iTimeNow)
{
//重置奇遇任务
bSendNotify = true;
m_iAdventEndTime = 0;
m_iAdventUserCost = 0;
m_iAdventShootNum = 0;
for (unsigned i = 0; i < m_vQuestData.size(); ++i)
{
if (m_vQuestData[i].iType != QUEST_TYPE_ADVENTURE)
{
continue;
}
//删除奇遇任务
DeleteQuest(m_vQuestData[i].iQuestID, *pstNotify->add_stchanges());
break;
}
}
if (!bIsInit && bSendNotify)
{
//需要推送通知
pstNotify->set_iadventnum(m_iAdventNum);
pstNotify->set_iadventendtime(m_iAdventEndTime);
CZoneMsgHelper::SendZoneMsgToRole(stMsg, GetOwner());
}
return;
}
|
[
"784108273@qq.com"
] |
784108273@qq.com
|
bb06440bf6cc795d29a3549e550e201ef86f3818
|
4610baf9a7e81cad6e52fe49289a5f234861732b
|
/perception/cluster_descriptors/cluster_descriptors.cpp
|
fd16bdb04b9f25582f08a7bd3bb8734d62707b2e
|
[] |
no_license
|
kuasha/stanley
|
07f924f6ff61413f5baabd5b6605d4289e93c68d
|
b6b6d3a9efd4611258b2a6337ef25007f406bd80
|
refs/heads/master
| 2021-01-19T00:57:09.752337
| 2016-08-15T02:36:18
| 2016-08-15T02:36:18
| 65,698,509
| 6
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 36,724
|
cpp
|
/********************************************************
Stanford Driving Software
Copyright (c) 2011 Stanford University
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.
* The names of the contributors may not 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.
********************************************************/
#include <cluster_descriptors/cluster_descriptors.h>
using namespace std;
using namespace pipeline;
using namespace Eigen;
using boost::shared_ptr;
/*************************************************************
* PlaneFittingCloudOrienter
**************************************************************/
PlaneFittingCloudOrienter::PlaneFittingCloudOrienter(int num_iterations, float tolerance) :
PointCloudInterface(),
tolerance_(tolerance),
num_iterations_(num_iterations)
{
assert(!input_cloud_);
assert(!input_intensity_);
}
void PlaneFittingCloudOrienter::setInputCloud(boost::shared_ptr<Eigen::MatrixXf> cloud) {
input_cloud_ = cloud;
}
void PlaneFittingCloudOrienter::setInputIntensity(boost::shared_ptr<Eigen::VectorXf> intensity) {
input_intensity_ = intensity;
}
shared_ptr<MatrixXf> PlaneFittingCloudOrienter::getOutputCloud() const {
return output_cloud_;
}
shared_ptr<VectorXf> PlaneFittingCloudOrienter::getOutputIntensity() const {
return input_intensity_;
}
string PlaneFittingCloudOrienter::_getName() const {
ostringstream oss;
oss << "PlaneFittingCloudOrienter_tolerance" << tolerance_ << "_iters" << num_iterations_;
return oss.str();
}
void PlaneFittingCloudOrienter::_flush() {
output_cloud_.reset();
input_cloud_.reset();
input_intensity_.reset();
}
VectorXf PlaneFittingCloudOrienter::fitPlane(const MatrixXf& cloud) const {
assert(cloud.rows() > 0);
assert(cloud.cols() == 3);
int max_num_fit = 0;
VectorXf best_plane = VectorXf::Zero(2);
for(int i = 0; i < num_iterations_; ++i) {
// -- Get two random points.
VectorXf p(2);
int idx0 = rand() % input_cloud_->rows();
p(0) = input_cloud_->coeff(idx0, 0);
p(1) = input_cloud_->coeff(idx0, 1);
VectorXf q(2);
int idx1 = rand() % input_cloud_->rows();
q(0) = input_cloud_->coeff(idx1, 0);
q(1) = input_cloud_->coeff(idx1, 1);
if(p(0) == q(0) && p(1) == q(1))
continue;
// -- Fit a line a'x = b.
VectorXf a(2);
a(0) = 1;
if(p(1) - q(1) == 0)
continue;
else
a(1) = -(p(0) - q(0)) / (p(1) - q(1));
a.normalize();
float b = a.dot(p);
assert(fabs(a.norm() - 1) < 1e-3);
assert(fabs(a.dot(p - q)) < 1e-3);
assert(fabs(a.dot(q) - b) < 1e-3);
// -- Count how many other points are close to the line.
int num_fit = 0;
for(int i = 0; i < input_cloud_->rows(); ++i) {
float adotx = a.coeff(0) * input_cloud_->coeff(i, 0) + a.coeff(1) * input_cloud_->coeff(i, 1);
if(fabs(adotx - b) <= tolerance_)
++num_fit;
}
if(num_fit > max_num_fit) {
max_num_fit = num_fit;
best_plane = a;
}
}
return best_plane;
}
void PlaneFittingCloudOrienter::_compute() {
assert(input_cloud_);
assert(input_intensity_);
assert(!output_cloud_);
// -- Fit a plane.
VectorXf a = fitPlane(*input_cloud_);
// -- Rotate the points so that the direction of the best plane is the x axis.
assert(fabs(a.norm() - 1) < 1e-4);
double theta = M_PI/2. - atan2(a(1), a(0));
MatrixXf rotation = MatrixXf::Identity(3, 3);
rotation(0,0) = cos(theta);
rotation(1,1) = cos(theta);
rotation(0,1) = sin(theta);
rotation(1,0) = -sin(theta);
output_cloud_ = shared_ptr<MatrixXf>(new MatrixXf());
*output_cloud_ = *input_cloud_ * rotation;
VectorXf foo = fitPlane(*output_cloud_);
//cout << "New plane: " << foo.transpose() << endl;
// -- Subtract off the mean of the points.
MatrixXf& points = *output_cloud_;
VectorXf pt_mean = points.colwise().sum() / (float)points.rows();
for(int i=0; i<points.rows(); ++i)
points.row(i) -= pt_mean.transpose();
}
/*************************************************************
* CloudOrienter
**************************************************************/
CloudOrienter::CloudOrienter() :
PointCloudInterface()
{
assert(!input_cloud_);
assert(!input_intensities_);
assert(!output_cloud_);
}
string CloudOrienter::_getName() const {
return string("CloudOrienter");
}
void CloudOrienter::_flush() {
input_cloud_.reset();
input_intensities_.reset();
output_cloud_.reset();
}
void CloudOrienter::setInputCloud(boost::shared_ptr<Eigen::MatrixXf> cloud) {
input_cloud_ = cloud;
}
void CloudOrienter::setInputIntensity(boost::shared_ptr<Eigen::VectorXf> intensity) {
input_intensities_ = intensity;
}
shared_ptr<MatrixXf> CloudOrienter::getOutputCloud() const {
return output_cloud_;
}
shared_ptr<VectorXf> CloudOrienter::getOutputIntensity() const {
return input_intensities_;
}
void CloudOrienter::_compute() {
assert(input_cloud_);
assert(input_intensities_);
assert(!output_cloud_);
//cout << input_intensities_->rows() << " " << input_cloud_->rows() << endl;
assert(input_cloud_->rows() == input_intensities_->rows());
assert(input_cloud_->rows() > 2);
// -- Subtract off the mean of the points.
MatrixXf& points = *input_cloud_;
VectorXf pt_mean = points.colwise().sum() / (float)points.rows();
for(int i=0; i<points.rows(); ++i)
points.row(i) -= pt_mean.transpose();
// -- Flatten to z == 0.
MatrixXf X = points;
X.col(2) = VectorXf::Zero(X.rows());
MatrixXf Xt = X.transpose();
// -- Find the long axis.
// Start with a random vector.
VectorXf pc = VectorXf::Zero(3);
pc(0) = 1; //Chosen by fair dice roll.
pc(1) = 1;
pc.normalize();
// Power method.
VectorXf prev = pc;
double thresh = 1e-4;
int ctr = 0;
while(true) {
prev = pc;
pc = Xt * (X * pc);
pc.normalize();
ctr++;
if((pc - prev).norm() < thresh)
break;
// -- In some degenerate cases, it is possible for the vector
// to never settle down to the first PC.
if(ctr > 100)
break;
}
assert(abs(pc(2)) < 1e-4);
// -- Find the short axis.
VectorXf shrt = VectorXf::Zero(3);
shrt(1) = -pc(0);
shrt(0) = pc(1);
assert(abs(shrt.norm() - 1) < 1e-4);
assert(abs(shrt.dot(pc)) < 1e-4);
// -- Build the basis of normalized coordinates.
MatrixXf basis = MatrixXf::Zero(3,3);
basis.col(0) = pc;
basis.col(1) = shrt;
basis(2,2) = 1.0;
assert(abs(basis.col(0).dot(basis.col(1))) < 1e-4);
assert(abs(basis.col(0).norm() - 1) < 1e-4);
assert(abs(basis.col(1).norm() - 1) < 1e-4);
assert(abs(basis.col(2).norm() - 1) < 1e-4);
// -- Rotate and set the output_cloud_.
output_cloud_ = shared_ptr<MatrixXf>(new MatrixXf);
*output_cloud_ = points * basis;
assert(output_cloud_->rows() == input_cloud_->rows());
}
/*************************************************************
* HoughCloudOrienter
**************************************************************/
HoughCloudOrienter::HoughCloudOrienter() :
CloudOrienter()
{
}
string HoughCloudOrienter::_getName() const {
return string("CloudOrienter");
}
void HoughCloudOrienter::_compute() {
assert(input_cloud_);
assert(input_intensities_);
assert(!output_cloud_);
//cout << input_intensities_->rows() << " " << input_cloud_->rows() << endl;
assert(input_cloud_->rows() == input_intensities_->rows());
assert(input_cloud_->rows() > 2);
// -- Subtract off the mean of the points.
MatrixXf& points = *input_cloud_;
VectorXf pt_mean = points.colwise().sum() / (float)points.rows();
for(int i=0; i<points.rows(); ++i)
points.row(i) -= pt_mean.transpose();
// -- Find the principal axis.
static const int num_bins = 12;
static const int max_samples = 100;
static unsigned int count[num_bins];
static double angle_total[num_bins];
for (int i=0; i < num_bins; i++) {
count[i] = 0;
angle_total[i] = 0;
}
int num_points = points.rows();
int num_samples = 0;
unsigned int max_count = 0;
int max_index = 0;
while (num_samples < max_samples) {
int ix = rand() % num_points;
int iy = rand() % num_points;
while (ix == iy)
iy = rand() % num_points;
VectorXf p1 = points.row(ix);
VectorXf p2 = points.row(iy);
double dy = (p1(1) - p2(1));
double dx = (p1(0) - p2(0));
if ((fabs(dy) < 0.001) && ( fabs(dx) < 0.001))
continue;
double y = atan2(dy, dx);
// wrap into range
if (y < 0) y += M_PI;
if (y >= M_PI_2) y -= M_PI_2;
int idx = (num_bins * y / M_PI_2);
if (idx >= num_bins) {
idx = 0;
y = 0.0;
}
angle_total[idx] += y;
count[idx]++;
if (count[idx] > max_count) {
max_count = count[idx];
max_index = idx;
}
num_samples++;
}
double angle = angle_total[max_index] / max_count;
VectorXf pc = VectorXf::Zero(3);
pc(0) = sin(angle);
pc(1) = cos(angle);
pc(2) = 0.0;
assert(abs(pc(2)) < 1e-4);
// -- Find the short axis.
VectorXf shrt = VectorXf::Zero(3);
shrt(1) = -pc(0);
shrt(0) = pc(1);
assert(abs(shrt.norm() - 1) < 1e-4);
assert(abs(shrt.dot(pc)) < 1e-4);
// -- Build the basis of normalized coordinates.
MatrixXf basis = MatrixXf::Zero(3,3);
basis.col(0) = pc;
basis.col(1) = shrt;
basis(2,2) = 1.0;
assert(abs(basis.col(0).dot(basis.col(1))) < 1e-4);
assert(abs(basis.col(0).norm() - 1) < 1e-4);
assert(abs(basis.col(1).norm() - 1) < 1e-4);
assert(abs(basis.col(2).norm() - 1) < 1e-4);
// -- Rotate and set the output_cloud_.
output_cloud_ = shared_ptr<MatrixXf>(new MatrixXf);
*output_cloud_ = points * basis;
assert(output_cloud_->rows() == input_cloud_->rows());
}
/*************************************************************
* CloudSpinner
**************************************************************/
CloudSpinner::CloudSpinner(shared_ptr<PointCloudInterface> orienter) :
ComputeNode(),
orienter_(orienter)
{
registerInput(orienter_);
}
string CloudSpinner::_getName() const {
return string("CloudSpinner");
}
void CloudSpinner::_flush() {
spin_coords_.reset();
}
void CloudSpinner::_compute() {
assert(orienter_->getOutputCloud());
MatrixXf& xyz = *orienter_->getOutputCloud();
spin_coords_ = shared_ptr<MatrixXf>(new MatrixXf(xyz.rows(), 2));
for(int i = 0; i < xyz.rows(); ++i) {
spin_coords_->coeffRef(i, 0) = sqrt(xyz(i, 0) * xyz(i, 0) + xyz(i, 1) * xyz(i, 1));
spin_coords_->coeffRef(i, 1) = xyz(i, 2);
}
// -- Check that they are centered. (They are.)
// cout << "mean of beta: " << spin_coords_->col(1).sum() / (float)spin_coords_->rows() << endl;
// VectorXf mean = xyz.colwise().sum() / (float)xyz.rows();
// cout << "mean of alpha in xyz: " << sqrt(mean(0) * mean(0) + mean(1) * mean(1)) << endl;
}
/*************************************************************
* SpinImage
**************************************************************/
SpinImage::SpinImage(boost::shared_ptr<CloudSpinner> spinner, float pixels_per_meter, int num_rows, int num_cols) :
DescriptorNode(),
spinner_(spinner),
pixels_per_meter_(pixels_per_meter),
num_rows_(num_rows),
num_cols_(num_cols),
ipl_(NULL)
{
registerInput(spinner);
ipl_ = cvCreateImage(cvSize(num_cols_, num_rows_), IPL_DEPTH_32F, 1);
}
int SpinImage::getDescriptorLength() const {
return num_rows_ * num_cols_;
}
shared_ptr<VectorXf> SpinImage::_getDescriptor() const {
return vectorized_spin_image_;
}
SpinImage::~SpinImage() {
if(ipl_)
cvReleaseImage(&ipl_);
}
void SpinImage::_flush() {
vectorized_spin_image_.reset();
}
void SpinImage::_compute() {
assert(spinner_->spin_coords_);
assert(spinner_->spin_coords_->rows() > 0);
MatrixXf& spun = *spinner_->spin_coords_;
vectorized_spin_image_ = shared_ptr<VectorXf>(new VectorXf());
*vectorized_spin_image_ = VectorXf::Zero(num_rows_ * num_cols_);
cvZero(ipl_);
for(int i = 0; i < spun.rows(); ++i) {
// -- Compute the projection.
int alpha = spun(i, 0) * pixels_per_meter_;
int beta = -(spun(i, 1) - (float)num_rows_ / pixels_per_meter_ / 2.) * pixels_per_meter_;
if(alpha < 0 || alpha >= num_cols_)
continue;
if(beta < 0 || beta >= num_rows_)
continue;
// -- Fill the outputs.
((float*)(ipl_->imageData + beta * ipl_->widthStep))[alpha]++;
int idx = beta * num_cols_ + alpha;
assert(idx < num_rows_ * num_cols_);
assert(idx >= 0);
++vectorized_spin_image_->coeffRef(idx);
}
// -- Check that the data is correct. TODO: remove this.
for(int y = 0; y < ipl_->height; ++y) {
float* ptr = (float*)(ipl_->imageData + y * ipl_->widthStep);
for(int x = 0; x < ipl_->width; ++x, ++ptr) {
int idx = y * num_cols_ + x;
assert(*ptr == vectorized_spin_image_->coeffRef(idx));
}
}
}
void SpinImage::_display() const {
IplImage* vis = cvCloneImage(ipl_);
float maxval = 0;
for(int y = 0; y < ipl_->height; ++y) {
float* ptr = (float*)(ipl_->imageData + y * ipl_->widthStep);
for(int x = 0; x < ipl_->width; ++x, ++ptr) {
if(*ptr > maxval)
maxval = *ptr;
}
}
cvConvertScale(vis, vis, 1. / maxval); //Convert from [0, maxval] to [0, 1].
float scale = 10;
IplImage* big = cvCreateImage(cvSize(((float)vis->width)*scale, ((float)vis->height)*scale),
vis->depth, vis->nChannels);
cvResize(vis, big, CV_INTER_AREA);
cvNamedWindow("Spin Image");
cvShowImage("Spin Image", big);
cvWaitKey(0);
cvDestroyWindow("Spin Image");
cvReleaseImage(&vis);
cvReleaseImage(&big);
}
string SpinImage::_getName() const {
ostringstream oss;
oss << "SpinImage_pixelsPerMeter" << pixels_per_meter_ << "_rows" << num_rows_ << "_cols" << num_cols_;
return oss.str();
}
/*************************************************************
* CloudProjector
**************************************************************/
CloudProjector::CloudProjector(int axis_of_projection, float pixels_per_meter, boost::shared_ptr<PointCloudInterface> orienter, int smoothing, int min_width, int min_height) :
ComputeNode(),
intensity_projection_(NULL),
depth_projection_(NULL),
axis_of_projection_(axis_of_projection),
pixels_per_meter_(pixels_per_meter),
smoothing_(smoothing),
min_width_(min_width),
min_height_(min_height),
orienter_(orienter)
{
registerInput(orienter_);
}
CloudProjector::~CloudProjector() {
_flush();
}
void CloudProjector::_flush() {
if(intensity_projection_) {
cvReleaseImage(&intensity_projection_);
intensity_projection_ = NULL;
}
if(depth_projection_) {
cvReleaseImage(&depth_projection_);
depth_projection_ = NULL;
}
}
std::string CloudProjector::_getName() const {
ostringstream oss;
oss << "CloudProjector_axis" << axis_of_projection_ << "_ppm" << pixels_per_meter_
<< "_smoothing" << smoothing_ << "_min_width" << min_width_ << "_min_height" << min_height_;
return oss.str();
}
void CloudProjector::_display() const {
float scale = 10;
IplImage* intensity_big = cvCreateImage(cvSize(((float)intensity_projection_->width)*scale, ((float)intensity_projection_->height)*scale),
intensity_projection_->depth, intensity_projection_->nChannels);
cvResize(intensity_projection_, intensity_big, CV_INTER_AREA);
IplImage* depth_big = cvCreateImage(cvSize(((float)depth_projection_->width)*scale, ((float)depth_projection_->height)*scale),
depth_projection_->depth, depth_projection_->nChannels);
cvResize(depth_projection_, depth_big, CV_INTER_AREA);
string intensity_name = "Intensity from " + getFullName();
string depth_name = "Depth from " + getFullName();
cvNamedWindow(intensity_name.c_str());
//cvNamedWindow(depth_name.c_str());
cvShowImage(intensity_name.c_str(), intensity_big);
//cvShowImage(depth_name.c_str(), depth_big);
cvWaitKey();
cvDestroyWindow(intensity_name.c_str());
//cvDestroyWindow(depth_name.c_str());
cvReleaseImage(&intensity_big);
cvReleaseImage(&depth_big);
}
void CloudProjector::_compute() {
assert(orienter_);
assert(orienter_->getOutputCloud());
assert(!depth_projection_);
assert(!intensity_projection_);
MatrixXf& oriented = *orienter_->getOutputCloud();
VectorXf& intensities = *orienter_->getOutputIntensity();
// -- Get a copy of the projected points.
MatrixXf projected(oriented.rows(), 2);
int c=0;
for(int i=0; i<3; ++i) {
if(i == axis_of_projection_)
continue;
projected.col(c) = oriented.col(i);
++c;
}
// -- Transform into pixel units. projected is currently in meters, centered at 0.
//projected *= pixels_per_meter_;
for(int i=0; i<projected.rows(); ++i) {
projected(i, 0) *= pixels_per_meter_;
projected(i, 1) *= pixels_per_meter_;
}
// -- Find min and max of u and v. TODO: noise sensitivity?
// u is the col number in the image plane, v is the row number.
float min_v = FLT_MAX;
float min_u = FLT_MAX;
float max_v = -FLT_MAX;
float max_u = -FLT_MAX;
for(int i=0; i<projected.rows(); ++i) {
float u = projected(i, 0);
float v = projected(i, 1);
if(u < min_u)
min_u = u;
if(u > max_u)
max_u = u;
if(v < min_v)
min_v = v;
if(v > max_v)
max_v = v;
}
// -- Translate to coordinate system where (0,0) is the upper right of the image.
for(int i=0; i<projected.rows(); ++i) {
projected(i, 0) -= min_u;
projected(i, 1) = max_v - projected(i, 1);
}
// -- Get the max depth.
float max_depth = -FLT_MAX;
float min_depth = FLT_MAX;
for(int i=0; i<oriented.rows(); ++i) {
if(oriented(i, axis_of_projection_) > max_depth)
max_depth = oriented(i, axis_of_projection_);
if(oriented(i, axis_of_projection_) < min_depth)
min_depth = oriented(i, axis_of_projection_);
}
// -- Compute the normalized depths. Depths are between 0 and 1, with 1 meaning closest and 0 meaning furthest.
VectorXf depths = oriented.col(axis_of_projection_);
if(axis_of_projection_ == 1)
depths = -depths;
depths = (depths.array() - depths.minCoeff()).matrix();
depths = depths / depths.maxCoeff();
// -- Fill the IplImages.
assert(sizeof(float) == 4);
CvSize size = cvSize(ceil(max_u - min_u) + 1, ceil(max_v - min_v) + 1);
float pad_width = 0;
if(min_width_ > 0 && size.width < min_width_) {
pad_width = (float)(min_width_ - size.width) / 2.;
size.width = min_width_;
}
float pad_height = 0;
if(min_height_ > 0 && size.height < min_height_) {
pad_height = (float)(min_height_ - size.height) / 2.;
size.height = min_height_;
}
IplImage* acc = cvCreateImage(size, IPL_DEPTH_32F, 1);
intensity_projection_ = cvCreateImage(size, IPL_DEPTH_32F, 1);
depth_projection_ = cvCreateImage(size, IPL_DEPTH_32F, 1);
cvSetZero(acc);
cvSetZero(depth_projection_);
cvSetZero(intensity_projection_);
assert(intensities.rows() == projected.rows());
for(int i=0; i<projected.rows(); ++i) {
int row = floor(projected(i, 1) + pad_height);
int col = floor(projected(i, 0) + pad_width);
assert(row < size.height && row >= 0 && col < size.width && col >= 0);
// Update accumulator.
((float*)(acc->imageData + row * acc->widthStep))[col]++;
// Update intensity values.
float val = intensities(i) / 255.0 * (3.0 / 4.0) + 0.25;
assert(val <= 1.0 && val >= 0.0);
((float*)(intensity_projection_->imageData + row * intensity_projection_->widthStep))[col] += val;
// Update depth values.
((float*)(depth_projection_->imageData + row * depth_projection_->widthStep))[col] += depths(i); //
}
// -- Normalize by the number of points falling in each pixel.
for(int v=0; v<acc->height; ++v) {
float* intensity_ptr = (float*)(intensity_projection_->imageData + v * intensity_projection_->widthStep);
float* depth_ptr = (float*)(depth_projection_->imageData + v * depth_projection_->widthStep);
float* acc_ptr = (float*)(acc->imageData + v * acc->widthStep);
for(int u=0; u<acc->width; ++u) {
if(*acc_ptr == 0) {
*intensity_ptr = 0;
*depth_ptr = 0;
}
else {
*intensity_ptr = *intensity_ptr / *acc_ptr;
*depth_ptr = *depth_ptr / *acc_ptr;
}
intensity_ptr++;
depth_ptr++;
acc_ptr++;
}
}
// -- Blur the images. TODO: depth too?
cvSmooth(intensity_projection_, intensity_projection_, CV_GAUSSIAN, smoothing_, smoothing_);
// -- Clean up.
cvReleaseImage(&acc);
}
/*************************************************************
* Whitener
**************************************************************/
Whitener::Whitener(shared_ptr<DescriptorNode> node) :
node_(node)
{
registerInput(node);
};
int Whitener::getDescriptorLength() const {
return node_->getDescriptorLength();
}
shared_ptr<VectorXf> Whitener::_getDescriptor() const {
return whitened_;
}
void Whitener::_flush() {
whitened_.reset();
}
void Whitener::_compute() {
assert(node_->getDescriptor());
assert(node_->getDescriptor()->rows() > 0);
// -- Set mean to zero.
whitened_ = shared_ptr<VectorXf>(new VectorXf());
*whitened_ = *node_->getDescriptor();
double mean = whitened_->sum() / (float)whitened_->rows();
assert(!isnan(mean));
*whitened_ = (whitened_->array() - mean).matrix();
//assert(fabs(whitened_->sum() / (float)whitened_->rows()) < 1e-4);
// -- Set the variance to one.
double var = 0;
for(int i = 0; i < whitened_->rows(); ++i)
var += whitened_->coeffRef(i) * whitened_->coeffRef(i);
if(var == 0)
return;
var /= (float)whitened_->rows();
*whitened_ = *whitened_ * sqrt(1. / var);
// -- Check.
// assert(fabs(whitened_->sum() / (float)whitened_->rows()) < 1e-4);
// var = 0;
// for(int i = 0; i < whitened_->rows(); ++i)
// var += whitened_->coeffRef(i) * whitened_->coeffRef(i);
// var /= (float)whitened_->rows();
// assert(abs(var - 1) < 1e-4);
}
string Whitener::_getName() const {
return string("Whitener");
}
/*************************************************************
* OrientedBoundingBoxSize
**************************************************************/
OrientedBoundingBoxSize::OrientedBoundingBoxSize(shared_ptr<PointCloudInterface> orienter) :
DescriptorNode(),
orienter_(orienter)
{
//TODO: How do I make registerInput see orienter as a ComputeNode?
registerInput(orienter_);
}
void OrientedBoundingBoxSize::_compute() {
assert(orienter_);
assert(orienter_->getOutputCloud());
MatrixXf& cloud = *orienter_->getOutputCloud();
assert(cloud.cols() == 3);
VectorXf min = cloud.colwise().minCoeff();
VectorXf max = cloud.colwise().maxCoeff();
bbox_size_ = shared_ptr<VectorXf>(new VectorXf(3));
*bbox_size_ = max - min;
}
void OrientedBoundingBoxSize::_display() const {
//cout << bbox_size_->transpose() << endl;
cin.ignore();
}
int OrientedBoundingBoxSize::getDescriptorLength() const {
return 3;
}
shared_ptr<VectorXf> OrientedBoundingBoxSize::_getDescriptor() const {
return bbox_size_;
}
/*************************************************************
* HogArray
**************************************************************/
HogArray::HogArray(boost::shared_ptr<CloudProjector> projector, const std::vector<float>& u_offset_pcts, const std::vector<float>& v_offset_pcts,
cv::Size win_size, cv::Size block_size, cv::Size block_stride, cv::Size cell_size, int num_bins) :
ComputeNode(),
u_offset_pcts_(u_offset_pcts),
v_offset_pcts_(v_offset_pcts),
projector_(projector),
win_size_(win_size),
block_size_(block_size),
block_stride_(block_stride),
cell_size_(cell_size),
num_bins_(num_bins),
hog_(win_size_, block_size_, block_stride_, cell_size_, num_bins_, 1, -1, 0, 0.2, false), //hardcoded options appear to not be implemented in opencv anyway.
img8u_(NULL)
{
registerInput(projector_);
assert(u_offset_pcts_.size() == v_offset_pcts_.size());
assert(u_offset_pcts_.size() > 0);
for(size_t i = 0; i < u_offset_pcts_.size(); ++i) {
assert(u_offset_pcts_[i] >= 0 && u_offset_pcts_[i] <= 1);
assert(v_offset_pcts_[i] >= 0 && v_offset_pcts_[i] <= 1);
}
}
HogArray::~HogArray() {
cvReleaseImage(&img8u_);
}
std::string HogArray::_getName() const {
ostringstream oss;
oss << "HogArray_winsize" << win_size_.width << "x" << win_size_.height;
oss << "_blocksize" << win_size_.width << "x" << win_size_.height;
oss << "_blockstride" << block_stride_.width << "x" << block_stride_.height;
oss << "_cellsize" << cell_size_.width << "x" << cell_size_.height;
oss << "_numbins" << num_bins_;
oss << "_uvoffsets";
for(size_t i = 0; i < u_offset_pcts_.size(); ++i) {
oss << "(" << u_offset_pcts_[i] << "," << v_offset_pcts_[i] << ")";
}
return oss.str();
}
void HogArray::_flush() {
descriptors_.clear();
coords_.clear();
if(img8u_) {
cvReleaseImage(&img8u_);
img8u_ = NULL;
}
}
int HogArray::getDescriptorLength() const {
return hog_.getDescriptorSize();
}
void HogArray::_compute() {
// -- Convert image to IPL_DEPTH_8U.
IplImage* img32f = projector_->intensity_projection_;
assert(img32f->depth == IPL_DEPTH_32F);
assert(img32f->nChannels == 1);
for(int y = 0; y < img32f->height; ++y) {
float* ptr = (float*)(img32f->imageData + img32f->widthStep * y);
for(int x = 0; x < img32f->width; ++x, ++ptr) {
assert(*ptr >= 0 && *ptr <= 1);
}
}
img8u_ = cvCreateImage(cvSize(img32f->width, img32f->height), IPL_DEPTH_8U, 1);
cvConvertScale(img32f, img8u_, 255); //Convert from [0, 1] to [0, 255].
if(img8u_->width < hog_.winSize.width || img8u_->height < hog_.winSize.height) {
if(debug_)
cerr << _getName() << ": image is smaller than hog window." << endl;
cvReleaseImage(&img8u_);
assert(!img8u_);
descriptors_ = vector< shared_ptr<VectorXf> >(u_offset_pcts_.size(), shared_ptr<VectorXf>((VectorXf*)NULL)); //Fill all descriptors with NULL pointers.
return;
}
// -- Get list of Points to do computation at from u and v offset percents.
coords_ = vector<cv::Point>(u_offset_pcts_.size());
for(size_t i = 0; i < u_offset_pcts_.size(); i++) {
int u = u_offset_pcts_[i] * img8u_->width;
int v = v_offset_pcts_[i] * img8u_->height;
//Subtracting off half winSize since the feature is computed in a window where location[i] is
//the upper left corner. points[i] is the center of the window.
coords_[i] = cv::Point(u - hog_.winSize.width/2, v - hog_.winSize.height/2);
}
// -- Shift any points so that they don't make the window fall off the edge of the image.
for(size_t i = 0; i < coords_.size(); i++) {
if(coords_[i].x + hog_.winSize.width >= img8u_->width)
coords_[i].x = img8u_->width - hog_.winSize.width;
else if(coords_[i].x < 0)
coords_[i].x = 0;
if(coords_[i].y + hog_.winSize.height >= img8u_->height)
coords_[i].y = img8u_->height - hog_.winSize.height;
else if(coords_[i].y < 0)
coords_[i].y = 0;
}
// -- Call opencv.
std::vector<float> result;
hog_.compute(img8u_, result, cv::Size(), cv::Size(), coords_); //winStride and padding are set to default
// -- Put results in vector<VectorXf> from the long concatenation that hog_ produces.
descriptors_ = vector< shared_ptr<VectorXf> >(coords_.size());
size_t sz = hog_.getDescriptorSize();
assert(sz != 0);
for(size_t i=0; i<coords_.size(); i++) {
descriptors_[i] = shared_ptr<VectorXf>(new VectorXf(sz));
for(size_t j = 0; j < sz; ++j) //Copy in the result.
descriptors_[i]->coeffRef(j) = result[i*sz + j];
}
}
/*************************************************************
* HogWindow
**************************************************************/
HogWindow::HogWindow(size_t window_number, boost::shared_ptr<HogArray> hog_array) :
DescriptorNode(),
hog_array_(hog_array),
window_number_(window_number)
{
assert(hog_array_);
assert(window_number_ < hog_array_->u_offset_pcts_.size());
registerInput(hog_array_);
}
int HogWindow::getDescriptorLength() const {
return hog_array_->getDescriptorLength();
}
shared_ptr<VectorXf> HogWindow::_getDescriptor() const {
return hog_descriptor_;
}
std::string HogWindow::_getName() const {
ostringstream oss;
oss << "HogWindow_windowNumber" << window_number_;
return oss.str();
}
void HogWindow::_display() const {
// -- Create a color image.
if(!hog_descriptor_) {
cout << "No valid descriptor." << endl;
cin.ignore();
return;
}
assert(hog_array_->img8u_);
IplImage* img = cvCloneImage(hog_array_->img8u_);
assert(img->depth == IPL_DEPTH_8U);
assert(img->nChannels == 1);
IplImage* vis = cvCreateImage(cvSize(img->width, img->height), IPL_DEPTH_8U, 3);
cvCvtColor(img, vis, CV_GRAY2BGR);
// -- Draw window.
cv::HOGDescriptor& hog = hog_array_->hog_;
vector<cv::Point>& coords = hog_array_->coords_;
cvRectangle(vis, cvPoint(coords[window_number_].x, coords[window_number_].y),
cvPoint(coords[window_number_].x + hog.winSize.width, coords[window_number_].y + hog.winSize.height), cvScalar(255,0,0));
// -- Draw block.
int ul_x = coords[window_number_].x;
int ul_y = coords[window_number_].y;
cvRectangle(vis, cvPoint(ul_x, ul_y), cvPoint(ul_x + hog.blockSize.width, ul_y + hog.blockSize.height), cvScalar(0,255,0));
// -- Draw cell.
cvRectangle(vis, cvPoint(ul_x, ul_y), cvPoint(ul_x + hog.cellSize.width, ul_y + hog.cellSize.height), cvScalar(0,0,255));
// -- Display.
float scale = 10;
IplImage* big = cvCreateImage(cvSize(((float)vis->width)*scale, ((float)vis->height)*scale),
vis->depth, vis->nChannels);
cvResize(vis, big, CV_INTER_AREA);
cvNamedWindow(getShortName().c_str());
cvShowImage(getShortName().c_str(), big);
cvWaitKey();
// -- Clean up.
cvReleaseImage(&big);
cvReleaseImage(&vis);
cvDestroyWindow(getShortName().c_str()); // Why does this appear to do nothing? The window should close.
cvWaitKey(500); // Ample time to destroy the window, if this were the problem.
}
void HogWindow::_flush() {
hog_descriptor_.reset();
}
void HogWindow::_compute() {
hog_descriptor_ = hog_array_->descriptors_[window_number_];
}
/*************************************************************
* RandomProjector
**************************************************************/
// RandomProjector::RandomProjector(const RandomProjector& rp, shared_ptr<DescriptorNode> descriptor) :
// DescriptorNode(),
// output_dim_(rp.output_dim_),
// seed_(rp.seed_),
// descriptor_(descriptor),
// projector_(rp.projector_)
// {
// registerInput(descriptor_);
// }
RandomProjector::RandomProjector(shared_ptr<MatrixXf> projector, shared_ptr<DescriptorNode> descriptor) :
DescriptorNode(),
seed_(-1),
output_dim_(projector->rows()),
descriptor_(descriptor),
projector_(projector)
{
registerInput(descriptor_);
}
RandomProjector::RandomProjector(int output_dim, int seed, boost::shared_ptr<pipeline::DescriptorNode> descriptor) :
DescriptorNode(),
seed_(seed),
output_dim_(output_dim),
descriptor_(descriptor)
{
registerInput(descriptor_);
projector_ = generateProjectionMatrix(descriptor_->getDescriptorLength(), output_dim_, seed_);
}
shared_ptr<MatrixXf> RandomProjector::generateProjectionMatrix(int input_dim, int output_dim, int seed) {
shared_ptr<MatrixXf> projector(new MatrixXf(output_dim, input_dim));
projector->setZero();
// -- Each entry in the projector is drawn from the standard normal.
// http://books.google.com/books?id=6Ewlh_lNo4sC&lpg=PP9&ots=JrJ9sqV0a5&dq=random%20projection&lr=&pg=PA2#v=twopage&q=&f=false
std::tr1::mt19937 mersenne_twister(seed);
for(int i=0; i<projector->rows(); ++i)
for(int j=0; j<projector->cols(); ++j)
projector->coeffRef(i,j) = sampleFromGaussian(mersenne_twister, 1);
return projector;
}
double RandomProjector::sampleFromGaussian(std::tr1::mt19937& mersenne_twister, double stdev) {
double sum = 0;
for(size_t i=0; i<12; ++i) {
sum += 2. * stdev * (double)mersenne_twister() / (double)mersenne_twister.max() - stdev;
}
return sum / 2.;
}
int RandomProjector::getDescriptorLength() const {
return output_dim_;
}
boost::shared_ptr<Eigen::VectorXf> RandomProjector::_getDescriptor() const {
return projected_descriptor_;
}
string RandomProjector::_getName() const {
ostringstream oss;
// -- Hash the projector matrix.
// This version was 32bit unsafe.
// ostringstream moss;
// moss << *projector_;
// locale loc;
// const collate<char>& coll = use_facet<collate<char> >(loc);
// string mstr = moss.str();
// long hash = coll.hash(mstr.data(), mstr.data() + mstr.length());
// -- "Hash" the projection matrix.
// Using the sum() function does not produce the same result on 32bit.
double hash = 0;
for(int i = 0; i < projector_->rows(); ++i)
for(int j = 0; j < projector_->cols(); ++j)
hash += projector_->coeff(i,j);
oss << "RandomProjector_outputDim" << output_dim_ << "_projectionMatrixHash" << setprecision(12) << hash;
return oss.str();
}
void RandomProjector::_flush() {
projected_descriptor_.reset();
}
void RandomProjector::_compute() {
if(descriptor_->getDescriptor()) {
projected_descriptor_ = shared_ptr<VectorXf>(new VectorXf());
*projected_descriptor_ = (*projector_) * (*descriptor_->getDescriptor());
}
else
projected_descriptor_ = shared_ptr<VectorXf>((VectorXf*)NULL);
}
/*************************************************************
* MultiBoosterNode
**************************************************************/
MultiBoosterNode::MultiBoosterNode(MultiBooster* booster, shared_ptr<MultiBoosterObjectConstructor> constructor) :
response_(VectorXf::Zero(booster->class_map_.size())),
booster_(booster),
constructor_(constructor)
{
assert(booster_);
assert(constructor_);
registerInput(constructor);
}
string MultiBoosterNode::_getName() const {
return string("MultiBoosterNode");
}
void MultiBoosterNode::_flush() {
response_.setZero();
}
void MultiBoosterNode::_compute() {
assert(constructor_);
response_ = booster_->treeClassify(*constructor_->object_);
}
/*************************************************************
* MultiBoosterObjectConstructor
**************************************************************/
MultiBoosterObjectConstructor::MultiBoosterObjectConstructor(vector< shared_ptr<DescriptorNode> > descriptor_nodes) :
descriptor_nodes_(descriptor_nodes),
object_(NULL)
{
for(size_t i = 0; i < descriptor_nodes_.size(); ++i) {
registerInput(descriptor_nodes_[i]);
}
}
string MultiBoosterObjectConstructor::_getName() const {
return string("MultiBoosterObjectConstructor");
}
void MultiBoosterObjectConstructor::_flush() {
//object_.reset();
if(object_) {
delete object_;
object_ = NULL;
}
}
void MultiBoosterObjectConstructor::_compute() {
//object_ = shared_ptr<Object>(new Object());
object_ = new Object();
object_->label_ = -2; //unlabeled.
object_->descriptors_ = vector<descriptor>(descriptor_nodes_.size());
for(size_t i = 0; i < descriptor_nodes_.size(); ++i) {
descriptor& desc = object_->descriptors_[i];
if(descriptor_nodes_[i]->getDescriptor()) {
desc.vector = new VectorXf();
*desc.vector = *descriptor_nodes_[i]->getDescriptor(); //TODO: Make multibooster take a shared_ptr.
desc.length_squared = desc.vector->dot(*desc.vector);
}
else {
desc.vector = NULL;
desc.length_squared = -1;
}
}
}
|
[
"kuasha@gmail.com"
] |
kuasha@gmail.com
|
398d26a4399dda7dc6536a39262f00cbc4a9a13f
|
d12718f986df62bccba7fda289e903c8c282f60a
|
/user_ops/gather_corr_op.cc
|
6ea763d9b60208b6d244a9ef50f79e45c033a0fc
|
[] |
no_license
|
marek094/tf-rectified-renderer
|
f39a8328820fbe2167727601f59bf741263be4c9
|
d43c20546d279ee7a1399c6cf07a1794b5ec27e8
|
refs/heads/master
| 2020-11-25T09:19:27.526176
| 2019-12-17T10:53:51
| 2019-12-17T10:56:34
| 228,592,179
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,435
|
cc
|
/* Copyright 2015 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.
==============================================================================*/
// See docs in ../ops/array_ops.cc.
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/variant_encode_decode.h"
#include "tensorflow/core/kernels/bounds_check.h"
#include "tensorflow/core/user_ops/gather_corr_functor.h"
#include "tensorflow/core/platform/mem.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/util.h"
namespace tensorflow {
typedef Eigen::ThreadPoolDevice CPUDevice;
typedef Eigen::GpuDevice GPUDevice;
template <typename Device, typename T, typename Index>
class GatherCorrOp : public OpKernel {
public:
// QUESTION: It'd be nice to support DT_INT16, DT_UINT8,
// etc. here for the type of the second input argument. Should
// we have the framework do some sort of integer promotion
// automatically, or should that be something that users have to
// do explicitly with a conversion operator in the graph?
explicit GatherCorrOp(OpKernelConstruction* c) : OpKernel(c) {}
void Compute(OpKernelContext* c) override {
const Tensor& s_params = c->input(0);
const Tensor& params = c->input(1);
const Tensor& indices = c->input(2);
OP_REQUIRES(
c, TensorShapeUtils::IsVectorOrHigher(params.shape()),
errors::InvalidArgument("params must be at least 1 dimensional"));
// GatherV2 added an axis argument. For backwards compatibility with Gather,
// fall back to axis 0 if the op does not have an axis input.
int64 axis = 0;
if (c->num_inputs() == 4) {
const Tensor& axis_tensor = c->input(3);
OP_REQUIRES(c, TensorShapeUtils::IsScalar(axis_tensor.shape()),
errors::InvalidArgument("axis must be scalar"));
if (axis_tensor.dtype() == DT_INT32) {
axis = axis_tensor.scalar<int32>()();
} else if (axis_tensor.dtype() == DT_INT64) {
axis = axis_tensor.scalar<int64>()();
} else {
OP_REQUIRES(c, false,
errors::InvalidArgument("axis must be int32 or int64."));
}
}
OP_REQUIRES(
c, axis >= -params.dims() && axis < params.dims(),
errors::InvalidArgument("Expected axis in the range [", -params.dims(),
", ", params.dims(), "), but got ", axis));
if (axis < 0) {
axis = params.dims() + axis;
}
// Check that we have enough index space
const int64 gather_dim_size = params.dim_size(axis);
const int64 N = indices.NumElements();
OP_REQUIRES(
c, gather_dim_size <= std::numeric_limits<Index>::max(),
errors::InvalidArgument("params.shape[", axis, "] too large for ",
DataTypeString(DataTypeToEnum<Index>::v()),
" indexing: ", gather_dim_size, " > ",
std::numeric_limits<Index>::max()));
// The result shape is params.shape[0:axis] + indices.shape +
// params.shape[axis + 1:].
TensorShape result_shape;
int64 outer_size = 1;
int64 inner_size = 1;
for (int i = 0; i < axis; i++) {
result_shape.AddDim(params.dim_size(i));
outer_size *= params.dim_size(i);
}
result_shape.AppendShape(indices.shape());
for (int i = axis + 1; i < params.dims(); i++) {
inner_size *= params.dim_size(i);
}
Tensor* out = nullptr;
OP_REQUIRES_OK(c, c->allocate_output(0, result_shape, &out));
if (N > 0 && outer_size > 0 && inner_size > 0) {
auto params_flat =
params.shaped<T, 3>({outer_size, gather_dim_size, inner_size});
auto s_params_flat =
s_params.shaped<T, 3>({outer_size, gather_dim_size, inner_size});
auto indices_flat = indices.flat<Index>();
auto out_flat = out->shaped<T, 2>({outer_size, N});
functor::GatherFunctor<Device, T, Index> functor;
int64 bad_i = functor(c, s_params_flat, params_flat, indices_flat, out_flat);
OP_REQUIRES(
c, bad_i < 0,
errors::InvalidArgument(
"indices", SliceDebugString(indices.shape(), bad_i), " = ",
indices_flat(bad_i), " is not in [0, ", gather_dim_size, ")"));
}
}
};
#define REGISTER_GATHER_FULL(dev, type, index_type) \
REGISTER_KERNEL_BUILDER(Name("GatherCorr") \
.Device(DEVICE_##dev) \
.TypeConstraint<type>("Tparams") \
.TypeConstraint<index_type>("Tindices"), \
GatherCorrOp<dev##Device, type, index_type>);
#define REGISTER_GATHER_ALL_INDICES(dev, type) \
REGISTER_GATHER_FULL(dev, type, int32); \
REGISTER_GATHER_FULL(dev, type, int64)
#define REGISTER_GATHER_CPU(type) REGISTER_GATHER_ALL_INDICES(CPU, type)
// Registration of the CPU implementations.
TF_CALL_ALL_TYPES(REGISTER_GATHER_CPU);
TF_CALL_QUANTIZED_TYPES(REGISTER_GATHER_CPU);
TF_CALL_quint16(REGISTER_GATHER_CPU);
TF_CALL_qint16(REGISTER_GATHER_CPU);
TF_CALL_uint32(REGISTER_GATHER_CPU);
TF_CALL_uint64(REGISTER_GATHER_CPU);
#undef REGISTER_GATHER_CPU
#if GOOGLE_CUDA
// Registration of the GPU implementations.
#define REGISTER_GATHER_GPU(type) REGISTER_GATHER_ALL_INDICES(GPU, type)
// TF_CALL_bool(REGISTER_GATHER_GPU);
TF_CALL_int32(REGISTER_GATHER_GPU);
TF_CALL_int64(REGISTER_GATHER_GPU);
TF_CALL_GPU_NUMBER_TYPES(REGISTER_GATHER_GPU);
// TF_CALL_complex64(REGISTER_GATHER_GPU);
// TF_CALL_complex128(REGISTER_GATHER_GPU);
#undef REGISTER_GATHER_GPU
#endif // GOOGLE_CUDA
#undef REGISTER_GATHER_ALL_INDICES
#undef REGISTER_GATHER_FULL
} // namespace tensorflow
|
[
"me@marekcerny.com"
] |
me@marekcerny.com
|
86b939cf5fb9254ffbb8371c377cacb193fc0131
|
eefb836e9ec761c2b1f102b4007ed7ab6380c7a2
|
/code/delta/core/modules/shle/libSceCommonDialog/libSceCommonDialog_api.cpp
|
ded76dd4a42346c861362fb16c11478d94abb610
|
[] |
no_license
|
RyuDanuer/ps4delta
|
be6ee054ca3ae59159ecbcc59addb77c6f60c85f
|
e3ee468357fa0fbbd428d52034fc84e76b851c4c
|
refs/heads/master
| 2020-09-25T05:18:15.631545
| 2019-12-02T20:13:54
| 2019-12-02T20:13:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,404
|
cpp
|
// Copyright (C) 2019 Force67
// This file was generated on Sat Sep 7 22:01:24 2019
#include "../../ModuleLinker.h"
#include "libSceCommonDialog.h"
static const mlink::FunctionInfo functions[] = {
{0xBA85292C6364CA09, &sceCommonDialogInitialize},
{0x050DED7B2D099903, &sceCommonDialogIsUsed},
{0x0B00B31B49E72E0F, &unk_CwCzG0nnLg8},
{0x0BF119DCF92189B4, &unk_C_EZ3PkhibQ},
{0x0FF577E4E8457883, &unk_D_V35OhFeIM},
{0x21BD523266EBD3B9, &unk_Ib1SMmbr07k},
{0x23EB5DC6C09AA74F, &unk_I_tdxsCap08},
{0x41716C2CE379416C, &unk_QXFsLON5QWw},
{0x483A427D8F6E0748, &unk_SDpCfY9uB0g},
{0x5B6333AD68B1DA63, &unk_W2MzrWix2mM},
{0x6944B83E02727BDF, &unk_aUS4PgJye98},
{0x69F2DD23A8B4950C, &unk_afLdI6i0lQw},
{0x6D40B1EF6FFD7F48, &unk_bUCx72_9f0g},
{0x9954673DEAC170AD, &unk_mVRnPerBcK0},
{0x99D260770A0CD0CA, &unk_mdJgdwoM0Mo},
{0xA7D4D3AB86CB7455, &unk_p9TTq4bLdFU},
{0xADE4C51256B8350C, &unk_reTFEla4NQw},
{0xB71349CF15FACAB0, &unk_txNJzxX6yrA},
{0xBF8FA0CEE4E4BFA9, &unk_v4_gzuTkv6k},
{0xC59B57AB9E782DB8, &unk_xZtXq554Lbg},
{0xCB18E00EFA946C64, &unk_yxjgDvqUbGQ},
{0xD9176271D1E1B460, &unk_2RdicdHhtGA},
{0xE9320CA46BECAC2E, &unk_6TIMpGvsrC4},
{0xEA58DE4D28BE7E3B, &unk_6ljeTSi_fjs},
{0xEF49E210A5009D9D, &unk_70niEKUAnZ0},
{0xF2AEE270605622B0, &unk_8q7icGBWIrA},
{0xF3B19E904D67A308, &unk_87GekE1nowg},
{0xF94C8AC56027A885, &unk__UyKxWAnqIU},
};
MODULE_INIT(libSceCommonDialog);
|
[
"prelink835@gmail.com"
] |
prelink835@gmail.com
|
b3966f762ae361b2f7ec159fdaab52fd4cf10cee
|
e82ff0cf1e4590082aaf0337336fb191595377e0
|
/src/qt/qvaluecombobox.cpp
|
b3a7ef575fc00fcda837794f3d98aa805047aa09
|
[
"MIT"
] |
permissive
|
yoda-x-com/blockchain
|
f2d5969081cbdd1bfcfa4466304e4ccf773fc294
|
5f4d83bc9f7dfb17cd6997e61ca5a5c764fc4772
|
refs/heads/master
| 2022-07-30T11:49:43.534316
| 2020-05-08T08:46:41
| 2020-05-08T08:46:41
| 262,270,941
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 797
|
cpp
|
// Copyright (c) 2011-2013 The Bitcoin developers
// Copyright (c) 2017-2019 The YODA developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "qvaluecombobox.h"
QValueComboBox::QValueComboBox(QWidget* parent) : QComboBox(parent), role(Qt::UserRole)
{
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));
}
QVariant QValueComboBox::value() const
{
return itemData(currentIndex(), role);
}
void QValueComboBox::setValue(const QVariant& value)
{
setCurrentIndex(findData(value, role));
}
void QValueComboBox::setRole(int role)
{
this->role = role;
}
void QValueComboBox::handleSelectionChanged(int idx)
{
Q_EMIT valueChanged();
}
|
[
"support@yoda-x.com"
] |
support@yoda-x.com
|
79349c5822637430c71928954ae50d8d04242155
|
e121e35904a22e1427884bdfbe0e98a56a8a4254
|
/Classes/HelloWorldScene.h
|
343f8c7bbcc782a4c135a38b0f666613c5c9e85b
|
[] |
no_license
|
linchangjian/LCJNoOneDie
|
face7e6b56103b12a85093812a01ad215898f1de
|
9aab3d24b188302178c0a6df0dcd3520cd6ebd06
|
refs/heads/master
| 2021-01-10T18:40:45.953121
| 2015-08-05T04:00:32
| 2015-08-05T04:00:32
| 40,157,909
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 786
|
h
|
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
#include"GameController.h"
class HelloWorld : public cocos2d::LayerColor
{
private :
cocos2d::Vector<GameController*> gcs;
int scoreCount = 0;
Label* _labelSorce;
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
virtual void update(float dt);
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
void timeScore(float dt);
// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
};
#endif // __HELLOWORLD_SCENE_H__
|
[
"linchangjianting@163.com"
] |
linchangjianting@163.com
|
1e5dcce8daf9d84d9574aec7710211f9d6e4f8e0
|
0424284ceb27e08c21de6cb60037eea4c4eac318
|
/src/qt/intro.h
|
6bd73092b9c110e7bdd768073ee8da34d1e5263f
|
[
"MIT"
] |
permissive
|
zelantus/MainNet-critical-fix
|
499ced9931f469a667c9edca8b20f3676db60bb7
|
dd6483350264a93e3a806d041b61acda1cc39871
|
refs/heads/master
| 2022-12-14T23:46:00.374195
| 2020-09-07T18:42:44
| 2020-09-07T18:42:44
| 277,615,888
| 2
| 2
|
MIT
| 2020-09-07T18:41:39
| 2020-07-06T18:13:36
|
C
|
UTF-8
|
C++
| false
| false
| 1,955
|
h
|
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Copyright (c) 2017-2019 The Zelantus Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef RAVEN_QT_INTRO_H
#define RAVEN_QT_INTRO_H
#include <QDialog>
#include <QMutex>
#include <QThread>
static const bool DEFAULT_CHOOSE_DATADIR = false;
class FreespaceChecker;
namespace Ui {
class Intro;
}
/** Introduction screen (pre-GUI startup).
Allows the user to choose a data directory,
in which the wallet and block chain will be stored.
*/
class Intro : public QDialog
{
Q_OBJECT
public:
explicit Intro(QWidget *parent = 0);
~Intro();
QString getDataDirectory();
void setDataDirectory(const QString &dataDir);
/**
* Determine data directory. Let the user choose if the current one doesn't exist.
*
* @returns true if a data directory was selected, false if the user cancelled the selection
* dialog.
*
* @note do NOT call global GetDataDir() before calling this function, this
* will cause the wrong path to be cached.
*/
static bool pickDataDirectory();
/**
* Determine default data directory for operating system.
*/
static QString getDefaultDataDirectory();
Q_SIGNALS:
void requestCheck();
void stopThread();
public Q_SLOTS:
void setStatus(int status, const QString &message, quint64 bytesAvailable);
private Q_SLOTS:
void on_dataDirectory_textChanged(const QString &arg1);
void on_ellipsisButton_clicked();
void on_dataDirDefault_clicked();
void on_dataDirCustom_clicked();
private:
Ui::Intro *ui;
QThread *thread;
QMutex mutex;
bool signalled;
QString pathToCheck;
void startThread();
void checkPath(const QString &dataDir);
QString getPathToCheck();
friend class FreespaceChecker;
};
#endif // RAVEN_QT_INTRO_H
|
[
"comingtom531@gmail.com"
] |
comingtom531@gmail.com
|
96fae6412aace48463b21b25717c967df544ab7b
|
2aad1f0f979723b915009fb55434b9fac29a3024
|
/Externals/libicp/src/icpPointToPlane.cpp
|
b76e3b38b6308104f49bb6240c5785237bcd49c6
|
[] |
no_license
|
zainmehdi/manual_pos_graph_slam
|
778b368972d7f955878dfe756433ac5ed2ea843d
|
dbfb960c48be3684ec509507aae69757b55781fa
|
refs/heads/master
| 2021-06-06T14:09:57.503925
| 2016-10-24T08:16:37
| 2016-10-24T08:16:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 15,466
|
cpp
|
/*
Copyright 2011. All rights reserved.
Institute of Measurement and Control Systems
Karlsruhe Institute of Technology, Germany
Authors: Andreas Geiger
openMP support by Manolis Lourakis, Foundation for Research & Technology - Hellas, Heraklion, Greece
libicp 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 2 of the License, or any later version.
libicp 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
libicp; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include <cassert>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "../include/libicp/icpPointToPlane.h"
using namespace std;
namespace libicp {
// solve the least squares problem min_x |A*x-b| via SVD
static inline Matrix lssolvesvd(Matrix &A, Matrix &b) {
int i;
Matrix U, S, V;
A.svd(U, S, V);
Matrix Uc = U.getMat(0, 0, A.m - 1, A.n - 1); // compact U
Matrix Uctb = ~Uc * b;
for (i = 0; i < Uctb.m; ++i)
Uctb.val[i][0] *= (fabs(S.val[i][0]) > 1E-10) ? 1.0 / S.val[i][0] : 0.0;
return V * Uctb;
}
// Also see (3d part): "Linear Least-Squares Optimization for Point-to-Plane ICP Surface Registration" (Kok-Lim Low)
double IcpPointToPlane::fitStep(const double *T, const int32_t T_num, Matrix &R, Matrix &t,
const std::vector<int32_t> &active) {
int i;
int nact = (int) active.size();
// init matrix for point correspondences
Matrix p_m(nact, dim); // model
Matrix p_t(nact, dim); // template
// dimensionality 2
if (dim == 2) {
// extract matrix and translation vector
double r00 = R.val[0][0];
double r01 = R.val[0][1];
double r10 = R.val[1][0];
double r11 = R.val[1][1];
double t0 = t.val[0][0];
double t1 = t.val[1][0];
// init A and b
Matrix A(nact, 3);
Matrix b(nact, 1);
// establish correspondences
#pragma omp parallel for private(i) default(none) shared(T,active,nact,p_m,p_t,A,b,r00,r01,r10,r11,t0,t1) // schedule (dynamic,2)
for (i = 0; i < nact; i++) {
// kd tree query + result
std::vector<float> query(dim);
kdtree::KDTreeResultVector result;
// get index of active point
int32_t idx = active[i];
// transform point according to R|t
query[0] = (float) (r00 * T[idx * 2 + 0] + r01 * T[idx * 2 + 1] + t0);
query[1] = (float) (r10 * T[idx * 2 + 0] + r11 * T[idx * 2 + 1] + t1);
// search nearest neighbor
M_tree->n_nearest(query, 1, result);
// model point
double dx = M_tree->the_data[result[0].idx][0];
double dy = M_tree->the_data[result[0].idx][1];
// model point normal
double nx = M_normal[result[0].idx * 2 + 0];
double ny = M_normal[result[0].idx * 2 + 1];
// template point
double sx = query[0];
double sy = query[1];
// setup least squares system
A.val[i][0] = ny * sx - nx * sy;
A.val[i][1] = nx;
A.val[i][2] = ny;
b.val[i][0] = nx * (dx - sx) + ny * (dy - sy); //nx*dx+ny*dy-nx*sx-ny*sy;
}
// solve linear least squares
#if 1
// use the normal equations
Matrix A_ = ~A * A;
Matrix b_ = ~A * b;
if (!b_.solve(A_)) return 0; // failure
#else
// use SVD which is slower but more stable numerically
Matrix b_=lssolvesvd(A, b);
#endif
// rotation matrix
Matrix R_ = Matrix::eye(2);
R_.val[0][1] = -b_.val[0][0];
R_.val[1][0] = +b_.val[0][0];
// orthonormalized rotation matrix
Matrix U, W, V;
R_.svd(U, W, V);
R_ = U * ~V;
// fix improper matrix problem
if (R_.det() < 0) {
Matrix B = Matrix::eye(dim);
B.val[dim - 1][dim - 1] = R_.det();
R_ = V * B * ~U;
}
// translation vector
Matrix t_(2, 1);
t_.val[0][0] = b_.val[1][0];
t_.val[1][0] = b_.val[2][0];
// compose: R|t = R_|t_ * R|t
R = R_ * R;
t = R_ * t + t_;
return max((R_ - Matrix::eye(2)).l2norm(), t_.l2norm());
// dimensionality 3
} else {
// extract matrix and translation vector
double r00 = R.val[0][0];
double r01 = R.val[0][1];
double r02 = R.val[0][2];
double r10 = R.val[1][0];
double r11 = R.val[1][1];
double r12 = R.val[1][2];
double r20 = R.val[2][0];
double r21 = R.val[2][1];
double r22 = R.val[2][2];
double t0 = t.val[0][0];
double t1 = t.val[1][0];
double t2 = t.val[2][0];
// init A and b
Matrix A(nact, 6);
Matrix b(nact, 1);
// establish correspondences
#pragma omp parallel for private(i) default(none) shared(T,active,nact,p_m,p_t,A,b,r00,r01,r02,r10,r11,r12,r20,r21,r22,t0,t1,t2) // schedule (dynamic,2)
for (i = 0; i < nact; i++) {
// kd tree query + result
std::vector<float> query(dim);
kdtree::KDTreeResultVector result;
// get index of active point
int32_t idx = active[i];
// transform point according to R|t
query[0] = (float) (r00 * T[idx * 3 + 0] + r01 * T[idx * 3 + 1] + r02 * T[idx * 3 + 2] + t0);
query[1] = (float) (r10 * T[idx * 3 + 0] + r11 * T[idx * 3 + 1] + r12 * T[idx * 3 + 2] + t1);
query[2] = (float) (r20 * T[idx * 3 + 0] + r21 * T[idx * 3 + 1] + r22 * T[idx * 3 + 2] + t2);
// search nearest neighbor
M_tree->n_nearest(query, 1, result);
//assert(result.size()!=0); // check if NN search failed
// model point
double dx = M_tree->the_data[result[0].idx][0];
double dy = M_tree->the_data[result[0].idx][1];
double dz = M_tree->the_data[result[0].idx][2];
// model point normal
double nx = M_normal[result[0].idx * 3 + 0];
double ny = M_normal[result[0].idx * 3 + 1];
double nz = M_normal[result[0].idx * 3 + 2];
// template point
double sx = query[0];
double sy = query[1];
double sz = query[2];
// setup least squares system
A.val[i][0] = nz * sy - ny * sz;
A.val[i][1] = nx * sz - nz * sx;
A.val[i][2] = ny * sx - nx * sy;
A.val[i][3] = nx;
A.val[i][4] = ny;
A.val[i][5] = nz;
b.val[i][0] =
nx * (dx - sx) + ny * (dy - sy) + nz * (dz - sz); //nx*dx+ny*dy+nz*dz-nx*sx-ny*sy-nz*sz;
}
// solve linear least squares
#if 1
// use the normal equations
Matrix A_ = ~A * A;
Matrix b_ = ~A * b;
if (!b_.solve(A_)) return 0; // failure
#else
// use SVD which is slower but more stable numerically
Matrix b_=lssolvesvd(A, b);
#endif
// rotation matrix
Matrix R_ = Matrix::eye(3);
R_.val[0][1] = -b_.val[2][0];
R_.val[1][0] = +b_.val[2][0];
R_.val[0][2] = +b_.val[1][0];
R_.val[2][0] = -b_.val[1][0];
R_.val[1][2] = -b_.val[0][0];
R_.val[2][1] = +b_.val[0][0];
// orthonormalized rotation matrix
Matrix U, W, V;
R_.svd(U, W, V);
R_ = U * ~V;
// fix improper matrix problem
if (R_.det() < 0) {
Matrix B = Matrix::eye(dim);
B.val[dim - 1][dim - 1] = R_.det();
R_ = V * B * ~U;
}
// translation vector
Matrix t_(3, 1);
t_.val[0][0] = b_.val[3][0];
t_.val[1][0] = b_.val[4][0];
t_.val[2][0] = b_.val[5][0];
// compose: R|t = R_|t_ * R|t
R = R_ * R;
t = R_ * t + t_;
return max((R_ - Matrix::eye(3)).l2norm(), t_.l2norm());
}
// failure
return 0;
}
std::vector<int32_t> IcpPointToPlane::getInliers(const double *T, const int32_t T_num, const Matrix &R,
const Matrix &t, const double indist) {
// init inlier vector + query point + query result
vector<int32_t> inliers;
std::vector<float> query(dim);
kdtree::KDTreeResultVector neighbor;
// dimensionality 2
if (dim == 2) {
// extract matrix and translation vector
double r00 = R.val[0][0];
double r01 = R.val[0][1];
double r10 = R.val[1][0];
double r11 = R.val[1][1];
double t0 = t.val[0][0];
double t1 = t.val[1][0];
// check for all points if they are inliers
for (int32_t i = 0; i < T_num; i++) {
// transform point according to R|t
double sx = r00 * T[i * 2 + 0] + r01 * T[i * 2 + 1] + t0;
query[0] = (float) sx;
double sy = r10 * T[i * 2 + 0] + r11 * T[i * 2 + 1] + t1;
query[1] = (float) sy;
// search nearest neighbor
M_tree->n_nearest(query, 1, neighbor);
//assert(result.size()!=0); // check if NN search failed
// model point
double dx = M_tree->the_data[neighbor[0].idx][0];
double dy = M_tree->the_data[neighbor[0].idx][1];
// model point normal
double nx = M_normal[neighbor[0].idx * 2 + 0];
double ny = M_normal[neighbor[0].idx * 2 + 1];
// check if it is an inlier
if ((sx - dx) * nx + (sy - dy) * ny < indist)
inliers.push_back(i);
}
// dimensionality 3
} else {
// extract matrix and translation vector
double r00 = R.val[0][0];
double r01 = R.val[0][1];
double r02 = R.val[0][2];
double r10 = R.val[1][0];
double r11 = R.val[1][1];
double r12 = R.val[1][2];
double r20 = R.val[2][0];
double r21 = R.val[2][1];
double r22 = R.val[2][2];
double t0 = t.val[0][0];
double t1 = t.val[1][0];
double t2 = t.val[2][0];
// check for all points if they are inliers
for (int32_t i = 0; i < T_num; i++) {
// transform point according to R|t
double sx = r00 * T[i * 3 + 0] + r01 * T[i * 3 + 1] + r02 * T[i * 3 + 2] + t0;
query[0] = (float) sx;
double sy = r10 * T[i * 3 + 0] + r11 * T[i * 3 + 1] + r12 * T[i * 3 + 2] + t1;
query[1] = (float) sy;
double sz = r20 * T[i * 3 + 0] + r21 * T[i * 3 + 1] + r22 * T[i * 3 + 2] + t2;
query[2] = (float) sz;
// search nearest neighbor
M_tree->n_nearest(query, 1, neighbor);
// model point
double dx = M_tree->the_data[neighbor[0].idx][0];
double dy = M_tree->the_data[neighbor[0].idx][1];
double dz = M_tree->the_data[neighbor[0].idx][2];
// model point normal
double nx = M_normal[neighbor[0].idx * 3 + 0];
double ny = M_normal[neighbor[0].idx * 3 + 1];
double nz = M_normal[neighbor[0].idx * 3 + 2];
// check if it is an inlier
if ((sx - dx) * nx + (sy - dy) * ny + (sz - dz) * nz < indist)
inliers.push_back(i);
}
}
// return vector with inliers
return inliers;
}
void IcpPointToPlane::computeNormal(const kdtree::KDTreeResultVector &neighbors, double *M_normal,
const double flatness) {
// dimensionality 2
if (dim == 2) {
// extract neighbors
Matrix P(neighbors.size(), 2);
Matrix mu(1, 2);
for (uint32_t i = 0; i < neighbors.size(); i++) {
double x = M_tree->the_data[neighbors[i].idx][0];
double y = M_tree->the_data[neighbors[i].idx][1];
P.val[i][0] = x;
P.val[i][1] = y;
mu.val[0][0] += x;
mu.val[0][1] += y;
}
// zero mean
mu = mu / (double) neighbors.size();
Matrix Q = P - Matrix::ones(neighbors.size(), 1) * mu;
// principal component analysis
Matrix H = ~Q * Q;
Matrix U, W, V;
H.svd(U, W, V);
// normal
M_normal[0] = U.val[0][1];
M_normal[1] = U.val[1][1];
// dimensionality 3
} else {
// extract neighbors
Matrix P(neighbors.size(), 3);
Matrix mu(1, 3);
for (uint32_t i = 0; i < neighbors.size(); i++) {
double x = M_tree->the_data[neighbors[i].idx][0];
double y = M_tree->the_data[neighbors[i].idx][1];
double z = M_tree->the_data[neighbors[i].idx][2];
P.val[i][0] = x;
P.val[i][1] = y;
P.val[i][2] = z;
mu.val[0][0] += x;
mu.val[0][1] += y;
mu.val[0][2] += z;
}
// zero mean
mu = mu / (double) neighbors.size();
Matrix Q = P - Matrix::ones(neighbors.size(), 1) * mu;
// principal component analysis
Matrix H = ~Q * Q;
Matrix U, W, V;
H.svd(U, W, V);
// normal
M_normal[0] = U.val[0][2];
M_normal[1] = U.val[1][2];
M_normal[2] = U.val[2][2];
}
}
double *IcpPointToPlane::computeNormals(const int32_t num_neighbors, const double flatness) {
double *M_normal = (double *) malloc(M_tree->N * dim * sizeof(double));
kdtree::KDTreeResultVector neighbors;
for (int32_t i = 0; i < M_tree->N; i++) {
M_tree->n_nearest_around_point(i, 0, num_neighbors, neighbors);
if (dim == 2) computeNormal(neighbors, M_normal + i * 2, flatness);
else computeNormal(neighbors, M_normal + i * 3, flatness);
}
return M_normal;
}
}
|
[
"jaejun0201@gmail.com"
] |
jaejun0201@gmail.com
|
28633820a8c7bed0ddff26eeead607e5c8204395
|
87592b4207788088ce5c836f1a95dac553f7e417
|
/include/exch/dataExOnTheCouch.h
|
c1a438bcf02698038a2a5c39555344e8bd64274e
|
[] |
no_license
|
jtsiva/nachonet
|
af4ac3938b8d70b8ec67028255172d102d9c2f2d
|
3f0030da749d90ac296f72ef2a304bd53c0c3b7a
|
refs/heads/master
| 2020-12-25T17:34:12.665441
| 2016-09-01T20:54:57
| 2016-09-01T20:54:57
| 23,408,386
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,356
|
h
|
/*******************************************************************************
File: dataExOnTheCouch.h
Author: Josh Siva
Date: 3/3/14
Project: NachoNet
Purpose: Defines the interface to the data exchange module on the couch. This
extends the data exchange module to work with CouchDB
*******************************************************************************/
#pragma once
#include "dataEx.h"
#include "../util/json.h"
#include "../util/jsonParser.h"
#include "multicast.h"
#include <curl/curl.h>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <thread>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <cstdio>
#include <ctime>
class dataExOnTheCouch : public dataEx
{
public:
dataExOnTheCouch ();
virtual ~dataExOnTheCouch ();
void setIP (std::string newIP);
std::string getIP () const;
void greetNewNode ();
virtual void ping (Message message); //push msg
virtual void checkMessages ();
virtual void pushUpdates (int flag);
virtual void pullUpdates (int flag);
virtual void setState (std::string state);
virtual void discover ();
static const double TIMEOUT;
static const long CURL_TIMEOUT = 30;
static const int DEFAULT_COUCH_PORT = 5984;
static const std::string LOCALHOST;
static enum DB {ADMIN, NODES, DEVICES, ALL, NODES_END} DB;
static const std::string TARGET_DB[];
static const std::string ALL_DOCS_Q;
//these are the keys for all of the JSON pairs we need to use
static const std::string LOCATION;
static const std::string ID;
static const std::string ALT_ID;
static const std::string IP;
static const std::string X_COOR;
static const std::string Y_COOR;
static const std::string MEASUREMENTS;
static const std::string DEV_ID;
static const std::string DISTANCE;
static const std::string REVISION;
static const std::string RESPONSE_REV;
static const std::string SOURCE;
static const std::string TARGET;
static const std::string REPLICATE;
static const std::string DOC_IDS;
static const std::string STATE;
static const std::string MESSAGE;
static const std::string MSG_TEXT;
static const std::string MSG_SRC;
static const std::string DELETED;
static const std::string TOTAL_ROWS; //used to count docs
static const std::string ROWS; //used to look through docs in db
private:
void updateNodesFromCouch ();
void updateDevsFromCouch ();
void updateCouchFromNode ();
void updateCouchFromDevs ();
multicast * pNachoCast;
bool stillGreetingNodes;
std::thread * pGreeter;
//from http://www.cplusplus.com/forum/unices/45878/
CURLcode curlRead(const std::string& url, std::ostream& os,
long timeout = CURL_TIMEOUT);
CURLcode curlPut(const std::string& url, const std::string& json,
std::ostream& os);
CURLcode curlPost(const std::string& url, const std::string& json,
std::ostream& os);
void clearDB (std::string url, std::ostream& os);
std::map<int, std::string> nodeIPAddr;
//We need to track the current revision number of each document
std::map<int, std::string> nodeDBRevisions;
std::map<std::string, std::string> devDBRevisions;
std::string myIP;
};
|
[
"jtsiva@gmail.com"
] |
jtsiva@gmail.com
|
96ddb1ceef52df49a8f73fc764b331f12ed4a105
|
f949d51be3ed5d02761621da4f7688de1c00a2d5
|
/egfilebuf.h
|
bf9d09943bc49aa7d574a7977879258d9ff58f0a
|
[] |
no_license
|
vpike/LomonosovTB
|
fc200d30cc3159b182e21db8a6cc4755bada3548
|
3aee8da7b0680c42a249a5338df4cb37cb6f7498
|
refs/heads/master
| 2021-06-01T17:45:51.319274
| 2018-09-21T11:41:09
| 2018-09-21T11:41:09
| 17,903,872
| 2
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,515
|
h
|
#ifndef EGFILEBUF_H_
#define EGFILEBUF_H_
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _MSC_VER
#include <unistd.h>
#else
#include <io.h>
#endif
#include "egmaintypes.h"
#ifdef WIN32
#define WIN32_FILE
#endif
//#define FILE_VIA_MPI
// basic buffered reading plain files
#ifdef FILE_VIA_MPI
typedef MPI_Offset file_offset;
#else
typedef unsigned long long file_offset;
#endif
#define FB_TO_THE_END 0xffffffffffffffffLL
#define FB_NO_SEEK 0xffffffffffffffffLL
class read_file_bufferizer {
protected:
#ifdef FILE_VIA_MPI
MPI_File fh;
#else
#ifdef WIN32_FILE
HANDLE fh;
#else
int fh; // handle of file
#endif
#endif
bool no_file;
bool opened_;
char *buffer;
unsigned long buf_size, buf_pos, bytes_in_buffer;
file_offset cur_file_pos_read, cur_file_pos_write, end_file_pos;
virtual void read_buffer();
bool write_mode;
public:
char *read_file_name;
bool not_caching;
#ifdef PARALLEL_TB
bool locked;
#endif
bool trylock() {
#ifdef PARALLEL_TB
if (locked)
return false;
else {
locked = true;
return true;
}
#else
return true;
#endif
}
void unlock();
file_offset total_file_length; // read-only, filled in begin_read()
read_file_bufferizer() {
#ifdef PARALLEL_TB
locked = false;
#endif
no_file = true; buffer = NULL;
not_caching = true;
opened_ = false;
read_file_name = NULL;
}
virtual ~read_file_bufferizer() {
if (!no_file) {
#ifndef WIN32_FILE
if (write_mode) flush();
#endif
#ifdef FILE_VIA_MPI
MPI_File_close(&fh);
#else
#ifdef WIN32_FILE
CloseHandle(fh);
#else
close(fh);
#endif
#endif
}
if (buffer) free(buffer);
if (read_file_name) free(read_file_name);
}
virtual bool begin_read(const char *filename, file_offset start_pos, file_offset length);
virtual void read(char *data, unsigned long size);
bool end_of_file() { return buf_pos >= bytes_in_buffer && cur_file_pos_read >= end_file_pos; }
virtual file_offset current_file_pos() { return cur_file_pos_read - bytes_in_buffer + buf_pos; }
virtual void seek(file_offset new_pos);
#ifndef WIN32_FILE
void flush();
#endif
virtual void set_buf_size(unsigned long value);
int get_size() {
return sizeof(read_file_bufferizer) + buf_size;
}
};
#ifndef WIN32_FILE
// buffered read-write of plain files
class plain_file_bufferizer: public read_file_bufferizer {
public:
bool begin_write(const char *filename, file_offset start_pos, file_offset length);
void write(char *data, unsigned long size);
};
#endif
#endif /*EGFILEBUF_H_*/
|
[
"vshchukin@boiler-n.bishop"
] |
vshchukin@boiler-n.bishop
|
fb1bdd1131b84ed9d823e18804172cce6ad7e549
|
145a23997f344e77192975ebd44452cf54b46b43
|
/Survival_Game/Intermediate/Build/Win64/UE4Editor/Inc/Survival_Game/Survival_GameGameMode.gen.cpp
|
e4bfdbb59a5ed07e1e692fa4aa3856b412aecfa2
|
[] |
no_license
|
EnricoSandri/Start_Project
|
8b06acbf67c8b584dadc50436e6e4a1379592304
|
23e5d6ccbb3f6e8ca6a6d5441b11efacca82cb4b
|
refs/heads/main
| 2023-06-10T16:33:55.046073
| 2021-06-15T10:53:21
| 2021-06-15T10:53:21
| 377,780,824
| 0
| 0
| null | 2021-06-17T09:48:07
| 2021-06-17T09:48:06
| null |
UTF-8
|
C++
| false
| false
| 3,650
|
cpp
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/GeneratedCppIncludes.h"
#include "Survival_Game/Survival_GameGameMode.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4883)
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS
void EmptyLinkFunctionForGeneratedCodeSurvival_GameGameMode() {}
// Cross Module References
SURVIVAL_GAME_API UClass* Z_Construct_UClass_ASurvival_GameGameMode_NoRegister();
SURVIVAL_GAME_API UClass* Z_Construct_UClass_ASurvival_GameGameMode();
ENGINE_API UClass* Z_Construct_UClass_AGameModeBase();
UPackage* Z_Construct_UPackage__Script_Survival_Game();
// End Cross Module References
void ASurvival_GameGameMode::StaticRegisterNativesASurvival_GameGameMode()
{
}
UClass* Z_Construct_UClass_ASurvival_GameGameMode_NoRegister()
{
return ASurvival_GameGameMode::StaticClass();
}
struct Z_Construct_UClass_ASurvival_GameGameMode_Statics
{
static UObject* (*const DependentSingletons[])();
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam Class_MetaDataParams[];
#endif
static const FCppClassTypeInfoStatic StaticCppClassTypeInfo;
static const UE4CodeGen_Private::FClassParams ClassParams;
};
UObject* (*const Z_Construct_UClass_ASurvival_GameGameMode_Statics::DependentSingletons[])() = {
(UObject* (*)())Z_Construct_UClass_AGameModeBase,
(UObject* (*)())Z_Construct_UPackage__Script_Survival_Game,
};
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_ASurvival_GameGameMode_Statics::Class_MetaDataParams[] = {
{ "HideCategories", "Info Rendering MovementReplication Replication Actor Input Movement Collision Rendering Utilities|Transformation" },
{ "IncludePath", "Survival_GameGameMode.h" },
{ "ModuleRelativePath", "Survival_GameGameMode.h" },
{ "ShowCategories", "Input|MouseInput Input|TouchInput" },
};
#endif
const FCppClassTypeInfoStatic Z_Construct_UClass_ASurvival_GameGameMode_Statics::StaticCppClassTypeInfo = {
TCppClassTypeTraits<ASurvival_GameGameMode>::IsAbstract,
};
const UE4CodeGen_Private::FClassParams Z_Construct_UClass_ASurvival_GameGameMode_Statics::ClassParams = {
&ASurvival_GameGameMode::StaticClass,
"Game",
&StaticCppClassTypeInfo,
DependentSingletons,
nullptr,
nullptr,
nullptr,
UE_ARRAY_COUNT(DependentSingletons),
0,
0,
0,
0x008802ACu,
METADATA_PARAMS(Z_Construct_UClass_ASurvival_GameGameMode_Statics::Class_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UClass_ASurvival_GameGameMode_Statics::Class_MetaDataParams))
};
UClass* Z_Construct_UClass_ASurvival_GameGameMode()
{
static UClass* OuterClass = nullptr;
if (!OuterClass)
{
UE4CodeGen_Private::ConstructUClass(OuterClass, Z_Construct_UClass_ASurvival_GameGameMode_Statics::ClassParams);
}
return OuterClass;
}
IMPLEMENT_CLASS(ASurvival_GameGameMode, 3670089407);
template<> SURVIVAL_GAME_API UClass* StaticClass<ASurvival_GameGameMode>()
{
return ASurvival_GameGameMode::StaticClass();
}
static FCompiledInDefer Z_CompiledInDefer_UClass_ASurvival_GameGameMode(Z_Construct_UClass_ASurvival_GameGameMode, &ASurvival_GameGameMode::StaticClass, TEXT("/Script/Survival_Game"), TEXT("ASurvival_GameGameMode"), false, nullptr, nullptr, nullptr);
DEFINE_VTABLE_PTR_HELPER_CTOR(ASurvival_GameGameMode);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#ifdef _MSC_VER
#pragma warning (pop)
#endif
|
[
"sait.aaron@yahoo.co.uk"
] |
sait.aaron@yahoo.co.uk
|
5944e9f497087eff1265a4af23a1dbbbe6783887
|
283590633be05d51c5166bebd0adb90f17e49aa0
|
/src/protocol/RemotingCommand.cpp
|
46e274b2cb8e91edb54ac2b62ecd59371ec083a4
|
[
"Apache-2.0"
] |
permissive
|
liuyingjie-asir/rocketmq-client-cpp
|
201aeae3bbaa71d4f13a54d9e617e3e89f5f1b1b
|
fed75d8a81d9cfa82458b24ee7747329176e22fc
|
refs/heads/master
| 2021-10-16T09:00:49.566259
| 2019-01-31T02:08:00
| 2019-01-31T02:08:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 9,244
|
cpp
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "RemotingCommand.h"
#include "Logging.h"
#include "MQProtos.h"
#include "MQVersion.h"
#include "SessionCredentials.h"
namespace rocketmq {
boost::atomic<int> RemotingCommand::s_seqNumber;
boost::mutex RemotingCommand::m_clock;
//<!************************************************************************
RemotingCommand::RemotingCommand(int code,
CommandHeader* pExtHeader /* = NULL */)
: m_code(code),
m_language("CPP"),
m_version(MQVersion::s_CurrentVersion),
m_flag(0),
m_remark(""),
m_pExtHeader(pExtHeader) {
boost::lock_guard<boost::mutex> lock(m_clock);
m_opaque = (s_seqNumber.load(boost::memory_order_acquire)) %
(numeric_limits<int>::max());
s_seqNumber.store(m_opaque, boost::memory_order_release);
++s_seqNumber;
}
RemotingCommand::RemotingCommand(int code, string language, int version,
int opaque, int flag, string remark,
CommandHeader* pExtHeader)
: m_code(code),
m_language(language),
m_version(version),
m_opaque(opaque),
m_flag(flag),
m_remark(remark),
m_pExtHeader(pExtHeader) {}
RemotingCommand::RemotingCommand(const RemotingCommand& command) {
Assign(command);
}
RemotingCommand& RemotingCommand::operator=(const RemotingCommand& command) {
if (this != &command) {
Assign(command);
}
return *this;
}
RemotingCommand::~RemotingCommand() { m_pExtHeader = NULL; }
void RemotingCommand::Assign(const RemotingCommand &command) {
m_code = command.m_code;
m_language = command.m_language;
m_version = command.m_version;
m_opaque = command.m_opaque;
m_flag = command.m_flag;
m_remark = command.m_remark;
m_msgBody = command.m_msgBody;
for (auto &it : command.m_extFields) {
m_extFields[it.first] = it.second;
}
m_head = command.m_head;
m_body = command.m_body;
m_parsedJson = command.m_parsedJson;
//m_pExtHeader = command.m_pExtHeader; //ignore this filed at this moment, if need please add it
}
void RemotingCommand::Encode() {
Json::Value root;
root["code"] = m_code;
root["language"] = "CPP";
root["version"] = m_version;
root["opaque"] = m_opaque;
root["flag"] = m_flag;
root["remark"] = m_remark;
if (m_pExtHeader) {
Json::Value extJson;
m_pExtHeader->Encode(extJson);
extJson[SessionCredentials::Signature] =
m_extFields[SessionCredentials::Signature];
extJson[SessionCredentials::AccessKey] =
m_extFields[SessionCredentials::AccessKey];
extJson[SessionCredentials::ONSChannelKey] =
m_extFields[SessionCredentials::ONSChannelKey];
root["extFields"] = extJson;
} else { // for heartbeat
Json::Value extJson;
extJson[SessionCredentials::Signature] =
m_extFields[SessionCredentials::Signature];
extJson[SessionCredentials::AccessKey] =
m_extFields[SessionCredentials::AccessKey];
extJson[SessionCredentials::ONSChannelKey] =
m_extFields[SessionCredentials::ONSChannelKey];
root["extFields"] = extJson;
}
Json::FastWriter fastwrite;
string data = fastwrite.write(root);
uint32 headLen = data.size();
uint32 totalLen = 4 + headLen + m_body.getSize();
uint32 messageHeader[2];
messageHeader[0] = htonl(totalLen);
messageHeader[1] = htonl(headLen);
//<!include self 4 bytes, see : doc/protocol.txt;
m_head.setSize(4 + 4 + headLen);
m_head.copyFrom(messageHeader, 0, sizeof(messageHeader));
m_head.copyFrom(data.c_str(), sizeof(messageHeader), headLen);
}
const MemoryBlock* RemotingCommand::GetHead() const { return &m_head; }
const MemoryBlock* RemotingCommand::GetBody() const { return &m_body; }
void RemotingCommand::SetBody(const char* pData, int len) {
m_body.reset();
m_body.setSize(len);
m_body.copyFrom(pData, 0, len);
}
RemotingCommand* RemotingCommand::Decode(const MemoryBlock& mem) {
//<!decode 1 bytes,4+head+body
uint32 messageHeader[1];
mem.copyTo(messageHeader, 0, sizeof(messageHeader));
int totalLen = mem.getSize();
int headLen = ntohl(messageHeader[0]);
int bodyLen = totalLen - 4 - headLen;
//<!decode header;
const char* const pData = static_cast<const char*>(mem.getData());
Json::Reader reader;
Json::Value object;
const char* begin = pData + 4;
const char* end = pData + 4 + headLen;
if (!reader.parse(begin, end, object)) {
THROW_MQEXCEPTION(MQClientException, "conn't parse json", -1);
}
int code = object["code"].asInt();
string language = object["language"].asString();
int version = object["version"].asInt();
int opaque = object["opaque"].asInt();
int flag = object["flag"].asInt();
Json::Value v = object["remark"];
string remark = "";
if (!v.isNull()) {
remark = object["remark"].asString();
}
LOG_DEBUG(
"code:%d, remark:%s, version:%d, opaque:%d, flag:%d, remark:%s, "
"headLen:%d, bodyLen:%d ",
code, language.c_str(), version, opaque, flag, remark.c_str(), headLen,
bodyLen);
RemotingCommand* cmd =
new RemotingCommand(code, language, version, opaque, flag, remark, NULL);
cmd->setParsedJson(object);
if (bodyLen > 0) {
cmd->SetBody(pData + 4 + headLen, bodyLen);
}
return cmd;
}
void RemotingCommand::markResponseType() {
int bits = 1 << RPC_TYPE;
m_flag |= bits;
}
bool RemotingCommand::isResponseType() {
int bits = 1 << RPC_TYPE;
return (m_flag & bits) == bits;
}
void RemotingCommand::markOnewayRPC() {
int bits = 1 << RPC_ONEWAY;
m_flag |= bits;
}
bool RemotingCommand::isOnewayRPC() {
int bits = 1 << RPC_ONEWAY;
return (m_flag & bits) == bits;
}
void RemotingCommand::setOpaque(const int opa) { m_opaque = opa; }
void RemotingCommand::SetExtHeader(int code) {
try {
Json::Value ext = m_parsedJson["extFields"];
if (!ext.isNull()) {
m_pExtHeader = NULL;
switch (code) {
case SEND_MESSAGE:
m_pExtHeader.reset(SendMessageResponseHeader::Decode(ext));
break;
case PULL_MESSAGE:
m_pExtHeader.reset(PullMessageResponseHeader::Decode(ext));
break;
case GET_MIN_OFFSET:
m_pExtHeader.reset(GetMinOffsetResponseHeader::Decode(ext));
break;
case GET_MAX_OFFSET:
m_pExtHeader.reset(GetMaxOffsetResponseHeader::Decode(ext));
break;
case SEARCH_OFFSET_BY_TIMESTAMP:
m_pExtHeader.reset(SearchOffsetResponseHeader::Decode(ext));
break;
case GET_EARLIEST_MSG_STORETIME:
m_pExtHeader.reset(
GetEarliestMsgStoretimeResponseHeader::Decode(ext));
break;
case QUERY_CONSUMER_OFFSET:
m_pExtHeader.reset(QueryConsumerOffsetResponseHeader::Decode(ext));
break;
case RESET_CONSUMER_CLIENT_OFFSET:
m_pExtHeader.reset(ResetOffsetRequestHeader::Decode(ext));
break;
case GET_CONSUMER_RUNNING_INFO:
m_pExtHeader.reset(GetConsumerRunningInfoRequestHeader::Decode(ext));
break;
case NOTIFY_CONSUMER_IDS_CHANGED:
m_pExtHeader.reset(
NotifyConsumerIdsChangedRequestHeader::Decode(ext));
default:
break;
}
}
} catch (MQException& e) {
LOG_ERROR("set response head error");
}
}
void RemotingCommand::setCode(int code) { m_code = code; }
int RemotingCommand::getCode() const { return m_code; }
int RemotingCommand::getOpaque() const { return m_opaque; }
string RemotingCommand::getRemark() const { return m_remark; }
void RemotingCommand::setRemark(string mark) { m_remark = mark; }
CommandHeader* RemotingCommand::getCommandHeader() const {
return m_pExtHeader.get();
}
void RemotingCommand::setParsedJson(Json::Value json) { m_parsedJson = json; }
const int RemotingCommand::getFlag() const { return m_flag; }
const int RemotingCommand::getVersion() const { return m_version; }
void RemotingCommand::setMsgBody(const string& body) { m_msgBody = body; }
string RemotingCommand::getMsgBody() const { return m_msgBody; }
void RemotingCommand::addExtField(const string& key, const string& value) {
m_extFields[key] = value;
}
std::string RemotingCommand::ToString() const {
std::stringstream ss;
ss << "code:" << m_code
<< ",opaque:" << m_opaque
<< ",flag:" << m_flag
<< ",body.size:" << m_body.getSize()
<< ",header.size:" << m_head.getSize();
return ss.str();
}
} //<!end namespace;
|
[
"libya_003@163.com"
] |
libya_003@163.com
|
6e331f6f065c95884d5610e6f957d5aca04e3b08
|
539996b61db3ac81dfbaeb1a640b0e60442c7631
|
/Classes/AppDelegate.cpp
|
a9e19f0f7f86a6aa845cd52d8c5aa54714ba9039
|
[] |
no_license
|
SelAD/BattleFish
|
99c01f5e936b99837f835ad48adda29f36993b5b
|
96e32ebdd2cb9e4d6f1a838db7c0c3934aa518f0
|
refs/heads/master
| 2023-03-24T09:11:56.579124
| 2018-05-02T08:11:28
| 2018-05-02T08:11:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,333
|
cpp
|
#include "AppDelegate.h"
#include "BFSceneMenu.h"
USING_NS_CC;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene *pScene = BFSceneMenu::scene();
// run
pDirector->runWithScene(pScene);
return true;
}
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground() {
CCDirector::sharedDirector()->stopAnimation();
// if you use SimpleAudioEngine, it must be pause
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
CCDirector::sharedDirector()->startAnimation();
// if you use SimpleAudioEngine, it must resume here
// SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}
|
[
"useful@bk.ru"
] |
useful@bk.ru
|
03cb27e4b5d10b4039283d9a3f0548d5a393faae
|
34b8bb9621ea4ab5a5e5614f6723000f91e5e18d
|
/src/apps/base/sa_baseapp.cpp
|
5c28ab0cd911d1df42b9f4e26e234e2cbdb51f41
|
[
"Apache-2.0"
] |
permissive
|
suggitpe/RPMS
|
39784b8f0dade1d2a078afc26a4dd4b2e4c67176
|
7a12da0128f79b8b0339fd7146105ba955079b8c
|
refs/heads/master
| 2021-01-10T19:19:23.391960
| 2019-04-29T06:46:22
| 2019-04-29T06:46:22
| 10,453,608
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,778
|
cpp
|
#include "sa_baseapp.hpp"
#include "si_baseapplog.hpp"
#include <sys/stat.h>
#include <signal.h>
#include <logging/si_logging.hpp>
#include <utilities/ss_ini.hpp>
#include <base/sx_exception.hpp>
using rpms::SA_BaseApp;
static bool set = false;
///////////////////////////////////////////////////////////////
extern "C" void handler(int sig)
{
// we only want this called once else all hell breaks loose
// as we are using threads we have to adapt to the Linux
// threading policy (no threads just cloned procesess sharing
// address space)
if(!set)
{
set = true;
SA_BaseApp::killApp();
}
}
///////////////////////////////////////////////////////////////
void SA_BaseApp::killApp()
{
mApp->shutdown();
}
///////////////////////////////////////////////////////////////
int SA_BaseApp::baseMain( int aArgC, char *aArgV[] )
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_flags = SA_RESTART;
sa.sa_handler = handler;
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
try
{
struct stat stat_res;
char * cfgFile = ::getenv("RPMS_CFG_FILE");
if( NULL == cfgFile )
{
std::cerr << "\n\t*** RpmsApplication error: Environment variable \'RPMS_CFG_FILE\' "
<< "required ***\n" << std::endl;
exit(1);
}
if( 0 != ::stat( cfgFile, &stat_res ) )
{
std::cerr << "\n\t*** RpmsApplication: Configuration file [" << cfgFile
<< "] does not exist ***\n" << std::endl;
exit(1);
}
if( 0 != ::access( cfgFile, R_OK ) )
{
std::cerr << "\n\t*** RpmsApplication: No read permission on config file ["
<< cfgFile << "] ***\n" << std::endl;
exit(1);
}
SS_Ini::instance()->initialise(cfgFile);
RPMS_INFO( BASE_APP_LOG, "********************************");
RPMS_INFO( BASE_APP_LOG, "INI initialised with [" + std::string(cfgFile) + "]");
RPMS_INFO( BASE_APP_LOG, "********************************");
execute( aArgC, aArgV );
RPMS_INFO( BASE_APP_LOG, "Application execution complete");
RPMS_INFO( BASE_APP_LOG, "********************************");
// now explicitly delete the app while we are in the try catch
delete mApp;
}
catch( SX_Exception &x )
{
std::cerr << "\n\t*** RpmsApplication: Rpms Exception caught *** \n"
<< x.reason() << std::endl;
}
catch( ... )
{
std::cerr << "\n\t*** RpmsApplication: Unknown exception caught ***\n" << std::endl;
}
return 0;
}
///////////////////////////////////////////////////////////////
|
[
"me@suggs.org.uk"
] |
me@suggs.org.uk
|
5f8f62c3af0b014a09fbb993b45b1bb870bda1ef
|
499f4b46c5745bf8ea155551712b4c401861b0eb
|
/NoSqlDb/TestProj1/TestProj1.h
|
46fee14f225e83f64d4b05cbf565aadea5d96564
|
[] |
no_license
|
acmer29/RemoteCodeRepository
|
c2619b0d011f3547e87a0e412ecd3cd76839f740
|
943804560f13ac112ec24e012824e0fe57a339e5
|
refs/heads/master
| 2021-09-26T10:28:35.180250
| 2018-05-01T22:12:50
| 2018-05-01T22:12:50
| 155,156,270
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 831
|
h
|
#pragma once
#ifndef TESTPROJ1_H
#define TESTPROJ1_H
#include <iostream>
#include <iomanip>
#include <functional>
#include "../Query/Query.h"
#include "../DbCore/DbCore.h"
#include "../Persistence/Persisence.h"
#include "../Utilities/TestUtilities/TestUtilities.h"
#include "../Utilities/StringUtilities/StringUtilities.h"
#include "../Test/Test.h"
namespace NoSqlDb {
class testCase {
public:
bool testR1();
bool testR2();
bool testR3();
bool testR4();
bool testR5();
bool testR6();
bool testR7();
bool testR8();
bool testR9();
bool testR10();
bool testR11();
bool testR12();
bool testR13();
void casesRun(std::ostream& out = std::cout);
private:
std::vector<std::_Mem_fn<bool(testCase::*) ()>> cases;
void check(bool result, std::ostream& out);
NoSqlDb::DbCore<std::string> db;
};
}
#endif
|
[
"tqi100@syr.edu"
] |
tqi100@syr.edu
|
c226c4d50afebcc9d93f19e43b43a26ef5da2501
|
3bb2b6eeca9990de89adb9cc4443f50fe29a5369
|
/src/core/util/Audio/DestroyVoice.cpp
|
be5dc5848629c01639a952c1de6bbc81fd6df1db
|
[] |
no_license
|
am11/ffcore
|
2ae7c14a1d75f5b7af0df87c897a4a0bee2381e0
|
4855bfd3c3d0c30c887dd6546c86f7542612e148
|
refs/heads/master
| 2021-01-17T02:03:26.356471
| 2015-08-12T17:56:23
| 2015-08-12T17:56:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,724
|
cpp
|
#include "pch.h"
#include "Audio/AudioDevice.h"
#include "Audio/DestroyVoice.h"
#include "Globals/ProcessGlobals.h"
#include "Graph/Data/GraphCategory.h"
#include "Module/ModuleFactory.h"
BEGIN_INTERFACES(ff::DestroyVoiceWorkItem)
HAS_INTERFACE(ff::IWorkItem)
HAS_INTERFACE(ff::IAudioDeviceChild)
END_INTERFACES()
// STATIC_DATA (object)
static ff::PoolAllocator<ff::ComObject<ff::DestroyVoiceWorkItem>> s_destroyVoiceAllocator;
static HRESULT CreateDestroyVoiceWorkItem(IUnknown *unkOuter, REFGUID clsid, REFGUID iid, void **ppObj)
{
assertRetVal(clsid == GUID_NULL || clsid == __uuidof(ff::DestroyVoiceWorkItem), E_INVALIDARG);
ff::ComPtr<ff::ComObject<ff::DestroyVoiceWorkItem>> pObj = s_destroyVoiceAllocator.New();
assertRetVal(SUCCEEDED(pObj->_Construct(unkOuter)), E_FAIL);
return pObj->QueryInterface(iid, ppObj);
}
bool ff::CreateDestroyVoiceWorkItem(IAudioDevice *device, IXAudio2SourceVoice *source, DestroyVoiceWorkItem **obj)
{
assertRetVal(obj, false);
ComPtr<DestroyVoiceWorkItem, IWorkItem> myObj;
assertHrRetVal(::CreateDestroyVoiceWorkItem(device, GUID_NULL, __uuidof(DestroyVoiceWorkItem), (void **)&myObj), false);
assertRetVal(myObj->Init(source), false);
*obj = myObj.Detach();
return true;
}
static ff::ModuleStartup RegisterWorkItem([](ff::Module &module)
{
static ff::StaticString name(L"Destroy Source Voice Work Item");
module.RegisterClass(
name,
__uuidof(ff::DestroyVoiceWorkItem),
::CreateDestroyVoiceWorkItem,
__uuidof(ff::DestroyVoiceWorkItem),
ff::GetCategoryAudioObject());
});
ff::DestroyVoiceWorkItem::DestroyVoiceWorkItem()
: _source(nullptr)
{
}
ff::DestroyVoiceWorkItem::~DestroyVoiceWorkItem()
{
Reset();
}
HRESULT ff::DestroyVoiceWorkItem::_Construct(IUnknown *unkOuter)
{
assertRetVal(_device.QueryFrom(unkOuter), E_INVALIDARG);
return __super::_Construct(unkOuter);
}
void ff::DestroyVoiceWorkItem::_DeleteThis()
{
s_destroyVoiceAllocator.Delete(static_cast<ComObject<DestroyVoiceWorkItem>*>(this));
}
bool ff::DestroyVoiceWorkItem::Init(IXAudio2SourceVoice *source)
{
assertRetVal(_device && source, false);
_source = source;
return true;
}
// on helper thread
void ff::DestroyVoiceWorkItem::Run()
{
if (_source)
{
_source->DestroyVoice();
_source = nullptr;
}
}
// on main thread
void ff::DestroyVoiceWorkItem::OnCancel()
{
Run();
}
void ff::DestroyVoiceWorkItem::OnComplete()
{
}
ff::IAudioDevice *ff::DestroyVoiceWorkItem::GetDevice() const
{
return _device;
}
void ff::DestroyVoiceWorkItem::Reset()
{
if (_source)
{
if (!ff::ProcessGlobals::Get()->GetThreadPool()->Cancel(this))
{
// already started running, so wait
ff::ProcessGlobals::Get()->GetThreadPool()->Wait(this);
}
assert(!_source);
}
}
|
[
"spadapet@hotmail.com"
] |
spadapet@hotmail.com
|
421c9bd58945581503be80ddc7782450a912fc67
|
15bd7227959f8fd37d4293f44a3d99d5b5172510
|
/LeetCode/1465/Solution.cpp
|
c0e342bdf9dfab7fdee41e886935e5266d2f32ef
|
[] |
no_license
|
dskym/Algorithm
|
a9d589ec47a472a157fb4843010c77a09315e262
|
6b215fdf88ba02370b75c8565867cdc401c40fa1
|
refs/heads/master
| 2023-05-10T22:04:44.567097
| 2023-05-09T13:12:41
| 2023-05-09T13:12:41
| 148,602,397
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 884
|
cpp
|
class Solution {
public:
int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) {
horizontalCuts.push_back(0);
horizontalCuts.push_back(h);
sort(horizontalCuts.begin(), horizontalCuts.end());
verticalCuts.push_back(0);
verticalCuts.push_back(w);
sort(verticalCuts.begin(), verticalCuts.end());
vector<int> a;
vector<int> b;
for(int i=1;i<horizontalCuts.size();++i) {
a.push_back(horizontalCuts[i]-horizontalCuts[i-1]);
}
for(int i=1;i<verticalCuts.size();++i) {
b.push_back(verticalCuts[i]-verticalCuts[i-1]);
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
return (unsigned long long)a[a.size()-1] * (unsigned long long)b[b.size()-1] % 1000000007;
}
};
|
[
"dskym@naver.com"
] |
dskym@naver.com
|
447ef67c61d6447521207020f1a781568e9f8968
|
9f4f22f499064eb1bfb99b185dd71c32dd1f603a
|
/LSDShapeTools.hpp
|
38c1ef97d1bd4b86c6523a5f2ba6f3ce6c89cf59
|
[] |
no_license
|
LSDtopotools/LSDTT_Hillslope_Analysis
|
f23a0d5d3375a23b418cb9676765d471660d3f2d
|
fb12d2f6d18fc33060b4dd93fe503466fbd370df
|
refs/heads/master
| 2021-01-10T16:50:31.332236
| 2015-11-10T12:44:19
| 2015-11-10T12:44:19
| 45,909,225
| 0
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,957
|
hpp
|
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// LSDShapeTools
// Land Surface Dynamics Shapefile tools
//
// A collection of routines for maipulating the binary ESRI shapefile format
// for use within the Edinburgh Land Surface Dynamics group topographic toolbox
//
// Developed by:
// Simon M. Mudd
// Martin D. Hurst
// David T. Milodowski
// Stuart W.D. Grieve
// Declan A. Valters
// Fiona Clubb
//
// Copyright (C) 2013 Simon M. Mudd 2013
//
// Developer can be contacted by simon.m.mudd _at_ ed.ac.uk
//
// Simon Mudd
// University of Edinburgh
// School of GeoSciences
// Drummond Street
// Edinburgh, EH8 9XP
// Scotland
// United Kingdom
//
// 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 2 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, write to:
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301
// USA
//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//-----------------------------------------------------------------
//DOCUMENTATION URL: http://www.geos.ed.ac.uk/~s0675405/LSD_Docs/
//-----------------------------------------------------------------
using namespace std;
#include <vector>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <vector>
#include <fstream>
#include <cmath>
#ifndef ShapeTools_H
#define ShapeTools_H
// An unsigned char can store 1 Byte (8bits) of data
typedef unsigned char BYTE;
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to test the Byte order of the system.
// Returns a boolean value where true is little endian.
//
// SWDG 11/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
bool SystemEndiannessTest();
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Structure to store X and Y point data.
//
// SWDG 12/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
struct PointData
{
vector<double> X;
vector<double> Y;
};
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to swap the byte order of a word in memory. Used if the system's byte order
// does not match the data in the shapefile.
//
// SWDG 11/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void ByteSwap(int length, void * ByteData);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to load an ESRI ShapeFile.
//
// Only works for X,Y point shapefiles at present and it's behavious is totally undefined
// if you pass in any other type of file.
//
// In future this will be rebuilt into a full class that can support shapefiles of
// different types.
//
// Built in part from:
// http://www.dreamincode.net/forums/topic/170054-understanding-and-reading-binary-files-in-c/
//
// SWDG 13/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PointData LoadShapefile(string Filename);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to load an ESRI polyline Shapefile.
//
// Only works for polyline shapefiles at present and it's behaviour is totally undefined
// if you pass in any other type of file.
//
// In future this will be rebuilt into a full class that can support shapefiles of
// different types.
//
// Returns a vector of points. So that each item in the vector represents a single polyline.
//
// Built in part from:
// http://www.dreamincode.net/forums/topic/170054-understanding-and-reading-binary-files-in-c/
//
// SWDG 17/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
vector<PointData> LoadPolyline(string Filename);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to convert an IndexChannelTree to a PointData object.
//
// Returns a vector of points.
//
// multistem_option -> 0 = mainstem only, 1 = all tributaries, 2 specify tributary number (DAV 09/04/2015)
// DTM 11/07/2014
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PointData LoadChannelTree(string Filename, int multistem_option = 0, int trib_number = 0);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Method to get the size of the binary file being loaded.
//
// Taken from http://www.dreamincode.net/forums/topic/170054-understanding-and-reading-binary-files-in-c/
//
// SWDG 10/3/14
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
long getFileSize(FILE *file);
/// @brief Ellipsoid class for converting coordinates between UTM and lat long
class LSDEllipsoid
{
public:
/// @detail the default constructor
LSDEllipsoid() {};
/// @detail assigment constructor for the ellipsiod class
/// @param id a reference into the ellipsoid
/// @param name the name of the ellipsoid
/// @param radius the radius of the equator in km
/// @param fr not sure what this is
LSDEllipsoid(int id, char* name, double radius, double fr)
{ Name=name; EquatorialRadius=radius; eccSquared=2/fr-1/(fr*fr);}
/// name of the ellipsoid
char* Name;
/// equatorial radius in km
double EquatorialRadius;
/// square of the equatorial radius
double eccSquared;
};
/// @brief Datum class for converting coordinates between UTM and lat long
class LSDDatum
{
public:
LSDDatum(){};
LSDDatum(int id, char* name, int eid, double dx, double dy, double dz)
{ Name=name; eId=eid; dX=dx; dY=dy; dZ=dz;}
/// name of the datum
char* Name;
/// the ellipsoid id
int eId;
double dX;
double dY;
double dZ;
};
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// A class for converting datums and coordinates
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class LSDCoordinateConverterLLandUTM
{
public:
// default constructor. This sets up the data elements.
LSDCoordinateConverterLLandUTM() { create(); }
/// @brief converts LatLong to UTM coords
/// 3/22/95: by ChuckGantz chuck.gantz@globalstar.com, from USGS Bulletin 1532.
/// @param eID the ellipsoid ID. Options are:
/// 0 = "Airy1830";
/// 1 = "AiryModified";
/// 2 = "AustralianNational";
/// 3 = "Bessel1841Namibia";
/// 4 = "Bessel1841";
/// 5 = "Clarke1866";
/// 6 = "Clarke1880";
/// 7 = "EverestIndia1830";
/// 8 = "EverestSabahSarawak";
/// 9 = "EverestIndia1956";
/// 10 = "EverestMalaysia1969";
/// 11 = "EverestMalay_Sing";
/// 12 = "EverestPakistan";
/// 13 = "Fischer1960Modified";
/// 14 = "Helmert1906";
/// 15 = "Hough1960";
/// 16 = "Indonesian1974";
/// 17 = "International1924";
/// 18 = "Krassovsky1940";
/// 19 = "GRS80";
/// 20 = "SouthAmerican1969";
/// 21 = "WGS72";
/// 22 = "WGS84";
/// @param Lat the latitude in decimal degrees
/// @param Long the longitude in decimal degrees
/// @param Northing in metres. This argument is replaced by the function
/// @param Easting in metres. This argument is replaced by the function
/// @param Zone the UTM zone. This argument is replaced by the function
/// @author SMM, modified from Chuck Gantz
/// @date 07/12/2014
void LLtoUTM(int eId, double Lat, double Long,
double& Northing, double& Easting, int& Zone);
/// @brief converts LatLong to UTM coords
/// 3/22/95: by ChuckGantz chuck.gantz@globalstar.com, from USGS Bulletin 1532.
/// @param eID the ellipsoid ID. Options are:
/// 0 = "Airy1830";
/// 1 = "AiryModified";
/// 2 = "AustralianNational";
/// 3 = "Bessel1841Namibia";
/// 4 = "Bessel1841";
/// 5 = "Clarke1866";
/// 6 = "Clarke1880";
/// 7 = "EverestIndia1830";
/// 8 = "EverestSabahSarawak";
/// 9 = "EverestIndia1956";
/// 10 = "EverestMalaysia1969";
/// 11 = "EverestMalay_Sing";
/// 12 = "EverestPakistan";
/// 13 = "Fischer1960Modified";
/// 14 = "Helmert1906";
/// 15 = "Hough1960";
/// 16 = "Indonesian1974";
/// 17 = "International1924";
/// 18 = "Krassovsky1940";
/// 19 = "GRS80";
/// 20 = "SouthAmerican1969";
/// 21 = "WGS72";
/// 22 = "WGS84";
/// @param Northing in metres.
/// @param Easting in metres.
/// @param Zone the UTM zone.
/// @param isNorth is a boolean that states if the map is in the northern hemisphere
/// @param Lat the latitude in decimal degrees.
/// This argument is replaced by the function
/// @param Long the longitude in decimal degrees
/// This argument is replaced by the function
/// @author SMM, modified from Chuck Gantz
/// @date 07/12/2014
void UTMtoLL(int eId, double Northing, double Easting, int Zone, bool isNorth,
double& Lat, double& Long);
/// @brief converts LatLongHt in datum dIn, to LatLongHt in datum dTo;
/// @detail 2002dec: by Eugene Reimer, from PeterDana equations.
/// Lat and Long params are in degrees;
/// North latitudes and East longitudes are positive; Height is in meters;
/// ==This approach to Datum-conversion is a waste of time;
/// to get acceptable accuracy a large table is needed -- see NADCON, NTv2...
void DatumConvert(int dIn, double LatIn, double LongIn, double HtIn,
int dTo, double& LatTo, double& LongTo, double& HtTo);
protected:
/// @brief a vector holding the ellipsoids
vector<LSDEllipsoid> Ellipsoids;
/// @brief a vectro holding the datums
vector<LSDDatum> Datums;
double RADIANS_PER_DEGREE;
double DEGREES_PER_RADIAN;
/** Useful constants **/
double TWOPI;
double HALFPI;
// Grid granularity for rounding UTM coordinates to generate MapXY.
double grid_size; // 100 km grid
// WGS84 Parameters
double WGS84_A; // major axis
double WGS84_B; // minor axis
double WGS84_F; // ellipsoid flattening
double WGS84_E; // first eccentricity
double WGS84_EP; // second eccentricity
// UTM Parameters
double UTM_K0; // scale factor
double UTM_FE; // false easting
double UTM_FN_N; // false northing, northern hemisphere
double UTM_FN_S; // false northing, southern hemisphere
double UTM_E2; // e^2
double UTM_E4; // e^4
double UTM_E6; // e^6
double UTM_EP2; // e'^2
private:
/// @brief This create function sets up the data membeers that hold the
/// ellipsoid and datum data
void create();
};
#endif
|
[
"s.grieve@ed.ac.uk"
] |
s.grieve@ed.ac.uk
|
2dfb3461000bb241c5362dff73b50441d32b6887
|
29a7775ddef9923ee6d1ad6afeb389fae8601348
|
/src/libzerocoin/Denominations.h
|
d3f36e316a071aaf39b60d38b4462f0c04194bd9
|
[
"MIT"
] |
permissive
|
arowwne/TesraSupernet
|
e1721016947d33cd84ecfe2b63b34142e54abdd8
|
79546fdb5026b008abcaccc00d6b5d9b3bd3f9ca
|
refs/heads/master
| 2020-05-26T06:48:00.625590
| 2019-05-21T10:50:18
| 2019-05-21T10:50:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,279
|
h
|
/**
* @file Denominations.h
*
* @brief Denomination info for the Zerocoin library.
*
* @copyright Copyright 2017 PIVX Developers
* @license This project is released under the MIT license.
**/
#ifndef DENOMINATIONS_H_
#define DENOMINATIONS_H_
#include <cstdint>
#include <string>
#include <vector>
namespace libzerocoin {
enum CoinDenomination {
ZQ_ERROR = 0,
ZQ_ONE = 1,
ZQ_FIVE = 5,
ZQ_TEN = 10,
ZQ_FIFTY = 50,
ZQ_ONE_HUNDRED = 100,
ZQ_FIVE_HUNDRED = 500,
ZQ_ONE_THOUSAND = 1000,
ZQ_FIVE_THOUSAND = 5000
};
const std::vector<CoinDenomination> zerocoinDenomList = {ZQ_ONE, ZQ_FIVE, ZQ_TEN, ZQ_FIFTY, ZQ_ONE_HUNDRED, ZQ_FIVE_HUNDRED, ZQ_ONE_THOUSAND, ZQ_FIVE_THOUSAND};
const std::vector<int> maxCoinsAtDenom = {4, 1, 4, 1, 4, 1, 4, 4};
int64_t ZerocoinDenominationToInt(const CoinDenomination& denomination);
int64_t ZerocoinDenominationToAmount(const CoinDenomination& denomination);
CoinDenomination IntToZerocoinDenomination(int64_t amount);
CoinDenomination AmountToZerocoinDenomination(int64_t amount);
CoinDenomination AmountToClosestDenomination(int64_t nAmount, int64_t& nRemaining);
CoinDenomination get_denomination(std::string denomAmount);
int64_t get_amount(std::string denomAmount);
}
#endif
|
[
"qiujie@qiujiedeMac-mini.local"
] |
qiujie@qiujiedeMac-mini.local
|
eac19e6234ac36ffe7c42d002099cc47fcef752f
|
e5e67e2a3a54c8e2f5de96d05a3c9e8350e970ce
|
/TAREA3-PUNTOS-Y-CARGAS/Tarea3-LP/Puntos.cpp
|
1887c06dd98bef8ac6a1978bdfe92a4dfab96a92
|
[] |
no_license
|
FJ98/CLionProjects-2019-1
|
32e94c5f5537ebf21684f5d864935d30b5728861
|
31b5ab8afc987d9b912fbcc75c5545678c7ea3a8
|
refs/heads/master
| 2020-06-22T03:11:39.128173
| 2019-07-18T16:30:09
| 2019-07-18T16:30:09
| 197,617,095
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 108
|
cpp
|
#include "Puntos.h"
Puntos::Puntos(int x, int y){PosX = x; PosY = y; Potencia = 0.0;}
Puntos::~Puntos() {}
|
[
"felix.solano@utec.edu.pe"
] |
felix.solano@utec.edu.pe
|
e1598da307c0f44ae1ded50cbabf22d5ecc341af
|
5c3f5a340eb7db751b025754888fb28763c2c46b
|
/src/protocol.h
|
f702dfdb452ca4ee80398652cec5ef4f30877cf1
|
[
"MIT"
] |
permissive
|
roscoin1/roscoin
|
6986dec82313217038fc61265b9c29919f8e8a25
|
d2d615e78934425a110b5800ff2b605110359fb7
|
refs/heads/master
| 2021-01-10T20:55:33.235364
| 2014-10-25T22:29:24
| 2014-10-25T22:29:24
| 25,748,960
| 0
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,383
|
h
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 19091 : 19090;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64_t nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64_t nServices;
// disk and network only
unsigned int nTime;
// memory only
int64_t nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
#endif // __INCLUDED_PROTOCOL_H__
|
[
"godivacoin@yahoo.com"
] |
godivacoin@yahoo.com
|
10758e9fd4ae117f4b3f4eecfb65fb1051652e81
|
eee64ef3b384930cc04de645316e8ffea01b1b72
|
/LeetCode/cpp/UniqueBST.cpp
|
89081a5ac2409aeabe5be06b68f6677135180b84
|
[] |
no_license
|
XingBin111/LeetCode
|
17a8b2d764900510989531198f71bfbfbb601803
|
6bceb5569e45ffc0d83f22467d25380bbc25aa77
|
refs/heads/master
| 2023-07-22T05:12:32.092963
| 2021-09-09T09:37:48
| 2021-09-09T09:37:48
| 266,281,037
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,397
|
cpp
|
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(NULL) {}
ListNode(int x) : val(x), next(NULL) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(NULL), right(NULL) {}
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
class Solution {
public:
vector<TreeNode*> generate(int start, int end)
{
vector<TreeNode*> res;
for(int val=start; val<=end; val++)
{
vector<TreeNode*> left = generate(start, val-1);
vector<TreeNode*> right = generate(val+1, end);
for(int i=0; i<left.size(); i++)
{
for(int j=0; j<right.size(); j++)
{
TreeNode* node = new TreeNode(val, left[i], right[j]);
res.push_back(node);
}
}
}
if(res.size() == 0)
res.push_back(nullptr);
return res;
}
vector<TreeNode*> generateTrees(int n)
{
vector<TreeNode*> res;
if(n == 0)
return res;
return generate(1, n);
}
};
|
[
"xingb001@cmft.com"
] |
xingb001@cmft.com
|
819b153bb8b0b848b23e0d015116f106f319f40f
|
5ae7adc9719e3dfd22824c00d85fe39b2cb89cc1
|
/66. 加一.cpp
|
cfd1fdf04f919aa5e15b6e6c83e9d3034530e10f
|
[] |
no_license
|
xuyang21/Algorithm
|
4aeab02d52ce38f0a2334ad7dc1a84324d248422
|
cac6eafd91f5ea0cb254eb9e8752addb8bd1eea5
|
refs/heads/master
| 2022-12-10T05:38:13.538499
| 2020-08-16T16:46:13
| 2020-08-16T16:46:13
| 287,984,462
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 882
|
cpp
|
给定一个由整数组成的非空数组所表示的非负整数,在该数的基础上加一。
最高位数字存放在数组的首位, 数组中每个元素只存储单个数字。
你可以假设除了整数 0 之外,这个整数不会以零开头。
示例 1:
输入: [1,2,3]
输出: [1,2,4]
解释: 输入数组表示数字 123。
示例 2:
输入: [4,3,2,1]
输出: [4,3,2,2]
解释: 输入数组表示数字 4321。
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int size = digits.size();
for(int i = size-1; i >= 0; --i)
{
if(digits[i]!=9)
{
++digits[i];
return digits;
}
else
{
digits[i] = 0;
}
}
vector<int> res(size+1, 0);
res[0] = 1;
return res;
}
};
|
[
"xu.yang.ee@gmail.com"
] |
xu.yang.ee@gmail.com
|
d10c51bc3b4dea97ba159500dd457af267f7a72b
|
877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a
|
/app/src/main/cpp/dir7941/dir7942/dir8062/dir8063/dir12766/dir12767/dir20982/file20995.cpp
|
0f64d18caa1bb2e340f2915da7791f05e8cd151e
|
[] |
no_license
|
tgeng/HugeProject
|
829c3bdfb7cbaf57727c41263212d4a67e3eb93d
|
4488d3b765e8827636ce5e878baacdf388710ef2
|
refs/heads/master
| 2022-08-21T16:58:54.161627
| 2020-05-28T01:54:03
| 2020-05-28T01:54:03
| 267,468,475
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 115
|
cpp
|
#ifndef file20995
#error "macro file20995 must be defined"
#endif
static const char* file20995String = "file20995";
|
[
"tgeng@google.com"
] |
tgeng@google.com
|
1c66e14ef26198d8db647612a175f586f5ebae65
|
0e2099167118c27fffed55610f64fdfd04ea685a
|
/Análisis Numérico para Ingeniería/Proyectos/Proyecto1/Polynomial/main.cpp
|
3ac8b93bc37137487205a1d202efbf6064b7a66c
|
[
"MIT"
] |
permissive
|
Arturok/TEC
|
4c1c58094b9ee66a2877999d3265f6fabed14389
|
9abe113afb98d1c6ea22c73d979ade928596072c
|
refs/heads/master
| 2023-01-13T16:28:46.346317
| 2019-06-26T20:52:25
| 2019-06-26T20:52:25
| 193,999,541
| 0
| 0
|
MIT
| 2023-01-05T03:14:49
| 2019-06-27T01:12:16
|
HTML
|
UTF-8
|
C++
| false
| false
| 11,609
|
cpp
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: jeremy
*
* Created on 12 de marzo de 2018, 05:47 PM
*/
#include <cstdlib>
#include "RootMuller.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <iomanip>
#include <complex>
#include <typeinfo>
#include <boost/math/tools/polynomial.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
#include <boost/lexical_cast.hpp>
#include "string.h"
#define deflation 1
#define deflation2 2
#define muller 3
#define laguerre 4
#define debug
void mainAux(std::vector<double>& poly, std::vector<double> positions,
short order, unsigned short method, double tolerance, int maxIt,
double root, bool polish, bool singlePrecision) {
if (poly.size() == 0 && method != 0) {
std::cout << "Para usar un metodo debe proporcionar un polinomio usando la opcion '--polynomial coef1 coef2 coef3'" << std::endl;
return;
}
switch(method) {
case deflation: {
if (singlePrecision) {
//Deflation single(float)
}
else {
//Deflation double
}
break;
}
case deflation2: {
if (singlePrecision) {
//Deflation2 single(float)
}
else {
//Deflation2 double
}
break;
}
case muller: {
if (singlePrecision) {
std::vector<std::complex<float> > polyFloat;
for (int iter = poly.size()-1; iter >= 0; iter--) {
std::complex<float> temp = *(new std::complex<float>(poly[iter],0));
polyFloat.push_back(temp);
}
std::vector<std::complex<float> > result;
result = anpi::rootMuller<float>((float)positions[0],
(float)positions[1],
(float)positions[2],
polyFloat,
(unsigned int)maxIt,
(float)tolerance);
std::cout << "Raices de Muller para presicion simple: " << std::endl;
for (int i = 0; i < result.size(); i++){
std::cout<< "x" << i <<": " << result[i] << std::endl;
}
}
else {
std::vector<std::complex<double> > polyDouble;
for (int iter = poly.size()-1; iter >= 0 ; iter--) {
std::complex<double> temp = *(new std::complex<double>(poly[iter],0));
polyDouble.push_back(temp);
}
std::vector<std::complex<double> > result;
result = anpi::rootMuller<double>((double)positions[0],
(double)positions[1],
(double)positions[2],
polyDouble,
(unsigned int)maxIt,
(double)tolerance);
std::cout << "Raices de Muller para presicion doble: " << std::endl;
for (int i = 0; i < result.size(); i++){
std::cout<< "x" << i <<": " << result[i] << std::endl;
}
}
break;
}
case laguerre: {
if (singlePrecision) {
//Laguerre single(float)
}
else {
//Laguerre double
}
break;
}
default: {
//Deflation
//Deflation2
//Default Muller Method
std::cout << "Metodo de Muller para x^3+2x^2+9x+18=0" << std::endl;
std::complex<double> tmp= *(new std::complex<double>(12,0));
std::vector<std::complex<double> >coefs;
tmp = 18;
coefs.push_back(tmp);
tmp = 9;
coefs.push_back(tmp);
tmp = 2;
coefs.push_back(tmp);
tmp = 1;
coefs.push_back(tmp);
std::vector<std::complex<double> > result;
result = anpi::rootMuller<double>((double)-3,
(double)-1,
(double)0,
coefs,
(unsigned int)50,
(long double)0.000001);
for (int i = 0; i < result.size(); i++){
std::cout<< "x" << i <<": " << result[i] << std::endl;
}
//Laguerre
}
}
}
int main(int argc, char** argv) {
using boost::lexical_cast;
using boost::bad_lexical_cast;
std::vector<double> poly;
std::vector<double> positions;
short order = 3;
unsigned short method = 0;
double tolerance = 0.000001;
int maxIt=50;
double root;
bool polish=0;
bool singlePrecision=0;
//User Interface (Options)
boost::program_options::options_description options("Project 1 Options");
options.add_options()
("help", "Muestra la ayuda del progrma")
("polynomial", boost::program_options::value<std::vector<double> >(&poly)->multitoken(), "Polinomio que se va a usar, utilizar '--polynomial coef1 coef2 ... coefn'")
("positions", boost::program_options::value<std::vector<double> >(&positions)->multitoken(), "Posiciones que encierran las primeras 2 raices, utilizar '--positions pos1 pos2 pos3'")
("root", boost::program_options::value<double>(&root), "Raiz utilizada para deflacionar, utilizar '--root rootValue'")
("order", boost::program_options::value<short>(&order), "Orden del polinomio, utilizar '--order orderValue'")
("tolerance", boost::program_options::value<double>(&tolerance), "Tolerancia del error, utilizar '--tolerance tolValue'")
("maxIterations", boost::program_options::value<int>(&maxIt), "Cantidad maxima de iteraciones que se quieren realizar")
("singlePrecision", boost::program_options::value<bool>(&singlePrecision), "Presicion usada para los metodos, utilizar '--singlePrecision boolValue' 1:single, 0:double(default)")
("deflation", "Usar el metodo de Deflacion para numeros reales, utilizar '--deflation'")
("deflation2", "Usar el metodo de Deflacion para numeros complejos, utilizar '--deflation2'")
("muller", "Usar el metodo de Muller, utilizar '--muller'")
("laguerre", "Usar el metodo de Laguerre, utilizar '--laguerre'")
("polish", "Pule las raices, utilizar '--polish boolValue'");
boost::program_options::positional_options_description pod;
pod.add("file", -1);
boost::program_options::variables_map vMap;
try {
boost::program_options::store(boost::program_options::parse_command_line(argc, argv, options, boost::program_options::command_line_style::unix_style ^ boost::program_options::command_line_style::allow_short), vMap);
boost::program_options::notify(vMap);
if (vMap.count("help")) {
std::cout << options << std::endl;
return 0;
}
if (vMap.count("polynomial")) {
#ifdef debug
std::cout << "Coeficientes del polinomio cambiados a: " << std::endl;
for(std::vector<double>::iterator it = poly.begin(); it != poly.end(); ++it) {
std::cout << ' ' << *it;
}
std::cout << '\n';
#endif
if (poly.size()<=0) {
std::cout << "Poly size: " << poly.size() << std::endl;
std::cout << "Deben de asignarse mas de 0 coeficientes al polinomio" << std::endl;
return -1;
}
}
if (vMap.count("positions")) {
#ifdef debug
std::cout << "Posiciones cambiadas a: ";
for(std::vector<double>::iterator it = positions.begin(); it != positions.end(); ++it) {
std::cout << ' ' << *it;
}
std:: cout << '\n';
#endif
if (positions.size() <= 0) {
std::cout << "Pos size: " << positions.size() << std::endl;
std::cout << "Deben de asignarse mas de 0 posiciones" << std::endl;
return -1;
}
}
if (vMap.count("root")) {
#ifdef debug
std::cout << "Raiz cambiada a: "<< root << std::endl;
#endif
}
if (vMap.count("order")) {
#ifdef debug
std::cout << "Orden cambiado a: " << order << std::endl;
#endif
if (order < 0) {
std::cout << "El orden debe ser un numero positivo" << std::endl;
return -1;
}
}
if (vMap.count("tolerance")) {
#ifdef debug
std::cout << "Tolerancia cambiada a: "<< tolerance << std::endl;
#endif
if (tolerance < 0) {
std::cout << "La tolerancia debe ser un numero positivo" << std::endl;
return -1;
}
}
if (vMap.count("maxIterations")) {
#ifdef debug
std::cout << "Cantidad maxima de iteraciones cambiada a: " << maxIt << std::endl;
#endif
if (tolerance < 0) {
std::cout << "La cantidad maxima de iteraciones debe ser un numero positivo" << std::endl;
return -1;
}
}
if (vMap.count("singlePrecision")) {
#ifdef debug
string precision = singlePrecision == 1 ? "Single" : "Float";
std::cout << "Precision cambiada a: " << precision << std::endl;
#endif
}
if (vMap.count("deflation")) {
#ifdef debug
std::cout << "Usando metodo de Deflacion para reales" << std::endl;
#endif
method = deflation;
}
if (vMap.count("deflation2")) {
#ifdef debug
std::cout << "Usando metodo de Deflacion para complejos" << std::endl;
#endif
method = deflation2;
}
if (vMap.count("muller")) {
#ifdef debug
std::cout << "Usando metodo de Muller" << std::endl;
#endif
method = muller;
}
if (vMap.count("laguerre")) {
#ifdef debug
std::cout << "Usando metodo de Laguerre" << std::endl;
#endif
method = laguerre;
}
mainAux(poly, positions, order, method, tolerance, maxIt, root, polish, singlePrecision);
}
catch (const boost::program_options::error &exception) {
std::cerr << exception.what() << '\n';
}
}
|
[
"mchinchilla11@gmail.com"
] |
mchinchilla11@gmail.com
|
981fcbce98ffab9e87bde7f635f7e400e63c813d
|
4330a9c40198f1b97bb0b88ece427cdd1016b8c2
|
/Day05/ex04/ShrubberyCreationForm.cpp
|
57f8a2020c1d43081e9f6076674f5dd87758a919
|
[] |
no_license
|
ggavryly/Pool_CPP
|
b4065271607a704a51d7b61ed597239af1e376e0
|
477f6470ee4a0c5405e2214742b6efb419910c0d
|
refs/heads/master
| 2020-09-23T07:53:46.597164
| 2020-02-02T18:32:58
| 2020-02-02T18:32:58
| 225,445,577
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,853
|
cpp
|
//
// Created by Gennady GAVRYLYSHYN on 2019-10-08.
//
#include <iostream>
#include "ShrubberyCreationForm.hpp"
#include <fstream>
ShrubberyCreationForm::ShrubberyCreationForm(const std::string &name)
: Form("ShrubberyCreationForm", 145, 137)
{
this->_target = name;
}
ShrubberyCreationForm::~ShrubberyCreationForm() {
}
ShrubberyCreationForm::ShrubberyCreationForm(const ShrubberyCreationForm &a) : Form::Form(a)
{
this->_target = a.getTarget();
}
void ShrubberyCreationForm::execute(Bureaucrat const &a) const
{
if (this->getGradeToExecute() < a.getGrade())
throw Bureaucrat::GradeTooLowException();
if (!this->isSign())
throw Form::NotSigned();
std::string outfile_name("<");
outfile_name += this->getTarget();
outfile_name += ">_shrubbery";
std::ofstream outfile;
outfile.open(outfile_name, std::ofstream::out | std::ofstream::app);
outfile << " .\n"
" . ; \n"
" . . ;% ;; \n"
" , , :;% %; \n"
" : ; :;%;' ., \n"
" ,. %; %; ; %;' ,;\n"
" ; ;%; %%; , %; ;%; ,%'\n"
" %; %;%; , ; %; ;%; ,%;' \n"
" ;%; %; ;%; % ;%; ,%;'\n"
" `%;. ;%; %;' `;%%;.%;'\n"
" `:;%. ;%%. %@; %; ;@%;%'\n"
" `:%;. :;bd%; %;@%;'\n"
" `@%:. :;%. ;@@%;' \n"
" `@%. `;@%. ;@@%; \n"
" `@%%. `@%% ;@@%; \n"
" ;@%. :@%% %@@%; \n"
" %@bd%%%bd%%:; \n"
" #@%%%%%:;;\n"
" %@@%%%::;\n"
" %@@@%(o); . ' \n"
" %@@@o%;:(.,' \n"
" `.. %@@@o%::; \n"
" `)@@@o%::; \n"
" %@@(o)::; \n"
" .%@@@@%::; \n"
" ;%@@@@%::;. \n"
" ;%@@@@%%:;;;. \n"
" ...;%@@@@@%%:;;;;,.." << std::endl;
outfile.close();
}
const std::string &ShrubberyCreationForm::getTarget() const {
return _target;
}
void ShrubberyCreationForm::setTarget(const std::string &target) {
_target = target;
}
|
[
"torgo121@gmail.com"
] |
torgo121@gmail.com
|
0235942a42b5a07d34993219fa748f2781f13a02
|
3d76c52ee5d95ad41605945b7ee9bc2659971112
|
/LAB2/Unit1.cpp
|
fdf03afe67eac5ba3649af14f7db505221f0325e
|
[] |
no_license
|
Artyom-Gerchik/cPlusPlusLabsSecondTerm
|
ecef62d0db90de627a435112b777740e1a0fca31
|
93ca20bf6244890e8e68a5e0d373866796d87ea7
|
refs/heads/master
| 2023-04-22T00:16:38.765430
| 2021-05-17T16:54:01
| 2021-05-17T16:54:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,243
|
cpp
|
// ---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Disk.h"
#include "DisksContainer.h"
#include <array>
// ---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
using namespace std;
TForm1 *Form1;
DisksContainer* dContainer = new DisksContainer;
// ---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender) {
if (FileSaveDialog1->Execute()) {
dContainer->saveToFile(FileSaveDialog1->FileName);
}
else {
}
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject * Sender) {
if (FileOpenDialog1->Execute()) {
dContainer->readFromFile(FileOpenDialog1->FileName);
UpdateUI();
}
else {
}
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender) {
int selectedIndex = StrToInt(Edit1->Text);
if (selectedIndex == 0 || selectedIndex > dContainer->Count()) {
ShowMessage("Enter Proper Index.");
}
else {
TForm2 *Form = new TForm2(this, dContainer, selectedIndex - 1);
Form->ShowModal();
}
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender) {
TForm2 *Form = new TForm2(this, dContainer, -1);
Form->ShowModal();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender) {
int indexForDelete = StrToInt(Edit1->Text);
if (indexForDelete == 0 || indexForDelete > dContainer->Count()) {
ShowMessage("Enter Proper Index.");
}
else {
dContainer->deleteDisk(indexForDelete - 1);
UpdateUI();
}
}
// ---------------------------------------------------------------------------
void TForm1::UpdateUI() {
TStringList *temp = dContainer->memoPresentation();
Memo1->Lines = temp;
temp->Free();
Label1->Caption = dContainer->Count();
Edit1->Text = "";
TStringList *cbSource = dContainer->comboBoxAuthors();
ComboBox1->Items = cbSource;
cbSource->Free();
TStringList *cbSourceSecond = dContainer->comboBoxTypes();
ComboBox2->Items = cbSourceSecond;
cbSourceSecond->Free();
}
void __fastcall TForm1::Button6Click(TObject *Sender) {
dContainer->sortAll();
UpdateUI();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button7Click(TObject *Sender) {
dContainer->sortAll2();
UpdateUI();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button8Click(TObject *Sender) {
ComboBox1->Text = "";
ComboBox2->Text = "";
TStringList *tmp = dContainer->searchByAuthor(SearchField->Text);
Memo2->Lines = tmp;
tmp->Free();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::Button9Click(TObject *Sender) {
ComboBox1->Text = "";
ComboBox2->Text = "";
TStringList *tmp = dContainer->searchByName(SearchField->Text);
Memo2->Lines = tmp;
tmp->Free();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::onSelect(TObject *Sender) {
ComboBox2->Text = "";
SearchField->Text = "";
UnicodeString authorName = ComboBox1->Text;
TStringList *tmp = dContainer->searchByAuthor(authorName);
Memo2->Lines = tmp;
tmp->Free();
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::onSelectSecond(TObject *Sender) {
ComboBox1->Text = "";
SearchField->Text = "";
UnicodeString typeOfDisk = ComboBox2->Text;
TStringList *tmp = dContainer->searchByType(typeOfDisk);
Memo2->Lines = tmp;
tmp->Free();
}
// ---------------------------------------------------------------------------
|
[
""
] | |
6e35ef8d34eefa7b2cdb30f2314c8bf90b0c120a
|
5486ab44beb88be5ef6d62bf577dd351a5b7a3ab
|
/prog2/src/prog2.cpp
|
0c480ff16e66f606dc1cb9e9281ebeed1f5bb443
|
[] |
no_license
|
lalfiler/CS570
|
a05ce0f42efd378cb123f32831ea8006889dfb63
|
41fe55ba0ab27cb7ba88ff9afc538755d704ed42
|
refs/heads/master
| 2020-03-22T16:55:22.468743
| 2018-07-10T01:09:05
| 2018-07-10T01:09:05
| 140,359,001
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 82
|
cpp
|
#include "prog2.h"
prog2::prog2()
{
//ctor
}
prog2::~prog2()
{
//dtor
}
|
[
"lalfiler4@gmail.com"
] |
lalfiler4@gmail.com
|
e0cad0cd1af3de58390fc8da1785f208a20b789d
|
ee89f2c304fb1acf760bb4122b1ece8cd92806b7
|
/texture0.cpp
|
67c1bdb73e46f861c40bc187ee67b22cc4ef6547
|
[
"MIT"
] |
permissive
|
djhunter/graphics-texture0
|
c28c60482acc859cf279a3cdb3a6197d394ff2c9
|
38e98f8330a64ca56a12410e44080c478824c959
|
refs/heads/master
| 2021-06-25T02:33:54.740996
| 2017-09-07T22:11:09
| 2017-09-07T22:11:09
| 93,765,356
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 9,028
|
cpp
|
/*===================================================
// Skeleton Project for CS-150: 3D Computer Graphics
// Uses textures.
//===================================================*/
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <array>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h> // for reading image files
using namespace std;
using namespace glm;
struct Vertex {
vec3 position;
vec2 tex_coords;
};
const array<Vertex, 24> cube =
{{
// top (if +z is up, +y is right, +x is forward)
{vec3(1.0f, 1.0f, 1.0f), vec2(1.0f, 0.0f)},
{vec3(-1.0f, 1.0f, 1.0f), vec2(0.0f, 0.0f)},
{vec3(-1.0f, -1.0f, 1.0f), vec2(0.0f, 1.0f)},
{vec3(1.0f, -1.0f, 1.0f), vec2(1.0f, 1.0f)},
// bottom
{vec3(1.0f, 1.0f, -1.0f), vec2(1.0f, 0.0f)},
{vec3(1.0f, -1.0f, -1.0f), vec2(0.0f, 0.0f)},
{vec3(-1.0f, -1.0f, -1.0f), vec2(0.0f, 1.0f)},
{vec3(-1.0f, 1.0f, -1.0f), vec2(1.0f, 1.0f)},
// right
{vec3(1.0f, 1.0f, 1.0f), vec2(1.0f, 0.0f)},
{vec3(1.0f, 1.0f, -1.0f), vec2(0.0f, 0.0f)},
{vec3(-1.0f, 1.0f, -1.0f), vec2(0.0f, 1.0f)},
{vec3(-1.0f, 1.0f, 1.0f), vec2(1.0f, 1.0f)},
// left
{vec3(1.0f, -1.0f, 1.0f), vec2(1.0f, 0.0f)},
{vec3(-1.0f, -1.0f, 1.0f), vec2(0.0f, 0.0f)},
{vec3(-1.0f, -1.0f, -1.0f), vec2(0.0f, 1.0f)},
{vec3(1.0f, -1.0f, -1.0f), vec2(1.0f, 1.0f)},
// front
{vec3(1.0f, 1.0f, 1.0f), vec2(1.0f, 0.0f)},
{vec3(1.0f, -1.0f, 1.0f), vec2(0.0f, 0.0f)},
{vec3(1.0f, -1.0f, -1.0f), vec2(0.0f, 1.0f)},
{vec3(1.0f, 1.0f, -1.0f), vec2(1.0f, 1.0f)},
// back
{vec3(-1.0f, 1.0f, 1.0f), vec2(1.0f, 0.0f)},
{vec3(-1.0f, 1.0f, -1.0f), vec2(0.0f, 0.0f)},
{vec3(-1.0f, -1.0f, -1.0f), vec2(0.0f, 1.0f)},
{vec3(-1.0f, -1.0f, 1.0f), vec2(1.0f, 1.0f)}
}};
const array<GLuint, 36> cube_idx = { 0, 1, 2, 0, 2, 3,
4, 5, 6, 4, 6, 7,
8, 9,10, 8,10,11,
12,13,14,12,14,15,
16,17,18,16,18,19,
20,21,22,20,22,23 };
const GLchar* vertexShaderSource = R"glsl(
#version 330
uniform mat4 MVP;
in vec3 vPos;
in vec2 tc;
out vec2 texCoord;
void main()
{
gl_Position = MVP * vec4(vPos, 1.0);
texCoord = tc;
}
)glsl";
const GLchar* fragmentShaderSource = R"glsl(
#version 330
uniform vec3 uColor;
in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D tex0;
void main()
{
fragColor = texture(tex0, texCoord) * vec4(uColor, 1.0);
}
)glsl";
static void errorCallback(int error, const char* description)
{
cerr << "GLFW Error: " << description << endl;
}
static void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
void compileShader(GLuint shader, const char *shaderText)
{
glShaderSource(shader, 1, &shaderText, NULL);
glCompileShader(shader);
GLchar infoLog[8192];
GLint success = 0;
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
if (!success)
{
glGetShaderInfoLog(shader, 8192, NULL, infoLog);
cerr << "Shader failed to complile." << endl
<< "Error log: " << infoLog << endl;
}
}
int main(void)
{
GLFWwindow* window;
glfwSetErrorCallback(errorCallback);
if (!glfwInit())
exit(EXIT_FAILURE);
// Request OpenGL version 3.3.
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Don't use old OpenGL
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); // OSX needs this
window = glfwCreateWindow(640, 480, "CS 150 Template Project: Textures", NULL, NULL);
if (!window)
{
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwSetKeyCallback(window, keyCallback);
glfwMakeContextCurrent(window);
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
cout << "GL version: " << glGetString(GL_VERSION) << endl
<< "GL vendor: " << glGetString(GL_VENDOR) << endl
<< "GL renderer: " << glGetString(GL_RENDERER) << endl
<< "GL shading language version: "
<< glGetString(GL_SHADING_LANGUAGE_VERSION) << endl;
glfwSwapInterval(1); // Framerate matches monitor refresh rate
// Compile shaders and check for errors
GLuint vertexShader, fragmentShader, program;
vertexShader = glCreateShader(GL_VERTEX_SHADER);
fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
compileShader(vertexShader, vertexShaderSource);
compileShader(fragmentShader, fragmentShaderSource);
program = glCreateProgram();
glAttachShader(program, vertexShader);
glAttachShader(program, fragmentShader);
glBindFragDataLocation(program, 0, "fragColor");
glLinkProgram(program);
GLint success = 0;
glGetProgramiv(program, GL_LINK_STATUS, &success);
if (!success)
{
cerr << "ERROR: Shader linking failed." << endl;
glDeleteProgram(program);
program = 0u;
}
glDeleteShader(vertexShader);
glDeleteShader(fragmentShader);
glUseProgram(program);
GLint l_MVP = glGetUniformLocation(program, "MVP");
GLint l_vPos = glGetAttribLocation(program, "vPos");
GLint l_tc = glGetAttribLocation(program, "tc");
GLint l_uColor = glGetUniformLocation(program, "uColor");
GLuint VAO, VBO, EBO; // vertex array and vertex and index buffer objects
glGenVertexArrays(1, &VAO);
glGenBuffers(1, &VBO);
glGenBuffers(1, &EBO);
glBindVertexArray(VAO); // only one VAO; leave it bound for whole program
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, cube.size()*sizeof(Vertex), cube.data(), GL_STATIC_DRAW);
glEnableVertexAttribArray(l_vPos);
glVertexAttribPointer(l_vPos, 3, GL_FLOAT, GL_FALSE,
sizeof(Vertex), // stride
reinterpret_cast<const GLvoid*>(0) ); // offset
glEnableVertexAttribArray(l_tc);
glVertexAttribPointer(l_tc, 2, GL_FLOAT, GL_FALSE,
sizeof(Vertex),
reinterpret_cast<const GLvoid*>(3*sizeof(float)));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, cube_idx.size()*sizeof(GLuint),
cube_idx.data(), GL_STATIC_DRAW);
// Load textures
int tWidth, tHeight, tComps;
GLuint dipTexture;
glGenTextures(1, &dipTexture); // generate texture names
glActiveTexture(GL_TEXTURE0); // texture unit for tex0
glUniform1i(glGetUniformLocation(program, "tex0"), 0);
glBindTexture(GL_TEXTURE_2D, dipTexture); // bind dipTexture to active texture
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// read the image file
unsigned char *tData = stbi_load("dip.jpg", &tWidth, &tHeight, &tComps, 0);
if (tData == NULL) {
cerr << "Problem reading file " << "dip.jpg" << "." << endl;
}
else {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tWidth, tHeight, 0, GL_RGB,
GL_UNSIGNED_BYTE, tData); // send image to shaders
glGenerateMipmap(GL_TEXTURE_2D);
}
stbi_image_free(tData);
glEnable(GL_DEPTH_TEST);
mat4 M, V, P, MVP;
vec3 eye = vec3(0.0f, 5.0f, 15.0f);
vec3 center = vec3(0.0f, 0.0f, 0.0f);
vec3 up = vec3(0.0f, 1.0f, 0.0f);
V = lookAt(eye, center, up);
vec3 cubeColor = vec3(1.0f, 1.0f, 1.0f);
glUniform3fv(l_uColor, 1, value_ptr(cubeColor));
while (!glfwWindowShouldClose(window))
{
float ratio;
int width, height;
glfwGetFramebufferSize(window, &width, &height);
glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, dipTexture); // select texture to use
ratio = static_cast<float>(width) / static_cast<float>(height);
P = perspective(0.60f, ratio, 1.0f, 100.0f);
M = rotate(mat4(1.0f), static_cast<float>(glfwGetTime()),
vec3(0.0f, 0.0f, 1.0f));
MVP = P * V * M;
glUniformMatrix4fv(l_MVP, 1, GL_FALSE, value_ptr(MVP));
glDrawElements(GL_TRIANGLES, cube_idx.size(), GL_UNSIGNED_INT, 0);
// check for OpenGL errors
GLenum error_code;
while ((error_code = glGetError()) != GL_NO_ERROR)
cerr << "OpenGL error HEX: " << hex << error_code << endl;
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
exit(EXIT_SUCCESS);
}
|
[
"dhunter@westmont.edu"
] |
dhunter@westmont.edu
|
066d7ed9216123d323f4b08af989feae864cdcb2
|
05e30e1f7b05ed8ec65fb7e09c792210144665cb
|
/HW/prog3_holmes.cpp
|
b8c8e5291fc5a9436cbbc13c28507e484192fb29
|
[] |
no_license
|
ColbyHolmes/Old-Classwork
|
91a2c27d6195890196252843fc07abb738b2eaa5
|
c795b3fbf9df10ae6674a3d558f27032a7f7e89e
|
refs/heads/master
| 2021-01-25T06:25:15.380712
| 2017-06-06T22:55:45
| 2017-06-06T22:55:45
| 93,571,065
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 22,381
|
cpp
|
/*Colby Holmes
Program 3
Implementation of AVL tree
Due 11/2*/
#include <iostream>
using namespace std;
/*NOTE: Functions are grossly written and all over the place as far as syntax goes...
I apologize for this. It's a result of trying to pack all of the code in one
properly named file, and working over multiple nights.*/
//ALSO node depth is shown in the find function. Tree depth is called in the menu
class Tree{
public:
int n;
char c;
float f;
Tree* left;
Tree* right;
//functions
Tree()
{
left = NULL;
right = NULL;
}
Tree(int n);//construct integer tree
Tree(char c);//construct character tree
Tree(float f);//construct floating pt tree
int height(Tree* node);
Tree* insert(Tree*& node, int d_IN);//overloaded functions for types
Tree* insert(Tree*& node, char d_IN);
Tree* insert(Tree*& node, float d_IN);
Tree* deleteNodeI(Tree* root, int key);
Tree* deleteNodeC(Tree* root, char key);
Tree* deleteNodeF(Tree* root, float key);
void find(Tree* root, int num, int depth, string out);
void find(Tree* root, char lett, int depth, string out);
void find(Tree* root, float dec, int depth, string out);
void rotateLeftOnce(Tree*& node);
void rotateLeftTwice(Tree*& node);
void rotateRightOnce(Tree*& node);
void rotateRightTwice(Tree*& node);
};
Tree *INT, *CHAR, *FLO;//GLOBALS
bool iTree = false;
bool cTree = false;
bool fTree = false;//checks for if tree exists already
//*****************************find height of node
int Tree::height(Tree* node){
int left, right;
if(node==NULL)
return 0;
left = height(node->left);
right = height(node->right);
if(left > right)
return left+1;
else
return right+1;
}
// Get Balance factor of node N
int getBalance(Tree *N)
{
if (N == NULL)
return 0;
return (N->left)->height(N->left) - (N->right)->height(N->right);
}
//**********************************ROTATE FUNCTIONS
void Tree::rotateLeftOnce(Tree*& node){
Tree *otherNode;
otherNode = node->left;
node->left = otherNode->right;
otherNode->right = node;
node = otherNode;
}
void Tree::rotateLeftTwice(Tree*& node){
rotateRightOnce(node->left);
rotateLeftOnce(node);
}
void Tree::rotateRightOnce(Tree*& node){
Tree *otherNode;
otherNode = node->right;
node->right = otherNode->left;
otherNode->left = node;
node = otherNode;
}
void Tree::rotateRightTwice(Tree*& node){
rotateLeftOnce(node->right);
rotateRightOnce(node);
}
//*****************************INSERT INT
Tree* Tree::insert(Tree*& node, int d_IN){
if(node == NULL){ // (1) If we are at the end of the tree place the value
node = new Tree();
node->n = d_IN;
}
else if(d_IN < node->n){ //(2) otherwise go left if smaller
insert(node->left, d_IN);
if(height(node->left) - height(node->right) == 2){
if(d_IN < node->left->n)
rotateLeftOnce(node);
else
rotateLeftTwice(node);
}
}
else if(d_IN > node->n){ // (3) otherwise go right if bigger
insert(node->right, d_IN);
if(height(node->right) - height(node->left) == 2){
if(d_IN > node->right->n)
rotateRightOnce(node);
else
rotateRightTwice(node);
}
}
return node;
}
//******************************INSERT LETTER
Tree* Tree::insert(Tree*& node, char d_IN){
if(node == NULL){ // (1) If we are at the end of the tree place the value
node = new Tree();
node->c = d_IN;
}
else if(d_IN < node->c){ //(2) otherwise go left if smaller
insert(node->left, d_IN);
if(height(node->left) - height(node->right) == 2){
if(d_IN < node->left->c)
rotateLeftOnce(node);
else
rotateLeftTwice(node);
}
}
else if(d_IN > node->c){ // (3) otherwise go right if bigger
insert(node->right, d_IN);
if(height(node->right) - height(node->left) == 2){
if(d_IN > node->right->c)
rotateRightOnce(node);
else
rotateRightTwice(node);
}
}
return node;
}
//**********************************INSERT FLOAT
Tree* Tree::insert(Tree*& node, float d_IN){
if(node == NULL){ // (1) If we are at the end of the tree place the value
node = new Tree();
node->f = d_IN;
}
else if(d_IN < node->f){ //(2) otherwise go left if smaller
insert(node->left, d_IN);
if(height(node->left) - height(node->right) == 2){
if(d_IN < node->left->f)
rotateLeftOnce(node);
else
rotateLeftTwice(node);
}
}
else if(d_IN > node->f){ // (3) otherwise go right if bigger
insert(node->right, d_IN);
if(height(node->right) - height(node->left) == 2){
if(d_IN > node->right->f)
rotateRightOnce(node);
else
rotateRightTwice(node);
}
}
return node;
}
Tree* minValueNode(Tree* node)
{
Tree* current = node;
/* loop down to find the leftmost leaf */
while (current->left != NULL)
current = current->left;
return current;
}
//***********************************delete functions
Tree* Tree::deleteNodeI(Tree* root, int key)
{
// STEP 1: PERFORM STANDARD BST DELETE
if (root == NULL)
return root;
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( key < root->n )
root->left = deleteNodeI(root->left, key);
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( key > root->n )
root->right = deleteNodeI(root->right, key);
// if key is same as root's key, then This is the node
// to be deleted
else
{
// node with only one child or no child
if( (root->left == NULL) || (root->right == NULL) )
{
Tree *temp = root->left ? root->left : root->right;
// No child case
if(temp == NULL)
{
temp = root;
root = NULL;
}
else // One child case
*root = *temp; // Copy the contents of the non-empty child
}
else
{
// node with two children: Get the inorder successor (smallest
// in the right subtree)
Tree* temp = minValueNode(root->right);
// Copy the inorder successor's data to this node
root->n = temp->n;
// Delete the inorder successor
root->right = deleteNodeI(root->right, temp->n);
}
}
// If the tree had only one node then return
if (root == NULL)
return root;
// STEP 2: GET THE BALANCE FACTOR OF THIS NODE (to check whether
// this node became unbalanced)
int balance = getBalance(root);
// If this node becomes unbalanced, then there are 4 cases
// Left Left Case
if (balance > 1 && getBalance(root->left) >= 0)
root->rotateRightOnce(root);
// Left Right Case
if (balance > 1 && getBalance(root->left) < 0)
{
(root->left)->rotateLeftOnce(root->left);
root->rotateRightOnce(root);
}
// Right Right Case
if (balance < -1 && getBalance(root->right) <= 0)
root->rotateLeftOnce(root);
// Right Left Case
if (balance < -1 && getBalance(root->right) > 0)
{
(root->right)->rotateRightOnce(root->right);
root->rotateRightOnce(root);
}
return root;
}
Tree* Tree::deleteNodeC(Tree* root, char key)//del char****
{
// STEP 1: PERFORM STANDARD BST DELETE
if (root == NULL)
return root;
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( key < root->c )
root->left = deleteNodeI(root->left, key);
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( key > root->c )
root->right = deleteNodeI(root->right, key);
// if key is same as root's key, then This is the node
// to be deleted
else
{
// node with only one child or no child
if( (root->left == NULL) || (root->right == NULL) )
{
Tree *temp = root->left ? root->left : root->right;
// No child case
if(temp == NULL)
{
temp = root;
root = NULL;
}
else // One child case
*root = *temp; // Copy the contents of the non-empty child
}
else
{
// node with two children: Get the inorder successor (smallest
// in the right subtree)
Tree* temp = minValueNode(root->right);
// Copy the inorder successor's data to this node
root->n = temp->c;
// Delete the inorder successor
root->right = deleteNodeI(root->right, temp->c);
}
}
// If the tree had only one node then return
if (root == NULL)
return root;
// STEP 2: GET THE BALANCE FACTOR OF THIS NODE (to check whether
// this node became unbalanced)
int balance = getBalance(root);
// If this node becomes unbalanced, then there are 4 cases
// Left Left Case
if (balance > 1 && getBalance(root->left) >= 0)
root->rotateRightOnce(root);
// Left Right Case
if (balance > 1 && getBalance(root->left) < 0)
{
(root->left)->rotateLeftOnce(root->left);
root->rotateRightOnce(root);
}
// Right Right Case
if (balance < -1 && getBalance(root->right) <= 0)
root->rotateLeftOnce(root);
// Right Left Case
if (balance < -1 && getBalance(root->right) > 0)
{
(root->right)->rotateRightOnce(root->right);
root->rotateRightOnce(root);
}
return root;
}
Tree* Tree::deleteNodeF(Tree* root, float key)//del Float
{
// STEP 1: PERFORM STANDARD BST DELETE
if (root == NULL)
return root;
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( key < root->f )
root->left = deleteNodeI(root->left, key);
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( key > root->f )
root->right = deleteNodeI(root->right, key);
// if key is same as root's key, then This is the node
// to be deleted
else
{
// node with only one child or no child
if( (root->left == NULL) || (root->right == NULL) )
{
Tree *temp = root->left ? root->left : root->right;
// No child case
if(temp == NULL)
{
temp = root;
root = NULL;
}
else // One child case
*root = *temp; // Copy the contents of the non-empty child
}
else
{
// node with two children: Get the inorder successor (smallest
// in the right subtree)
Tree* temp = minValueNode(root->right);
// Copy the inorder successor's data to this node
root->n = temp->f;
// Delete the inorder successor
root->right = deleteNodeI(root->right, temp->f);
}
}
// If the tree had only one node then return
if (root == NULL)
return root;
// STEP 2: GET THE BALANCE FACTOR OF THIS NODE (to check whether
// this node became unbalanced)
int balance = getBalance(root);
// If this node becomes unbalanced, then there are 4 cases
// Left Left Case
if (balance > 1 && getBalance(root->left) >= 0)
root->rotateRightOnce(root);
// Left Right Case
if (balance > 1 && getBalance(root->left) < 0)
{
(root->left)->rotateLeftOnce(root->left);
root->rotateRightOnce(root);
}
// Right Right Case
if (balance < -1 && getBalance(root->right) <= 0)
root->rotateLeftOnce(root);
// Right Left Case
if (balance < -1 && getBalance(root->right) > 0)
{
(root->right)->rotateRightOnce(root->right);
root->rotateRightOnce(root);
}
return root;
}
//*****************************Find functions
void Tree::find(Tree* root, int num, int depth, string out)
{
if (root == NULL)
{
cout << num << " not found!\n\n";
return;
}
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( num < root->n )
{
out += "->leftchild";
(root->left)->find(root->left, num, depth + 1, out);
}
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( num > root->n )
{
out += "->rightchild";
(root->right)->find(root->right, num, depth + 1, out);
}
// if key is same as root's key
else
{
cout << "\nKey: " << num << "\nDepth: " << depth << "\nPath: " << out << "\n\n";
}
}
void Tree::find(Tree* root, char lett, int depth, string out)
{
if (root == NULL)
{
cout << lett << " not found!\n\n";
return;
}
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( lett < root->c )
{
out += "->leftchild";
(root->left)->find(root->left, lett, depth + 1, out);
}
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( lett > root->c )
{
out += "->rightchild";
(root->right)->find(root->right, lett, depth + 1, out);
}
// if key is same as root's key
else
{
cout << "\nKey: " << lett << "\nDepth: " << depth << "\nPath: " << out << "\n\n";
}
}
void Tree::find(Tree* root, float dec, int depth, string out)
{
if (root == NULL)
{
cout << dec << " not found!\n\n";
return;
}
// If the key to be deleted is smaller than the root's key,
// then it lies in left subtree
if ( dec < root->f )
{
out += "->leftchild";
(root->left)->find(root->left, dec, depth + 1, out);
}
// If the key to be deleted is greater than the root's key,
// then it lies in right subtree
else if( dec > root->f )
{
out += "->rightchild";
(root->right)->find(root->right, dec, depth + 1, out);
}
// if key is same as root's key
else
{
cout << "\nKey: " << dec << "\nDepth: " << depth << "\nPath: " << out << "\n\n";
}
}
/* Given a binary tree, print its nodes according to the
"bottom-up" postorder traversal. */
void printPostorderI(Tree* node)
{
if (node == NULL)
return;
// first recur on left subtree
printPostorderI(node->left);
// then recur on right subtree
printPostorderI(node->right);
// now deal with the node
cout << node->n << " ";
}
/* Given a binary tree, print its nodes according to the
"bottom-up" postorder traversal. */
void printPostorderC(Tree* node)
{
if (node == NULL)
return;
// first recur on left subtree
printPostorderC(node->left);
// then recur on right subtree
printPostorderC(node->right);
// now deal with the node
cout << node->c << " ";
}
/* Given a binary tree, print its nodes according to the
"bottom-up" postorder traversal. */
void printPostorderF(Tree* node)
{
if (node == NULL)
return;
// first recur on left subtree
printPostorderF(node->left);
// then recur on right subtree
printPostorderF(node->right);
// now deal with the node
cout << node->f << " ";
}
/* Given a binary tree, print its nodes in inorder*/
void printInorderI(Tree* node)
{
if (node == NULL)
return;
/* first recur on left child */
printInorderI(node->left);
/* then print the data of node */
cout << node->n << " ";
/* now recur on right child */
printInorderI(node->right);
}
/* Given a binary tree, print its nodes in inorder*/
void printInorderC(Tree* node)
{
if (node == NULL)
return;
/* first recur on left child */
printInorderC(node->left);
/* then print the data of node */
cout << node->c << " ";
/* now recur on right child */
printInorderC(node->right);
}
/* Given a binary tree, print its nodes in inorder*/
void printInorderF(Tree* node)
{
if (node == NULL)
return;
/* first recur on left child */
printInorderF(node->left);
/* then print the data of node */
cout << node->f << " ";
/* now recur on right child */
printInorderF(node->right);
}
/* Given a binary tree, print its nodes in preorder*/
void printPreorderI(Tree* node)
{
if (node == NULL)
return;
/* first print data of node */
cout << node->n << " ";
/* then recur on left sutree */
printPreorderI(node->left);
/* now recur on right subtree */
printPreorderI(node->right);
}
/* Given a binary tree, print its nodes in preorder*/
void printPreorderC(Tree* node)
{
if (node == NULL)
return;
/* first print data of node */
cout << node->c << " ";
/* then recur on left sutree */
printPreorderC(node->left);
/* now recur on right subtree */
printPreorderC(node->right);
}
/* Given a binary tree, print its nodes in preorder*/
void printPreorderF(Tree* node)
{
if (node == NULL)
return;
/* first print data of node */
cout << node->f << " ";
/* then recur on left sutree */
printPreorderF(node->left);
/* now recur on right subtree */
printPreorderF(node->right);
}
//**************************PRINT MENU
void printmenu(){
cout << "\n\tAVL Tree Program\n\n1. Insert element\n2. Delete element\n"
<< "3. Find element\n4. Print Tree\n5. Find Tree depth\nq. Quit\n\ncmd>";
}
//******************************MAIN FUNCTION
int main(){
char input = ' ';
while (input != 'q')
{
printmenu();
cin >> input;
if (input == '1')//insert
{
char type = ' ';
int num;
cout << "\nWhich tree are you populating:\n\ti. Integer\n\t"
<< "c. Character\n\tf. Float\n\ncmd>";
cin >> type;
cout << "\nHow many items would you like to insert in the tree\ncmd>";
cin >> num;
if (type == 'i') //insert integer
{
for (int i = 0; i < num; i++)
{
int set;
cout << i+1 << ". Enter integer to insert: ";
cin >> set;
if (!iTree) //if the tree hasn't been initialized
{
INT = new Tree();
INT->n = set;
INT->left = NULL;
INT->right = NULL;
iTree = true;
}
else
INT = INT->insert(INT, set);
}
}
else if (type == 'c') //insert character
{
for (int i = 0; i < num; i++)
{
char set;
cout << i+1 << ". Enter letter to insert: ";
cin >> set;
if (!cTree) //if the tree hasn't been initialized
{
CHAR = new Tree();
CHAR->c = set;
cTree = true;
}
else
CHAR = CHAR->insert(CHAR, set);
}
}
else if (type == 'f') //insert float
{
for (int i = 0; i < num; i++)
{
float set;
cout << i+1 << ". Enter float to insert: ";
cin >> set;
if (!fTree) //if the tree hasn't been initialized
{
FLO = new Tree();
FLO->f = set;
fTree = true;
}
else
FLO = FLO->insert(FLO, set);
}
}
else //unrecognized
cout << "\nINVALID TYPE\n\n";
}
else if (input == '2')//delete
{
char type = ' ';
cout << "\nWhich tree are you removing from:\n\ti. Integer\n\t"
<< "c. Character\n\tf. Float\n\ncmd>";
cin >> type;
if (type == 'i') //del integer
{
int set;
cout << "Enter integer to delete: ";
cin >> set;
INT = INT->deleteNodeI(INT, set);
}
else if (type == 'c') //del character
{
char set;
cout << "Enter letter to delete: ";
cin >> set;
CHAR = CHAR->deleteNodeC(CHAR, set);
}
else if (type == 'f') //del float
{
float set;
cout << "Enter float to delete: ";
cin >> set;
FLO = FLO->deleteNodeF(FLO, set);
}
else //unrecognized
cout << "\nINVALID TYPE\n\n";
}
else if (input == '3')//find
{
char type = ' ';
cout << "\nWhich tree are you searching:\n\ti. Integer\n\t"
<< "c. Character\n\tf. Float\n\ncmd>";
cin >> type;
switch(type){
case 'i':
int key;
cout << "Enter integer to find: ";
cin >> key;
INT->find(INT, key, 0, "root");
break;
case 'c':
char l;
cout << "Enter character to find: ";
cin >> l;
CHAR->find(CHAR, l, 0, "root");
break;
case 'f':
float fl;
cout << "Enter float to find: ";
cin >> fl;
FLO->find(FLO, fl, 0, "root");
break;
default:
cout << "\nINVALID TYPE\n\n";
}
}
else if (input == '4')//print
{
char type = ' ';
cout << "\nWhich tree are you printing:\n\ti. Integer\n\t"
<< "c. Character\n\tf. Float\n\ncmd>";
cin >> type;
switch(type){
case 'i':
cout << "\nPreorder:\n";
printPreorderI(INT);
cout << "\n\nInorder:\n";
printInorderI(INT);
cout << "\n\nPostorder:\n";
printPostorderI(INT);
break;
case 'c':
cout << "\nPreorder:\n";
printPreorderC(CHAR);
cout << "\n\nInorder:\n";
printInorderC(CHAR);
cout << "\n\nPostorder:\n";
printPostorderC(CHAR);
break;
case 'f':
cout << "\nPreorder:\n";
printPreorderF(FLO);
cout << "\n\nInorder:\n";
printInorderF(FLO);
cout << "\n\nPostorder:\n";
printPostorderF(FLO);
break;
default:
cout << "\nINVALID TYPE\n\n";
}
}
else if (input == '5')//depth
{
//**tree depth. node depth shown in the find function**
cout << "\nInteger Tree depth:\t" << INT->height(INT);
cout << "\nCharacter Tree depth:\t" << CHAR->height(CHAR);
cout << "\nFloat Tree depth:\t" << FLO->height(FLO) << "\n\n";
}
else if (input == 'q')//quit
{cout << "\nCLOSING PROGRAM\n\n";}
else
cout << "\nINVALID INPUT\n\n";
}//msg loop
return 0;
}
|
[
"holmeboy92@gmail.com"
] |
holmeboy92@gmail.com
|
b2d1880377424debfe48957edae655072cb1ce5b
|
3020ad6641093f00234414c1dc9346237b2a6a9a
|
/leetcode/merge_sorted_array_88.cpp
|
e659881745f4865698cecfa9cbf38549d1496dd2
|
[] |
no_license
|
Litchiware/alg-exercise
|
8706d38608b355cdc5ef3e1b44a211c79ab04214
|
5920f09ef22dbc4699854d3cf88eb08a65147d7b
|
refs/heads/master
| 2021-01-20T20:37:02.273588
| 2016-08-27T13:51:42
| 2016-08-27T13:51:42
| 64,053,664
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 643
|
cpp
|
#include <vector>
#include <algorithm>
#include <iostream>
#include "../utils.h"
using namespace std;
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int r1 = m - 1, r2 = n - 1, r = m + n - 1;
while(r1 >= 0 && r2 >= 0)
nums1[r--] = nums1[r1] > nums2[r2] ? nums1[r1--] : nums2[r2--];
while(r1 >= 0 && r2 >= 0)
nums1[r--] = nums1[r1] > nums2[r2] ? nums1[r1--] : nums2[r2--];
while(r2 >= 0)
nums1[r--] = nums2[r2--];
}
int main(){
vector<int> v1{-1, 0, 0, 3, 3, 3, 0, 0, 0};
vector<int> v2{1, 2, 2};
merge(v1, 6, v2, 3);
cout << vectorToString(v1) << endl;
cout << vectorToString(v2) << endl;
}
|
[
"1508490934@qq.com"
] |
1508490934@qq.com
|
c9a764fe9ca05b4bb9f30a31b87d160630cc4237
|
d9ef801a3c3601252a0b947c61c40586e21d58c4
|
/robot_control/src/drive_pivot.cpp
|
f5693d67d96e4ccb16557e3ca8744f4d21801b3e
|
[] |
no_license
|
cagrikilic/cataglyphis3-software
|
204abc0ffeb47e36b62ff8143b7720185bbc0c77
|
b9e06cc857456d6b7686c53dcc909bd9277dcb67
|
refs/heads/master
| 2021-06-27T08:58:59.800212
| 2017-04-05T17:21:29
| 2017-04-05T17:21:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 8,993
|
cpp
|
#include <robot_control/drive_pivot.h>
void DrivePivot::init()
{
leftDeltaVector_.clear();
rightDeltaVector_.clear();
initHeading_ = robotStatus.heading;
desiredDeltaHeading_ = params.float1;
if(deltaHeading_<0.0) pivotSign_ = -1;
else pivotSign_ = 1;
timeoutValue_ = (unsigned int)round((10.0 + fabs(desiredDeltaHeading_)/10.0)*robotStatus.loopRate);
timeoutCounter_ = 0;
rSpeedI_ = 0.0;
inThreshold_ = false;
thresholdTime_ = 0.0;
robotOutputs.stopFlag = false;
robotOutputs.turnFlag = true;
encPrev_[0] = robotStatus.flEncoder;
encPrev_[1] = robotStatus.mlEncoder;
encPrev_[2] = robotStatus.blEncoder;
encPrev_[3] = robotStatus.frEncoder;
encPrev_[4] = robotStatus.mrEncoder;
encPrev_[5] = robotStatus.brEncoder;
yawRatePrev_ = 0.0;
dogLegState = _monitoring;
dogLegDetectTimeStarted_ = false;
ROS_DEBUG("drivePivot init");
}
int DrivePivot::run()
{
//int temp;
ROS_INFO_THROTTLE(1,"drive pivot running");
//ROS_INFO("======================");
robotOutputs.stopFlag = false;
robotOutputs.turnFlag = true;
rMax_ = robotStatus.rMax;
deltaHeading_ = robotStatus.heading - initHeading_;
//ROS_INFO("desiredDeltaHeading = %f", desiredDeltaHeading_);
//ROS_INFO("deltaHeading_ = %f",deltaHeading_);
rDes_ = kpR_*(desiredDeltaHeading_-deltaHeading_);
//ROS_INFO("rDes before dogLeg = %f",rDes_);
dogLeg_();
//ROS_INFO("rDes_ after dogLeg = %f",rDes_);
if(rDes_>rMax_) rDes_ = rMax_;
else if(rDes_<(-rMax_)) rDes_ = -rMax_;
if(rDes_>0.0)
{
ccwBoostGain_ = cornerBoostGain_;
cwBoostGain_ = 1.0;
rightMiddleWheelMultiplier_ = reverseMiddleGain_;
leftMiddleWheelMultiplier_ = 1.0;
}
else
{
ccwBoostGain_ = 1.0;
cwBoostGain_ = cornerBoostGain_;
rightMiddleWheelMultiplier_ = 1.0;
leftMiddleWheelMultiplier_ = reverseMiddleGain_;
}
if(std::isnan(robotStatus.yawRate)) {ROS_ERROR("yaw rate is nan"); robotStatus.yawRate = yawRatePrev_;}
else yawRatePrev_ = robotStatus.yawRate;
//ROS_INFO("yawRate = %f",robotStatus.yawRate);
errorR_ = rDes_ - robotStatus.yawRate;
//ROS_INFO("errorR_ = %f",errorR_);
rSpeedP_ = kROutput_*rDes_;
//ROS_INFO("rSpeedP_ = %f",rSpeedP_);
rSpeedI_ += kiR_*errorR_;
//ROS_INFO("rSpeedI_ before coerc = %f",rSpeedI_);
if(rSpeedI_>rSpeedIMax_) rSpeedI_ = rSpeedIMax_;
else if(rSpeedI_<-rSpeedIMax_) rSpeedI_ = -rSpeedIMax_;
//ROS_INFO("rSpeedI_ before coerc = %f",rSpeedI_);
rSpeedT_ = round(rSpeedP_ + rSpeedI_);
//ROS_INFO("rSpeedT_ before coerc = %f",rSpeedT_);
if(rSpeedT_>rSpeedMax_) rSpeedT_ = rSpeedMax_;
else if(rSpeedT_<(-rSpeedMax_)) rSpeedT_ = -rSpeedMax_;
//ROS_INFO("rSpeedT after coerc = %f",rSpeedT_);
//ROS_INFO("rDes: %f",rDes_);
//ROS_INFO("deltaHeading = %f", deltaHeading_);
//ROS_INFO("desiredDeltaHeading_-deltaHeading_: %f", desiredDeltaHeading_-deltaHeading_);
leftSpeed_ = rSpeedT_;
rightSpeed_ = -rSpeedT_;
//ROS_INFO("leftSpeed_ = %f",leftSpeed_);
//ROS_INFO("rightSpeed_ = %f",rightSpeed_);
timeoutCounter_++;
if(fabs(desiredDeltaHeading_-deltaHeading_)<=deltaHeadingThreshold_ && inThreshold_==false) {thresholdInitTime_ = ros::Time::now().toSec(); inThreshold_ = true;}
if(fabs(desiredDeltaHeading_-deltaHeading_)<=deltaHeadingThreshold_) thresholdTime_ = ros::Time::now().toSec() - thresholdInitTime_;
else {thresholdTime_ = 0.0; inThreshold_ = false;}
if(thresholdTime_ >= thresholdMinTime_ || timeoutCounter_ >= timeoutValue_)
{
robotOutputs.flMotorSpeed = 0;
robotOutputs.mlMotorSpeed = 0;
robotOutputs.blMotorSpeed = 0;
robotOutputs.frMotorSpeed = 0;
robotOutputs.mrMotorSpeed = 0;
robotOutputs.brMotorSpeed = 0;
ROS_INFO("end pivot");
taskEnded_ = 1;
}
else
{
robotOutputs.flMotorSpeed = (int)round(leftSpeed_*cwBoostGain_);
robotOutputs.mlMotorSpeed = (int)round(leftSpeed_*middleWheelReduction_*leftMiddleWheelMultiplier_);
robotOutputs.blMotorSpeed = (int)round(leftSpeed_*ccwBoostGain_);
robotOutputs.frMotorSpeed = (int)round(rightSpeed_*ccwBoostGain_);
robotOutputs.mrMotorSpeed = (int)round(rightSpeed_*middleWheelReduction_*rightMiddleWheelMultiplier_);
robotOutputs.brMotorSpeed = (int)round(rightSpeed_*cwBoostGain_);
taskEnded_ = 0;
}
//ROS_INFO("task ended = %i",taskEnded_);
//std::printf("\n");
return taskEnded_;
}
void DrivePivot::dogLeg_()
{
//ROS_INFO("dogLegState = %i",dogLegState);
switch(dogLegState)
{
case _monitoring:
encDelta_[0] = abs(robotStatus.flEncoder - encPrev_[0]);
encDelta_[1] = abs(robotStatus.mlEncoder - encPrev_[1]);
encDelta_[2] = abs(robotStatus.blEncoder - encPrev_[2]);
encDelta_[3] = abs(robotStatus.frEncoder - encPrev_[3]);
encDelta_[4] = abs(robotStatus.mrEncoder - encPrev_[4]);
encDelta_[5] = abs(robotStatus.brEncoder - encPrev_[5]);
minLeftDelta_ = 10000;
maxLeftDelta_ = 0;
minRightDelta_ = 10000;
maxRightDelta_ = 0;
for(int i=0; i<3; i++) // Left side
{
if(encDelta_[i] < minLeftDelta_) minLeftDelta_ = encDelta_[i];
if(encDelta_[i] > maxLeftDelta_) maxLeftDelta_ = encDelta_[i];
}
for(int i=3; i<6; i++) // Right side
{
if(encDelta_[i] < minRightDelta_) minRightDelta_ = encDelta_[i];
if(encDelta_[i] > maxRightDelta_) maxRightDelta_ = encDelta_[i];
}
leftMaxMinusMin_ = abs(maxLeftDelta_ - minLeftDelta_);
rightMaxMinusMin_ = abs(maxRightDelta_ - minRightDelta_);
if(leftMaxMinusMin_ > maxMinusMinLimit_) leftMaxMinusMin_ = maxMinusMinLimit_;
if(rightMaxMinusMin_ > maxMinusMinLimit_) rightMaxMinusMin_ = maxMinusMinLimit_;
leftDeltaVector_.insert(leftDeltaVector_.begin(),leftMaxMinusMin_);
rightDeltaVector_.insert(rightDeltaVector_.begin(),rightMaxMinusMin_);
if(leftDeltaVector_.size()>rollingAverageSize_) leftDeltaVector_.pop_back();
if(rightDeltaVector_.size()>rollingAverageSize_) rightDeltaVector_.pop_back();
leftDeltaAverage_ = 0;
for(int i=0; i<leftDeltaVector_.size(); i++)
{
leftDeltaAverage_ += leftDeltaVector_.at(i);
}
rightDeltaAverage_ = 0;
for(int i=0; i<rightDeltaVector_.size(); i++)
{
rightDeltaAverage_ += rightDeltaVector_.at(i);
}
if(leftDeltaVector_.size()>=rollingAverageSize_) leftDeltaAverage_ /= leftDeltaVector_.size();
else leftDeltaAverage_ = 1;
if(rightDeltaVector_.size()>=rollingAverageSize_) rightDeltaAverage_ /= rightDeltaVector_.size();
else rightDeltaAverage_ = 1;
ROS_INFO_THROTTLE(1,"left dog leg delta average = %i",leftDeltaAverage_);
ROS_INFO_THROTTLE(1,"right dog leg delta average = %i",rightDeltaAverage_);
if((leftDeltaAverage_ > encoderDogLegTriggerValue_ || rightDeltaAverage_ > encoderDogLegTriggerValue_)
&& !dogLegDetectTimeStarted_) {dogLegDetectTimeStarted_ = true; dogLegDetectTime_ = ros::Time::now().toSec();}
else if((leftDeltaAverage_ <= encoderDogLegTriggerValue_ && rightDeltaAverage_ <= encoderDogLegTriggerValue_)
&& dogLegDetectTimeStarted_) dogLegDetectTimeStarted_ = false;
if(dogLegDetectTimeStarted_ && (ros::Time::now().toSec() - dogLegDetectTime_) >= dogLegDetectThreshold_) {dogLegState = _stoppingFirst; dogLegStopTime_ = ros::Time::now().toSec();}
else dogLegState = _monitoring;
break;
case _stoppingFirst:
ROS_INFO("dog leg detected, first stopping");
if((ros::Time::now().toSec() - dogLegStopTime_) > dogLegStopDuration_)
{
rSpeedI_ = 0.0;
dogLegRecoverStartTime_ = ros::Time::now().toSec();
dogLegState = _recovering;
}
else
{
dogLegState = _stoppingFirst;
}
rDes_ = 0.0;
break;
case _recovering:
ROS_INFO("dog leg recovering");
if((ros::Time::now().toSec() - dogLegRecoverStartTime_) > dogLegRecoverDuration_)
{
dogLegStopTime_ = ros::Time::now().toSec();
dogLegDetectTimeStarted_ = false;
dogLegState = _stoppingSecond;
}
else
{
if(pivotSign_ > 0) rDes_ = -dogLegRDes_;
else rDes_ = dogLegRDes_;
dogLegState = _recovering;
}
break;
case _stoppingSecond:
ROS_INFO("dog leg, second stopping");
if((ros::Time::now().toSec() - dogLegStopTime_) > dogLegStopDuration_)
{
rSpeedI_ = 0.0;
dogLegState = _monitoring;
}
else
{
dogLegState = _stoppingSecond;
}
rDes_ = 0.0;
break;
}
encPrev_[0] = robotStatus.flEncoder;
encPrev_[1] = robotStatus.mlEncoder;
encPrev_[2] = robotStatus.blEncoder;
encPrev_[3] = robotStatus.frEncoder;
encPrev_[4] = robotStatus.mrEncoder;
encPrev_[5] = robotStatus.brEncoder;
}
|
[
"mountainman@live.com"
] |
mountainman@live.com
|
ff7affccb045483cdd5312606c9408d9e93fb6d5
|
1c3230864622e4b4617fbc36f636c1a50a404d64
|
/02_fq2fa.cc
|
07e41b2b890dd7227d689ef2b6a0ef4eff274833
|
[] |
no_license
|
AdamFeng/Cor3GS
|
5f406dcc2e22228f93bf49c6f1e4a8996d4b87fc
|
02f567cd251f4608fe5e428042d8d837a4d218da
|
refs/heads/master
| 2021-05-12T05:56:54.969321
| 2018-01-12T07:14:39
| 2018-01-12T07:14:39
| 117,206,001
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,724
|
cc
|
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
using namespace std;
long line = 0;
int main(int argc,char *argv[])
{
ifstream fin;
ofstream fout;
if(argc != 3) {
cout << "ERROR: illegal argument number: " << argc << endl;
cout << "Uasage: \n \t fq2fa fastaq_file fasta_file \n" <<endl;
exit(0);
}
fin.open(argv[1]);
fout.open(argv[2]);
if(!fin.good()) {
cout << "ERROR: illegal input file path: " << argv[1] <<endl;
cout << "Uasage: \n \t fq2fa fastaq_file fasta_file \n" <<endl;
exit(0);
}
else if(!fout.good()) {
cout << "ERROR: illegal output file path" << endl;
cout << "Uasage: \n \t fq2fa fastaq_file fasta_file \n" <<endl;
exit(0);
}
cout << "Converting Data..." << endl;
int mod;
line=0;
while(fin != NULL) {
string s;
getline(fin,s,'\n');
if (s==""){
continue;
}
line=line+1;
mod=line % 4;
if (mod == 1){
s[0]='>';
fout << s << endl;
}
if (mod == 2){
fout << s << endl;
}
}
cout << "finished!" << endl;
fout.close();
fin.close();
return 0;
}
|
[
"836505080@qq.com"
] |
836505080@qq.com
|
3d434a406ad97c8aa6bf08b405417239564ddcef
|
8c8ea056e5c38abe04c70c1a89fcd610613777de
|
/module02/ex01/Fixed.class.hpp
|
189214b42b403244fe548af5aabed5819e228d19
|
[] |
no_license
|
1337hunter/cpp_modules
|
96992f7a000323ffee98fa7ee95bd5ce0686c381
|
b8cce9989c3092d878654799b390c0ab23d44e6e
|
refs/heads/master
| 2023-03-22T09:26:28.061684
| 2021-03-12T07:11:21
| 2021-03-12T07:11:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,393
|
hpp
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Fixed.class.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbright <gbright@student.21-school.ru> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/13 09:23:01 by gbright #+# #+# */
/* Updated: 2020/09/14 12:44:21 by gbright ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FIXED_CLASS_HPP
# define FIXED_CLASS_HPP
#include <iostream>
class Fixed
{
int value;
static const int pos = 8;
public:
Fixed(void);
~Fixed(void);
Fixed(Fixed const &what);
Fixed(const int n);
Fixed(const float n);
float toFloat(void) const;
int toInt(void) const;
void operator=(const Fixed &what);
int getRawBits(void) const;
void setRawBits(int const raw);
};
std::ostream &operator<<(std::ostream &os, const Fixed &what);
#endif
|
[
"ant.sergy@gmail.com"
] |
ant.sergy@gmail.com
|
b879e634bd5b8d883ab0adc195750314bdaec691
|
03bd05b47f0beaaadc3c179f9959805021bb913a
|
/include/vsg/core/Value.h
|
4e8056509bdd8008d7935595b7004f97df05d637
|
[
"MIT"
] |
permissive
|
blackball/VulkanSceneGraphPrototype
|
8d4b92d194505290eaa87173848127d9b4ef59aa
|
69b6afe66d50dd292462c63e5c4e2a6f6518db0c
|
refs/heads/master
| 2020-04-02T16:11:12.130410
| 2018-10-24T17:06:25
| 2018-10-24T17:06:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,701
|
h
|
#pragma once
/* <editor-fold desc="MIT License">
Copyright(c) 2018 Robert Osfield
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</editor-fold> */
#include <vsg/core/Data.h>
#include <vsg/maths/vec2.h>
#include <vsg/maths/vec3.h>
#include <vsg/maths/vec4.h>
#include <vsg/maths/mat4.h>
namespace vsg
{
template<typename T>
class Value : public Data
{
public:
using value_type = T;
Value() {}
Value(const Value& rhs) : _value(rhs._value) {}
explicit Value(const value_type& in_value) : _value(in_value) {}
std::size_t sizeofObject() const noexcept override { return sizeof(Value); }
// implementation provided by Visitor.h
void accept(Visitor& visitor) override;
void accept(ConstVisitor& visitor) const override;
std::size_t valueSize() const override { return sizeof(value_type); }
std::size_t valueCount() const override { return 1; }
std::size_t dataSize() const override { return sizeof(value_type); }
void* dataPointer() override { return &_value; }
const void* dataPointer() const override { return &_value; }
void* dataRelease() override { return nullptr; }
Value& operator = (const Value& rhs) { _value = rhs._value; return *this; }
Value& operator = (const value_type& rhs) { _value = rhs; return *this; }
operator value_type& () { return _value; }
operator const value_type& () const { return _value; }
value_type& value() { return _value; }
const value_type& value() const { return _value; }
protected:
virtual ~Value() {}
private:
value_type _value;
};
template<typename T>
void Object::setValue(const Key& key, const T& value)
{
using ValueT = Value<T>;
setObject(key, new ValueT(value));
}
template<typename T>
bool Object::getValue(const Key& key, T& value) const
{
using ValueT = Value<T>;
const ValueT* vo = dynamic_cast<const ValueT*>(getObject(key));
if (vo)
{
value = *vo;
return true;
}
else
{
return false;
}
}
using stringValue = Value<std::string>;
using boolValue = Value<bool>;
using intValue = Value<int>;
using uintValue = Value<unsigned int>;
using floatValue = Value<float>;
using doubleValue = Value<double>;
using vec2Value = Value<vec2>;
using vec3Value = Value<vec3>;
using vec4Value = Value<vec4>;
using mat4Value = Value<mat4>;
using dvec2Value = Value<dvec2>;
using dvec3Value = Value<dvec3>;
using dvec4Value = Value<dvec4>;
using dmat4Value = Value<dmat4>;
}
|
[
"robert@openscenegraph.com"
] |
robert@openscenegraph.com
|
f5622fb7e261a7157befe7fb8b41277257776083
|
13160ff519bf768a68c8f7356b16403734d388a7
|
/Atcoder/ABC/abc001/A.cpp
|
281c200580c04c691785d4bdaf4de5dd74987337
|
[] |
no_license
|
takuzoo3868/Competitive
|
a463ca529f8e1d4aadb55eebfb746273619eecb5
|
0ba0fa7ae925a7b36068eae5adc6a99f0d3eebbc
|
refs/heads/master
| 2021-07-18T04:04:36.625747
| 2018-11-18T09:26:15
| 2018-11-18T09:26:15
| 103,939,092
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 180
|
cpp
|
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
int h1, h2;
cin >> h1;
cin >> h2;
cout << h1 - h2 << endl;
return 0;
}
|
[
"sata3868.k.serpentis@gmail.com"
] |
sata3868.k.serpentis@gmail.com
|
69a1f3964398d386f501e895437f8cae0d568e91
|
fb295da32a6d8cbd13b5ed8ce6de93c4021e94aa
|
/algorithm_note/cp11-dp/longestCommonSubsequence.cpp
|
8f3cc1b8b853c8506ee288c8574536d2e96e7730
|
[] |
no_license
|
Thisnicknameisalreadytaken/kaoyan
|
dd31c88a232cda523b67e07d29d785acd9c844cd
|
d3c31d5d1c90e68294f6d16030476dfe70b98268
|
refs/heads/master
| 2023-03-21T04:11:56.205750
| 2020-06-08T16:38:09
| 2020-06-08T16:38:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,229
|
cpp
|
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
/*
* P434 给定两个字符串(或数字序列)A 和 B,求一个字符串,使得这个字符串是 A 和 B 的最长公共部分(子序列可以不连续),求最长公共子序列长度。
* 令 dp[i][j] 表示字符串 A 的 i 号位和字符串 B 的 j 号位之前的最长公共子序列长度(下标从 1 开始),
* 则有 dp[i][j] = { dp[i-1][j-1] + 1, A[i] == B[j]
* { max{dp[i-1][j], dp[i][j-1]}, A[i] != B[j]
* 边界:dp[i][0] = dp[0][j] = 0
*/
const int maxn = 100;
int dp[maxn][maxn];
int main() {
string a, b;
cin >> a >> b;
int a_length = a.size();
int b_length = b.size();
// 边界
for (int i = 0; i <= a_length; ++i) {
dp[i][0] = 0;
}
for (int j = 0; j <= b_length; ++j) {
dp[0][j] = 0;
}
for (int i = 1; i <= a_length; ++i) {
for (int j = 1; j <= b_length; ++j) {
if (a[i] == b[j]) {
dp[i][j] = dp[i - 1][j - 1] + 1;
} else {
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
}
}
}
cout << dp[a_length][b_length];
return 0;
}
|
[
"jiebaomaster@163.com"
] |
jiebaomaster@163.com
|
10de1affeb46007e1a61edd258f7baee83abd1d8
|
c405647ebd9e1fabacac5516b538e1119485ad69
|
/Zork/Entity.h
|
7beb917a486c3fc8cfd131c6834e499c976b3b01
|
[
"MIT"
] |
permissive
|
Max72590/Zork
|
4936693f6225781438d929acd2d5dee8f51ff737
|
88324cf2998867aec55c0e220a4dd6dd14cafdd3
|
refs/heads/master
| 2021-07-22T23:09:52.793699
| 2017-10-29T09:39:10
| 2017-10-29T09:39:10
| 106,169,634
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 221
|
h
|
#ifndef __Entity__
#define __Entity__
#include <string>
class Entity
{
public:
Entity();
~Entity();
public:
Entity* parent = nullptr;
std::string entityName;
std::string entityDescription;
};
#endif //__Entity__
|
[
"max-725@hotmail.com"
] |
max-725@hotmail.com
|
24f2c428159034d21d6387a1d845f9e38e5def63
|
1744b31acd0c4c6f03866ccc69555afd3de3e6a7
|
/14_final_ribbon/src/Ribbon.h
|
0cfc0e1ac40d1dde5fac4dbaa400e630b72e201c
|
[] |
no_license
|
ovicin/giang063_sims2014
|
70a5b77fe3759e094a32a9722c25cbf734505fe8
|
4846c1a7f0ecd87e1e7fdaa438975cfca27b2eef
|
refs/heads/master
| 2020-12-29T02:07:31.321307
| 2014-11-30T21:54:51
| 2014-11-30T21:54:51
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,349
|
h
|
//
// Ribbon.h
// 06_midterm
//
// Created by Gabriel Gianordoli on 10/5/14.
//
//
#pragma once
#include "ofMain.h"
#include "Particle.h"
#include "Spring.h"
class Ribbon{
public:
void setup(float _x, float _y);
void updatePhysics(string _selectedMode, ofPoint _mousePos, float _radius, float _strength);
void updateOscillation(float _amplitude, int _frequencyInSeconds, int _nModifier);
void draw(string _selectedMode, float _nVertices, float _thickness, float _zDepth);
// Drawing
void addPoint(float _x, float _y);
void applySmoothing(int _shapeSmoothing);
void resetSmoothing();
// Particles and Springs
void eraseParticles();
void createParticles();
void eraseSprings();
void connectSprings();
// ofPolyline is actually ONE line
// It would be the same as a vector of ofPoint.
// But it has some special properties, like the smoothing feature
ofPolyline originalLine; // this is the original line drawing
ofPolyline currentLine; // this is the smoothed line drawing
// We always draw the CURRENT line
// but we keep the original as an option to reset
// each vertex from our polyLine will respond to physics
vector<Particle> myParticles;
vector<Spring> springList;
};
|
[
"gianordoligabriel@yahoo.com.br"
] |
gianordoligabriel@yahoo.com.br
|
4db9c70c61db7971c9070cabc53957b38d661d83
|
4c83c841c32f0f3db42ee6edb9d622a60ef4982d
|
/CODEFORECES/Educational Codeforces Round 82 (Rated for Div. 2) /A.cpp
|
007419a77c6bf58f5e396aab4c03ba28b4267af8
|
[] |
no_license
|
marco-park/problemSolving
|
544762cd64cc730fdc1607114d2b40d56e22da8d
|
b68966b00227a7a8177b46b2898418d468964e6f
|
refs/heads/master
| 2023-09-04T11:11:42.963727
| 2021-09-22T14:08:35
| 2021-09-22T14:08:35
| 231,756,065
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 695
|
cpp
|
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
while(n--){
int ret = 0;
string s;
cin >> s;
bool flag = false;
int first=-1,last=-1;
for(int i=0;s[i];i++){
if(s[i]=='1'){
first = i;
break;
}
}
if(first==-1){
cout << 0 << '\n';
continue;
}
for(int i=0;s[i];i++){
if(s[i]=='1')last = i;
}
for(int i=first+1;i<last;i++){
if(s[i]=='0')ret++;
}
cout << ret << '\n';
}
}
|
[
"sungbinpark@bagseongbin-ui-MacBookPro.local"
] |
sungbinpark@bagseongbin-ui-MacBookPro.local
|
874f8d333e15ea384b820f178afca61f8298ae81
|
5d83739af703fb400857cecc69aadaf02e07f8d1
|
/Archive2/ef/ca727df9863435/main.cpp
|
fc86b72c368ce5b2a089ce4ff415b6a6eb89d7b8
|
[] |
no_license
|
WhiZTiM/coliru
|
3a6c4c0bdac566d1aa1c21818118ba70479b0f40
|
2c72c048846c082f943e6c7f9fa8d94aee76979f
|
refs/heads/master
| 2021-01-01T05:10:33.812560
| 2015-08-24T19:09:22
| 2015-08-24T19:09:22
| 56,789,706
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 159
|
cpp
|
#include <iostream>
#include <functional>
#include <memory>
int foo()
{
return 5;
}
int main(int argc, char* argv[])
{
auto& v = foo();
}
|
[
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] |
francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df
|
1b6de6474e16153193c8db973fe7e2a1aef1eda8
|
4da2337a64ad28facdcdfe2471710ffa4975a3f4
|
/source/Kraken/KrakenNormal.h
|
157f3b69579dded841035fc594d2791d6cfe7026
|
[] |
no_license
|
TheMaverickProgrammer/ios-game-release-the-kraken
|
90e0aef97125b7f60bc7f75a79db192b15c2c079
|
7c7986f1c563d59c858dab30084a6eb57aee7eb9
|
refs/heads/master
| 2016-09-06T21:32:57.488102
| 2015-08-11T22:25:33
| 2015-08-11T22:25:33
| 40,566,186
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,643
|
h
|
//
// KrakenNormal.h
// Kraken
//
// Created by Maverick Programmer on 5/27/12.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//
#ifndef KRAKEN_NORMAL_H
#define KRAKEN_NORMAL_H
#include "Entity.h"
#include "KrakenGameTiledMap.h"
#include "KrakenGame.h"
#include "Camera.h"
#include "Player.h"
#include "Core.h"
#include "Vector2D.h"
#include "Group.h"
#include "Predator.h"
class KrakenTentacle;
class KrakenNormal : public Entity, public Predator
{
private:
Vector2D position;
long kraken_begin_time;
long last;
double speed;
class KrakenTentacle // Gets drawn in Kraken onDraw() function
{
private:
KrakenTentacle* child; // null means this is end
double current_angle;
double delta_angle;
bool is_end;
KrakenNormal *kraken;
Vector2D position;
public:
KrakenTentacle(int length, KrakenNormal *kraken, Vector2D position)
{
if(length != 0)
{
is_end = false;
child = new KrakenTentacle(length-1, kraken, position);
}
else
{
is_end = true;
child = 0; // no child; endpoint
}
current_angle = 0;
delta_angle = 2;
this->position = position;
this->kraken = kraken;
}
Vector2D getPosition()
{
return position;
}
void update()
{
if(Gosu::random(0, 100) > 95)
delta_angle = Gosu::random(-2.0, 2.0);
current_angle += delta_angle;
if(current_angle <= -45 || current_angle >= 45)
delta_angle = -delta_angle;
if( hasChild() )
{
getChild()->update();
}
}
const bool hasChild() { return !is_end; }
KrakenTentacle* getChild() { return child; }
const double getCurrentAngle() { return current_angle; }
void attackPoint(Vector2D point)
{
const double RADIANS = (22.0/7.0)/180.0; // PI / 180
Vector2D pos(cosf(current_angle*RADIANS)*32, sinf(current_angle*RADIANS)*32);
pos.normalize();
point.normalize();
current_angle += acos(pos.dot(point));
if(hasChild())
getChild()->attackPoint(point);
}
void returnFromAttack()
{
current_angle = 0;
if(hasChild())
getChild()->returnFromAttack();
}
Vector2D getDrawPosition()
{
Vector2D return_result;
const double RADIANS = (22.0/7.0)/180.0; // PI / 180
return_result = Vector2D( 32*cosf(current_angle*RADIANS), 32*sinf(current_angle*RADIANS));
return return_result;
}
void draw(Camera* cam)
{
KrakenTentacle *ptr = this;
int i = 0;
Vector2D coord;
Vector2D draw_pos = cam->worldToScreen(kraken->getPosition() + position);
while( (ptr->hasChild() ) )
{
// draw arm
Vector2D coord = draw_pos;
draw_pos = draw_pos + ptr->getDrawPosition();
double scale = cam->getZoom();
Core::get().getGraphicResources().get("KrakenArm")->drawRot(coord.x, coord.y, 5, ptr->getCurrentAngle(), 0, 0.5, scale, scale);
ptr = ptr->getChild();
i++;
}
// otherwise draw end
coord = draw_pos;
double scale = cam->getZoom();
Core::get().getGraphicResources().get("KrakenEnd")->drawRot(coord.x, coord.y, 5, ptr->getCurrentAngle(), 0, 0.5, scale, scale);
}
};
Group<KrakenTentacle*> all_my_arms;
public:
KrakenNormal();
~KrakenNormal();
void onUpdate();
void onDraw();
void resetClock();
bool hasTentacleHitPlayer(Player* player);
};
#endif
|
[
"bmpeppers@gmail.com"
] |
bmpeppers@gmail.com
|
e2a0262c198327f8fdbb9067e1abda7f13c58f64
|
f98c9dea0e212be5c7bc3161499e5633383bd4d7
|
/curl/curltest.cpp
|
c7fffb96b8e9aaf652f594b863e65f19f5360854
|
[
"MIT"
] |
permissive
|
ysoftman/test_code
|
dddb5bee3420977bfa335320a09d66e5984403f5
|
0bf6307073081eeb1d654a1eb5efde44a0bdfe1e
|
refs/heads/master
| 2023-08-17T05:45:49.716829
| 2023-08-16T05:00:09
| 2023-08-16T05:00:09
| 108,200,568
| 4
| 0
|
MIT
| 2023-03-15T04:23:10
| 2017-10-25T00:49:26
|
C++
|
UTF-8
|
C++
| false
| false
| 4,699
|
cpp
|
/*
# ysoftman
# libcurl 테스트
# linux/mac
# openssl 설치
wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
tar zxvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k
./config
make -j4
sudo make install
cd ..
# curl 설치
wget https://curl.haxx.se/download/curl-7.60.0.tar.gz
tar zxvf curl-7.60.0.tar.gz
cd curl-7.60.0
# linux
./configure --prefix=${HOME}/workspace/curl-7.60.0 --with-ssl
# mac
export MACOSX_DEPLOYMENT_TARGET="10.6"
./configure --prefix=${HOME}/workspace/curl-7.60.0 --with-darwinssl
make -j4 && make install
cd ..
gcc curltest.cpp -I${HOME}/workspace/curl-7.60.0/include/curl -L${HOME}/workspace/curl-7.60.0/lib -lcurl -o curltest
# windows
# https://curl.haxx.se/download/curl-7.60.0.tar.gz 다운로드 후 압축 풀기
# cmake 에서 configure -> visual studio 11 2012 선택 -> generate
# visual studio 로 빌드하기 (코드 생성 MT)
# 헤더파일은 curl 소스의 include 사용
# 참고
# visual studio 에서 .c 대신 .cpp 확장자를 사용하도록 한다.
# 실행시 zlib1.dll 관련 에러가 발생한다면
# 윈도우용 zlib 다운로드 http://gnuwin32.sourceforge.net/downlinks/zlib-bin-zip.php
# 압축 해제 후 zlib1.dll 를 복사해서 사용해한다.
# curl 참고
https://curl.haxx.se/libcurl/c/getinmemory.html
http://curl.haxx.se/libcurl/c/example.html
http://www.joinc.co.kr/modules/moniwiki//wiki.php/Site/Web/documents/UsedCurl
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "curl.h"
#if defined(_WIN32) || defined(_WIN64)
#include "include/curl/curl.h"
#pragma comment(lib, "lib/libcurl_imp_mtd_2012.lib")
#endif
struct CURL_DATA_INFO
{
char *pData;
size_t size;
};
// 응답 패킷 내용 쓰는 함수(콜백)
static size_t WriteData(void *contents, size_t size, size_t nmemb, void *userdata)
{
size_t realsize = size * nmemb;
struct CURL_DATA_INFO *mem = (struct CURL_DATA_INFO *)userdata;
// 여러번 콜백될 수 있어 기존 데이터에 이어붙인다.
mem->pData = (char *)realloc(mem->pData, mem->size + realsize + 1);
if (mem->pData == NULL)
{
fprintf(stderr, "realloc failed\n");
return 0;
}
memcpy(&(mem->pData[mem->size]), contents, realsize);
mem->size += realsize;
mem->pData[mem->size] = 0;
return realsize;
}
int main(int argc, char **argv)
{
if (argc != 2)
{
fprintf(stderr, "Usage(example) : %s https://www.google.com\n", argv[0]);
return 0;
}
CURL *curl;
CURLcode curlcode;
// 초기화
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if (!curl)
{
fprintf(stderr, "Can't initialize cURL.\n");
return -1;
}
// 대상 URL 설정
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
// 헤더와 바디 내용 쓰기 함수 설정
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, WriteData);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData);
// 헤더와 바디 내용 출력 대상 설정
//curl_easy_setopt(curl, CURLOPT_WRITEHEADER, stderr);
//curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout);
CURL_DATA_INFO header;
header.size = 0;
header.pData = (char *)calloc(1, sizeof(char) * 1);
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, &header);
CURL_DATA_INFO body;
body.size = 0;
body.pData = (char *)calloc(1, sizeof(char *) * 1);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
// id, pw 설정
//curl_easy_setopt(curl, CURLOPT_USERNAME, "ysoftman");
//curl_easy_setopt(curl, CURLOPT_PASSWORD, "qwer1234");
//curl_easy_setopt(curl, CURLOPT_USERPWD, "ysoftman:qwer1234");
// 상세 정보 보기(콘솔에 request/body 관련 정보가 출력된다.)
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
// redirect 된 경우 해당 경로를 따라가도록 함
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
// 타임아웃(second) 설정
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
// 실행
curlcode = curl_easy_perform(curl);
if (curlcode != CURLE_OK)
{
printf("\n\n\ncurl error : %s\n", curl_easy_strerror(curlcode));
}
else
{
long nHttpRespCode;
double dDownloadSize;
char *szContentType;
curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &nHttpRespCode);
curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &szContentType);
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dDownloadSize);
fprintf(stderr, "curl success!\n");
fprintf(stderr, "HttpResponseCode: %ld\n", nHttpRespCode);
fprintf(stderr, "ContentType: %s\n", szContentType);
fprintf(stderr, "DownloadSize: %f (bytes)\n", dDownloadSize);
fprintf(stderr, "Response Header: %s\n", header.pData);
fprintf(stderr, "Response Body: %s\n", body.pData);
}
free(header.pData);
free(body.pData);
// context 제거
curl_easy_cleanup(curl);
curl_global_init(CURL_GLOBAL_ALL);
return 0;
}
|
[
"ysoftman@gmail.com"
] |
ysoftman@gmail.com
|
4591199bf730a592d1a198c301f4ae151c9d1a7a
|
8bbeb7b5721a9dbf40caa47a96e6961ceabb0128
|
/cpp/40.Combination Sum II(组合总和 II).cpp
|
9a6e2a7978bbecde17012f916cb1588b963804f5
|
[
"MIT"
] |
permissive
|
lishulongVI/leetcode
|
bb5b75642f69dfaec0c2ee3e06369c715125b1ba
|
6731e128be0fd3c0bdfe885c1a409ac54b929597
|
refs/heads/master
| 2020-03-23T22:17:40.335970
| 2018-07-23T14:46:06
| 2018-07-23T14:46:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,921
|
cpp
|
/*
<p>Given a collection of candidate numbers (<code>candidates</code>) and a target number (<code>target</code>), find all unique combinations in <code>candidates</code> where the candidate numbers sums to <code>target</code>.</p>
<p>Each number in <code>candidates</code> may only be used <strong>once</strong> in the combination.</p>
<p><strong>Note:</strong></p>
<ul>
<li>All numbers (including <code>target</code>) will be positive integers.</li>
<li>The solution set must not contain duplicate combinations.</li>
</ul>
<p><strong>Example 1:</strong></p>
<pre>
<strong>Input:</strong> candidates = <code>[10,1,2,7,6,1,5]</code>, target = <code>8</code>,
<strong>A solution set is:</strong>
[
[1, 7],
[1, 2, 5],
[2, 6],
[1, 1, 6]
]
</pre>
<p><strong>Example 2:</strong></p>
<pre>
<strong>Input:</strong> candidates = [2,5,2,1,2], target = 5,
<strong>A solution set is:</strong>
[
[1,2,2],
[5]
]
</pre>
<p>给定一个数组 <code>candidates</code> 和一个目标数 <code>target</code> ,找出 <code>candidates</code> 中所有可以使数字和为 <code>target</code> 的组合。</p>
<p><code>candidates</code> 中的每个数字在每个组合中只能使用一次。</p>
<p><strong>说明:</strong></p>
<ul>
<li>所有数字(包括目标数)都是正整数。</li>
<li>解集不能包含重复的组合。 </li>
</ul>
<p><strong>示例 1:</strong></p>
<pre><strong>输入:</strong> candidates = <code>[10,1,2,7,6,1,5]</code>, target = <code>8</code>,
<strong>所求解集为:</strong>
[
[1, 7],
[1, 2, 5],
[2, 6],
[1, 1, 6]
]
</pre>
<p><strong>示例 2:</strong></p>
<pre><strong>输入:</strong> candidates = [2,5,2,1,2], target = 5,
<strong>所求解集为:</strong>
[
[1,2,2],
[5]
]</pre>
<p>给定一个数组 <code>candidates</code> 和一个目标数 <code>target</code> ,找出 <code>candidates</code> 中所有可以使数字和为 <code>target</code> 的组合。</p>
<p><code>candidates</code> 中的每个数字在每个组合中只能使用一次。</p>
<p><strong>说明:</strong></p>
<ul>
<li>所有数字(包括目标数)都是正整数。</li>
<li>解集不能包含重复的组合。 </li>
</ul>
<p><strong>示例 1:</strong></p>
<pre><strong>输入:</strong> candidates = <code>[10,1,2,7,6,1,5]</code>, target = <code>8</code>,
<strong>所求解集为:</strong>
[
[1, 7],
[1, 2, 5],
[2, 6],
[1, 1, 6]
]
</pre>
<p><strong>示例 2:</strong></p>
<pre><strong>输入:</strong> candidates = [2,5,2,1,2], target = 5,
<strong>所求解集为:</strong>
[
[1,2,2],
[5]
]</pre>
*/
class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
}
};
|
[
"lishulong@wecash.net"
] |
lishulong@wecash.net
|
91d09979d57b684671cd59d331137dc2a5028cc6
|
af96101dcbe0618a30616027580bca5a556369e5
|
/include/AnnErrorCode.hpp
|
32404211686997505c097e9789a8bc23433ab4b2
|
[
"MIT"
] |
permissive
|
zerubeus/Annwvyn
|
a9c7cd27c34b2fd89621511c0912a9bdcc779758
|
e5485e817ae45d611bd46e9410c160d1e109050d
|
refs/heads/master
| 2020-12-30T19:11:11.009976
| 2016-01-22T00:57:00
| 2016-01-22T00:57:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,384
|
hpp
|
/**
* \file AnnErrorCode.hpp
* \brief Define a serise of hex code as constant keywords to define error codes.
* \author A. Brainville (Ybalrid)
*/
#ifndef ANN_ERROR_CODE
#define ANN_ERROR_CODE
#define ANN_ERR_CRITIC 0xDEAD60D // Dead God
/*
Indicate that the execution environement of the engine hasn't been about to be initialized
- Check log file
*/
#define ANN_ERR_MEMORY 0xFAA760D // Fa_t God
/*
Indicate that a memory error has been caused inside the engine
- Check if you haven't done something stupid pointers
- Please don't try to delete anything created by the engine, it's not you're problem
- Check log file for more information
*/
#define ANN_ERR_RENDER 0x5ADE60D // Sa_d God
/*
Indicate an irecuperable error with the renderer. Either during initialization or during rendering
- Check OVR runtime version
- Check hardware (HMD plugged, Graphics card compatible)
- Check other software (Graphics drivers)
- Check log file for more information
*/
#define ANN_ERR_INFILE 0x12F1D31 // Infi-del
/*
Indicate that the engine is unable to understand an Annwvyn file you tried to load
- Check file path in your code
- Check file path referenced in the file
- Check syntax of the file
- Check log file at the moment of crash for more information
*/
#define ANN_ERR_UNKOWN 0x200760D // No_t God
/*
See log. Something gone wrong and don't have a specific error code.
*/
#endif
|
[
"ybalrid@cecmu.org"
] |
ybalrid@cecmu.org
|
ea4810bfe623fcf38cb20225163266e27341cf25
|
bc1d68d7a7c837b8a99e516050364a7254030727
|
/src/ZOJ/ZOJ3359 Penalties Kick.cpp
|
340c597dac915040f00d996d016edb8caa89265e
|
[] |
no_license
|
kester-lin/acm_backup
|
1e86b0b4699f8fa50a526ce091f242ee75282f59
|
a4850379c6c67a42da6b5aea499306e67edfc9fd
|
refs/heads/master
| 2021-05-28T20:01:31.044690
| 2013-05-16T03:27:21
| 2013-05-16T03:27:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,952
|
cpp
|
// ZOJ3359 Penalties Kick.cpp : Defines the entry point for the console application.
//
// #include "stdafx.h"
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <math.h>
#include <algorithm>
#include <numeric>
#include <functional>
#include <memory.h>
using namespace std;
int main(void)
{
// ifstream cin("data.txt");
int ncases;
int casenum;
char str1[4],str2[4],str3[4];
cin>>ncases;
int kick[3][22];
for(casenum=1;casenum<=ncases;++casenum)
{
for(int i=0;i<22;++i)
{
scanf("%s %s %s",&str1,&str2,&str3);
if (str1[0]=='y')
{
kick[0][i]=1;
}
else
{
kick[0][i]=0;
}
if (str2[0]=='y')
{
kick[1][i]=1;
}
else
{
kick[1][i]=0;
}
if (str3[0]=='y')
{
kick[2][i]=1;
}
else
{
kick[2][i]=0;
}
}
int away(0),home(0),count(0);
int flag(1);
printf("Match %d:\n",casenum);
for(int i=0;i<3 && flag;++i)
{
for(int j=0;j<11;++j)
{
++count;
home += kick[i][j];
if(count<6 && home-away>5-count+1)
{
printf("Winner: home\nScore: %d:%d\n",home,away);
flag=0;
break;
}
if(count<6 && away-home>5-count)
{
printf("Winner: away\nScore: %d:%d\n",home,away);
flag=0;
break;
}
away += kick[i][j+11];
if(count<6 && home-away>5-count)
{
printf("Winner: home\nScore: %d:%d\n",home,away);
flag=0;
break;
}
if(count<6 && away-home>5-count)
{
printf("Winner: away\nScore: %d:%d\n",home,away);
flag=0;
break;
}
if (count>5 && home>away)
{
printf("Winner: home\nScore: %d:%d\n",home,away);
flag=0;
break;
}
else if(count>5 && away>home)
{
printf("Winner: away\nScore: %d:%d\n",home,away);
flag=0;
break;
}
}
}
}
return 0;
}
|
[
"neosfung@gmail.com"
] |
neosfung@gmail.com
|
0b859466de34107317ec74cd98708822732c87ff
|
6d7a3bb26053cb180f35c88daf108f5a773ff293
|
/wasm_llvm/utils/TableGen/CodeGenDAGPatterns.cpp
|
610513b38b062675836673dcbbc2126b2e29fa67
|
[
"NCSA",
"MIT"
] |
permissive
|
WaykiChain/wicc-wasm-cdt
|
e4088f0313fbeb1aae7f4631b2735fbd2fc3c0c6
|
fcf9edcc9d8abf689c6a2452399735c887185bfa
|
refs/heads/master
| 2021-07-06T15:20:58.417585
| 2020-10-12T01:25:17
| 2020-10-12T01:25:17
| 237,560,833
| 1
| 2
|
MIT
| 2020-10-12T01:25:19
| 2020-02-01T04:19:53
|
C++
|
UTF-8
|
C++
| false
| false
| 163,439
|
cpp
|
//===- CodeGenDAGPatterns.cpp - Read DAG patterns from .td file -----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements the CodeGenDAGPatterns class, which is used to read and
// represent the patterns present in a .td file for instructions.
//
//===----------------------------------------------------------------------===//
#include "CodeGenDAGPatterns.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <algorithm>
#include <cstdio>
#include <set>
using namespace llvm;
#define DEBUG_TYPE "dag-patterns"
static inline bool isIntegerOrPtr(MVT VT) {
return VT.isInteger() || VT == MVT::iPTR;
}
static inline bool isFloatingPoint(MVT VT) {
return VT.isFloatingPoint();
}
static inline bool isVector(MVT VT) {
return VT.isVector();
}
static inline bool isScalar(MVT VT) {
return !VT.isVector();
}
template <typename Predicate>
static bool berase_if(MachineValueTypeSet &S, Predicate P) {
bool Erased = false;
// It is ok to iterate over MachineValueTypeSet and remove elements from it
// at the same time.
for (MVT T : S) {
if (!P(T))
continue;
Erased = true;
S.erase(T);
}
return Erased;
}
// --- TypeSetByHwMode
// This is a parameterized type-set class. For each mode there is a list
// of types that are currently possible for a given tree node. Type
// inference will apply to each mode separately.
TypeSetByHwMode::TypeSetByHwMode(ArrayRef<ValueTypeByHwMode> VTList) {
for (const ValueTypeByHwMode &VVT : VTList)
insert(VVT);
}
bool TypeSetByHwMode::isValueTypeByHwMode(bool AllowEmpty) const {
for (const auto &I : *this) {
if (I.second.size() > 1)
return false;
if (!AllowEmpty && I.second.empty())
return false;
}
return true;
}
ValueTypeByHwMode TypeSetByHwMode::getValueTypeByHwMode() const {
assert(isValueTypeByHwMode(true) &&
"The type set has multiple types for at least one HW mode");
ValueTypeByHwMode VVT;
for (const auto &I : *this) {
MVT T = I.second.empty() ? MVT::Other : *I.second.begin();
VVT.getOrCreateTypeForMode(I.first, T);
}
return VVT;
}
bool TypeSetByHwMode::isPossible() const {
for (const auto &I : *this)
if (!I.second.empty())
return true;
return false;
}
bool TypeSetByHwMode::insert(const ValueTypeByHwMode &VVT) {
bool Changed = false;
SmallDenseSet<unsigned, 4> Modes;
for (const auto &P : VVT) {
unsigned M = P.first;
Modes.insert(M);
// Make sure there exists a set for each specific mode from VVT.
Changed |= getOrCreate(M).insert(P.second).second;
}
// If VVT has a default mode, add the corresponding type to all
// modes in "this" that do not exist in VVT.
if (Modes.count(DefaultMode)) {
MVT DT = VVT.getType(DefaultMode);
for (auto &I : *this)
if (!Modes.count(I.first))
Changed |= I.second.insert(DT).second;
}
return Changed;
}
// Constrain the type set to be the intersection with VTS.
bool TypeSetByHwMode::constrain(const TypeSetByHwMode &VTS) {
bool Changed = false;
if (hasDefault()) {
for (const auto &I : VTS) {
unsigned M = I.first;
if (M == DefaultMode || hasMode(M))
continue;
Map.insert({M, Map.at(DefaultMode)});
Changed = true;
}
}
for (auto &I : *this) {
unsigned M = I.first;
SetType &S = I.second;
if (VTS.hasMode(M) || VTS.hasDefault()) {
Changed |= intersect(I.second, VTS.get(M));
} else if (!S.empty()) {
S.clear();
Changed = true;
}
}
return Changed;
}
template <typename Predicate>
bool TypeSetByHwMode::constrain(Predicate P) {
bool Changed = false;
for (auto &I : *this)
Changed |= berase_if(I.second, [&P](MVT VT) { return !P(VT); });
return Changed;
}
template <typename Predicate>
bool TypeSetByHwMode::assign_if(const TypeSetByHwMode &VTS, Predicate P) {
assert(empty());
for (const auto &I : VTS) {
SetType &S = getOrCreate(I.first);
for (auto J : I.second)
if (P(J))
S.insert(J);
}
return !empty();
}
void TypeSetByHwMode::writeToStream(raw_ostream &OS) const {
SmallVector<unsigned, 4> Modes;
Modes.reserve(Map.size());
for (const auto &I : *this)
Modes.push_back(I.first);
if (Modes.empty()) {
OS << "{}";
return;
}
array_pod_sort(Modes.begin(), Modes.end());
OS << '{';
for (unsigned M : Modes) {
OS << ' ' << getModeName(M) << ':';
writeToStream(get(M), OS);
}
OS << " }";
}
void TypeSetByHwMode::writeToStream(const SetType &S, raw_ostream &OS) {
SmallVector<MVT, 4> Types(S.begin(), S.end());
array_pod_sort(Types.begin(), Types.end());
OS << '[';
for (unsigned i = 0, e = Types.size(); i != e; ++i) {
OS << ValueTypeByHwMode::getMVTName(Types[i]);
if (i != e-1)
OS << ' ';
}
OS << ']';
}
bool TypeSetByHwMode::operator==(const TypeSetByHwMode &VTS) const {
bool HaveDefault = hasDefault();
if (HaveDefault != VTS.hasDefault())
return false;
if (isSimple()) {
if (VTS.isSimple())
return *begin() == *VTS.begin();
return false;
}
SmallDenseSet<unsigned, 4> Modes;
for (auto &I : *this)
Modes.insert(I.first);
for (const auto &I : VTS)
Modes.insert(I.first);
if (HaveDefault) {
// Both sets have default mode.
for (unsigned M : Modes) {
if (get(M) != VTS.get(M))
return false;
}
} else {
// Neither set has default mode.
for (unsigned M : Modes) {
// If there is no default mode, an empty set is equivalent to not having
// the corresponding mode.
bool NoModeThis = !hasMode(M) || get(M).empty();
bool NoModeVTS = !VTS.hasMode(M) || VTS.get(M).empty();
if (NoModeThis != NoModeVTS)
return false;
if (!NoModeThis)
if (get(M) != VTS.get(M))
return false;
}
}
return true;
}
namespace llvm {
raw_ostream &operator<<(raw_ostream &OS, const TypeSetByHwMode &T) {
T.writeToStream(OS);
return OS;
}
}
LLVM_DUMP_METHOD
void TypeSetByHwMode::dump() const {
dbgs() << *this << '\n';
}
bool TypeSetByHwMode::intersect(SetType &Out, const SetType &In) {
bool OutP = Out.count(MVT::iPTR), InP = In.count(MVT::iPTR);
auto Int = [&In](MVT T) -> bool { return !In.count(T); };
if (OutP == InP)
return berase_if(Out, Int);
// Compute the intersection of scalars separately to account for only
// one set containing iPTR.
// The itersection of iPTR with a set of integer scalar types that does not
// include iPTR will result in the most specific scalar type:
// - iPTR is more specific than any set with two elements or more
// - iPTR is less specific than any single integer scalar type.
// For example
// { iPTR } * { i32 } -> { i32 }
// { iPTR } * { i32 i64 } -> { iPTR }
// and
// { iPTR i32 } * { i32 } -> { i32 }
// { iPTR i32 } * { i32 i64 } -> { i32 i64 }
// { iPTR i32 } * { i32 i64 i128 } -> { iPTR i32 }
// Compute the difference between the two sets in such a way that the
// iPTR is in the set that is being subtracted. This is to see if there
// are any extra scalars in the set without iPTR that are not in the
// set containing iPTR. Then the iPTR could be considered a "wildcard"
// matching these scalars. If there is only one such scalar, it would
// replace the iPTR, if there are more, the iPTR would be retained.
SetType Diff;
if (InP) {
Diff = Out;
berase_if(Diff, [&In](MVT T) { return In.count(T); });
// Pre-remove these elements and rely only on InP/OutP to determine
// whether a change has been made.
berase_if(Out, [&Diff](MVT T) { return Diff.count(T); });
} else {
Diff = In;
berase_if(Diff, [&Out](MVT T) { return Out.count(T); });
Out.erase(MVT::iPTR);
}
// The actual intersection.
bool Changed = berase_if(Out, Int);
unsigned NumD = Diff.size();
if (NumD == 0)
return Changed;
if (NumD == 1) {
Out.insert(*Diff.begin());
// This is a change only if Out was the one with iPTR (which is now
// being replaced).
Changed |= OutP;
} else {
// Multiple elements from Out are now replaced with iPTR.
Out.insert(MVT::iPTR);
Changed |= !OutP;
}
return Changed;
}
bool TypeSetByHwMode::validate() const {
#ifndef NDEBUG
if (empty())
return true;
bool AllEmpty = true;
for (const auto &I : *this)
AllEmpty &= I.second.empty();
return !AllEmpty;
#endif
return true;
}
// --- TypeInfer
bool TypeInfer::MergeInTypeInfo(TypeSetByHwMode &Out,
const TypeSetByHwMode &In) {
ValidateOnExit _1(Out, *this);
In.validate();
if (In.empty() || Out == In || TP.hasError())
return false;
if (Out.empty()) {
Out = In;
return true;
}
bool Changed = Out.constrain(In);
if (Changed && Out.empty())
TP.error("Type contradiction");
return Changed;
}
bool TypeInfer::forceArbitrary(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError())
return false;
assert(!Out.empty() && "cannot pick from an empty set");
bool Changed = false;
for (auto &I : Out) {
TypeSetByHwMode::SetType &S = I.second;
if (S.size() <= 1)
continue;
MVT T = *S.begin(); // Pick the first element.
S.clear();
S.insert(T);
Changed = true;
}
return Changed;
}
bool TypeInfer::EnforceInteger(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError())
return false;
if (!Out.empty())
return Out.constrain(isIntegerOrPtr);
return Out.assign_if(getLegalTypes(), isIntegerOrPtr);
}
bool TypeInfer::EnforceFloatingPoint(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError())
return false;
if (!Out.empty())
return Out.constrain(isFloatingPoint);
return Out.assign_if(getLegalTypes(), isFloatingPoint);
}
bool TypeInfer::EnforceScalar(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError())
return false;
if (!Out.empty())
return Out.constrain(isScalar);
return Out.assign_if(getLegalTypes(), isScalar);
}
bool TypeInfer::EnforceVector(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError())
return false;
if (!Out.empty())
return Out.constrain(isVector);
return Out.assign_if(getLegalTypes(), isVector);
}
bool TypeInfer::EnforceAny(TypeSetByHwMode &Out) {
ValidateOnExit _1(Out, *this);
if (TP.hasError() || !Out.empty())
return false;
Out = getLegalTypes();
return true;
}
template <typename Iter, typename Pred, typename Less>
static Iter min_if(Iter B, Iter E, Pred P, Less L) {
if (B == E)
return E;
Iter Min = E;
for (Iter I = B; I != E; ++I) {
if (!P(*I))
continue;
if (Min == E || L(*I, *Min))
Min = I;
}
return Min;
}
template <typename Iter, typename Pred, typename Less>
static Iter max_if(Iter B, Iter E, Pred P, Less L) {
if (B == E)
return E;
Iter Max = E;
for (Iter I = B; I != E; ++I) {
if (!P(*I))
continue;
if (Max == E || L(*Max, *I))
Max = I;
}
return Max;
}
/// Make sure that for each type in Small, there exists a larger type in Big.
bool TypeInfer::EnforceSmallerThan(TypeSetByHwMode &Small,
TypeSetByHwMode &Big) {
ValidateOnExit _1(Small, *this), _2(Big, *this);
if (TP.hasError())
return false;
bool Changed = false;
if (Small.empty())
Changed |= EnforceAny(Small);
if (Big.empty())
Changed |= EnforceAny(Big);
assert(Small.hasDefault() && Big.hasDefault());
std::vector<unsigned> Modes = union_modes(Small, Big);
// 1. Only allow integer or floating point types and make sure that
// both sides are both integer or both floating point.
// 2. Make sure that either both sides have vector types, or neither
// of them does.
for (unsigned M : Modes) {
TypeSetByHwMode::SetType &S = Small.get(M);
TypeSetByHwMode::SetType &B = Big.get(M);
if (any_of(S, isIntegerOrPtr) && any_of(S, isIntegerOrPtr)) {
auto NotInt = [](MVT VT) { return !isIntegerOrPtr(VT); };
Changed |= berase_if(S, NotInt) |
berase_if(B, NotInt);
} else if (any_of(S, isFloatingPoint) && any_of(B, isFloatingPoint)) {
auto NotFP = [](MVT VT) { return !isFloatingPoint(VT); };
Changed |= berase_if(S, NotFP) |
berase_if(B, NotFP);
} else if (S.empty() || B.empty()) {
Changed = !S.empty() || !B.empty();
S.clear();
B.clear();
} else {
TP.error("Incompatible types");
return Changed;
}
if (none_of(S, isVector) || none_of(B, isVector)) {
Changed |= berase_if(S, isVector) |
berase_if(B, isVector);
}
}
auto LT = [](MVT A, MVT B) -> bool {
return A.getScalarSizeInBits() < B.getScalarSizeInBits() ||
(A.getScalarSizeInBits() == B.getScalarSizeInBits() &&
A.getSizeInBits() < B.getSizeInBits());
};
auto LE = [](MVT A, MVT B) -> bool {
// This function is used when removing elements: when a vector is compared
// to a non-vector, it should return false (to avoid removal).
if (A.isVector() != B.isVector())
return false;
// Note on the < comparison below:
// X86 has patterns like
// (set VR128X:$dst, (v16i8 (X86vtrunc (v4i32 VR128X:$src1)))),
// where the truncated vector is given a type v16i8, while the source
// vector has type v4i32. They both have the same size in bits.
// The minimal type in the result is obviously v16i8, and when we remove
// all types from the source that are smaller-or-equal than v8i16, the
// only source type would also be removed (since it's equal in size).
return A.getScalarSizeInBits() <= B.getScalarSizeInBits() ||
A.getSizeInBits() < B.getSizeInBits();
};
for (unsigned M : Modes) {
TypeSetByHwMode::SetType &S = Small.get(M);
TypeSetByHwMode::SetType &B = Big.get(M);
// MinS = min scalar in Small, remove all scalars from Big that are
// smaller-or-equal than MinS.
auto MinS = min_if(S.begin(), S.end(), isScalar, LT);
if (MinS != S.end())
Changed |= berase_if(B, std::bind(LE, std::placeholders::_1, *MinS));
// MaxS = max scalar in Big, remove all scalars from Small that are
// larger than MaxS.
auto MaxS = max_if(B.begin(), B.end(), isScalar, LT);
if (MaxS != B.end())
Changed |= berase_if(S, std::bind(LE, *MaxS, std::placeholders::_1));
// MinV = min vector in Small, remove all vectors from Big that are
// smaller-or-equal than MinV.
auto MinV = min_if(S.begin(), S.end(), isVector, LT);
if (MinV != S.end())
Changed |= berase_if(B, std::bind(LE, std::placeholders::_1, *MinV));
// MaxV = max vector in Big, remove all vectors from Small that are
// larger than MaxV.
auto MaxV = max_if(B.begin(), B.end(), isVector, LT);
if (MaxV != B.end())
Changed |= berase_if(S, std::bind(LE, *MaxV, std::placeholders::_1));
}
return Changed;
}
/// 1. Ensure that for each type T in Vec, T is a vector type, and that
/// for each type U in Elem, U is a scalar type.
/// 2. Ensure that for each (scalar) type U in Elem, there exists a (vector)
/// type T in Vec, such that U is the element type of T.
bool TypeInfer::EnforceVectorEltTypeIs(TypeSetByHwMode &Vec,
TypeSetByHwMode &Elem) {
ValidateOnExit _1(Vec, *this), _2(Elem, *this);
if (TP.hasError())
return false;
bool Changed = false;
if (Vec.empty())
Changed |= EnforceVector(Vec);
if (Elem.empty())
Changed |= EnforceScalar(Elem);
for (unsigned M : union_modes(Vec, Elem)) {
TypeSetByHwMode::SetType &V = Vec.get(M);
TypeSetByHwMode::SetType &E = Elem.get(M);
Changed |= berase_if(V, isScalar); // Scalar = !vector
Changed |= berase_if(E, isVector); // Vector = !scalar
assert(!V.empty() && !E.empty());
SmallSet<MVT,4> VT, ST;
// Collect element types from the "vector" set.
for (MVT T : V)
VT.insert(T.getVectorElementType());
// Collect scalar types from the "element" set.
for (MVT T : E)
ST.insert(T);
// Remove from V all (vector) types whose element type is not in S.
Changed |= berase_if(V, [&ST](MVT T) -> bool {
return !ST.count(T.getVectorElementType());
});
// Remove from E all (scalar) types, for which there is no corresponding
// type in V.
Changed |= berase_if(E, [&VT](MVT T) -> bool { return !VT.count(T); });
}
return Changed;
}
bool TypeInfer::EnforceVectorEltTypeIs(TypeSetByHwMode &Vec,
const ValueTypeByHwMode &VVT) {
TypeSetByHwMode Tmp(VVT);
ValidateOnExit _1(Vec, *this), _2(Tmp, *this);
return EnforceVectorEltTypeIs(Vec, Tmp);
}
/// Ensure that for each type T in Sub, T is a vector type, and there
/// exists a type U in Vec such that U is a vector type with the same
/// element type as T and at least as many elements as T.
bool TypeInfer::EnforceVectorSubVectorTypeIs(TypeSetByHwMode &Vec,
TypeSetByHwMode &Sub) {
ValidateOnExit _1(Vec, *this), _2(Sub, *this);
if (TP.hasError())
return false;
/// Return true if B is a suB-vector of P, i.e. P is a suPer-vector of B.
auto IsSubVec = [](MVT B, MVT P) -> bool {
if (!B.isVector() || !P.isVector())
return false;
// Logically a <4 x i32> is a valid subvector of <n x 4 x i32>
// but until there are obvious use-cases for this, keep the
// types separate.
if (B.isScalableVector() != P.isScalableVector())
return false;
if (B.getVectorElementType() != P.getVectorElementType())
return false;
return B.getVectorNumElements() < P.getVectorNumElements();
};
/// Return true if S has no element (vector type) that T is a sub-vector of,
/// i.e. has the same element type as T and more elements.
auto NoSubV = [&IsSubVec](const TypeSetByHwMode::SetType &S, MVT T) -> bool {
for (const auto &I : S)
if (IsSubVec(T, I))
return false;
return true;
};
/// Return true if S has no element (vector type) that T is a super-vector
/// of, i.e. has the same element type as T and fewer elements.
auto NoSupV = [&IsSubVec](const TypeSetByHwMode::SetType &S, MVT T) -> bool {
for (const auto &I : S)
if (IsSubVec(I, T))
return false;
return true;
};
bool Changed = false;
if (Vec.empty())
Changed |= EnforceVector(Vec);
if (Sub.empty())
Changed |= EnforceVector(Sub);
for (unsigned M : union_modes(Vec, Sub)) {
TypeSetByHwMode::SetType &S = Sub.get(M);
TypeSetByHwMode::SetType &V = Vec.get(M);
Changed |= berase_if(S, isScalar);
// Erase all types from S that are not sub-vectors of a type in V.
Changed |= berase_if(S, std::bind(NoSubV, V, std::placeholders::_1));
// Erase all types from V that are not super-vectors of a type in S.
Changed |= berase_if(V, std::bind(NoSupV, S, std::placeholders::_1));
}
return Changed;
}
/// 1. Ensure that V has a scalar type iff W has a scalar type.
/// 2. Ensure that for each vector type T in V, there exists a vector
/// type U in W, such that T and U have the same number of elements.
/// 3. Ensure that for each vector type U in W, there exists a vector
/// type T in V, such that T and U have the same number of elements
/// (reverse of 2).
bool TypeInfer::EnforceSameNumElts(TypeSetByHwMode &V, TypeSetByHwMode &W) {
ValidateOnExit _1(V, *this), _2(W, *this);
if (TP.hasError())
return false;
bool Changed = false;
if (V.empty())
Changed |= EnforceAny(V);
if (W.empty())
Changed |= EnforceAny(W);
// An actual vector type cannot have 0 elements, so we can treat scalars
// as zero-length vectors. This way both vectors and scalars can be
// processed identically.
auto NoLength = [](const SmallSet<unsigned,2> &Lengths, MVT T) -> bool {
return !Lengths.count(T.isVector() ? T.getVectorNumElements() : 0);
};
for (unsigned M : union_modes(V, W)) {
TypeSetByHwMode::SetType &VS = V.get(M);
TypeSetByHwMode::SetType &WS = W.get(M);
SmallSet<unsigned,2> VN, WN;
for (MVT T : VS)
VN.insert(T.isVector() ? T.getVectorNumElements() : 0);
for (MVT T : WS)
WN.insert(T.isVector() ? T.getVectorNumElements() : 0);
Changed |= berase_if(VS, std::bind(NoLength, WN, std::placeholders::_1));
Changed |= berase_if(WS, std::bind(NoLength, VN, std::placeholders::_1));
}
return Changed;
}
/// 1. Ensure that for each type T in A, there exists a type U in B,
/// such that T and U have equal size in bits.
/// 2. Ensure that for each type U in B, there exists a type T in A
/// such that T and U have equal size in bits (reverse of 1).
bool TypeInfer::EnforceSameSize(TypeSetByHwMode &A, TypeSetByHwMode &B) {
ValidateOnExit _1(A, *this), _2(B, *this);
if (TP.hasError())
return false;
bool Changed = false;
if (A.empty())
Changed |= EnforceAny(A);
if (B.empty())
Changed |= EnforceAny(B);
auto NoSize = [](const SmallSet<unsigned,2> &Sizes, MVT T) -> bool {
return !Sizes.count(T.getSizeInBits());
};
for (unsigned M : union_modes(A, B)) {
TypeSetByHwMode::SetType &AS = A.get(M);
TypeSetByHwMode::SetType &BS = B.get(M);
SmallSet<unsigned,2> AN, BN;
for (MVT T : AS)
AN.insert(T.getSizeInBits());
for (MVT T : BS)
BN.insert(T.getSizeInBits());
Changed |= berase_if(AS, std::bind(NoSize, BN, std::placeholders::_1));
Changed |= berase_if(BS, std::bind(NoSize, AN, std::placeholders::_1));
}
return Changed;
}
void TypeInfer::expandOverloads(TypeSetByHwMode &VTS) {
ValidateOnExit _1(VTS, *this);
TypeSetByHwMode Legal = getLegalTypes();
bool HaveLegalDef = Legal.hasDefault();
for (auto &I : VTS) {
unsigned M = I.first;
if (!Legal.hasMode(M) && !HaveLegalDef) {
TP.error("Invalid mode " + Twine(M));
return;
}
expandOverloads(I.second, Legal.get(M));
}
}
void TypeInfer::expandOverloads(TypeSetByHwMode::SetType &Out,
const TypeSetByHwMode::SetType &Legal) {
std::set<MVT> Ovs;
for (MVT T : Out) {
if (!T.isOverloaded())
continue;
Ovs.insert(T);
// MachineValueTypeSet allows iteration and erasing.
Out.erase(T);
}
for (MVT Ov : Ovs) {
switch (Ov.SimpleTy) {
case MVT::iPTRAny:
Out.insert(MVT::iPTR);
return;
case MVT::iAny:
for (MVT T : MVT::integer_valuetypes())
if (Legal.count(T))
Out.insert(T);
for (MVT T : MVT::integer_vector_valuetypes())
if (Legal.count(T))
Out.insert(T);
return;
case MVT::fAny:
for (MVT T : MVT::fp_valuetypes())
if (Legal.count(T))
Out.insert(T);
for (MVT T : MVT::fp_vector_valuetypes())
if (Legal.count(T))
Out.insert(T);
return;
case MVT::vAny:
for (MVT T : MVT::vector_valuetypes())
if (Legal.count(T))
Out.insert(T);
return;
case MVT::Any:
for (MVT T : MVT::all_valuetypes())
if (Legal.count(T))
Out.insert(T);
return;
default:
break;
}
}
}
TypeSetByHwMode TypeInfer::getLegalTypes() {
if (!LegalTypesCached) {
// Stuff all types from all modes into the default mode.
const TypeSetByHwMode <S = TP.getDAGPatterns().getLegalTypes();
for (const auto &I : LTS)
LegalCache.insert(I.second);
LegalTypesCached = true;
}
TypeSetByHwMode VTS;
VTS.getOrCreate(DefaultMode) = LegalCache;
return VTS;
}
#ifndef NDEBUG
TypeInfer::ValidateOnExit::~ValidateOnExit() {
if (!VTS.validate()) {
dbgs() << "Type set is empty for each HW mode:\n"
"possible type contradiction in the pattern below "
"(use -print-records with llvm-tblgen to see all "
"expanded records).\n";
Infer.TP.dump();
llvm_unreachable(nullptr);
}
}
#endif
//===----------------------------------------------------------------------===//
// TreePredicateFn Implementation
//===----------------------------------------------------------------------===//
/// TreePredicateFn constructor. Here 'N' is a subclass of PatFrag.
TreePredicateFn::TreePredicateFn(TreePattern *N) : PatFragRec(N) {
assert(
(!hasPredCode() || !hasImmCode()) &&
".td file corrupt: can't have a node predicate *and* an imm predicate");
}
bool TreePredicateFn::hasPredCode() const {
return isLoad() || isStore() || isAtomic() ||
!PatFragRec->getRecord()->getValueAsString("PredicateCode").empty();
}
std::string TreePredicateFn::getPredCode() const {
std::string Code = "";
if (!isLoad() && !isStore() && !isAtomic()) {
Record *MemoryVT = getMemoryVT();
if (MemoryVT)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"MemoryVT requires IsLoad or IsStore");
}
if (!isLoad() && !isStore()) {
if (isUnindexed())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsUnindexed requires IsLoad or IsStore");
Record *ScalarMemoryVT = getScalarMemoryVT();
if (ScalarMemoryVT)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"ScalarMemoryVT requires IsLoad or IsStore");
}
if (isLoad() + isStore() + isAtomic() > 1)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsLoad, IsStore, and IsAtomic are mutually exclusive");
if (isLoad()) {
if (!isUnindexed() && !isNonExtLoad() && !isAnyExtLoad() &&
!isSignExtLoad() && !isZeroExtLoad() && getMemoryVT() == nullptr &&
getScalarMemoryVT() == nullptr)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsLoad cannot be used by itself");
} else {
if (isNonExtLoad())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonExtLoad requires IsLoad");
if (isAnyExtLoad())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAnyExtLoad requires IsLoad");
if (isSignExtLoad())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsSignExtLoad requires IsLoad");
if (isZeroExtLoad())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsZeroExtLoad requires IsLoad");
}
if (isStore()) {
if (!isUnindexed() && !isTruncStore() && !isNonTruncStore() &&
getMemoryVT() == nullptr && getScalarMemoryVT() == nullptr)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsStore cannot be used by itself");
} else {
if (isNonTruncStore())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonTruncStore requires IsStore");
if (isTruncStore())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsTruncStore requires IsStore");
}
if (isAtomic()) {
if (getMemoryVT() == nullptr && !isAtomicOrderingMonotonic() &&
!isAtomicOrderingAcquire() && !isAtomicOrderingRelease() &&
!isAtomicOrderingAcquireRelease() &&
!isAtomicOrderingSequentiallyConsistent() &&
!isAtomicOrderingAcquireOrStronger() &&
!isAtomicOrderingReleaseOrStronger() &&
!isAtomicOrderingWeakerThanAcquire() &&
!isAtomicOrderingWeakerThanRelease())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomic cannot be used by itself");
} else {
if (isAtomicOrderingMonotonic())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingMonotonic requires IsAtomic");
if (isAtomicOrderingAcquire())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingAcquire requires IsAtomic");
if (isAtomicOrderingRelease())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingRelease requires IsAtomic");
if (isAtomicOrderingAcquireRelease())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingAcquireRelease requires IsAtomic");
if (isAtomicOrderingSequentiallyConsistent())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingSequentiallyConsistent requires IsAtomic");
if (isAtomicOrderingAcquireOrStronger())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingAcquireOrStronger requires IsAtomic");
if (isAtomicOrderingReleaseOrStronger())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingReleaseOrStronger requires IsAtomic");
if (isAtomicOrderingWeakerThanAcquire())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAtomicOrderingWeakerThanAcquire requires IsAtomic");
}
if (isLoad() || isStore() || isAtomic()) {
StringRef SDNodeName =
isLoad() ? "LoadSDNode" : isStore() ? "StoreSDNode" : "AtomicSDNode";
Record *MemoryVT = getMemoryVT();
if (MemoryVT)
Code += ("if (cast<" + SDNodeName + ">(N)->getMemoryVT() != MVT::" +
MemoryVT->getName() + ") return false;\n")
.str();
}
if (isAtomic() && isAtomicOrderingMonotonic())
Code += "if (cast<AtomicSDNode>(N)->getOrdering() != "
"AtomicOrdering::Monotonic) return false;\n";
if (isAtomic() && isAtomicOrderingAcquire())
Code += "if (cast<AtomicSDNode>(N)->getOrdering() != "
"AtomicOrdering::Acquire) return false;\n";
if (isAtomic() && isAtomicOrderingRelease())
Code += "if (cast<AtomicSDNode>(N)->getOrdering() != "
"AtomicOrdering::Release) return false;\n";
if (isAtomic() && isAtomicOrderingAcquireRelease())
Code += "if (cast<AtomicSDNode>(N)->getOrdering() != "
"AtomicOrdering::AcquireRelease) return false;\n";
if (isAtomic() && isAtomicOrderingSequentiallyConsistent())
Code += "if (cast<AtomicSDNode>(N)->getOrdering() != "
"AtomicOrdering::SequentiallyConsistent) return false;\n";
if (isAtomic() && isAtomicOrderingAcquireOrStronger())
Code += "if (!isAcquireOrStronger(cast<AtomicSDNode>(N)->getOrdering())) "
"return false;\n";
if (isAtomic() && isAtomicOrderingWeakerThanAcquire())
Code += "if (isAcquireOrStronger(cast<AtomicSDNode>(N)->getOrdering())) "
"return false;\n";
if (isAtomic() && isAtomicOrderingReleaseOrStronger())
Code += "if (!isReleaseOrStronger(cast<AtomicSDNode>(N)->getOrdering())) "
"return false;\n";
if (isAtomic() && isAtomicOrderingWeakerThanRelease())
Code += "if (isReleaseOrStronger(cast<AtomicSDNode>(N)->getOrdering())) "
"return false;\n";
if (isLoad() || isStore()) {
StringRef SDNodeName = isLoad() ? "LoadSDNode" : "StoreSDNode";
if (isUnindexed())
Code += ("if (cast<" + SDNodeName +
">(N)->getAddressingMode() != ISD::UNINDEXED) "
"return false;\n")
.str();
if (isLoad()) {
if ((isNonExtLoad() + isAnyExtLoad() + isSignExtLoad() +
isZeroExtLoad()) > 1)
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonExtLoad, IsAnyExtLoad, IsSignExtLoad, and "
"IsZeroExtLoad are mutually exclusive");
if (isNonExtLoad())
Code += "if (cast<LoadSDNode>(N)->getExtensionType() != "
"ISD::NON_EXTLOAD) return false;\n";
if (isAnyExtLoad())
Code += "if (cast<LoadSDNode>(N)->getExtensionType() != ISD::EXTLOAD) "
"return false;\n";
if (isSignExtLoad())
Code += "if (cast<LoadSDNode>(N)->getExtensionType() != ISD::SEXTLOAD) "
"return false;\n";
if (isZeroExtLoad())
Code += "if (cast<LoadSDNode>(N)->getExtensionType() != ISD::ZEXTLOAD) "
"return false;\n";
} else {
if ((isNonTruncStore() + isTruncStore()) > 1)
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonTruncStore, and IsTruncStore are mutually exclusive");
if (isNonTruncStore())
Code +=
" if (cast<StoreSDNode>(N)->isTruncatingStore()) return false;\n";
if (isTruncStore())
Code +=
" if (!cast<StoreSDNode>(N)->isTruncatingStore()) return false;\n";
}
Record *ScalarMemoryVT = getScalarMemoryVT();
if (ScalarMemoryVT)
Code += ("if (cast<" + SDNodeName +
">(N)->getMemoryVT().getScalarType() != MVT::" +
ScalarMemoryVT->getName() + ") return false;\n")
.str();
}
std::string PredicateCode = PatFragRec->getRecord()->getValueAsString("PredicateCode");
Code += PredicateCode;
if (PredicateCode.empty() && !Code.empty())
Code += "return true;\n";
return Code;
}
bool TreePredicateFn::hasImmCode() const {
return !PatFragRec->getRecord()->getValueAsString("ImmediateCode").empty();
}
std::string TreePredicateFn::getImmCode() const {
return PatFragRec->getRecord()->getValueAsString("ImmediateCode");
}
bool TreePredicateFn::immCodeUsesAPInt() const {
return getOrigPatFragRecord()->getRecord()->getValueAsBit("IsAPInt");
}
bool TreePredicateFn::immCodeUsesAPFloat() const {
bool Unset;
// The return value will be false when IsAPFloat is unset.
return getOrigPatFragRecord()->getRecord()->getValueAsBitOrUnset("IsAPFloat",
Unset);
}
bool TreePredicateFn::isPredefinedPredicateEqualTo(StringRef Field,
bool Value) const {
bool Unset;
bool Result =
getOrigPatFragRecord()->getRecord()->getValueAsBitOrUnset(Field, Unset);
if (Unset)
return false;
return Result == Value;
}
bool TreePredicateFn::isLoad() const {
return isPredefinedPredicateEqualTo("IsLoad", true);
}
bool TreePredicateFn::isStore() const {
return isPredefinedPredicateEqualTo("IsStore", true);
}
bool TreePredicateFn::isAtomic() const {
return isPredefinedPredicateEqualTo("IsAtomic", true);
}
bool TreePredicateFn::isUnindexed() const {
return isPredefinedPredicateEqualTo("IsUnindexed", true);
}
bool TreePredicateFn::isNonExtLoad() const {
return isPredefinedPredicateEqualTo("IsNonExtLoad", true);
}
bool TreePredicateFn::isAnyExtLoad() const {
return isPredefinedPredicateEqualTo("IsAnyExtLoad", true);
}
bool TreePredicateFn::isSignExtLoad() const {
return isPredefinedPredicateEqualTo("IsSignExtLoad", true);
}
bool TreePredicateFn::isZeroExtLoad() const {
return isPredefinedPredicateEqualTo("IsZeroExtLoad", true);
}
bool TreePredicateFn::isNonTruncStore() const {
return isPredefinedPredicateEqualTo("IsTruncStore", false);
}
bool TreePredicateFn::isTruncStore() const {
return isPredefinedPredicateEqualTo("IsTruncStore", true);
}
bool TreePredicateFn::isAtomicOrderingMonotonic() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingMonotonic", true);
}
bool TreePredicateFn::isAtomicOrderingAcquire() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingAcquire", true);
}
bool TreePredicateFn::isAtomicOrderingRelease() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingRelease", true);
}
bool TreePredicateFn::isAtomicOrderingAcquireRelease() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingAcquireRelease", true);
}
bool TreePredicateFn::isAtomicOrderingSequentiallyConsistent() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingSequentiallyConsistent",
true);
}
bool TreePredicateFn::isAtomicOrderingAcquireOrStronger() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingAcquireOrStronger", true);
}
bool TreePredicateFn::isAtomicOrderingWeakerThanAcquire() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingAcquireOrStronger", false);
}
bool TreePredicateFn::isAtomicOrderingReleaseOrStronger() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingReleaseOrStronger", true);
}
bool TreePredicateFn::isAtomicOrderingWeakerThanRelease() const {
return isPredefinedPredicateEqualTo("IsAtomicOrderingReleaseOrStronger", false);
}
Record *TreePredicateFn::getMemoryVT() const {
Record *R = getOrigPatFragRecord()->getRecord();
if (R->isValueUnset("MemoryVT"))
return nullptr;
return R->getValueAsDef("MemoryVT");
}
Record *TreePredicateFn::getScalarMemoryVT() const {
Record *R = getOrigPatFragRecord()->getRecord();
if (R->isValueUnset("ScalarMemoryVT"))
return nullptr;
return R->getValueAsDef("ScalarMemoryVT");
}
StringRef TreePredicateFn::getImmType() const {
if (immCodeUsesAPInt())
return "const APInt &";
if (immCodeUsesAPFloat())
return "const APFloat &";
return "int64_t";
}
StringRef TreePredicateFn::getImmTypeIdentifier() const {
if (immCodeUsesAPInt())
return "APInt";
else if (immCodeUsesAPFloat())
return "APFloat";
return "I64";
}
/// isAlwaysTrue - Return true if this is a noop predicate.
bool TreePredicateFn::isAlwaysTrue() const {
return !hasPredCode() && !hasImmCode();
}
/// Return the name to use in the generated code to reference this, this is
/// "Predicate_foo" if from a pattern fragment "foo".
std::string TreePredicateFn::getFnName() const {
return "Predicate_" + PatFragRec->getRecord()->getName().str();
}
/// getCodeToRunOnSDNode - Return the code for the function body that
/// evaluates this predicate. The argument is expected to be in "Node",
/// not N. This handles casting and conversion to a concrete node type as
/// appropriate.
std::string TreePredicateFn::getCodeToRunOnSDNode() const {
// Handle immediate predicates first.
std::string ImmCode = getImmCode();
if (!ImmCode.empty()) {
if (isLoad())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsLoad cannot be used with ImmLeaf or its subclasses");
if (isStore())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"IsStore cannot be used with ImmLeaf or its subclasses");
if (isUnindexed())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsUnindexed cannot be used with ImmLeaf or its subclasses");
if (isNonExtLoad())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonExtLoad cannot be used with ImmLeaf or its subclasses");
if (isAnyExtLoad())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsAnyExtLoad cannot be used with ImmLeaf or its subclasses");
if (isSignExtLoad())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsSignExtLoad cannot be used with ImmLeaf or its subclasses");
if (isZeroExtLoad())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsZeroExtLoad cannot be used with ImmLeaf or its subclasses");
if (isNonTruncStore())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsNonTruncStore cannot be used with ImmLeaf or its subclasses");
if (isTruncStore())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"IsTruncStore cannot be used with ImmLeaf or its subclasses");
if (getMemoryVT())
PrintFatalError(getOrigPatFragRecord()->getRecord()->getLoc(),
"MemoryVT cannot be used with ImmLeaf or its subclasses");
if (getScalarMemoryVT())
PrintFatalError(
getOrigPatFragRecord()->getRecord()->getLoc(),
"ScalarMemoryVT cannot be used with ImmLeaf or its subclasses");
std::string Result = (" " + getImmType() + " Imm = ").str();
if (immCodeUsesAPFloat())
Result += "cast<ConstantFPSDNode>(Node)->getValueAPF();\n";
else if (immCodeUsesAPInt())
Result += "cast<ConstantSDNode>(Node)->getAPIntValue();\n";
else
Result += "cast<ConstantSDNode>(Node)->getSExtValue();\n";
return Result + ImmCode;
}
// Handle arbitrary node predicates.
assert(hasPredCode() && "Don't have any predicate code!");
StringRef ClassName;
if (PatFragRec->getOnlyTree()->isLeaf())
ClassName = "SDNode";
else {
Record *Op = PatFragRec->getOnlyTree()->getOperator();
ClassName = PatFragRec->getDAGPatterns().getSDNodeInfo(Op).getSDClassName();
}
std::string Result;
if (ClassName == "SDNode")
Result = " SDNode *N = Node;\n";
else
Result = " auto *N = cast<" + ClassName.str() + ">(Node);\n";
return Result + getPredCode();
}
//===----------------------------------------------------------------------===//
// PatternToMatch implementation
//
/// getPatternSize - Return the 'size' of this pattern. We want to match large
/// patterns before small ones. This is used to determine the size of a
/// pattern.
static unsigned getPatternSize(const TreePatternNode *P,
const CodeGenDAGPatterns &CGP) {
unsigned Size = 3; // The node itself.
// If the root node is a ConstantSDNode, increases its size.
// e.g. (set R32:$dst, 0).
if (P->isLeaf() && isa<IntInit>(P->getLeafValue()))
Size += 2;
if (const ComplexPattern *AM = P->getComplexPatternInfo(CGP)) {
Size += AM->getComplexity();
// We don't want to count any children twice, so return early.
return Size;
}
// If this node has some predicate function that must match, it adds to the
// complexity of this node.
if (!P->getPredicateFns().empty())
++Size;
// Count children in the count if they are also nodes.
for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i) {
const TreePatternNode *Child = P->getChild(i);
if (!Child->isLeaf() && Child->getNumTypes()) {
const TypeSetByHwMode &T0 = Child->getType(0);
// At this point, all variable type sets should be simple, i.e. only
// have a default mode.
if (T0.getMachineValueType() != MVT::Other) {
Size += getPatternSize(Child, CGP);
continue;
}
}
if (Child->isLeaf()) {
if (isa<IntInit>(Child->getLeafValue()))
Size += 5; // Matches a ConstantSDNode (+3) and a specific value (+2).
else if (Child->getComplexPatternInfo(CGP))
Size += getPatternSize(Child, CGP);
else if (!Child->getPredicateFns().empty())
++Size;
}
}
return Size;
}
/// Compute the complexity metric for the input pattern. This roughly
/// corresponds to the number of nodes that are covered.
int PatternToMatch::
getPatternComplexity(const CodeGenDAGPatterns &CGP) const {
return getPatternSize(getSrcPattern(), CGP) + getAddedComplexity();
}
/// getPredicateCheck - Return a single string containing all of this
/// pattern's predicates concatenated with "&&" operators.
///
std::string PatternToMatch::getPredicateCheck() const {
SmallVector<const Predicate*,4> PredList;
for (const Predicate &P : Predicates)
PredList.push_back(&P);
llvm::sort(PredList.begin(), PredList.end(), deref<llvm::less>());
std::string Check;
for (unsigned i = 0, e = PredList.size(); i != e; ++i) {
if (i != 0)
Check += " && ";
Check += '(' + PredList[i]->getCondString() + ')';
}
return Check;
}
//===----------------------------------------------------------------------===//
// SDTypeConstraint implementation
//
SDTypeConstraint::SDTypeConstraint(Record *R, const CodeGenHwModes &CGH) {
OperandNo = R->getValueAsInt("OperandNum");
if (R->isSubClassOf("SDTCisVT")) {
ConstraintType = SDTCisVT;
VVT = getValueTypeByHwMode(R->getValueAsDef("VT"), CGH);
for (const auto &P : VVT)
if (P.second == MVT::isVoid)
PrintFatalError(R->getLoc(), "Cannot use 'Void' as type to SDTCisVT");
} else if (R->isSubClassOf("SDTCisPtrTy")) {
ConstraintType = SDTCisPtrTy;
} else if (R->isSubClassOf("SDTCisInt")) {
ConstraintType = SDTCisInt;
} else if (R->isSubClassOf("SDTCisFP")) {
ConstraintType = SDTCisFP;
} else if (R->isSubClassOf("SDTCisVec")) {
ConstraintType = SDTCisVec;
} else if (R->isSubClassOf("SDTCisSameAs")) {
ConstraintType = SDTCisSameAs;
x.SDTCisSameAs_Info.OtherOperandNum = R->getValueAsInt("OtherOperandNum");
} else if (R->isSubClassOf("SDTCisVTSmallerThanOp")) {
ConstraintType = SDTCisVTSmallerThanOp;
x.SDTCisVTSmallerThanOp_Info.OtherOperandNum =
R->getValueAsInt("OtherOperandNum");
} else if (R->isSubClassOf("SDTCisOpSmallerThanOp")) {
ConstraintType = SDTCisOpSmallerThanOp;
x.SDTCisOpSmallerThanOp_Info.BigOperandNum =
R->getValueAsInt("BigOperandNum");
} else if (R->isSubClassOf("SDTCisEltOfVec")) {
ConstraintType = SDTCisEltOfVec;
x.SDTCisEltOfVec_Info.OtherOperandNum = R->getValueAsInt("OtherOpNum");
} else if (R->isSubClassOf("SDTCisSubVecOfVec")) {
ConstraintType = SDTCisSubVecOfVec;
x.SDTCisSubVecOfVec_Info.OtherOperandNum =
R->getValueAsInt("OtherOpNum");
} else if (R->isSubClassOf("SDTCVecEltisVT")) {
ConstraintType = SDTCVecEltisVT;
VVT = getValueTypeByHwMode(R->getValueAsDef("VT"), CGH);
for (const auto &P : VVT) {
MVT T = P.second;
if (T.isVector())
PrintFatalError(R->getLoc(),
"Cannot use vector type as SDTCVecEltisVT");
if (!T.isInteger() && !T.isFloatingPoint())
PrintFatalError(R->getLoc(), "Must use integer or floating point type "
"as SDTCVecEltisVT");
}
} else if (R->isSubClassOf("SDTCisSameNumEltsAs")) {
ConstraintType = SDTCisSameNumEltsAs;
x.SDTCisSameNumEltsAs_Info.OtherOperandNum =
R->getValueAsInt("OtherOperandNum");
} else if (R->isSubClassOf("SDTCisSameSizeAs")) {
ConstraintType = SDTCisSameSizeAs;
x.SDTCisSameSizeAs_Info.OtherOperandNum =
R->getValueAsInt("OtherOperandNum");
} else {
PrintFatalError("Unrecognized SDTypeConstraint '" + R->getName() + "'!\n");
}
}
/// getOperandNum - Return the node corresponding to operand #OpNo in tree
/// N, and the result number in ResNo.
static TreePatternNode *getOperandNum(unsigned OpNo, TreePatternNode *N,
const SDNodeInfo &NodeInfo,
unsigned &ResNo) {
unsigned NumResults = NodeInfo.getNumResults();
if (OpNo < NumResults) {
ResNo = OpNo;
return N;
}
OpNo -= NumResults;
if (OpNo >= N->getNumChildren()) {
std::string S;
raw_string_ostream OS(S);
OS << "Invalid operand number in type constraint "
<< (OpNo+NumResults) << " ";
N->print(OS);
PrintFatalError(OS.str());
}
return N->getChild(OpNo);
}
/// ApplyTypeConstraint - Given a node in a pattern, apply this type
/// constraint to the nodes operands. This returns true if it makes a
/// change, false otherwise. If a type contradiction is found, flag an error.
bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
const SDNodeInfo &NodeInfo,
TreePattern &TP) const {
if (TP.hasError())
return false;
unsigned ResNo = 0; // The result number being referenced.
TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NodeInfo, ResNo);
TypeInfer &TI = TP.getInfer();
switch (ConstraintType) {
case SDTCisVT:
// Operand must be a particular type.
return NodeToApply->UpdateNodeType(ResNo, VVT, TP);
case SDTCisPtrTy:
// Operand must be same as target pointer type.
return NodeToApply->UpdateNodeType(ResNo, MVT::iPTR, TP);
case SDTCisInt:
// Require it to be one of the legal integer VTs.
return TI.EnforceInteger(NodeToApply->getExtType(ResNo));
case SDTCisFP:
// Require it to be one of the legal fp VTs.
return TI.EnforceFloatingPoint(NodeToApply->getExtType(ResNo));
case SDTCisVec:
// Require it to be one of the legal vector VTs.
return TI.EnforceVector(NodeToApply->getExtType(ResNo));
case SDTCisSameAs: {
unsigned OResNo = 0;
TreePatternNode *OtherNode =
getOperandNum(x.SDTCisSameAs_Info.OtherOperandNum, N, NodeInfo, OResNo);
return NodeToApply->UpdateNodeType(ResNo, OtherNode->getExtType(OResNo),TP)|
OtherNode->UpdateNodeType(OResNo,NodeToApply->getExtType(ResNo),TP);
}
case SDTCisVTSmallerThanOp: {
// The NodeToApply must be a leaf node that is a VT. OtherOperandNum must
// have an integer type that is smaller than the VT.
if (!NodeToApply->isLeaf() ||
!isa<DefInit>(NodeToApply->getLeafValue()) ||
!static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()
->isSubClassOf("ValueType")) {
TP.error(N->getOperator()->getName() + " expects a VT operand!");
return false;
}
DefInit *DI = static_cast<DefInit*>(NodeToApply->getLeafValue());
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
auto VVT = getValueTypeByHwMode(DI->getDef(), T.getHwModes());
TypeSetByHwMode TypeListTmp(VVT);
unsigned OResNo = 0;
TreePatternNode *OtherNode =
getOperandNum(x.SDTCisVTSmallerThanOp_Info.OtherOperandNum, N, NodeInfo,
OResNo);
return TI.EnforceSmallerThan(TypeListTmp, OtherNode->getExtType(OResNo));
}
case SDTCisOpSmallerThanOp: {
unsigned BResNo = 0;
TreePatternNode *BigOperand =
getOperandNum(x.SDTCisOpSmallerThanOp_Info.BigOperandNum, N, NodeInfo,
BResNo);
return TI.EnforceSmallerThan(NodeToApply->getExtType(ResNo),
BigOperand->getExtType(BResNo));
}
case SDTCisEltOfVec: {
unsigned VResNo = 0;
TreePatternNode *VecOperand =
getOperandNum(x.SDTCisEltOfVec_Info.OtherOperandNum, N, NodeInfo,
VResNo);
// Filter vector types out of VecOperand that don't have the right element
// type.
return TI.EnforceVectorEltTypeIs(VecOperand->getExtType(VResNo),
NodeToApply->getExtType(ResNo));
}
case SDTCisSubVecOfVec: {
unsigned VResNo = 0;
TreePatternNode *BigVecOperand =
getOperandNum(x.SDTCisSubVecOfVec_Info.OtherOperandNum, N, NodeInfo,
VResNo);
// Filter vector types out of BigVecOperand that don't have the
// right subvector type.
return TI.EnforceVectorSubVectorTypeIs(BigVecOperand->getExtType(VResNo),
NodeToApply->getExtType(ResNo));
}
case SDTCVecEltisVT: {
return TI.EnforceVectorEltTypeIs(NodeToApply->getExtType(ResNo), VVT);
}
case SDTCisSameNumEltsAs: {
unsigned OResNo = 0;
TreePatternNode *OtherNode =
getOperandNum(x.SDTCisSameNumEltsAs_Info.OtherOperandNum,
N, NodeInfo, OResNo);
return TI.EnforceSameNumElts(OtherNode->getExtType(OResNo),
NodeToApply->getExtType(ResNo));
}
case SDTCisSameSizeAs: {
unsigned OResNo = 0;
TreePatternNode *OtherNode =
getOperandNum(x.SDTCisSameSizeAs_Info.OtherOperandNum,
N, NodeInfo, OResNo);
return TI.EnforceSameSize(OtherNode->getExtType(OResNo),
NodeToApply->getExtType(ResNo));
}
}
llvm_unreachable("Invalid ConstraintType!");
}
// Update the node type to match an instruction operand or result as specified
// in the ins or outs lists on the instruction definition. Return true if the
// type was actually changed.
bool TreePatternNode::UpdateNodeTypeFromInst(unsigned ResNo,
Record *Operand,
TreePattern &TP) {
// The 'unknown' operand indicates that types should be inferred from the
// context.
if (Operand->isSubClassOf("unknown_class"))
return false;
// The Operand class specifies a type directly.
if (Operand->isSubClassOf("Operand")) {
Record *R = Operand->getValueAsDef("Type");
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
return UpdateNodeType(ResNo, getValueTypeByHwMode(R, T.getHwModes()), TP);
}
// PointerLikeRegClass has a type that is determined at runtime.
if (Operand->isSubClassOf("PointerLikeRegClass"))
return UpdateNodeType(ResNo, MVT::iPTR, TP);
// Both RegisterClass and RegisterOperand operands derive their types from a
// register class def.
Record *RC = nullptr;
if (Operand->isSubClassOf("RegisterClass"))
RC = Operand;
else if (Operand->isSubClassOf("RegisterOperand"))
RC = Operand->getValueAsDef("RegClass");
assert(RC && "Unknown operand type");
CodeGenTarget &Tgt = TP.getDAGPatterns().getTargetInfo();
return UpdateNodeType(ResNo, Tgt.getRegisterClass(RC).getValueTypes(), TP);
}
bool TreePatternNode::ContainsUnresolvedType(TreePattern &TP) const {
for (unsigned i = 0, e = Types.size(); i != e; ++i)
if (!TP.getInfer().isConcrete(Types[i], true))
return true;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
if (getChild(i)->ContainsUnresolvedType(TP))
return true;
return false;
}
bool TreePatternNode::hasProperTypeByHwMode() const {
for (const TypeSetByHwMode &S : Types)
if (!S.isDefaultOnly())
return true;
for (const TreePatternNodePtr &C : Children)
if (C->hasProperTypeByHwMode())
return true;
return false;
}
bool TreePatternNode::hasPossibleType() const {
for (const TypeSetByHwMode &S : Types)
if (!S.isPossible())
return false;
for (const TreePatternNodePtr &C : Children)
if (!C->hasPossibleType())
return false;
return true;
}
bool TreePatternNode::setDefaultMode(unsigned Mode) {
for (TypeSetByHwMode &S : Types) {
S.makeSimple(Mode);
// Check if the selected mode had a type conflict.
if (S.get(DefaultMode).empty())
return false;
}
for (const TreePatternNodePtr &C : Children)
if (!C->setDefaultMode(Mode))
return false;
return true;
}
//===----------------------------------------------------------------------===//
// SDNodeInfo implementation
//
SDNodeInfo::SDNodeInfo(Record *R, const CodeGenHwModes &CGH) : Def(R) {
EnumName = R->getValueAsString("Opcode");
SDClassName = R->getValueAsString("SDClass");
Record *TypeProfile = R->getValueAsDef("TypeProfile");
NumResults = TypeProfile->getValueAsInt("NumResults");
NumOperands = TypeProfile->getValueAsInt("NumOperands");
// Parse the properties.
Properties = parseSDPatternOperatorProperties(R);
// Parse the type constraints.
std::vector<Record*> ConstraintList =
TypeProfile->getValueAsListOfDefs("Constraints");
for (Record *R : ConstraintList)
TypeConstraints.emplace_back(R, CGH);
}
/// getKnownType - If the type constraints on this node imply a fixed type
/// (e.g. all stores return void, etc), then return it as an
/// MVT::SimpleValueType. Otherwise, return EEVT::Other.
MVT::SimpleValueType SDNodeInfo::getKnownType(unsigned ResNo) const {
unsigned NumResults = getNumResults();
assert(NumResults <= 1 &&
"We only work with nodes with zero or one result so far!");
assert(ResNo == 0 && "Only handles single result nodes so far");
for (const SDTypeConstraint &Constraint : TypeConstraints) {
// Make sure that this applies to the correct node result.
if (Constraint.OperandNo >= NumResults) // FIXME: need value #
continue;
switch (Constraint.ConstraintType) {
default: break;
case SDTypeConstraint::SDTCisVT:
if (Constraint.VVT.isSimple())
return Constraint.VVT.getSimple().SimpleTy;
break;
case SDTypeConstraint::SDTCisPtrTy:
return MVT::iPTR;
}
}
return MVT::Other;
}
//===----------------------------------------------------------------------===//
// TreePatternNode implementation
//
static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) {
if (Operator->getName() == "set" ||
Operator->getName() == "implicit")
return 0; // All return nothing.
if (Operator->isSubClassOf("Intrinsic"))
return CDP.getIntrinsic(Operator).IS.RetVTs.size();
if (Operator->isSubClassOf("SDNode"))
return CDP.getSDNodeInfo(Operator).getNumResults();
if (Operator->isSubClassOf("PatFrag")) {
// If we've already parsed this pattern fragment, get it. Otherwise, handle
// the forward reference case where one pattern fragment references another
// before it is processed.
if (TreePattern *PFRec = CDP.getPatternFragmentIfRead(Operator))
return PFRec->getOnlyTree()->getNumTypes();
// Get the result tree.
DagInit *Tree = Operator->getValueAsDag("Fragment");
Record *Op = nullptr;
if (Tree)
if (DefInit *DI = dyn_cast<DefInit>(Tree->getOperator()))
Op = DI->getDef();
assert(Op && "Invalid Fragment");
return GetNumNodeResults(Op, CDP);
}
if (Operator->isSubClassOf("Instruction")) {
CodeGenInstruction &InstInfo = CDP.getTargetInfo().getInstruction(Operator);
unsigned NumDefsToAdd = InstInfo.Operands.NumDefs;
// Subtract any defaulted outputs.
for (unsigned i = 0; i != InstInfo.Operands.NumDefs; ++i) {
Record *OperandNode = InstInfo.Operands[i].Rec;
if (OperandNode->isSubClassOf("OperandWithDefaultOps") &&
!CDP.getDefaultOperand(OperandNode).DefaultOps.empty())
--NumDefsToAdd;
}
// Add on one implicit def if it has a resolvable type.
if (InstInfo.HasOneImplicitDefWithKnownVT(CDP.getTargetInfo()) !=MVT::Other)
++NumDefsToAdd;
return NumDefsToAdd;
}
if (Operator->isSubClassOf("SDNodeXForm"))
return 1; // FIXME: Generalize SDNodeXForm
if (Operator->isSubClassOf("ValueType"))
return 1; // A type-cast of one result.
if (Operator->isSubClassOf("ComplexPattern"))
return 1;
errs() << *Operator;
PrintFatalError("Unhandled node in GetNumNodeResults");
}
void TreePatternNode::print(raw_ostream &OS) const {
if (isLeaf())
OS << *getLeafValue();
else
OS << '(' << getOperator()->getName();
for (unsigned i = 0, e = Types.size(); i != e; ++i) {
OS << ':';
getExtType(i).writeToStream(OS);
}
if (!isLeaf()) {
if (getNumChildren() != 0) {
OS << " ";
getChild(0)->print(OS);
for (unsigned i = 1, e = getNumChildren(); i != e; ++i) {
OS << ", ";
getChild(i)->print(OS);
}
}
OS << ")";
}
for (const TreePredicateFn &Pred : PredicateFns)
OS << "<<P:" << Pred.getFnName() << ">>";
if (TransformFn)
OS << "<<X:" << TransformFn->getName() << ">>";
if (!getName().empty())
OS << ":$" << getName();
}
void TreePatternNode::dump() const {
print(errs());
}
/// isIsomorphicTo - Return true if this node is recursively
/// isomorphic to the specified node. For this comparison, the node's
/// entire state is considered. The assigned name is ignored, since
/// nodes with differing names are considered isomorphic. However, if
/// the assigned name is present in the dependent variable set, then
/// the assigned name is considered significant and the node is
/// isomorphic if the names match.
bool TreePatternNode::isIsomorphicTo(const TreePatternNode *N,
const MultipleUseVarSet &DepVars) const {
if (N == this) return true;
if (N->isLeaf() != isLeaf() || getExtTypes() != N->getExtTypes() ||
getPredicateFns() != N->getPredicateFns() ||
getTransformFn() != N->getTransformFn())
return false;
if (isLeaf()) {
if (DefInit *DI = dyn_cast<DefInit>(getLeafValue())) {
if (DefInit *NDI = dyn_cast<DefInit>(N->getLeafValue())) {
return ((DI->getDef() == NDI->getDef())
&& (DepVars.find(getName()) == DepVars.end()
|| getName() == N->getName()));
}
}
return getLeafValue() == N->getLeafValue();
}
if (N->getOperator() != getOperator() ||
N->getNumChildren() != getNumChildren()) return false;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
if (!getChild(i)->isIsomorphicTo(N->getChild(i), DepVars))
return false;
return true;
}
/// clone - Make a copy of this tree and all of its children.
///
TreePatternNodePtr TreePatternNode::clone() const {
TreePatternNodePtr New;
if (isLeaf()) {
New = std::make_shared<TreePatternNode>(getLeafValue(), getNumTypes());
} else {
std::vector<TreePatternNodePtr> CChildren;
CChildren.reserve(Children.size());
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
CChildren.push_back(getChild(i)->clone());
New = std::make_shared<TreePatternNode>(getOperator(), CChildren,
getNumTypes());
}
New->setName(getName());
New->Types = Types;
New->setPredicateFns(getPredicateFns());
New->setTransformFn(getTransformFn());
return New;
}
/// RemoveAllTypes - Recursively strip all the types of this tree.
void TreePatternNode::RemoveAllTypes() {
// Reset to unknown type.
std::fill(Types.begin(), Types.end(), TypeSetByHwMode());
if (isLeaf()) return;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
getChild(i)->RemoveAllTypes();
}
/// SubstituteFormalArguments - Replace the formal arguments in this tree
/// with actual values specified by ArgMap.
void TreePatternNode::SubstituteFormalArguments(
std::map<std::string, TreePatternNodePtr> &ArgMap) {
if (isLeaf()) return;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i) {
TreePatternNode *Child = getChild(i);
if (Child->isLeaf()) {
Init *Val = Child->getLeafValue();
// Note that, when substituting into an output pattern, Val might be an
// UnsetInit.
if (isa<UnsetInit>(Val) || (isa<DefInit>(Val) &&
cast<DefInit>(Val)->getDef()->getName() == "node")) {
// We found a use of a formal argument, replace it with its value.
TreePatternNodePtr NewChild = ArgMap[Child->getName()];
assert(NewChild && "Couldn't find formal argument!");
assert((Child->getPredicateFns().empty() ||
NewChild->getPredicateFns() == Child->getPredicateFns()) &&
"Non-empty child predicate clobbered!");
setChild(i, std::move(NewChild));
}
} else {
getChild(i)->SubstituteFormalArguments(ArgMap);
}
}
}
/// InlinePatternFragments - If this pattern refers to any pattern
/// fragments, inline them into place, giving us a pattern without any
/// PatFrag references.
TreePatternNodePtr TreePatternNode::InlinePatternFragments(TreePatternNodePtr T,
TreePattern &TP) {
if (TP.hasError())
return nullptr;
if (isLeaf())
return T; // nothing to do.
Record *Op = getOperator();
if (!Op->isSubClassOf("PatFrag")) {
// Just recursively inline children nodes.
for (unsigned i = 0, e = getNumChildren(); i != e; ++i) {
TreePatternNodePtr Child = getChildShared(i);
TreePatternNodePtr NewChild = Child->InlinePatternFragments(Child, TP);
assert((Child->getPredicateFns().empty() ||
NewChild->getPredicateFns() == Child->getPredicateFns()) &&
"Non-empty child predicate clobbered!");
setChild(i, std::move(NewChild));
}
return T;
}
// Otherwise, we found a reference to a fragment. First, look up its
// TreePattern record.
TreePattern *Frag = TP.getDAGPatterns().getPatternFragment(Op);
// Verify that we are passing the right number of operands.
if (Frag->getNumArgs() != Children.size()) {
TP.error("'" + Op->getName() + "' fragment requires " +
Twine(Frag->getNumArgs()) + " operands!");
return {nullptr};
}
TreePatternNodePtr FragTree = Frag->getOnlyTree()->clone();
TreePredicateFn PredFn(Frag);
if (!PredFn.isAlwaysTrue())
FragTree->addPredicateFn(PredFn);
// Resolve formal arguments to their actual value.
if (Frag->getNumArgs()) {
// Compute the map of formal to actual arguments.
std::map<std::string, TreePatternNodePtr> ArgMap;
for (unsigned i = 0, e = Frag->getNumArgs(); i != e; ++i) {
const TreePatternNodePtr &Child = getChildShared(i);
ArgMap[Frag->getArgName(i)] = Child->InlinePatternFragments(Child, TP);
}
FragTree->SubstituteFormalArguments(ArgMap);
}
FragTree->setName(getName());
for (unsigned i = 0, e = Types.size(); i != e; ++i)
FragTree->UpdateNodeType(i, getExtType(i), TP);
// Transfer in the old predicates.
for (const TreePredicateFn &Pred : getPredicateFns())
FragTree->addPredicateFn(Pred);
// The fragment we inlined could have recursive inlining that is needed. See
// if there are any pattern fragments in it and inline them as needed.
return FragTree->InlinePatternFragments(FragTree, TP);
}
/// getImplicitType - Check to see if the specified record has an implicit
/// type which should be applied to it. This will infer the type of register
/// references from the register file information, for example.
///
/// When Unnamed is set, return the type of a DAG operand with no name, such as
/// the F8RC register class argument in:
///
/// (COPY_TO_REGCLASS GPR:$src, F8RC)
///
/// When Unnamed is false, return the type of a named DAG operand such as the
/// GPR:$src operand above.
///
static TypeSetByHwMode getImplicitType(Record *R, unsigned ResNo,
bool NotRegisters,
bool Unnamed,
TreePattern &TP) {
CodeGenDAGPatterns &CDP = TP.getDAGPatterns();
// Check to see if this is a register operand.
if (R->isSubClassOf("RegisterOperand")) {
assert(ResNo == 0 && "Regoperand ref only has one result!");
if (NotRegisters)
return TypeSetByHwMode(); // Unknown.
Record *RegClass = R->getValueAsDef("RegClass");
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
return TypeSetByHwMode(T.getRegisterClass(RegClass).getValueTypes());
}
// Check to see if this is a register or a register class.
if (R->isSubClassOf("RegisterClass")) {
assert(ResNo == 0 && "Regclass ref only has one result!");
// An unnamed register class represents itself as an i32 immediate, for
// example on a COPY_TO_REGCLASS instruction.
if (Unnamed)
return TypeSetByHwMode(MVT::i32);
// In a named operand, the register class provides the possible set of
// types.
if (NotRegisters)
return TypeSetByHwMode(); // Unknown.
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
return TypeSetByHwMode(T.getRegisterClass(R).getValueTypes());
}
if (R->isSubClassOf("PatFrag")) {
assert(ResNo == 0 && "FIXME: PatFrag with multiple results?");
// Pattern fragment types will be resolved when they are inlined.
return TypeSetByHwMode(); // Unknown.
}
if (R->isSubClassOf("Register")) {
assert(ResNo == 0 && "Registers only produce one result!");
if (NotRegisters)
return TypeSetByHwMode(); // Unknown.
const CodeGenTarget &T = TP.getDAGPatterns().getTargetInfo();
return TypeSetByHwMode(T.getRegisterVTs(R));
}
if (R->isSubClassOf("SubRegIndex")) {
assert(ResNo == 0 && "SubRegisterIndices only produce one result!");
return TypeSetByHwMode(MVT::i32);
}
if (R->isSubClassOf("ValueType")) {
assert(ResNo == 0 && "This node only has one result!");
// An unnamed VTSDNode represents itself as an MVT::Other immediate.
//
// (sext_inreg GPR:$src, i16)
// ~~~
if (Unnamed)
return TypeSetByHwMode(MVT::Other);
// With a name, the ValueType simply provides the type of the named
// variable.
//
// (sext_inreg i32:$src, i16)
// ~~~~~~~~
if (NotRegisters)
return TypeSetByHwMode(); // Unknown.
const CodeGenHwModes &CGH = CDP.getTargetInfo().getHwModes();
return TypeSetByHwMode(getValueTypeByHwMode(R, CGH));
}
if (R->isSubClassOf("CondCode")) {
assert(ResNo == 0 && "This node only has one result!");
// Using a CondCodeSDNode.
return TypeSetByHwMode(MVT::Other);
}
if (R->isSubClassOf("ComplexPattern")) {
assert(ResNo == 0 && "FIXME: ComplexPattern with multiple results?");
if (NotRegisters)
return TypeSetByHwMode(); // Unknown.
return TypeSetByHwMode(CDP.getComplexPattern(R).getValueType());
}
if (R->isSubClassOf("PointerLikeRegClass")) {
assert(ResNo == 0 && "Regclass can only have one result!");
TypeSetByHwMode VTS(MVT::iPTR);
TP.getInfer().expandOverloads(VTS);
return VTS;
}
if (R->getName() == "node" || R->getName() == "srcvalue" ||
R->getName() == "zero_reg") {
// Placeholder.
return TypeSetByHwMode(); // Unknown.
}
if (R->isSubClassOf("Operand")) {
const CodeGenHwModes &CGH = CDP.getTargetInfo().getHwModes();
Record *T = R->getValueAsDef("Type");
return TypeSetByHwMode(getValueTypeByHwMode(T, CGH));
}
TP.error("Unknown node flavor used in pattern: " + R->getName());
return TypeSetByHwMode(MVT::Other);
}
/// getIntrinsicInfo - If this node corresponds to an intrinsic, return the
/// CodeGenIntrinsic information for it, otherwise return a null pointer.
const CodeGenIntrinsic *TreePatternNode::
getIntrinsicInfo(const CodeGenDAGPatterns &CDP) const {
if (getOperator() != CDP.get_intrinsic_void_sdnode() &&
getOperator() != CDP.get_intrinsic_w_chain_sdnode() &&
getOperator() != CDP.get_intrinsic_wo_chain_sdnode())
return nullptr;
unsigned IID = cast<IntInit>(getChild(0)->getLeafValue())->getValue();
return &CDP.getIntrinsicInfo(IID);
}
/// getComplexPatternInfo - If this node corresponds to a ComplexPattern,
/// return the ComplexPattern information, otherwise return null.
const ComplexPattern *
TreePatternNode::getComplexPatternInfo(const CodeGenDAGPatterns &CGP) const {
Record *Rec;
if (isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(getLeafValue());
if (!DI)
return nullptr;
Rec = DI->getDef();
} else
Rec = getOperator();
if (!Rec->isSubClassOf("ComplexPattern"))
return nullptr;
return &CGP.getComplexPattern(Rec);
}
unsigned TreePatternNode::getNumMIResults(const CodeGenDAGPatterns &CGP) const {
// A ComplexPattern specifically declares how many results it fills in.
if (const ComplexPattern *CP = getComplexPatternInfo(CGP))
return CP->getNumOperands();
// If MIOperandInfo is specified, that gives the count.
if (isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(getLeafValue());
if (DI && DI->getDef()->isSubClassOf("Operand")) {
DagInit *MIOps = DI->getDef()->getValueAsDag("MIOperandInfo");
if (MIOps->getNumArgs())
return MIOps->getNumArgs();
}
}
// Otherwise there is just one result.
return 1;
}
/// NodeHasProperty - Return true if this node has the specified property.
bool TreePatternNode::NodeHasProperty(SDNP Property,
const CodeGenDAGPatterns &CGP) const {
if (isLeaf()) {
if (const ComplexPattern *CP = getComplexPatternInfo(CGP))
return CP->hasProperty(Property);
return false;
}
if (Property != SDNPHasChain) {
// The chain proprety is already present on the different intrinsic node
// types (intrinsic_w_chain, intrinsic_void), and is not explicitly listed
// on the intrinsic. Anything else is specific to the individual intrinsic.
if (const CodeGenIntrinsic *Int = getIntrinsicInfo(CGP))
return Int->hasProperty(Property);
}
if (!Operator->isSubClassOf("SDPatternOperator"))
return false;
return CGP.getSDNodeInfo(Operator).hasProperty(Property);
}
/// TreeHasProperty - Return true if any node in this tree has the specified
/// property.
bool TreePatternNode::TreeHasProperty(SDNP Property,
const CodeGenDAGPatterns &CGP) const {
if (NodeHasProperty(Property, CGP))
return true;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
if (getChild(i)->TreeHasProperty(Property, CGP))
return true;
return false;
}
/// isCommutativeIntrinsic - Return true if the node corresponds to a
/// commutative intrinsic.
bool
TreePatternNode::isCommutativeIntrinsic(const CodeGenDAGPatterns &CDP) const {
if (const CodeGenIntrinsic *Int = getIntrinsicInfo(CDP))
return Int->isCommutative;
return false;
}
static bool isOperandClass(const TreePatternNode *N, StringRef Class) {
if (!N->isLeaf())
return N->getOperator()->isSubClassOf(Class);
DefInit *DI = dyn_cast<DefInit>(N->getLeafValue());
if (DI && DI->getDef()->isSubClassOf(Class))
return true;
return false;
}
static void emitTooManyOperandsError(TreePattern &TP,
StringRef InstName,
unsigned Expected,
unsigned Actual) {
TP.error("Instruction '" + InstName + "' was provided " + Twine(Actual) +
" operands but expected only " + Twine(Expected) + "!");
}
static void emitTooFewOperandsError(TreePattern &TP,
StringRef InstName,
unsigned Actual) {
TP.error("Instruction '" + InstName +
"' expects more than the provided " + Twine(Actual) + " operands!");
}
/// ApplyTypeConstraints - Apply all of the type constraints relevant to
/// this node and its children in the tree. This returns true if it makes a
/// change, false otherwise. If a type contradiction is found, flag an error.
bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
if (TP.hasError())
return false;
CodeGenDAGPatterns &CDP = TP.getDAGPatterns();
if (isLeaf()) {
if (DefInit *DI = dyn_cast<DefInit>(getLeafValue())) {
// If it's a regclass or something else known, include the type.
bool MadeChange = false;
for (unsigned i = 0, e = Types.size(); i != e; ++i)
MadeChange |= UpdateNodeType(i, getImplicitType(DI->getDef(), i,
NotRegisters,
!hasName(), TP), TP);
return MadeChange;
}
if (IntInit *II = dyn_cast<IntInit>(getLeafValue())) {
assert(Types.size() == 1 && "Invalid IntInit");
// Int inits are always integers. :)
bool MadeChange = TP.getInfer().EnforceInteger(Types[0]);
if (!TP.getInfer().isConcrete(Types[0], false))
return MadeChange;
ValueTypeByHwMode VVT = TP.getInfer().getConcrete(Types[0], false);
for (auto &P : VVT) {
MVT::SimpleValueType VT = P.second.SimpleTy;
if (VT == MVT::iPTR || VT == MVT::iPTRAny)
continue;
unsigned Size = MVT(VT).getSizeInBits();
// Make sure that the value is representable for this type.
if (Size >= 32)
continue;
// Check that the value doesn't use more bits than we have. It must
// either be a sign- or zero-extended equivalent of the original.
int64_t SignBitAndAbove = II->getValue() >> (Size - 1);
if (SignBitAndAbove == -1 || SignBitAndAbove == 0 ||
SignBitAndAbove == 1)
continue;
TP.error("Integer value '" + Twine(II->getValue()) +
"' is out of range for type '" + getEnumName(VT) + "'!");
break;
}
return MadeChange;
}
return false;
}
// special handling for set, which isn't really an SDNode.
if (getOperator()->getName() == "set") {
assert(getNumTypes() == 0 && "Set doesn't produce a value");
assert(getNumChildren() >= 2 && "Missing RHS of a set?");
unsigned NC = getNumChildren();
TreePatternNode *SetVal = getChild(NC-1);
bool MadeChange = SetVal->ApplyTypeConstraints(TP, NotRegisters);
for (unsigned i = 0; i < NC-1; ++i) {
TreePatternNode *Child = getChild(i);
MadeChange |= Child->ApplyTypeConstraints(TP, NotRegisters);
// Types of operands must match.
MadeChange |= Child->UpdateNodeType(0, SetVal->getExtType(i), TP);
MadeChange |= SetVal->UpdateNodeType(i, Child->getExtType(0), TP);
}
return MadeChange;
}
if (getOperator()->getName() == "implicit") {
assert(getNumTypes() == 0 && "Node doesn't produce a value");
bool MadeChange = false;
for (unsigned i = 0; i < getNumChildren(); ++i)
MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
return MadeChange;
}
if (const CodeGenIntrinsic *Int = getIntrinsicInfo(CDP)) {
bool MadeChange = false;
// Apply the result type to the node.
unsigned NumRetVTs = Int->IS.RetVTs.size();
unsigned NumParamVTs = Int->IS.ParamVTs.size();
for (unsigned i = 0, e = NumRetVTs; i != e; ++i)
MadeChange |= UpdateNodeType(i, Int->IS.RetVTs[i], TP);
if (getNumChildren() != NumParamVTs + 1) {
TP.error("Intrinsic '" + Int->Name + "' expects " + Twine(NumParamVTs) +
" operands, not " + Twine(getNumChildren() - 1) + " operands!");
return false;
}
// Apply type info to the intrinsic ID.
MadeChange |= getChild(0)->UpdateNodeType(0, MVT::iPTR, TP);
for (unsigned i = 0, e = getNumChildren()-1; i != e; ++i) {
MadeChange |= getChild(i+1)->ApplyTypeConstraints(TP, NotRegisters);
MVT::SimpleValueType OpVT = Int->IS.ParamVTs[i];
assert(getChild(i+1)->getNumTypes() == 1 && "Unhandled case");
MadeChange |= getChild(i+1)->UpdateNodeType(0, OpVT, TP);
}
return MadeChange;
}
if (getOperator()->isSubClassOf("SDNode")) {
const SDNodeInfo &NI = CDP.getSDNodeInfo(getOperator());
// Check that the number of operands is sane. Negative operands -> varargs.
if (NI.getNumOperands() >= 0 &&
getNumChildren() != (unsigned)NI.getNumOperands()) {
TP.error(getOperator()->getName() + " node requires exactly " +
Twine(NI.getNumOperands()) + " operands!");
return false;
}
bool MadeChange = false;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
MadeChange |= NI.ApplyTypeConstraints(this, TP);
return MadeChange;
}
if (getOperator()->isSubClassOf("Instruction")) {
const DAGInstruction &Inst = CDP.getInstruction(getOperator());
CodeGenInstruction &InstInfo =
CDP.getTargetInfo().getInstruction(getOperator());
bool MadeChange = false;
// Apply the result types to the node, these come from the things in the
// (outs) list of the instruction.
unsigned NumResultsToAdd = std::min(InstInfo.Operands.NumDefs,
Inst.getNumResults());
for (unsigned ResNo = 0; ResNo != NumResultsToAdd; ++ResNo)
MadeChange |= UpdateNodeTypeFromInst(ResNo, Inst.getResult(ResNo), TP);
// If the instruction has implicit defs, we apply the first one as a result.
// FIXME: This sucks, it should apply all implicit defs.
if (!InstInfo.ImplicitDefs.empty()) {
unsigned ResNo = NumResultsToAdd;
// FIXME: Generalize to multiple possible types and multiple possible
// ImplicitDefs.
MVT::SimpleValueType VT =
InstInfo.HasOneImplicitDefWithKnownVT(CDP.getTargetInfo());
if (VT != MVT::Other)
MadeChange |= UpdateNodeType(ResNo, VT, TP);
}
// If this is an INSERT_SUBREG, constrain the source and destination VTs to
// be the same.
if (getOperator()->getName() == "INSERT_SUBREG") {
assert(getChild(0)->getNumTypes() == 1 && "FIXME: Unhandled");
MadeChange |= UpdateNodeType(0, getChild(0)->getExtType(0), TP);
MadeChange |= getChild(0)->UpdateNodeType(0, getExtType(0), TP);
} else if (getOperator()->getName() == "REG_SEQUENCE") {
// We need to do extra, custom typechecking for REG_SEQUENCE since it is
// variadic.
unsigned NChild = getNumChildren();
if (NChild < 3) {
TP.error("REG_SEQUENCE requires at least 3 operands!");
return false;
}
if (NChild % 2 == 0) {
TP.error("REG_SEQUENCE requires an odd number of operands!");
return false;
}
if (!isOperandClass(getChild(0), "RegisterClass")) {
TP.error("REG_SEQUENCE requires a RegisterClass for first operand!");
return false;
}
for (unsigned I = 1; I < NChild; I += 2) {
TreePatternNode *SubIdxChild = getChild(I + 1);
if (!isOperandClass(SubIdxChild, "SubRegIndex")) {
TP.error("REG_SEQUENCE requires a SubRegIndex for operand " +
Twine(I + 1) + "!");
return false;
}
}
}
unsigned ChildNo = 0;
for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) {
Record *OperandNode = Inst.getOperand(i);
// If the instruction expects a predicate or optional def operand, we
// codegen this by setting the operand to it's default value if it has a
// non-empty DefaultOps field.
if (OperandNode->isSubClassOf("OperandWithDefaultOps") &&
!CDP.getDefaultOperand(OperandNode).DefaultOps.empty())
continue;
// Verify that we didn't run out of provided operands.
if (ChildNo >= getNumChildren()) {
emitTooFewOperandsError(TP, getOperator()->getName(), getNumChildren());
return false;
}
TreePatternNode *Child = getChild(ChildNo++);
unsigned ChildResNo = 0; // Instructions always use res #0 of their op.
// If the operand has sub-operands, they may be provided by distinct
// child patterns, so attempt to match each sub-operand separately.
if (OperandNode->isSubClassOf("Operand")) {
DagInit *MIOpInfo = OperandNode->getValueAsDag("MIOperandInfo");
if (unsigned NumArgs = MIOpInfo->getNumArgs()) {
// But don't do that if the whole operand is being provided by
// a single ComplexPattern-related Operand.
if (Child->getNumMIResults(CDP) < NumArgs) {
// Match first sub-operand against the child we already have.
Record *SubRec = cast<DefInit>(MIOpInfo->getArg(0))->getDef();
MadeChange |=
Child->UpdateNodeTypeFromInst(ChildResNo, SubRec, TP);
// And the remaining sub-operands against subsequent children.
for (unsigned Arg = 1; Arg < NumArgs; ++Arg) {
if (ChildNo >= getNumChildren()) {
emitTooFewOperandsError(TP, getOperator()->getName(),
getNumChildren());
return false;
}
Child = getChild(ChildNo++);
SubRec = cast<DefInit>(MIOpInfo->getArg(Arg))->getDef();
MadeChange |=
Child->UpdateNodeTypeFromInst(ChildResNo, SubRec, TP);
}
continue;
}
}
}
// If we didn't match by pieces above, attempt to match the whole
// operand now.
MadeChange |= Child->UpdateNodeTypeFromInst(ChildResNo, OperandNode, TP);
}
if (!InstInfo.Operands.isVariadic && ChildNo != getNumChildren()) {
emitTooManyOperandsError(TP, getOperator()->getName(),
ChildNo, getNumChildren());
return false;
}
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
return MadeChange;
}
if (getOperator()->isSubClassOf("ComplexPattern")) {
bool MadeChange = false;
for (unsigned i = 0; i < getNumChildren(); ++i)
MadeChange |= getChild(i)->ApplyTypeConstraints(TP, NotRegisters);
return MadeChange;
}
assert(getOperator()->isSubClassOf("SDNodeXForm") && "Unknown node type!");
// Node transforms always take one operand.
if (getNumChildren() != 1) {
TP.error("Node transform '" + getOperator()->getName() +
"' requires one operand!");
return false;
}
bool MadeChange = getChild(0)->ApplyTypeConstraints(TP, NotRegisters);
return MadeChange;
}
/// OnlyOnRHSOfCommutative - Return true if this value is only allowed on the
/// RHS of a commutative operation, not the on LHS.
static bool OnlyOnRHSOfCommutative(TreePatternNode *N) {
if (!N->isLeaf() && N->getOperator()->getName() == "imm")
return true;
if (N->isLeaf() && isa<IntInit>(N->getLeafValue()))
return true;
return false;
}
/// canPatternMatch - If it is impossible for this pattern to match on this
/// target, fill in Reason and return false. Otherwise, return true. This is
/// used as a sanity check for .td files (to prevent people from writing stuff
/// that can never possibly work), and to prevent the pattern permuter from
/// generating stuff that is useless.
bool TreePatternNode::canPatternMatch(std::string &Reason,
const CodeGenDAGPatterns &CDP) {
if (isLeaf()) return true;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
if (!getChild(i)->canPatternMatch(Reason, CDP))
return false;
// If this is an intrinsic, handle cases that would make it not match. For
// example, if an operand is required to be an immediate.
if (getOperator()->isSubClassOf("Intrinsic")) {
// TODO:
return true;
}
if (getOperator()->isSubClassOf("ComplexPattern"))
return true;
// If this node is a commutative operator, check that the LHS isn't an
// immediate.
const SDNodeInfo &NodeInfo = CDP.getSDNodeInfo(getOperator());
bool isCommIntrinsic = isCommutativeIntrinsic(CDP);
if (NodeInfo.hasProperty(SDNPCommutative) || isCommIntrinsic) {
// Scan all of the operands of the node and make sure that only the last one
// is a constant node, unless the RHS also is.
if (!OnlyOnRHSOfCommutative(getChild(getNumChildren()-1))) {
unsigned Skip = isCommIntrinsic ? 1 : 0; // First operand is intrinsic id.
for (unsigned i = Skip, e = getNumChildren()-1; i != e; ++i)
if (OnlyOnRHSOfCommutative(getChild(i))) {
Reason="Immediate value must be on the RHS of commutative operators!";
return false;
}
}
}
return true;
}
//===----------------------------------------------------------------------===//
// TreePattern implementation
//
TreePattern::TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp),
isInputPattern(isInput), HasError(false),
Infer(*this) {
for (Init *I : RawPat->getValues())
Trees.push_back(ParseTreePattern(I, ""));
}
TreePattern::TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp),
isInputPattern(isInput), HasError(false),
Infer(*this) {
Trees.push_back(ParseTreePattern(Pat, ""));
}
TreePattern::TreePattern(Record *TheRec, TreePatternNodePtr Pat, bool isInput,
CodeGenDAGPatterns &cdp)
: TheRecord(TheRec), CDP(cdp), isInputPattern(isInput), HasError(false),
Infer(*this) {
Trees.push_back(Pat);
}
void TreePattern::error(const Twine &Msg) {
if (HasError)
return;
dump();
PrintError(TheRecord->getLoc(), "In " + TheRecord->getName() + ": " + Msg);
HasError = true;
}
void TreePattern::ComputeNamedNodes() {
for (TreePatternNodePtr &Tree : Trees)
ComputeNamedNodes(Tree.get());
}
void TreePattern::ComputeNamedNodes(TreePatternNode *N) {
if (!N->getName().empty())
NamedNodes[N->getName()].push_back(N);
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
ComputeNamedNodes(N->getChild(i));
}
TreePatternNodePtr TreePattern::ParseTreePattern(Init *TheInit,
StringRef OpName) {
if (DefInit *DI = dyn_cast<DefInit>(TheInit)) {
Record *R = DI->getDef();
// Direct reference to a leaf DagNode or PatFrag? Turn it into a
// TreePatternNode of its own. For example:
/// (foo GPR, imm) -> (foo GPR, (imm))
if (R->isSubClassOf("SDNode") || R->isSubClassOf("PatFrag"))
return ParseTreePattern(
DagInit::get(DI, nullptr,
std::vector<std::pair<Init*, StringInit*> >()),
OpName);
// Input argument?
TreePatternNodePtr Res = std::make_shared<TreePatternNode>(DI, 1);
if (R->getName() == "node" && !OpName.empty()) {
if (OpName.empty())
error("'node' argument requires a name to match with operand list");
Args.push_back(OpName);
}
Res->setName(OpName);
return Res;
}
// ?:$name or just $name.
if (isa<UnsetInit>(TheInit)) {
if (OpName.empty())
error("'?' argument requires a name to match with operand list");
TreePatternNodePtr Res = std::make_shared<TreePatternNode>(TheInit, 1);
Args.push_back(OpName);
Res->setName(OpName);
return Res;
}
if (isa<IntInit>(TheInit) || isa<BitInit>(TheInit)) {
if (!OpName.empty())
error("Constant int or bit argument should not have a name!");
if (isa<BitInit>(TheInit))
TheInit = TheInit->convertInitializerTo(IntRecTy::get());
return std::make_shared<TreePatternNode>(TheInit, 1);
}
if (BitsInit *BI = dyn_cast<BitsInit>(TheInit)) {
// Turn this into an IntInit.
Init *II = BI->convertInitializerTo(IntRecTy::get());
if (!II || !isa<IntInit>(II))
error("Bits value must be constants!");
return ParseTreePattern(II, OpName);
}
DagInit *Dag = dyn_cast<DagInit>(TheInit);
if (!Dag) {
TheInit->print(errs());
error("Pattern has unexpected init kind!");
}
DefInit *OpDef = dyn_cast<DefInit>(Dag->getOperator());
if (!OpDef) error("Pattern has unexpected operator type!");
Record *Operator = OpDef->getDef();
if (Operator->isSubClassOf("ValueType")) {
// If the operator is a ValueType, then this must be "type cast" of a leaf
// node.
if (Dag->getNumArgs() != 1)
error("Type cast only takes one operand!");
TreePatternNodePtr New =
ParseTreePattern(Dag->getArg(0), Dag->getArgNameStr(0));
// Apply the type cast.
assert(New->getNumTypes() == 1 && "FIXME: Unhandled");
const CodeGenHwModes &CGH = getDAGPatterns().getTargetInfo().getHwModes();
New->UpdateNodeType(0, getValueTypeByHwMode(Operator, CGH), *this);
if (!OpName.empty())
error("ValueType cast should not have a name!");
return New;
}
// Verify that this is something that makes sense for an operator.
if (!Operator->isSubClassOf("PatFrag") &&
!Operator->isSubClassOf("SDNode") &&
!Operator->isSubClassOf("Instruction") &&
!Operator->isSubClassOf("SDNodeXForm") &&
!Operator->isSubClassOf("Intrinsic") &&
!Operator->isSubClassOf("ComplexPattern") &&
Operator->getName() != "set" &&
Operator->getName() != "implicit")
error("Unrecognized node '" + Operator->getName() + "'!");
// Check to see if this is something that is illegal in an input pattern.
if (isInputPattern) {
if (Operator->isSubClassOf("Instruction") ||
Operator->isSubClassOf("SDNodeXForm"))
error("Cannot use '" + Operator->getName() + "' in an input pattern!");
} else {
if (Operator->isSubClassOf("Intrinsic"))
error("Cannot use '" + Operator->getName() + "' in an output pattern!");
if (Operator->isSubClassOf("SDNode") &&
Operator->getName() != "imm" &&
Operator->getName() != "fpimm" &&
Operator->getName() != "tglobaltlsaddr" &&
Operator->getName() != "tconstpool" &&
Operator->getName() != "tjumptable" &&
Operator->getName() != "tframeindex" &&
Operator->getName() != "texternalsym" &&
Operator->getName() != "tblockaddress" &&
Operator->getName() != "tglobaladdr" &&
Operator->getName() != "bb" &&
Operator->getName() != "vt" &&
Operator->getName() != "mcsym")
error("Cannot use '" + Operator->getName() + "' in an output pattern!");
}
std::vector<TreePatternNodePtr> Children;
// Parse all the operands.
for (unsigned i = 0, e = Dag->getNumArgs(); i != e; ++i)
Children.push_back(ParseTreePattern(Dag->getArg(i), Dag->getArgNameStr(i)));
// Get the actual number of results before Operator is converted to an intrinsic
// node (which is hard-coded to have either zero or one result).
unsigned NumResults = GetNumNodeResults(Operator, CDP);
// If the operator is an intrinsic, then this is just syntactic sugar for
// (intrinsic_* <number>, ..children..). Pick the right intrinsic node, and
// convert the intrinsic name to a number.
if (Operator->isSubClassOf("Intrinsic")) {
const CodeGenIntrinsic &Int = getDAGPatterns().getIntrinsic(Operator);
unsigned IID = getDAGPatterns().getIntrinsicID(Operator)+1;
// If this intrinsic returns void, it must have side-effects and thus a
// chain.
if (Int.IS.RetVTs.empty())
Operator = getDAGPatterns().get_intrinsic_void_sdnode();
else if (Int.ModRef != CodeGenIntrinsic::NoMem)
// Has side-effects, requires chain.
Operator = getDAGPatterns().get_intrinsic_w_chain_sdnode();
else // Otherwise, no chain.
Operator = getDAGPatterns().get_intrinsic_wo_chain_sdnode();
Children.insert(Children.begin(),
std::make_shared<TreePatternNode>(IntInit::get(IID), 1));
}
if (Operator->isSubClassOf("ComplexPattern")) {
for (unsigned i = 0; i < Children.size(); ++i) {
TreePatternNodePtr Child = Children[i];
if (Child->getName().empty())
error("All arguments to a ComplexPattern must be named");
// Check that the ComplexPattern uses are consistent: "(MY_PAT $a, $b)"
// and "(MY_PAT $b, $a)" should not be allowed in the same pattern;
// neither should "(MY_PAT_1 $a, $b)" and "(MY_PAT_2 $a, $b)".
auto OperandId = std::make_pair(Operator, i);
auto PrevOp = ComplexPatternOperands.find(Child->getName());
if (PrevOp != ComplexPatternOperands.end()) {
if (PrevOp->getValue() != OperandId)
error("All ComplexPattern operands must appear consistently: "
"in the same order in just one ComplexPattern instance.");
} else
ComplexPatternOperands[Child->getName()] = OperandId;
}
}
TreePatternNodePtr Result =
std::make_shared<TreePatternNode>(Operator, Children, NumResults);
Result->setName(OpName);
if (Dag->getName()) {
assert(Result->getName().empty());
Result->setName(Dag->getNameStr());
}
return Result;
}
/// SimplifyTree - See if we can simplify this tree to eliminate something that
/// will never match in favor of something obvious that will. This is here
/// strictly as a convenience to target authors because it allows them to write
/// more type generic things and have useless type casts fold away.
///
/// This returns true if any change is made.
static bool SimplifyTree(TreePatternNodePtr &N) {
if (N->isLeaf())
return false;
// If we have a bitconvert with a resolved type and if the source and
// destination types are the same, then the bitconvert is useless, remove it.
if (N->getOperator()->getName() == "bitconvert" &&
N->getExtType(0).isValueTypeByHwMode(false) &&
N->getExtType(0) == N->getChild(0)->getExtType(0) &&
N->getName().empty()) {
N = N->getChildShared(0);
SimplifyTree(N);
return true;
}
// Walk all children.
bool MadeChange = false;
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {
TreePatternNodePtr Child = N->getChildShared(i);
MadeChange |= SimplifyTree(Child);
N->setChild(i, std::move(Child));
}
return MadeChange;
}
/// InferAllTypes - Infer/propagate as many types throughout the expression
/// patterns as possible. Return true if all types are inferred, false
/// otherwise. Flags an error if a type contradiction is found.
bool TreePattern::
InferAllTypes(const StringMap<SmallVector<TreePatternNode*,1> > *InNamedTypes) {
if (NamedNodes.empty())
ComputeNamedNodes();
bool MadeChange = true;
while (MadeChange) {
MadeChange = false;
for (TreePatternNodePtr &Tree : Trees) {
MadeChange |= Tree->ApplyTypeConstraints(*this, false);
MadeChange |= SimplifyTree(Tree);
}
// If there are constraints on our named nodes, apply them.
for (auto &Entry : NamedNodes) {
SmallVectorImpl<TreePatternNode*> &Nodes = Entry.second;
// If we have input named node types, propagate their types to the named
// values here.
if (InNamedTypes) {
if (!InNamedTypes->count(Entry.getKey())) {
error("Node '" + std::string(Entry.getKey()) +
"' in output pattern but not input pattern");
return true;
}
const SmallVectorImpl<TreePatternNode*> &InNodes =
InNamedTypes->find(Entry.getKey())->second;
// The input types should be fully resolved by now.
for (TreePatternNode *Node : Nodes) {
// If this node is a register class, and it is the root of the pattern
// then we're mapping something onto an input register. We allow
// changing the type of the input register in this case. This allows
// us to match things like:
// def : Pat<(v1i64 (bitconvert(v2i32 DPR:$src))), (v1i64 DPR:$src)>;
if (Node == Trees[0].get() && Node->isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(Node->getLeafValue());
if (DI && (DI->getDef()->isSubClassOf("RegisterClass") ||
DI->getDef()->isSubClassOf("RegisterOperand")))
continue;
}
assert(Node->getNumTypes() == 1 &&
InNodes[0]->getNumTypes() == 1 &&
"FIXME: cannot name multiple result nodes yet");
MadeChange |= Node->UpdateNodeType(0, InNodes[0]->getExtType(0),
*this);
}
}
// If there are multiple nodes with the same name, they must all have the
// same type.
if (Entry.second.size() > 1) {
for (unsigned i = 0, e = Nodes.size()-1; i != e; ++i) {
TreePatternNode *N1 = Nodes[i], *N2 = Nodes[i+1];
assert(N1->getNumTypes() == 1 && N2->getNumTypes() == 1 &&
"FIXME: cannot name multiple result nodes yet");
MadeChange |= N1->UpdateNodeType(0, N2->getExtType(0), *this);
MadeChange |= N2->UpdateNodeType(0, N1->getExtType(0), *this);
}
}
}
}
bool HasUnresolvedTypes = false;
for (const TreePatternNodePtr &Tree : Trees)
HasUnresolvedTypes |= Tree->ContainsUnresolvedType(*this);
return !HasUnresolvedTypes;
}
void TreePattern::print(raw_ostream &OS) const {
OS << getRecord()->getName();
if (!Args.empty()) {
OS << "(" << Args[0];
for (unsigned i = 1, e = Args.size(); i != e; ++i)
OS << ", " << Args[i];
OS << ")";
}
OS << ": ";
if (Trees.size() > 1)
OS << "[\n";
for (const TreePatternNodePtr &Tree : Trees) {
OS << "\t";
Tree->print(OS);
OS << "\n";
}
if (Trees.size() > 1)
OS << "]\n";
}
void TreePattern::dump() const { print(errs()); }
//===----------------------------------------------------------------------===//
// CodeGenDAGPatterns implementation
//
CodeGenDAGPatterns::CodeGenDAGPatterns(RecordKeeper &R,
PatternRewriterFn PatternRewriter)
: Records(R), Target(R), LegalVTS(Target.getLegalValueTypes()),
PatternRewriter(PatternRewriter) {
Intrinsics = CodeGenIntrinsicTable(Records, false);
TgtIntrinsics = CodeGenIntrinsicTable(Records, true);
ParseNodeInfo();
ParseNodeTransforms();
ParseComplexPatterns();
ParsePatternFragments();
ParseDefaultOperands();
ParseInstructions();
ParsePatternFragments(/*OutFrags*/true);
ParsePatterns();
// Break patterns with parameterized types into a series of patterns,
// where each one has a fixed type and is predicated on the conditions
// of the associated HW mode.
ExpandHwModeBasedTypes();
// Generate variants. For example, commutative patterns can match
// multiple ways. Add them to PatternsToMatch as well.
GenerateVariants();
// Infer instruction flags. For example, we can detect loads,
// stores, and side effects in many cases by examining an
// instruction's pattern.
InferInstructionFlags();
// Verify that instruction flags match the patterns.
VerifyInstructionFlags();
}
Record *CodeGenDAGPatterns::getSDNodeNamed(const std::string &Name) const {
Record *N = Records.getDef(Name);
if (!N || !N->isSubClassOf("SDNode"))
PrintFatalError("Error getting SDNode '" + Name + "'!");
return N;
}
// Parse all of the SDNode definitions for the target, populating SDNodes.
void CodeGenDAGPatterns::ParseNodeInfo() {
std::vector<Record*> Nodes = Records.getAllDerivedDefinitions("SDNode");
const CodeGenHwModes &CGH = getTargetInfo().getHwModes();
while (!Nodes.empty()) {
Record *R = Nodes.back();
SDNodes.insert(std::make_pair(R, SDNodeInfo(R, CGH)));
Nodes.pop_back();
}
// Get the builtin intrinsic nodes.
intrinsic_void_sdnode = getSDNodeNamed("intrinsic_void");
intrinsic_w_chain_sdnode = getSDNodeNamed("intrinsic_w_chain");
intrinsic_wo_chain_sdnode = getSDNodeNamed("intrinsic_wo_chain");
}
/// ParseNodeTransforms - Parse all SDNodeXForm instances into the SDNodeXForms
/// map, and emit them to the file as functions.
void CodeGenDAGPatterns::ParseNodeTransforms() {
std::vector<Record*> Xforms = Records.getAllDerivedDefinitions("SDNodeXForm");
while (!Xforms.empty()) {
Record *XFormNode = Xforms.back();
Record *SDNode = XFormNode->getValueAsDef("Opcode");
StringRef Code = XFormNode->getValueAsString("XFormFunction");
SDNodeXForms.insert(std::make_pair(XFormNode, NodeXForm(SDNode, Code)));
Xforms.pop_back();
}
}
void CodeGenDAGPatterns::ParseComplexPatterns() {
std::vector<Record*> AMs = Records.getAllDerivedDefinitions("ComplexPattern");
while (!AMs.empty()) {
ComplexPatterns.insert(std::make_pair(AMs.back(), AMs.back()));
AMs.pop_back();
}
}
/// ParsePatternFragments - Parse all of the PatFrag definitions in the .td
/// file, building up the PatternFragments map. After we've collected them all,
/// inline fragments together as necessary, so that there are no references left
/// inside a pattern fragment to a pattern fragment.
///
void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) {
std::vector<Record*> Fragments = Records.getAllDerivedDefinitions("PatFrag");
// First step, parse all of the fragments.
for (Record *Frag : Fragments) {
if (OutFrags != Frag->isSubClassOf("OutPatFrag"))
continue;
DagInit *Tree = Frag->getValueAsDag("Fragment");
TreePattern *P =
(PatternFragments[Frag] = llvm::make_unique<TreePattern>(
Frag, Tree, !Frag->isSubClassOf("OutPatFrag"),
*this)).get();
// Validate the argument list, converting it to set, to discard duplicates.
std::vector<std::string> &Args = P->getArgList();
// Copy the args so we can take StringRefs to them.
auto ArgsCopy = Args;
SmallDenseSet<StringRef, 4> OperandsSet;
OperandsSet.insert(ArgsCopy.begin(), ArgsCopy.end());
if (OperandsSet.count(""))
P->error("Cannot have unnamed 'node' values in pattern fragment!");
// Parse the operands list.
DagInit *OpsList = Frag->getValueAsDag("Operands");
DefInit *OpsOp = dyn_cast<DefInit>(OpsList->getOperator());
// Special cases: ops == outs == ins. Different names are used to
// improve readability.
if (!OpsOp ||
(OpsOp->getDef()->getName() != "ops" &&
OpsOp->getDef()->getName() != "outs" &&
OpsOp->getDef()->getName() != "ins"))
P->error("Operands list should start with '(ops ... '!");
// Copy over the arguments.
Args.clear();
for (unsigned j = 0, e = OpsList->getNumArgs(); j != e; ++j) {
if (!isa<DefInit>(OpsList->getArg(j)) ||
cast<DefInit>(OpsList->getArg(j))->getDef()->getName() != "node")
P->error("Operands list should all be 'node' values.");
if (!OpsList->getArgName(j))
P->error("Operands list should have names for each operand!");
StringRef ArgNameStr = OpsList->getArgNameStr(j);
if (!OperandsSet.count(ArgNameStr))
P->error("'" + ArgNameStr +
"' does not occur in pattern or was multiply specified!");
OperandsSet.erase(ArgNameStr);
Args.push_back(ArgNameStr);
}
if (!OperandsSet.empty())
P->error("Operands list does not contain an entry for operand '" +
*OperandsSet.begin() + "'!");
// If there is a code init for this fragment, keep track of the fact that
// this fragment uses it.
TreePredicateFn PredFn(P);
if (!PredFn.isAlwaysTrue())
P->getOnlyTree()->addPredicateFn(PredFn);
// If there is a node transformation corresponding to this, keep track of
// it.
Record *Transform = Frag->getValueAsDef("OperandTransform");
if (!getSDNodeTransform(Transform).second.empty()) // not noop xform?
P->getOnlyTree()->setTransformFn(Transform);
}
// Now that we've parsed all of the tree fragments, do a closure on them so
// that there are not references to PatFrags left inside of them.
for (Record *Frag : Fragments) {
if (OutFrags != Frag->isSubClassOf("OutPatFrag"))
continue;
TreePattern &ThePat = *PatternFragments[Frag];
ThePat.InlinePatternFragments();
// Infer as many types as possible. Don't worry about it if we don't infer
// all of them, some may depend on the inputs of the pattern.
ThePat.InferAllTypes();
ThePat.resetError();
// If debugging, print out the pattern fragment result.
LLVM_DEBUG(ThePat.dump());
}
}
void CodeGenDAGPatterns::ParseDefaultOperands() {
std::vector<Record*> DefaultOps;
DefaultOps = Records.getAllDerivedDefinitions("OperandWithDefaultOps");
// Find some SDNode.
assert(!SDNodes.empty() && "No SDNodes parsed?");
Init *SomeSDNode = DefInit::get(SDNodes.begin()->first);
for (unsigned i = 0, e = DefaultOps.size(); i != e; ++i) {
DagInit *DefaultInfo = DefaultOps[i]->getValueAsDag("DefaultOps");
// Clone the DefaultInfo dag node, changing the operator from 'ops' to
// SomeSDnode so that we can parse this.
std::vector<std::pair<Init*, StringInit*> > Ops;
for (unsigned op = 0, e = DefaultInfo->getNumArgs(); op != e; ++op)
Ops.push_back(std::make_pair(DefaultInfo->getArg(op),
DefaultInfo->getArgName(op)));
DagInit *DI = DagInit::get(SomeSDNode, nullptr, Ops);
// Create a TreePattern to parse this.
TreePattern P(DefaultOps[i], DI, false, *this);
assert(P.getNumTrees() == 1 && "This ctor can only produce one tree!");
// Copy the operands over into a DAGDefaultOperand.
DAGDefaultOperand DefaultOpInfo;
const TreePatternNodePtr &T = P.getTree(0);
for (unsigned op = 0, e = T->getNumChildren(); op != e; ++op) {
TreePatternNodePtr TPN = T->getChildShared(op);
while (TPN->ApplyTypeConstraints(P, false))
/* Resolve all types */;
if (TPN->ContainsUnresolvedType(P)) {
PrintFatalError("Value #" + Twine(i) + " of OperandWithDefaultOps '" +
DefaultOps[i]->getName() +
"' doesn't have a concrete type!");
}
DefaultOpInfo.DefaultOps.push_back(std::move(TPN));
}
// Insert it into the DefaultOperands map so we can find it later.
DefaultOperands[DefaultOps[i]] = DefaultOpInfo;
}
}
/// HandleUse - Given "Pat" a leaf in the pattern, check to see if it is an
/// instruction input. Return true if this is a real use.
static bool HandleUse(TreePattern &I, TreePatternNodePtr Pat,
std::map<std::string, TreePatternNodePtr> &InstInputs) {
// No name -> not interesting.
if (Pat->getName().empty()) {
if (Pat->isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(Pat->getLeafValue());
if (DI && (DI->getDef()->isSubClassOf("RegisterClass") ||
DI->getDef()->isSubClassOf("RegisterOperand")))
I.error("Input " + DI->getDef()->getName() + " must be named!");
}
return false;
}
Record *Rec;
if (Pat->isLeaf()) {
DefInit *DI = dyn_cast<DefInit>(Pat->getLeafValue());
if (!DI)
I.error("Input $" + Pat->getName() + " must be an identifier!");
Rec = DI->getDef();
} else {
Rec = Pat->getOperator();
}
// SRCVALUE nodes are ignored.
if (Rec->getName() == "srcvalue")
return false;
TreePatternNodePtr &Slot = InstInputs[Pat->getName()];
if (!Slot) {
Slot = Pat;
return true;
}
Record *SlotRec;
if (Slot->isLeaf()) {
SlotRec = cast<DefInit>(Slot->getLeafValue())->getDef();
} else {
assert(Slot->getNumChildren() == 0 && "can't be a use with children!");
SlotRec = Slot->getOperator();
}
// Ensure that the inputs agree if we've already seen this input.
if (Rec != SlotRec)
I.error("All $" + Pat->getName() + " inputs must agree with each other");
if (Slot->getExtTypes() != Pat->getExtTypes())
I.error("All $" + Pat->getName() + " inputs must agree with each other");
return true;
}
/// FindPatternInputsAndOutputs - Scan the specified TreePatternNode (which is
/// part of "I", the instruction), computing the set of inputs and outputs of
/// the pattern. Report errors if we see anything naughty.
void CodeGenDAGPatterns::FindPatternInputsAndOutputs(
TreePattern &I, TreePatternNodePtr Pat,
std::map<std::string, TreePatternNodePtr> &InstInputs,
std::map<std::string, TreePatternNodePtr> &InstResults,
std::vector<Record *> &InstImpResults) {
if (Pat->isLeaf()) {
bool isUse = HandleUse(I, Pat, InstInputs);
if (!isUse && Pat->getTransformFn())
I.error("Cannot specify a transform function for a non-input value!");
return;
}
if (Pat->getOperator()->getName() == "implicit") {
for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i) {
TreePatternNode *Dest = Pat->getChild(i);
if (!Dest->isLeaf())
I.error("implicitly defined value should be a register!");
DefInit *Val = dyn_cast<DefInit>(Dest->getLeafValue());
if (!Val || !Val->getDef()->isSubClassOf("Register"))
I.error("implicitly defined value should be a register!");
InstImpResults.push_back(Val->getDef());
}
return;
}
if (Pat->getOperator()->getName() != "set") {
// If this is not a set, verify that the children nodes are not void typed,
// and recurse.
for (unsigned i = 0, e = Pat->getNumChildren(); i != e; ++i) {
if (Pat->getChild(i)->getNumTypes() == 0)
I.error("Cannot have void nodes inside of patterns!");
FindPatternInputsAndOutputs(I, Pat->getChildShared(i), InstInputs,
InstResults, InstImpResults);
}
// If this is a non-leaf node with no children, treat it basically as if
// it were a leaf. This handles nodes like (imm).
bool isUse = HandleUse(I, Pat, InstInputs);
if (!isUse && Pat->getTransformFn())
I.error("Cannot specify a transform function for a non-input value!");
return;
}
// Otherwise, this is a set, validate and collect instruction results.
if (Pat->getNumChildren() == 0)
I.error("set requires operands!");
if (Pat->getTransformFn())
I.error("Cannot specify a transform function on a set node!");
// Check the set destinations.
unsigned NumDests = Pat->getNumChildren()-1;
for (unsigned i = 0; i != NumDests; ++i) {
TreePatternNodePtr Dest = Pat->getChildShared(i);
if (!Dest->isLeaf())
I.error("set destination should be a register!");
DefInit *Val = dyn_cast<DefInit>(Dest->getLeafValue());
if (!Val) {
I.error("set destination should be a register!");
continue;
}
if (Val->getDef()->isSubClassOf("RegisterClass") ||
Val->getDef()->isSubClassOf("ValueType") ||
Val->getDef()->isSubClassOf("RegisterOperand") ||
Val->getDef()->isSubClassOf("PointerLikeRegClass")) {
if (Dest->getName().empty())
I.error("set destination must have a name!");
if (InstResults.count(Dest->getName()))
I.error("cannot set '" + Dest->getName() + "' multiple times");
InstResults[Dest->getName()] = Dest;
} else if (Val->getDef()->isSubClassOf("Register")) {
InstImpResults.push_back(Val->getDef());
} else {
I.error("set destination should be a register!");
}
}
// Verify and collect info from the computation.
FindPatternInputsAndOutputs(I, Pat->getChildShared(NumDests), InstInputs,
InstResults, InstImpResults);
}
//===----------------------------------------------------------------------===//
// Instruction Analysis
//===----------------------------------------------------------------------===//
class InstAnalyzer {
const CodeGenDAGPatterns &CDP;
public:
bool hasSideEffects;
bool mayStore;
bool mayLoad;
bool isBitcast;
bool isVariadic;
InstAnalyzer(const CodeGenDAGPatterns &cdp)
: CDP(cdp), hasSideEffects(false), mayStore(false), mayLoad(false),
isBitcast(false), isVariadic(false) {}
void Analyze(const TreePattern *Pat) {
// Assume only the first tree is the pattern. The others are clobber nodes.
AnalyzeNode(Pat->getTree(0).get());
}
void Analyze(const PatternToMatch &Pat) {
AnalyzeNode(Pat.getSrcPattern());
}
private:
bool IsNodeBitcast(const TreePatternNode *N) const {
if (hasSideEffects || mayLoad || mayStore || isVariadic)
return false;
if (N->getNumChildren() != 2)
return false;
const TreePatternNode *N0 = N->getChild(0);
if (!N0->isLeaf() || !isa<DefInit>(N0->getLeafValue()))
return false;
const TreePatternNode *N1 = N->getChild(1);
if (N1->isLeaf())
return false;
if (N1->getNumChildren() != 1 || !N1->getChild(0)->isLeaf())
return false;
const SDNodeInfo &OpInfo = CDP.getSDNodeInfo(N1->getOperator());
if (OpInfo.getNumResults() != 1 || OpInfo.getNumOperands() != 1)
return false;
return OpInfo.getEnumName() == "ISD::BITCAST";
}
public:
void AnalyzeNode(const TreePatternNode *N) {
if (N->isLeaf()) {
if (DefInit *DI = dyn_cast<DefInit>(N->getLeafValue())) {
Record *LeafRec = DI->getDef();
// Handle ComplexPattern leaves.
if (LeafRec->isSubClassOf("ComplexPattern")) {
const ComplexPattern &CP = CDP.getComplexPattern(LeafRec);
if (CP.hasProperty(SDNPMayStore)) mayStore = true;
if (CP.hasProperty(SDNPMayLoad)) mayLoad = true;
if (CP.hasProperty(SDNPSideEffect)) hasSideEffects = true;
}
}
return;
}
// Analyze children.
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
AnalyzeNode(N->getChild(i));
// Ignore set nodes, which are not SDNodes.
if (N->getOperator()->getName() == "set") {
isBitcast = IsNodeBitcast(N);
return;
}
// Notice properties of the node.
if (N->NodeHasProperty(SDNPMayStore, CDP)) mayStore = true;
if (N->NodeHasProperty(SDNPMayLoad, CDP)) mayLoad = true;
if (N->NodeHasProperty(SDNPSideEffect, CDP)) hasSideEffects = true;
if (N->NodeHasProperty(SDNPVariadic, CDP)) isVariadic = true;
if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) {
// If this is an intrinsic, analyze it.
if (IntInfo->ModRef & CodeGenIntrinsic::MR_Ref)
mayLoad = true;// These may load memory.
if (IntInfo->ModRef & CodeGenIntrinsic::MR_Mod)
mayStore = true;// Intrinsics that can write to memory are 'mayStore'.
if (IntInfo->ModRef >= CodeGenIntrinsic::ReadWriteMem ||
IntInfo->hasSideEffects)
// ReadWriteMem intrinsics can have other strange effects.
hasSideEffects = true;
}
}
};
static bool InferFromPattern(CodeGenInstruction &InstInfo,
const InstAnalyzer &PatInfo,
Record *PatDef) {
bool Error = false;
// Remember where InstInfo got its flags.
if (InstInfo.hasUndefFlags())
InstInfo.InferredFrom = PatDef;
// Check explicitly set flags for consistency.
if (InstInfo.hasSideEffects != PatInfo.hasSideEffects &&
!InstInfo.hasSideEffects_Unset) {
// Allow explicitly setting hasSideEffects = 1 on instructions, even when
// the pattern has no side effects. That could be useful for div/rem
// instructions that may trap.
if (!InstInfo.hasSideEffects) {
Error = true;
PrintError(PatDef->getLoc(), "Pattern doesn't match hasSideEffects = " +
Twine(InstInfo.hasSideEffects));
}
}
if (InstInfo.mayStore != PatInfo.mayStore && !InstInfo.mayStore_Unset) {
Error = true;
PrintError(PatDef->getLoc(), "Pattern doesn't match mayStore = " +
Twine(InstInfo.mayStore));
}
if (InstInfo.mayLoad != PatInfo.mayLoad && !InstInfo.mayLoad_Unset) {
// Allow explicitly setting mayLoad = 1, even when the pattern has no loads.
// Some targets translate immediates to loads.
if (!InstInfo.mayLoad) {
Error = true;
PrintError(PatDef->getLoc(), "Pattern doesn't match mayLoad = " +
Twine(InstInfo.mayLoad));
}
}
// Transfer inferred flags.
InstInfo.hasSideEffects |= PatInfo.hasSideEffects;
InstInfo.mayStore |= PatInfo.mayStore;
InstInfo.mayLoad |= PatInfo.mayLoad;
// These flags are silently added without any verification.
InstInfo.isBitcast |= PatInfo.isBitcast;
// Don't infer isVariadic. This flag means something different on SDNodes and
// instructions. For example, a CALL SDNode is variadic because it has the
// call arguments as operands, but a CALL instruction is not variadic - it
// has argument registers as implicit, not explicit uses.
return Error;
}
/// hasNullFragReference - Return true if the DAG has any reference to the
/// null_frag operator.
static bool hasNullFragReference(DagInit *DI) {
DefInit *OpDef = dyn_cast<DefInit>(DI->getOperator());
if (!OpDef) return false;
Record *Operator = OpDef->getDef();
// If this is the null fragment, return true.
if (Operator->getName() == "null_frag") return true;
// If any of the arguments reference the null fragment, return true.
for (unsigned i = 0, e = DI->getNumArgs(); i != e; ++i) {
DagInit *Arg = dyn_cast<DagInit>(DI->getArg(i));
if (Arg && hasNullFragReference(Arg))
return true;
}
return false;
}
/// hasNullFragReference - Return true if any DAG in the list references
/// the null_frag operator.
static bool hasNullFragReference(ListInit *LI) {
for (Init *I : LI->getValues()) {
DagInit *DI = dyn_cast<DagInit>(I);
assert(DI && "non-dag in an instruction Pattern list?!");
if (hasNullFragReference(DI))
return true;
}
return false;
}
/// Get all the instructions in a tree.
static void
getInstructionsInTree(TreePatternNode *Tree, SmallVectorImpl<Record*> &Instrs) {
if (Tree->isLeaf())
return;
if (Tree->getOperator()->isSubClassOf("Instruction"))
Instrs.push_back(Tree->getOperator());
for (unsigned i = 0, e = Tree->getNumChildren(); i != e; ++i)
getInstructionsInTree(Tree->getChild(i), Instrs);
}
/// Check the class of a pattern leaf node against the instruction operand it
/// represents.
static bool checkOperandClass(CGIOperandList::OperandInfo &OI,
Record *Leaf) {
if (OI.Rec == Leaf)
return true;
// Allow direct value types to be used in instruction set patterns.
// The type will be checked later.
if (Leaf->isSubClassOf("ValueType"))
return true;
// Patterns can also be ComplexPattern instances.
if (Leaf->isSubClassOf("ComplexPattern"))
return true;
return false;
}
const DAGInstruction &CodeGenDAGPatterns::parseInstructionPattern(
CodeGenInstruction &CGI, ListInit *Pat, DAGInstMap &DAGInsts) {
assert(!DAGInsts.count(CGI.TheDef) && "Instruction already parsed!");
// Parse the instruction.
auto I = llvm::make_unique<TreePattern>(CGI.TheDef, Pat, true, *this);
// Inline pattern fragments into it.
I->InlinePatternFragments();
// Infer as many types as possible. If we cannot infer all of them, we can
// never do anything with this instruction pattern: report it to the user.
if (!I->InferAllTypes())
I->error("Could not infer all types in pattern!");
// InstInputs - Keep track of all of the inputs of the instruction, along
// with the record they are declared as.
std::map<std::string, TreePatternNodePtr> InstInputs;
// InstResults - Keep track of all the virtual registers that are 'set'
// in the instruction, including what reg class they are.
std::map<std::string, TreePatternNodePtr> InstResults;
std::vector<Record*> InstImpResults;
// Verify that the top-level forms in the instruction are of void type, and
// fill in the InstResults map.
SmallString<32> TypesString;
for (unsigned j = 0, e = I->getNumTrees(); j != e; ++j) {
TypesString.clear();
TreePatternNodePtr Pat = I->getTree(j);
if (Pat->getNumTypes() != 0) {
raw_svector_ostream OS(TypesString);
for (unsigned k = 0, ke = Pat->getNumTypes(); k != ke; ++k) {
if (k > 0)
OS << ", ";
Pat->getExtType(k).writeToStream(OS);
}
I->error("Top-level forms in instruction pattern should have"
" void types, has types " +
OS.str());
}
// Find inputs and outputs, and verify the structure of the uses/defs.
FindPatternInputsAndOutputs(*I, Pat, InstInputs, InstResults,
InstImpResults);
}
// Now that we have inputs and outputs of the pattern, inspect the operands
// list for the instruction. This determines the order that operands are
// added to the machine instruction the node corresponds to.
unsigned NumResults = InstResults.size();
// Parse the operands list from the (ops) list, validating it.
assert(I->getArgList().empty() && "Args list should still be empty here!");
// Check that all of the results occur first in the list.
std::vector<Record*> Results;
SmallVector<TreePatternNodePtr, 2> ResNodes;
for (unsigned i = 0; i != NumResults; ++i) {
if (i == CGI.Operands.size())
I->error("'" + InstResults.begin()->first +
"' set but does not appear in operand list!");
const std::string &OpName = CGI.Operands[i].Name;
// Check that it exists in InstResults.
TreePatternNodePtr RNode = InstResults[OpName];
if (!RNode)
I->error("Operand $" + OpName + " does not exist in operand list!");
Record *R = cast<DefInit>(RNode->getLeafValue())->getDef();
ResNodes.push_back(std::move(RNode));
if (!R)
I->error("Operand $" + OpName + " should be a set destination: all "
"outputs must occur before inputs in operand list!");
if (!checkOperandClass(CGI.Operands[i], R))
I->error("Operand $" + OpName + " class mismatch!");
// Remember the return type.
Results.push_back(CGI.Operands[i].Rec);
// Okay, this one checks out.
InstResults.erase(OpName);
}
// Loop over the inputs next. Make a copy of InstInputs so we can destroy
// the copy while we're checking the inputs.
std::map<std::string, TreePatternNodePtr> InstInputsCheck(InstInputs);
std::vector<TreePatternNodePtr> ResultNodeOperands;
std::vector<Record*> Operands;
for (unsigned i = NumResults, e = CGI.Operands.size(); i != e; ++i) {
CGIOperandList::OperandInfo &Op = CGI.Operands[i];
const std::string &OpName = Op.Name;
if (OpName.empty())
I->error("Operand #" + Twine(i) + " in operands list has no name!");
if (!InstInputsCheck.count(OpName)) {
// If this is an operand with a DefaultOps set filled in, we can ignore
// this. When we codegen it, we will do so as always executed.
if (Op.Rec->isSubClassOf("OperandWithDefaultOps")) {
// Does it have a non-empty DefaultOps field? If so, ignore this
// operand.
if (!getDefaultOperand(Op.Rec).DefaultOps.empty())
continue;
}
I->error("Operand $" + OpName +
" does not appear in the instruction pattern");
}
TreePatternNodePtr InVal = InstInputsCheck[OpName];
InstInputsCheck.erase(OpName); // It occurred, remove from map.
if (InVal->isLeaf() && isa<DefInit>(InVal->getLeafValue())) {
Record *InRec = static_cast<DefInit*>(InVal->getLeafValue())->getDef();
if (!checkOperandClass(Op, InRec))
I->error("Operand $" + OpName + "'s register class disagrees"
" between the operand and pattern");
}
Operands.push_back(Op.Rec);
// Construct the result for the dest-pattern operand list.
TreePatternNodePtr OpNode = InVal->clone();
// No predicate is useful on the result.
OpNode->clearPredicateFns();
// Promote the xform function to be an explicit node if set.
if (Record *Xform = OpNode->getTransformFn()) {
OpNode->setTransformFn(nullptr);
std::vector<TreePatternNodePtr> Children;
Children.push_back(OpNode);
OpNode = std::make_shared<TreePatternNode>(Xform, Children,
OpNode->getNumTypes());
}
ResultNodeOperands.push_back(std::move(OpNode));
}
if (!InstInputsCheck.empty())
I->error("Input operand $" + InstInputsCheck.begin()->first +
" occurs in pattern but not in operands list!");
TreePatternNodePtr ResultPattern = std::make_shared<TreePatternNode>(
I->getRecord(), ResultNodeOperands,
GetNumNodeResults(I->getRecord(), *this));
// Copy fully inferred output node types to instruction result pattern.
for (unsigned i = 0; i != NumResults; ++i) {
assert(ResNodes[i]->getNumTypes() == 1 && "FIXME: Unhandled");
ResultPattern->setType(i, ResNodes[i]->getExtType(0));
}
// Create and insert the instruction.
// FIXME: InstImpResults should not be part of DAGInstruction.
Record *R = I->getRecord();
DAGInstruction &TheInst =
DAGInsts.emplace(std::piecewise_construct, std::forward_as_tuple(R),
std::forward_as_tuple(std::move(I), Results, Operands,
InstImpResults)).first->second;
// Use a temporary tree pattern to infer all types and make sure that the
// constructed result is correct. This depends on the instruction already
// being inserted into the DAGInsts map.
TreePattern Temp(TheInst.getPattern()->getRecord(), ResultPattern, false,
*this);
Temp.InferAllTypes(&TheInst.getPattern()->getNamedNodesMap());
TheInst.setResultPattern(Temp.getOnlyTree());
return TheInst;
}
/// ParseInstructions - Parse all of the instructions, inlining and resolving
/// any fragments involved. This populates the Instructions list with fully
/// resolved instructions.
void CodeGenDAGPatterns::ParseInstructions() {
std::vector<Record*> Instrs = Records.getAllDerivedDefinitions("Instruction");
for (Record *Instr : Instrs) {
ListInit *LI = nullptr;
if (isa<ListInit>(Instr->getValueInit("Pattern")))
LI = Instr->getValueAsListInit("Pattern");
// If there is no pattern, only collect minimal information about the
// instruction for its operand list. We have to assume that there is one
// result, as we have no detailed info. A pattern which references the
// null_frag operator is as-if no pattern were specified. Normally this
// is from a multiclass expansion w/ a SDPatternOperator passed in as
// null_frag.
if (!LI || LI->empty() || hasNullFragReference(LI)) {
std::vector<Record*> Results;
std::vector<Record*> Operands;
CodeGenInstruction &InstInfo = Target.getInstruction(Instr);
if (InstInfo.Operands.size() != 0) {
for (unsigned j = 0, e = InstInfo.Operands.NumDefs; j < e; ++j)
Results.push_back(InstInfo.Operands[j].Rec);
// The rest are inputs.
for (unsigned j = InstInfo.Operands.NumDefs,
e = InstInfo.Operands.size(); j < e; ++j)
Operands.push_back(InstInfo.Operands[j].Rec);
}
// Create and insert the instruction.
std::vector<Record*> ImpResults;
Instructions.insert(std::make_pair(Instr,
DAGInstruction(nullptr, Results, Operands, ImpResults)));
continue; // no pattern.
}
CodeGenInstruction &CGI = Target.getInstruction(Instr);
const DAGInstruction &DI = parseInstructionPattern(CGI, LI, Instructions);
(void)DI;
LLVM_DEBUG(DI.getPattern()->dump());
}
// If we can, convert the instructions to be patterns that are matched!
for (auto &Entry : Instructions) {
DAGInstruction &TheInst = Entry.second;
TreePattern *I = TheInst.getPattern();
if (!I) continue; // No pattern.
if (PatternRewriter)
PatternRewriter(I);
// FIXME: Assume only the first tree is the pattern. The others are clobber
// nodes.
TreePatternNodePtr Pattern = I->getTree(0);
TreePatternNodePtr SrcPattern;
if (Pattern->getOperator()->getName() == "set") {
SrcPattern = Pattern->getChild(Pattern->getNumChildren()-1)->clone();
} else{
// Not a set (store or something?)
SrcPattern = Pattern;
}
Record *Instr = Entry.first;
ListInit *Preds = Instr->getValueAsListInit("Predicates");
int Complexity = Instr->getValueAsInt("AddedComplexity");
AddPatternToMatch(
I,
PatternToMatch(Instr, makePredList(Preds), SrcPattern,
TheInst.getResultPattern(), TheInst.getImpResults(),
Complexity, Instr->getID()));
}
}
typedef std::pair<TreePatternNode *, unsigned> NameRecord;
static void FindNames(TreePatternNode *P,
std::map<std::string, NameRecord> &Names,
TreePattern *PatternTop) {
if (!P->getName().empty()) {
NameRecord &Rec = Names[P->getName()];
// If this is the first instance of the name, remember the node.
if (Rec.second++ == 0)
Rec.first = P;
else if (Rec.first->getExtTypes() != P->getExtTypes())
PatternTop->error("repetition of value: $" + P->getName() +
" where different uses have different types!");
}
if (!P->isLeaf()) {
for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i)
FindNames(P->getChild(i), Names, PatternTop);
}
}
std::vector<Predicate> CodeGenDAGPatterns::makePredList(ListInit *L) {
std::vector<Predicate> Preds;
for (Init *I : L->getValues()) {
if (DefInit *Pred = dyn_cast<DefInit>(I))
Preds.push_back(Pred->getDef());
else
llvm_unreachable("Non-def on the list");
}
// Sort so that different orders get canonicalized to the same string.
llvm::sort(Preds.begin(), Preds.end());
return Preds;
}
void CodeGenDAGPatterns::AddPatternToMatch(TreePattern *Pattern,
PatternToMatch &&PTM) {
// Do some sanity checking on the pattern we're about to match.
std::string Reason;
if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this)) {
PrintWarning(Pattern->getRecord()->getLoc(),
Twine("Pattern can never match: ") + Reason);
return;
}
// If the source pattern's root is a complex pattern, that complex pattern
// must specify the nodes it can potentially match.
if (const ComplexPattern *CP =
PTM.getSrcPattern()->getComplexPatternInfo(*this))
if (CP->getRootNodes().empty())
Pattern->error("ComplexPattern at root must specify list of opcodes it"
" could match");
// Find all of the named values in the input and output, ensure they have the
// same type.
std::map<std::string, NameRecord> SrcNames, DstNames;
FindNames(PTM.getSrcPattern(), SrcNames, Pattern);
FindNames(PTM.getDstPattern(), DstNames, Pattern);
// Scan all of the named values in the destination pattern, rejecting them if
// they don't exist in the input pattern.
for (const auto &Entry : DstNames) {
if (SrcNames[Entry.first].first == nullptr)
Pattern->error("Pattern has input without matching name in output: $" +
Entry.first);
}
// Scan all of the named values in the source pattern, rejecting them if the
// name isn't used in the dest, and isn't used to tie two values together.
for (const auto &Entry : SrcNames)
if (DstNames[Entry.first].first == nullptr &&
SrcNames[Entry.first].second == 1)
Pattern->error("Pattern has dead named input: $" + Entry.first);
PatternsToMatch.push_back(PTM);
}
void CodeGenDAGPatterns::InferInstructionFlags() {
ArrayRef<const CodeGenInstruction*> Instructions =
Target.getInstructionsByEnumValue();
// First try to infer flags from the primary instruction pattern, if any.
SmallVector<CodeGenInstruction*, 8> Revisit;
unsigned Errors = 0;
for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
CodeGenInstruction &InstInfo =
const_cast<CodeGenInstruction &>(*Instructions[i]);
// Get the primary instruction pattern.
const TreePattern *Pattern = getInstruction(InstInfo.TheDef).getPattern();
if (!Pattern) {
if (InstInfo.hasUndefFlags())
Revisit.push_back(&InstInfo);
continue;
}
InstAnalyzer PatInfo(*this);
PatInfo.Analyze(Pattern);
Errors += InferFromPattern(InstInfo, PatInfo, InstInfo.TheDef);
}
// Second, look for single-instruction patterns defined outside the
// instruction.
for (const PatternToMatch &PTM : ptms()) {
// We can only infer from single-instruction patterns, otherwise we won't
// know which instruction should get the flags.
SmallVector<Record*, 8> PatInstrs;
getInstructionsInTree(PTM.getDstPattern(), PatInstrs);
if (PatInstrs.size() != 1)
continue;
// Get the single instruction.
CodeGenInstruction &InstInfo = Target.getInstruction(PatInstrs.front());
// Only infer properties from the first pattern. We'll verify the others.
if (InstInfo.InferredFrom)
continue;
InstAnalyzer PatInfo(*this);
PatInfo.Analyze(PTM);
Errors += InferFromPattern(InstInfo, PatInfo, PTM.getSrcRecord());
}
if (Errors)
PrintFatalError("pattern conflicts");
// Revisit instructions with undefined flags and no pattern.
if (Target.guessInstructionProperties()) {
for (CodeGenInstruction *InstInfo : Revisit) {
if (InstInfo->InferredFrom)
continue;
// The mayLoad and mayStore flags default to false.
// Conservatively assume hasSideEffects if it wasn't explicit.
if (InstInfo->hasSideEffects_Unset)
InstInfo->hasSideEffects = true;
}
return;
}
// Complain about any flags that are still undefined.
for (CodeGenInstruction *InstInfo : Revisit) {
if (InstInfo->InferredFrom)
continue;
if (InstInfo->hasSideEffects_Unset)
PrintError(InstInfo->TheDef->getLoc(),
"Can't infer hasSideEffects from patterns");
if (InstInfo->mayStore_Unset)
PrintError(InstInfo->TheDef->getLoc(),
"Can't infer mayStore from patterns");
if (InstInfo->mayLoad_Unset)
PrintError(InstInfo->TheDef->getLoc(),
"Can't infer mayLoad from patterns");
}
}
/// Verify instruction flags against pattern node properties.
void CodeGenDAGPatterns::VerifyInstructionFlags() {
unsigned Errors = 0;
for (ptm_iterator I = ptm_begin(), E = ptm_end(); I != E; ++I) {
const PatternToMatch &PTM = *I;
SmallVector<Record*, 8> Instrs;
getInstructionsInTree(PTM.getDstPattern(), Instrs);
if (Instrs.empty())
continue;
// Count the number of instructions with each flag set.
unsigned NumSideEffects = 0;
unsigned NumStores = 0;
unsigned NumLoads = 0;
for (const Record *Instr : Instrs) {
const CodeGenInstruction &InstInfo = Target.getInstruction(Instr);
NumSideEffects += InstInfo.hasSideEffects;
NumStores += InstInfo.mayStore;
NumLoads += InstInfo.mayLoad;
}
// Analyze the source pattern.
InstAnalyzer PatInfo(*this);
PatInfo.Analyze(PTM);
// Collect error messages.
SmallVector<std::string, 4> Msgs;
// Check for missing flags in the output.
// Permit extra flags for now at least.
if (PatInfo.hasSideEffects && !NumSideEffects)
Msgs.push_back("pattern has side effects, but hasSideEffects isn't set");
// Don't verify store flags on instructions with side effects. At least for
// intrinsics, side effects implies mayStore.
if (!PatInfo.hasSideEffects && PatInfo.mayStore && !NumStores)
Msgs.push_back("pattern may store, but mayStore isn't set");
// Similarly, mayStore implies mayLoad on intrinsics.
if (!PatInfo.mayStore && PatInfo.mayLoad && !NumLoads)
Msgs.push_back("pattern may load, but mayLoad isn't set");
// Print error messages.
if (Msgs.empty())
continue;
++Errors;
for (const std::string &Msg : Msgs)
PrintError(PTM.getSrcRecord()->getLoc(), Twine(Msg) + " on the " +
(Instrs.size() == 1 ?
"instruction" : "output instructions"));
// Provide the location of the relevant instruction definitions.
for (const Record *Instr : Instrs) {
if (Instr != PTM.getSrcRecord())
PrintError(Instr->getLoc(), "defined here");
const CodeGenInstruction &InstInfo = Target.getInstruction(Instr);
if (InstInfo.InferredFrom &&
InstInfo.InferredFrom != InstInfo.TheDef &&
InstInfo.InferredFrom != PTM.getSrcRecord())
PrintError(InstInfo.InferredFrom->getLoc(), "inferred from pattern");
}
}
if (Errors)
PrintFatalError("Errors in DAG patterns");
}
/// Given a pattern result with an unresolved type, see if we can find one
/// instruction with an unresolved result type. Force this result type to an
/// arbitrary element if it's possible types to converge results.
static bool ForceArbitraryInstResultType(TreePatternNode *N, TreePattern &TP) {
if (N->isLeaf())
return false;
// Analyze children.
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
if (ForceArbitraryInstResultType(N->getChild(i), TP))
return true;
if (!N->getOperator()->isSubClassOf("Instruction"))
return false;
// If this type is already concrete or completely unknown we can't do
// anything.
TypeInfer &TI = TP.getInfer();
for (unsigned i = 0, e = N->getNumTypes(); i != e; ++i) {
if (N->getExtType(i).empty() || TI.isConcrete(N->getExtType(i), false))
continue;
// Otherwise, force its type to an arbitrary choice.
if (TI.forceArbitrary(N->getExtType(i)))
return true;
}
return false;
}
void CodeGenDAGPatterns::ParsePatterns() {
std::vector<Record*> Patterns = Records.getAllDerivedDefinitions("Pattern");
for (Record *CurPattern : Patterns) {
DagInit *Tree = CurPattern->getValueAsDag("PatternToMatch");
// If the pattern references the null_frag, there's nothing to do.
if (hasNullFragReference(Tree))
continue;
TreePattern Pattern(CurPattern, Tree, true, *this);
// Inline pattern fragments into it.
Pattern.InlinePatternFragments();
ListInit *LI = CurPattern->getValueAsListInit("ResultInstrs");
if (LI->empty()) continue; // no pattern.
// Parse the instruction.
TreePattern Result(CurPattern, LI, false, *this);
// Inline pattern fragments into it.
Result.InlinePatternFragments();
if (Result.getNumTrees() != 1)
Result.error("Cannot handle instructions producing instructions "
"with temporaries yet!");
bool IterateInference;
bool InferredAllPatternTypes, InferredAllResultTypes;
do {
// Infer as many types as possible. If we cannot infer all of them, we
// can never do anything with this pattern: report it to the user.
InferredAllPatternTypes =
Pattern.InferAllTypes(&Pattern.getNamedNodesMap());
// Infer as many types as possible. If we cannot infer all of them, we
// can never do anything with this pattern: report it to the user.
InferredAllResultTypes =
Result.InferAllTypes(&Pattern.getNamedNodesMap());
IterateInference = false;
// Apply the type of the result to the source pattern. This helps us
// resolve cases where the input type is known to be a pointer type (which
// is considered resolved), but the result knows it needs to be 32- or
// 64-bits. Infer the other way for good measure.
for (unsigned i = 0, e = std::min(Result.getTree(0)->getNumTypes(),
Pattern.getTree(0)->getNumTypes());
i != e; ++i) {
IterateInference = Pattern.getTree(0)->UpdateNodeType(
i, Result.getTree(0)->getExtType(i), Result);
IterateInference |= Result.getTree(0)->UpdateNodeType(
i, Pattern.getTree(0)->getExtType(i), Result);
}
// If our iteration has converged and the input pattern's types are fully
// resolved but the result pattern is not fully resolved, we may have a
// situation where we have two instructions in the result pattern and
// the instructions require a common register class, but don't care about
// what actual MVT is used. This is actually a bug in our modelling:
// output patterns should have register classes, not MVTs.
//
// In any case, to handle this, we just go through and disambiguate some
// arbitrary types to the result pattern's nodes.
if (!IterateInference && InferredAllPatternTypes &&
!InferredAllResultTypes)
IterateInference =
ForceArbitraryInstResultType(Result.getTree(0).get(), Result);
} while (IterateInference);
// Verify that we inferred enough types that we can do something with the
// pattern and result. If these fire the user has to add type casts.
if (!InferredAllPatternTypes)
Pattern.error("Could not infer all types in pattern!");
if (!InferredAllResultTypes) {
Pattern.dump();
Result.error("Could not infer all types in pattern result!");
}
// Validate that the input pattern is correct.
std::map<std::string, TreePatternNodePtr> InstInputs;
std::map<std::string, TreePatternNodePtr> InstResults;
std::vector<Record*> InstImpResults;
for (unsigned j = 0, ee = Pattern.getNumTrees(); j != ee; ++j)
FindPatternInputsAndOutputs(Pattern, Pattern.getTree(j), InstInputs,
InstResults, InstImpResults);
// Promote the xform function to be an explicit node if set.
const TreePatternNodePtr &DstPattern = Result.getOnlyTree();
std::vector<TreePatternNodePtr> ResultNodeOperands;
for (unsigned ii = 0, ee = DstPattern->getNumChildren(); ii != ee; ++ii) {
TreePatternNodePtr OpNode = DstPattern->getChildShared(ii);
if (Record *Xform = OpNode->getTransformFn()) {
OpNode->setTransformFn(nullptr);
std::vector<TreePatternNodePtr> Children;
Children.push_back(OpNode);
OpNode = std::make_shared<TreePatternNode>(Xform, Children,
OpNode->getNumTypes());
}
ResultNodeOperands.push_back(OpNode);
}
TreePatternNodePtr DstShared =
DstPattern->isLeaf()
? DstPattern
: std::make_shared<TreePatternNode>(DstPattern->getOperator(),
ResultNodeOperands,
DstPattern->getNumTypes());
for (unsigned i = 0, e = Result.getOnlyTree()->getNumTypes(); i != e; ++i)
DstShared->setType(i, Result.getOnlyTree()->getExtType(i));
TreePattern Temp(Result.getRecord(), DstShared, false, *this);
Temp.InferAllTypes();
// A pattern may end up with an "impossible" type, i.e. a situation
// where all types have been eliminated for some node in this pattern.
// This could occur for intrinsics that only make sense for a specific
// value type, and use a specific register class. If, for some mode,
// that register class does not accept that type, the type inference
// will lead to a contradiction, which is not an error however, but
// a sign that this pattern will simply never match.
if (Pattern.getTree(0)->hasPossibleType() &&
Temp.getOnlyTree()->hasPossibleType()) {
ListInit *Preds = CurPattern->getValueAsListInit("Predicates");
int Complexity = CurPattern->getValueAsInt("AddedComplexity");
if (PatternRewriter)
PatternRewriter(&Pattern);
AddPatternToMatch(&Pattern,
PatternToMatch(CurPattern, makePredList(Preds),
Pattern.getTree(0), Temp.getOnlyTree(),
std::move(InstImpResults), Complexity,
CurPattern->getID()));
}
}
}
static void collectModes(std::set<unsigned> &Modes, const TreePatternNode *N) {
for (const TypeSetByHwMode &VTS : N->getExtTypes())
for (const auto &I : VTS)
Modes.insert(I.first);
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
collectModes(Modes, N->getChild(i));
}
void CodeGenDAGPatterns::ExpandHwModeBasedTypes() {
const CodeGenHwModes &CGH = getTargetInfo().getHwModes();
std::map<unsigned,std::vector<Predicate>> ModeChecks;
std::vector<PatternToMatch> Copy = PatternsToMatch;
PatternsToMatch.clear();
auto AppendPattern = [this, &ModeChecks](PatternToMatch &P, unsigned Mode) {
TreePatternNodePtr NewSrc = P.SrcPattern->clone();
TreePatternNodePtr NewDst = P.DstPattern->clone();
if (!NewSrc->setDefaultMode(Mode) || !NewDst->setDefaultMode(Mode)) {
return;
}
std::vector<Predicate> Preds = P.Predicates;
const std::vector<Predicate> &MC = ModeChecks[Mode];
Preds.insert(Preds.end(), MC.begin(), MC.end());
PatternsToMatch.emplace_back(P.getSrcRecord(), Preds, std::move(NewSrc),
std::move(NewDst), P.getDstRegs(),
P.getAddedComplexity(), Record::getNewUID(),
Mode);
};
for (PatternToMatch &P : Copy) {
TreePatternNodePtr SrcP = nullptr, DstP = nullptr;
if (P.SrcPattern->hasProperTypeByHwMode())
SrcP = P.SrcPattern;
if (P.DstPattern->hasProperTypeByHwMode())
DstP = P.DstPattern;
if (!SrcP && !DstP) {
PatternsToMatch.push_back(P);
continue;
}
std::set<unsigned> Modes;
if (SrcP)
collectModes(Modes, SrcP.get());
if (DstP)
collectModes(Modes, DstP.get());
// The predicate for the default mode needs to be constructed for each
// pattern separately.
// Since not all modes must be present in each pattern, if a mode m is
// absent, then there is no point in constructing a check for m. If such
// a check was created, it would be equivalent to checking the default
// mode, except not all modes' predicates would be a part of the checking
// code. The subsequently generated check for the default mode would then
// have the exact same patterns, but a different predicate code. To avoid
// duplicated patterns with different predicate checks, construct the
// default check as a negation of all predicates that are actually present
// in the source/destination patterns.
std::vector<Predicate> DefaultPred;
for (unsigned M : Modes) {
if (M == DefaultMode)
continue;
if (ModeChecks.find(M) != ModeChecks.end())
continue;
// Fill the map entry for this mode.
const HwMode &HM = CGH.getMode(M);
ModeChecks[M].emplace_back(Predicate(HM.Features, true));
// Add negations of the HM's predicates to the default predicate.
DefaultPred.emplace_back(Predicate(HM.Features, false));
}
for (unsigned M : Modes) {
if (M == DefaultMode)
continue;
AppendPattern(P, M);
}
bool HasDefault = Modes.count(DefaultMode);
if (HasDefault)
AppendPattern(P, DefaultMode);
}
}
/// Dependent variable map for CodeGenDAGPattern variant generation
typedef StringMap<int> DepVarMap;
static void FindDepVarsOf(TreePatternNode *N, DepVarMap &DepMap) {
if (N->isLeaf()) {
if (N->hasName() && isa<DefInit>(N->getLeafValue()))
DepMap[N->getName()]++;
} else {
for (size_t i = 0, e = N->getNumChildren(); i != e; ++i)
FindDepVarsOf(N->getChild(i), DepMap);
}
}
/// Find dependent variables within child patterns
static void FindDepVars(TreePatternNode *N, MultipleUseVarSet &DepVars) {
DepVarMap depcounts;
FindDepVarsOf(N, depcounts);
for (const auto &Pair : depcounts) {
if (Pair.getValue() > 1)
DepVars.insert(Pair.getKey());
}
}
#ifndef NDEBUG
/// Dump the dependent variable set:
static void DumpDepVars(MultipleUseVarSet &DepVars) {
if (DepVars.empty()) {
LLVM_DEBUG(errs() << "<empty set>");
} else {
LLVM_DEBUG(errs() << "[ ");
for (const auto &DepVar : DepVars) {
LLVM_DEBUG(errs() << DepVar.getKey() << " ");
}
LLVM_DEBUG(errs() << "]");
}
}
#endif
/// CombineChildVariants - Given a bunch of permutations of each child of the
/// 'operator' node, put them together in all possible ways.
static void CombineChildVariants(
TreePatternNodePtr Orig,
const std::vector<std::vector<TreePatternNodePtr>> &ChildVariants,
std::vector<TreePatternNodePtr> &OutVariants, CodeGenDAGPatterns &CDP,
const MultipleUseVarSet &DepVars) {
// Make sure that each operand has at least one variant to choose from.
for (const auto &Variants : ChildVariants)
if (Variants.empty())
return;
// The end result is an all-pairs construction of the resultant pattern.
std::vector<unsigned> Idxs;
Idxs.resize(ChildVariants.size());
bool NotDone;
do {
#ifndef NDEBUG
LLVM_DEBUG(if (!Idxs.empty()) {
errs() << Orig->getOperator()->getName() << ": Idxs = [ ";
for (unsigned Idx : Idxs) {
errs() << Idx << " ";
}
errs() << "]\n";
});
#endif
// Create the variant and add it to the output list.
std::vector<TreePatternNodePtr> NewChildren;
for (unsigned i = 0, e = ChildVariants.size(); i != e; ++i)
NewChildren.push_back(ChildVariants[i][Idxs[i]]);
TreePatternNodePtr R = std::make_shared<TreePatternNode>(
Orig->getOperator(), NewChildren, Orig->getNumTypes());
// Copy over properties.
R->setName(Orig->getName());
R->setPredicateFns(Orig->getPredicateFns());
R->setTransformFn(Orig->getTransformFn());
for (unsigned i = 0, e = Orig->getNumTypes(); i != e; ++i)
R->setType(i, Orig->getExtType(i));
// If this pattern cannot match, do not include it as a variant.
std::string ErrString;
// Scan to see if this pattern has already been emitted. We can get
// duplication due to things like commuting:
// (and GPRC:$a, GPRC:$b) -> (and GPRC:$b, GPRC:$a)
// which are the same pattern. Ignore the dups.
if (R->canPatternMatch(ErrString, CDP) &&
none_of(OutVariants, [&](TreePatternNodePtr Variant) {
return R->isIsomorphicTo(Variant.get(), DepVars);
}))
OutVariants.push_back(R);
// Increment indices to the next permutation by incrementing the
// indices from last index backward, e.g., generate the sequence
// [0, 0], [0, 1], [1, 0], [1, 1].
int IdxsIdx;
for (IdxsIdx = Idxs.size() - 1; IdxsIdx >= 0; --IdxsIdx) {
if (++Idxs[IdxsIdx] == ChildVariants[IdxsIdx].size())
Idxs[IdxsIdx] = 0;
else
break;
}
NotDone = (IdxsIdx >= 0);
} while (NotDone);
}
/// CombineChildVariants - A helper function for binary operators.
///
static void CombineChildVariants(TreePatternNodePtr Orig,
const std::vector<TreePatternNodePtr> &LHS,
const std::vector<TreePatternNodePtr> &RHS,
std::vector<TreePatternNodePtr> &OutVariants,
CodeGenDAGPatterns &CDP,
const MultipleUseVarSet &DepVars) {
std::vector<std::vector<TreePatternNodePtr>> ChildVariants;
ChildVariants.push_back(LHS);
ChildVariants.push_back(RHS);
CombineChildVariants(Orig, ChildVariants, OutVariants, CDP, DepVars);
}
static void
GatherChildrenOfAssociativeOpcode(TreePatternNodePtr N,
std::vector<TreePatternNodePtr> &Children) {
assert(N->getNumChildren()==2 &&"Associative but doesn't have 2 children!");
Record *Operator = N->getOperator();
// Only permit raw nodes.
if (!N->getName().empty() || !N->getPredicateFns().empty() ||
N->getTransformFn()) {
Children.push_back(N);
return;
}
if (N->getChild(0)->isLeaf() || N->getChild(0)->getOperator() != Operator)
Children.push_back(N->getChildShared(0));
else
GatherChildrenOfAssociativeOpcode(N->getChildShared(0), Children);
if (N->getChild(1)->isLeaf() || N->getChild(1)->getOperator() != Operator)
Children.push_back(N->getChildShared(1));
else
GatherChildrenOfAssociativeOpcode(N->getChildShared(1), Children);
}
/// GenerateVariantsOf - Given a pattern N, generate all permutations we can of
/// the (potentially recursive) pattern by using algebraic laws.
///
static void GenerateVariantsOf(TreePatternNodePtr N,
std::vector<TreePatternNodePtr> &OutVariants,
CodeGenDAGPatterns &CDP,
const MultipleUseVarSet &DepVars) {
// We cannot permute leaves or ComplexPattern uses.
if (N->isLeaf() || N->getOperator()->isSubClassOf("ComplexPattern")) {
OutVariants.push_back(N);
return;
}
// Look up interesting info about the node.
const SDNodeInfo &NodeInfo = CDP.getSDNodeInfo(N->getOperator());
// If this node is associative, re-associate.
if (NodeInfo.hasProperty(SDNPAssociative)) {
// Re-associate by pulling together all of the linked operators
std::vector<TreePatternNodePtr> MaximalChildren;
GatherChildrenOfAssociativeOpcode(N, MaximalChildren);
// Only handle child sizes of 3. Otherwise we'll end up trying too many
// permutations.
if (MaximalChildren.size() == 3) {
// Find the variants of all of our maximal children.
std::vector<TreePatternNodePtr> AVariants, BVariants, CVariants;
GenerateVariantsOf(MaximalChildren[0], AVariants, CDP, DepVars);
GenerateVariantsOf(MaximalChildren[1], BVariants, CDP, DepVars);
GenerateVariantsOf(MaximalChildren[2], CVariants, CDP, DepVars);
// There are only two ways we can permute the tree:
// (A op B) op C and A op (B op C)
// Within these forms, we can also permute A/B/C.
// Generate legal pair permutations of A/B/C.
std::vector<TreePatternNodePtr> ABVariants;
std::vector<TreePatternNodePtr> BAVariants;
std::vector<TreePatternNodePtr> ACVariants;
std::vector<TreePatternNodePtr> CAVariants;
std::vector<TreePatternNodePtr> BCVariants;
std::vector<TreePatternNodePtr> CBVariants;
CombineChildVariants(N, AVariants, BVariants, ABVariants, CDP, DepVars);
CombineChildVariants(N, BVariants, AVariants, BAVariants, CDP, DepVars);
CombineChildVariants(N, AVariants, CVariants, ACVariants, CDP, DepVars);
CombineChildVariants(N, CVariants, AVariants, CAVariants, CDP, DepVars);
CombineChildVariants(N, BVariants, CVariants, BCVariants, CDP, DepVars);
CombineChildVariants(N, CVariants, BVariants, CBVariants, CDP, DepVars);
// Combine those into the result: (x op x) op x
CombineChildVariants(N, ABVariants, CVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, BAVariants, CVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, ACVariants, BVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, CAVariants, BVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, BCVariants, AVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, CBVariants, AVariants, OutVariants, CDP, DepVars);
// Combine those into the result: x op (x op x)
CombineChildVariants(N, CVariants, ABVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, CVariants, BAVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, BVariants, ACVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, BVariants, CAVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, AVariants, BCVariants, OutVariants, CDP, DepVars);
CombineChildVariants(N, AVariants, CBVariants, OutVariants, CDP, DepVars);
return;
}
}
// Compute permutations of all children.
std::vector<std::vector<TreePatternNodePtr>> ChildVariants;
ChildVariants.resize(N->getNumChildren());
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
GenerateVariantsOf(N->getChildShared(i), ChildVariants[i], CDP, DepVars);
// Build all permutations based on how the children were formed.
CombineChildVariants(N, ChildVariants, OutVariants, CDP, DepVars);
// If this node is commutative, consider the commuted order.
bool isCommIntrinsic = N->isCommutativeIntrinsic(CDP);
if (NodeInfo.hasProperty(SDNPCommutative) || isCommIntrinsic) {
assert((N->getNumChildren()>=2 || isCommIntrinsic) &&
"Commutative but doesn't have 2 children!");
// Don't count children which are actually register references.
unsigned NC = 0;
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {
TreePatternNode *Child = N->getChild(i);
if (Child->isLeaf())
if (DefInit *DI = dyn_cast<DefInit>(Child->getLeafValue())) {
Record *RR = DI->getDef();
if (RR->isSubClassOf("Register"))
continue;
}
NC++;
}
// Consider the commuted order.
if (isCommIntrinsic) {
// Commutative intrinsic. First operand is the intrinsic id, 2nd and 3rd
// operands are the commutative operands, and there might be more operands
// after those.
assert(NC >= 3 &&
"Commutative intrinsic should have at least 3 children!");
std::vector<std::vector<TreePatternNodePtr>> Variants;
Variants.push_back(std::move(ChildVariants[0])); // Intrinsic id.
Variants.push_back(std::move(ChildVariants[2]));
Variants.push_back(std::move(ChildVariants[1]));
for (unsigned i = 3; i != NC; ++i)
Variants.push_back(std::move(ChildVariants[i]));
CombineChildVariants(N, Variants, OutVariants, CDP, DepVars);
} else if (NC == N->getNumChildren()) {
std::vector<std::vector<TreePatternNodePtr>> Variants;
Variants.push_back(std::move(ChildVariants[1]));
Variants.push_back(std::move(ChildVariants[0]));
for (unsigned i = 2; i != NC; ++i)
Variants.push_back(std::move(ChildVariants[i]));
CombineChildVariants(N, Variants, OutVariants, CDP, DepVars);
}
}
}
// GenerateVariants - Generate variants. For example, commutative patterns can
// match multiple ways. Add them to PatternsToMatch as well.
void CodeGenDAGPatterns::GenerateVariants() {
LLVM_DEBUG(errs() << "Generating instruction variants.\n");
// Loop over all of the patterns we've collected, checking to see if we can
// generate variants of the instruction, through the exploitation of
// identities. This permits the target to provide aggressive matching without
// the .td file having to contain tons of variants of instructions.
//
// Note that this loop adds new patterns to the PatternsToMatch list, but we
// intentionally do not reconsider these. Any variants of added patterns have
// already been added.
//
for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) {
MultipleUseVarSet DepVars;
std::vector<TreePatternNodePtr> Variants;
FindDepVars(PatternsToMatch[i].getSrcPattern(), DepVars);
LLVM_DEBUG(errs() << "Dependent/multiply used variables: ");
LLVM_DEBUG(DumpDepVars(DepVars));
LLVM_DEBUG(errs() << "\n");
GenerateVariantsOf(PatternsToMatch[i].getSrcPatternShared(), Variants,
*this, DepVars);
assert(!Variants.empty() && "Must create at least original variant!");
if (Variants.size() == 1) // No additional variants for this pattern.
continue;
LLVM_DEBUG(errs() << "FOUND VARIANTS OF: ";
PatternsToMatch[i].getSrcPattern()->dump(); errs() << "\n");
for (unsigned v = 0, e = Variants.size(); v != e; ++v) {
TreePatternNodePtr Variant = Variants[v];
LLVM_DEBUG(errs() << " VAR#" << v << ": "; Variant->dump();
errs() << "\n");
// Scan to see if an instruction or explicit pattern already matches this.
bool AlreadyExists = false;
for (unsigned p = 0, e = PatternsToMatch.size(); p != e; ++p) {
// Skip if the top level predicates do not match.
if (PatternsToMatch[i].getPredicates() !=
PatternsToMatch[p].getPredicates())
continue;
// Check to see if this variant already exists.
if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern(),
DepVars)) {
LLVM_DEBUG(errs() << " *** ALREADY EXISTS, ignoring variant.\n");
AlreadyExists = true;
break;
}
}
// If we already have it, ignore the variant.
if (AlreadyExists) continue;
// Otherwise, add it to the list of patterns we have.
PatternsToMatch.push_back(PatternToMatch(
PatternsToMatch[i].getSrcRecord(), PatternsToMatch[i].getPredicates(),
Variant, PatternsToMatch[i].getDstPatternShared(),
PatternsToMatch[i].getDstRegs(),
PatternsToMatch[i].getAddedComplexity(), Record::getNewUID()));
}
LLVM_DEBUG(errs() << "\n");
}
}
|
[
"1634054493@qq.com"
] |
1634054493@qq.com
|
603eb5b01d302a8b7a77ed71ff246b89404c730f
|
128dbe5cb2898497ec87d75ef1bb9cad14abd427
|
/test/doctest-rapidcheck.hpp
|
a2b9d9c4e53bd68b87b8853ada3cadb96ae5e4a1
|
[
"MIT"
] |
permissive
|
objectx/cpp-clockwork-base32
|
569f65c68889e31cf4823dd030d82ca9db56ea8d
|
441d21ec1ae4beb32372f4bfa9290f006671e76d
|
refs/heads/master
| 2022-12-04T23:52:34.370369
| 2020-08-10T16:45:57
| 2020-08-10T16:45:57
| 282,008,617
| 4
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,100
|
hpp
|
/// @brief Helper function for using the `rapidcheck` under the `doctest`.
#pragma once
#include <doctest/doctest.h>
#include <rapidcheck.h>
#include <utility>
namespace rc {
template <typename Testable_>
void prop (const std::string &description, Testable_ &&testable) {
using namespace detail;
DOCTEST_SUBCASE(description.c_str()) {
const auto result = checkTestable(std::forward<Testable_>(testable));
if (result.template is<SuccessResult> ()) {
const auto success = result.template get<SuccessResult> ();
if (! success.distribution.empty ()) {
std::cout << "- " << description << '\n';
printResultMessage (result, std::cout);
std::cout << std::endl;
}
}
else {
std::ostringstream ss;
printResultMessage (result, ss);
DOCTEST_FAIL_CHECK (ss.str() << "\n");
}
}
}
}
|
[
"objectxtreme@gmail.com"
] |
objectxtreme@gmail.com
|
58cdee96c85f35cac02cc2dd5b984ebe067c0fd3
|
4dc9caed5cb3f4639587d3d596a82cd748254045
|
/lib/jsrt/jsrtRuntime.cpp
|
4c6f8d7501d0a7046c1b54cd2558c73d7e0ff751
|
[
"MIT"
] |
permissive
|
jkrems/ChakraCore
|
2e68c27a8a278c36bfa144f77dbd79398279c52b
|
59b31e5821b7b8df3ed1f5021ed971da82cde9e1
|
refs/heads/master
| 2021-01-18T04:42:10.298111
| 2016-01-22T23:45:30
| 2016-01-22T23:45:30
| 50,215,307
| 2
| 0
| null | 2016-01-23T00:06:01
| 2016-01-23T00:06:00
| null |
UTF-8
|
C++
| false
| false
| 3,753
|
cpp
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#include <JsrtPch.h>
#include "JsrtRuntime.h"
#include "Base\ThreadContextTLSEntry.h"
#include "Base\ThreadBoundThreadContextManager.h"
JsrtRuntime::JsrtRuntime(ThreadContext * threadContext, bool useIdle, bool dispatchExceptions)
{
Assert(threadContext != NULL);
this->threadContext = threadContext;
this->contextList = NULL;
this->collectCallback = NULL;
this->beforeCollectCallback = NULL;
this->callbackContext = NULL;
this->allocationPolicyManager = threadContext->GetAllocationPolicyManager();
this->useIdle = useIdle;
this->dispatchExceptions = dispatchExceptions;
if (useIdle)
{
this->threadService.Initialize(threadContext);
}
threadContext->SetJSRTRuntime(this);
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
serializeByteCodeForLibrary = false;
#endif
}
JsrtRuntime::~JsrtRuntime()
{
HeapDelete(allocationPolicyManager);
}
// This is called at process detach.
// threadcontext created from runtime should not be destroyed in ThreadBoundThreadContext
// we should clean them up at process detach only as runtime can be used in other threads
// even after the current physical thread was destroyed.
// This is called after ThreadBoundThreadContext are cleaned up, so the remaining items
// in the globalthreadContext linklist should be for jsrt only.
void JsrtRuntime::Uninitialize()
{
ThreadContext* currentThreadContext = ThreadContext::GetThreadContextList();
ThreadContext* tmpThreadContext;
while (currentThreadContext)
{
Assert(!currentThreadContext->IsScriptActive());
JsrtRuntime* currentRuntime = static_cast<JsrtRuntime*>(currentThreadContext->GetJSRTRuntime());
tmpThreadContext = currentThreadContext;
currentThreadContext = currentThreadContext->Next();
currentRuntime->CloseContexts();
RentalThreadContextManager::DestroyThreadContext(tmpThreadContext);
HeapDelete(currentRuntime);
}
}
void JsrtRuntime::CloseContexts()
{
while (this->contextList != NULL)
{
this->contextList->Dispose(false);
// This will remove it from the list
}
}
void JsrtRuntime::SetBeforeCollectCallback(JsBeforeCollectCallback beforeCollectCallback, void * callbackContext)
{
if (beforeCollectCallback != NULL)
{
if (this->collectCallback == NULL)
{
this->collectCallback = this->threadContext->AddRecyclerCollectCallBack(RecyclerCollectCallbackStatic, this);
}
this->beforeCollectCallback = beforeCollectCallback;
this->callbackContext = callbackContext;
}
else
{
if (this->collectCallback != NULL)
{
this->threadContext->RemoveRecyclerCollectCallBack(this->collectCallback);
this->collectCallback = NULL;
}
this->beforeCollectCallback = NULL;
this->callbackContext = NULL;
}
}
void JsrtRuntime::RecyclerCollectCallbackStatic(void * context, RecyclerCollectCallBackFlags flags)
{
if (flags & Collect_Begin)
{
JsrtRuntime * _this = reinterpret_cast<JsrtRuntime *>(context);
try
{
_this->beforeCollectCallback(_this->callbackContext);
}
catch (...)
{
AssertMsg(false, "Unexpected non-engine exception.");
}
}
}
unsigned int JsrtRuntime::Idle()
{
return this->threadService.Idle();
}
|
[
"chakrabot@users.noreply.github.com"
] |
chakrabot@users.noreply.github.com
|
e4855cbb9264dd4019ad5eb79f16cec71afe08a4
|
33d9fb53e5e5ec22dd8f7336399a4d60c6987f7b
|
/zImprovedArmor/ZenGin/Gothic_I_Addon/API/oNews.h
|
98afb5b7d8ffed36c29b75c29383545b806ee74a
|
[] |
no_license
|
Gratt-5r2/zImprovedArmor
|
bae5dde5c0c1ae1b3614141d7592b8a73eee2a41
|
061915791032acfed45703284d2ccd5d394e4a88
|
refs/heads/master
| 2023-04-30T23:20:52.486636
| 2023-03-12T12:42:08
| 2023-03-12T12:42:08
| 332,370,109
| 1
| 2
| null | 2023-04-18T23:44:42
| 2021-01-24T04:54:39
|
C++
|
UTF-8
|
C++
| false
| false
| 4,872
|
h
|
// Supported with union (c) 2018-2021 Union team
#ifndef __ONEWS_H__VER1__
#define __ONEWS_H__VER1__
namespace Gothic_I_Addon {
const int MAX_ENTRY = 20;
typedef enum oENewsSpreadType {
NEWS_DONT_SPREAD,
NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_VICTIM,
NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_WITNESS,
NEWS_SPREAD_NPC_FRIENDLY_TOWARDS_OFFENDER,
NEWS_SPREAD_NPC_SAME_GUILD_VICTIM
} oTNewsSpreadType;
// sizeof 64h
class oCNews {
public:
int told; // sizeof 04h offset 04h
float spread_time; // sizeof 04h offset 08h
oTNewsSpreadType spreadType; // sizeof 04h offset 0Ch
int news_id; // sizeof 04h offset 10h
int gossip; // sizeof 04h offset 14h
oCNpc* mNpcWitness; // sizeof 04h offset 18h
oCNpc* mNpcOffender; // sizeof 04h offset 1Ch
oCNpc* mNpcVictim; // sizeof 04h offset 20h
zSTRING witnessName; // sizeof 14h offset 24h
zSTRING offenderName; // sizeof 14h offset 38h
zSTRING victimName; // sizeof 14h offset 4Ch
int guildvictim; // sizeof 04h offset 60h
void oCNews_OnInit() zCall( 0x006B8850 );
void oCNews_OnInit( int, int, oCNpc*, oCNpc*, oCNpc*, int ) zCall( 0x006B8A10 );
oCNews() zInit( oCNews_OnInit() );
oCNews( int a0, int a1, oCNpc* a2, oCNpc* a3, oCNpc* a4, int a5 ) zInit( oCNews_OnInit( a0, a1, a2, a3, a4, a5 ));
~oCNews() zCall( 0x006B8C30 );
int GetID() zCall( 0x006B8DE0 );
int IsIdentical( int, oCNpc*, oCNpc* ) zCall( 0x006B8DF0 );
void SetSpreadTime( float ) zCall( 0x006B8E20 );
float GetSpreadTime() zCall( 0x006B8E50 );
void SetGossip( int ) zCall( 0x006B8E60 );
int IsGossip() zCall( 0x006B8E80 );
int IsGuildVictim() zCall( 0x006B8E90 );
void GetNewsData( int&, int&, oCNpc*&, oCNpc*&, oCNpc*& ) zCall( 0x006B8EA0 );
static int GetRemainingNews() zCall( 0x006B8360 );
static void CheckRemainingNews() zCall( 0x006B8370 );
virtual void Archive( zCArchiver& ) zCall( 0x006B8FB0 );
virtual void Unarchive( zCArchiver& ) zCall( 0x006B9260 );
// static properties
static int& news_counter;
// user API
#include "oCNews.inl"
};
// sizeof 0Ch
class oCNewsMemory {
public:
zCList<oCNews> iknow; // sizeof 08h offset 04h
void oCNewsMemory_OnInit() zCall( 0x006B7560 );
oCNewsMemory() zInit( oCNewsMemory_OnInit() );
~oCNewsMemory() zCall( 0x006B7580 );
void Insert( oCNews* ) zCall( 0x006B7690 );
void Remove( oCNews* ) zCall( 0x006B7770 );
oCNews* GetNews( int, oCNpc*, oCNpc* ) zCall( 0x006B77F0 );
void CheckSpreadNews() zCall( 0x006B7830 );
int SearchNews( int, oCNpc*, oCNpc* ) zCall( 0x006B78C0 );
void ShowDebugInfos() zCall( 0x006B7940 );
oCNews* GetNewsByNumber( int ) zCall( 0x006B7F40 );
void ClearNews() zCall( 0x006B7F70 );
int DeleteNewsByNumber( int ) zCall( 0x006B8070 );
virtual void Archive( zCArchiver& ) zCall( 0x006B8110 );
virtual void Unarchive( zCArchiver& ) zCall( 0x006B8190 );
// user API
#include "oCNewsMemory.inl"
};
// sizeof 58h
class oCNewsManager {
public:
int called_BAssessAndMem; // sizeof 04h offset 00h
int sentry; // sizeof 04h offset 04h
int spreadList[MAX_ENTRY]; // sizeof 50h offset 08h
void oCNewsManager_OnInit() zCall( 0x006B6BC0 );
oCNewsManager() zInit( oCNewsManager_OnInit() );
~oCNewsManager() zCall( 0x006B6BE0 );
void CreateNews( int, int, oCNpc*, oCNpc*, oCNpc*, int ) zCall( 0x006B6BF0 );
void SpreadToGuild( int ) zCall( 0x006B6F40 );
int IsInSpreadList( int ) zCall( 0x006B6F60 );
void SpreadNews( oCNews* ) zCall( 0x006B6F90 );
// user API
#include "oCNewsManager.inl"
};
} // namespace Gothic_I_Addon
#endif // __ONEWS_H__VER1__
|
[
"amax96@yandex.ru"
] |
amax96@yandex.ru
|
547b43442a42f60e910332895ebda32f716829f9
|
3309f74c7120899929139d80530f8a5b85e6b7f3
|
/JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
|
144edd599703015c2bb4705e666749aa8923c11d
|
[] |
no_license
|
AndyBrown91/MusicPlayer
|
d8910e6b5963c9abfa6e26fbe0c1e6b82be92e44
|
d5867a1448439b49b5140bc3eabc327230e1b4db
|
refs/heads/master
| 2020-04-12T21:02:20.544198
| 2013-07-25T11:18:48
| 2013-07-25T11:18:48
| 10,436,549
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 33,365
|
cpp
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE 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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
AudioDeviceManager::AudioDeviceSetup::AudioDeviceSetup()
: sampleRate (0),
bufferSize (0),
useDefaultInputChannels (true),
useDefaultOutputChannels (true)
{
}
bool AudioDeviceManager::AudioDeviceSetup::operator== (const AudioDeviceManager::AudioDeviceSetup& other) const
{
return outputDeviceName == other.outputDeviceName
&& inputDeviceName == other.inputDeviceName
&& sampleRate == other.sampleRate
&& bufferSize == other.bufferSize
&& inputChannels == other.inputChannels
&& useDefaultInputChannels == other.useDefaultInputChannels
&& outputChannels == other.outputChannels
&& useDefaultOutputChannels == other.useDefaultOutputChannels;
}
//==============================================================================
class AudioDeviceManager::CallbackHandler : public AudioIODeviceCallback,
public MidiInputCallback,
public AudioIODeviceType::Listener
{
public:
CallbackHandler (AudioDeviceManager& adm) noexcept : owner (adm) {}
private:
void audioDeviceIOCallback (const float** ins, int numIns, float** outs, int numOuts, int numSamples) override
{
owner.audioDeviceIOCallbackInt (ins, numIns, outs, numOuts, numSamples);
}
void audioDeviceAboutToStart (AudioIODevice* device) override
{
owner.audioDeviceAboutToStartInt (device);
}
void audioDeviceStopped() override
{
owner.audioDeviceStoppedInt();
}
void audioDeviceError (const String& message) override
{
owner.audioDeviceErrorInt (message);
}
void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message) override
{
owner.handleIncomingMidiMessageInt (source, message);
}
void audioDeviceListChanged() override
{
owner.audioDeviceListChanged();
}
AudioDeviceManager& owner;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CallbackHandler)
};
//==============================================================================
AudioDeviceManager::AudioDeviceManager()
: numInputChansNeeded (0),
numOutputChansNeeded (2),
listNeedsScanning (true),
useInputNames (false),
inputLevel (0),
testSoundPosition (0),
tempBuffer (2, 2),
cpuUsageMs (0),
timeToCpuScale (0)
{
callbackHandler = new CallbackHandler (*this);
}
AudioDeviceManager::~AudioDeviceManager()
{
currentAudioDevice = nullptr;
defaultMidiOutput = nullptr;
}
//==============================================================================
void AudioDeviceManager::createDeviceTypesIfNeeded()
{
if (availableDeviceTypes.size() == 0)
{
OwnedArray <AudioIODeviceType> types;
createAudioDeviceTypes (types);
for (int i = 0; i < types.size(); ++i)
addAudioDeviceType (types.getUnchecked(i));
types.clear (false);
if (AudioIODeviceType* first = availableDeviceTypes.getFirst())
currentDeviceType = first->getTypeName();
}
}
const OwnedArray <AudioIODeviceType>& AudioDeviceManager::getAvailableDeviceTypes()
{
scanDevicesIfNeeded();
return availableDeviceTypes;
}
void AudioDeviceManager::audioDeviceListChanged()
{
if (currentAudioDevice != nullptr)
{
currentSetup.sampleRate = currentAudioDevice->getCurrentSampleRate();
currentSetup.bufferSize = currentAudioDevice->getCurrentBufferSizeSamples();
currentSetup.inputChannels = currentAudioDevice->getActiveInputChannels();
currentSetup.outputChannels = currentAudioDevice->getActiveOutputChannels();
}
sendChangeMessage();
}
//==============================================================================
static void addIfNotNull (OwnedArray <AudioIODeviceType>& list, AudioIODeviceType* const device)
{
if (device != nullptr)
list.add (device);
}
void AudioDeviceManager::createAudioDeviceTypes (OwnedArray <AudioIODeviceType>& list)
{
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_WASAPI());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_DirectSound());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ASIO());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_CoreAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_iOSAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ALSA());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_JACK());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_OpenSLES());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Android());
}
void AudioDeviceManager::addAudioDeviceType (AudioIODeviceType* newDeviceType)
{
if (newDeviceType != nullptr)
{
jassert (lastDeviceTypeConfigs.size() == availableDeviceTypes.size());
availableDeviceTypes.add (newDeviceType);
lastDeviceTypeConfigs.add (new AudioDeviceSetup());
newDeviceType->addListener (callbackHandler);
}
}
//==============================================================================
String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
const int numOutputChannelsNeeded,
const XmlElement* const e,
const bool selectDefaultDeviceOnFailure,
const String& preferredDefaultDeviceName,
const AudioDeviceSetup* preferredSetupOptions)
{
scanDevicesIfNeeded();
numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded;
if (e != nullptr && e->hasTagName ("DEVICESETUP"))
{
lastExplicitSettings = new XmlElement (*e);
String error;
AudioDeviceSetup setup;
if (preferredSetupOptions != nullptr)
setup = *preferredSetupOptions;
if (e->getStringAttribute ("audioDeviceName").isNotEmpty())
{
setup.inputDeviceName = setup.outputDeviceName
= e->getStringAttribute ("audioDeviceName");
}
else
{
setup.inputDeviceName = e->getStringAttribute ("audioInputDeviceName");
setup.outputDeviceName = e->getStringAttribute ("audioOutputDeviceName");
}
currentDeviceType = e->getStringAttribute ("deviceType");
if (findType (currentDeviceType) == nullptr)
{
if (AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName))
currentDeviceType = type->getTypeName();
else if (availableDeviceTypes.size() > 0)
currentDeviceType = availableDeviceTypes.getUnchecked(0)->getTypeName();
}
setup.bufferSize = e->getIntAttribute ("audioDeviceBufferSize");
setup.sampleRate = e->getDoubleAttribute ("audioDeviceRate");
setup.inputChannels .parseString (e->getStringAttribute ("audioDeviceInChans", "11"), 2);
setup.outputChannels.parseString (e->getStringAttribute ("audioDeviceOutChans", "11"), 2);
setup.useDefaultInputChannels = ! e->hasAttribute ("audioDeviceInChans");
setup.useDefaultOutputChannels = ! e->hasAttribute ("audioDeviceOutChans");
error = setAudioDeviceSetup (setup, true);
midiInsFromXml.clear();
forEachXmlChildElementWithTagName (*e, c, "MIDIINPUT")
midiInsFromXml.add (c->getStringAttribute ("name"));
const StringArray allMidiIns (MidiInput::getDevices());
for (int i = allMidiIns.size(); --i >= 0;)
setMidiInputEnabled (allMidiIns[i], midiInsFromXml.contains (allMidiIns[i]));
if (error.isNotEmpty() && selectDefaultDeviceOnFailure)
error = initialise (numInputChannelsNeeded, numOutputChannelsNeeded, 0,
false, preferredDefaultDeviceName);
setDefaultMidiOutput (e->getStringAttribute ("defaultMidiOutput"));
return error;
}
else
{
AudioDeviceSetup setup;
if (preferredSetupOptions != nullptr)
{
setup = *preferredSetupOptions;
}
else if (preferredDefaultDeviceName.isNotEmpty())
{
for (int j = availableDeviceTypes.size(); --j >= 0;)
{
AudioIODeviceType* const type = availableDeviceTypes.getUnchecked(j);
const StringArray outs (type->getDeviceNames (false));
for (int i = 0; i < outs.size(); ++i)
{
if (outs[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.outputDeviceName = outs[i];
break;
}
}
const StringArray ins (type->getDeviceNames (true));
for (int i = 0; i < ins.size(); ++i)
{
if (ins[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.inputDeviceName = ins[i];
break;
}
}
}
}
insertDefaultDeviceNames (setup);
return setAudioDeviceSetup (setup, false);
}
}
void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) const
{
if (AudioIODeviceType* type = getCurrentDeviceTypeObject())
{
if (setup.outputDeviceName.isEmpty())
setup.outputDeviceName = type->getDeviceNames (false) [type->getDefaultDeviceIndex (false)];
if (setup.inputDeviceName.isEmpty())
setup.inputDeviceName = type->getDeviceNames (true) [type->getDefaultDeviceIndex (true)];
}
}
XmlElement* AudioDeviceManager::createStateXml() const
{
return lastExplicitSettings.createCopy();
}
//==============================================================================
void AudioDeviceManager::scanDevicesIfNeeded()
{
if (listNeedsScanning)
{
listNeedsScanning = false;
createDeviceTypesIfNeeded();
for (int i = availableDeviceTypes.size(); --i >= 0;)
availableDeviceTypes.getUnchecked(i)->scanForDevices();
}
}
AudioIODeviceType* AudioDeviceManager::findType (const String& typeName)
{
scanDevicesIfNeeded();
for (int i = availableDeviceTypes.size(); --i >= 0;)
if (availableDeviceTypes.getUnchecked(i)->getTypeName() == typeName)
return availableDeviceTypes.getUnchecked(i);
return nullptr;
}
AudioIODeviceType* AudioDeviceManager::findType (const String& inputName, const String& outputName)
{
scanDevicesIfNeeded();
for (int i = availableDeviceTypes.size(); --i >= 0;)
{
AudioIODeviceType* const type = availableDeviceTypes.getUnchecked(i);
if ((inputName.isNotEmpty() && type->getDeviceNames (true).contains (inputName, true))
|| (outputName.isNotEmpty() && type->getDeviceNames (false).contains (outputName, true)))
{
return type;
}
}
return nullptr;
}
void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup)
{
setup = currentSetup;
}
void AudioDeviceManager::deleteCurrentDevice()
{
currentAudioDevice = nullptr;
currentSetup.inputDeviceName = String::empty;
currentSetup.outputDeviceName = String::empty;
}
void AudioDeviceManager::setCurrentAudioDeviceType (const String& type,
const bool treatAsChosenDevice)
{
for (int i = 0; i < availableDeviceTypes.size(); ++i)
{
if (availableDeviceTypes.getUnchecked(i)->getTypeName() == type
&& currentDeviceType != type)
{
if (currentAudioDevice != nullptr)
{
closeAudioDevice();
Thread::sleep (1500); // allow a moment for OS devices to sort themselves out, to help
// avoid things like DirectSound/ASIO clashes
}
currentDeviceType = type;
AudioDeviceSetup s (*lastDeviceTypeConfigs.getUnchecked(i));
insertDefaultDeviceNames (s);
setAudioDeviceSetup (s, treatAsChosenDevice);
sendChangeMessage();
break;
}
}
}
AudioIODeviceType* AudioDeviceManager::getCurrentDeviceTypeObject() const
{
for (int i = 0; i < availableDeviceTypes.size(); ++i)
if (availableDeviceTypes.getUnchecked(i)->getTypeName() == currentDeviceType)
return availableDeviceTypes.getUnchecked(i);
return availableDeviceTypes[0];
}
String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup,
const bool treatAsChosenDevice)
{
jassert (&newSetup != ¤tSetup); // this will have no effect
if (newSetup == currentSetup && currentAudioDevice != nullptr)
return String::empty;
if (! (newSetup == currentSetup))
sendChangeMessage();
stopDevice();
const String newInputDeviceName (numInputChansNeeded == 0 ? String::empty : newSetup.inputDeviceName);
const String newOutputDeviceName (numOutputChansNeeded == 0 ? String::empty : newSetup.outputDeviceName);
String error;
AudioIODeviceType* type = getCurrentDeviceTypeObject();
if (type == nullptr || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty()))
{
deleteCurrentDevice();
if (treatAsChosenDevice)
updateXml();
return String::empty;
}
if (currentSetup.inputDeviceName != newInputDeviceName
|| currentSetup.outputDeviceName != newOutputDeviceName
|| currentAudioDevice == nullptr)
{
deleteCurrentDevice();
scanDevicesIfNeeded();
if (newOutputDeviceName.isNotEmpty()
&& ! type->getDeviceNames (false).contains (newOutputDeviceName))
{
return "No such device: " + newOutputDeviceName;
}
if (newInputDeviceName.isNotEmpty()
&& ! type->getDeviceNames (true).contains (newInputDeviceName))
{
return "No such device: " + newInputDeviceName;
}
currentAudioDevice = type->createDevice (newOutputDeviceName, newInputDeviceName);
if (currentAudioDevice == nullptr)
error = "Can't open the audio device!\n\n"
"This may be because another application is currently using the same device - "
"if so, you should close any other applications and try again!";
else
error = currentAudioDevice->getLastError();
if (error.isNotEmpty())
{
deleteCurrentDevice();
return error;
}
if (newSetup.useDefaultInputChannels)
{
inputChannels.clear();
inputChannels.setRange (0, numInputChansNeeded, true);
}
if (newSetup.useDefaultOutputChannels)
{
outputChannels.clear();
outputChannels.setRange (0, numOutputChansNeeded, true);
}
if (newInputDeviceName.isEmpty()) inputChannels.clear();
if (newOutputDeviceName.isEmpty()) outputChannels.clear();
}
if (! newSetup.useDefaultInputChannels) inputChannels = newSetup.inputChannels;
if (! newSetup.useDefaultOutputChannels) outputChannels = newSetup.outputChannels;
currentSetup = newSetup;
currentSetup.sampleRate = chooseBestSampleRate (newSetup.sampleRate);
currentSetup.bufferSize = chooseBestBufferSize (newSetup.bufferSize);
error = currentAudioDevice->open (inputChannels,
outputChannels,
currentSetup.sampleRate,
currentSetup.bufferSize);
if (error.isEmpty())
{
currentDeviceType = currentAudioDevice->getTypeName();
currentAudioDevice->start (callbackHandler);
currentSetup.sampleRate = currentAudioDevice->getCurrentSampleRate();
currentSetup.bufferSize = currentAudioDevice->getCurrentBufferSizeSamples();
currentSetup.inputChannels = currentAudioDevice->getActiveInputChannels();
currentSetup.outputChannels = currentAudioDevice->getActiveOutputChannels();
for (int i = 0; i < availableDeviceTypes.size(); ++i)
if (availableDeviceTypes.getUnchecked (i)->getTypeName() == currentDeviceType)
*(lastDeviceTypeConfigs.getUnchecked (i)) = currentSetup;
if (treatAsChosenDevice)
updateXml();
}
else
{
deleteCurrentDevice();
}
return error;
}
double AudioDeviceManager::chooseBestSampleRate (double rate) const
{
jassert (currentAudioDevice != nullptr);
if (rate > 0)
for (int i = currentAudioDevice->getNumSampleRates(); --i >= 0;)
if (currentAudioDevice->getSampleRate (i) == rate)
return rate;
double lowestAbove44 = 0.0;
for (int i = currentAudioDevice->getNumSampleRates(); --i >= 0;)
{
const double sr = currentAudioDevice->getSampleRate (i);
if (sr >= 44100.0 && (lowestAbove44 < 1.0 || sr < lowestAbove44))
lowestAbove44 = sr;
}
if (lowestAbove44 > 0.0)
return lowestAbove44;
return currentAudioDevice->getSampleRate (0);
}
int AudioDeviceManager::chooseBestBufferSize (int bufferSize) const
{
jassert (currentAudioDevice != nullptr);
if (bufferSize > 0)
for (int i = currentAudioDevice->getNumBufferSizesAvailable(); --i >= 0;)
if (currentAudioDevice->getBufferSizeSamples(i) == bufferSize)
return bufferSize;
return currentAudioDevice->getDefaultBufferSize();
}
void AudioDeviceManager::stopDevice()
{
if (currentAudioDevice != nullptr)
currentAudioDevice->stop();
testSound = nullptr;
}
void AudioDeviceManager::closeAudioDevice()
{
stopDevice();
currentAudioDevice = nullptr;
}
void AudioDeviceManager::restartLastAudioDevice()
{
if (currentAudioDevice == nullptr)
{
if (currentSetup.inputDeviceName.isEmpty()
&& currentSetup.outputDeviceName.isEmpty())
{
// This method will only reload the last device that was running
// before closeAudioDevice() was called - you need to actually open
// one first, with setAudioDevice().
jassertfalse;
return;
}
AudioDeviceSetup s (currentSetup);
setAudioDeviceSetup (s, false);
}
}
void AudioDeviceManager::updateXml()
{
lastExplicitSettings = new XmlElement ("DEVICESETUP");
lastExplicitSettings->setAttribute ("deviceType", currentDeviceType);
lastExplicitSettings->setAttribute ("audioOutputDeviceName", currentSetup.outputDeviceName);
lastExplicitSettings->setAttribute ("audioInputDeviceName", currentSetup.inputDeviceName);
if (currentAudioDevice != nullptr)
{
lastExplicitSettings->setAttribute ("audioDeviceRate", currentAudioDevice->getCurrentSampleRate());
if (currentAudioDevice->getDefaultBufferSize() != currentAudioDevice->getCurrentBufferSizeSamples())
lastExplicitSettings->setAttribute ("audioDeviceBufferSize", currentAudioDevice->getCurrentBufferSizeSamples());
if (! currentSetup.useDefaultInputChannels)
lastExplicitSettings->setAttribute ("audioDeviceInChans", currentSetup.inputChannels.toString (2));
if (! currentSetup.useDefaultOutputChannels)
lastExplicitSettings->setAttribute ("audioDeviceOutChans", currentSetup.outputChannels.toString (2));
}
for (int i = 0; i < enabledMidiInputs.size(); ++i)
lastExplicitSettings->createNewChildElement ("MIDIINPUT")
->setAttribute ("name", enabledMidiInputs[i]->getName());
if (midiInsFromXml.size() > 0)
{
// Add any midi devices that have been enabled before, but which aren't currently
// open because the device has been disconnected.
const StringArray availableMidiDevices (MidiInput::getDevices());
for (int i = 0; i < midiInsFromXml.size(); ++i)
if (! availableMidiDevices.contains (midiInsFromXml[i], true))
lastExplicitSettings->createNewChildElement ("MIDIINPUT")
->setAttribute ("name", midiInsFromXml[i]);
}
if (defaultMidiOutputName.isNotEmpty())
lastExplicitSettings->setAttribute ("defaultMidiOutput", defaultMidiOutputName);
}
//==============================================================================
void AudioDeviceManager::addAudioCallback (AudioIODeviceCallback* newCallback)
{
{
const ScopedLock sl (audioCallbackLock);
if (callbacks.contains (newCallback))
return;
}
if (currentAudioDevice != nullptr && newCallback != nullptr)
newCallback->audioDeviceAboutToStart (currentAudioDevice);
const ScopedLock sl (audioCallbackLock);
callbacks.add (newCallback);
}
void AudioDeviceManager::removeAudioCallback (AudioIODeviceCallback* callbackToRemove)
{
if (callbackToRemove != nullptr)
{
bool needsDeinitialising = currentAudioDevice != nullptr;
{
const ScopedLock sl (audioCallbackLock);
needsDeinitialising = needsDeinitialising && callbacks.contains (callbackToRemove);
callbacks.removeFirstMatchingValue (callbackToRemove);
}
if (needsDeinitialising)
callbackToRemove->audioDeviceStopped();
}
}
void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelData,
int numInputChannels,
float** outputChannelData,
int numOutputChannels,
int numSamples)
{
const ScopedLock sl (audioCallbackLock);
if (inputLevelMeasurementEnabledCount.get() > 0 && numInputChannels > 0)
{
for (int j = 0; j < numSamples; ++j)
{
float s = 0;
for (int i = 0; i < numInputChannels; ++i)
s += std::abs (inputChannelData[i][j]);
s /= numInputChannels;
const double decayFactor = 0.99992;
if (s > inputLevel)
inputLevel = s;
else if (inputLevel > 0.001f)
inputLevel *= decayFactor;
else
inputLevel = 0;
}
}
else
{
inputLevel = 0;
}
if (callbacks.size() > 0)
{
const double callbackStartTime = Time::getMillisecondCounterHiRes();
tempBuffer.setSize (jmax (1, numOutputChannels), jmax (1, numSamples), false, false, true);
callbacks.getUnchecked(0)->audioDeviceIOCallback (inputChannelData, numInputChannels,
outputChannelData, numOutputChannels, numSamples);
float** const tempChans = tempBuffer.getArrayOfChannels();
for (int i = callbacks.size(); --i > 0;)
{
callbacks.getUnchecked(i)->audioDeviceIOCallback (inputChannelData, numInputChannels,
tempChans, numOutputChannels, numSamples);
for (int chan = 0; chan < numOutputChannels; ++chan)
{
if (const float* const src = tempChans [chan])
if (float* const dst = outputChannelData [chan])
for (int j = 0; j < numSamples; ++j)
dst[j] += src[j];
}
}
const double msTaken = Time::getMillisecondCounterHiRes() - callbackStartTime;
const double filterAmount = 0.2;
cpuUsageMs += filterAmount * (msTaken - cpuUsageMs);
}
else
{
for (int i = 0; i < numOutputChannels; ++i)
zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples);
}
if (testSound != nullptr)
{
const int numSamps = jmin (numSamples, testSound->getNumSamples() - testSoundPosition);
const float* const src = testSound->getSampleData (0, testSoundPosition);
for (int i = 0; i < numOutputChannels; ++i)
for (int j = 0; j < numSamps; ++j)
outputChannelData [i][j] += src[j];
testSoundPosition += numSamps;
if (testSoundPosition >= testSound->getNumSamples())
testSound = nullptr;
}
}
void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device)
{
cpuUsageMs = 0;
const double sampleRate = device->getCurrentSampleRate();
const int blockSize = device->getCurrentBufferSizeSamples();
if (sampleRate > 0.0 && blockSize > 0)
{
const double msPerBlock = 1000.0 * blockSize / sampleRate;
timeToCpuScale = (msPerBlock > 0.0) ? (1.0 / msPerBlock) : 0.0;
}
{
const ScopedLock sl (audioCallbackLock);
for (int i = callbacks.size(); --i >= 0;)
callbacks.getUnchecked(i)->audioDeviceAboutToStart (device);
}
sendChangeMessage();
}
void AudioDeviceManager::audioDeviceStoppedInt()
{
cpuUsageMs = 0;
timeToCpuScale = 0;
sendChangeMessage();
const ScopedLock sl (audioCallbackLock);
for (int i = callbacks.size(); --i >= 0;)
callbacks.getUnchecked(i)->audioDeviceStopped();
}
void AudioDeviceManager::audioDeviceErrorInt (const String& message)
{
const ScopedLock sl (audioCallbackLock);
for (int i = callbacks.size(); --i >= 0;)
callbacks.getUnchecked(i)->audioDeviceError (message);
}
double AudioDeviceManager::getCpuUsage() const
{
return jlimit (0.0, 1.0, timeToCpuScale * cpuUsageMs);
}
//==============================================================================
void AudioDeviceManager::setMidiInputEnabled (const String& name, const bool enabled)
{
if (enabled != isMidiInputEnabled (name))
{
if (enabled)
{
const int index = MidiInput::getDevices().indexOf (name);
if (index >= 0)
{
if (MidiInput* const midiIn = MidiInput::openDevice (index, callbackHandler))
{
enabledMidiInputs.add (midiIn);
midiIn->start();
}
}
}
else
{
for (int i = enabledMidiInputs.size(); --i >= 0;)
if (enabledMidiInputs[i]->getName() == name)
enabledMidiInputs.remove (i);
}
updateXml();
sendChangeMessage();
}
}
bool AudioDeviceManager::isMidiInputEnabled (const String& name) const
{
for (int i = enabledMidiInputs.size(); --i >= 0;)
if (enabledMidiInputs[i]->getName() == name)
return true;
return false;
}
void AudioDeviceManager::addMidiInputCallback (const String& name, MidiInputCallback* callbackToAdd)
{
removeMidiInputCallback (name, callbackToAdd);
if (name.isEmpty() || isMidiInputEnabled (name))
{
const ScopedLock sl (midiCallbackLock);
midiCallbacks.add (callbackToAdd);
midiCallbackDevices.add (name);
}
}
void AudioDeviceManager::removeMidiInputCallback (const String& name, MidiInputCallback* callbackToRemove)
{
for (int i = midiCallbacks.size(); --i >= 0;)
{
if (midiCallbackDevices[i] == name && midiCallbacks.getUnchecked(i) == callbackToRemove)
{
const ScopedLock sl (midiCallbackLock);
midiCallbacks.remove (i);
midiCallbackDevices.remove (i);
}
}
}
void AudioDeviceManager::handleIncomingMidiMessageInt (MidiInput* source, const MidiMessage& message)
{
if (! message.isActiveSense())
{
const bool isDefaultSource = (source == nullptr || source == enabledMidiInputs.getFirst());
const ScopedLock sl (midiCallbackLock);
for (int i = midiCallbackDevices.size(); --i >= 0;)
{
const String name (midiCallbackDevices[i]);
if ((isDefaultSource && name.isEmpty()) || (name.isNotEmpty() && name == source->getName()))
midiCallbacks.getUnchecked(i)->handleIncomingMidiMessage (source, message);
}
}
}
//==============================================================================
void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName)
{
if (defaultMidiOutputName != deviceName)
{
Array <AudioIODeviceCallback*> oldCallbacks;
{
const ScopedLock sl (audioCallbackLock);
oldCallbacks = callbacks;
callbacks.clear();
}
if (currentAudioDevice != nullptr)
for (int i = oldCallbacks.size(); --i >= 0;)
oldCallbacks.getUnchecked(i)->audioDeviceStopped();
defaultMidiOutput = nullptr;
defaultMidiOutputName = deviceName;
if (deviceName.isNotEmpty())
defaultMidiOutput = MidiOutput::openDevice (MidiOutput::getDevices().indexOf (deviceName));
if (currentAudioDevice != nullptr)
for (int i = oldCallbacks.size(); --i >= 0;)
oldCallbacks.getUnchecked(i)->audioDeviceAboutToStart (currentAudioDevice);
{
const ScopedLock sl (audioCallbackLock);
callbacks = oldCallbacks;
}
updateXml();
sendChangeMessage();
}
}
//==============================================================================
void AudioDeviceManager::playTestSound()
{
{ // cunningly nested to swap, unlock and delete in that order.
ScopedPointer <AudioSampleBuffer> oldSound;
{
const ScopedLock sl (audioCallbackLock);
oldSound = testSound;
}
}
testSoundPosition = 0;
if (currentAudioDevice != nullptr)
{
const double sampleRate = currentAudioDevice->getCurrentSampleRate();
const int soundLength = (int) sampleRate;
AudioSampleBuffer* const newSound = new AudioSampleBuffer (1, soundLength);
float* samples = newSound->getSampleData (0);
const double frequency = 440.0;
const float amplitude = 0.5f;
const double phasePerSample = double_Pi * 2.0 / (sampleRate / frequency);
for (int i = 0; i < soundLength; ++i)
samples[i] = amplitude * (float) std::sin (i * phasePerSample);
newSound->applyGainRamp (0, 0, soundLength / 10, 0.0f, 1.0f);
newSound->applyGainRamp (0, soundLength - soundLength / 4, soundLength / 4, 1.0f, 0.0f);
const ScopedLock sl (audioCallbackLock);
testSound = newSound;
}
}
void AudioDeviceManager::enableInputLevelMeasurement (const bool enableMeasurement)
{
if (enableMeasurement)
++inputLevelMeasurementEnabledCount;
else
--inputLevelMeasurementEnabledCount;
inputLevel = 0;
}
double AudioDeviceManager::getCurrentInputLevel() const
{
jassert (inputLevelMeasurementEnabledCount.get() > 0); // you need to call enableInputLevelMeasurement() before using this!
return inputLevel;
}
|
[
"andyjtbrown@gmail.com"
] |
andyjtbrown@gmail.com
|
1c5a69448b59f2bd17db49de4e6b83ce34070fca
|
9058a5332c0a23b9b0c09c4bd1fd28adeda1f535
|
/DediwareSourceCode/Dlg_ATmega/stdafx.cpp
|
9e07dd3c9c7130ea0bf5f3b0281ced9fe1ac1af1
|
[] |
no_license
|
AllenJunior/Allen
|
4fe92340cb3bd7b03c2a72492d16821fe994acc7
|
e21d4e247736c5847b113f9ef103d57930643ee4
|
refs/heads/My-Design
| 2020-05-19T19:49:20.275658
| 2017-02-05T07:12:07
| 2017-02-05T07:12:07
| 40,643,800
| 0
| 0
| null | 2017-02-05T07:38:07
| 2015-08-13T06:59:32
|
C++
|
UTF-8
|
C++
| false
| false
| 203
|
cpp
|
// stdafx.cpp : source file that includes just the standard includes
// Dlg_ATmega.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
|
[
"allenliu521@gmail.com"
] |
allenliu521@gmail.com
|
1b8bed92855c6ef9ca7cce361a4e48503ac6544e
|
43b61e6af99f8fde8a6d3a2748ed66ada0f0f3b9
|
/Sources/OpenGL0/OpenGL0/Model.h
|
cfedb79caee7356b8b0d9cb046abfd6d986d057f
|
[] |
no_license
|
biopox/Fowler_Robinson_Tuton_389
|
b6976d18bb87457d8677a2ab63efceb8fe9a2446
|
b50c9bffb6adc2afbd4db918d0d1108c1c6cd5c7
|
refs/heads/master
| 2021-09-13T22:16:59.859310
| 2018-05-05T00:49:29
| 2018-05-05T00:49:29
| 117,934,588
| 0
| 0
| null | 2018-04-02T11:58:12
| 2018-01-18T04:58:44
|
C
|
UTF-8
|
C++
| false
| false
| 1,491
|
h
|
#pragma once
#include<Windows.h>
#include<stdlib.h>
#include<stdio.h>
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <iterator>
#include <string.h>
#include <map>
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <gl\GLU.h>
#include <gl\GL.h>
#include <assimp\Importer.hpp>
#include <assimp\scene.h>
#include <assimp\postprocess.h>
using namespace std;
class OBJ {
public:
vector<float> vertices;
vector<float> textures;
vector<float> normals;
vector<int> faces; // vertices of each face
vector<int> facesNormal; // normals of each face
vector<int> facesTexture; // texture coordinates of each face
bool verticesIncludeW; // If .obj has v x y z [w]
bool texturesIncludeW; // If .obj has vt u v [w]
int facesSize; // Size of face e.g. triangles are 3
int faceMode; // v: 0
// v, t: 1
// v, t, n: 2
// v, n: 3
string name; // Name of object
};
vector<OBJ> loadOBJ(string path, float scale);
void printOBJ(vector<OBJ> objects);
float *verticesToFloat(OBJ obj);
float *getVerticesArray(OBJ obj);
int *getFacesArray(OBJ obj);
GLint TextureFromFile(const char *path, string directory);
|
[
"benjamin.fowler@student.nmt.edu"
] |
benjamin.fowler@student.nmt.edu
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.