hexsha
stringlengths
40
40
size
int64
19
11.4M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
270
max_stars_repo_name
stringlengths
5
110
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
270
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
270
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
19
11.4M
avg_line_length
float64
1.93
229k
max_line_length
int64
12
688k
alphanum_fraction
float64
0.07
0.99
matches
listlengths
1
10
4e03ab28d3b8b3beba9be5d3d05535e99b2ef780
6,656
cpp
C++
Sources/main.cpp
anirul/Vector3vsVector4
e5d8633666bf20232c92dcdeccdf5d337689addc
[ "MIT" ]
null
null
null
Sources/main.cpp
anirul/Vector3vsVector4
e5d8633666bf20232c92dcdeccdf5d337689addc
[ "MIT" ]
null
null
null
Sources/main.cpp
anirul/Vector3vsVector4
e5d8633666bf20232c92dcdeccdf5d337689addc
[ "MIT" ]
null
null
null
#include <array> #include <vector> #include <chrono> #include <cmath> #include <iostream> #include <numeric> #include <algorithm> #include <random> // A simple vec3. struct vec3 { vec3() : x(0), y(0), z(0) {} vec3(float a) : x(a), y(0), z(0) {} vec3(float a, float b, float c) : x(a), y(b), z(c) {} float x = 0; float y = 0; float z = 0; }; template <size_t N> struct vec3SoA { std::array<float, N> x = { 0 }; std::array<float, N> y = { 0 }; std::array<float, N> z = { 0 }; }; // Dot product. vec3 operator*(const vec3& v1, const vec3& v2) { vec3 ret; ret.x = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; ret.y = 0; ret.z = 0; return ret; } vec3 square_root(const vec3& v) { vec3 ret; ret.x = std::sqrt(v.x + v.y + v.z); ret.y = 0; ret.z = 1; return ret; } template <size_t N> vec3SoA<N> operator*(const vec3SoA<N>& v1, const vec3SoA<N>& v2) { vec3SoA<N> ret; for (int i = 0; i < N; ++i) { ret.x[i] = v1.x[i] * v2.x[i]; ret.y[i] = v1.y[i] * v2.y[i]; ret.z[i] = v1.z[i] * v2.z[i]; } return ret; } template <size_t N> vec3SoA<N> square_root(const vec3SoA<N>& v) { vec3SoA<N> ret; for (int i = 0; i < N; ++i) { ret.x[i] = std::sqrt(v.x[i] + v.y[i] + v.z[i]); ret.y[i] = 0; ret.z[i] = 1; } return ret; } // A simple vec4. struct vec4 { vec4() : x(0), y(0), z(0), w(1) {} vec4(float a) : x(a), y(0), z(0), w(1) {} vec4(float a, float b, float c, float d) : x(a), y(b), z(c), w(d) {} float x = 0; float y = 0; float z = 0; float w = 0; }; template <size_t N> struct vec4SoA { std::array<float, N> x = { 0 }; std::array<float, N> y = { 0 }; std::array<float, N> z = { 0 }; std::array<float, N> w = { 0 }; }; // Purposely simplified dot product (to be equivalent to the vec3). vec4 operator*(const vec4& v1, const vec4& v2) { vec4 ret; ret.x = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; ret.y = 0; ret.z = 0; ret.w = 0; return ret; } vec4 square_root(const vec4& v) { vec4 ret; ret.x = std::sqrt(v.x + v.y + v.z); ret.y = 0; ret.z = 0; ret.w = 1; return ret; } template <size_t N> vec4SoA<N> operator*(const vec4SoA<N>& v1, const vec4SoA<N>& v2) { vec4SoA<N> ret; for (int i = 0; i < N; ++i) { ret.x[i] = v1.x[i] * v2.x[i]; ret.y[i] = v1.y[i] * v2.y[i]; ret.z[i] = v1.z[i] * v2.z[i]; } return ret; } template <size_t N> vec4SoA<N> square_root(const vec4SoA<N>& v) { vec4SoA<N> ret; for (int i = 0; i < N; ++i) { ret.x[i] = std::sqrt(v.x[i] + v.y[i] + v.z[i]); ret.y[i] = 0; ret.z[i] = 0; ret.w[i] = 1; } return ret; } template <size_t N> class RandomFill { public: RandomFill() { generator_ = std::mt19937(device_()); distribution_ = std::uniform_real_distribution<>(-100.0, 100.0); } template <typename T> void Set(T& v) { SetValue(v.x); SetValue(v.y); SetValue(v.z); } private: void SetValue(float& v) { v = (float)distribution_(generator_); } void SetValue(std::array<float, N>& v) { std::for_each(v.begin(), v.end(), [this](float& f) { f = (float)distribution_(generator_); }); } private: std::random_device device_; std::mt19937 generator_; std::uniform_real_distribution<> distribution_; }; namespace { constexpr size_t small_value = 1024; RandomFill<8> random_fill; } template <typename T, size_t N = 1, typename I> double Check(I begin, I end) { std::vector<double> result_vector; result_vector.resize(small_value); std::for_each(begin, end, [](T& val) { random_fill.Set<T>(val); }); for (int i = 0; i < small_value; ++i) { auto before = std::chrono::high_resolution_clock::now(); std::for_each(begin, end, [](T& val) { val = T{ square_root(val * val) }; }); auto after = std::chrono::high_resolution_clock::now(); std::chrono::duration<double> delta_time = after - before; result_vector[i] = delta_time.count(); } return *std::min_element(result_vector.begin(), result_vector.end()); } // This is there to test if vec3 is faster than vec4. int main(int ac, char** av) { #ifdef WIN32 std::cout << "default alignment : " << __STDCPP_DEFAULT_NEW_ALIGNMENT__ << std::endl; #endif // First I try with local arrays. { std::array<vec3, small_value> vec3_array; std::cout << "time spend (array<vec3>) : " << Check<vec3>(vec3_array.begin(), vec3_array.end()) << std::endl; std::cout << "total space used : " << sizeof(vec3) * small_value << std::endl; } { std::array<vec4, small_value> vec4_array; std::cout << "time spend (array<vec4>) : " << Check<vec4>(vec4_array.begin(), vec4_array.end()) << std::endl; std::cout << "total space used : " << sizeof(vec4) * small_value << std::endl; } { std::array<vec3SoA<8>, small_value / 8> vec3SoA_array; std::cout << "time spend (array<vec3SoA>) : " << Check<vec3SoA<8>, 8>(vec3SoA_array.begin(), vec3SoA_array.end()) << std::endl; std::cout << "total space used : " << sizeof(vec3SoA<8>) * small_value / 8 << std::endl; } { std::array<vec4SoA<8>, small_value / 8> vec4SoA_array; std::cout << "time spend (array<vec4SoA>) : " << Check<vec4SoA<8>, 8>(vec4SoA_array.begin(), vec4SoA_array.end()) << std::endl; std::cout << "total space used : " << sizeof(vec4SoA<8>) * small_value / 8 << std::endl; } // I finally try with vectors. constexpr size_t big_value = 1024 * 1024; { std::vector<vec3> vec3_vector; vec3_vector.resize(big_value); std::cout << "time spend (vector<vec3>) : " << Check<vec3>(vec3_vector.begin(), vec3_vector.end()) << std::endl; std::cout << "total space used : " << sizeof(vec3) * big_value << std::endl; } { std::vector<vec4> vec4_vector; vec4_vector.resize(big_value); std::cout << "time spend (vector<vec4>) : " << Check<vec4>(vec4_vector.begin(), vec4_vector.end()) << std::endl; std::cout << "total space used : " << sizeof(vec4) * big_value << std::endl; } { std::vector<vec3SoA<8>> vec3SoA_vector; vec3SoA_vector.resize(big_value / 8); std::cout << "time spend (vector<vec3SoA>) : " << Check<vec3SoA<8>, 8>( vec3SoA_vector.begin(), vec3SoA_vector.end()) << std::endl; std::cout << "total spend used : " << sizeof(vec3SoA<8>) * big_value / 8 << std::endl; } { std::vector<vec4SoA<8>> vec4SoA_vector; vec4SoA_vector.resize(big_value / 8); std::cout << "time spend (vector<vec4SoA>) : " << Check<vec4SoA<8>, 8>( vec4SoA_vector.begin(), vec4SoA_vector.end()) << std::endl; std::cout << "total spend used : " << sizeof(vec4SoA<8>) * big_value / 8 << std::endl; } return 0; }
22.716724
70
0.580829
[ "vector" ]
4e0ebe684718f1d9049b28130ecec81b0db49e23
22,807
cpp
C++
mainwindow.cpp
fsziegler/qt-git
0402f2772498da2c5e42a7e497a3a47e04b1b7a5
[ "MIT" ]
null
null
null
mainwindow.cpp
fsziegler/qt-git
0402f2772498da2c5e42a7e497a3a47e04b1b7a5
[ "MIT" ]
2
2016-07-08T03:16:37.000Z
2016-07-11T05:43:42.000Z
mainwindow.cpp
fsziegler/qt-git
0402f2772498da2c5e42a7e497a3a47e04b1b7a5
[ "MIT" ]
null
null
null
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFileDialog> #include <QProcess> #include <QDesktopWidget> #include <QInputDialog> #include <QJsonDocument> #include <QMessageBox> #include "testdialog.h" #include "octaldialog.h" #include <iostream> #include <sstream> using namespace std; QJsonObject MainWindow::ms_jsonSettings; QFileInfo MainWindow::ms_rootGitDir; QString MainWindow::ms_settingsFileStr; QString MainWindow::ms_remoteRepoFileStr; void ExceptionHandler() { ExceptionHandler("Exception throw: UNKNOWN"); } void ExceptionHandler(const string& what) { QMessageBox msgBox; QString msg("Exception throw: "); msg.append(what.c_str()); msgBox.setText(msg); msgBox.exec(); } void MainWindow::ClearStaticMembers() { if(!ms_jsonSettings.isEmpty()) { QString error("MainWindow::ClearStaticMembers(): " "ms_jsonSettings.isEmpty()\n"); error.append(__FILE__); error.append(": "); error.append(__LINE__); throw runtime_error(error.toStdString()); } if(ms_rootGitDir.exists()) { QString error("MainWindow::ClearStaticMembers(): " "ms_rootGitDir.exists()\n"); error.append(__FILE__); error.append(": "); error.append(__LINE__); throw runtime_error(error.toStdString()); } ms_settingsFileStr.clear(); ms_remoteRepoFileStr.clear(); } MainWindow::MainWindow(const QString& cmdStr, QWidget* parent) : QMainWindow(parent), mc_appDir(QFileInfo(cmdStr).path()), ui(new Ui::MainWindow) { try { ClearStaticMembers(); ms_settingsFileStr.append(mc_appDir.filePath()).append("/settings.json"); ReadSettings(); ui->setupUi(this); ui->label_git_root->setText(ms_rootGitDir.filePath()); ui->label_remote_repo->setText(ms_remoteRepoFileStr); const QRect screenRect(QApplication::desktop()->availableGeometry()); if((screenRect.width() >= width()) && (screenRect.height() >= height())) { setGeometry( QStyle::alignedRect( Qt::LeftToRight, Qt::AlignCenter, size(), QApplication::desktop()->availableGeometry())); } } catch(exception& e) { ExceptionHandler(e.what()); } catch(...) { ExceptionHandler(); } setWindowTitle("Fred's Power qt-git"); OnGitStatus(); SetButtonFormattedToolTip(ui->btn_choose_git_root, QString("Choose the root directory for all git operations")); // "" SetButtonFormattedToolTip(ui->btn_remote_repo, QString("Choose the remote repository for all git operations")); SetButtonFormattedToolTip(ui->btn_git_add, QString("git-add - Add file contents to the index\n" "This command updates the index using the current content found" " in the working tree, to prepare the content staged for the ne" "xt commit. It typically adds the current content of existing p" "aths as a whole, but with some options it can also be used to " "add content with only part of the changes made to the working " "tree files applied, or remove paths that do not exist in the w" "orking tree anymore.")); SetButtonFormattedToolTip(ui->btn_git_branch, QString("git-branch - List, create, or delete branches\n" "If --list is given, or if there are no non-option arguments, e" "xisting branches are listed; the current branch will be highli" "ghted with an asterisk. Option -r causes the remote-tracking b" "ranches to be listed, and option -a shows both local and remot" "e branches. If a <pattern> is given, it is used as a shell wil" "dcard to restrict the output to matching branches. If multiple" " patterns are given, a branch is shown if it matches any of th" "e patterns. Note that when providing a <pattern>, you must use" " --list; otherwise the command is interpreted as branch creati" "on.\n\nWith --contains, shows only the branches that contain t" "he named commit (in other words, the branches whose tip commit" "s are descendants of the named commit). With --merged, only br" "anches merged into the named commit (i.e. the branches whose t" "ip commits are reachable from the named commit) will be listed" ". With --no-merged only branches not merged into the named com" "mit will be listed. If the <commit> argument is missing it def" "aults to HEAD (i.e. the tip of the current branch).")); SetButtonFormattedToolTip(ui->btn_git_checkout, QString("git-checkout - Switch branches or restore working tree files\n" "Updates files in the working tree to match the version in the " "index or the specified tree. If no paths are given, git checko" "ut will also update HEAD to set the specified branch as the cu" "rrent branch.")); SetButtonFormattedToolTip(ui->btn_git_clone, QString("git-clone - Clone a repository into a new directory\n" "Clones a repository into a newly created directory, creates re" "mote-tracking branches for each branch in the cloned repositor" "y (visible using git branch -r), and creates and checks out an" " initial branch that is forked from the cloned repository’s cu" "rrently active branch.")); SetButtonFormattedToolTip(ui->btn_git_commit, QString("git-commit - Record changes to the repository\n" "Stores the current contents of the index in a new commit along" " with a log message from the user describing the changes.")); SetButtonFormattedToolTip(ui->btn_git_diff, QString("git-diff - Show changes between commits, commit and working " "tree, etc\n" "Show changes between the working tree and the index or a tree," " changes between the index and a tree, changes between two tre" "es, changes between two blob objects, or changes between two f" "iles on disk.")); SetButtonFormattedToolTip(ui->btn_git_fetch, QString("git-fetch - Download objects and refs from another repository" "\n" "Fetch branches and/or tags (collectively, \"refs\") from one o" "r more other repositories, along with the objects necessary to" " complete their histories. Remote-tracking branches are update" "d (see the description of <refspec> below for ways to control " "this behavior).")); SetButtonFormattedToolTip(ui->btn_git_init, QString("git-init - Create an empty Git repository or reinitialize an " "existing one\n" "This command creates an empty Git repository - basically a .gi" "t directory with subdirectories for objects, refs/heads, refs/" "tags, and template files. An initial HEAD file that references" " the HEAD of the master branch is also created.")); SetButtonFormattedToolTip(ui->btn_git_merge, QString("git-merge - Join two or more development histories together\n" "Incorporates changes from the named commits (since the time th" "eir histories diverged from the current branch) into the curre" "nt branch. This command is used by git pull to incorporate cha" "nges from another repository and can be used by hand to merge " "changes from one branch into another.")); SetButtonFormattedToolTip(ui->btn_git_pull, QString("git-pull - Fetch from and integrate with another repository or" " a local branch\n" "Incorporates changes from a remote repository into the current" " branch. In its default mode, git pull is shorthand for git fe" "tch followed by git merge FETCH_HEAD.\n\nMore precisely, git p" "ull runs git fetch with the given parameters and calls git mer" "ge to merge the retrieved branch heads into the current branch" ". With --rebase, it runs git rebase instead of git merge.")); SetButtonFormattedToolTip(ui->btn_git_push, QString("git-push - Update remote refs along with associated objects\n" "Updates remote refs using local refs, while sending objects ne" "cessary to complete the given refs.")); SetButtonFormattedToolTip(ui->btn_git_rebase, QString("git-rebase - Reapply commits on top of another base tip\n" "If <branch> is specified, git rebase will perform an automatic" " git checkout <branch> before doing anything else. Otherwise i" "t remains on the current branch.")); SetButtonFormattedToolTip(ui->btn_git_stash, QString("git-stash - Stash the changes in a dirty working directory " "away\n" "Use git stash when you want to record the current state of the" " working directory and the index, but want to go back to a cle" "an working directory. The command saves your local modificatio" "ns away and reverts the working directory to match the HEAD co" "mmit.")); SetButtonFormattedToolTip(ui->btn_git_status, QString("git-status - Show the working tree status\n" "Displays paths that have differences between the index file an" "d the current HEAD commit, paths that have differences between" " the working tree and the index file, and paths in the working" " tree that are not tracked by Git (and are not ignored by giti" "gnore(5)). The first are what you would commit by running git " "commit; the second and third are what you could commit by runn" "ing git add before running git commit.")); } MainWindow::~MainWindow() { delete ui; } void MainWindow::ClearStash() { ui->comboBox_stash->clear(); } size_t MainWindow::GetProcessResults(const string& cmd, const string& execDir, const TStrVect& args, TStrVect& resultVect) { // Setup resultVect.clear(); QProcess proc; QStringList strList; for(TStrVectCItr itr = args.begin(); args.end() != itr; ++itr) { string str(*itr); strList.append(str.c_str()); } if(0 < execDir.length()) { proc.setWorkingDirectory(execDir.c_str()); } if((0 == strList[0].compare("clone")) && ((1 == strList.length()) || (0 != strList[1].compare("--help")))) { strList.push_back(ms_remoteRepoFileStr); } // Execute proc.start(cmd.c_str(), strList); // proc.start(cmd.c_str(), QStringList() << args.c_str() << "-R"); if(!proc.waitForStarted()) { cout << "!proc.waitForStarted()" << endl; return 0; } proc.closeWriteChannel(); if(!proc.waitForFinished()) { cout << "!proc.waitForFinished()" << endl; return 0; } // Read results QByteArray result = proc.readAll(); string tmpStr; tmpStr.clear(); for(auto itr: result) { if('\n' != itr) { char c(itr); tmpStr += c; } else { resultVect.push_back(tmpStr); tmpStr.clear(); } } return resultVect.size(); } void MainWindow::OnGitStatus() { ui->comboBox_stash->clear(); const string cmd("git"); const string execDir(ms_rootGitDir.filePath().toStdString()); //git status --porcelain TStrVect args; args.push_back("status"); args.push_back("--porcelain"); TStrVect resultVect; GetProcessResults(cmd, execDir, args, resultVect); if(0 < resultVect.size())//Hello { /* 2006> git status --porcelain AM qt/cs-ipc/Client.cpp AM qt/cs-ipc/EventMessage.cpp AM qt/cs-ipc/Server.cpp A qt/cs-ipc/ZiegVersion.h AM qt/cs-ipc/cs-ipc.pro A qt/cs-ipc/csipc/Client.h A qt/cs-ipc/csipc/EventMessage.h A qt/cs-ipc/csipc/Server.h A qt/cs-ipc/csipc/defines.h AM qt/cs-ipc/internals.cpp A qt/cs-ipc/internals.h AM qt/cs-ipc/main.cpp ?? qt/build-cs-ipc-Desktop_Qt_5_4_2_GCC_32bit-Debug/ ?? qt/cs-ipc/cs-ipc.pro.user ?? qt/cs-ipc/ziegversion.sh [fred][~/dev/sandbox/cs-ipc][Sat Jul 02@19:31:13] */ QRegularExpression reModified("AM (.+)"); for(auto itr: resultVect) { const string str0(itr); const QString str(str0.c_str()); QRegularExpressionMatch match = reModified.match(str); if(match.hasMatch()) { cout << "Match: [" << match.captured(1).toStdString() << "]" << endl; ui->comboBox_stash->addItem(match.captured(1)); } } } } void MainWindow::SetButtonFormattedToolTip(QAbstractButton* pCB, const QString& tooltip, int width) { int len = tooltip.size(); if(len <= width) { pCB->setToolTip(tooltip); } QString modToolTip(tooltip); int index(width); int floor(0); int ceiling(index); while(index < len) { bool hasCR(false); for(int i = index; floor < i; --i) { // if(QChar('\n') == modToolTip.at(i)) if('\n' == modToolTip.at(i)) { hasCR = true; index = i; break; } } if(!hasCR) { while((!modToolTip.at(index).isSpace()) && (floor < index)) { --index; } if('\n' != modToolTip.at(index)) { if(floor < index) { modToolTip[index] = QChar('\n'); } else { modToolTip.insert(ceiling, QChar('\n')); ++len; index = ceiling; } } } floor = ++index; index += width; ceiling = index; } pCB->setToolTip(modToolTip); // cout << modToolTip.toStdString() << endl << endl; } void MainWindow::ReadSettings() { QFile loadFile(ms_settingsFileStr); if(!loadFile.open(QIODevice::ReadOnly)) { QString error("MainWindow::ReadSettings(): " "!loadFile.open(QIODevice::ReadOnly)\n" "File = "); error.append(ms_settingsFileStr); error.append("\n"); error.append(__FILE__); error.append(": "); error.append(__LINE__); throw runtime_error(error.toStdString()); } QByteArray saveData = loadFile.readAll(); QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); ms_jsonSettings = loadDoc.object(); ms_rootGitDir = ms_jsonSettings["Git Root Directory"].toString(); ms_remoteRepoFileStr = ms_jsonSettings["Git Remote Repo"].toString(); } void MainWindow::SaveSettings() { ms_jsonSettings["Git Root Directory"] = ms_rootGitDir.filePath(); ms_jsonSettings["Git Remote Repo"] = ms_remoteRepoFileStr; SaveSettings(ms_jsonSettings, ms_settingsFileStr.toStdString()); } void MainWindow::SaveSettings(const QJsonObject& jsonObj, const string& fileNameStr) { QFile saveFile(fileNameStr.c_str()); if(!saveFile.open(QIODevice::WriteOnly)) { QString error("MainWindow::SaveSettings(): " "!saveFile.open(QIODevice::WriteOnly)\n" "File = "); error.append(QString(fileNameStr.c_str())); error.append("\n"); error.append(__FILE__); error.append(": "); error.append(__LINE__); throw runtime_error(error.toStdString()); } QJsonDocument saveDoc(jsonObj); saveFile.write(saveDoc.toJson()); } bool MainWindow::ReadDirectory(QWidget* parent, string& pathStr) { return ReadDirectory(parent, "Select Directory", pathStr); } bool MainWindow::ReadDirectory(QWidget* parent, string caption, string& pathStr) { QString dir = QFileDialog::getExistingDirectory( parent, tr(caption.c_str()), ms_rootGitDir.filePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(!dir.isNull()) { pathStr = dir.toStdString(); return true; } return false; } bool MainWindow::ReadFile(QWidget* parent, string& pathStr) { return ReadFile(parent, "Select File", pathStr); } bool MainWindow::ReadFile(QWidget* parent, string caption, string& pathStr) { QString file = QFileDialog::getOpenFileName(parent, tr(caption.c_str()), ms_rootGitDir.filePath(), tr("All Files (*.*)")); if(!file.isNull()) { pathStr = file.toStdString(); return true; } return false; } bool MainWindow::ReadTextInput(QWidget* parent, string title, string label, string& textStr) { bool ok; QString text = QInputDialog::getText(parent, tr(title.c_str()), tr(label.c_str()), QLineEdit::Normal, textStr.c_str(), &ok); if(ok && !text.isEmpty()) { textStr = text.toStdString(); return true; } return false; } bool MainWindow::ReadOctalVal(string& octalStr) { OctalDialog octalDlg; if(1 == octalDlg.exec()) { octalStr = octalDlg.getOctalValStr(); return true; } return false; } void MainWindow::RunCmdDialog(const string& gitCmdStr) { TestDialog dlg; dlg.SetDirectory(ms_rootGitDir.filePath()); dlg.SetCommand("git", gitCmdStr.c_str()); dlg.ExecuteLayout(); dlg.exec(); } bool MainWindow::YesNoDialog(QWidget* parent, const string& title, const string& msg) { QMessageBox::StandardButton reply; reply = QMessageBox::question(parent, title.c_str(), msg.c_str(), QMessageBox::Yes|QMessageBox::No); return (reply == QMessageBox::Yes); } void MainWindow::on_btn_choose_git_root_clicked() { QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), ms_rootGitDir.filePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(!dir.isNull()) { ClearStash(); ms_rootGitDir = dir; ui->label_git_root->setText(dir); SaveSettings(); } } void MainWindow::on_comboBox_stash_currentIndexChanged(const QString& arg1) { // QMessageBox msgBox; // msgBox.setText(arg1); // msgBox.exec(); QString sbMsg("Stash \""); sbMsg.append(arg1).append("\" chosen"); ui->statusBar->showMessage(sbMsg); // ui->comboBox_stash->addItem("giddyup"); } void MainWindow::on_btn_git_init_clicked() { RunCmdDialog("init"); // GitInitDialog initDlg; // initDlg.exec(); } void MainWindow::on_btn_git_clone_clicked() { RunCmdDialog("clone"); // GitCloneDialog cloneDlg; // cloneDlg.exec(); } void MainWindow::on_btn_remote_repo_clicked() { bool ok; QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"), tr("Remote repo URL:"), QLineEdit::Normal, ui->label_remote_repo->text(), &ok); if(ok && !text.isEmpty()) { ms_remoteRepoFileStr = text; ui->label_remote_repo->setText(text); SaveSettings(); } } void MainWindow::on_btn_git_branch_clicked() { RunCmdDialog("branch"); } void MainWindow::on_btn_git_checkout_clicked() { RunCmdDialog("checkout"); } void MainWindow::on_btn_git_merge_clicked() { RunCmdDialog("merge"); } void MainWindow::on_btn_git_fetch_clicked() { RunCmdDialog("fetch"); } void MainWindow::on_btn_git_rebase_clicked() { RunCmdDialog("rebase"); } void MainWindow::on_btn_git_add_clicked() { RunCmdDialog("add"); } void MainWindow::on_btn_git_stash_clicked() { RunCmdDialog("stash"); } void MainWindow::on_btn_git_commit_clicked() { RunCmdDialog("commit"); } void MainWindow::on_btn_git_push_clicked() { RunCmdDialog("push"); } void MainWindow::on_btn_git_pull_clicked() { RunCmdDialog("pull"); } void MainWindow::on_btn_git_diff_clicked() { RunCmdDialog("diff"); } void MainWindow::on_btn_git_status_clicked() { RunCmdDialog("status"); } void MainWindow::on_btn_git_log_clicked() { RunCmdDialog("log"); }
35.469673
101
0.557504
[ "object" ]
4e0f34149976cd106919b3c65858f44ca6ee9466
16,184
cpp
C++
gdax_zorro_plugin/gdax/client.cpp
kzhdev/gdax_zorro_plugin
796e15cf57662ec05a854ca24de80d37565dac6d
[ "MIT" ]
2
2021-04-02T18:53:04.000Z
2021-09-19T00:07:36.000Z
gdax_zorro_plugin/gdax/client.cpp
kzhdev/gdax_zorro_plugin
796e15cf57662ec05a854ca24de80d37565dac6d
[ "MIT" ]
1
2022-02-17T09:55:43.000Z
2022-02-17T13:14:52.000Z
gdax_zorro_plugin/gdax/client.cpp
kzhdev/gdax_zorro_plugin
796e15cf57662ec05a854ca24de80d37565dac6d
[ "MIT" ]
null
null
null
#include "stdafx.h" #include "gdax/client.h" #include <sstream> #include <memory> #include <optional> #include <chrono> #include <algorithm> #include "rapidjson/document.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" #include "cryptopp/cryptlib.h" using CryptoPP::Exception; #include "cryptopp/hmac.h" using CryptoPP::HMAC; #include "cryptopp/sha.h" using CryptoPP::SHA256; #include "cryptopp/base64.h" using CryptoPP::Base64Encoder; using CryptoPP::Base64Decoder; using CryptoPP::byte; #include "cryptopp/hex.h" using CryptoPP::HexEncoder; #include "cryptopp/filters.h" using CryptoPP::StringSink; using CryptoPP::StringSource; using CryptoPP::HashFilter; namespace { /// The base URL for API calls to the live trading API constexpr const char* s_APIBaseURLLive = "https://api.pro.coinbase.com"; /// The base URL for API calls to the paper trading API constexpr const char* s_APIBaseURLPaper = "https://api-public.sandbox.pro.coinbase.com"; inline uint64_t get_timestamp() { auto now = std::chrono::system_clock::now(); return std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count(); } inline uint64_t nonce() { static const uint64_t base = 1613437804467; return get_timestamp() - base; } inline double to_num_contracts(double lots, double qty_multiplier) { return ((lots / qty_multiplier) + 1e-11) * lots; } constexpr double epsilon = 1e-9; constexpr uint64_t default_norm_factor = 1e8; inline static double fix_floating_error(double value, int32_t norm_factor = default_norm_factor) { auto v = value + epsilon; return ((double)((int64_t)(v * norm_factor)) / norm_factor); } inline static uint32_t compute_number_decimals(double value) { value = std::abs(fix_floating_error(value)); uint32_t count = 0; while (value - std::floor(value) > epsilon) { ++count; value *= 10; } return count; } } namespace gdax { std::string timeToString(time_t time) { tm* tm; tm = gmtime(&time); char buf[64]; strftime(buf, 64, "%Y-%m-%dT%H:%M:%SZ", tm); return buf; } Client::Client(const std::string& key, const std::string& passphrase, const std::string& secret, bool isPaperTrading, const std::string& stp) : baseUrl_(isPaperTrading ? s_APIBaseURLPaper : s_APIBaseURLLive) , stp_(stp) , constant_headers_( "Content-Type:application/json\nUser-Agent:Zorro\nCB-ACCESS-KEY:" + key + "\nCB-ACCESS-PASSPHRASE:" + passphrase) , public_api_headers_("User-Agent:Zorro") , isLiveMode_(!isPaperTrading) { try { StringSource(secret, true, new Base64Decoder(new StringSink(secret_))); } catch (const CryptoPP::Exception& e) { BrokerError(("failed to decode API secret. err=" + std::string(e.what())).c_str()); throw std::runtime_error(e.what()); } } bool Client::sign( const char* method, const std::string& request_path, std::string& timestamp, std::string& sign, const std::string& body) const { try { timestamp = std::to_string(get_timestamp()); std::string msg = timestamp; msg.append(method).append(request_path).append(body); std::string mac; HMAC<SHA256> hmac((unsigned char*)secret_.c_str(), secret_.size()); StringSource(msg, true, new HashFilter(hmac, new StringSink(mac))); StringSource(mac, true, new Base64Encoder(new StringSink(sign), false)); return true; } catch (const CryptoPP::Exception& e) { BrokerError(("failed to sign request. err=" + std::string(e.what())).c_str()); } return false; } std::string Client::headers(const std::string& sign, const std::string& timestamp) const { std::stringstream ss; ss << constant_headers_ << "\nCB-ACCESS-SIGN:" << sign << "\nCB-ACCESS-TIMESTAMP:" << timestamp; //logger_.logDebug("%s\n", ss.str().c_str()); return ss.str(); } Response<std::vector<Account>> Client::getAccounts() const { std::string timestamp; std::string signature; if (sign("GET", "/accounts", timestamp, signature)) { return request<std::vector<Account>>(baseUrl_ + "/accounts", headers(signature, timestamp).c_str()); } return Response<std::vector<Account>>(1, "Failed to sign /accounts request"); } const std::unordered_map<std::string, Product>& Client::getProducts() { if (!products_.empty()) { return products_; } auto response = request<std::vector<Product>>(baseUrl_ + "/products", public_api_headers_.c_str()); if (!response) { BrokerError(("Failed to get products. err=" + response.what()).c_str()); } else { for (auto& prod : response.content()) { products_.insert(std::make_pair(prod.id, prod)); } } return products_; } const Product* Client::getProduct(const char* asset) { auto& products = getProducts(); auto it = products.find(asset); if (it != products.end()) { return &it->second; } return nullptr; } Response<Ticker> Client::getTicker(const std::string& id) const { return request<Ticker>(baseUrl_ + "/products/" + id + "/ticker", public_api_headers_.c_str()); } Response<Time> Client::getTime() const { return request<Time>(baseUrl_ + "/time", public_api_headers_.c_str()); } Response<Candles> Client::getCandles(const std::string& AssetId, uint32_t start, uint32_t end, uint32_t granularity, uint32_t nCandles) const { static std::vector<uint32_t> s_valid_granularity = { 60, 300, 900, 3600, 21600, 86400 }; auto iter = std::find(s_valid_granularity.begin(), s_valid_granularity.end(), granularity); uint32_t supported_granularity = granularity; uint32_t n = 1; if (iter == s_valid_granularity.end()) { // not a supported granularity; assert(false); bool find = false; for (auto it = s_valid_granularity.rbegin(); it != s_valid_granularity.rend(); ++it) { if ((granularity % (*it)) == 0) { supported_granularity = *it; n = (uint32_t)(granularity / supported_granularity); LOG_DEBUG("Grenularity %n is not supported by Coinbase Pro, use %d instead.", granularity, supported_granularity); find = true; break; } } if (!find) { return Response<Candles>(1, "Granularity " + std::to_string(granularity) + " is not supported"); } } uint32_t s; uint32_t e = end; nCandles *= n; auto download_candles = [this, &s, e, supported_granularity, AssetId, start]() { // make sure only 300 candles requests s = e - 300 * supported_granularity; if (s < start) { s = start; } std::stringstream ss; ss << baseUrl_ << "/products/" << AssetId << "/candles?start=" << timeToString(time_t(s)) << "&end=" << timeToString(time_t(e)) << "&granularity=" << supported_granularity; return request<Candles>(ss.str(), public_api_headers_.c_str(), nullptr, nullptr, LogLevel::L_TRACE); }; if (n == 1) { auto rsp = download_candles(); if (!rsp) { return rsp; } auto& downloadedCandles = rsp.content().candles; for (auto it = downloadedCandles.begin(); it != downloadedCandles.end();) { if (it->time > e || it->time < s) { it = downloadedCandles.erase(it); } else { ++it; } } return rsp; } Response<Candles> rt; auto& candles = rt.content().candles; candles.reserve(nCandles); uint32_t i = 0; Candle c; do { auto rsp = download_candles(); if (!rsp) { BrokerError(rsp.what().c_str()); break; } auto& downloadedCandles = rsp.content().candles; for (size_t i = 0; i < downloadedCandles.size(); ++i) { auto& candle = downloadedCandles[i]; e = candle.time; if (candle.time > e) { continue; } if (candle.time < s) { break; } if (i == 0) { c = candle; } else { c.high = std::max<double>(candle.high, c.high); c.low = std::min<double>(candle.low, c.low); c.close = candle.close; c.volume += candle.volume; } if (++i == n) { candles.emplace_back(std::move(c)); i = 0; --nCandles; } if (!nCandles) { return rt; } } e -= 30; } while (nCandles > 0 && s > start); return rt; } //Response<std::vector<Trade>> Client::getTrades(const std::string& AssetId) const { // //std::stringstream url; // //url << baseUrl_ << "/v1/trades/" << symbol << "?timestamp=" << timestamp << "&limit_trades=" << limit; /**/ // return request<std::vector<Trade>>(url.str(), nullptr); //} Response<std::vector<Order>> Client::getOrders() const { std::string timestamp; std::string signature; if (sign("GET", "/orders?status=all", timestamp, signature)) { return request<std::vector<Order>>(baseUrl_ + "/orders?status=all", headers(signature, timestamp).c_str()); } return Response<std::vector<Order>>(1, "Failed to sign /orders request"); } Response<Order*> Client::getOrder(const std::string& order_id) { Response<Order*> rt; rt.content() = nullptr; auto ord_it = orders_.find(order_id); if (ord_it != orders_.end()) { rt.content() = &ord_it->second; if (rt.content()->status == "done" || rt.content()->status == "canceled") { return rt; } } std::string path = "/orders/"; if (rt.content()) { path.append(rt.content()->id); } else { path.append(order_id); } std::string timestamp; std::string signature; if (sign("GET", path, timestamp, signature)) { auto response = request<Order>(baseUrl_ + path, headers(signature, timestamp).c_str(), nullptr, rt.content(), LogLevel::L_TRACE); if (response && !rt.content()) { auto it = orders_.emplace(order_id, std::move(response.content())).first; rt.content() = &it->second; } return rt; } return Response<Order*>(1, "Failed to sign " + path + " request"); } Response<Order*> Client::getOrder(Order* order) { std::string path = "/orders/" + order->id; std::string timestamp; std::string signature; Response<Order*> rt; rt.content() = order; if (sign("GET", path, timestamp, signature)) { auto response = request<Order>(baseUrl_ + path, headers(signature, timestamp).c_str(), nullptr, order, LogLevel::L_TRACE); if (!response) { rt.onError(response.getCode(), response.what()); } return rt; } rt.onError(1, "Failed to sign " + path + " request"); return rt; } Response<Order*> Client::submitOrder( const Product* const product, double lots, OrderSide side, OrderType type, TimeInForce tif, double limit_price, double stop_price, bool post_only) { Response<Order*> response; response.content() = nullptr; rapidjson::StringBuffer s; s.Clear(); rapidjson::Writer<rapidjson::StringBuffer> writer(s); writer.StartObject(); writer.Key("product_id"); writer.String(product->id.c_str()); writer.Key("side"); writer.String(to_string(side)); writer.Key("type"); writer.String(to_string(type)); if (!stp_.empty()) { writer.Key("stp"); writer.String(stp_.c_str()); } if (type == OrderType::Limit) { writer.Key("time_in_force"); writer.String(to_string(tif)); std::ostringstream price; price.precision(compute_number_decimals(product->quote_increment)); if (side == OrderSide::Buy) { price << std::fixed << (limit_price - 0.5 * product->quote_increment); } else { price << std::fixed << (limit_price + 0.5 * product->quote_increment); } writer.Key("price"); writer.String(price.str().c_str()); if (stop_price) { writer.Key("stop_price"); writer.String(std::to_string(stop_price).c_str()); writer.Key("stop"); writer.String("loss"); } if (tif != TimeInForce::FOK && tif != TimeInForce::IOC) { writer.Key("post_only"); writer.Bool(post_only); } } std::ostringstream qty; qty.precision(compute_number_decimals(product->base_increment)); qty << std::fixed << lots; writer.Key("size"); writer.String(qty.str().c_str()); writer.EndObject(); auto data = s.GetString(); auto start = std::time(nullptr); std::string timestamp; std::string signature; if (sign("POST", "/orders", timestamp, signature, data)) { auto rsp = request<Order>(baseUrl_ + "/orders", headers(signature, timestamp).c_str(), data, nullptr, LogLevel::L_TRACE); if (rsp) { Order& order = rsp.content(); auto iter = orders_.insert(std::make_pair(order.id, order)).first; response.content() = &iter->second; while (iter->second.status == "pending") { response = getOrder(response.content()); if (!response) { break; } if (std::difftime(std::time(nullptr), start) >= 30) { response.onError(-2, "Order response timedout"); return response; } } } else { response.onError(1, rsp.what()); } } else { response.onError(1, "Failed to sign order request"); } return response; } Response<bool> Client::cancelOrder(Order& order) { LOG_DEBUG("--> DELETE %s/orders/%s\n", baseUrl_.c_str(), order.id.c_str()); auto path = "/orders/" + order.id; std::string timestamp; std::string signature; if (sign("DELETE", path, timestamp, signature)) { auto response = request<std::string>(baseUrl_ + path, headers(signature, timestamp).c_str(), "#DELETE", nullptr, LogLevel::L_TRACE); if (response) { order.status = "canceled"; return Response<bool>(0, "OK", true); } return Response<bool>(1, response.what(), false); } return Response<bool>(1, "Failed to sign cancelOrder request", false); } } // namespace gdax
34.804301
184
0.53763
[ "vector" ]
4e109529edf0e509007c44cf1f8d0dab4b8bd358
684
hpp
C++
driver_massless/IUpdatable.hpp
Massless-io/OpenVRDriver_MasslessPen
bce3c01877752d4e9c2135dec3e56b40e956ae60
[ "BSD-3-Clause-Clear", "CC0-1.0", "BSD-3-Clause" ]
null
null
null
driver_massless/IUpdatable.hpp
Massless-io/OpenVRDriver_MasslessPen
bce3c01877752d4e9c2135dec3e56b40e956ae60
[ "BSD-3-Clause-Clear", "CC0-1.0", "BSD-3-Clause" ]
null
null
null
driver_massless/IUpdatable.hpp
Massless-io/OpenVRDriver_MasslessPen
bce3c01877752d4e9c2135dec3e56b40e956ae60
[ "BSD-3-Clause-Clear", "CC0-1.0", "BSD-3-Clause" ]
null
null
null
/* Copyright (C) 2020 Massless Corp. - All Rights Reserved * Author: Jacob Hilton. * You may use, distribute and modify this code under the * terms of the BSD 3-Clause "New" or "Revised" License. * * You should have received a copy of this license with * this file. If not, please email support@massless.io */ #pragma once #include <vector> #include <openvr_driver.h> /// <summary> /// Interface for devices that will be updated every frame /// </summary> class IUpdatable { public: /// <summary> /// Called to update the state of this device. /// </summary> virtual void update(std::vector<vr::VREvent_t> events) = 0; virtual ~IUpdatable() = default; };
27.36
63
0.684211
[ "vector" ]
4e126245fb0c1630ea269fdcb6bd33f2826a7c57
1,718
hxx
C++
tests/Observer/references/MyObserver.hxx
UltimateScript/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
null
null
null
tests/Observer/references/MyObserver.hxx
UltimateScript/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
2
2021-07-07T17:31:49.000Z
2021-07-16T11:40:38.000Z
tests/Observer/references/MyObserver.hxx
OuluLinux/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
null
null
null
#ifndef MYOBSERVER_HXX #define MYOBSERVER_HXX #ifndef VECTOR_H #include <vector.H> #endif class MyObserver; class MySubject; class MyMessage { public: #line 10 "tests/Observer/Observer.fog" virtual void dispatch_to(MyObserver& anObserver, MySubject& aSubject) const; }; class MyMessage1 : public MyMessage { private: #line 70 int _count; int _count1; public: #line 73 inline MyMessage1(int aCount); inline int count() const; #line 36 virtual void dispatch_to(MyObserver& anObserver, MySubject& aSubject) const; }; class MyObserver { public: #line 30 typedef void observe_MyMessage(MySubject& aSubject, const MyMessage& aMessage); #line 37 typedef void observe_MyMessage1(MySubject& aSubject, const MyMessage1& aMessage); public: #line 29 virtual void observe(MySubject& aSubject, const MyMessage& aMessage); #line 38 virtual void observe(MySubject& aSubject, const MyMessage1& aMessage); }; class MyObserver1 : public MyObserver { public: #line 83 virtual void observe(MySubject& aSubject, const MyMessage1& aMessage); }; class MySubject { private: #line 16 vector < MyObserver * > _observers; public: #line 18 inline void attach(MyObserver *anObserver); inline void detach(MyObserver *anObserver); void notify(const MyMessage& aMessage); }; #line 73 inline MyMessage1::MyMessage1(int aCount) : _count(aCount) {}; #line 74 inline int MyMessage1::count() const { #line 74 return _count; }; #line 18 inline void MySubject::attach(MyObserver *anObserver) { #line 18 _observers.push_back(anObserver); }; #line 19 inline void MySubject::detach(MyObserver *anObserver) { #line 19 _observers.remove(anObserver); }; #endif
17.895833
85
0.731665
[ "vector" ]
4e23cc4e5f39cb64bfaade23a9008d21630b2e8a
1,294
cpp
C++
CodeForces/arraystab.cpp
unstablesun/CodeForces
bd7437200ec0cdb911b78cb6b6c82857dcbb2d69
[ "MIT" ]
null
null
null
CodeForces/arraystab.cpp
unstablesun/CodeForces
bd7437200ec0cdb911b78cb6b6c82857dcbb2d69
[ "MIT" ]
null
null
null
CodeForces/arraystab.cpp
unstablesun/CodeForces
bd7437200ec0cdb911b78cb6b6c82857dcbb2d69
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <string> #include <cmath> // g++ -std=c++11 -O2 -Wall arraystab.cpp -o arraystab using namespace std; int main() { int n; int stabArray[100000]; cin >> n; for (int i = 0; i < n; i++) { int b; cin >> b; stabArray[i] = b; } int result = 0; int max = 0; int min = INT_MAX; int minIndex = 0; int maxIndex = 0; for (int i = 0; i < n; i++) { if (min > stabArray[i]) { min = stabArray[i]; minIndex = i; } if (max < stabArray[i]) { max = stabArray[i]; maxIndex = i; } } int max2 = 0; int min2 = INT_MAX; int minIndex2 = 0; int maxIndex2 = 0; for (int i = 0; i < n; i++) { if (min2 > stabArray[i] && i != minIndex) { min2 = stabArray[i]; minIndex2 = i; } if (max2 < stabArray[i] && i != maxIndex) { max2 = stabArray[i]; maxIndex2 = i; } } //printf("%d %d %d %d\n", max, max2, min, min2); if (max - max2 > min2 - min) { result = max2 - min; } else { result = max - min2; } cout << result << "\n"; }
17.486486
54
0.421947
[ "vector" ]
4e25962ae5f6f2a1e1b751c4b7be1cd740e44d5c
3,960
cpp
C++
Libraries/RobsJuceModules/rosic/filters/lopt.cpp
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
34
2017-04-19T18:26:02.000Z
2022-02-15T17:47:26.000Z
Libraries/RobsJuceModules/rosic/filters/lopt.cpp
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
307
2017-05-04T21:45:01.000Z
2022-02-03T00:59:01.000Z
Libraries/RobsJuceModules/rosic/filters/lopt.cpp
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
4
2017-09-05T17:04:31.000Z
2021-12-15T21:24:28.000Z
// lopt.cpp -- Optimum 'L' Filter algorithm. // (C) 2004, C. Bond. // // Based on discussion in Kuo, "Network Analysis and Synthesis", // pp. 379-383. Original method due to A.Papoulis."On Monotonic // Response Filters", Proc. IRE, 47, Feb. 1959. // #include <math.h> // This routine calculates the coefficients of the Legendre polynomial // of the 1st kind. It uses a recursion relation. The first few polynomials // are hard coded and the rest are found by recursion. // // (n+1)Pn+1 = (2n+1)xPn - nPn-1 Recursion relation. // void legendre(double *p,int n) { double *a,*b; int i,j; if (n == 0) { p[0] = 1.0; return; } if (n == 1) { p[0] = 0.0; p[1] = 1.0; return; } p[0] = -0.5; p[1] = 0.0; p[2] = 1.5; if (n == 2) return; a = new double [n+1]; b = new double [n+1]; for (i=0;i<=n;i++) { a[i] = b[i] = 0.0; } b[1] = 1.0; for (i=3;i<=n;i++) { for (j=0;j<=i;j++) { a[j] = b[j]; b[j] = p[j]; p[j] = 0.0; } for (j=i-2;j>=0;j-=2) { p[j] -= (i-1)*a[j]/i; } for (j=i-1;j>=0;j-=2) { p[j+1] += (2*i-1)*b[j]/i; } } delete [] b; delete [] a; } // // // In the following routine n = 2k + 1 for odd 'n' and n = 2k + 2 for // even 'n'. // // // n k // ----- // 1 0 // 2 0 // 3 1 // 4 1 // 5 2 // 6 2 // void lopt(double *w,int n) { double *a,*p,*s,*v,c0,c1; int i,j,k; a = new double [n+1]; p = new double [2*n+1]; s = new double [2*n+1]; v = new double [2*n+4]; k = (n-1)/2; // // form vector of 'a' constants // if (n & 1) { // odd for (i=0;i<=k;i++) { a[i] = (2.0*i+1.0)/(M_SQRT2*(k+1.0)); } } // even else { for (i=0;i<k+1;i++) { a[i] = 0.0; } if (k & 1) { for (i=1;i<=k;i+=2) { a[i] = (2*i+1)/sqrt((k+1)*(k+2)); } } else { for (i=0;i<=k;i+=2) { a[i] = (2*i+1)/sqrt((k+1)*(k+2)); } } } for (i=0;i<=n;i++){ s[i] = 0.0; w[i] = 0.0; } // // form s[] = sum of a[i]*P[i] // s[0] = a[0]; s[1] = a[1]; for (i=2;i<=k;i++) { legendre(p,i); for (j=0;j<=i;j++) { s[j] += a[i]*p[j]; } } // // form v[] = square of s[] // for (i=0;i<=2*k+2;i++) { v[i] = 0.0; } for (i=0;i<=k;i++) { for (j=0;j<=k;j++) { v[i+j] += s[i]*s[j]; } } // // modify integrand for even 'n' // v[2*k+1] = 0.0; if ((n & 1) == 0) { for (i=n;i>=0;i--) { v[i+1] += v[i]; } } // // form integral of v[] // for (i=n+1;i>=0;i--) { v[i+1] = v[i]/(double)(i+1.0); } v[0] = 0.0; // // clear s[] for use in computing definite integral // for (i=0;i<(n+2);i++){ s[i] = 0.0; } s[0] = -1.0; s[1] = 2.0; // // calculate definite integral // for (i=1;i<=n;i++) { if (i > 1) { c0 = -s[0]; for (j=1;j<i+1;j++) { c1 = -s[j] + 2.0*s[j-1]; s[j-1] = c0; c0 = c1; } c1 = 2.0*s[i]; s[i] = c0; s[i+1] = c1; } for (j=i;j>0;j--) { w[j] += (v[i]*s[j]); } } if ((n & 1) == 0) w[1] = 0.0; delete [] v; delete [] p; delete [] s; delete [] a; } #include <iostream.h> int main() { double w[20]; int i,n; cout << "Order of Optimal (L) Filter (n < 20): "; // This limit is arbitrary! cin >> n; if (n > 19) return 1; lopt(w,n); for (i=1;i<=n;i++) { if (w[i]) cout << w[i] << "w^" << 2*i << endl; } return 0; }
19.130435
81
0.354545
[ "vector" ]
4e2769d58a45f0bb25e3a39e0abfedc235270206
2,308
cpp
C++
34.find-first-and-last-position-of-element-in-sorted-array.cpp
meyash/LeetCode-Solutions
a9e064af64436e5a24bc3a2c93bd15d3c43f2391
[ "MIT" ]
1
2022-01-08T14:26:11.000Z
2022-01-08T14:26:11.000Z
34.find-first-and-last-position-of-element-in-sorted-array.cpp
meyash/LeetCode-Solutions
a9e064af64436e5a24bc3a2c93bd15d3c43f2391
[ "MIT" ]
null
null
null
34.find-first-and-last-position-of-element-in-sorted-array.cpp
meyash/LeetCode-Solutions
a9e064af64436e5a24bc3a2c93bd15d3c43f2391
[ "MIT" ]
null
null
null
/* * @lc app=leetcode id=34 lang=cpp * * [34] Find First and Last Position of Element in Sorted Array * * https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/ * * algorithms * Medium (36.95%) * Likes: 4728 * Dislikes: 181 * Total Accepted: 622.9K * Total Submissions: 1.7M * Testcase Example: '[5,7,7,8,8,10]\n8' * * Given an array of integers nums sorted in ascending order, find the starting * and ending position of a given target value. * * If target is not found in the array, return [-1, -1]. * * Follow up: Could you write an algorithm with O(log n) runtime complexity? * * * Example 1: * Input: nums = [5,7,7,8,8,10], target = 8 * Output: [3,4] * Example 2: * Input: nums = [5,7,7,8,8,10], target = 6 * Output: [-1,-1] * Example 3: * Input: nums = [], target = 0 * Output: [-1,-1] * * * Constraints: * * * 0 <= nums.length <= 10^5 * -10^9 <= nums[i] <= 10^9 * nums is a non-decreasing array. * -10^9 <= target <= 10^9 * * */ #include<bits/stdc++.h> using namespace std; // 10^5 => nlogn may be accepted // my soln => find using binary search // then expand in both directions // @lc code=start class Solution { public: vector<int> searchRange(vector<int>& nums, int target) { int n=nums.size(); if(n<1){ return {-1,-1}; } if(n==1){ if(nums[0]==target){ return {0,0}; }else{ return {-1,-1}; } } int start=0; int end=n-1; int mid; int found=-1; while(start<=end){ mid=(start+end)/2; if(nums[mid]>target){ end=mid-1; }else if(nums[mid]==target){ found=1; break; }else{ start=mid+1; } } if(found==-1){ return {-1,-1}; } // now expand in both directions int rightindex=mid; int leftindex=mid; while(rightindex<n-1&&nums[rightindex+1]==target){ rightindex++; } while(leftindex>0&&nums[leftindex-1]==target){ leftindex--; } return {leftindex,rightindex}; } }; // @lc code=end
22.851485
101
0.515598
[ "vector" ]
89ed0fecfbb6db4017880401337149199bddeb80
45,225
cpp
C++
SourceSDK/tier1/strtools.cpp
SDLash3D/libvinterface
4030b748f7e2b56870dc7a6a6b1c671d6f188089
[ "MIT" ]
1
2016-04-24T21:00:02.000Z
2016-04-24T21:00:02.000Z
SourceSDK/tier1/strtools.cpp
SDLash3D/libvinterface
4030b748f7e2b56870dc7a6a6b1c671d6f188089
[ "MIT" ]
null
null
null
SourceSDK/tier1/strtools.cpp
SDLash3D/libvinterface
4030b748f7e2b56870dc7a6a6b1c671d6f188089
[ "MIT" ]
null
null
null
//===== Copyright (C) 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: String Tools // //===========================================================================// // These are redefined in the project settings to prevent anyone from using them. // We in this module are of a higher caste and thus are privileged in their use. #ifdef strncpy #undef strncpy #endif #ifdef _snprintf #undef _snprintf #endif #if defined( sprintf ) #undef sprintf #endif #if defined( vsprintf ) #undef vsprintf #endif #ifdef _vsnprintf #ifdef _WIN32 #undef _vsnprintf #endif #endif #ifdef vsnprintf #ifndef _WIN32 #undef vsnprintf #endif #endif #if defined( strcat ) #undef strcat #endif #ifdef strncat #undef strncat #endif // NOTE: I have to include stdio + stdarg first so vsnprintf gets compiled in #include <stdio.h> #include <stdarg.h> #ifdef _LINUX #include <ctype.h> #include <unistd.h> #include <stdlib.h> #define _getcwd getcwd #elif _WIN32 #include <direct.h> #if !defined( _X360 ) #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif #endif #ifdef _WIN32 #ifndef CP_UTF8 #define CP_UTF8 65001 #endif #endif #include "tier0/dbg.h" #include "tier1/strtools.h" #include <string.h> #include <stdlib.h> #include "tier0/basetypes.h" #include "tier1/utldict.h" #if defined( _X360 ) #include "xbox/xbox_win32stubs.h" #endif #include "tier0/memdbgon.h" void _V_memset (const char* file, int line, void *dest, int fill, int count) { Assert( count >= 0 ); AssertValidWritePtr( dest, count ); memset(dest,fill,count); } void _V_memcpy (const char* file, int line, void *dest, const void *src, int count) { Assert( count >= 0 ); AssertValidReadPtr( src, count ); AssertValidWritePtr( dest, count ); memcpy( dest, src, count ); } void _V_memmove(const char* file, int line, void *dest, const void *src, int count) { Assert( count >= 0 ); AssertValidReadPtr( src, count ); AssertValidWritePtr( dest, count ); memmove( dest, src, count ); } int _V_memcmp (const char* file, int line, const void *m1, const void *m2, int count) { Assert( count >= 0 ); AssertValidReadPtr( m1, count ); AssertValidReadPtr( m2, count ); return memcmp( m1, m2, count ); } int _V_strlen(const char* file, int line, const char *str) { AssertValidStringPtr(str); return strlen( str ); } void _V_strcpy (const char* file, int line, char *dest, const char *src) { AssertValidWritePtr(dest); AssertValidStringPtr(src); strcpy( dest, src ); } int _V_wcslen(const char* file, int line, const wchar_t *pwch) { return wcslen( pwch ); } char *_V_strrchr(const char* file, int line, const char *s, char c) { AssertValidStringPtr( s ); int len = V_strlen(s); s += len; while (len--) if (*--s == c) return (char *)s; return 0; } int _V_strcmp (const char* file, int line, const char *s1, const char *s2) { AssertValidStringPtr( s1 ); AssertValidStringPtr( s2 ); return strcmp( s1, s2 ); } int _V_wcscmp (const char* file, int line, const wchar_t *s1, const wchar_t *s2) { while (1) { if (*s1 != *s2) return -1; // strings not equal if (!*s1) return 0; // strings are equal s1++; s2++; } return -1; } int _V_stricmp(const char* file, int line, const char *s1, const char *s2 ) { AssertValidStringPtr( s1 ); AssertValidStringPtr( s2 ); return stricmp( s1, s2 ); } char *_V_strstr(const char* file, int line, const char *s1, const char *search ) { AssertValidStringPtr( s1 ); AssertValidStringPtr( search ); #if defined( _X360 ) return (char *)strstr( (char *)s1, search ); #else return (char *)strstr( s1, search ); #endif } char *_V_strupr (const char* file, int line, char *start) { AssertValidStringPtr( start ); return strupr( start ); } char *_V_strlower (const char* file, int line, char *start) { AssertValidStringPtr( start ); return strlwr(start); } int V_strncmp (const char *s1, const char *s2, int count) { Assert( count >= 0 ); AssertValidStringPtr( s1, count ); AssertValidStringPtr( s2, count ); while ( count-- > 0 ) { if ( *s1 != *s2 ) return *s1 < *s2 ? -1 : 1; // string different if ( *s1 == '\0' ) return 0; // null terminator hit - strings the same s1++; s2++; } return 0; // count characters compared the same } char *V_strnlwr(char *s, size_t count) { Assert( count >= 0 ); AssertValidStringPtr( s, count ); char* pRet = s; if ( !s ) return s; while ( --count >= 0 ) { if ( !*s ) break; *s = tolower( *s ); ++s; } if ( count > 0 ) { s[count-1] = 0; } return pRet; } int V_strncasecmp (const char *s1, const char *s2, int n) { Assert( n >= 0 ); AssertValidStringPtr( s1 ); AssertValidStringPtr( s2 ); while ( n-- > 0 ) { int c1 = *s1++; int c2 = *s2++; if (c1 != c2) { if (c1 >= 'a' && c1 <= 'z') c1 -= ('a' - 'A'); if (c2 >= 'a' && c2 <= 'z') c2 -= ('a' - 'A'); if (c1 != c2) return c1 < c2 ? -1 : 1; } if ( c1 == '\0' ) return 0; // null terminator hit - strings the same } return 0; // n characters compared the same } int V_strcasecmp( const char *s1, const char *s2 ) { AssertValidStringPtr( s1 ); AssertValidStringPtr( s2 ); return stricmp( s1, s2 ); } int V_strnicmp (const char *s1, const char *s2, int n) { Assert( n >= 0 ); AssertValidStringPtr(s1); AssertValidStringPtr(s2); return V_strncasecmp( s1, s2, n ); } const char *StringAfterPrefix( const char *str, const char *prefix ) { AssertValidStringPtr( str ); AssertValidStringPtr( prefix ); do { if ( !*prefix ) return str; } while ( tolower( *str++ ) == tolower( *prefix++ ) ); return NULL; } const char *StringAfterPrefixCaseSensitive( const char *str, const char *prefix ) { AssertValidStringPtr( str ); AssertValidStringPtr( prefix ); do { if ( !*prefix ) return str; } while ( *str++ == *prefix++ ); return NULL; } int V_atoi (const char *str) { AssertValidStringPtr( str ); int val; int sign; int c; Assert( str ); if (*str == '-') { sign = -1; str++; } else sign = 1; val = 0; // // check for hex // if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') ) { str += 2; while (1) { c = *str++; if (c >= '0' && c <= '9') val = (val<<4) + c - '0'; else if (c >= 'a' && c <= 'f') val = (val<<4) + c - 'a' + 10; else if (c >= 'A' && c <= 'F') val = (val<<4) + c - 'A' + 10; else return val*sign; } } // // check for character // if (str[0] == '\'') { return sign * str[1]; } // // assume decimal // while (1) { c = *str++; if (c <'0' || c > '9') return val*sign; val = val*10 + c - '0'; } return 0; } float V_atof (const char *str) { AssertValidStringPtr( str ); double val; int sign; int c; int decimal, total; if (*str == '-') { sign = -1; str++; } else sign = 1; val = 0; // // check for hex // if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') ) { str += 2; while (1) { c = *str++; if (c >= '0' && c <= '9') val = (val*16) + c - '0'; else if (c >= 'a' && c <= 'f') val = (val*16) + c - 'a' + 10; else if (c >= 'A' && c <= 'F') val = (val*16) + c - 'A' + 10; else return val*sign; } } // // check for character // if (str[0] == '\'') { return sign * str[1]; } // // assume decimal // decimal = -1; total = 0; while (1) { c = *str++; if (c == '.') { decimal = total; continue; } if (c <'0' || c > '9') break; val = val*10 + c - '0'; total++; } if (decimal == -1) return val*sign; while (total > decimal) { val /= 10; total--; } return val*sign; } //----------------------------------------------------------------------------- // Normalizes a float string in place. // // (removes leading zeros, trailing zeros after the decimal point, and the decimal point itself where possible) //----------------------------------------------------------------------------- void V_normalizeFloatString( char* pFloat ) { // If we have a decimal point, remove trailing zeroes: if( strchr( pFloat,'.' ) ) { int len = V_strlen(pFloat); while( len > 1 && pFloat[len - 1] == '0' ) { pFloat[len - 1] = '\0'; len--; } if( len > 1 && pFloat[ len - 1 ] == '.' ) { pFloat[len - 1] = '\0'; len--; } } // TODO: Strip leading zeros } //----------------------------------------------------------------------------- // Finds a string in another string with a case insensitive test //----------------------------------------------------------------------------- char const* V_stristr( char const* pStr, char const* pSearch ) { AssertValidStringPtr(pStr); AssertValidStringPtr(pSearch); if (!pStr || !pSearch) return 0; char const* pLetter = pStr; // Check the entire string while (*pLetter != 0) { // Skip over non-matches if (tolower((unsigned char)*pLetter) == tolower((unsigned char)*pSearch)) { // Check for match char const* pMatch = pLetter + 1; char const* pTest = pSearch + 1; while (*pTest != 0) { // We've run off the end; don't bother. if (*pMatch == 0) return 0; if (tolower((unsigned char)*pMatch) != tolower((unsigned char)*pTest)) break; ++pMatch; ++pTest; } // Found a match! if (*pTest == 0) return pLetter; } ++pLetter; } return 0; } char* V_stristr( char* pStr, char const* pSearch ) { AssertValidStringPtr( pStr ); AssertValidStringPtr( pSearch ); return (char*)V_stristr( (char const*)pStr, pSearch ); } //----------------------------------------------------------------------------- // Finds a string in another string with a case insensitive test w/ length validation //----------------------------------------------------------------------------- char const* V_strnistr( char const* pStr, char const* pSearch, int n ) { AssertValidStringPtr(pStr); AssertValidStringPtr(pSearch); if (!pStr || !pSearch) return 0; char const* pLetter = pStr; // Check the entire string while (*pLetter != 0) { if ( n <= 0 ) return 0; // Skip over non-matches if (tolower(*pLetter) == tolower(*pSearch)) { int n1 = n - 1; // Check for match char const* pMatch = pLetter + 1; char const* pTest = pSearch + 1; while (*pTest != 0) { if ( n1 <= 0 ) return 0; // We've run off the end; don't bother. if (*pMatch == 0) return 0; if (tolower(*pMatch) != tolower(*pTest)) break; ++pMatch; ++pTest; --n1; } // Found a match! if (*pTest == 0) return pLetter; } ++pLetter; --n; } return 0; } const char* V_strnchr( const char* pStr, char c, int n ) { char const* pLetter = pStr; char const* pLast = pStr + n; // Check the entire string while ( (pLetter < pLast) && (*pLetter != 0) ) { if (*pLetter == c) return pLetter; ++pLetter; } return NULL; } void V_strncpy( char *pDest, char const *pSrc, int maxLen ) { Assert( maxLen >= 0 ); AssertValidWritePtr( pDest, maxLen ); AssertValidStringPtr( pSrc ); strncpy( pDest, pSrc, maxLen ); if ( maxLen > 0 ) { pDest[maxLen-1] = 0; } } void V_wcsncpy( wchar_t *pDest, wchar_t const *pSrc, int maxLenInBytes ) { Assert( maxLenInBytes >= 0 ); AssertValidWritePtr( pDest, maxLenInBytes ); AssertValidReadPtr( pSrc ); int maxLen = maxLenInBytes / sizeof(wchar_t); wcsncpy( pDest, pSrc, maxLen ); if( maxLen ) { pDest[maxLen-1] = 0; } } int V_snprintf( char *pDest, int maxLen, char const *pFormat, ... ) { Assert( maxLen >= 0 ); AssertValidWritePtr( pDest, maxLen ); AssertValidStringPtr( pFormat ); va_list marker; va_start( marker, pFormat ); #ifdef _WIN32 int len = _vsnprintf( pDest, maxLen, pFormat, marker ); #elif _LINUX int len = vsnprintf( pDest, maxLen, pFormat, marker ); #else #error "define vsnprintf type." #endif va_end( marker ); // Len < 0 represents an overflow if( len < 0 ) { len = maxLen; pDest[maxLen-1] = 0; } return len; } int V_vsnprintf( char *pDest, int maxLen, char const *pFormat, va_list params ) { Assert( maxLen > 0 ); AssertValidWritePtr( pDest, maxLen ); AssertValidStringPtr( pFormat ); int len = _vsnprintf( pDest, maxLen, pFormat, params ); if( len < 0 ) { len = maxLen; pDest[maxLen-1] = 0; } return len; } //----------------------------------------------------------------------------- // Purpose: If COPY_ALL_CHARACTERS == max_chars_to_copy then we try to add the whole pSrc to the end of pDest, otherwise // we copy only as many characters as are specified in max_chars_to_copy (or the # of characters in pSrc if thats's less). // Input : *pDest - destination buffer // *pSrc - string to append // destBufferSize - sizeof the buffer pointed to by pDest // max_chars_to_copy - COPY_ALL_CHARACTERS in pSrc or max # to copy // Output : char * the copied buffer //----------------------------------------------------------------------------- char *V_strncat(char *pDest, const char *pSrc, size_t destBufferSize, int max_chars_to_copy ) { size_t charstocopy = (size_t)0; Assert( destBufferSize >= 0 ); AssertValidStringPtr( pDest); AssertValidStringPtr( pSrc ); size_t len = strlen(pDest); size_t srclen = strlen( pSrc ); if ( max_chars_to_copy <= COPY_ALL_CHARACTERS ) { charstocopy = srclen; } else { charstocopy = (size_t)min( max_chars_to_copy, (int)srclen ); } if ( len + charstocopy >= destBufferSize ) { charstocopy = destBufferSize - len - 1; } if ( !charstocopy ) { return pDest; } char *pOut = strncat( pDest, pSrc, charstocopy ); pOut[destBufferSize-1] = 0; return pOut; } //----------------------------------------------------------------------------- // Purpose: Converts value into x.xx MB/ x.xx KB, x.xx bytes format, including commas // Input : value - // 2 - // false - // Output : char //----------------------------------------------------------------------------- #define NUM_PRETIFYMEM_BUFFERS 8 char *V_pretifymem( float value, int digitsafterdecimal /*= 2*/, bool usebinaryonek /*= false*/ ) { static char output[ NUM_PRETIFYMEM_BUFFERS ][ 32 ]; static int current; float onekb = usebinaryonek ? 1024.0f : 1000.0f; float onemb = onekb * onekb; char *out = output[ current ]; current = ( current + 1 ) & ( NUM_PRETIFYMEM_BUFFERS -1 ); char suffix[ 8 ]; // First figure out which bin to use if ( value > onemb ) { value /= onemb; V_snprintf( suffix, sizeof( suffix ), " MB" ); } else if ( value > onekb ) { value /= onekb; V_snprintf( suffix, sizeof( suffix ), " KB" ); } else { V_snprintf( suffix, sizeof( suffix ), " bytes" ); } char val[ 32 ]; // Clamp to >= 0 digitsafterdecimal = max( digitsafterdecimal, 0 ); // If it's basically integral, don't do any decimals if ( FloatMakePositive( value - (int)value ) < 0.00001 ) { V_snprintf( val, sizeof( val ), "%i%s", (int)value, suffix ); } else { char fmt[ 32 ]; // Otherwise, create a format string for the decimals V_snprintf( fmt, sizeof( fmt ), "%%.%if%s", digitsafterdecimal, suffix ); V_snprintf( val, sizeof( val ), fmt, value ); } // Copy from in to out char *i = val; char *o = out; // Search for decimal or if it was integral, find the space after the raw number char *dot = strstr( i, "." ); if ( !dot ) { dot = strstr( i, " " ); } // Compute position of dot int pos = dot - i; // Don't put a comma if it's <= 3 long pos -= 3; while ( *i ) { // If pos is still valid then insert a comma every third digit, except if we would be // putting one in the first spot if ( pos >= 0 && !( pos % 3 ) ) { // Never in first spot if ( o != out ) { *o++ = ','; } } // Count down comma position pos--; // Copy rest of data as normal *o++ = *i++; } // Terminate *o = 0; return out; } //----------------------------------------------------------------------------- // Purpose: Returns a string representation of an integer with commas // separating the 1000s (ie, 37,426,421) // Input : value - Value to convert // Output : Pointer to a static buffer containing the output //----------------------------------------------------------------------------- #define NUM_PRETIFYNUM_BUFFERS 8 char *V_pretifynum( int64 value ) { static char output[ NUM_PRETIFYMEM_BUFFERS ][ 32 ]; static int current; char *out = output[ current ]; current = ( current + 1 ) & ( NUM_PRETIFYMEM_BUFFERS -1 ); *out = 0; // Render the leading -, if necessary if ( value < 0 ) { char *pchRender = out + V_strlen( out ); V_snprintf( pchRender, 32, "-" ); value = -value; } // Render quadrillions if ( value >= 1000000000000 ) { char *pchRender = out + V_strlen( out ); V_snprintf( pchRender, 32, "%d,", value / 1000000000000 ); } // Render trillions if ( value >= 1000000000000 ) { char *pchRender = out + V_strlen( out ); V_snprintf( pchRender, 32, "%d,", value / 1000000000000 ); } // Render billions if ( value >= 1000000000 ) { char *pchRender = out + V_strlen( out ); V_snprintf( pchRender, 32, "%d,", value / 1000000000 ); } // Render millions if ( value >= 1000000 ) { char *pchRender = out + V_strlen( out ); if ( value >= 1000000000 ) V_snprintf( pchRender, 32, "%03d,", ( value / 1000000 ) % 1000 ); else V_snprintf( pchRender, 32, "%d,", ( value / 1000000 ) % 1000 ); } // Render thousands if ( value >= 1000 ) { char *pchRender = out + V_strlen( out ); if ( value >= 1000000 ) V_snprintf( pchRender, 32, "%03d,", ( value / 1000 ) % 1000 ); else V_snprintf( pchRender, 32, "%d,", ( value / 1000 ) % 1000 ); } // Render units char *pchRender = out + V_strlen( out ); if ( value > 1000 ) V_snprintf( pchRender, 32, "%03d", value % 1000 ); else V_snprintf( pchRender, 32, "%d", value % 1000 ); return out; } //----------------------------------------------------------------------------- // Purpose: Converts a UTF8 string into a unicode string //----------------------------------------------------------------------------- int V_UTF8ToUnicode( const char *pUTF8, wchar_t *pwchDest, int cubDestSizeInBytes ) { AssertValidStringPtr(pUTF8); AssertValidWritePtr(pwchDest); pwchDest[0] = 0; #ifdef _WIN32 int cchResult = MultiByteToWideChar( CP_UTF8, 0, pUTF8, -1, pwchDest, cubDestSizeInBytes / sizeof(wchar_t) ); #elif _LINUX int cchResult = mbstowcs( pwchDest, pUTF8, cubDestSizeInBytes / sizeof(wchar_t) ); #endif pwchDest[(cubDestSizeInBytes / sizeof(wchar_t)) - 1] = 0; return cchResult; } //----------------------------------------------------------------------------- // Purpose: Converts a unicode string into a UTF8 (standard) string //----------------------------------------------------------------------------- int V_UnicodeToUTF8( const wchar_t *pUnicode, char *pUTF8, int cubDestSizeInBytes ) { AssertValidStringPtr(pUTF8, cubDestSizeInBytes); AssertValidReadPtr(pUnicode); pUTF8[0] = 0; #ifdef _WIN32 int cchResult = WideCharToMultiByte( CP_UTF8, 0, pUnicode, -1, pUTF8, cubDestSizeInBytes, NULL, NULL ); #elif _LINUX int cchResult = wcstombs( pUTF8, pUnicode, cubDestSizeInBytes ); #endif pUTF8[cubDestSizeInBytes - 1] = 0; return cchResult; } //----------------------------------------------------------------------------- // Purpose: Returns the 4 bit nibble for a hex character // Input : c - // Output : unsigned char //----------------------------------------------------------------------------- static unsigned char V_nibble( char c ) { if ( ( c >= '0' ) && ( c <= '9' ) ) { return (unsigned char)(c - '0'); } if ( ( c >= 'A' ) && ( c <= 'F' ) ) { return (unsigned char)(c - 'A' + 0x0a); } if ( ( c >= 'a' ) && ( c <= 'f' ) ) { return (unsigned char)(c - 'a' + 0x0a); } return '0'; } //----------------------------------------------------------------------------- // Purpose: // Input : *in - // numchars - // *out - // maxoutputbytes - //----------------------------------------------------------------------------- void V_hextobinary( char const *in, int numchars, byte *out, int maxoutputbytes ) { int len = V_strlen( in ); numchars = min( len, numchars ); // Make sure it's even numchars = ( numchars ) & ~0x1; // Must be an even # of input characters (two chars per output byte) Assert( numchars >= 2 ); memset( out, 0x00, maxoutputbytes ); byte *p; int i; p = out; for ( i = 0; ( i < numchars ) && ( ( p - out ) < maxoutputbytes ); i+=2, p++ ) { *p = ( V_nibble( in[i] ) << 4 ) | V_nibble( in[i+1] ); } } //----------------------------------------------------------------------------- // Purpose: // Input : *in - // inputbytes - // *out - // outsize - //----------------------------------------------------------------------------- void V_binarytohex( const byte *in, int inputbytes, char *out, int outsize ) { Assert( outsize >= 1 ); char doublet[10]; int i; out[0]=0; for ( i = 0; i < inputbytes; i++ ) { unsigned char c = in[i]; V_snprintf( doublet, sizeof( doublet ), "%02x", c ); V_strncat( out, doublet, outsize, COPY_ALL_CHARACTERS ); } } #if defined( _WIN32 ) || defined( WIN32 ) #define PATHSEPARATOR(c) ((c) == '\\' || (c) == '/') #else //_WIN32 #define PATHSEPARATOR(c) ((c) == '/') #endif //_WIN32 //----------------------------------------------------------------------------- // Purpose: Extracts the base name of a file (no path, no extension, assumes '/' or '\' as path separator) // Input : *in - // *out - // maxlen - //----------------------------------------------------------------------------- void V_FileBase( const char *in, char *out, int maxlen ) { Assert( maxlen >= 1 ); Assert( in ); Assert( out ); if ( !in || !in[ 0 ] ) { *out = 0; return; } int len, start, end; len = V_strlen( in ); // scan backward for '.' end = len - 1; while ( end&& in[end] != '.' && !PATHSEPARATOR( in[end] ) ) { end--; } if ( in[end] != '.' ) // no '.', copy to end { end = len-1; } else { end--; // Found ',', copy to left of '.' } // Scan backward for '/' start = len-1; while ( start >= 0 && !PATHSEPARATOR( in[start] ) ) { start--; } if ( start < 0 || !PATHSEPARATOR( in[start] ) ) { start = 0; } else { start++; } // Length of new sting len = end - start + 1; int maxcopy = min( len + 1, maxlen ); // Copy partial string V_strncpy( out, &in[start], maxcopy ); } //----------------------------------------------------------------------------- // Purpose: // Input : *ppath - //----------------------------------------------------------------------------- void V_StripTrailingSlash( char *ppath ) { Assert( ppath ); int len = V_strlen( ppath ); if ( len > 0 ) { if ( PATHSEPARATOR( ppath[ len - 1 ] ) ) { ppath[ len - 1 ] = 0; } } } //----------------------------------------------------------------------------- // Purpose: // Input : *in - // *out - // outSize - //----------------------------------------------------------------------------- void V_StripExtension( const char *in, char *out, int outSize ) { // Find the last dot. If it's followed by a dot or a slash, then it's part of a // directory specifier like ../../somedir/./blah. // scan backward for '.' int end = V_strlen( in ) - 1; while ( end > 0 && in[end] != '.' && !PATHSEPARATOR( in[end] ) ) { --end; } if (end > 0 && !PATHSEPARATOR( in[end] ) && end < outSize) { int nChars = min( end, outSize-1 ); if ( out != in ) { memcpy( out, in, nChars ); } out[nChars] = 0; } else { // nothing found if ( out != in ) { V_strncpy( out, in, outSize ); } } } //----------------------------------------------------------------------------- // Purpose: // Input : *path - // *extension - // pathStringLength - //----------------------------------------------------------------------------- void V_DefaultExtension( char *path, const char *extension, int pathStringLength ) { Assert( path ); Assert( pathStringLength >= 1 ); Assert( extension ); Assert( extension[0] == '.' ); char *src; // if path doesn't have a .EXT, append extension // (extension should include the .) src = path + V_strlen(path) - 1; while ( !PATHSEPARATOR( *src ) && ( src > path ) ) { if (*src == '.') { // it has an extension return; } src--; } // Concatenate the desired extension V_strncat( path, extension, pathStringLength, COPY_ALL_CHARACTERS ); } //----------------------------------------------------------------------------- // Purpose: Force extension... // Input : *path - // *extension - // pathStringLength - //----------------------------------------------------------------------------- void V_SetExtension( char *path, const char *extension, int pathStringLength ) { V_StripExtension( path, path, pathStringLength ); V_DefaultExtension( path, extension, pathStringLength ); } //----------------------------------------------------------------------------- // Purpose: Remove final filename from string // Input : *path - // Output : void V_StripFilename //----------------------------------------------------------------------------- void V_StripFilename (char *path) { int length; length = V_strlen( path )-1; if ( length <= 0 ) return; while ( length > 0 && !PATHSEPARATOR( path[length] ) ) { length--; } path[ length ] = 0; } #ifdef _WIN32 #define CORRECT_PATH_SEPARATOR '\\' #define INCORRECT_PATH_SEPARATOR '/' #elif _LINUX #define CORRECT_PATH_SEPARATOR '/' #define INCORRECT_PATH_SEPARATOR '\\' #endif //----------------------------------------------------------------------------- // Purpose: Changes all '/' or '\' characters into separator // Input : *pname - // separator - //----------------------------------------------------------------------------- void V_FixSlashes( char *pname, char separator /* = CORRECT_PATH_SEPARATOR */ ) { while ( *pname ) { if ( *pname == INCORRECT_PATH_SEPARATOR || *pname == CORRECT_PATH_SEPARATOR ) { *pname = separator; } pname++; } } //----------------------------------------------------------------------------- // Purpose: This function fixes cases of filenames like materials\\blah.vmt or somepath\otherpath\\ and removes the extra double slash. //----------------------------------------------------------------------------- void V_FixDoubleSlashes( char *pStr ) { int len = V_strlen( pStr ); for ( int i=1; i < len-1; i++ ) { if ( (pStr[i] == '/' || pStr[i] == '\\') && (pStr[i+1] == '/' || pStr[i+1] == '\\') ) { // This means there's a double slash somewhere past the start of the filename. That // can happen in Hammer if they use a material in the root directory. You'll get a filename // that looks like 'materials\\blah.vmt' V_memmove( &pStr[i], &pStr[i+1], len - i ); --len; } } } //----------------------------------------------------------------------------- // Purpose: Strip off the last directory from dirName // Input : *dirName - // maxlen - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool V_StripLastDir( char *dirName, int maxlen ) { if( dirName[0] == 0 || !V_stricmp( dirName, "./" ) || !V_stricmp( dirName, ".\\" ) ) return false; int len = V_strlen( dirName ); Assert( len < maxlen ); // skip trailing slash if ( PATHSEPARATOR( dirName[len-1] ) ) { len--; } while ( len > 0 ) { if ( PATHSEPARATOR( dirName[len-1] ) ) { dirName[len] = 0; V_FixSlashes( dirName, CORRECT_PATH_SEPARATOR ); return true; } len--; } // Allow it to return an empty string and true. This can happen if something like "tf2/" is passed in. // The correct behavior is to strip off the last directory ("tf2") and return true. if( len == 0 ) { V_snprintf( dirName, maxlen, ".%c", CORRECT_PATH_SEPARATOR ); return true; } return true; } //----------------------------------------------------------------------------- // Purpose: Returns a pointer to the beginning of the unqualified file name // (no path information) // Input: in - file name (may be unqualified, relative or absolute path) // Output: pointer to unqualified file name //----------------------------------------------------------------------------- const char * V_UnqualifiedFileName( const char * in ) { // back up until the character after the first path separator we find, // or the beginning of the string const char * out = in + strlen( in ) - 1; while ( ( out > in ) && ( !PATHSEPARATOR( *( out-1 ) ) ) ) out--; return out; } //----------------------------------------------------------------------------- // Purpose: Composes a path and filename together, inserting a path separator // if need be // Input: path - path to use // filename - filename to use // dest - buffer to compose result in // destSize - size of destination buffer //----------------------------------------------------------------------------- void V_ComposeFileName( const char *path, const char *filename, char *dest, int destSize ) { V_strncpy( dest, path, destSize ); V_AppendSlash( dest, destSize ); V_strncat( dest, filename, destSize, COPY_ALL_CHARACTERS ); V_FixSlashes( dest ); } //----------------------------------------------------------------------------- // Purpose: // Input : *path - // *dest - // destSize - // Output : void V_ExtractFilePath //----------------------------------------------------------------------------- bool V_ExtractFilePath (const char *path, char *dest, int destSize ) { Assert( destSize >= 1 ); if ( destSize < 1 ) { return false; } // Last char int len = V_strlen(path); const char *src = path + (len ? len-1 : 0); // back up until a \ or the start while ( src != path && !PATHSEPARATOR( *(src-1) ) ) { src--; } int copysize = min( src - path, destSize - 1 ); memcpy( dest, path, copysize ); dest[copysize] = 0; return copysize != 0 ? true : false; } //----------------------------------------------------------------------------- // Purpose: // Input : *path - // *dest - // destSize - // Output : void V_ExtractFileExtension //----------------------------------------------------------------------------- void V_ExtractFileExtension( const char *path, char *dest, int destSize ) { *dest = NULL; const char * extension = V_GetFileExtension( path ); if ( NULL != extension ) V_strncpy( dest, extension, destSize ); } //----------------------------------------------------------------------------- // Purpose: Returns a pointer to the file extension within a file name string // Input: in - file name // Output: pointer to beginning of extension (after the "."), or NULL // if there is no extension //----------------------------------------------------------------------------- const char * V_GetFileExtension( const char * path ) { const char *src; src = path + strlen(path) - 1; // // back up until a . or the start // while (src != path && *(src-1) != '.' ) src--; // check to see if the '.' is part of a pathname if (src == path || PATHSEPARATOR( *src ) ) { return NULL; // no extension } return src; } bool V_RemoveDotSlashes( char *pFilename, char separator ) { // Remove '//' or '\\' char *pIn = pFilename; char *pOut = pFilename; bool bPrevPathSep = false; while ( *pIn ) { bool bIsPathSep = PATHSEPARATOR( *pIn ); if ( !bIsPathSep || !bPrevPathSep ) { *pOut++ = *pIn; } bPrevPathSep = bIsPathSep; ++pIn; } *pOut = 0; // Get rid of "./"'s pIn = pFilename; pOut = pFilename; while ( *pIn ) { // The logic on the second line is preventing it from screwing up "../" if ( pIn[0] == '.' && PATHSEPARATOR( pIn[1] ) && (pIn == pFilename || pIn[-1] != '.') ) { pIn += 2; } else { *pOut = *pIn; ++pIn; ++pOut; } } *pOut = 0; // Get rid of a trailing "/." (needless). int len = strlen( pFilename ); if ( len > 2 && pFilename[len-1] == '.' && PATHSEPARATOR( pFilename[len-2] ) ) { pFilename[len-2] = 0; } // Each time we encounter a "..", back up until we've read the previous directory name, // then get rid of it. pIn = pFilename; while ( *pIn ) { if ( pIn[0] == '.' && pIn[1] == '.' && (pIn == pFilename || PATHSEPARATOR(pIn[-1])) && // Preceding character must be a slash. (pIn[2] == 0 || PATHSEPARATOR(pIn[2])) ) // Following character must be a slash or the end of the string. { char *pEndOfDots = pIn + 2; char *pStart = pIn - 2; // Ok, now scan back for the path separator that starts the preceding directory. while ( 1 ) { if ( pStart < pFilename ) return false; if ( PATHSEPARATOR( *pStart ) ) break; --pStart; } // Now slide the string down to get rid of the previous directory and the ".." memmove( pStart, pEndOfDots, strlen( pEndOfDots ) + 1 ); // Start over. pIn = pFilename; } else { ++pIn; } } V_FixSlashes( pFilename, separator ); return true; } void V_AppendSlash( char *pStr, int strSize ) { int len = V_strlen( pStr ); if ( len > 0 && !PATHSEPARATOR(pStr[len-1]) ) { if ( len+1 >= strSize ) Error( "V_AppendSlash: ran out of space on %s.", pStr ); pStr[len] = CORRECT_PATH_SEPARATOR; pStr[len+1] = 0; } } void V_MakeAbsolutePath( char *pOut, int outLen, const char *pPath, const char *pStartingDir ) { if ( V_IsAbsolutePath( pPath ) ) { // pPath is not relative.. just copy it. V_strncpy( pOut, pPath, outLen ); } else { // Make sure the starting directory is absolute.. if ( pStartingDir && V_IsAbsolutePath( pStartingDir ) ) { V_strncpy( pOut, pStartingDir, outLen ); } else { if ( !_getcwd( pOut, outLen ) ) Error( "V_MakeAbsolutePath: _getcwd failed." ); if ( pStartingDir ) { V_AppendSlash( pOut, outLen ); V_strncat( pOut, pStartingDir, outLen, COPY_ALL_CHARACTERS ); } } // Concatenate the paths. V_AppendSlash( pOut, outLen ); V_strncat( pOut, pPath, outLen, COPY_ALL_CHARACTERS ); } if ( !V_RemoveDotSlashes( pOut ) ) Error( "V_MakeAbsolutePath: tried to \"..\" past the root." ); V_FixSlashes( pOut ); } //----------------------------------------------------------------------------- // Makes a relative path //----------------------------------------------------------------------------- bool V_MakeRelativePath( const char *pFullPath, const char *pDirectory, char *pRelativePath, int nBufLen ) { pRelativePath[0] = 0; const char *pPath = pFullPath; const char *pDir = pDirectory; // Strip out common parts of the path const char *pLastCommonPath = NULL; const char *pLastCommonDir = NULL; while ( *pPath && ( tolower( *pPath ) == tolower( *pDir ) || ( PATHSEPARATOR( *pPath ) && ( PATHSEPARATOR( *pDir ) || (*pDir == 0) ) ) ) ) { if ( PATHSEPARATOR( *pPath ) ) { pLastCommonPath = pPath + 1; pLastCommonDir = pDir + 1; } if ( *pDir == 0 ) { --pLastCommonDir; break; } ++pDir; ++pPath; } // Nothing in common if ( !pLastCommonPath ) return false; // For each path separator remaining in the dir, need a ../ int nOutLen = 0; bool bLastCharWasSeparator = true; for ( ; *pLastCommonDir; ++pLastCommonDir ) { if ( PATHSEPARATOR( *pLastCommonDir ) ) { pRelativePath[nOutLen++] = '.'; pRelativePath[nOutLen++] = '.'; pRelativePath[nOutLen++] = CORRECT_PATH_SEPARATOR; bLastCharWasSeparator = true; } else { bLastCharWasSeparator = false; } } // Deal with relative paths not specified with a trailing slash if ( !bLastCharWasSeparator ) { pRelativePath[nOutLen++] = '.'; pRelativePath[nOutLen++] = '.'; pRelativePath[nOutLen++] = CORRECT_PATH_SEPARATOR; } // Copy the remaining part of the relative path over, fixing the path separators for ( ; *pLastCommonPath; ++pLastCommonPath ) { if ( PATHSEPARATOR( *pLastCommonPath ) ) { pRelativePath[nOutLen++] = CORRECT_PATH_SEPARATOR; } else { pRelativePath[nOutLen++] = *pLastCommonPath; } // Check for overflow if ( nOutLen == nBufLen - 1 ) break; } pRelativePath[nOutLen] = 0; return true; } //----------------------------------------------------------------------------- // small helper function shared by lots of modules //----------------------------------------------------------------------------- bool V_IsAbsolutePath( const char *pStr ) { bool bIsAbsolute = ( pStr[0] && pStr[1] == ':' ) || pStr[0] == '/' || pStr[0] == '\\'; return bIsAbsolute; } // Copies at most nCharsToCopy bytes from pIn into pOut. // Returns false if it would have overflowed pOut's buffer. static bool CopyToMaxChars( char *pOut, int outSize, const char *pIn, int nCharsToCopy ) { if ( outSize == 0 ) return false; int iOut = 0; while ( *pIn && nCharsToCopy > 0 ) { if ( iOut == (outSize-1) ) { pOut[iOut] = 0; return false; } pOut[iOut] = *pIn; ++iOut; ++pIn; --nCharsToCopy; } pOut[iOut] = 0; return true; } // Returns true if it completed successfully. // If it would overflow pOut, it fills as much as it can and returns false. bool V_StrSubst( const char *pIn, const char *pMatch, const char *pReplaceWith, char *pOut, int outLen, bool bCaseSensitive ) { int replaceFromLen = strlen( pMatch ); int replaceToLen = strlen( pReplaceWith ); const char *pInStart = pIn; char *pOutPos = pOut; pOutPos[0] = 0; while ( 1 ) { int nRemainingOut = outLen - (pOutPos - pOut); const char *pTestPos = ( bCaseSensitive ? strstr( pInStart, pMatch ) : V_stristr( pInStart, pMatch ) ); if ( pTestPos ) { // Found an occurence of pMatch. First, copy whatever leads up to the string. int copyLen = pTestPos - pInStart; if ( !CopyToMaxChars( pOutPos, nRemainingOut, pInStart, copyLen ) ) return false; // Did we hit the end of the output string? if ( copyLen > nRemainingOut-1 ) return false; pOutPos += strlen( pOutPos ); nRemainingOut = outLen - (pOutPos - pOut); // Now add the replacement string. if ( !CopyToMaxChars( pOutPos, nRemainingOut, pReplaceWith, replaceToLen ) ) return false; pInStart += copyLen + replaceFromLen; pOutPos += replaceToLen; } else { // We're at the end of pIn. Copy whatever remains and get out. int copyLen = strlen( pInStart ); V_strncpy( pOutPos, pInStart, nRemainingOut ); return ( copyLen <= nRemainingOut-1 ); } } } char* AllocString( const char *pStr, int nMaxChars ) { int allocLen; if ( nMaxChars == -1 ) allocLen = strlen( pStr ) + 1; else allocLen = min( (int)strlen(pStr), nMaxChars ) + 1; char *pOut = new char[allocLen]; V_strncpy( pOut, pStr, allocLen ); return pOut; } void V_SplitString2( const char *pString, const char **pSeparators, int nSeparators, CUtlVector<char*> &outStrings ) { outStrings.Purge(); const char *pCurPos = pString; while ( 1 ) { int iFirstSeparator = -1; const char *pFirstSeparator = 0; for ( int i=0; i < nSeparators; i++ ) { const char *pTest = V_stristr( pCurPos, pSeparators[i] ); if ( pTest && (!pFirstSeparator || pTest < pFirstSeparator) ) { iFirstSeparator = i; pFirstSeparator = pTest; } } if ( pFirstSeparator ) { // Split on this separator and continue on. int separatorLen = strlen( pSeparators[iFirstSeparator] ); if ( pFirstSeparator > pCurPos ) { outStrings.AddToTail( AllocString( pCurPos, pFirstSeparator-pCurPos ) ); } pCurPos = pFirstSeparator + separatorLen; } else { // Copy the rest of the string if ( strlen( pCurPos ) ) { outStrings.AddToTail( AllocString( pCurPos, -1 ) ); } return; } } } void V_SplitString( const char *pString, const char *pSeparator, CUtlVector<char*> &outStrings ) { V_SplitString2( pString, &pSeparator, 1, outStrings ); } // This function takes a slice out of pStr and stores it in pOut. // It follows the Python slice convention: // Negative numbers wrap around the string (-1 references the last character). // Numbers are clamped to the end of the string. void V_StrSlice( const char *pStr, int firstChar, int lastCharNonInclusive, char *pOut, int outSize ) { if ( outSize == 0 ) return; int length = strlen( pStr ); // Fixup the string indices. if ( firstChar < 0 ) { firstChar = length - (-firstChar % length); } else if ( firstChar >= length ) { pOut[0] = 0; return; } if ( lastCharNonInclusive < 0 ) { lastCharNonInclusive = length - (-lastCharNonInclusive % length); } else if ( lastCharNonInclusive > length ) { lastCharNonInclusive %= length; } if ( lastCharNonInclusive <= firstChar ) { pOut[0] = 0; return; } int copyLen = lastCharNonInclusive - firstChar; if ( copyLen <= (outSize-1) ) { memcpy( pOut, &pStr[firstChar], copyLen ); pOut[copyLen] = 0; } else { memcpy( pOut, &pStr[firstChar], outSize-1 ); pOut[outSize-1] = 0; } } void V_StrLeft( const char *pStr, int nChars, char *pOut, int outSize ) { if ( nChars == 0 ) { if ( outSize != 0 ) pOut[0] = 0; return; } V_StrSlice( pStr, 0, nChars, pOut, outSize ); } void V_StrRight( const char *pStr, int nChars, char *pOut, int outSize ) { int len = strlen( pStr ); if ( nChars >= len ) { V_strncpy( pOut, pStr, outSize ); } else { V_StrSlice( pStr, -nChars, strlen( pStr ), pOut, outSize ); } } //----------------------------------------------------------------------------- // Convert multibyte to wchar + back //----------------------------------------------------------------------------- void V_strtowcs( const char *pString, int nInSize, wchar_t *pWString, int nOutSize ) { #ifdef _WIN32 if ( !MultiByteToWideChar( CP_UTF8, 0, pString, nInSize, pWString, nOutSize ) ) { *pWString = L'\0'; } #elif _LINUX if ( mbstowcs( pWString, pString, nOutSize / sizeof(wchar_t) ) <= 0 ) { *pWString = 0; } #endif } void V_wcstostr( const wchar_t *pWString, int nInSize, char *pString, int nOutSize ) { #ifdef _WIN32 if ( !WideCharToMultiByte( CP_UTF8, 0, pWString, nInSize, pString, nOutSize, NULL, NULL ) ) { *pString = '\0'; } #elif _LINUX if ( wcstombs( pString, pWString, nOutSize ) <= 0 ) { *pString = '\0'; } #endif } //-------------------------------------------------------------------------------- // backslashification //-------------------------------------------------------------------------------- static char s_BackSlashMap[]="\tt\nn\rr\"\"\\\\"; char *V_AddBackSlashesToSpecialChars( char const *pSrc ) { // first, count how much space we are going to need int nSpaceNeeded = 0; for( char const *pScan = pSrc; *pScan; pScan++ ) { nSpaceNeeded++; for(char const *pCharSet=s_BackSlashMap; *pCharSet; pCharSet += 2 ) { if ( *pCharSet == *pScan ) nSpaceNeeded++; // we need to store a bakslash } } char *pRet = new char[ nSpaceNeeded + 1 ]; // +1 for null char *pOut = pRet; for( char const *pScan = pSrc; *pScan; pScan++ ) { bool bIsSpecial = false; for(char const *pCharSet=s_BackSlashMap; *pCharSet; pCharSet += 2 ) { if ( *pCharSet == *pScan ) { *( pOut++ ) = '\\'; *( pOut++ ) = pCharSet[1]; bIsSpecial = true; break; } } if (! bIsSpecial ) { *( pOut++ ) = *pScan; } } *( pOut++ ) = 0; return pRet; }
23.204207
136
0.526213
[ "render" ]
89f1119b7a2a107fdcdbafc209485a67c0015fbc
5,606
hpp
C++
packages/teamplay/include/int/actions/cAbstractAction.hpp
Falcons-Robocup/code
2281a8569e7f11cbd3238b7cc7341c09e2e16249
[ "Apache-2.0" ]
2
2021-01-15T13:27:19.000Z
2021-08-04T08:40:52.000Z
packages/teamplay/include/int/actions/cAbstractAction.hpp
Falcons-Robocup/code
2281a8569e7f11cbd3238b7cc7341c09e2e16249
[ "Apache-2.0" ]
null
null
null
packages/teamplay/include/int/actions/cAbstractAction.hpp
Falcons-Robocup/code
2281a8569e7f11cbd3238b7cc7341c09e2e16249
[ "Apache-2.0" ]
5
2018-05-01T10:39:31.000Z
2022-03-25T03:02:35.000Z
// Copyright 2016-2020 Erik Kouters (Falcons) // SPDX-License-Identifier: Apache-2.0 /* * cAbstractAction.hpp * * Created on: Apr 30, 2016 * Author: Erik Kouters */ #ifndef CABSTRACTACTION_HPP_ #define CABSTRACTACTION_HPP_ #include <stdint.h> #include <vector> #include <string> #include <map> #include <boost/assign/list_of.hpp> #include <boost/assign/ptr_map_inserter.hpp> #include <boost/optional.hpp> #include <boost/ptr_container/ptr_map.hpp> #include <boost/lexical_cast.hpp> #include "int/types/cDecisionTreeTypes.hpp" #include "int/cMotionPlanningInterface.hpp" #include "area2D.hpp" #include "vector2d.hpp" #include "linepoint2D.hpp" #include "tracing.hpp" #include "FalconsRtDB2.hpp" // These vectors contain the valid parameter values for different actions. // e.g. a Move accepts a parameter "target", with as value "ball". // The allowed values for the parameter target is listed here. // poi == environment.poi // area == environment.area static std::string emptyValue = "tbd"; static std::string poiValue = "poi"; static std::string areaValue = "area"; // This list of values is part of the "default point of interest" list: defaultPOI static std::vector<std::string> defaultPOI { "ball", "lastKnownBallLocation", "robot", "closestTeammember", "closestAttacker", "closestAttackerOnOppHalf", "closestAttackerToOppGoal", "closestDefender", "closestDefenderToOppGoal", "closestOpponent", "closestOpponentToOwnGoal", "potentialOppAttacker", poiValue }; // This list of values is part of the "default areas" list: defaultArea static std::vector<std::string> defaultArea { areaValue }; // This list of values is part of the "default shoot types" list: defaultShootTypes static std::vector<std::string> defaultShootTypes { "shootTowardsGoal", "lobTowardsGoal" }; // This list of values is part of the "default pass types" list: defaultPassTypes static std::vector<std::string> defaultPassTypes { "passTowardsNearestTeammember", "passTowardsNearestAttacker", "passTowardsFurthestAttacker", "passTowardsNearestAttackerOnOppHalf", "passTowardsTipInPosition", "passTowardsFurthestDefender" }; // This list of values is part of the "motion profiles" defined by pathplanning. static std::vector<std::string> defaultMotionProfiles { "normal", "setpiece" }; class cAbstractAction { public: cAbstractAction(); virtual ~cAbstractAction(); virtual behTreeReturnEnum execute(const std::map<std::string, std::string> &parameters); boost::optional<Position2D> getPos2DFromStr(const std::map<std::string, std::string> &parameters, std::string &param); boost::optional<Area2D> getArea2DFromStr(const std::map<std::string, std::string> &parameters, std::string &param); // key: parameters (e.g. "target") // value: pair( vector<string> allowedValues, bool optional ) (e.g. pair( {"ball", "robot"}, false )) std::map< std::string, std::pair< std::vector<std::string>, bool > > _actionParameters; template <typename T> T getParameter(const std::map<std::string, std::string> &parameters, std::string const &key) { T result; auto paramValPair = parameters.find(key); if (paramValPair != parameters.end()) { std::string value = paramValPair->second; if (value.compare(emptyValue) != 0) { result = boost::lexical_cast<T>(value); } return result; } throw std::runtime_error(std::string("missing parameter " + key)); } template <typename T> T getParameter(const std::map<std::string, std::string> &parameters, std::string const &key, T const &defaultValue) { T result = defaultValue; auto paramValPair = parameters.find(key); if (paramValPair != parameters.end()) { std::string value = paramValPair->second; if (value.compare(emptyValue) != 0) { result = boost::lexical_cast<T>(value); } } return result; } protected: behTreeReturnEnum moveTo(double x, double y, const std::string& motionProfile = "normal"); behTreeReturnEnum pass(float x, float y); behTreeReturnEnum shoot(const Point2D& target); behTreeReturnEnum lobShot (const Point2D& target); behTreeReturnEnum getBall(const std::string& motionProfile); behTreeReturnEnum turnAwayFromOpponent(double x, double y); behTreeReturnEnum keeperMove(float x); behTreeReturnEnum interceptBall(); void stop(); bool positionReached(double x, double y); bool positionReached(double x, double y, double xy_threshold); bool isCurrentPosValid() const; bool isTargetPosInsideSafetyBoundaries (const Position2D&) const; std::vector<polygon2D> getForbiddenAreas() const; std::vector<polygon2D> getForbiddenActionAreas() const; Point2D getPreferredPartOfGoal() const; void sendIntention(); double XYpositionTolerance = 0.1; T_INTENTION _intention; private: T_ACTION makeAction(); int _actionId = 0; void setForbiddenAreas(); behTreeReturnEnum translateActionResultToTreeEnum(T_ACTION_RESULT actionResult); behTreeReturnEnum executeAction(T_ACTION const &actionData); motionTypeEnum determineMotionType(const std::string& motionProfile); }; #endif /* CABSTRACTACTION_HPP_ */
40.623188
312
0.674099
[ "vector" ]
89fd58dd58b8db027dd2ceb8d584f88e01ff4b97
7,414
cpp
C++
src/tty/convneuralnet.cpp
GustavoSilvera/OF_neuralNet
42b28ea3b7e3855120342be32b584359c449d105
[ "MIT" ]
1
2019-07-18T05:06:42.000Z
2019-07-18T05:06:42.000Z
src/tty/convneuralnet.cpp
GustavoSilvera/OF_neuralNet
42b28ea3b7e3855120342be32b584359c449d105
[ "MIT" ]
null
null
null
src/tty/convneuralnet.cpp
GustavoSilvera/OF_neuralNet
42b28ea3b7e3855120342be32b584359c449d105
[ "MIT" ]
null
null
null
#include "convneuralnet.h" #include "util.h" #include <algorithm> #include <chrono> #include <iostream> #include <string.h> #include <thread> #include <unistd.h> /*getcwd*/ using namespace std; size_t convneuralnet::get_num_networks() const { return num_networks; } net convneuralnet::get_network(size_t i) const { return network[i]; } bool convneuralnet::is_training() const { return training; } double convneuralnet::get_avg_cost() { calc_avg_cost(); return avg_cost; } void convneuralnet::reset() { cout << "Resetting neural net..."; randomize_weights(); cout << "Done!\n"; } void convneuralnet::use_threads() { using_threads = true; cout << "Now using Multithreading\n"; } void convneuralnet::use_single() { using_threads = false; cout << "Now using a Single Core\n"; } void convneuralnet::begin_train() { cout << "Starting CNN training:\n..."; auto start = std::chrono::steady_clock::now(); const size_t num_iter = 1000; for (size_t i = 0; i < num_iter; i++) { train(); if (i % num_iter / 100 == 0) { //every 10th cout << "."; cout.flush(); //dosent affect performance much } } auto end = std::chrono::steady_clock::now(); std::chrono::duration<double> diff = end - start; std::cout << "Took " << diff.count() << "s\n"; cout << "Success!\n"; } void convneuralnet::init() { if (read_data()) cout << "\n Read file successfully\n"; else cout << "\n ERROR reading file\n"; for (size_t i = 0; i < num_networks; i++) { //each network corresponds to one specific output, thus one 'ideal' neuron ideals.emplace_back(1); //new layer of neuron past output layer } size_t i = 0; //initialize networks for (net &n : network) { cout << " ..Initializing network: " << i; n.init(total_data, num_inputs); cout << "... SUCCESS!\n"; i++; } i = 0; for (net &n : network) { //print neurons cout << " Network: " << i << " is built with: \n "; for (size_t j = 0; j < n.get_num_layers(); j++) { cout << " -- " << n.get_layer(j).get_num_neurons(); } cout << " neurons \n"; i++; } } bool convneuralnet::read_data() { #define MAX_LINE 500 char cwd[MAX_LINE]; if (getcwd(cwd, sizeof(cwd)) != NULL) { printf("Current working dir: %s\n", cwd); } else { perror("getcwd() error"); return 1; } const string file_at = strcat(cwd, "/../data/data.txt"); ifstream file(file_at); //using CWD ifstream file2(file_at); //need this to find "file_length" bc the istreambuf iterator DELETES the file after reading?? size_t file_length = size_t(count(istreambuf_iterator<char>(file2), istreambuf_iterator<char>(), '\n')); //gets number of '\n' in the file if (file.is_open()) { cout << " Reading from \"" << file_at << endl; size_t line_num = 0; while (line_num < file_length) { char line[MAX_LINE]; //default line (less than 100 chars) file.getline(line, MAX_LINE); vector<double> ind_data; string sline = line; size_t end_inputs = sline.find(';'); //has to be recomputed every time (strings are diff) size_t end_outputs = sline.size(); size_t i = 0; num_inputs.push_back(0); //initialize num_inputs[line_num] num_outputs.push_back(0); //initialize num_outputs[line_num] while (sline.find(' ', i) < end_inputs) { size_t next_space = sline.find(' ', i); //finds next instance of " " from index i string datum = sline.substr(i, next_space); ind_data.push_back(stod(datum)); //adds all inputs to ind_data num_inputs[line_num]++; i = next_space + 1; //not get inf loop finding same index } i = end_inputs + 2; //refresh i with new start while (i < end_outputs) { //space is IN FRONT of datum now... -_- size_t next_space = sline.find(' ', i); //finds next instance of " " from index i if (next_space == string::npos) next_space = end_outputs; //end of line string datum = sline.substr(i, next_space); ind_data.push_back(stod(datum)); //adds all outputs to ind_data num_outputs[line_num]++; i = next_space + 1; //not get inf loop finding same index } line_num++; total_data.push_back(ind_data); } } else { cout << "Unable to open file: " << file_at << endl; return false; } file.close(); return true; } void convneuralnet::new_data() { cout << "Inputting new data:" << endl; cout << "Testing on line " << network[0].get_data_line() << " out of " << total_data.size() << endl; for (size_t i = 0; i < num_networks; i++) { //data line indicates which line of data is being read //i indicates network and focus variable cout << " Network " << i << ": " << total_data[network[i].get_data_line()][i] << endl; network[i].test_data(&ideals[i]); const layer &output_layer = network[i].get_layer(network[i].get_num_layers() - 1); const double actual_output = output_layer.get_neuron(0).get_weight(); const double expected_output = ideals[i].get_neuron(0).get_weight(); const double p_err = (actual_output - expected_output); if (expected_output != 0) { const double r_err = p_err / expected_output; //relative error cout << " Got: " << actual_output << " instead of " << expected_output << " (" << p_err << " error, " << 100 * r_err << "%)\n"; } else { cout << " Got: " << actual_output << " instead of " << expected_output << " (" << p_err << " error)\n"; //NO %ERR } } } void convneuralnet::randomize_weights() { for (size_t i = 0; i < num_networks; i++) { network[i].randomize_weights(); } } void convneuralnet::calc_avg_cost() { last_cost = avg_cost; avg_cost = 0; for (size_t i = 0; i < num_networks; i++) { network[i].comp_avg_cost(&ideals[i]); avg_cost += network[i].get_avg_cost(); } avg_cost /= num_networks; } void convneuralnet::train() { if (using_threads) { vector<thread> threads; //amdalhs law for (size_t i = 0; i < num_networks; i++) { //creates new thread for computing individual avg_improve threads.push_back( thread([&, i] {vector<double> v; network[i].avg_improve(&ideals[i], &ideals[i], v); })); } for (auto &thread : threads) { thread.join(); } } //thread top (network[0].avg_improve, &ideals[0], &ideals[0], v); else { for (size_t i = 0; i < num_networks; i++) { vector<double> v; network[i].avg_improve(&ideals[i], &ideals[i], v); } } calc_avg_cost(); } void convneuralnet::output() { #define MAX_LINE 500 char cwd[MAX_LINE]; if (getcwd(cwd, sizeof(cwd)) != NULL) { printf("Current working dir: %s\n", cwd); } else { perror("getcwd() error"); return; } const string file_at = strcat(cwd, "/output.txt"); cout << "Saving current Network to \"" << file_at << "\"\n "; ofstream output(file_at); for (size_t i = 0; i < num_networks; i++) { cout << "...N" << i; output << "//Network: " << i + 1 << "\n"; output << network[i].output(); cout << "..."; } output.flush(); cout << "Success!\n"; }
28.190114
200
0.587402
[ "vector" ]
d601bbf5cefab8f64f2eb829767331dd81c08cb2
171
hpp
C++
libraries/chain/include/eosio/chain/wast_to_wasm.hpp
abitmore/mandel
dfa3c92a713e7a093fc671fefa453a3033e27b0a
[ "MIT" ]
60
2022-01-03T18:41:12.000Z
2022-03-25T07:08:19.000Z
libraries/chain/include/eosio/chain/wast_to_wasm.hpp
abitmore/mandel
dfa3c92a713e7a093fc671fefa453a3033e27b0a
[ "MIT" ]
37
2022-01-13T22:23:58.000Z
2022-03-31T13:32:38.000Z
libraries/chain/include/eosio/chain/wast_to_wasm.hpp
abitmore/mandel
dfa3c92a713e7a093fc671fefa453a3033e27b0a
[ "MIT" ]
11
2022-01-14T21:14:11.000Z
2022-03-25T07:08:29.000Z
#pragma once #include <vector> #include <string> namespace eosio { namespace chain { std::vector<uint8_t> wast_to_wasm( const std::string& wast ); } } /// eosio::chain
17.1
61
0.701754
[ "vector" ]
d606491648ebccd94fa3462831a5c268d3afc056
5,954
cc
C++
chromium/components/mus/mus_app.cc
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
chromium/components/mus/mus_app.cc
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
chromium/components/mus/mus_app.cc
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/mus/mus_app.h" #include "base/stl_util.h" #include "build/build_config.h" #include "components/mus/common/args.h" #include "components/mus/gles2/gpu_impl.h" #include "components/mus/surfaces/surfaces_scheduler.h" #include "components/mus/ws/client_connection.h" #include "components/mus/ws/connection_manager.h" #include "components/mus/ws/forwarding_window_manager.h" #include "components/mus/ws/window_tree_host_connection.h" #include "components/mus/ws/window_tree_host_impl.h" #include "components/mus/ws/window_tree_impl.h" #include "mojo/public/c/system/main.h" #include "mojo/services/tracing/public/cpp/tracing_impl.h" #include "mojo/shell/public/cpp/application_connection.h" #include "mojo/shell/public/cpp/application_impl.h" #include "mojo/shell/public/cpp/application_runner.h" #include "ui/events/event_switches.h" #include "ui/events/platform/platform_event_source.h" #include "ui/gl/gl_surface.h" #if defined(USE_X11) #include <X11/Xlib.h> #include "base/command_line.h" #include "ui/platform_window/x11/x11_window.h" #elif defined(USE_OZONE) #include "ui/ozone/public/ozone_platform.h" #endif using mojo::ApplicationConnection; using mojo::ApplicationImpl; using mojo::InterfaceRequest; using mus::mojom::WindowTreeHostFactory; using mus::mojom::Gpu; namespace mus { MandolineUIServicesApp::MandolineUIServicesApp() : app_impl_(nullptr) {} MandolineUIServicesApp::~MandolineUIServicesApp() { if (gpu_state_) gpu_state_->StopThreads(); // Destroy |connection_manager_| first, since it depends on |event_source_|. connection_manager_.reset(); } void MandolineUIServicesApp::Initialize(ApplicationImpl* app) { app_impl_ = app; surfaces_state_ = new SurfacesState; #if defined(USE_X11) XInitThreads(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(kUseX11TestConfig)) { ui::test::SetUseOverrideRedirectWindowByDefault(true); } #endif #if defined(USE_OZONE) // The ozone platform can provide its own event source. So initialize the // platform before creating the default event source. // TODO(rjkroege): Add tracing here. ui::OzonePlatform::InitializeForUI(); ui::OzonePlatform::InitializeForGPU(); #endif bool hardware_rendering_available = true; #if !defined(OS_ANDROID) hardware_rendering_available = gfx::GLSurface::InitializeOneOff(); event_source_ = ui::PlatformEventSource::CreateDefault(); #endif // TODO(rjkroege): It is possible that we might want to generalize the // GpuState object. if (!gpu_state_.get()) gpu_state_ = new GpuState(hardware_rendering_available); connection_manager_.reset(new ws::ConnectionManager(this, surfaces_state_)); tracing_.Initialize(app); } bool MandolineUIServicesApp::ConfigureIncomingConnection( ApplicationConnection* connection) { connection->AddService<Gpu>(this); connection->AddService<mojom::WindowManager>(this); connection->AddService<WindowTreeHostFactory>(this); return true; } void MandolineUIServicesApp::OnFirstRootConnectionCreated() { WindowManagerRequests requests; requests.swap(pending_window_manager_requests_); for (auto& request : requests) Create(nullptr, std::move(*request)); } void MandolineUIServicesApp::OnNoMoreRootConnections() { app_impl_->Quit(); } ws::ClientConnection* MandolineUIServicesApp::CreateClientConnectionForEmbedAtWindow( ws::ConnectionManager* connection_manager, mojo::InterfaceRequest<mojom::WindowTree> tree_request, ws::ServerWindow* root, uint32_t policy_bitmask, mojom::WindowTreeClientPtr client) { scoped_ptr<ws::WindowTreeImpl> service( new ws::WindowTreeImpl(connection_manager, root, policy_bitmask)); return new ws::DefaultClientConnection(std::move(service), connection_manager, std::move(tree_request), std::move(client)); } void MandolineUIServicesApp::Create( mojo::ApplicationConnection* connection, mojo::InterfaceRequest<mojom::WindowManager> request) { if (!connection_manager_->has_tree_host_connections()) { pending_window_manager_requests_.push_back(make_scoped_ptr( new mojo::InterfaceRequest<mojom::WindowManager>(std::move(request)))); return; } if (!window_manager_impl_) { window_manager_impl_.reset( new ws::ForwardingWindowManager(connection_manager_.get())); } window_manager_bindings_.AddBinding(window_manager_impl_.get(), std::move(request)); } void MandolineUIServicesApp::Create( ApplicationConnection* connection, InterfaceRequest<WindowTreeHostFactory> request) { factory_bindings_.AddBinding(this, std::move(request)); } void MandolineUIServicesApp::Create(mojo::ApplicationConnection* connection, mojo::InterfaceRequest<Gpu> request) { DCHECK(gpu_state_); new GpuImpl(std::move(request), gpu_state_); } void MandolineUIServicesApp::CreateWindowTreeHost( mojo::InterfaceRequest<mojom::WindowTreeHost> host, mojom::WindowTreeHostClientPtr host_client, mojom::WindowTreeClientPtr tree_client, mojom::WindowManagerPtr window_manager) { DCHECK(connection_manager_); // TODO(fsamuel): We need to make sure that only the window manager can create // new roots. ws::WindowTreeHostImpl* host_impl = new ws::WindowTreeHostImpl( std::move(host_client), connection_manager_.get(), app_impl_, gpu_state_, surfaces_state_, std::move(window_manager)); // WindowTreeHostConnection manages its own lifetime. host_impl->Init(new ws::WindowTreeHostConnectionImpl( std::move(host), make_scoped_ptr(host_impl), std::move(tree_client), connection_manager_.get())); } } // namespace mus
35.230769
80
0.753275
[ "object" ]
d606810de5910780c38202d8c3fd2e283cbe94b9
941
hpp
C++
include/choice.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
include/choice.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
include/choice.hpp
richard-vock/graphene
1a721894a9972c8865a1ad0861d500cef8436932
[ "Unlicense" ]
null
null
null
#pragma once #include "common.hpp" #include "text.hpp" #include "tracked.hpp" namespace graphene { template <typename T> struct active { active(T v) : value(v) {} T value; }; template <typename T> struct option { option(const std::string& l, T v) : label(l), value(v) {} std::string label; T value; }; namespace property { template <typename T> class choice { public: template <typename... Ts> choice(std::string label, shared<T> value, option<T> possible, Ts&&... more); template <typename F, typename... Ts> choice(std::string label, F func, std::variant<option<T>, active<option<T>>> possible, Ts&&... more); void render(); protected: std::string label_; tracked<T> value_; text text_; std::vector<std::string> labels_; std::vector<T> possible_; uint32_t active_; }; } // namespace property } // namespace graphene #include "choice.ipp"
17.109091
78
0.628055
[ "render", "vector" ]
d60c622e0972cf3327d542de07fede103e6839ba
2,752
cpp
C++
C++OperatorExamples/GoogleTests/PositiveTests/PositiveTests.cpp
RomanoViolet/C-
95fdb40e57875d68ddb8ea69c2caf9c86df7ab48
[ "MIT" ]
null
null
null
C++OperatorExamples/GoogleTests/PositiveTests/PositiveTests.cpp
RomanoViolet/C-
95fdb40e57875d68ddb8ea69c2caf9c86df7ab48
[ "MIT" ]
null
null
null
C++OperatorExamples/GoogleTests/PositiveTests/PositiveTests.cpp
RomanoViolet/C-
95fdb40e57875d68ddb8ea69c2caf9c86df7ab48
[ "MIT" ]
null
null
null
#include "CastFromEnum.hpp" #include "TypeAsOperator.hpp" #include "gmock/gmock.h" #include "gtest/gtest-death-test.h" #include "gtest/gtest.h" #include <ctime> #include <string> #include <type_traits> TEST( Operators, FloatTypeAcceptance ) { TypeAsOperator< float > typeAsOperator{ 4.5F }; // assign the value of the object, a float. Conversion is handled inside the class itself float float_response = typeAsOperator; EXPECT_FLOAT_EQ( 4.5F, float_response ); // assign the value of the object, a float to an int. Type conversion handled by the class. int int_response = typeAsOperator; EXPECT_EQ( int_response, 4 ); // assign the value of the object, a float to an double. Type conversion handled by the class. double double_response = typeAsOperator; EXPECT_DOUBLE_EQ( 4.5, double_response ); // assign the value of the object, a float to an bool. Type conversion handled by the class. bool bool_response = typeAsOperator; EXPECT_TRUE( bool_response ); } TEST( Operators, DoubleTypeAcceptance ) { TypeAsOperator< double > myOperators{ 4.5 }; double double_response = myOperators; EXPECT_DOUBLE_EQ( 4.5, double_response ); // assign the value of the object, a double to an float. Type conversion handled by the class. float float_response = myOperators; EXPECT_FLOAT_EQ( 4.5F, float_response ); // assign the value of the object, a double to an int. Type conversion handled by the class. int int_response = myOperators; EXPECT_EQ( 4, int_response ); // assign the value of the object, a double to a bool. Type conversion handled by the class. bool bool_response = myOperators; EXPECT_TRUE( bool_response ); } TEST( Operators, CastFromEnumTest ) { CastFromEnum e; // assign the value of the object, an enumeration. Conversion is handled inside the class itself int int_response = e; EXPECT_EQ( int_response, static_cast< int >( CastFromEnum::MyEnumeration::OK ) ); CastFromEnum e2{ CastFromEnum::MyEnumeration::APOCALYPSE }; // assign the value of the object, an enumeration. Conversion is handled inside the class itself float float_response = e2; EXPECT_FLOAT_EQ( float_response, static_cast< float >( CastFromEnum::MyEnumeration::APOCALYPSE ) ); CastFromEnum e3{ CastFromEnum::MyEnumeration::ERROR }; // assign the value of the object, an enumeration. Conversion is handled inside the class itself double double_response = e3; EXPECT_DOUBLE_EQ( double_response, static_cast< double >( CastFromEnum::MyEnumeration::ERROR ) ); CastFromEnum e4{ CastFromEnum::MyEnumeration::ERROR }; // assign the value of the object, an enumeration. Conversion is handled inside the class itself bool bool_response = e3; EXPECT_FALSE( bool_response ); }
38.222222
99
0.747093
[ "object" ]
d6114478e3b0b780d9570242e55eb3ada0f256c8
7,015
cpp
C++
src/main.cpp
Lalaland/SuperGunBros
87da6138ac7d1c8eee5e9b5cac8bcec4a38e2998
[ "MIT" ]
2
2017-02-06T19:55:01.000Z
2017-08-16T18:05:47.000Z
src/main.cpp
Lalaland/SuperGunBros
87da6138ac7d1c8eee5e9b5cac8bcec4a38e2998
[ "MIT" ]
null
null
null
src/main.cpp
Lalaland/SuperGunBros
87da6138ac7d1c8eee5e9b5cac8bcec4a38e2998
[ "MIT" ]
null
null
null
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <stdlib.h> #include <stdio.h> #include <iostream> #include <vector> #include "rendering/renderlist.h" #include "rendering/render.h" #include "screens/menuscreen.h" #include <cmath> #include "soundthread.h" const int screen_width = 1280; const int screen_height = 720; const bool debug_keyboard_player = false; const bool debug_other_player = false;; bool other_player_start_button = true; const bool music_on = true; struct MainData { std::unique_ptr<Screen> current_screen; }; void error_callback(int /*error*/, const char* description) { fprintf(stderr, "Error: %s\n", description); } void opengl_error(GLenum /*source*/, GLenum type, GLuint id, GLenum severity, GLsizei /*length*/, const GLchar* message, const void* /*userParam*/) { if (severity == GL_DEBUG_SEVERITY_NOTIFICATION) { return; } fprintf(stderr, "Opengl Error: %s, %d %d %d\n", message, type, id, severity); } void key_callback(GLFWwindow* window, int key, int /*scancode*/, int action, int /*mods*/) { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { glfwSetWindowShouldClose(window, GLFW_TRUE); } } inputs keyboard_debug_input(GLFWwindow* window) { inputs input; input.ls.x = 0; input.ls.x -= glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS; input.ls.x += glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS; input.ls.y = 0; input.ls.y -= glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS; input.ls.y += glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS; //Directional Aiming double cursorX; double cursorY; glfwGetCursorPos(window, &cursorX, &cursorY); double needed_gun_angle = atan2(cursorY - 720.0/2, cursorX - 1280.0/2); input.rs.x = cos(needed_gun_angle); input.rs.y = sin(needed_gun_angle); input.buttons[ButtonName::A] = 0; input.buttons[ButtonName::B] = 0; input.buttons[ButtonName::X] = (button_val) (glfwGetKey(window, GLFW_KEY_X) == GLFW_PRESS); input.buttons[ButtonName::Y] = (button_val) (glfwGetKey(window, GLFW_KEY_RIGHT_BRACKET) == GLFW_PRESS); input.buttons[ButtonName::LB] = (button_val) (glfwGetKey(window, GLFW_KEY_Q) == GLFW_PRESS); input.buttons[ButtonName::RB] = (button_val) (glfwGetKey(window, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS); input.buttons[ButtonName::LT] = (button_val) (glfwGetKey(window, GLFW_KEY_SPACE) == GLFW_PRESS); input.buttons[ButtonName::RT] = (button_val)(glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS); input.buttons[ButtonName::BACK] = (button_val) (glfwGetKey(window, GLFW_KEY_BACKSPACE) == GLFW_PRESS);; input.buttons[ButtonName::START] = (button_val) (glfwGetKey(window, GLFW_KEY_ENTER) == GLFW_PRESS); input.buttons[ButtonName::L3] = glfwGetKey(window, GLFW_KEY_TAB) == GLFW_PRESS; input.buttons[ButtonName::R3] = (button_val) (glfwGetKey(window, GLFW_KEY_LEFT_BRACKET) == GLFW_PRESS);; input.buttons[ButtonName::UD] = glfwGetKey(window, GLFW_KEY_UP) == GLFW_PRESS; input.buttons[ButtonName::DD] = glfwGetKey(window, GLFW_KEY_DOWN) == GLFW_PRESS; input.buttons[ButtonName::LD] = glfwGetKey(window, GLFW_KEY_LEFT) == GLFW_PRESS; input.buttons[ButtonName::RD] = glfwGetKey(window, GLFW_KEY_RIGHT) == GLFW_PRESS; return input; } const double TIME_PER_TICK = 1.0/60; std::map<int, inputs> get_joystick_inputs(const std::vector<int>& connected_joysticks, GLFWwindow* window) { std::map<int, inputs> joystick_inputs; for (int i : connected_joysticks) { joystick_inputs[i] = getInputs(i); } if (debug_keyboard_player) { joystick_inputs[-1] = keyboard_debug_input(window); } if (debug_other_player) { inputs blah = {}; blah.buttons[ButtonName::START] = other_player_start_button; other_player_start_button = !other_player_start_button; joystick_inputs[-2] = blah; } return joystick_inputs; } int main(void) { SoundThread sounds; sounds.start(); if (music_on) { sounds.play_sound("../assets/sound/menu.wav", true, 2); } glfwSetErrorCallback(error_callback); if (!glfwInit()) { exit(EXIT_FAILURE); } //Window settings glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); glfwWindowHint(GLFW_SAMPLES, 4); //Mac Compatibility glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //Debug mode if compatible if (GLAD_GL_KHR_debug) { glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE); } //Create the window GLFWwindow* window = glfwCreateWindow(screen_width, screen_height, "SuperGunBros", nullptr, nullptr); //Verify Window Creation if (!window) { glfwTerminate(); exit(EXIT_FAILURE); } glfwMakeContextCurrent(window); glfwSwapInterval(1); gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); if (GLAD_GL_KHR_debug) { glDebugMessageCallback(opengl_error, nullptr); } int pixel_width, pixel_height; glfwGetFramebufferSize(window, &pixel_width, &pixel_height); auto setups = create_and_use_program(pixel_width, pixel_height, screen_width, screen_height); MainData data; data.current_screen = std::make_unique<MenuScreen>(); glfwSetWindowUserPointer(window, &data); glfwSetKeyCallback(window, key_callback); double start_time = glfwGetTime(); std::vector<int> connected_joysticks; for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; i++) { if (glfwJoystickPresent(i)) { connected_joysticks.push_back(i); } } // The main loop of the program. Just keeps rendering and updating. std::map<int, inputs> last_inputs = get_joystick_inputs(connected_joysticks, window); while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); RenderList list("../assets/img/pixelPacker.json"); data.current_screen->render(list); setups[0](); list.draw(); setups[1](); list.draw_flame(); setups[0](); list.draw_top(); glfwSwapBuffers(window); glfwPollEvents(); double current_time = glfwGetTime(); while (current_time - start_time > TIME_PER_TICK) { std::map<int, inputs> current_inputs = get_joystick_inputs(connected_joysticks, window); start_time += TIME_PER_TICK; std::unique_ptr<Screen> next_screen = data.current_screen->update(current_inputs, last_inputs, sounds); if (next_screen) { data.current_screen = std::move(next_screen); } last_inputs = current_inputs; } } glfwDestroyWindow(window); glfwTerminate(); exit(EXIT_SUCCESS); }
30.107296
115
0.684533
[ "render", "vector" ]
d614d7f49ba214d3e8fd114a9662d7beccd13e1e
8,776
cc
C++
Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
// Package: Phase2ITValidateRecHit // Class: Phase2ITValidateRecHit // /**\class Phase2ITValidateRecHit Phase2ITValidateRecHit.cc Description: Plugin for Phase2 RecHit validation */ // // Author: Shubhi Parolia, Suvankar Roy Chowdhury // Date: June 2020 // // system include files #include <memory> #include <map> #include <vector> #include <algorithm> #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESWatcher.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/DetSetVector.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" //--- for SimHit association #include "SimDataFormats/Track/interface/SimTrackContainer.h" #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" //DQM #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" // base class #include "Validation/SiTrackerPhase2V/interface/Phase2ITValidateRecHitBase.h" #include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" class Phase2ITValidateRecHit : public Phase2ITValidateRecHitBase { public: explicit Phase2ITValidateRecHit(const edm::ParameterSet&); ~Phase2ITValidateRecHit() override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void fillITHistos(const edm::Event& iEvent, const TrackerHitAssociator& associateRecHit, const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, const std::map<unsigned int, SimTrack>& selectedSimTrackMap); edm::ParameterSet config_; TrackerHitAssociator::Config trackerHitAssociatorConfig_; const double simtrackminpt_; const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> simHitTokens_; }; Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) : Phase2ITValidateRecHitBase(iConfig), config_(iConfig), trackerHitAssociatorConfig_(iConfig, consumesCollector()), simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")), tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))) { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit "; for (const auto& itName : config_.getParameter<std::vector<std::string>>("ROUList")) { simHitTokens_.push_back(consumes<std::vector<PSimHit>>(edm::InputTag("g4SimHits", itName))); } } // Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit "; } void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { std::vector<edm::Handle<edm::PSimHitContainer>> simHits; for (const auto& itoken : simHitTokens_) { const auto& simHitHandle = iEvent.getHandle(itoken); if (!simHitHandle.isValid()) continue; simHits.emplace_back(simHitHandle); } // Get the SimTracks and push them in a map of id, SimTrack const auto& simTracks = iEvent.getHandle(simTracksToken_); std::map<unsigned int, SimTrack> selectedSimTrackMap; for (const auto& simTrackIt : *simTracks) { if (simTrackIt.momentum().pt() > simtrackminpt_) { selectedSimTrackMap.emplace(simTrackIt.trackId(), simTrackIt); } } TrackerHitAssociator associateRecHit(iEvent, trackerHitAssociatorConfig_); fillITHistos(iEvent, associateRecHit, simHits, selectedSimTrackMap); } void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, const TrackerHitAssociator& associateRecHit, const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, const std::map<unsigned int, SimTrack>& selectedSimTrackMap) { // Get the RecHits const auto& rechits = iEvent.getHandle(tokenRecHitsIT_); if (!rechits.isValid()) return; std::map<std::string, unsigned int> nrechitLayerMap_primary; // Loop over modules for (const auto& DSViter : *rechits) { // Get the detector unit's id unsigned int rawid(DSViter.detId()); DetId detId(rawid); // determine the detector we are in std::string key = phase2tkutil::getITHistoId(detId.rawId(), tTopo_); if (nrechitLayerMap_primary.find(key) == nrechitLayerMap_primary.end()) { nrechitLayerMap_primary.emplace(key, DSViter.size()); } else { nrechitLayerMap_primary[key] += DSViter.size(); } //loop over rechits for a single detId for (const auto& rechit : DSViter) { //GetSimHits const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(rechit); const PSimHit* simhitClosest = nullptr; float minx = 10000; LocalPoint lp = rechit.localPosition(); for (const auto& simHitCol : simHits) { for (const auto& simhitIt : *simHitCol) { if (detId.rawId() != simhitIt.detUnitId()) continue; for (const auto& mId : matchedId) { if (simhitIt.trackId() == mId.first) { if (!simhitClosest || abs(simhitIt.localPosition().x() - lp.x()) < minx) { minx = std::abs(simhitIt.localPosition().x() - lp.x()); simhitClosest = &simhitIt; } } } } //end loop over PSimhitcontainers } //end loop over simHits if (!simhitClosest) continue; // call the base class method to fill the plots fillRechitHistos(simhitClosest, &rechit, selectedSimTrackMap, nrechitLayerMap_primary); } //end loop over rechits of a detId } //End loop over DetSetVector //fill nRecHit counter per layer for (const auto& lme : nrechitLayerMap_primary) { layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]); } } void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { // rechitValidIT edm::ParameterSetDescription desc; // call the base fillPsetDescription for the plots bookings Phase2ITValidateRecHitBase::fillPSetDescription(desc); //to be used in TrackerHitAssociator desc.add<bool>("associatePixel", true); desc.add<bool>("associateStrip", false); desc.add<bool>("usePhase2Tracker", true); desc.add<bool>("associateRecoTracks", false); desc.add<bool>("associateHitbySimTrack", true); desc.add<edm::InputTag>("pixelSimLinkSrc", edm::InputTag("simSiPixelDigis", "Pixel")); desc.add<std::vector<std::string>>("ROUList", { "TrackerHitsPixelBarrelLowTof", "TrackerHitsPixelBarrelHighTof", "TrackerHitsPixelEndcapLowTof", "TrackerHitsPixelEndcapHighTof", }); // desc.add<edm::InputTag>("simTracksSrc", edm::InputTag("g4SimHits")); desc.add<edm::InputTag>("SimVertexSource", edm::InputTag("g4SimHits")); desc.add<double>("SimTrackMinPt", 2.0); desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHitV"); desc.add<bool>("Verbosity", false); descriptions.add("Phase2ITValidateRecHit", desc); } //define this as a plug-in DEFINE_FWK_MODULE(Phase2ITValidateRecHit);
44.323232
110
0.711258
[ "geometry", "vector" ]
d61e6007fe8a2a719a7f48459805e9621fc67ce6
947
cc
C++
ui/gfx/extension_set.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
ui/gfx/extension_set.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
113
2015-05-04T09:58:14.000Z
2022-01-31T19:35:03.000Z
ui/gfx/extension_set.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/gfx/extension_set.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" namespace gfx { ExtensionSet MakeExtensionSet(const base::StringPiece& extensions_string) { return ExtensionSet(SplitStringPiece( extensions_string, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)); } bool HasExtension(const ExtensionSet& extension_set, const base::StringPiece& extension) { return extension_set.find(extension) != extension_set.end(); } std::string MakeExtensionString(const ExtensionSet& extension_set) { std::vector<base::StringPiece> extension_list(extension_set.begin(), extension_set.end()); return base::JoinString(extension_list, " "); } } // namespace gfx
33.821429
76
0.713833
[ "vector" ]
d623f5569e866d7d92edbc7d0df49b7b9da9de34
876
cpp
C++
Source/UtilsNet/UiCtrlsNet/TreeNodeAscendingSorter.cpp
keshbach/Arcade
662048e92d5a65b6100fd424a00545069a175651
[ "Apache-2.0" ]
1
2021-12-11T14:21:55.000Z
2021-12-11T14:21:55.000Z
Source/UtilsNet/UiCtrlsNet/TreeNodeAscendingSorter.cpp
keshbach/Arcade
662048e92d5a65b6100fd424a00545069a175651
[ "Apache-2.0" ]
null
null
null
Source/UtilsNet/UiCtrlsNet/TreeNodeAscendingSorter.cpp
keshbach/Arcade
662048e92d5a65b6100fd424a00545069a175651
[ "Apache-2.0" ]
1
2021-06-23T14:01:55.000Z
2021-06-23T14:01:55.000Z
///////////////////////////////////////////////////////////////////////////// // Copyright (C) 2014-2014 Kevin Eshbach ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "TreeNodeAscendingSorter.h" System::Int32 Common::Forms::TreeNodeAscendingSorter::Compare( System::Object^ Object1, System::Object^ Object2) { System::Windows::Forms::TreeNode^ Node1 = dynamic_cast<System::Windows::Forms::TreeNode^>(Object1); System::Windows::Forms::TreeNode^ Node2 = dynamic_cast<System::Windows::Forms::TreeNode^>(Object2); return System::StringComparer::CurrentCulture->Compare(Node1->Text, Node2->Text); } ///////////////////////////////////////////////////////////////////////////// // Copyright (C) 2014-2014 Kevin Eshbach /////////////////////////////////////////////////////////////////////////////
41.714286
103
0.47032
[ "object" ]
d62423257d65754560df31a25c86c3bc0613c0d8
8,138
cpp
C++
grasp_generation/graspitmodified_lm/Coin-3.1.3/src/scxml/ScXMLState.cpp
KraftOreo/EBM_Hand
9ab1722c196b7eb99b4c3ecc85cef6e8b1887053
[ "MIT" ]
null
null
null
grasp_generation/graspitmodified_lm/Coin-3.1.3/src/scxml/ScXMLState.cpp
KraftOreo/EBM_Hand
9ab1722c196b7eb99b4c3ecc85cef6e8b1887053
[ "MIT" ]
null
null
null
grasp_generation/graspitmodified_lm/Coin-3.1.3/src/scxml/ScXMLState.cpp
KraftOreo/EBM_Hand
9ab1722c196b7eb99b4c3ecc85cef6e8b1887053
[ "MIT" ]
null
null
null
/**************************************************************************\ * * This file is part of the Coin 3D visualization library. * Copyright (C) by Kongsberg Oil & Gas Technologies. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.GPL at the root directory of this source * distribution for additional information about the GNU GPL. * * For using Coin with software that can not be combined with the GNU * GPL, and for taking advantage of the additional benefits of our * support services, please contact Kongsberg Oil & Gas Technologies * about acquiring a Coin Professional Edition License. * * See http://www.coin3d.org/ for more information. * * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. * http://www.sim.no/ sales@sim.no coin-support@coin3d.org * \**************************************************************************/ #include "scxml/ScXMLState.h" #include <assert.h> #include <string.h> #include <algorithm> #include <vector> #include <boost/scoped_ptr.hpp> #include <Inventor/C/tidbits.h> #include <Inventor/scxml/ScXML.h> #include <Inventor/scxml/ScXMLInvoke.h> #include "scxml/ScXMLOnExit.h" #include "scxml/ScXMLOnEntry.h" #include "scxml/ScXMLTransition.h" #include "scxml/ScXMLInitial.h" #include "scxml/ScXMLFinal.h" #include "scxml/ScXMLHistory.h" #include "scxml/ScXMLAnchor.h" #include "scxml/ScXMLCommonP.h" // ************************************************************************* /*! \class ScXMLState ScXMLState.h Inventor/scxml/ScXMLState.h \brief Implementation of the &lt;state&gt; and &lt;parallel&gt; SCXML elements. \since Coin 3.0 \ingroup scxml */ class ScXMLState::PImpl { public: boost::scoped_ptr<ScXMLOnEntry> onentryptr; boost::scoped_ptr<ScXMLOnExit> onexitptr; std::vector<ScXMLTransition *> transitionlist; boost::scoped_ptr<ScXMLInitial> initialptr; std::vector<ScXMLState *> statelist; std::vector<ScXMLState *> parallellist; std::vector<ScXMLFinal *> finallist; std::vector<ScXMLHistory *> historylist; std::vector<ScXMLAnchor *> anchorlist; // datamodel boost::scoped_ptr<ScXMLInvoke> invokeptr; PImpl(void) : onentryptr(NULL), onexitptr(NULL), initialptr(NULL), invokeptr(NULL) { } ~PImpl(void) { { std::vector<ScXMLTransition *>::iterator it = this->transitionlist.begin(); while (it != this->transitionlist.end()) { delete *it; ++it; } this->transitionlist.clear(); } { std::vector<ScXMLState *>::iterator it = this->statelist.begin(); while (it != this->statelist.end()) { delete *it; ++it; } this->statelist.clear(); } { std::vector<ScXMLState *>::iterator it = this->parallellist.begin(); while (it != this->parallellist.end()) { delete *it; ++it; } this->parallellist.clear(); } { std::vector<ScXMLFinal *>::iterator it = this->finallist.begin(); while (it != this->finallist.end()) { delete *it; ++it; } this->finallist.clear(); } { std::vector<ScXMLHistory *>::iterator it = this->historylist.begin(); while (it != this->historylist.end()) { delete *it; ++it; } this->historylist.clear(); } { std::vector<ScXMLAnchor *>::iterator it = this->anchorlist.begin(); while (it != this->anchorlist.end()) { delete *it; ++it; } this->anchorlist.clear(); } } }; #define PRIVATE(obj) ((obj)->pimpl) SCXML_OBJECT_SOURCE(ScXMLState); /*! */ void ScXMLState::initClass(void) { SCXML_OBJECT_INIT_CLASS(ScXMLState, ScXMLObject, SCXML_DEFAULT_NS, "state"); } // ************************************************************************* ScXMLState::ScXMLState(void) : isparallel(FALSE), istask(FALSE), id(NULL), src(NULL), task(NULL) { } ScXMLState::~ScXMLState(void) { this->setIdAttribute(NULL); this->setSrcAttribute(NULL); this->setTaskAttribute(NULL); } // ************************************************************************* void ScXMLState::setIsParallel(SbBool isparallelarg) { this->isparallel = isparallelarg; } SbBool ScXMLState::isParallel(void) const { return this->isparallel; } // ************************************************************************* void ScXMLState::setIdAttribute(const char * idstr) { if (this->id && this->id != this->getXMLAttribute("id")) { delete [] this->id; } this->id = NULL; if (idstr) { this->id = new char [ strlen(idstr) + 1 ]; strcpy(this->id, idstr); } } // const char * ScXMLState::getIdAttribute(void) const void ScXMLState::setSrcAttribute(const char * srcstr) { if (this->src && this->src != this->getXMLAttribute("src")) { delete [] this->src; } this->src = NULL; if (srcstr) { this->src = new char [ strlen(srcstr) + 1 ]; strcpy(this->src, srcstr); } } // const char * ScXMLState::getSrcAttribute(void) const void ScXMLState::setTaskAttribute(const char * taskstr) { if (this->task && this->task != this->getXMLAttribute("task")) { delete [] this->task; } this->task = NULL; this->istask = FALSE; if (taskstr) { this->task = new char [ strlen(taskstr) + 1 ]; strcpy(this->task, taskstr); // acceptable truth-true values for boolean argument: if (strlen(this->task) == 4 && coin_strncasecmp(this->task, "true", 4) == 0) { this->istask = TRUE; } else if (strcmp(this->task, "1") == 0) { this->istask = TRUE; } } } // const char * ScXMLState::getTaskAttribute(void) const SbBool ScXMLState::handleXMLAttributes(void) { if (!inherited::handleXMLAttributes()) return FALSE; this->id = const_cast<char *>(this->getXMLAttribute("id")); this->src = const_cast<char *>(this->getXMLAttribute("src")); this->task = NULL; this->setTaskAttribute(this->getXMLAttribute("task")); if (!this->id) { return FALSE; } return TRUE; } // ************************************************************************* SCXML_SINGLE_OBJECT_API_IMPL(ScXMLState, ScXMLOnEntry, PRIVATE(this)->onentryptr, OnEntry); SCXML_SINGLE_OBJECT_API_IMPL(ScXMLState, ScXMLOnExit, PRIVATE(this)->onexitptr, OnExit); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLTransition, PRIVATE(this)->transitionlist, Transition, Transitions); SCXML_SINGLE_OBJECT_API_IMPL(ScXMLState, ScXMLInitial, PRIVATE(this)->initialptr, Initial); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLState, PRIVATE(this)->statelist, State, States); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLState, PRIVATE(this)->parallellist, Parallel, Parallels); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLFinal, PRIVATE(this)->finallist, Final, Finals); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLHistory, PRIVATE(this)->historylist, History, Histories); SCXML_LIST_OBJECT_API_IMPL(ScXMLState, ScXMLAnchor, PRIVATE(this)->anchorlist, Anchor, Anchors); // datamodel SCXML_SINGLE_OBJECT_API_IMPL(ScXMLState, ScXMLInvoke, PRIVATE(this)->invokeptr, Invoke); void ScXMLState::invoke(ScXMLStateMachine * statemachine) { if (PRIVATE(this)->invokeptr.get()) { PRIVATE(this)->invokeptr->invoke(statemachine); } } // ************************************************************************* /*! Returns TRUE if this is an "atomic state", which means that it has no sub-states but contains executable content. */ SbBool ScXMLState::isAtomicState(void) const { return ((PRIVATE(this)->statelist.size() == 0) && (PRIVATE(this)->parallellist.size() == 0) && (PRIVATE(this)->invokeptr.get() != NULL)); } /*! Returns TRUE if this state was tagged as a "task". "Tasks" will cause state change callbacks to be invoked in the ScXMLStateMachine as they are entered and exited, but other states will not. \sa ScXMLStateMachine::addStateChangeCallback */ SbBool ScXMLState::isTask(void) const { return this->istask; } #undef PRIVATE
26.594771
112
0.626812
[ "vector", "3d" ]
d6285c19da5f5c7193f9588928fdf37e854fa630
3,232
cpp
C++
code/SupportComponents/SymbolTable/SymbolTable.cpp
LLDevLab/LLDevCompiler
f73f13d38069ab5b571fb136e068eb06387caf4c
[ "BSD-3-Clause" ]
5
2019-10-22T18:37:43.000Z
2020-12-09T14:00:03.000Z
code/SupportComponents/SymbolTable/SymbolTable.cpp
LLDevLab/LLDevCompiler
f73f13d38069ab5b571fb136e068eb06387caf4c
[ "BSD-3-Clause" ]
1
2020-03-29T15:30:45.000Z
2020-03-29T15:30:45.000Z
code/SupportComponents/SymbolTable/SymbolTable.cpp
LLDevLab/LLDevCompiler
f73f13d38069ab5b571fb136e068eb06387caf4c
[ "BSD-3-Clause" ]
1
2019-12-23T06:51:45.000Z
2019-12-23T06:51:45.000Z
#include "SymbolTable.h" SymbolTable::~SymbolTable() { map<string, Symbol*>::iterator sym_map_it; vector<ObjFile*>::iterator obj_file_vect_it; for (sym_map_it = symbols_map.begin(); sym_map_it != symbols_map.end(); sym_map_it++) { Symbol* sym = sym_map_it->second; delete sym; } symbols_map.clear(); for (obj_file_vect_it = obj_file_vector.begin(); obj_file_vect_it != obj_file_vector.end(); obj_file_vect_it++) { ObjFile* file = *obj_file_vect_it; delete file; } obj_file_vector.clear(); } void SymbolTable::InitSymbolTable(vector<string> file_names) { vector<string>::iterator file_names_it; ObjFile* obj_file = NULL; string line = ""; Symbol* sym; uint cur_pos; uint init_bytecode_line_num = 0; for (file_names_it = file_names.begin(); file_names_it != file_names.end(); file_names_it++) { vector<Symbol*> file_sym_vect; LdaSrcFile lda_file(*file_names_it); obj_file = new ObjFile(lda_file.GetFileName(), init_bytecode_line_num); obj_file_vector.push_back(obj_file); lda_file.Open(FILE_IO_INPUT); cur_pos = 0; while (true) { line = ReadLine(&lda_file); // Here empty line could be return when end of file was reached if (line == "") break; if (Symbol::IsSymbol(line)) { string sym_line = line; if(LineHelper::IsLabel(sym_line)) sym_line = sym_line.substr(0, sym_line.size() - 1); if (SymbolExist(sym_line)) throw LLDevSymbolTableException("Label \"" + sym_line + "\" already exists in symbol table."); sym = InitSymbol(sym_line, cur_pos, obj_file); symbols_map.insert(pair<string, Symbol*>(sym->GetSymbolName(), sym)); file_sym_vect.push_back(sym); } if (!LineHelper::CanSkip(line)) cur_pos++; } lda_file.Close(FILE_IO_INPUT); file_sym_map.insert(pair<string, vector<Symbol*>>(obj_file->GetFileName(), file_sym_vect)); init_bytecode_line_num += cur_pos; } } bool SymbolTable::SymbolExist(string symbol) { return symbols_map.find(symbol) != symbols_map.end(); } uint SymbolTable::GetSymbolPos(string symbol) { map<string, Symbol*>::iterator it = symbols_map.find(symbol); Symbol* sym; if (it == symbols_map.end()) SymbolNotFoundException(symbol); sym = it->second; return sym->GetSymbolPosOffset(); } string SymbolTable::ReadLine(LdaSrcFile* lda_file) { string ret = ""; do { ret = lda_file->ReadLine(); } while (!lda_file->IsEndOfInput() && ret == ""); // ignore empty lines return ret; } Symbol* SymbolTable::InitSymbol(string line, uint pos, ObjFile* obj_file) { Symbol* sym = NULL; if (LineHelper::IsRet(line)) sym = new RetSymbol(line, pos, obj_file); else sym = new LabelSymbol(line, pos, obj_file); return sym; } vector<Symbol*> SymbolTable::GetFileSymVector(string file_name) { vector<Symbol*> sym_vector; map<string, vector<Symbol*>>::iterator file_sym_map_it = file_sym_map.find(file_name); if (file_sym_map_it != file_sym_map.end()) sym_vector = file_sym_map_it->second; return sym_vector; } vector<ObjFile*> SymbolTable::GetObjFileVector() { return obj_file_vector; } inline void SymbolTable::SymbolNotFoundException(string sym_name) { throw LLDevSymbolTableException("Label \"" + sym_name + "\" not found in symbol table."); }
23.42029
112
0.70854
[ "vector" ]
d639a49fe88eeee267013f22e38f6fe9d8383dbd
1,456
cpp
C++
aws-cpp-sdk-resource-groups/source/model/GroupResourcesResult.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-resource-groups/source/model/GroupResourcesResult.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-resource-groups/source/model/GroupResourcesResult.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2020-10-27T18:16:01.000Z
2020-10-27T18:16:01.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/resource-groups/model/GroupResourcesResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::ResourceGroups::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GroupResourcesResult::GroupResourcesResult() { } GroupResourcesResult::GroupResourcesResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } GroupResourcesResult& GroupResourcesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Succeeded")) { Array<JsonView> succeededJsonList = jsonValue.GetArray("Succeeded"); for(unsigned succeededIndex = 0; succeededIndex < succeededJsonList.GetLength(); ++succeededIndex) { m_succeeded.push_back(succeededJsonList[succeededIndex].AsString()); } } if(jsonValue.ValueExists("Failed")) { Array<JsonView> failedJsonList = jsonValue.GetArray("Failed"); for(unsigned failedIndex = 0; failedIndex < failedJsonList.GetLength(); ++failedIndex) { m_failed.push_back(failedJsonList[failedIndex].AsObject()); } } return *this; }
27.471698
108
0.746566
[ "model" ]
d63a9e6e9e8ac2ee5cc315af19b8ace54e409efe
8,266
cc
C++
modules/Runtime/Main_gtk.cc
trueinteractions/tint2
8ec9ad70c4ab5355f5d06de67ba724830372a365
[ "MIT" ]
380
2015-01-06T15:52:07.000Z
2021-11-08T11:17:02.000Z
modules/Runtime/Main_gtk.cc
trueinteractions/tint2
8ec9ad70c4ab5355f5d06de67ba724830372a365
[ "MIT" ]
124
2015-01-01T02:51:40.000Z
2021-03-03T18:06:55.000Z
modules/Runtime/Main_gtk.cc
trueinteractions/tint2
8ec9ad70c4ab5355f5d06de67ba724830372a365
[ "MIT" ]
36
2015-01-09T19:01:16.000Z
2019-09-05T05:34:12.000Z
#include "node.cc" // this is a hack to get at node's internal globals. #include <tint_version.h> #include <gtk/gtk.h> #include <nan.h> #include "../libraries/gir/src/namespace_loader.h" #include <sys/types.h> #include <sys/epoll.h> #include <sys/time.h> static bool packaged = false; static int embed_closed = 0; static uv_sem_t embed_sem; static uv_thread_t embed_thread; static int init_argc; static char **init_argv; static int code; static GtkApplication *app; namespace REF { extern void Init (v8::Handle<v8::Object> target); } namespace FFI { extern void Init(v8::Handle<v8::Object> target); } v8::Handle<v8::Object> process_l; v8::Handle<v8::Object> gobj; node::Environment *env; NAN_METHOD(InitBridge) { v8::Local<v8::Object> bridge = Nan::New<v8::Object>(); gobj = Nan::New<v8::Object>(); process_l->ForceSet(Nan::New<v8::String>("bridge").ToLocalChecked(), bridge); bridge->ForceSet(Nan::New<v8::String>("gir").ToLocalChecked(), gobj); FFI::Init(bridge); REF::Init(bridge); Nan::Set(gobj, Nan::New("load").ToLocalChecked(), Nan::GetFunction(Nan::New<v8::FunctionTemplate>(gir::NamespaceLoader::Load)).ToLocalChecked()); Nan::Set(gobj, Nan::New("search_path").ToLocalChecked(), Nan::GetFunction(Nan::New<v8::FunctionTemplate>(gir::NamespaceLoader::SearchPath)).ToLocalChecked()); info.GetReturnValue().Set(Nan::New<v8::Object>()); } static bool uv_trip_timer_safety = false; static gboolean uv_pump(gpointer user_data) { if (uv_run(env->event_loop(), UV_RUN_NOWAIT) == false && uv_loop_alive(env->event_loop()) == false) { EmitBeforeExit(env); uv_trip_timer_safety = true; } uv_sem_post(&embed_sem); return false; } static void uv_event(void * info) { int epoll_ = epoll_create(1); int backend_fd = uv_backend_fd(env->event_loop()); int r; struct epoll_event ev; ev.events = EPOLLIN; ev.data.fd = backend_fd; epoll_ctl(epoll_, EPOLL_CTL_ADD, backend_fd, &ev); while (!embed_closed) { do { struct epoll_event ev; int timeout = uv_backend_timeout(env->event_loop()); if(timeout < 0) { timeout = 16; } else if (timeout > 250) { timeout = 250; } else if (timeout == 0 && uv_trip_timer_safety) { timeout = 150; uv_trip_timer_safety = false; } r = epoll_wait(epoll_, &ev, 1, timeout); } while (r == -1 && errno == EINTR); g_idle_add(uv_pump, NULL); // Wait for the main loop to deal with events. uv_sem_wait(&embed_sem); } } static void startup (GtkApplication* app, gpointer user_data) { process_l = env->process_object(); // Register the app:// protocol. // TODO: register the gtk app protocol. // Register the initial bridge objective-c protocols Nan::SetMethod(process_l, "initbridge", InitBridge); // Set Version Information process_l->Get(Nan::New<v8::String>("versions").ToLocalChecked())->ToObject()->Set(Nan::New<v8::String>("tint").ToLocalChecked(), Nan::New<v8::String>(TINT_VERSION).ToLocalChecked()); process_l->Set(Nan::New<v8::String>("packaged").ToLocalChecked(), Nan::New<v8::Boolean>(packaged)); // Start debug agent when argv has --debug if (node::use_debug_agent) node::StartDebug(env, node::debug_wait_connect); node::LoadEnvironment(env); // Enable debugger if (node::use_debug_agent) node::EnableDebug(env); // Start worker that will interrupt main loop when having uv events. // keep the UV loop in-sync with CFRunLoop. embed_closed = 0; uv_sem_init(&embed_sem, 0); uv_thread_create(&embed_thread, uv_event, NULL); } static gint gtk_command_line_cb (GApplication *app, GApplicationCommandLine *cmd, gpointer user_data) { return (gint)0; } static void deactivate() { embed_closed = 1; EmitBeforeExit(env); // Emit `beforeExit` if the loop became alive either after emitting // event, or after running some callbacks. if(uv_loop_alive(env->event_loop())) { uv_run(env->event_loop(), UV_RUN_NOWAIT); } EmitExit(env); RunAtExit(env); } static char **copy_argv(int argc, char **argv) { size_t strlen_sum; char **argv_copy; char *argv_data; size_t len; int i; strlen_sum = 0; for(i = 0; i < argc; i++) { strlen_sum += strlen(argv[i]) + 1; } argv_copy = (char **) malloc(sizeof(char *) * (argc + 1) + strlen_sum); if (!argv_copy) { return NULL; } argv_data = (char *) argv_copy + sizeof(char *) * (argc + 1); for(i = 0; i < argc; i++) { argv_copy[i] = argv_data; len = strlen(argv[i]) + 1; memcpy(argv_data, argv[i], len); argv_data += len; } argv_copy[argc] = NULL; return argv_copy; } int main(int argc, char * argv[]) { app = gtk_application_new ("org.trueinteractions.tint", G_APPLICATION_HANDLES_COMMAND_LINE); g_application_hold(G_APPLICATION (app)); g_signal_connect (app, "startup", G_CALLBACK (startup), NULL); g_signal_connect (app, "shutdown", G_CALLBACK (deactivate), NULL); g_signal_connect (app, "command-line", G_CALLBACK(gtk_command_line_cb), NULL); /*NSBundle *bundle = [NSBundle mainBundle]; NSString *package = [bundle pathForResource:@"package" ofType:@"json"]; NSString *identifier = [bundle bundleIdentifier]; if(package && identifier) { NSString *executable = [bundle executablePath]; NSDictionary *p = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:package] options:NSJSONReadingMutableContainers error:nil]; NSString *main = nil; for(NSString *key in p) { if([key isEqualToString:@"main"]) { main =[p valueForKey:key]; break; } } if(main == nil) { fprintf(stderr, "Cannot find main entry within package.json file.\n"); exit(1); } main = [[[bundle resourcePath] stringByAppendingString:@"/"] stringByAppendingString:main]; const char *exec = [executable cStringUsingEncoding:NSASCIIStringEncoding]; const char *pack = [main cStringUsingEncoding:NSASCIIStringEncoding]; unsigned int exec_len = strlen(exec) + 1; unsigned int pack_len = strlen(pack) + 1; unsigned int buf_len = sizeof(char *) * 2; char **p_argv = (char **)malloc(exec_len + pack_len + buf_len); char *base = (char *)p_argv; p_argv[0] = (char *)(base + buf_len); p_argv[1] = (char *)(base + buf_len + exec_len); // dont add argv. strncpy(p_argv[0], exec, exec_len); strncpy(p_argv[1], pack, pack_len); init_argc = argc = 2; init_argv = copy_argv(argc, p_argv); packaged = true; } else {*/ init_argc = argc; init_argv = copy_argv(argc, argv); //} const char* replaceInvalid = getenv("NODE_INVALID_UTF8"); if (replaceInvalid == NULL) node::WRITE_UTF8_FLAGS |= v8::String::REPLACE_INVALID_UTF8; // Try hard not to lose SIGUSR1 signals during the bootstrap process. node::InstallEarlyDebugSignalHandler(); assert(init_argc > 0); // Hack around with the argv pointer. Used for process.title = "blah". argv = uv_setup_args(init_argc, init_argv); // This needs to run *before* V8::Initialize(). The const_cast is not // optional, in case you're wondering. int exec_argc; const char** exec_argv; node::Init(&init_argc, const_cast<const char**>(init_argv), &exec_argc, &exec_argv); // V8 on Windows doesn't have a good source of entropy. Seed it from // OpenSSL's pool. v8::V8::SetEntropySource(node::crypto::EntropySource); v8::V8::Initialize(); node::node_is_initialized = true; { v8::Locker locker(node::node_isolate); v8::Isolate::Scope isolate_scope(node::node_isolate); v8::HandleScope handle_scope(node::node_isolate); v8::Local<v8::Context> context = v8::Context::New(node::node_isolate); env = node::CreateEnvironment( node::node_isolate, uv_default_loop(), context, init_argc, init_argv, exec_argc, exec_argv); v8::Context::Scope context_scope(context); g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); env->Dispose(); env = NULL; } CHECK_NE(node::node_isolate, NULL); node::node_isolate->Dispose(); node::node_isolate = NULL; v8::V8::Dispose(); delete[] exec_argv; exec_argv = NULL; return code; }
30.058182
185
0.670336
[ "object" ]
d63dbf9e0586be21ca0d20b2d315318e9a616ca9
1,369
cpp
C++
aws-cpp-sdk-backup-gateway/source/model/ListVirtualMachinesResult.cpp
perfectrecall/aws-sdk-cpp
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-backup-gateway/source/model/ListVirtualMachinesResult.cpp
perfectrecall/aws-sdk-cpp
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-backup-gateway/source/model/ListVirtualMachinesResult.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-12-30T04:25:33.000Z
2021-12-30T04:25:33.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/backup-gateway/model/ListVirtualMachinesResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::BackupGateway::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ListVirtualMachinesResult::ListVirtualMachinesResult() { } ListVirtualMachinesResult::ListVirtualMachinesResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } ListVirtualMachinesResult& ListVirtualMachinesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } if(jsonValue.ValueExists("VirtualMachines")) { Array<JsonView> virtualMachinesJsonList = jsonValue.GetArray("VirtualMachines"); for(unsigned virtualMachinesIndex = 0; virtualMachinesIndex < virtualMachinesJsonList.GetLength(); ++virtualMachinesIndex) { m_virtualMachines.push_back(virtualMachinesJsonList[virtualMachinesIndex].AsObject()); } } return *this; }
27.38
126
0.769175
[ "model" ]
d64039e056b81ebd96fa7dd830e246e11befb7ae
6,084
cpp
C++
HDUOJ/3468/dinic_bfs.cpp
codgician/ACM
391f3ce9b89b0a4bbbe3ff60eb2369fef57460d4
[ "MIT" ]
2
2018-02-14T01:59:31.000Z
2018-03-28T03:30:45.000Z
HDUOJ/3468/dinic_bfs.cpp
codgician/ACM
391f3ce9b89b0a4bbbe3ff60eb2369fef57460d4
[ "MIT" ]
null
null
null
HDUOJ/3468/dinic_bfs.cpp
codgician/ACM
391f3ce9b89b0a4bbbe3ff60eb2369fef57460d4
[ "MIT" ]
2
2017-12-30T02:46:35.000Z
2018-03-28T03:30:49.000Z
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <iomanip> #include <climits> #include <vector> #include <queue> #include <map> #include <set> #define ROW_COLUMN_SIZE 101 #define CHAR_SIZE 52 #define VERTEX_SIZE 10010 #define EDGE_SIZE 2100000 using namespace std; typedef struct _Node { int x, y; } Node; typedef struct _Edge { int to; int capacity; int next; } Edge; Edge arr[EDGE_SIZE]; int head[VERTEX_SIZE], arrPt; int depth[VERTEX_SIZE], lastVisitedEdge[VERTEX_SIZE]; int vertexNum; char mapArr[ROW_COLUMN_SIZE][ROW_COLUMN_SIZE]; bool hasVisited[ROW_COLUMN_SIZE][ROW_COLUMN_SIZE]; Node rallayArr[CHAR_SIZE], goldArr[VERTEX_SIZE]; int lastRallayPt, goldPt; int dis[CHAR_SIZE][ROW_COLUMN_SIZE][ROW_COLUMN_SIZE]; int dir[2][4] = {1, -1, 0, 0, 0, 0, 1, -1}; int row, column; void addEdge(int from, int to, int capacity) { arr[arrPt] = {to, capacity, head[from]}; head[from] = arrPt++; arr[arrPt] = {from, 0, head[to]}; head[to] = arrPt++; } bool updateDepth(int startPt, int endPt) { memset(depth, -1, sizeof(depth)); queue<int> q; q.push(startPt); depth[startPt] = 0; while (!q.empty()) { int cntPt = q.front(); q.pop(); int edgePt = head[cntPt]; while (edgePt != -1) { if (depth[arr[edgePt].to] == -1 && arr[edgePt].capacity > 0) { depth[arr[edgePt].to] = depth[cntPt] + 1; if (arr[edgePt].to == endPt) return true; q.push(arr[edgePt].to); } edgePt = arr[edgePt].next; } } return false; } int findAugPath(int cntPt, int endPt, int minCapacity) { if (cntPt == endPt) return minCapacity; int cntFlow = 0; int &edgePt = lastVisitedEdge[cntPt]; while (edgePt != -1) { if (depth[arr[edgePt].to] == depth[cntPt] + 1 && arr[edgePt].capacity > 0) { int flowInc = findAugPath(arr[edgePt].to, endPt, min(minCapacity - cntFlow, arr[edgePt].capacity)); if (flowInc == 0) { depth[arr[edgePt].to] = -1; } else { arr[edgePt].capacity -= flowInc; arr[edgePt ^ 1].capacity += flowInc; cntFlow += flowInc; if (cntFlow == minCapacity) break; } } edgePt = arr[edgePt].next; } return cntFlow; } int dinic(int startPt, int endPt) { int ans = 0; while (updateDepth(startPt, endPt)) { for (int i = 0; i < vertexNum; i++) lastVisitedEdge[i] = head[i]; int flowInc = findAugPath(startPt, endPt, INT_MAX); if (flowInc == 0) break; ans += flowInc; } return ans; } bool canVisit(Node &cntPt) { return cntPt.x >= 0 && cntPt.x < row && cntPt.y >= 0 && cntPt.y < column && !hasVisited[cntPt.x][cntPt.y] && mapArr[cntPt.x][cntPt.y] != '#'; } void bfs(int startPt) { memset(hasVisited, false, sizeof(hasVisited)); queue<Node> q; q.push(rallayArr[startPt]); hasVisited[rallayArr[startPt].x][rallayArr[startPt].y] = true; dis[startPt][rallayArr[startPt].x][rallayArr[startPt].y] = 0; while (!q.empty()) { Node cntPt = q.front(); q.pop(); for (int i = 0; i < 4; i++) { Node nextPt = {cntPt.x + dir[0][i], cntPt.y + dir[1][i]}; if (canVisit(nextPt)) { hasVisited[nextPt.x][nextPt.y] = true; q.push(nextPt); dis[startPt][nextPt.x][nextPt.y] = dis[startPt][cntPt.x][cntPt.y] + 1; } } } } int main() { ios::sync_with_stdio(false); while (cin >> row >> column) { memset(head, -1, sizeof(head)); memset(rallayArr, -1, sizeof(rallayArr)); memset(dis, -1, sizeof(dis)); arrPt = 0; lastRallayPt = 0; goldPt = 0; for (int i = 0; i < row; i++) { for (int j = 0; j < column; j++) { cin >> mapArr[i][j]; if (mapArr[i][j] >= 'A' && mapArr[i][j] <= 'Z') { rallayArr[mapArr[i][j] - 'A'] = {i, j}; lastRallayPt = max(lastRallayPt, mapArr[i][j] - 'A'); } else if (mapArr[i][j] >= 'a' && mapArr[i][j] <= 'z') { rallayArr[mapArr[i][j] - 'a' + 26] = {i, j}; lastRallayPt = max(lastRallayPt, mapArr[i][j] - 'a' + 26); } else if (mapArr[i][j] == '*') { goldArr[goldPt++] = {i, j}; } } } int startPt = 0; for (int i = 0; i <= lastRallayPt; i++) { bfs(i); if (i < lastRallayPt) addEdge(startPt, i + 1, 1); } bool hasAns = true; // Last rallyPt could be ignored for (int i = 0; i < lastRallayPt; i++) { for (int j = 0; j < goldPt; j++) { if (dis[i][rallayArr[i + 1].x][rallayArr[i + 1].y] == -1) { hasAns = false; break; } if (dis[i][goldArr[j].x][goldArr[j].y] + dis[i + 1][goldArr[j].x][goldArr[j].y] == dis[i][rallayArr[i + 1].x][rallayArr[i + 1].y]) { addEdge(i + 1, lastRallayPt + j + 1, 1); } } if (!hasAns) break; } if (!hasAns) { cout << -1 << endl; continue; } int endPt = lastRallayPt + goldPt + 1; vertexNum = endPt + 1; for (int i = 0; i < goldPt; i++) { addEdge(lastRallayPt + i + 1, endPt, 1); } int ans = dinic(startPt, endPt); cout << ans << endl; } return 0; }
25.140496
146
0.475181
[ "vector" ]
d64590cd72516b446c949afe088b885ddad865e0
3,388
cpp
C++
src/spec/ast/type/enum.cpp
betasheet/diffingo
285d21b16c118155e5c149b20fcb20a20276f3d7
[ "MIT" ]
null
null
null
src/spec/ast/type/enum.cpp
betasheet/diffingo
285d21b16c118155e5c149b20fcb20a20276f3d7
[ "MIT" ]
null
null
null
src/spec/ast/type/enum.cpp
betasheet/diffingo
285d21b16c118155e5c149b20fcb20a20276f3d7
[ "MIT" ]
null
null
null
/* * enum.cpp * * Distributed under the MIT License (MIT). * * Copyright (c) 2015 Eric Seckler * * 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 "spec/ast/constant/enum.h" #include "spec/ast/type/enum.h" #include <algorithm> #include <list> #include <memory> #include <stdexcept> #include <string> #include <utility> #include "spec/ast/exception.h" #include "spec/ast/expression/constant.h" #include "spec/ast/id.h" #include "spec/ast/node.h" #include "spec/ast/scope.h" #include "spec/ast/type/type.h" #include "util/util.h" namespace diffingo { namespace spec { namespace ast { namespace type { Enum::Enum(const label_list& labels, const Location& l) : Type(l) { int next = 1; for (auto label : labels) { if (*label.first == "UNDEF") throw ast::RuntimeError("enum label 'Undef' is already predefined", this); auto i = label.second; if (i < 0) i = next; next = std::max(next, i + 1); labels_.push_back(std::make_pair(label.first, i)); } labels_.push_back( std::make_pair(node_ptr<ID>(std::make_shared<ID>("UNDEF")), -1)); labels_.sort([](const Label& lhs, const Label& rhs) { return lhs.first->name().compare(rhs.first->name()) < 0; }); } Enum::Enum(const Location& l) : Type(l) { setWildcard(true); } Enum::~Enum() {} Enum::label_list Enum::labels() const { label_list labels; for (const auto& l : labels_) labels.push_back(l); return labels; } int Enum::labelValue(node_ptr<ID> label) { for (auto l : labels_) { if (*l.first == *label) return l.second; } throw ast::InternalError( util::fmt("unknown enum label %s", label->pathAsString().c_str()), this); } std::shared_ptr<Scope> Enum::typeScope() { if (scope_) return scope_; scope_ = std::make_shared<Scope>(); auto p = nodePtr<type::Type>(); for (auto label : labels_) { auto val = std::make_shared<constant::Enum>(label.first, p, location()); auto expr = std::make_shared<expression::Constant>( node_ptr<constant::Constant>(val), location()); scope_->insert(label.first, node_ptr<expression::Expression>(expr)); } return scope_; } std::string Enum::render() { std::string s = "ENUM ("; s += std::to_string(labels_.size()) + " labels) "; s += Type::render(); return s; } } // namespace type } // namespace ast } // namespace spec } // namespace diffingo
28.711864
80
0.68595
[ "render" ]
d64cc7f706c60f42bb7c29a1555d4bba880a0a47
7,400
hpp
C++
include/VROSC/PredictiveHitWisp.hpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
null
null
null
include/VROSC/PredictiveHitWisp.hpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
null
null
null
include/VROSC/PredictiveHitWisp.hpp
v0idp/virtuoso-codegen
6f560f04822c67f092d438a3f484249072c1d21d
[ "Unlicense" ]
1
2022-03-30T21:07:35.000Z
2022-03-30T21:07:35.000Z
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" #include "beatsaber-hook/shared/utils/byref.hpp" // Including type: UnityEngine.MonoBehaviour #include "UnityEngine/MonoBehaviour.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "beatsaber-hook/shared/utils/utils.h" #include "beatsaber-hook/shared/utils/typedefs-array.hpp" // Completed includes // Begin forward declares // Forward declaring namespace: VROSC namespace VROSC { // Forward declaring type: MalletVisual class MalletVisual; // Forward declaring type: PredictiveHittable class PredictiveHittable; } // Forward declaring namespace: UnityEngine namespace UnityEngine { // Forward declaring type: Transform class Transform; // Forward declaring type: TrailRenderer class TrailRenderer; // Skipping declaration: Vector3 because it is already included! // Forward declaring type: Color struct Color; } // Completed forward declares // Type namespace: VROSC namespace VROSC { // Forward declaring type: PredictiveHitWisp class PredictiveHitWisp; } #include "beatsaber-hook/shared/utils/il2cpp-type-check.hpp" NEED_NO_BOX(::VROSC::PredictiveHitWisp); DEFINE_IL2CPP_ARG_TYPE(::VROSC::PredictiveHitWisp*, "VROSC", "PredictiveHitWisp"); // Type namespace: VROSC namespace VROSC { // Size: 0x48 #pragma pack(push, 1) // Autogenerated type: VROSC.PredictiveHitWisp // [TokenAttribute] Offset: FFFFFFFF class PredictiveHitWisp : public ::UnityEngine::MonoBehaviour { public: // Nested type: ::VROSC::PredictiveHitWisp::ParticleEffect class ParticleEffect; // Nested type: ::VROSC::PredictiveHitWisp::$SetAtHitpoint$d__7 struct $SetAtHitpoint$d__7; public: // private UnityEngine.Transform _wisp // Size: 0x8 // Offset: 0x18 ::UnityEngine::Transform* wisp; // Field size check static_assert(sizeof(::UnityEngine::Transform*) == 0x8); // private System.Int32 remainMs // Size: 0x4 // Offset: 0x20 int remainMs; // Field size check static_assert(sizeof(int) == 0x4); // Padding between fields: remainMs and: particleEffects char __padding1[0x4] = {}; // private VROSC.PredictiveHitWisp/VROSC.ParticleEffect[] _particleEffects // Size: 0x8 // Offset: 0x28 ::ArrayW<::VROSC::PredictiveHitWisp::ParticleEffect*> particleEffects; // Field size check static_assert(sizeof(::ArrayW<::VROSC::PredictiveHitWisp::ParticleEffect*>) == 0x8); // private UnityEngine.Transform _lookAtPoint // Size: 0x8 // Offset: 0x30 ::UnityEngine::Transform* lookAtPoint; // Field size check static_assert(sizeof(::UnityEngine::Transform*) == 0x8); // private UnityEngine.TrailRenderer _trailRenderer // Size: 0x8 // Offset: 0x38 ::UnityEngine::TrailRenderer* trailRenderer; // Field size check static_assert(sizeof(::UnityEngine::TrailRenderer*) == 0x8); // private VROSC.MalletVisual _malletVisual // Size: 0x8 // Offset: 0x40 ::VROSC::MalletVisual* malletVisual; // Field size check static_assert(sizeof(::VROSC::MalletVisual*) == 0x8); public: // Deleting conversion operator: operator ::System::IntPtr constexpr operator ::System::IntPtr() const noexcept = delete; // Get instance field reference: private UnityEngine.Transform _wisp [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& dyn__wisp(); // Get instance field reference: private System.Int32 remainMs [[deprecated("Use field access instead!")]] int& dyn_remainMs(); // Get instance field reference: private VROSC.PredictiveHitWisp/VROSC.ParticleEffect[] _particleEffects [[deprecated("Use field access instead!")]] ::ArrayW<::VROSC::PredictiveHitWisp::ParticleEffect*>& dyn__particleEffects(); // Get instance field reference: private UnityEngine.Transform _lookAtPoint [[deprecated("Use field access instead!")]] ::UnityEngine::Transform*& dyn__lookAtPoint(); // Get instance field reference: private UnityEngine.TrailRenderer _trailRenderer [[deprecated("Use field access instead!")]] ::UnityEngine::TrailRenderer*& dyn__trailRenderer(); // Get instance field reference: private VROSC.MalletVisual _malletVisual [[deprecated("Use field access instead!")]] ::VROSC::MalletVisual*& dyn__malletVisual(); // public System.Void .ctor() // Offset: 0xAE2CFC template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static PredictiveHitWisp* New_ctor() { static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PredictiveHitWisp::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<PredictiveHitWisp*, creationType>())); } // public System.Void SetAtHitpoint(System.Double dspTime, UnityEngine.Vector3 hitpoint, VROSC.PredictiveHittable predictiveHittable) // Offset: 0xAE2B84 void SetAtHitpoint(double dspTime, ::UnityEngine::Vector3 hitpoint, ::VROSC::PredictiveHittable* predictiveHittable); // public System.Void SetTrailColor(UnityEngine.Color color) // Offset: 0xAE2C80 void SetTrailColor(::UnityEngine::Color color); }; // VROSC.PredictiveHitWisp #pragma pack(pop) static check_size<sizeof(PredictiveHitWisp), 64 + sizeof(::VROSC::MalletVisual*)> __VROSC_PredictiveHitWispSizeCheck; static_assert(sizeof(PredictiveHitWisp) == 0x48); } #include "beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" // Writing MetadataGetter for method: VROSC::PredictiveHitWisp::New_ctor // Il2CppName: .ctor // Cannot get method pointer of value based method overload from template for constructor! // Try using FindMethod instead! // Writing MetadataGetter for method: VROSC::PredictiveHitWisp::SetAtHitpoint // Il2CppName: SetAtHitpoint template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (VROSC::PredictiveHitWisp::*)(double, ::UnityEngine::Vector3, ::VROSC::PredictiveHittable*)>(&VROSC::PredictiveHitWisp::SetAtHitpoint)> { static const MethodInfo* get() { static auto* dspTime = &::il2cpp_utils::GetClassFromName("System", "Double")->byval_arg; static auto* hitpoint = &::il2cpp_utils::GetClassFromName("UnityEngine", "Vector3")->byval_arg; static auto* predictiveHittable = &::il2cpp_utils::GetClassFromName("VROSC", "PredictiveHittable")->byval_arg; return ::il2cpp_utils::FindMethod(classof(VROSC::PredictiveHitWisp*), "SetAtHitpoint", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{dspTime, hitpoint, predictiveHittable}); } }; // Writing MetadataGetter for method: VROSC::PredictiveHitWisp::SetTrailColor // Il2CppName: SetTrailColor template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (VROSC::PredictiveHitWisp::*)(::UnityEngine::Color)>(&VROSC::PredictiveHitWisp::SetTrailColor)> { static const MethodInfo* get() { static auto* color = &::il2cpp_utils::GetClassFromName("UnityEngine", "Color")->byval_arg; return ::il2cpp_utils::FindMethod(classof(VROSC::PredictiveHitWisp*), "SetTrailColor", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{color}); } };
48.684211
211
0.732973
[ "vector", "transform" ]
d6526c26e574b69204f3b44ec3889ec614f60b20
25,062
cc
C++
codec/L2/demos/pikEnc/host/host_dev.cc
vmayoral/Vitis_Libraries
2323dc5036041e18242718287aee4ce66ba071ef
[ "Apache-2.0" ]
1
2021-09-11T01:05:01.000Z
2021-09-11T01:05:01.000Z
codec/L2/demos/pikEnc/host/host_dev.cc
vmayoral/Vitis_Libraries
2323dc5036041e18242718287aee4ce66ba071ef
[ "Apache-2.0" ]
null
null
null
codec/L2/demos/pikEnc/host/host_dev.cc
vmayoral/Vitis_Libraries
2323dc5036041e18242718287aee4ce66ba071ef
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2019 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <iostream> #include <sys/time.h> #include "host_dev.hpp" #ifndef HLS_TEST #include "xcl2.hpp" #include "xf_utils_sw/logger.hpp" #define XCL_BANK(n) (((unsigned int)(n)) | XCL_MEM_TOPOLOGY) #define XCL_BANK0 XCL_BANK(0) #define XCL_BANK1 XCL_BANK(1) #define XCL_BANK2 XCL_BANK(2) #define XCL_BANK3 XCL_BANK(3) #define XCL_BANK4 XCL_BANK(4) #define XCL_BANK5 XCL_BANK(5) #define XCL_BANK6 XCL_BANK(6) #define XCL_BANK7 XCL_BANK(7) #define XCL_BANK8 XCL_BANK(8) #define XCL_BANK9 XCL_BANK(9) #define XCL_BANK10 XCL_BANK(10) #define XCL_BANK11 XCL_BANK(11) #define XCL_BANK12 XCL_BANK(12) #define XCL_BANK13 XCL_BANK(13) #define XCL_BANK14 XCL_BANK(14) #define XCL_BANK15 XCL_BANK(15) #define XCL_BANK16 XCL_BANK(16) #define XCL_BANK17 XCL_BANK(17) #define XCL_BANK18 XCL_BANK(18) #define XCL_BANK19 XCL_BANK(19) #define XCL_BANK20 XCL_BANK(20) #define XCL_BANK21 XCL_BANK(21) #define XCL_BANK22 XCL_BANK(22) #define XCL_BANK23 XCL_BANK(23) #define XCL_BANK24 XCL_BANK(24) #define XCL_BANK25 XCL_BANK(25) #define XCL_BANK26 XCL_BANK(26) #define XCL_BANK27 XCL_BANK(27) #define XCL_BANK28 XCL_BANK(28) #define XCL_BANK29 XCL_BANK(29) #define XCL_BANK30 XCL_BANK(30) #define XCL_BANK31 XCL_BANK(31) #define XCL_BANK32 XCL_BANK(32) #define XCL_BANK33 XCL_BANK(33) unsigned long diff(const struct timeval* newTime, const struct timeval* oldTime) { return (newTime->tv_sec - oldTime->tv_sec) * 1000000 + (newTime->tv_usec - oldTime->tv_usec); } template <typename T> T* aligned_alloc(std::size_t num) { void* ptr = NULL; if (posix_memalign(&ptr, 4096, num * sizeof(T))) throw std::bad_alloc(); return reinterpret_cast<T*>(ptr); } void host_func(std::string xclbinPath, float* dataDDR, ap_uint<AXI_SZ> k1_config[MAX_NUM_CONFIG], ap_uint<AXI_SZ> k2_config[MAX_NUM_CONFIG], ap_uint<AXI_SZ> k3_config[MAX_NUM_CONFIG], ap_uint<AXI_SZ> cmap[AXI_CMAP], ap_uint<AXI_SZ> order[MAX_NUM_ORDER], ap_uint<AXI_SZ> quant_field[AXI_QF], int len_dc_histo[2 * MAX_DC_GROUP], int len_dc[2 * MAX_DC_GROUP], ap_uint<AXI_SZ> dc_histo_code_out[2 * MAX_DC_GROUP * MAX_DC_HISTO_SIZE], ap_uint<AXI_SZ> dc_code_out[2 * MAX_DC_GROUP * MAX_DC_SIZE], int len_ac_histo[MAX_AC_GROUP], int len_ac[MAX_AC_GROUP], ap_uint<AXI_SZ> ac_histo_code_out[MAX_AC_GROUP * MAX_AC_HISTO_SIZE], ap_uint<AXI_SZ> ac_code_out[MAX_AC_GROUP * MAX_AC_SIZE]) { xf::common::utils_sw::Logger logger(std::cout, std::cerr); cl_int fail; struct timeval start_time; // End to end time clock start gettimeofday(&start_time, 0); // platform related operations std::vector<cl::Device> devices = xcl::get_xil_devices(); cl::Device device = devices[0]; // Creating Context and Command Queue for selected Device cl::Context context(device, NULL, NULL, NULL, &fail); logger.logCreateContext(fail); cl::CommandQueue q(context, device, CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &fail); logger.logCreateCommandQueue(fail); std::string devName = device.getInfo<CL_DEVICE_NAME>(); printf("INFO: Found Device=%s\n", devName.c_str()); cl::Program::Binaries xclBins = xcl::import_binary_file(xclbinPath); devices.resize(1); cl::Program program(context, devices, xclBins, NULL, &fail); logger.logCreateProgram(fail); int repInt = 1; // create kernels std::vector<cl::Kernel> pik_kernel1(repInt); std::vector<cl::Kernel> pik_kernel2(repInt); std::vector<cl::Kernel> pik_kernel3(repInt); for (int i = 0; i < repInt; i++) { pik_kernel1[i] = cl::Kernel(program, "kernel1Top", &fail); logger.logCreateKernel(fail); pik_kernel2[i] = cl::Kernel(program, "kernel2Top", &fail); logger.logCreateKernel(fail); pik_kernel3[i] = cl::Kernel(program, "kernel3Top", &fail); logger.logCreateKernel(fail); } std::cout << "INFO: kernel has been created" << std::endl; // declare map of host buffers std::cout << "kernel config size:" << MAX_NUM_CONFIG << std::endl; std::cout << "buf size:" << k2_config[8] << std::endl; std::cout << "ac size:" << k2_config[8] << std::endl; std::cout << "dc size:" << k2_config[24] << std::endl; std::cout << "acs size:" << k2_config[13] << std::endl; std::cout << "cmap size:" << k2_config[10] << std::endl; std::cout << "order size:" << k2_config[23] << std::endl; std::cout << "quant size:" << k2_config[15] << std::endl; std::cout << "ac_histo size:" << k3_config[12] * MAX_AC_HISTO_SIZE << std::endl; std::cout << "dc_histo size:" << 2 * k3_config[13] * MAX_DC_HISTO_SIZE << std::endl; std::cout << "ac_code size:" << k3_config[12] * MAX_AC_SIZE << std::endl; std::cout << "dc_code size:" << 2 * k3_config[13] * MAX_DC_SIZE << std::endl; ap_uint<32>* hb_config1 = aligned_alloc<ap_uint<32> >(MAX_NUM_CONFIG); ap_uint<32>* hb_config2 = aligned_alloc<ap_uint<32> >(MAX_NUM_CONFIG); ap_uint<32>* hb_config3 = aligned_alloc<ap_uint<32> >(MAX_NUM_CONFIG); float* hb_data_in = aligned_alloc<float>(BUF_DEPTH); ap_uint<32>* hb_buf_out = aligned_alloc<ap_uint<32> >(k2_config[8]); ap_uint<32>* hb_qf = aligned_alloc<ap_uint<32> >(k2_config[9]); ap_uint<32>* hb_cmap = aligned_alloc<ap_uint<32> >(k2_config[10]); ap_uint<32>* hb_ac = aligned_alloc<ap_uint<32> >(k2_config[8]); ap_uint<32>* hb_dc = aligned_alloc<ap_uint<32> >(k2_config[24]); ap_uint<32>* hb_order = aligned_alloc<ap_uint<32> >(k2_config[23]); ap_uint<32>* hb_strategy = aligned_alloc<ap_uint<32> >(k2_config[13]); ap_uint<32>* hb_block = aligned_alloc<ap_uint<32> >(k2_config[14]); ap_uint<32>* hb_quant = aligned_alloc<ap_uint<32> >(k2_config[15]); ap_uint<32>* hb_histo_cfg = aligned_alloc<ap_uint<32> >(4 * k3_config[13] + 2 * k3_config[12]); ap_uint<32>* hb_dc_histo = aligned_alloc<ap_uint<32> >(2 * k3_config[13] * MAX_DC_HISTO_SIZE); ap_uint<32>* hb_dc_code = aligned_alloc<ap_uint<32> >(2 * k3_config[13] * MAX_DC_SIZE); ap_uint<32>* hb_ac_histo = aligned_alloc<ap_uint<32> >(k3_config[12] * MAX_AC_HISTO_SIZE); ap_uint<32>* hb_ac_code = aligned_alloc<ap_uint<32> >(k3_config[12] * MAX_AC_SIZE); for (int j = 0; j < MAX_NUM_CONFIG; j++) { hb_config1[j] = k1_config[j]; hb_config2[j] = k2_config[j]; hb_config3[j] = k3_config[j]; } for (int j = 0; j < BUF_DEPTH; j++) hb_data_in[j] = dataDDR[j]; for (int j = 0; j < k2_config[8]; j++) hb_buf_out[j] = 0; for (int j = 0; j < k2_config[8]; j++) { hb_ac[j] = 0; } for (int j = 0; j < k2_config[24]; j++) { hb_dc[j] = 0; } for (int j = 0; j < k2_config[13]; j++) { hb_strategy[j] = 0; hb_block[j] = 0; hb_quant[j] = 0; } for (int j = 0; j < k2_config[10]; j++) { hb_cmap[j] = 0; } for (int j = 0; j < k2_config[23]; j++) hb_order[j] = 0; for (int j = 0; j < 4 * k3_config[13] + 2 * k3_config[12]; j++) { hb_histo_cfg[j] = 0; } for (int j = 0; j < 2 * k3_config[13] * MAX_DC_HISTO_SIZE; j++) { hb_dc_histo[j] = 0; } for (int j = 0; j < 2 * k3_config[13] * MAX_DC_SIZE; j++) { hb_dc_code[j] = 0; } for (int j = 0; j < k3_config[12] * MAX_AC_HISTO_SIZE; j++) { hb_ac_histo[j] = 0; } for (int j = 0; j < k3_config[12] * MAX_AC_SIZE; j++) { hb_ac_code[j] = 0; } std::vector<cl_mem_ext_ptr_t> mext_o(18); mext_o[0] = {XCL_BANK(0), hb_config1, 0}; mext_o[1] = {XCL_BANK(0), hb_data_in, 0}; mext_o[2] = {XCL_BANK(1), hb_buf_out, 0}; mext_o[3] = {XCL_BANK(1), hb_qf, 0}; mext_o[4] = {XCL_BANK(1), hb_cmap, 0}; mext_o[5] = {XCL_BANK(1), hb_config2, 0}; mext_o[6] = {XCL_BANK(2), hb_ac, 0}; mext_o[7] = {XCL_BANK(2), hb_dc, 0}; mext_o[8] = {XCL_BANK(2), hb_order, 0}; mext_o[9] = {XCL_BANK(2), hb_strategy, 0}; mext_o[10] = {XCL_BANK(2), hb_block, 0}; mext_o[11] = {XCL_BANK(2), hb_quant, 0}; mext_o[12] = {XCL_BANK(2), hb_config3, 0}; mext_o[13] = {XCL_BANK(3), hb_histo_cfg, 0}; mext_o[14] = {XCL_BANK(3), hb_ac_histo, 0}; mext_o[15] = {XCL_BANK(3), hb_ac_code, 0}; mext_o[16] = {XCL_BANK(3), hb_dc_histo, 0}; mext_o[17] = {XCL_BANK(3), hb_dc_code, 0}; // create device buffer and map dev buf to host buf cl::Buffer db_conf1, db_buf_in, db_buf_out, db_qf, db_cmap; cl::Buffer db_conf2, db_ac, db_dc, db_order, db_strategy, db_quant, db_block; cl::Buffer db_conf3, db_histo_cfg, db_dc_histo, db_dc_code, db_ac_histo, db_ac_code; db_conf1 = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * MAX_NUM_CONFIG, &mext_o[0]); db_buf_in = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[8], &mext_o[1]); db_buf_out = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[8], &mext_o[2]); db_qf = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[9], &mext_o[3]); db_cmap = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[10], &mext_o[4]); db_conf2 = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * MAX_NUM_CONFIG, &mext_o[5]); db_ac = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[8], &mext_o[6]); db_dc = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[24], &mext_o[7]); db_order = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[23], &mext_o[8]); db_strategy = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[13], &mext_o[9]); db_block = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[14], &mext_o[10]); db_quant = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k2_config[15], &mext_o[11]); db_conf3 = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * MAX_NUM_CONFIG, &mext_o[12]); db_histo_cfg = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * (4 * k3_config[13] + 2 * k3_config[12]), &mext_o[13]); db_ac_histo = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k3_config[12] * MAX_AC_HISTO_SIZE, &mext_o[14]); db_ac_code = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * k3_config[12] * MAX_AC_SIZE, &mext_o[15]); db_dc_histo = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * 2 * k3_config[13] * MAX_DC_HISTO_SIZE, &mext_o[16]); db_dc_code = cl::Buffer(context, CL_MEM_EXT_PTR_XILINX | CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE, sizeof(ap_int<32>) * 2 * k3_config[13] * MAX_DC_SIZE, &mext_o[17]); // add buffers to migrate std::vector<cl::Memory> init; init.push_back(db_conf1); init.push_back(db_buf_in); init.push_back(db_buf_out); init.push_back(db_qf); init.push_back(db_cmap); init.push_back(db_conf2); init.push_back(db_ac); init.push_back(db_dc); init.push_back(db_order); init.push_back(db_strategy); init.push_back(db_block); init.push_back(db_quant); init.push_back(db_conf3); init.push_back(db_histo_cfg); init.push_back(db_ac_histo); init.push_back(db_ac_code); init.push_back(db_dc_histo); init.push_back(db_dc_code); // migrate data from host to device q.enqueueMigrateMemObjects(init, CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED, nullptr, nullptr); q.finish(); std::vector<cl::Memory> ob_in; std::vector<cl::Memory> ob_out1, ob_out2, ob_out3; ob_in.push_back(db_conf1); ob_in.push_back(db_buf_in); ob_out1.push_back(db_buf_out); ob_out1.push_back(db_qf); ob_out1.push_back(db_cmap); ob_in.push_back(db_conf2); ob_out2.push_back(db_ac); ob_out2.push_back(db_dc); ob_out2.push_back(db_order); ob_out2.push_back(db_strategy); ob_out2.push_back(db_block); ob_out2.push_back(db_quant); ob_in.push_back(db_conf3); ob_out3.push_back(db_histo_cfg); ob_out3.push_back(db_ac_histo); ob_out3.push_back(db_ac_code); ob_out3.push_back(db_dc_histo); ob_out3.push_back(db_dc_code); // declare events std::vector<cl::Event> events_write(1); std::vector<std::vector<cl::Event> > events_kernel(3); std::vector<std::vector<cl::Event> > events_read(3); for (int i = 0; i < 3; ++i) { events_kernel[i].resize(1); events_read[i].resize(1); } // set kernel args for (int i = 0; i < repInt; i++) { pik_kernel1[i].setArg(0, db_conf1); pik_kernel1[i].setArg(1, db_buf_in); pik_kernel1[i].setArg(2, db_buf_out); pik_kernel1[i].setArg(3, db_cmap); pik_kernel1[i].setArg(4, db_qf); pik_kernel2[i].setArg(0, db_conf2); pik_kernel2[i].setArg(1, db_buf_out); pik_kernel2[i].setArg(2, db_qf); pik_kernel2[i].setArg(3, db_cmap); pik_kernel2[i].setArg(4, db_ac); pik_kernel2[i].setArg(5, db_dc); pik_kernel2[i].setArg(6, db_quant); pik_kernel2[i].setArg(7, db_strategy); pik_kernel2[i].setArg(8, db_block); pik_kernel2[i].setArg(9, db_order); pik_kernel3[i].setArg(0, db_conf3); pik_kernel3[i].setArg(1, db_ac); pik_kernel3[i].setArg(2, db_dc); pik_kernel3[i].setArg(3, db_quant); pik_kernel3[i].setArg(4, db_strategy); pik_kernel3[i].setArg(5, db_block); pik_kernel3[i].setArg(6, db_order); pik_kernel3[i].setArg(7, db_histo_cfg); pik_kernel3[i].setArg(8, db_dc_histo); pik_kernel3[i].setArg(9, db_dc_code); pik_kernel3[i].setArg(10, db_ac_histo); pik_kernel3[i].setArg(11, db_ac_code); } // launch kernel and calculate kernel execution time std::cout << "INFO: Kernel Start" << std::endl; // migrate q.enqueueMigrateMemObjects(ob_in, 0, nullptr, &events_write[0]); q.enqueueTask(pik_kernel1[0], &events_write, &events_kernel[0][0]); q.enqueueMigrateMemObjects(ob_out1, 1, &events_kernel[0], &events_read[0][0]); q.enqueueTask(pik_kernel2[0], &events_read[0], &events_kernel[1][0]); q.enqueueMigrateMemObjects(ob_out2, 1, &events_kernel[1], &events_read[1][0]); q.enqueueTask(pik_kernel3[0], &events_read[1], &events_kernel[2][0]); q.enqueueMigrateMemObjects(ob_out3, 1, &events_kernel[2], &events_read[2][0]); q.finish(); struct timeval end_time; gettimeofday(&end_time, 0); std::cout << "INFO: Finish kernel execution" << std::endl; std::cout << "INFO: Finish E2E execution" << std::endl; // print related times unsigned long timeStart, timeEnd, exec_time0; std::cout << "-------------------------------------------------------" << std::endl; events_write[0].getProfilingInfo(CL_PROFILING_COMMAND_START, &timeStart); events_write[0].getProfilingInfo(CL_PROFILING_COMMAND_END, &timeEnd); exec_time0 = (timeEnd - timeStart) / 1000.0; std::cout << "INFO: Data transfer from host to device: " << exec_time0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; events_read[0][0].getProfilingInfo(CL_PROFILING_COMMAND_START, &timeStart); events_read[0][0].getProfilingInfo(CL_PROFILING_COMMAND_END, &timeEnd); exec_time0 = (timeEnd - timeStart) / 1000.0; std::cout << "INFO: Kernel1 Data transfer from device to host: " << exec_time0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; events_read[1][0].getProfilingInfo(CL_PROFILING_COMMAND_START, &timeStart); events_read[1][0].getProfilingInfo(CL_PROFILING_COMMAND_END, &timeEnd); exec_time0 = (timeEnd - timeStart) / 1000.0; std::cout << "INFO: Kernel2 Data transfer from device to host: " << exec_time0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; events_read[2][0].getProfilingInfo(CL_PROFILING_COMMAND_START, &timeStart); events_read[2][0].getProfilingInfo(CL_PROFILING_COMMAND_END, &timeEnd); exec_time0 = (timeEnd - timeStart) / 1000.0; std::cout << "INFO: Kernel3 Data transfer from device to host: " << exec_time0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; exec_time0 = 0; for (int i = 0; i < 3; ++i) { events_kernel[i][0].getProfilingInfo(CL_PROFILING_COMMAND_START, &timeStart); events_kernel[i][0].getProfilingInfo(CL_PROFILING_COMMAND_END, &timeEnd); exec_time0 += (timeEnd - timeStart) / 1000.0; std::cout << "INFO: Kernel" << i + 1 << " execution: " << (timeEnd - timeStart) / 1000.0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; } std::cout << "INFO: kernel total execution: " << exec_time0 << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; unsigned long exec_timeE2E = diff(&end_time, &start_time); std::cout << "INFO: FPGA execution time:" << exec_timeE2E << " us\n"; std::cout << "-------------------------------------------------------" << std::endl; // output for (int i = 0; i < k2_config[10]; i++) { cmap[i] = hb_cmap[i]; } std::cout << "cmap finish" << std::endl; for (int i = 0; i < k2_config[23]; i++) { order[i] = hb_order[i]; } std::cout << "order finish" << std::endl; for (int i = 0; i < k2_config[15]; i++) { quant_field[i] = hb_quant[i]; } std::cout << "quant_field finish" << std::endl; int dc_histo_sum = 0; for (int j = 0; j < 2 * k3_config[13]; j++) { len_dc_histo[j] = hb_histo_cfg[j]; dc_histo_sum += len_dc_histo[j]; std::cout << "len_dc_h:" << (int)hb_histo_cfg[j] << std::endl; } std::cout << "dc_histo_sum:" << dc_histo_sum << std::endl; int ac_histo_sum = 0; for (int j = 0; j < k3_config[12]; j++) { len_ac_histo[j] = hb_histo_cfg[2 * k3_config[13] + j]; ac_histo_sum += len_ac_histo[j]; std::cout << "len_ac_h:" << (int)hb_histo_cfg[2 * k3_config[13] + j] << std::endl; } std::cout << "ac_histo_sum:" << ac_histo_sum << std::endl; int len_dc_sum = 0; for (int j = 0; j < 2 * k3_config[13]; j++) { len_dc[j] = hb_histo_cfg[2 * k3_config[13] + k3_config[12] + j]; len_dc_sum += (len_dc[j] + 1) / 2; std::cout << "len_dc_c:" << (int)hb_histo_cfg[2 * k3_config[13] + k3_config[12] + j] << std::endl; } std::cout << "len_dc_sum:" << len_dc_sum << std::endl; int len_ac_sum = 0; for (int j = 0; j < k3_config[12]; j++) { len_ac[j] = hb_histo_cfg[4 * k3_config[13] + k3_config[12] + j]; len_ac_sum += (len_ac[j] + 1) / 2; std::cout << "len_ac_c:" << (int)hb_histo_cfg[4 * k3_config[13] + k3_config[12] + j] << std::endl; } std::cout << "len_ac_sum:" << len_ac_sum << std::endl; const uint64_t num_dc_histo = 2 * k3_config[13] * MAX_DC_HISTO_SIZE; const uint64_t num_dc = 2 * k3_config[13] * MAX_DC_SIZE; const uint64_t num_ac_histo = k3_config[12] * MAX_AC_HISTO_SIZE; const uint64_t num_ac = k3_config[12] * MAX_AC_SIZE; memcpy(dc_histo_code_out, hb_dc_histo, sizeof(ap_uint<AXI_SZ>) * num_dc_histo); memcpy(dc_code_out, hb_dc_code, sizeof(ap_uint<AXI_SZ>) * num_dc); memcpy(ac_histo_code_out, hb_ac_histo, sizeof(ap_uint<AXI_SZ>) * num_ac_histo); memcpy(ac_code_out, hb_ac_code, sizeof(ap_uint<AXI_SZ>) * num_ac); std::cout << "k2 order:" << std::endl; for (int i = 0; i < k2_config[6] * k2_config[7]; i++) { for (int j = 0; j < 64 * 3; j++) { std::cout << (int)order[i * 3 * 64 + j] << ","; } std::cout << std::endl; } std::cout << "k2 quant:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)quant_field[i * k2_config[2] + j] << ","; } std::cout << std::endl; } std::cout << "k2 global_scale:" << (int)quant_field[k2_config[15] - 2] << std::endl; std::cout << "k2 dequant:" << (int)quant_field[k2_config[15] - 1] << std::endl; std::cout << "k2 acs:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)hb_strategy[i * k2_config[2] + j] << ","; } std::cout << std::endl; } std::cout << "k2 block:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)hb_block[i * k2_config[2] + j] << ","; } std::cout << std::endl; } std::cout << "k2 dc x:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)hb_dc[i * k2_config[2] + j] << ","; } std::cout << std::endl; } std::cout << "k2 dc y:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)hb_dc[i * k2_config[2] + k2_config[13]] << ","; } std::cout << std::endl; } std::cout << "k2 dc b:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << (int)hb_dc[i * k2_config[2] + 2 * k2_config[13]] << ","; } std::cout << std::endl; } std::cout << "k2 ac:" << std::endl; for (int i = 0; i < k2_config[3]; i++) { for (int j = 0; j < k2_config[2]; j++) { std::cout << "id=" << (i * k2_config[2] + j) << " "; for (int k = 0; k < 64; k++) { std::cout << (int)hb_ac[(i * k2_config[2] + j) * 64 + k] << ","; } std::cout << std::endl; } } std::cout << "dc_histo_code_out:" << std::endl; for (int j = 0; j < dc_histo_sum; j++) { std::cout << ", " << (int)dc_histo_code_out[j]; if (j != 0 && j % 32 == 0) std::cout << std::endl; } std::cout << std::endl; std::cout << "dc_code_out:" << std::endl; for (int j = 0; j < len_dc_sum; j++) { std::cout << ", " << (int)dc_code_out[j]; if (j != 0 && j % 32 == 0) std::cout << std::endl; } std::cout << std::endl; std::cout << "ac_histo_code_out:" << std::endl; for (int j = 0; j < ac_histo_sum; j++) { std::cout << ", " << (int)ac_histo_code_out[j]; if (j != 0 && j % 32 == 0) std::cout << std::endl; } std::cout << std::endl; std::cout << "ac_code_out:" << std::endl; for (int j = 0; j < len_ac_sum; j++) { std::cout << ", " << (int)ac_code_out[j]; if (j != 0 && j % 32 == 0) std::cout << std::endl; } std::cout << std::endl; free(hb_buf_out); free(hb_ac); free(hb_dc); free(hb_strategy); free(hb_block); free(hb_cmap); free(hb_order); free(hb_quant); free(hb_histo_cfg); free(hb_dc_histo); free(hb_dc_code); free(hb_ac_histo); free(hb_ac_code); } #endif
41.424793
115
0.601468
[ "vector" ]
d65895d8d414c2e3b164c67ff7178530db0e8ca8
8,547
cpp
C++
src/analyses/variable-sensitivity/value_set_pointer_abstract_object.cpp
tobireinhard/cbmc
fc165c119985adf8db9a13493f272a2def4e79fa
[ "BSD-4-Clause" ]
412
2016-04-02T01:14:27.000Z
2022-03-27T09:24:09.000Z
src/analyses/variable-sensitivity/value_set_pointer_abstract_object.cpp
tobireinhard/cbmc
fc165c119985adf8db9a13493f272a2def4e79fa
[ "BSD-4-Clause" ]
4,671
2016-02-25T13:52:16.000Z
2022-03-31T22:14:46.000Z
src/analyses/variable-sensitivity/value_set_pointer_abstract_object.cpp
tobireinhard/cbmc
fc165c119985adf8db9a13493f272a2def4e79fa
[ "BSD-4-Clause" ]
266
2016-02-23T12:48:00.000Z
2022-03-22T18:15:51.000Z
/*******************************************************************\ Module: analyses variable-sensitivity Author: Diffblue Ltd. \*******************************************************************/ /// \file /// Value Set of Pointer Abstract Object #include <analyses/variable-sensitivity/constant_pointer_abstract_object.h> #include <analyses/variable-sensitivity/context_abstract_object.h> #include <analyses/variable-sensitivity/value_set_pointer_abstract_object.h> #include <numeric> #include <util/pointer_expr.h> #include <util/simplify_expr.h> #include "abstract_environment.h" static abstract_object_sett unwrap_and_extract_values(const abstract_object_sett &values); /// Helper for converting singleton value sets into its only value. /// \p maybe_singleton: either a set of abstract values or a single value /// \return an abstract value without context static abstract_object_pointert maybe_extract_single_value(const abstract_object_pointert &maybe_singleton); value_set_pointer_abstract_objectt::value_set_pointer_abstract_objectt( const typet &type) : abstract_pointer_objectt(type) { values.insert(std::make_shared<constant_pointer_abstract_objectt>(type)); } value_set_pointer_abstract_objectt::value_set_pointer_abstract_objectt( const typet &new_type, bool top, bool bottom, const abstract_object_sett &new_values) : abstract_pointer_objectt(new_type, top, bottom), values(new_values) { } value_set_pointer_abstract_objectt::value_set_pointer_abstract_objectt( const typet &type, bool top, bool bottom) : abstract_pointer_objectt(type, top, bottom) { values.insert( std::make_shared<constant_pointer_abstract_objectt>(type, top, bottom)); } value_set_pointer_abstract_objectt::value_set_pointer_abstract_objectt( const exprt &expr, const abstract_environmentt &environment, const namespacet &ns) : abstract_pointer_objectt(expr.type(), false, false) { values.insert( std::make_shared<constant_pointer_abstract_objectt>(expr, environment, ns)); } abstract_object_pointert value_set_pointer_abstract_objectt::read_dereference( const abstract_environmentt &env, const namespacet &ns) const { if(is_top() || is_bottom()) { return env.abstract_object_factory( type().subtype(), ns, is_top(), !is_top()); } abstract_object_sett results; for(auto value : values) { auto pointer = std::dynamic_pointer_cast<const abstract_pointer_objectt>(value); results.insert(pointer->read_dereference(env, ns)); } return results.first(); } abstract_object_pointert value_set_pointer_abstract_objectt::write_dereference( abstract_environmentt &environment, const namespacet &ns, const std::stack<exprt> &stack, const abstract_object_pointert &new_value, bool merging_write) const { if(is_top() || is_bottom()) { environment.havoc("Writing to a 2value pointer"); return shared_from_this(); } for(auto value : values) { auto pointer = std::dynamic_pointer_cast<const abstract_pointer_objectt>(value); pointer->write_dereference( environment, ns, stack, new_value, merging_write); } return shared_from_this(); } abstract_object_pointert value_set_pointer_abstract_objectt::typecast( const typet &new_type, const abstract_environmentt &environment, const namespacet &ns) const { INVARIANT(is_void_pointer(type()), "Only allow pointer casting from void*"); abstract_object_sett new_values; for(auto value : values) { if(value->is_top()) // multiple mallocs in the same scope can cause spurious continue; // TOP values, which we can safely strip out during the cast auto pointer = std::dynamic_pointer_cast<const abstract_pointer_objectt>(value); new_values.insert(pointer->typecast(new_type, environment, ns)); } return std::make_shared<value_set_pointer_abstract_objectt>( new_type, is_top(), is_bottom(), new_values); } abstract_object_pointert value_set_pointer_abstract_objectt::ptr_diff( const exprt &expr, const std::vector<abstract_object_pointert> &operands, const abstract_environmentt &environment, const namespacet &ns) const { auto rhs = std::dynamic_pointer_cast<const value_set_pointer_abstract_objectt>( operands.back()); auto differences = std::vector<abstract_object_pointert>{}; for(auto &lhsv : values) { auto lhsp = std::dynamic_pointer_cast<const abstract_pointer_objectt>(lhsv); for(auto const &rhsp : rhs->values) { auto ops = std::vector<abstract_object_pointert>{lhsp, rhsp}; differences.push_back(lhsp->ptr_diff(expr, ops, environment, ns)); } } return std::accumulate( differences.cbegin(), differences.cend(), differences.front(), []( const abstract_object_pointert &lhs, const abstract_object_pointert &rhs) { return abstract_objectt::merge(lhs, rhs, widen_modet::no).object; }); } exprt value_set_pointer_abstract_objectt::ptr_comparison_expr( const exprt &expr, const std::vector<abstract_object_pointert> &operands, const abstract_environmentt &environment, const namespacet &ns) const { auto rhs = std::dynamic_pointer_cast<const value_set_pointer_abstract_objectt>( operands.back()); auto comparisons = std::set<exprt>{}; for(auto &lhsv : values) { auto lhsp = std::dynamic_pointer_cast<const abstract_pointer_objectt>(lhsv); for(auto const &rhsp : rhs->values) { auto ops = std::vector<abstract_object_pointert>{lhsp, rhsp}; auto comparison = lhsp->ptr_comparison_expr(expr, ops, environment, ns); auto result = simplify_expr(comparison, ns); comparisons.insert(result); } } if(comparisons.size() > 1) return nil_exprt(); return *comparisons.cbegin(); } abstract_object_pointert value_set_pointer_abstract_objectt::resolve_values( const abstract_object_sett &new_values) const { PRECONDITION(!new_values.empty()); if(new_values == values) return shared_from_this(); auto unwrapped_values = unwrap_and_extract_values(new_values); auto result = std::dynamic_pointer_cast<value_set_pointer_abstract_objectt>( mutable_clone()); if(unwrapped_values.size() > max_value_set_size) { result->set_top(); } else { result->set_values(unwrapped_values); } return result; } abstract_object_pointert value_set_pointer_abstract_objectt::merge( const abstract_object_pointert &other, const widen_modet &widen_mode) const { auto cast_other = std::dynamic_pointer_cast<const value_set_tag>(other); if(cast_other) { auto union_values = values; union_values.insert(cast_other->get_values()); return resolve_values(union_values); } return abstract_objectt::merge(other, widen_mode); } exprt value_set_pointer_abstract_objectt::to_predicate_internal( const exprt &name) const { if(values.size() == 1) return values.first()->to_predicate(name); auto all_predicates = exprt::operandst{}; std::transform( values.begin(), values.end(), std::back_inserter(all_predicates), [&name](const abstract_object_pointert &value) { return value->to_predicate(name); }); std::sort(all_predicates.begin(), all_predicates.end()); return or_exprt(all_predicates); } void value_set_pointer_abstract_objectt::set_values( const abstract_object_sett &other_values) { PRECONDITION(!other_values.empty()); set_not_top(); values = other_values; } void value_set_pointer_abstract_objectt::output( std::ostream &out, const ai_baset &ai, const namespacet &ns) const { if(is_top()) { out << "TOP"; } else if(is_bottom()) { out << "BOTTOM"; } else { out << "value-set-begin: "; values.output(out, ai, ns); out << " :value-set-end"; } } abstract_object_sett unwrap_and_extract_values(const abstract_object_sett &values) { abstract_object_sett unwrapped_values; for(auto const &value : values) { unwrapped_values.insert(maybe_extract_single_value(value)); } return unwrapped_values; } abstract_object_pointert maybe_extract_single_value(const abstract_object_pointert &maybe_singleton) { auto const &value_as_set = std::dynamic_pointer_cast<const value_set_tag>( maybe_singleton->unwrap_context()); if(value_as_set) { PRECONDITION(value_as_set->get_values().size() == 1); PRECONDITION(!std::dynamic_pointer_cast<const context_abstract_objectt>( value_as_set->get_values().first())); return value_as_set->get_values().first(); } else return maybe_singleton; }
27.570968
80
0.732772
[ "object", "vector", "transform" ]
d65b76400d3e0337ca8457ffa19ae62d2034eda1
1,661
cpp
C++
utilities/extractlines.cpp
HongjianLi/zinc
16dfb3cb9713d2fd0a02dbf4162a4e66f2ee2548
[ "Apache-2.0" ]
null
null
null
utilities/extractlines.cpp
HongjianLi/zinc
16dfb3cb9713d2fd0a02dbf4162a4e66f2ee2548
[ "Apache-2.0" ]
null
null
null
utilities/extractlines.cpp
HongjianLi/zinc
16dfb3cb9713d2fd0a02dbf4162a4e66f2ee2548
[ "Apache-2.0" ]
null
null
null
#include <iostream> #include <string> #include <vector> #include <boost/filesystem/fstream.hpp> #include <boost/lexical_cast.hpp> using std::cout; using std::vector; using std::string; using boost::filesystem::path; using boost::filesystem::ifstream; inline bool starts_with(const string& str, const string& start) { const size_t start_size = start.size(); if (str.size() < start_size) return false; for (size_t i = 0; i < start_size; ++i) { if (str[i] != start[i]) return false; } return true; } size_t binary(const vector<string>& ids, const string& id) { size_t s = 0; size_t e = ids.size(); while (s + 1 < e) { const size_t mid = (s + e) / 2; if (id < ids[mid]) { e = mid; } else { s = mid; } } return s; } int main(int argc, char* argv[]) { if (argc != 3) { cout << "extractlines 16_prop.xls 16_p0.0.0.csv\n"; return 0; } vector<string> lines; lines.reserve(1000); string line; line.reserve(200); // Read 16_p0.0.0.csv ifstream csv(argv[2]); while (getline(csv, line)) { lines.push_back(line); } csv.close(); const size_t num_lines = lines.size(); // Read 16_prop.xls ifstream xls(argv[1]); getline(xls, line); // Filter out header line. for (size_t i = 0; getline(xls, line) && (i < num_lines);) { if (starts_with(line, lines[i])) { cout << lines[i]; size_t s = 13, e; for (size_t j = 0; j < 9; ++j) // 9 properties, i.e. MWT,LogP,Desolv_apolar,Desolv_polar,HBD,HBA,tPSA,Charge,NRB { e = line.find_first_of('\t', s + 1); cout << ',' << line.substr(s, e - s); s = e + 1; } cout << ',' << line.substr(s) << '\n'; ++i; } } xls.close(); return 0; }
18.662921
115
0.605659
[ "vector" ]
d65ebf24f78eeffd4df2d9dd00f292462357d5ff
5,436
cpp
C++
B2G/gecko/xpcom/tests/TestExpirationTracker.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-08-31T15:24:31.000Z
2020-04-24T20:31:29.000Z
B2G/gecko/xpcom/tests/TestExpirationTracker.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
null
null
null
B2G/gecko/xpcom/tests/TestExpirationTracker.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-07-29T07:17:15.000Z
2020-11-04T06:55:37.000Z
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdlib.h> #include <stdio.h> #include <prthread.h> #include "nsExpirationTracker.h" #include "nsMemory.h" #include "nsAutoPtr.h" #include "nsString.h" #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsComponentManagerUtils.h" #include "nsXPCOM.h" #include "nsIFile.h" #include "prinrval.h" #include "nsThreadUtils.h" namespace TestExpirationTracker { struct Object { Object() : mExpired(false) { Touch(); } void Touch() { mLastUsed = PR_IntervalNow(); mExpired = false; } nsExpirationState mExpiration; nsExpirationState* GetExpirationState() { return &mExpiration; } PRIntervalTime mLastUsed; bool mExpired; }; static bool error; static uint32_t periodMS = 100; static uint32_t ops = 1000; static uint32_t iterations = 2; static bool logging = 0; static uint32_t sleepPeriodMS = 50; static uint32_t slackMS = 20; // allow this much error static void SignalError() { printf("ERROR!\n"); error = true; } template <uint32_t K> class Tracker : public nsExpirationTracker<Object,K> { public: Tracker() : nsExpirationTracker<Object,K>(periodMS) { Object* obj = new Object(); mUniverse.AppendElement(obj); LogAction(obj, "Created"); } nsTArray<nsAutoArrayPtr<Object> > mUniverse; void LogAction(Object* aObj, const char* aAction) { if (logging) { printf("%d %p(%d): %s\n", PR_IntervalNow(), static_cast<void*>(aObj), aObj->mLastUsed, aAction); } } void DoRandomOperation() { Object* obj; switch (rand() & 0x7) { case 0: { if (mUniverse.Length() < 50) { obj = new Object(); mUniverse.AppendElement(obj); nsExpirationTracker<Object,K>::AddObject(obj); LogAction(obj, "Created and added"); } break; } case 4: { if (mUniverse.Length() < 50) { obj = new Object(); mUniverse.AppendElement(obj); LogAction(obj, "Created"); } break; } case 1: { obj = mUniverse[uint32_t(rand())%mUniverse.Length()]; if (obj->mExpiration.IsTracked()) { nsExpirationTracker<Object,K>::RemoveObject(obj); LogAction(obj, "Removed"); } break; } case 2: { obj = mUniverse[uint32_t(rand())%mUniverse.Length()]; if (!obj->mExpiration.IsTracked()) { obj->Touch(); nsExpirationTracker<Object,K>::AddObject(obj); LogAction(obj, "Added"); } break; } case 3: { obj = mUniverse[uint32_t(rand())%mUniverse.Length()]; if (obj->mExpiration.IsTracked()) { obj->Touch(); nsExpirationTracker<Object,K>::MarkUsed(obj); LogAction(obj, "Marked used"); } break; } } } protected: void NotifyExpired(Object* aObj) { LogAction(aObj, "Expired"); PRIntervalTime now = PR_IntervalNow(); uint32_t timeDiffMS = (now - aObj->mLastUsed)*1000/PR_TicksPerSecond(); // See the comment for NotifyExpired in nsExpirationTracker.h for these // bounds uint32_t lowerBoundMS = (K-1)*periodMS - slackMS; uint32_t upperBoundMS = K*(periodMS + sleepPeriodMS) + slackMS; if (logging) { printf("Checking: %d-%d = %d [%d,%d]\n", now, aObj->mLastUsed, timeDiffMS, lowerBoundMS, upperBoundMS); } if (timeDiffMS < lowerBoundMS || timeDiffMS > upperBoundMS) { if (timeDiffMS < periodMS && aObj->mExpired) { // This is probably OK, it probably just expired twice } else { SignalError(); } } aObj->Touch(); aObj->mExpired = true; DoRandomOperation(); DoRandomOperation(); DoRandomOperation(); } }; template <uint32_t K> static bool test_random() { srand(K); error = false; for (uint32_t j = 0; j < iterations; ++j) { Tracker<K> tracker; uint32_t i = 0; for (i = 0; i < ops; ++i) { if ((rand() & 0xF) == 0) { // Simulate work that takes time if (logging) { printf("SLEEPING for %dms (%d)\n", sleepPeriodMS, PR_IntervalNow()); } PR_Sleep(PR_MillisecondsToInterval(sleepPeriodMS)); // Process pending timer events NS_ProcessPendingEvents(nullptr); } tracker.DoRandomOperation(); } } return !error; } static bool test_random3() { return test_random<3>(); } static bool test_random4() { return test_random<4>(); } static bool test_random8() { return test_random<8>(); } typedef bool (*TestFunc)(); #define DECL_TEST(name) { #name, name } static const struct Test { const char* name; TestFunc func; } tests[] = { DECL_TEST(test_random3), DECL_TEST(test_random4), DECL_TEST(test_random8), { nullptr, nullptr } }; } using namespace TestExpirationTracker; int main(int argc, char **argv) { int count = 1; if (argc > 1) count = atoi(argv[1]); if (NS_FAILED(NS_InitXPCOM2(nullptr, nullptr, nullptr))) return -1; while (count--) { for (const Test* t = tests; t->name != nullptr; ++t) { printf("%25s : %s\n", t->name, t->func() ? "SUCCESS" : "FAILURE"); } } NS_ShutdownXPCOM(nullptr); return 0; }
26.517073
79
0.623436
[ "object" ]
d661f149a1e835c054d3b3263d507e55da4a44c9
19,004
cc
C++
tests/sdglib/files_tests.cc
KatOfCats/sdg
1916e5c86dd88e601ab7476f38daef2bd3b3b6fc
[ "MIT" ]
null
null
null
tests/sdglib/files_tests.cc
KatOfCats/sdg
1916e5c86dd88e601ab7476f38daef2bd3b3b6fc
[ "MIT" ]
null
null
null
tests/sdglib/files_tests.cc
KatOfCats/sdg
1916e5c86dd88e601ab7476f38daef2bd3b3b6fc
[ "MIT" ]
null
null
null
// // Created by Luis Yanes (EI) on 23/08/2018. // #include <catch.hpp> #include <sdglib/readers/FileReader.hpp> #include <sdglib/workspace/WorkSpace.hpp> #include <random> #include <sdglib/datastores/ReadPathsDatastore.hpp> TEST_CASE("Workspace create, read, write") { // Long reads std::string Lr_filepath("../tests/datasets/workspace/long_reads/long_reads.fastq"); std::string Lrds_output_path("long_reads.loseq"); LongReadsDatastore::build_from_fastq(Lrds_output_path, Lrds_output_path, Lr_filepath); // Linked reads std::string lr1_filepath("../tests/datasets/workspace/10x/10x_R1.fastq"); std::string lr2_filepath("../tests/datasets/workspace/10x/10x_R2.fastq"); std::string lrds_output_path("10x.lseq"); LinkedReadsDatastore::build_from_fastq(lrds_output_path, lrds_output_path, lr1_filepath, lr2_filepath, LinkedReadsFormat::raw); // Paired reads std::string r1_filepath("../tests/datasets/workspace/pe/pe_R1.fastq"); std::string r2_filepath("../tests/datasets/workspace/pe/pe_R2.fastq"); std::string prds_output_path("pe.prseq"); PairedReadsDatastore::build_from_fastq(prds_output_path, r1_filepath, r2_filepath, prds_output_path); WorkSpace out, in; out.sdg.load_from_gfa("../tests/datasets/graph/tgraph.gfa"); out.long_reads_datastores.emplace_back(out, Lrds_output_path); out.paired_reads_datastores.emplace_back(out, prds_output_path); out.linked_reads_datastores.emplace_back(out, lrds_output_path); out.add_kmer_counts_datastore("kctest", 31).add_count("prtest", out.paired_reads_datastores[0]); out.add_operation("test","test","test"); out.dump_to_disk("workspace.bsgws"); in.load_from_disk("workspace.bsgws"); REQUIRE( out.kmer_counts == in.kmer_counts); REQUIRE( out.journal == in.journal); REQUIRE( out.sdg == in.sdg); ::unlink("10x.lseq"); ::unlink("pe.prseq"); ::unlink("long_reads.loseq"); ::unlink("workspace.bsgws"); ::unlink("kctest.count"); } TEST_CASE("Long reads datastore create, read, write") { { std::string lr_filepath("../tests/datasets/workspace/long_reads/long_reads.fastq"); std::string lrds_output_path("long_reads.loseq"); LongReadsDatastore::build_from_fastq(lrds_output_path, lrds_output_path, lr_filepath); } WorkSpace ws; LongReadsDatastore ds(ws, "long_reads.loseq"); ReadSequenceBuffer bufferedSequenceGetter(ds); std::string read1("AAAAGAGAGGCAAGCCAAAACGGCGCGCCCAAGTGAAAGGCGCCGACGTCCGTCGACTAAGAGCCCCATAGTAGGGGACGCGCCAAGGTACAGGGCGCCGACTAAGACCAACGTGAAGCGCCGACTCAAGCCCACTTTCATCCAATGTGTCCCACGCAAGCCGAGACGCACAACCATGTGTCGATTTCAATGGAATTCAGTATACACTAATGTCCTCATAGCTCTGAAGGGTGCACAGATGAAGATGCAAATAATGCGTTACCTAGGTGATTGCGTGACACCGGACAATTGAAGTAATTCAACCGGTTATATTGCTTATTCCTCTTGCGAAATAACCTTGGGGGACCTCTTTATGAATCTCCACCTGTCAGCAGATGCGACAAATATCTATTGAATGATTGGGAGCGGTTCAATGCCTCCTAATGTTCAGGTAAAATTGGAGCAGACTGATGGTACTATTACAAACTTTTAACATCAACCAACAAGTTGTGCCAATAGATAATGGAGCAGATATTCGGGTACCATCGATCGGATGTCCAGAATTGTCCTTATCTGGATTCCCGGATCAGGCACAGGAGCAACTGTGATACCGGAACAGCAGCAGGATTCCGATCAAGTACCGATGGTCCTGTGCTCCATGGGATGCTTCGGTGAACTTGGCACGCCAGGTTTCAGCCGGTTCCTTACAATCATTGATTACAAATCGGAAGGATCCATGACTAACTCCGGAATGTGGATAAGTCACACGGAGGTACTTGTCCGATGTATTCGCGAGATCTGGCTGTATCTTTGAGTTTTAATTGAAGTTGATTTCCGTACATGGTAAGAAAACAGGGTAAATCCCGTTAATAGAACACAAAAACAACATTGCAAATAATTATCTATATAATCAAATAATGAGCAAGCGAGTGACGAGCATAAGATAAAAATGAAATAATAAGAACAAGAACAGAGAACTGACAAAATATAAAGAATCGGCAACAGTGGTCGTCTTCGGCAAGATTACTAACAGAAAATACAACGCACGCATGCATACATAACATAACATAAAAATATCGGTGAGCAAGGGAGCTCACGCAGGGGTGGGTGTGCATGCATGCATCATCATCAAAAAGTGTGGCTTGTTTTGTGTTTGATTGTTCTTCACAACCACACTCAACTAATTGTAACATACACTGATACTGTCATAATACATACACATATTTCGCTCTACAAATTATAATACTCTGATTCGTATAATATAACTGTAATAAACACATAAAATGAACTTATTCTATTAATTAGATGCTCTGCTAGCTCTACCTACTAACGAACTGCTGACTCACTAAAAGTAGATTTTAGATCAGAACCTGAGATATTCTTTTTGGAATATTGACTTATTAGCACTTAAGCATATTATAAAGCATTCCAGCTTATTTAGGATATGTGTGTGTGTGTATATAACATAAATAGATACAAGGAATGTTTAGATATCCACATCGTGTTTGAATAAGAAAGTTCCAACATATGGAGAAATAGGTTTTAATAGACTGTTATGTATGTCGCTTCCATTACTCCGACTTCTGTATTTTCTTGTCGTCGAGCTTTCTTGTACTCCTCGAGCTGGTTTGATATAGTTAATGAGAATTAAGAAACAGGAGGTCTTAGTGGCAGACGCAGTCTTTTAAAAGCGGGACACACGTGTTTCAAAGAGAATTCTTGATACCGAAAAGCTTAGGTAGCACATTTGTAACGTGGTTCACCCCCTTGATGAACACGGACGTAAAGAAGATATACATAGTCGGCATTCCAATCCCTTGTAGTCACAACTATGTGCGTGACCTGCCGATGCTCGTACGAAAAATGGAAAAGCTGTGGGATATCATCAAGCTTATTGGTCTTCTTCTTCTCCGCCTCCGCTGTCTTCCTCCGTCATCACTCGTCAGATCTCAAAAGAGGGAATGTTCCAGGTATGTTCCATTACGTTCGAAAGATTTACTATTGTGTACTGTTGACGACAGTAGCTGTACTCGACGCACAGACGTGCTGTGTTGTTCCTTTAGCTTTGCATCGAGCTCCGGTTACTAGGCCGGCCTGATAAAATTTATAGTCTAACACACCCACTAGATGGTTGTCTTTAATGAAGCGTGACTGTCCATTCTCTCCGGTAGGGATTTGGAGACTTTCGTGAATGCTTTAGCAGTGTTGCTGCATCATAGGTTCGGCAAATTTTTCATGCATTTTCGGCCTTGATGGTTGATTTACATTTGCTTCTTTTGCCACCAACGAATCCCCACGTTGTGCAGTATTTGACATAGAGCCTCTGGTGGGAAACCGATTGGTCCGAATTCTGTGCAACAAATAGAAAATTCTCGCTATTTCATATGAGTCTCATAAAAGAAACCCATTGCCAGCGAAGACTACTTTTCACAATTTCCTGTAAGCCGTATTGATAACTTTGTGCTCGTCATCTTGAAAATGAAACTTCCAGAAAGTCAATACATGCATAAATATCTCCATTTTCTCCGAGGTTTCTTAAAGTAGGGTCAACTTTTTGGTTTTACGACACTTATGGATCTAGCGTGAGGGAAGCATGATGTCACCTCGGTTCGGAGTGGTAAAAGAGGACTGCTGACAGATGAAAATGCAGTCTTGAGATTTGCGGCATTGAGGCCAATGTTTGGAATATTCCAGAGGTAATATTCTGCATCTTTCGAGGATCCTAAAGTCTCTTTAATTGGTCAAATAGCAGGGTGCGAAAGTCACCTTATCACGACAAATACTTGAACGATGGCTTTCACTCTATTGCACAATCTTTTACTAATTTTCCATTCATACATTTTCTACAATCACGCCGATCCTTTTGAATGTATGCTGCATCTTTGGTCACTTTCGATCTATATCGAAAATTTGAATACCGTGTTCAACATTTATACTGATTGATGCTGGGGCTCCATCTGAGAAAAGAGTAGCAAAAACACAGATGCGTTCGGAGCATCGTGTCCATCACCTCCAGCCTTATCAATGCTGGAATGTAGAATTACTCCGTGAGTTTTGTCTCTTTTTGATAATTGTTCAAATGTTTTGATAAATGAATCATCAATGGTTTGGTCTATCACACTTGCGTCGTTGCTCATGAATTAGGGTACACAATCATCGCTGCCCATTTCATTGTCTCTCGAATCTTCTTCAAACATGGTAAATAACAGCTTGGGCCTGACAGTCTGATGCACCGCAATGTGAGGCGCTATCAACAATAAAACGGCATAAACCTTACCGCTATACTTGCCAGTGCTATTTGTACCTCTTCATCTAGCTCTCTCATCGCCAAGATGTACCTTCATAGAGAGAGGTTTCGTCCGTGATATAGAGTCACACCTCATGTGTTCGTAACGCCACCGTTTGGAACATCAGTCTGGATTGCGATTCCTTTCTGCGTGTCTTTGATTGCTGCCTGTAGTTCTTGTTTTCAATATTTCCTTTCTTATCTATGCATATAAGATGAATGACAGTTTGCGTATATTTGTTATTTATTTTTTGAAAAAGTGAGATGGACAACGAACAGATTCAATTTCAATCTGAGACAATTATGAAGAATAGGAAGAACAACATTGTTTCGTAGAATCCCCACATGCAGGAGAAAAAGGAGACGAGAAAAGACACCTTCCATTTTGTTTTGATGTCGATTCGTTCGAGATCTGCTAGTCGAGTCGACTCGACTCGTAATTGTCGAAGAATGAAATCACCTCGCCGTTGCGTCTGACATGAGAAATTAATGATTATATCCTCGGTCCGAATGAAGTTGAATCTGTTTTGCTCGAAATGTTTTTATATAGGTCTGGTGCTTTCCGAAGAAGCGAATTCTTTCGATCGTCTTTTTTTTTTTCCATCAATATTTAATTCCCGGACCAGCCAGTGTCATCAGTAATCAGGTAGGTTGTCTGTGAATCAATCAATGTTACTGCGATTCATTGCATAGTAAGGACCATTCTCAAGAACTTCCACGTATTTTATAGATGTAGACACGACTTTGGCAACAAGTTTGACTGATCTTTTGATGATGGATGTTCTTACATTTCACTCTATTCCGTACGCCTCTAACTTAGGTGGTGGAACAATAGGGAGACTGGAATATCCTCAAGATTCAGGACAGAACTATACGAAGGCAGAAGCCAGATTCTAGTTGTATGCCCTATATCCCGCGTATTAAGCTCAATAGTAGCTTCAAGGTTACGAAAGAATCACGAAGATTGATAACTGCTAGTATCCGCATGATGGTAGAATAACAAATGAAAATATATGAGAGCAGCGAAATTTTCATTGGTGTCGCTACCAGCAAGTTAGATTGAATGTTTTGCTTGTTTCACATACCGTAAAAGCAGATTATCATATTTGAGTTGCGGGTTGTGGTGTGGCTGTGTGTTGGCTGTAAAGACAGGGAACGTTGTTTTCCGATCAATTTCGACTGGCAAAAATGTTGGTTAATGCATATCGTATATGCCATAATCAATATTCAACCTGTAAGATCGTATCGGTACAGGTTGTGTCGGATTTGGTCTAGGGTCGCGCGCGAAGCGGCTTTAAGTTTACTTCCGGTAAGACACGCATAATTACGAGTGATTCCTGACGAAAAATTTCAAAATCTCATTTTTTTTTTAAATTCTGTCGATTGGGTCAATTGTACGGAATCTTAATTAGGTGTTTAGCGTGCTTGTGTTTGCCGTGTTAATTTATAAGACGATAATAGCTACCGTGCTACTCGGTAGCGCAAATGCGGTGCACGGAGAAAGTACTATACATGGTAGGTACGGTATTGAGTGCGGAAGGATTGTATGCAATAGTCAGGTATCGCAAAGAAAAGTGCAAGAAGATGGGCGCTCCCGCCGCCCTTGGTTTGAAAAAAAAGCAATTGCGCTTGCCTTGGCGTGAGGCAACTAAGGCTGGTCATTGGGAACTGAAAAAAATCTAAATATCTAATACGGTATGTACCGCATCACAAAAAACTTACTGACTTGCCAGCATGTCTGTAATGCTTACGTACATGTAACTCTACAGTACTGGGTACTACTGTAACTGTACTGAACCAGCCAACAGAAAAAAGGAAGGGAGATCGACGGCTATAAACCGGACGAAGCAAGAGCAAGGAAAGATCAATCAAGATTCAAATGACAAATTCAGGGATATATTATTTCCATTATGATGCATATATTAAATAAAATGATTGCATCATACAAGTATATTTATTTTTCAGCTTGACTAATTGAAAAAGAGTATTGTTTAGTCCATAGATCCAATTCTAATGGATTGTTAGTGAAAAACACTGATTTTAGTATAAAATTATAATCATGTATTTGATAATCGATCCAGAATGAATCGTATATGCACCATGTATCGATGGCAATTCTTGTATGTTTAGTTGATCTTTTTTATGGCTATAAAAACGGATGGAATAAGACGTGAGTAAGTAACATGTTATTTTAGACCAGTTAATAGTACCAAGCATTATTAGGTTTGTAAATTGATGCAAAGTTTTAACCATTACATGGATTTACGTTGATACTCCAAAAGATCATTATTGCATATTGTGTTAAGTGCAGAAGTCCTATTTAATATCATTGTTAGTATAGTTAAGTATGATTCTGCTACTGACAGATTGCAACTGCAACAACTATGTAAGTGCATCGCGTCGGCTGCATCACGAATGCGAACAGGAATGATTTACATGCATTATTAAGGGCTTGTACGAGATAGAGAGAAGAAAATGGATTGCTGAATGAAAAAATAGTAATGAAATCTTGAGAGATTAATTACTAGCCTTACATCGATTCGTACGTACAGTAGGTATGGTCGAGATCGAATATAATAATTGCTTGTAAAGATTGAATTTTAATAAATGATTTATTTTTTTGTGGATAAATTCTTTCATATTGTTATGTTATTTAATGTTATGCGTTGAGTATATGTAGTGTGGCTTTTCCTTTGTTTTATTCTGTTTTATTCTTTTTGTGAGTGGCTTTTTTTGCATTTCTTTATGTATTCTATTAATATAGTGTGAAGCGATTCTTTGTTTAATCATTGTGGTCCTTGTTGTTTTTTGGTCGAACTTTACCATCTGATCAATGGTAGTTCTATGTGTGTGTGTGGTGCGTGTGTGATTGATGGTAATTTCATTTGATATTTAGTGAGTGTCGAGGACTTGTTGACTTGAGGCTTTGCCTGTGCTTCCGATCACAACGAGACGGGTGTCATTCTAGTATTCATTCGTAGCGTAATTTTATTTTTCCGCATGTAATGAACGGGCATATGCTGTAGCACAAAACAAAAAATTGTTTAATCTTAATTGATTTAATCCGTTGTTGAATCTGTAAGAGACCACAGACCTAACACGCCGTACCCAATCGTCCCACCATAATCTCAAAAGTCTCAAAGCAGATCAATGAATCATTACACGACGCTCCGCCAAGCCTCAGTATTCGTGCCACCTCGCGTTGTTCCACACCACATCATTTATCAAACAACGACCAACACCACGACGCTCATACTTCGACTCACGCAGCGCGTTGGTCTTCCACACCCATCATAACATTTCTCCTCACCATATCATGTAGTGCATTTCACACCAAGACCATTAAGATAAGGTCTATCTACAACCCTTATTCTTCTTTGTCGGTAGCTCTCAATATATCCATCATTATCATAGCACCACCTTCCTCTATATATATTCCTCATATCGAACTCATTTAGATAATCATTCATGTTTTTGGTTTGATCTTTGAATAACCAACAGCACGAATTTTAGATGAGACACCATTATATACACTGGAGAAATGGAAAATGGGAGAGATAAATTGATAGAGAGAATACCGAGAAACAAATTCGGGTCAGACAAAAACACAGGGAAGATTTTTAATAGACAATGTTTATTTCAATTATTTACCTTTCCTTAGAATTGTTCATCTTGATAACCCACCACACTGACCGAATTCTTCATAGGCATCAGGATCGACGTCCCATGCATATCTGTTAAAGTCACTCCCTACCACGGACCACACCATACGATCACGTGCACCTCACCAAGACGACTTCCATATCCTAAGTCATAGGTCACGGCGGTCTTCCTCTTGTTCAGTTCCAGTCACACGTTCAATTCTTCAGATCACCCATTCTGGAAAAAAATCATTATTATTTGACCACTCCATGCCACCACCCATATACGTCTCCAGATCTCCATATAAGTTGTTGGCGTCCACGTGCACGGATCGACATTTTCACGACTTACTCGATAGAGGCGAATCTTGGCATCGATCGACCATTCTTGGAGGATCATCCAACCATTGATGCCATGCGTGTGGCTCGTGGTGTGTATATTTAACCGGTACCTATTTAAATTACAGCGAATAATCATAATAACTCAGCAATGATATCACACAACGCACTACCTCCATGGACTTCACCGCACACTACCTCTTCGAGCAATATGCTGAATGATGTTGTTGTTTCTAAAACTTAGACTGACAGTGGTGATGATGGATTGTGGTTTTAAAAGCAACAGCGTTGTTAATGGTGATATTATTATGAGTCAGGCAGTAGCAGAGCAATTTAGGCAAGATAGCTGTCGTGTTCTTCAGGACATATATGGCTGTGGATCTTAGTCTTTTTTTCTTTCATGATTTAGAATTTAAATTTAAAGGATAACGCTAGTACTGTATGTCATGAGAGGTTATAATATGTGTGATGTTGTCTTTTTCTTTGCTGTTCGTTCAGATTGAGTTGACTCTCCTCGACTCGTTGCTTCTTCTTGTGTTGGTTGGTGTCTTTCTTTGTTTGTGTGATGCCTTTCTTTTTCTGAGTGGATGAATGGAAATCGAGCAGGTGTTCCTAAACCAGGAAGTGCTTTACGGATATCGAACACGATTTATTACACAAAGCACAAAGGGGAAAGGTACATACAATAATAGGAGGCGCGAAGGTAAACACACGATAATACCGGCACGGAAATACGATACAAAAGTTTTTGGATCTGACTTTTTGATTGGATATAATTTTTGAATATTCAAAAATTGAGTAAGGCTAATAGCAAGTCAGCCAGTAAGAAGAGTCGAGCAGAAGAAGCATAGGGGAAGTGAGTCTTGGAAGTGAGTCGAGTCATGCAGTAATCTTCTGGTTCGTGCTGGCGTGGTAACGCGTCGTATGACTGGTATGTTCAGTACAAGAAGGAATGGTAGAATGATAACTCTAGCGTTTTACGATATGACCATACATCTCTCATATCGAAACTACGACACGATTAACATCTGGTGTGTGTGTGTGTCTGCGTGTATGTGGTTCTTGCCGTGAATCATGTGTTACTATGAAGCAGAAGGAGTACGAAGAGCTTGCGTGTGTGTCAATGAAAAAATATTAAATATTAAAATTGATTTTAACAACACGGAAATACGAAGACAATCTAGATAGTTGTTTTTGTTTTTTCTAAAAAAAGGCATTATATTTTTTTTTAGTAGTCTATTAGTTGCATCTCTGCCGTGAAAGAGATCCAGCATATTTACCTATTTACCAAGTGTATGTGCGCCGGTGTAGTGCATTGTTGCGGTCGTAAGGTGTATGATCCAGTAAAAGCATAGTGGGTGGTGTATGTTATTTACACTACCCATCGATTTCCTTTCTGATTCCATCATAAAGTAAGATGTCTTTTGGTATTATTTATTACACCACATACGCCATCCCTTTTTTTGGAAAGACGACGGATCGAGCTAGCAGCCAACAGTAGTATATCAACATCAGGTCCCTTCTTTTGAGAGTGGTAGTTGACGCAGGGGATGGCACATGCCACAGTATATAAGCGTAATCGCATCGTTGATCTACTCTTTTGTTGTGCTAGATTTAAGGATTCCGGTAATCATCACGTATATCATCAGTACAGATAGTATGTAACCATTATACTACAAATAGTTGAATGTTGTTGAGCGAACTGTCTTAGAGGGTGTTGGTGGTTCGAGATAATAACTTCGTGATGTTTTATATTGGGAATATTCGACGAGTTTAATAGACCAATGATGTTATATTCGGCGGCTGCTTTGCTGCTGCTTGCTTGTTGACTTCCATTCTTTCTTCTTCTGATCATGAATCTTAAAGTTGTTTTTTTGTCAGA"); std::string ds1(ds.get_read_sequence(1)); REQUIRE(ds1 == read1); std::string read300("AAACCTCGTTAAGAAAATAGTTTTGGGATTGTGTGGTTTTTGGCTTTGGGCCCTTTATGTCTAATTAATTGTATCAAAAAAATAGAACGAAAAATCATATATTTTTCTGACCCTGCCGCGCCCCAAACAATTTTTTTTAAACAAAATCAGTGACAATTCGTGGGGAAGTTGATCTTATGTCATTTAAACATGCAATATTCCATTGAGAAAACCCAACTAACTGGTAAGTTGTACCCTCATCTCCGTCATCTCATGGTATGTAGTAGGTGACAATTTACCGTACGGAATAGAACAAGTAGCATTCAGTTTACGTAGTGGTGCATGAACACTGTAGTACCTTATGCGGCAGTCATTTGTTTATTAGTCTTATCAACACAAACAAACTTAAGCAACAATACCTATGATGAAAGCAGACAATTACTTAAATAAATTCTTGAAAGAAGCAGTTACAGGATAAGCAAAGCATAAAAATATTTGTCTCAACAGCACTACAGTAGCGAATACCAAGTGGATGGCCCTGAAATAGGTAATACTCTAATTTGAAAGCCTTAGACCAATAGTGAATCTCATTATTGCAAACGATCGCTCAGGGCCAGTCTATCTAATAGCTTACACAGCAGAGTGTCTTGTCACAGAATTGTCCTTATAGCCTCTAGTCAACCAAAACTTGGGTACGAATTCAGTTTTGTAGAATGTGATCCAGACCTTAAATAAAATAATCTGGCACCTCTATGCATGCTGGGTTTGAGTCCGTCATTCTCCATTTTCCCCCTTACATTATAAACTACATGGTTAATTTTTCAATTCATCGGATGATCTACTGTTGGTTTTGTTTGGAATGGGAGTGCATTGGTACAAATGTCAGCAACAAGACTAGTTAATTTGGAGAATTGAGGAATGAGAGAACGTTTGTGCAACAGGATAGGACGAAATAATACAGGTGCAACAAATGAAAAATACACTAACAGACCTTGTCGAAATCATGGGTTCGGTTAACAGATTCCAGTTATGGCTCTCAGCTGAAGAGGCCACTTTTTTTGGGGTCAATTTTTTTTGTGGGGTGAATTTCTCAAAAAATGGACTTACACCCCCCTTTGGAGACCAGCGCAGTCTCCGAAGTCTAGGGCTACGGGTCTTTTTATATACTCAATTATGGAAGTCTCGTTGCTTTGTGATGGGCCGCACCTTAACCAGCGTAATACGGGCAAAATTAAATTCGGCTAAAGCCCATAGTAGGGTAATATTCGCGGTGAGCGTTGGGGATTGAACCAGTGCAATGTGTTAAAAGCAGCTGAAATATCTAAGTGAATTTCTGCGGCGATTTTTTTAATTTTTAAAAAACTCAAATAGTTGTTTAATAAAGACTGAGTAAGTAGTCAATGTAATAACTTCGGTATTGTGGTTGAGTTGGCACTGGCCGCCAGCGCGGCTTGGAGATAGGTCCTCGTTTCGATCACTTCCGATGTAATACATATTACTTTGTATAGTATACTTTTAGTTATATCAGGCTTGCAAAGATTTCATTTTTATCTATTTTTAAAGCAAAATACTGCGTGTTATGTAACACGCGTAAAATCTCCGAATAGAATTCCTTATAAAGGAACCTGTTAATGGTTGTCTTCGCATATCTTGAGGAGGAATGGAATGGGTCTCAGCTTGTCATAGTCAATGCATCACGTTCTTATATAATATTCAATGAATTTTTTGTTATTAATCCTACGGAAGCCAGTGCCTTTTGCGGGAAAATTATCCGAAAAAATCATATAAGGATATGAGTAAGGATGAAACAATACTCATACAACAAAATTAATGCCCAAATGCAATGTGAATGGAAATATCTATTTGTGGGATTTATAATATACGGTGTTAGTAGATAATTGATAATAATGTATTGCACTGGTACTGTTTTGCCTTGTTGCTTTGTGTATGCAAATAGCAGTATGTAGACATGATTAGTCATACATTTGATATCAGATTGCCATTTGATTGGGGATCCGGTTTTTTGAATACACCAAGTCCCTCTCCGTAAATATGAGATGGATTGTTGAATCACGCCATTTCTTTGTCGTATTATGTCAACAATTCAAGCTATAGAATTTGGTGTATTACCCGATAAAAAACGCGTTAAGTTGCAGAGAACTATTGCGGGAAAGATGAAAATTCCGAGGGCAAATAGAAGTAGATGACAACATTATGTAAGATTGACACATGAAGAGATAAACCGAAATCCCTCACCTGTGATAAACACAAAGGAGTTTGGAAAATAAACATCATAAATACTTTTGATATTTAGCAAAATAATTATACGCACATATTCTGCACTGTTTCCTCTTGGTTGCTTACACATTCGCTGGGATTCAATTCCCTGCCAACTCTTCCCAAATTTTTCCTAGGGGGCTCTTTCATTCATGTATAAGTTTTTACAGCTTATTACACATAGGTTGCGGCCCCATACAAGAGCAATGAAAGGACATAATATTGAATAATAGAAAACGACACTGCCTTGAACGGATGAGATGGGACGCTAATGTCCGATTTTTGGGGGGAGTAAACATCCCTGG"); std::string ds300(ds.get_read_sequence(300)); REQUIRE(ds300 == read300); ::unlink("long_reads.loseq"); } TEST_CASE("10x reads datastore create, read, write") { { std::string r1_filepath("../tests/datasets/workspace/10x/10x_R1.fastq"); std::string r2_filepath("../tests/datasets/workspace/10x/10x_R2.fastq"); std::string lrds_output_path("10x.lseq"); LinkedReadsDatastore::build_from_fastq(lrds_output_path, lrds_output_path, r1_filepath, r2_filepath, LinkedReadsFormat::raw); } WorkSpace ws; const LinkedReadsDatastore ds(ws, "10x.lseq"); ReadSequenceBuffer bufferedSequenceGetter(ds, 128*1024,260); //random number engine std::mt19937 gen(10); // Always using same seed to get same results std::uniform_int_distribution<> dis(1, ds.size()); std::array<uint64_t, 50> reads_to_check{}; for (auto &r:reads_to_check){ r = dis(gen); } const char* seq_ptr; std::unordered_map<uint32_t, size_t> read_sz1; StringKMerFactory skf(15); std::vector<std::pair<bool, uint64_t>> read_kmers; for (const auto &r: reads_to_check){ read_kmers.clear(); seq_ptr = bufferedSequenceGetter.get_read_sequence(r); skf.create_kmers(seq_ptr, read_kmers); read_sz1[r]=read_kmers.size(); } bool equal=true; uint32_t it=0; int i=0; for (i = 0; i < reads_to_check.size() and equal; i++) { seq_ptr = bufferedSequenceGetter.get_read_sequence(reads_to_check[i]); read_kmers.clear(); skf.create_kmers(seq_ptr, read_kmers); if (read_kmers.size() != read_sz1[reads_to_check[i]]) equal = false; } if (!equal) { std::cout << "Failed during iteration " << it << ", on read " << reads_to_check[i]; } REQUIRE(equal); ::unlink("10x.lseq"); } TEST_CASE("PE reads datastore create, read, write") { { std::string r1_filepath("../tests/datasets/workspace/pe/pe_R1.fastq"); std::string r2_filepath("../tests/datasets/workspace/pe/pe_R2.fastq"); std::string prds_output_path("pe.prseq"); PairedReadsDatastore::build_from_fastq(prds_output_path, r1_filepath, r2_filepath, prds_output_path); } WorkSpace ws; const PairedReadsDatastore ds(ws,"pe.prseq"); ReadSequenceBuffer bufferedSequenceGetter(ds, 128*1024,260); //random number engine std::mt19937 gen(10); // Always using same seed to get same results std::uniform_int_distribution<> dis(1, ds.size()); std::array<uint64_t, 50> reads_to_check{}; for (auto &r:reads_to_check){ r = dis(gen); } const char* seq_ptr; std::unordered_map<uint32_t, size_t> read_sz1; StringKMerFactory skf(15); std::vector<std::pair<bool, uint64_t>> read_kmers; for (const auto &r: reads_to_check){ read_kmers.clear(); seq_ptr = bufferedSequenceGetter.get_read_sequence(r); skf.create_kmers(seq_ptr, read_kmers); read_sz1[r]=read_kmers.size(); } bool equal=true; uint32_t it=0; int i=0; for (i = 0; i < reads_to_check.size() and equal; i++) { seq_ptr = bufferedSequenceGetter.get_read_sequence(reads_to_check[i]); read_kmers.clear(); skf.create_kmers(seq_ptr, read_kmers); if (read_kmers.size() != read_sz1[reads_to_check[i]]) equal = false; } if (!equal) { std::cout << "Failed during iteration " << it << ", on read " << reads_to_check[i]; } REQUIRE(equal); ::unlink("pe.prseq"); } TEST_CASE("Fastq file reader") { FastqReader<FastqRecord> fastqReader({0}, "../tests/datasets/test.fastq"); FastqRecord read; bool c; c = fastqReader.next_record(read); uint num_reads(0); while (c) { num_reads++; c = fastqReader.next_record(read); } REQUIRE(num_reads==10); } TEST_CASE("Fasta file reader") { FastaReader<FastaRecord> fastaReader({0}, "../tests/datasets/test.fasta"); FastaRecord read; bool c; c = fastaReader.next_record(read); uint num_reads(0); while (c) { num_reads++; c = fastaReader.next_record(read); } REQUIRE(num_reads==3); } TEST_CASE("Load GFA") { sdglib::OutputLogLevel = sdglib::DEBUG; WorkSpace ws; SequenceDistanceGraph sg(ws); sg.load_from_gfa("../tests/datasets/graph/tgraph.gfa"); REQUIRE(sg.nodes.size() > 1); } TEST_CASE("Load GFA2") { sdglib::OutputLogLevel = sdglib::DEBUG; WorkSpace ws; SequenceDistanceGraph sg(ws); sg.load_from_gfa("../tests/datasets/graph/test_gfa2.gfa"); REQUIRE(sg.nodes.size() > 1); } TEST_CASE("Load ReadPaths") { ReadPathsDatastore ds("../tests/datasets/test.paths"); REQUIRE(!ds.read_paths.empty()); }
83.350877
9,153
0.874237
[ "vector" ]
699506bff3a52af509dac6599f09be66bee49815
433
hpp
C++
src/parser_nodes/join_parser_node_pre.hpp
lowlander/nederrock
aa23f79de3adf0510419208938bf4dcdbe786c9f
[ "MIT" ]
null
null
null
src/parser_nodes/join_parser_node_pre.hpp
lowlander/nederrock
aa23f79de3adf0510419208938bf4dcdbe786c9f
[ "MIT" ]
null
null
null
src/parser_nodes/join_parser_node_pre.hpp
lowlander/nederrock
aa23f79de3adf0510419208938bf4dcdbe786c9f
[ "MIT" ]
null
null
null
// // Copyright (c) 2020 Erwin Rol <erwin@erwinrol.com> // // SPDX-License-Identifier: MIT // #ifndef NEDERROCK_SRC_JOIN_PARSER_NODE_PRE_HPP #define NEDERROCK_SRC_JOIN_PARSER_NODE_PRE_HPP #include <memory> #include <vector> class Join_Parser_Node; using Join_Parser_Node_Ptr = std::shared_ptr<Join_Parser_Node>; using Join_Parser_Node_Vector = std::vector<Join_Parser_Node_Ptr>; #endif // NEDERROCK_SRC_JOIN_PARSER_NODE_PRE_HPP
22.789474
66
0.810624
[ "vector" ]
699926fcfe0d78c2d76796668df23aaf00009084
46,314
cpp
C++
javaStructures/jdk-master/src/hotspot/share/cds/archiveBuilder.cpp
IThawk/learnCode
0ac843d28b193eaab33fb33692f18361d71c7331
[ "MIT" ]
1
2020-12-26T04:52:15.000Z
2020-12-26T04:52:15.000Z
javaStructures/jdk-master/src/hotspot/share/cds/archiveBuilder.cpp
IThawk/learnCode
0ac843d28b193eaab33fb33692f18361d71c7331
[ "MIT" ]
1
2020-12-26T04:57:19.000Z
2020-12-26T04:57:19.000Z
javaStructures/jdk-master/src/hotspot/share/cds/archiveBuilder.cpp
IThawk/learnCode
0ac843d28b193eaab33fb33692f18361d71c7331
[ "MIT" ]
1
2021-12-06T01:13:18.000Z
2021-12-06T01:13:18.000Z
/* * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #include "precompiled.hpp" #include "cds/archiveBuilder.hpp" #include "cds/archiveUtils.hpp" #include "cds/cppVtables.hpp" #include "cds/dumpAllocStats.hpp" #include "cds/metaspaceShared.hpp" #include "classfile/classLoaderDataShared.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionaryShared.hpp" #include "classfile/vmClasses.hpp" #include "interpreter/abstractInterpreter.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/allStatic.hpp" #include "memory/memRegion.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oopHandle.inline.hpp" #include "runtime/arguments.hpp" #include "runtime/globals_extension.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.hpp" #include "utilities/align.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/formatBuffer.hpp" #include "utilities/hashtable.inline.hpp" ArchiveBuilder* ArchiveBuilder::_current = NULL; ArchiveBuilder::OtherROAllocMark::~OtherROAllocMark() { char* newtop = ArchiveBuilder::current()->_ro_region.top(); ArchiveBuilder::alloc_stats()->record_other_type(int(newtop - _oldtop), true); } ArchiveBuilder::SourceObjList::SourceObjList() : _ptrmap(16 * K) { _total_bytes = 0; _objs = new (ResourceObj::C_HEAP, mtClassShared) GrowableArray<SourceObjInfo*>(128 * K, mtClassShared); } ArchiveBuilder::SourceObjList::~SourceObjList() { delete _objs; } void ArchiveBuilder::SourceObjList::append(MetaspaceClosure::Ref* enclosing_ref, SourceObjInfo* src_info) { // Save this source object for copying _objs->append(src_info); // Prepare for marking the pointers in this source object assert(is_aligned(_total_bytes, sizeof(address)), "must be"); src_info->set_ptrmap_start(_total_bytes / sizeof(address)); _total_bytes = align_up(_total_bytes + (uintx)src_info->size_in_bytes(), sizeof(address)); src_info->set_ptrmap_end(_total_bytes / sizeof(address)); BitMap::idx_t bitmap_size_needed = BitMap::idx_t(src_info->ptrmap_end()); if (_ptrmap.size() <= bitmap_size_needed) { _ptrmap.resize((bitmap_size_needed + 1) * 2); } } void ArchiveBuilder::SourceObjList::remember_embedded_pointer(SourceObjInfo* src_info, MetaspaceClosure::Ref* ref) { // src_obj contains a pointer. Remember the location of this pointer in _ptrmap, // so that we can copy/relocate it later. E.g., if we have // class Foo { intx scala; Bar* ptr; } // Foo *f = 0x100; // To mark the f->ptr pointer on 64-bit platform, this function is called with // src_info()->obj() == 0x100 // ref->addr() == 0x108 address src_obj = src_info->obj(); address* field_addr = ref->addr(); assert(src_info->ptrmap_start() < _total_bytes, "sanity"); assert(src_info->ptrmap_end() <= _total_bytes, "sanity"); assert(*field_addr != NULL, "should have checked"); intx field_offset_in_bytes = ((address)field_addr) - src_obj; DEBUG_ONLY(int src_obj_size = src_info->size_in_bytes();) assert(field_offset_in_bytes >= 0, "must be"); assert(field_offset_in_bytes + intx(sizeof(intptr_t)) <= intx(src_obj_size), "must be"); assert(is_aligned(field_offset_in_bytes, sizeof(address)), "must be"); BitMap::idx_t idx = BitMap::idx_t(src_info->ptrmap_start() + (uintx)(field_offset_in_bytes / sizeof(address))); _ptrmap.set_bit(BitMap::idx_t(idx)); } class RelocateEmbeddedPointers : public BitMapClosure { ArchiveBuilder* _builder; address _dumped_obj; BitMap::idx_t _start_idx; public: RelocateEmbeddedPointers(ArchiveBuilder* builder, address dumped_obj, BitMap::idx_t start_idx) : _builder(builder), _dumped_obj(dumped_obj), _start_idx(start_idx) {} bool do_bit(BitMap::idx_t bit_offset) { uintx FLAG_MASK = 0x03; // See comments around MetaspaceClosure::FLAG_MASK size_t field_offset = size_t(bit_offset - _start_idx) * sizeof(address); address* ptr_loc = (address*)(_dumped_obj + field_offset); uintx old_p_and_bits = (uintx)(*ptr_loc); uintx flag_bits = (old_p_and_bits & FLAG_MASK); address old_p = (address)(old_p_and_bits & (~FLAG_MASK)); address new_p = _builder->get_dumped_addr(old_p); uintx new_p_and_bits = ((uintx)new_p) | flag_bits; log_trace(cds)("Ref: [" PTR_FORMAT "] -> " PTR_FORMAT " => " PTR_FORMAT, p2i(ptr_loc), p2i(old_p), p2i(new_p)); ArchivePtrMarker::set_and_mark_pointer(ptr_loc, (address)(new_p_and_bits)); return true; // keep iterating the bitmap } }; void ArchiveBuilder::SourceObjList::relocate(int i, ArchiveBuilder* builder) { SourceObjInfo* src_info = objs()->at(i); assert(src_info->should_copy(), "must be"); BitMap::idx_t start = BitMap::idx_t(src_info->ptrmap_start()); // inclusive BitMap::idx_t end = BitMap::idx_t(src_info->ptrmap_end()); // exclusive RelocateEmbeddedPointers relocator(builder, src_info->dumped_addr(), start); _ptrmap.iterate(&relocator, start, end); } ArchiveBuilder::ArchiveBuilder() : _current_dump_space(NULL), _buffer_bottom(NULL), _last_verified_top(NULL), _num_dump_regions_used(0), _other_region_used_bytes(0), _requested_static_archive_bottom(NULL), _requested_static_archive_top(NULL), _requested_dynamic_archive_bottom(NULL), _requested_dynamic_archive_top(NULL), _mapped_static_archive_bottom(NULL), _mapped_static_archive_top(NULL), _buffer_to_requested_delta(0), _rw_region("rw", MAX_SHARED_DELTA), _ro_region("ro", MAX_SHARED_DELTA), _rw_src_objs(), _ro_src_objs(), _src_obj_table(INITIAL_TABLE_SIZE), _num_instance_klasses(0), _num_obj_array_klasses(0), _num_type_array_klasses(0), _total_closed_heap_region_size(0), _total_open_heap_region_size(0), _estimated_metaspaceobj_bytes(0), _estimated_hashtable_bytes(0) { _klasses = new (ResourceObj::C_HEAP, mtClassShared) GrowableArray<Klass*>(4 * K, mtClassShared); _symbols = new (ResourceObj::C_HEAP, mtClassShared) GrowableArray<Symbol*>(256 * K, mtClassShared); _special_refs = new (ResourceObj::C_HEAP, mtClassShared) GrowableArray<SpecialRefInfo>(24 * K, mtClassShared); assert(_current == NULL, "must be"); _current = this; } ArchiveBuilder::~ArchiveBuilder() { assert(_current == this, "must be"); _current = NULL; clean_up_src_obj_table(); for (int i = 0; i < _symbols->length(); i++) { _symbols->at(i)->decrement_refcount(); } delete _klasses; delete _symbols; delete _special_refs; } bool ArchiveBuilder::is_dumping_full_module_graph() { return DumpSharedSpaces && MetaspaceShared::use_full_module_graph(); } class GatherKlassesAndSymbols : public UniqueMetaspaceClosure { ArchiveBuilder* _builder; public: GatherKlassesAndSymbols(ArchiveBuilder* builder) : _builder(builder) {} virtual bool do_unique_ref(Ref* ref, bool read_only) { return _builder->gather_klass_and_symbol(ref, read_only); } }; bool ArchiveBuilder::gather_klass_and_symbol(MetaspaceClosure::Ref* ref, bool read_only) { if (ref->obj() == NULL) { return false; } if (get_follow_mode(ref) != make_a_copy) { return false; } if (ref->msotype() == MetaspaceObj::ClassType) { Klass* klass = (Klass*)ref->obj(); assert(klass->is_klass(), "must be"); if (!is_excluded(klass)) { _klasses->append(klass); if (klass->is_instance_klass()) { _num_instance_klasses ++; } else if (klass->is_objArray_klass()) { _num_obj_array_klasses ++; } else { assert(klass->is_typeArray_klass(), "sanity"); _num_type_array_klasses ++; } } // See RunTimeSharedClassInfo::get_for() _estimated_metaspaceobj_bytes += align_up(BytesPerWord, SharedSpaceObjectAlignment); } else if (ref->msotype() == MetaspaceObj::SymbolType) { // Make sure the symbol won't be GC'ed while we are dumping the archive. Symbol* sym = (Symbol*)ref->obj(); sym->increment_refcount(); _symbols->append(sym); } int bytes = ref->size() * BytesPerWord; _estimated_metaspaceobj_bytes += align_up(bytes, SharedSpaceObjectAlignment); return true; // recurse } void ArchiveBuilder::gather_klasses_and_symbols() { ResourceMark rm; log_info(cds)("Gathering classes and symbols ... "); GatherKlassesAndSymbols doit(this); iterate_roots(&doit, /*is_relocating_pointers=*/false); #if INCLUDE_CDS_JAVA_HEAP if (is_dumping_full_module_graph()) { ClassLoaderDataShared::iterate_symbols(&doit); } #endif doit.finish(); log_info(cds)("Number of classes %d", _num_instance_klasses + _num_obj_array_klasses + _num_type_array_klasses); log_info(cds)(" instance classes = %5d", _num_instance_klasses); log_info(cds)(" obj array classes = %5d", _num_obj_array_klasses); log_info(cds)(" type array classes = %5d", _num_type_array_klasses); log_info(cds)(" symbols = %5d", _symbols->length()); if (DumpSharedSpaces) { // To ensure deterministic contents in the static archive, we need to ensure that // we iterate the MetaspaceObjs in a deterministic order. It doesn't matter where // the MetaspaceObjs are located originally, as they are copied sequentially into // the archive during the iteration. // // The only issue here is that the symbol table and the system directories may be // randomly ordered, so we copy the symbols and klasses into two arrays and sort // them deterministically. // // During -Xshare:dump, the order of Symbol creation is strictly determined by // the SharedClassListFile (class loading is done in a single thread and the JIT // is disabled). Also, Symbols are allocated in monotonically increasing addresses // (see Symbol::operator new(size_t, int)). So if we iterate the Symbols by // ascending address order, we ensure that all Symbols are copied into deterministic // locations in the archive. // // TODO: in the future, if we want to produce deterministic contents in the // dynamic archive, we might need to sort the symbols alphabetically (also see // DynamicArchiveBuilder::sort_methods()). sort_symbols_and_fix_hash(); sort_klasses(); // TODO -- we need a proper estimate for the archived modules, etc, // but this should be enough for now _estimated_metaspaceobj_bytes += 200 * 1024 * 1024; } } int ArchiveBuilder::compare_symbols_by_address(Symbol** a, Symbol** b) { if (a[0] < b[0]) { return -1; } else { assert(a[0] > b[0], "Duplicated symbol %s unexpected", (*a)->as_C_string()); return 1; } } void ArchiveBuilder::sort_symbols_and_fix_hash() { log_info(cds)("Sorting symbols and fixing identity hash ... "); os::init_random(0x12345678); _symbols->sort(compare_symbols_by_address); for (int i = 0; i < _symbols->length(); i++) { assert(_symbols->at(i)->is_permanent(), "archived symbols must be permanent"); _symbols->at(i)->update_identity_hash(); } } int ArchiveBuilder::compare_klass_by_name(Klass** a, Klass** b) { return a[0]->name()->fast_compare(b[0]->name()); } void ArchiveBuilder::sort_klasses() { log_info(cds)("Sorting classes ... "); _klasses->sort(compare_klass_by_name); } size_t ArchiveBuilder::estimate_archive_size() { // size of the symbol table and two dictionaries, plus the RunTimeSharedClassInfo's size_t symbol_table_est = SymbolTable::estimate_size_for_archive(); size_t dictionary_est = SystemDictionaryShared::estimate_size_for_archive(); _estimated_hashtable_bytes = symbol_table_est + dictionary_est; size_t total = 0; total += _estimated_metaspaceobj_bytes; total += _estimated_hashtable_bytes; // allow fragmentation at the end of each dump region total += _total_dump_regions * MetaspaceShared::core_region_alignment(); log_info(cds)("_estimated_hashtable_bytes = " SIZE_FORMAT " + " SIZE_FORMAT " = " SIZE_FORMAT, symbol_table_est, dictionary_est, _estimated_hashtable_bytes); log_info(cds)("_estimated_metaspaceobj_bytes = " SIZE_FORMAT, _estimated_metaspaceobj_bytes); log_info(cds)("total estimate bytes = " SIZE_FORMAT, total); return align_up(total, MetaspaceShared::core_region_alignment()); } address ArchiveBuilder::reserve_buffer() { size_t buffer_size = estimate_archive_size(); ReservedSpace rs(buffer_size, MetaspaceShared::core_region_alignment(), os::vm_page_size()); if (!rs.is_reserved()) { log_error(cds)("Failed to reserve " SIZE_FORMAT " bytes of output buffer.", buffer_size); vm_direct_exit(0); } // buffer_bottom is the lowest address of the 2 core regions (rw, ro) when // we are copying the class metadata into the buffer. address buffer_bottom = (address)rs.base(); log_info(cds)("Reserved output buffer space at " PTR_FORMAT " [" SIZE_FORMAT " bytes]", p2i(buffer_bottom), buffer_size); _shared_rs = rs; _buffer_bottom = buffer_bottom; _last_verified_top = buffer_bottom; _current_dump_space = &_rw_region; _num_dump_regions_used = 1; _other_region_used_bytes = 0; _current_dump_space->init(&_shared_rs, &_shared_vs); ArchivePtrMarker::initialize(&_ptrmap, &_shared_vs); // The bottom of the static archive should be mapped at this address by default. _requested_static_archive_bottom = (address)MetaspaceShared::requested_base_address(); // The bottom of the archive (that I am writing now) should be mapped at this address by default. address my_archive_requested_bottom; if (DumpSharedSpaces) { my_archive_requested_bottom = _requested_static_archive_bottom; } else { _mapped_static_archive_bottom = (address)MetaspaceObj::shared_metaspace_base(); _mapped_static_archive_top = (address)MetaspaceObj::shared_metaspace_top(); assert(_mapped_static_archive_top >= _mapped_static_archive_bottom, "must be"); size_t static_archive_size = _mapped_static_archive_top - _mapped_static_archive_bottom; // At run time, we will mmap the dynamic archive at my_archive_requested_bottom _requested_static_archive_top = _requested_static_archive_bottom + static_archive_size; my_archive_requested_bottom = align_up(_requested_static_archive_top, MetaspaceShared::core_region_alignment()); _requested_dynamic_archive_bottom = my_archive_requested_bottom; } _buffer_to_requested_delta = my_archive_requested_bottom - _buffer_bottom; address my_archive_requested_top = my_archive_requested_bottom + buffer_size; if (my_archive_requested_bottom < _requested_static_archive_bottom || my_archive_requested_top <= _requested_static_archive_bottom) { // Size overflow. log_error(cds)("my_archive_requested_bottom = " INTPTR_FORMAT, p2i(my_archive_requested_bottom)); log_error(cds)("my_archive_requested_top = " INTPTR_FORMAT, p2i(my_archive_requested_top)); log_error(cds)("SharedBaseAddress (" INTPTR_FORMAT ") is too high. " "Please rerun java -Xshare:dump with a lower value", p2i(_requested_static_archive_bottom)); vm_direct_exit(0); } if (DumpSharedSpaces) { // We don't want any valid object to be at the very bottom of the archive. // See ArchivePtrMarker::mark_pointer(). rw_region()->allocate(16); } return buffer_bottom; } void ArchiveBuilder::iterate_sorted_roots(MetaspaceClosure* it, bool is_relocating_pointers) { int i; if (!is_relocating_pointers) { // Don't relocate _symbol, so we can safely call decrement_refcount on the // original symbols. int num_symbols = _symbols->length(); for (i = 0; i < num_symbols; i++) { it->push(_symbols->adr_at(i)); } } int num_klasses = _klasses->length(); for (i = 0; i < num_klasses; i++) { it->push(_klasses->adr_at(i)); } iterate_roots(it, is_relocating_pointers); } class GatherSortedSourceObjs : public MetaspaceClosure { ArchiveBuilder* _builder; public: GatherSortedSourceObjs(ArchiveBuilder* builder) : _builder(builder) {} virtual bool do_ref(Ref* ref, bool read_only) { return _builder->gather_one_source_obj(enclosing_ref(), ref, read_only); } virtual void push_special(SpecialRef type, Ref* ref, intptr_t* p) { assert(type == _method_entry_ref, "only special type allowed for now"); address src_obj = ref->obj(); size_t field_offset = pointer_delta(p, src_obj, sizeof(u1)); _builder->add_special_ref(type, src_obj, field_offset); }; virtual void do_pending_ref(Ref* ref) { if (ref->obj() != NULL) { _builder->remember_embedded_pointer_in_copied_obj(enclosing_ref(), ref); } } }; bool ArchiveBuilder::gather_one_source_obj(MetaspaceClosure::Ref* enclosing_ref, MetaspaceClosure::Ref* ref, bool read_only) { address src_obj = ref->obj(); if (src_obj == NULL) { return false; } ref->set_keep_after_pushing(); remember_embedded_pointer_in_copied_obj(enclosing_ref, ref); FollowMode follow_mode = get_follow_mode(ref); SourceObjInfo src_info(ref, read_only, follow_mode); bool created; SourceObjInfo* p = _src_obj_table.add_if_absent(src_obj, src_info, &created); if (created) { if (_src_obj_table.maybe_grow(MAX_TABLE_SIZE)) { log_info(cds, hashtables)("Expanded _src_obj_table table to %d", _src_obj_table.table_size()); } } assert(p->read_only() == src_info.read_only(), "must be"); if (created && src_info.should_copy()) { ref->set_user_data((void*)p); if (read_only) { _ro_src_objs.append(enclosing_ref, p); } else { _rw_src_objs.append(enclosing_ref, p); } return true; // Need to recurse into this ref only if we are copying it } else { return false; } } void ArchiveBuilder::add_special_ref(MetaspaceClosure::SpecialRef type, address src_obj, size_t field_offset) { _special_refs->append(SpecialRefInfo(type, src_obj, field_offset)); } void ArchiveBuilder::remember_embedded_pointer_in_copied_obj(MetaspaceClosure::Ref* enclosing_ref, MetaspaceClosure::Ref* ref) { assert(ref->obj() != NULL, "should have checked"); if (enclosing_ref != NULL) { SourceObjInfo* src_info = (SourceObjInfo*)enclosing_ref->user_data(); if (src_info == NULL) { // source objects of point_to_it/set_to_null types are not copied // so we don't need to remember their pointers. } else { if (src_info->read_only()) { _ro_src_objs.remember_embedded_pointer(src_info, ref); } else { _rw_src_objs.remember_embedded_pointer(src_info, ref); } } } } void ArchiveBuilder::gather_source_objs() { ResourceMark rm; log_info(cds)("Gathering all archivable objects ... "); gather_klasses_and_symbols(); GatherSortedSourceObjs doit(this); iterate_sorted_roots(&doit, /*is_relocating_pointers=*/false); doit.finish(); } bool ArchiveBuilder::is_excluded(Klass* klass) { if (klass->is_instance_klass()) { InstanceKlass* ik = InstanceKlass::cast(klass); return SystemDictionaryShared::is_excluded_class(ik); } else if (klass->is_objArray_klass()) { if (DynamicDumpSharedSpaces) { // Don't support archiving of array klasses for now (WHY???) return true; } Klass* bottom = ObjArrayKlass::cast(klass)->bottom_klass(); if (bottom->is_instance_klass()) { return SystemDictionaryShared::is_excluded_class(InstanceKlass::cast(bottom)); } } return false; } ArchiveBuilder::FollowMode ArchiveBuilder::get_follow_mode(MetaspaceClosure::Ref *ref) { address obj = ref->obj(); if (MetaspaceShared::is_in_shared_metaspace(obj)) { // Don't dump existing shared metadata again. return point_to_it; } else if (ref->msotype() == MetaspaceObj::MethodDataType) { return set_to_null; } else { if (ref->msotype() == MetaspaceObj::ClassType) { Klass* klass = (Klass*)ref->obj(); assert(klass->is_klass(), "must be"); if (is_excluded(klass)) { ResourceMark rm; log_debug(cds, dynamic)("Skipping class (excluded): %s", klass->external_name()); return set_to_null; } } return make_a_copy; } } void ArchiveBuilder::start_dump_space(DumpRegion* next) { address bottom = _last_verified_top; address top = (address)(current_dump_space()->top()); _other_region_used_bytes += size_t(top - bottom); current_dump_space()->pack(next); _current_dump_space = next; _num_dump_regions_used ++; _last_verified_top = (address)(current_dump_space()->top()); } void ArchiveBuilder::verify_estimate_size(size_t estimate, const char* which) { address bottom = _last_verified_top; address top = (address)(current_dump_space()->top()); size_t used = size_t(top - bottom) + _other_region_used_bytes; int diff = int(estimate) - int(used); log_info(cds)("%s estimate = " SIZE_FORMAT " used = " SIZE_FORMAT "; diff = %d bytes", which, estimate, used, diff); assert(diff >= 0, "Estimate is too small"); _last_verified_top = top; _other_region_used_bytes = 0; } void ArchiveBuilder::dump_rw_metadata() { ResourceMark rm; log_info(cds)("Allocating RW objects ... "); make_shallow_copies(&_rw_region, &_rw_src_objs); #if INCLUDE_CDS_JAVA_HEAP if (is_dumping_full_module_graph()) { // Archive the ModuleEntry's and PackageEntry's of the 3 built-in loaders char* start = rw_region()->top(); ClassLoaderDataShared::allocate_archived_tables(); alloc_stats()->record_modules(rw_region()->top() - start, /*read_only*/false); } #endif } void ArchiveBuilder::dump_ro_metadata() { ResourceMark rm; log_info(cds)("Allocating RO objects ... "); start_dump_space(&_ro_region); make_shallow_copies(&_ro_region, &_ro_src_objs); #if INCLUDE_CDS_JAVA_HEAP if (is_dumping_full_module_graph()) { char* start = ro_region()->top(); ClassLoaderDataShared::init_archived_tables(); alloc_stats()->record_modules(ro_region()->top() - start, /*read_only*/true); } #endif } void ArchiveBuilder::make_shallow_copies(DumpRegion *dump_region, const ArchiveBuilder::SourceObjList* src_objs) { for (int i = 0; i < src_objs->objs()->length(); i++) { make_shallow_copy(dump_region, src_objs->objs()->at(i)); } log_info(cds)("done (%d objects)", src_objs->objs()->length()); } void ArchiveBuilder::make_shallow_copy(DumpRegion *dump_region, SourceObjInfo* src_info) { MetaspaceClosure::Ref* ref = src_info->ref(); address src = ref->obj(); int bytes = src_info->size_in_bytes(); char* dest; char* oldtop; char* newtop; oldtop = dump_region->top(); if (ref->msotype() == MetaspaceObj::ClassType) { // Save a pointer immediate in front of an InstanceKlass, so // we can do a quick lookup from InstanceKlass* -> RunTimeSharedClassInfo* // without building another hashtable. See RunTimeSharedClassInfo::get_for() // in systemDictionaryShared.cpp. Klass* klass = (Klass*)src; if (klass->is_instance_klass()) { SystemDictionaryShared::validate_before_archiving(InstanceKlass::cast(klass)); dump_region->allocate(sizeof(address)); } } dest = dump_region->allocate(bytes); newtop = dump_region->top(); memcpy(dest, src, bytes); intptr_t* archived_vtable = CppVtables::get_archived_vtable(ref->msotype(), (address)dest); if (archived_vtable != NULL) { *(address*)dest = (address)archived_vtable; ArchivePtrMarker::mark_pointer((address*)dest); } log_trace(cds)("Copy: " PTR_FORMAT " ==> " PTR_FORMAT " %d", p2i(src), p2i(dest), bytes); src_info->set_dumped_addr((address)dest); _alloc_stats.record(ref->msotype(), int(newtop - oldtop), src_info->read_only()); } address ArchiveBuilder::get_dumped_addr(address src_obj) const { SourceObjInfo* p = _src_obj_table.lookup(src_obj); assert(p != NULL, "must be"); return p->dumped_addr(); } void ArchiveBuilder::relocate_embedded_pointers(ArchiveBuilder::SourceObjList* src_objs) { for (int i = 0; i < src_objs->objs()->length(); i++) { src_objs->relocate(i, this); } } void ArchiveBuilder::update_special_refs() { for (int i = 0; i < _special_refs->length(); i++) { SpecialRefInfo s = _special_refs->at(i); size_t field_offset = s.field_offset(); address src_obj = s.src_obj(); address dst_obj = get_dumped_addr(src_obj); intptr_t* src_p = (intptr_t*)(src_obj + field_offset); intptr_t* dst_p = (intptr_t*)(dst_obj + field_offset); assert(s.type() == MetaspaceClosure::_method_entry_ref, "only special type allowed for now"); assert(*src_p == *dst_p, "must be a copy"); ArchivePtrMarker::mark_pointer((address*)dst_p); } } class RefRelocator: public MetaspaceClosure { ArchiveBuilder* _builder; public: RefRelocator(ArchiveBuilder* builder) : _builder(builder) {} virtual bool do_ref(Ref* ref, bool read_only) { if (ref->not_null()) { ref->update(_builder->get_dumped_addr(ref->obj())); ArchivePtrMarker::mark_pointer(ref->addr()); } return false; // Do not recurse. } }; void ArchiveBuilder::relocate_roots() { log_info(cds)("Relocating external roots ... "); ResourceMark rm; RefRelocator doit(this); iterate_sorted_roots(&doit, /*is_relocating_pointers=*/true); doit.finish(); log_info(cds)("done"); } void ArchiveBuilder::relocate_metaspaceobj_embedded_pointers() { log_info(cds)("Relocating embedded pointers in core regions ... "); relocate_embedded_pointers(&_rw_src_objs); relocate_embedded_pointers(&_ro_src_objs); update_special_refs(); } // We must relocate vmClasses::_klasses[] only after we have copied the // java objects in during dump_java_heap_objects(): during the object copy, we operate on // old objects which assert that their klass is the original klass. void ArchiveBuilder::relocate_vm_classes() { log_info(cds)("Relocating vmClasses::_klasses[] ... "); ResourceMark rm; RefRelocator doit(this); vmClasses::metaspace_pointers_do(&doit); } void ArchiveBuilder::make_klasses_shareable() { for (int i = 0; i < klasses()->length(); i++) { Klass* k = klasses()->at(i); k->remove_java_mirror(); if (k->is_objArray_klass()) { // InstanceKlass and TypeArrayKlass will in turn call remove_unshareable_info // on their array classes. } else if (k->is_typeArray_klass()) { k->remove_unshareable_info(); } else { assert(k->is_instance_klass(), " must be"); InstanceKlass* ik = InstanceKlass::cast(k); if (DynamicDumpSharedSpaces) { // For static dump, class loader type are already set. ik->assign_class_loader_type(); } MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread::current(), ik); ik->remove_unshareable_info(); if (log_is_enabled(Debug, cds, class)) { ResourceMark rm; log_debug(cds, class)("klasses[%4d] = " PTR_FORMAT " %s", i, p2i(to_requested(ik)), ik->external_name()); } } } } uintx ArchiveBuilder::buffer_to_offset(address p) const { address requested_p = to_requested(p); assert(requested_p >= _requested_static_archive_bottom, "must be"); return requested_p - _requested_static_archive_bottom; } uintx ArchiveBuilder::any_to_offset(address p) const { if (is_in_mapped_static_archive(p)) { assert(DynamicDumpSharedSpaces, "must be"); return p - _mapped_static_archive_bottom; } return buffer_to_offset(p); } // Update a Java object to point its Klass* to the new location after // shared archive has been compacted. void ArchiveBuilder::relocate_klass_ptr(oop o) { assert(DumpSharedSpaces, "sanity"); Klass* k = get_relocated_klass(o->klass()); Klass* requested_k = to_requested(k); narrowKlass nk = CompressedKlassPointers::encode_not_null(requested_k, _requested_static_archive_bottom); o->set_narrow_klass(nk); } // RelocateBufferToRequested --- Relocate all the pointers in rw/ro, // so that the archive can be mapped to the "requested" location without runtime relocation. // // - See ArchiveBuilder header for the definition of "buffer", "mapped" and "requested" // - ArchivePtrMarker::ptrmap() marks all the pointers in the rw/ro regions // - Every pointer must have one of the following values: // [a] NULL: // No relocation is needed. Remove this pointer from ptrmap so we don't need to // consider it at runtime. // [b] Points into an object X which is inside the buffer: // Adjust this pointer by _buffer_to_requested_delta, so it points to X // when the archive is mapped at the requested location. // [c] Points into an object Y which is inside mapped static archive: // - This happens only during dynamic dump // - Adjust this pointer by _mapped_to_requested_static_archive_delta, // so it points to Y when the static archive is mapped at the requested location. template <bool STATIC_DUMP> class RelocateBufferToRequested : public BitMapClosure { ArchiveBuilder* _builder; address _buffer_bottom; intx _buffer_to_requested_delta; intx _mapped_to_requested_static_archive_delta; size_t _max_non_null_offset; public: RelocateBufferToRequested(ArchiveBuilder* builder) { _builder = builder; _buffer_bottom = _builder->buffer_bottom(); _buffer_to_requested_delta = builder->buffer_to_requested_delta(); _mapped_to_requested_static_archive_delta = builder->requested_static_archive_bottom() - builder->mapped_static_archive_bottom(); _max_non_null_offset = 0; address bottom = _builder->buffer_bottom(); address top = _builder->buffer_top(); address new_bottom = bottom + _buffer_to_requested_delta; address new_top = top + _buffer_to_requested_delta; log_debug(cds)("Relocating archive from [" INTPTR_FORMAT " - " INTPTR_FORMAT "] to " "[" INTPTR_FORMAT " - " INTPTR_FORMAT "]", p2i(bottom), p2i(top), p2i(new_bottom), p2i(new_top)); } bool do_bit(size_t offset) { address* p = (address*)_buffer_bottom + offset; assert(_builder->is_in_buffer_space(p), "pointer must live in buffer space"); if (*p == NULL) { // todo -- clear bit, etc ArchivePtrMarker::ptrmap()->clear_bit(offset); } else { if (STATIC_DUMP) { assert(_builder->is_in_buffer_space(*p), "old pointer must point inside buffer space"); *p += _buffer_to_requested_delta; assert(_builder->is_in_requested_static_archive(*p), "new pointer must point inside requested archive"); } else { if (_builder->is_in_buffer_space(*p)) { *p += _buffer_to_requested_delta; // assert is in requested dynamic archive } else { assert(_builder->is_in_mapped_static_archive(*p), "old pointer must point inside buffer space or mapped static archive"); *p += _mapped_to_requested_static_archive_delta; assert(_builder->is_in_requested_static_archive(*p), "new pointer must point inside requested archive"); } } _max_non_null_offset = offset; } return true; // keep iterating } void doit() { ArchivePtrMarker::ptrmap()->iterate(this); ArchivePtrMarker::compact(_max_non_null_offset); } }; void ArchiveBuilder::relocate_to_requested() { ro_region()->pack(); size_t my_archive_size = buffer_top() - buffer_bottom(); if (DumpSharedSpaces) { _requested_static_archive_top = _requested_static_archive_bottom + my_archive_size; RelocateBufferToRequested<true> patcher(this); patcher.doit(); } else { assert(DynamicDumpSharedSpaces, "must be"); _requested_dynamic_archive_top = _requested_dynamic_archive_bottom + my_archive_size; RelocateBufferToRequested<false> patcher(this); patcher.doit(); } } // Write detailed info to a mapfile to analyze contents of the archive. // static dump: // java -Xshare:dump -Xlog:cds+map=trace:file=cds.map:none:filesize=0 // dynamic dump: // java -cp MyApp.jar -XX:ArchiveClassesAtExit=MyApp.jsa \ // -Xlog:cds+map=trace:file=cds.map:none:filesize=0 MyApp // // We need to do some address translation because the buffers used at dump time may be mapped to // a different location at runtime. At dump time, the buffers may be at arbitrary locations // picked by the OS. At runtime, we try to map at a fixed location (SharedBaseAddress). For // consistency, we log everything using runtime addresses. class ArchiveBuilder::CDSMapLogger : AllStatic { static intx buffer_to_runtime_delta() { // Translate the buffers used by the RW/RO regions to their eventual (requested) locations // at runtime. return ArchiveBuilder::current()->buffer_to_requested_delta(); } // rw/ro regions only static void write_dump_region(const char* name, DumpRegion* region) { address region_base = address(region->base()); address region_top = address(region->top()); write_region(name, region_base, region_top, region_base + buffer_to_runtime_delta()); } #define _LOG_PREFIX PTR_FORMAT ": @@ %-17s %d" static void write_klass(Klass* k, address runtime_dest, const char* type_name, int bytes, Thread* current) { ResourceMark rm(current); log_debug(cds, map)(_LOG_PREFIX " %s", p2i(runtime_dest), type_name, bytes, k->external_name()); } static void write_method(Method* m, address runtime_dest, const char* type_name, int bytes, Thread* current) { ResourceMark rm(current); log_debug(cds, map)(_LOG_PREFIX " %s", p2i(runtime_dest), type_name, bytes, m->external_name()); } // rw/ro regions only static void write_objects(DumpRegion* region, const ArchiveBuilder::SourceObjList* src_objs) { address last_obj_base = address(region->base()); address last_obj_end = address(region->base()); address region_end = address(region->end()); Thread* current = Thread::current(); for (int i = 0; i < src_objs->objs()->length(); i++) { SourceObjInfo* src_info = src_objs->at(i); address src = src_info->orig_obj(); address dest = src_info->dumped_addr(); write_data(last_obj_base, dest, last_obj_base + buffer_to_runtime_delta()); address runtime_dest = dest + buffer_to_runtime_delta(); int bytes = src_info->size_in_bytes(); MetaspaceObj::Type type = src_info->msotype(); const char* type_name = MetaspaceObj::type_name(type); switch (type) { case MetaspaceObj::ClassType: write_klass((Klass*)src, runtime_dest, type_name, bytes, current); break; case MetaspaceObj::ConstantPoolType: write_klass(((ConstantPool*)src)->pool_holder(), runtime_dest, type_name, bytes, current); break; case MetaspaceObj::ConstantPoolCacheType: write_klass(((ConstantPoolCache*)src)->constant_pool()->pool_holder(), runtime_dest, type_name, bytes, current); break; case MetaspaceObj::MethodType: write_method((Method*)src, runtime_dest, type_name, bytes, current); break; case MetaspaceObj::ConstMethodType: write_method(((ConstMethod*)src)->method(), runtime_dest, type_name, bytes, current); break; case MetaspaceObj::SymbolType: { ResourceMark rm(current); Symbol* s = (Symbol*)src; log_debug(cds, map)(_LOG_PREFIX " %s", p2i(runtime_dest), type_name, bytes, s->as_quoted_ascii()); } break; default: log_debug(cds, map)(_LOG_PREFIX, p2i(runtime_dest), type_name, bytes); break; } last_obj_base = dest; last_obj_end = dest + bytes; } write_data(last_obj_base, last_obj_end, last_obj_base + buffer_to_runtime_delta()); if (last_obj_end < region_end) { log_debug(cds, map)(PTR_FORMAT ": @@ Misc data " SIZE_FORMAT " bytes", p2i(last_obj_end + buffer_to_runtime_delta()), size_t(region_end - last_obj_end)); write_data(last_obj_end, region_end, last_obj_end + buffer_to_runtime_delta()); } } #undef _LOG_PREFIX // Write information about a region, whose address at dump time is [base .. top). At // runtime, this region will be mapped to runtime_base. runtime_base is 0 if this // region will be mapped at os-selected addresses (such as the bitmap region), or will // be accessed with os::read (the header). static void write_region(const char* name, address base, address top, address runtime_base) { size_t size = top - base; base = runtime_base; top = runtime_base + size; log_info(cds, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " " SIZE_FORMAT_W(9) " bytes]", name, p2i(base), p2i(top), size); } // open and closed archive regions static void write_heap_region(const char* which, GrowableArray<MemRegion> *regions) { for (int i = 0; i < regions->length(); i++) { address start = address(regions->at(i).start()); address end = address(regions->at(i).end()); write_region(which, start, end, start); write_data(start, end, start); } } // Dump all the data [base...top). Pretend that the base address // will be mapped to runtime_base at run-time. static void write_data(address base, address top, address runtime_base) { assert(top >= base, "must be"); LogStreamHandle(Trace, cds, map) lsh; if (lsh.is_enabled()) { os::print_hex_dump(&lsh, base, top, sizeof(address), 32, runtime_base); } } static void write_header(FileMapInfo* mapinfo) { LogStreamHandle(Info, cds, map) lsh; if (lsh.is_enabled()) { mapinfo->print(&lsh); } } public: static void write(ArchiveBuilder* builder, FileMapInfo* mapinfo, GrowableArray<MemRegion> *closed_heap_regions, GrowableArray<MemRegion> *open_heap_regions, char* bitmap, size_t bitmap_size_in_bytes) { log_info(cds, map)("%s CDS archive map for %s", DumpSharedSpaces ? "Static" : "Dynamic", mapinfo->full_path()); address header = address(mapinfo->header()); address header_end = header + mapinfo->header()->header_size(); write_region("header", header, header_end, 0); write_header(mapinfo); write_data(header, header_end, 0); DumpRegion* rw_region = &builder->_rw_region; DumpRegion* ro_region = &builder->_ro_region; write_dump_region("rw region", rw_region); write_objects(rw_region, &builder->_rw_src_objs); write_dump_region("ro region", ro_region); write_objects(ro_region, &builder->_ro_src_objs); address bitmap_end = address(bitmap + bitmap_size_in_bytes); write_region("bitmap", address(bitmap), bitmap_end, 0); write_data(header, header_end, 0); if (closed_heap_regions != NULL) { write_heap_region("closed heap region", closed_heap_regions); } if (open_heap_regions != NULL) { write_heap_region("open heap region", open_heap_regions); } log_info(cds, map)("[End of CDS archive map]"); } }; void ArchiveBuilder::print_stats() { _alloc_stats.print_stats(int(_ro_region.used()), int(_rw_region.used())); } void ArchiveBuilder::clean_up_src_obj_table() { SrcObjTableCleaner cleaner; _src_obj_table.iterate(&cleaner); } void ArchiveBuilder::write_archive(FileMapInfo* mapinfo, GrowableArray<MemRegion>* closed_heap_regions, GrowableArray<MemRegion>* open_heap_regions, GrowableArray<ArchiveHeapOopmapInfo>* closed_heap_oopmaps, GrowableArray<ArchiveHeapOopmapInfo>* open_heap_oopmaps) { // Make sure NUM_CDS_REGIONS (exported in cds.h) agrees with // MetaspaceShared::n_regions (internal to hotspot). assert(NUM_CDS_REGIONS == MetaspaceShared::n_regions, "sanity"); write_region(mapinfo, MetaspaceShared::rw, &_rw_region, /*read_only=*/false,/*allow_exec=*/false); write_region(mapinfo, MetaspaceShared::ro, &_ro_region, /*read_only=*/true, /*allow_exec=*/false); size_t bitmap_size_in_bytes; char* bitmap = mapinfo->write_bitmap_region(ArchivePtrMarker::ptrmap(), closed_heap_oopmaps, open_heap_oopmaps, bitmap_size_in_bytes); if (closed_heap_regions != NULL) { _total_closed_heap_region_size = mapinfo->write_archive_heap_regions( closed_heap_regions, closed_heap_oopmaps, MetaspaceShared::first_closed_archive_heap_region, MetaspaceShared::max_closed_archive_heap_region); _total_open_heap_region_size = mapinfo->write_archive_heap_regions( open_heap_regions, open_heap_oopmaps, MetaspaceShared::first_open_archive_heap_region, MetaspaceShared::max_open_archive_heap_region); } print_region_stats(mapinfo, closed_heap_regions, open_heap_regions); mapinfo->set_requested_base((char*)MetaspaceShared::requested_base_address()); if (mapinfo->header()->magic() == CDS_DYNAMIC_ARCHIVE_MAGIC) { mapinfo->set_header_base_archive_name_size(strlen(Arguments::GetSharedArchivePath()) + 1); mapinfo->set_header_base_archive_is_default(FLAG_IS_DEFAULT(SharedArchiveFile)); } mapinfo->set_header_crc(mapinfo->compute_header_crc()); // After this point, we should not write any data into mapinfo->header() since this // would corrupt its checksum we have calculated before. mapinfo->write_header(); mapinfo->close(); if (log_is_enabled(Info, cds)) { print_stats(); } if (log_is_enabled(Info, cds, map)) { CDSMapLogger::write(this, mapinfo, closed_heap_regions, open_heap_regions, bitmap, bitmap_size_in_bytes); } FREE_C_HEAP_ARRAY(char, bitmap); } void ArchiveBuilder::write_region(FileMapInfo* mapinfo, int region_idx, DumpRegion* dump_region, bool read_only, bool allow_exec) { mapinfo->write_region(region_idx, dump_region->base(), dump_region->used(), read_only, allow_exec); } void ArchiveBuilder::print_region_stats(FileMapInfo *mapinfo, GrowableArray<MemRegion>* closed_heap_regions, GrowableArray<MemRegion>* open_heap_regions) { // Print statistics of all the regions const size_t bitmap_used = mapinfo->space_at(MetaspaceShared::bm)->used(); const size_t bitmap_reserved = mapinfo->space_at(MetaspaceShared::bm)->used_aligned(); const size_t total_reserved = _ro_region.reserved() + _rw_region.reserved() + bitmap_reserved + _total_closed_heap_region_size + _total_open_heap_region_size; const size_t total_bytes = _ro_region.used() + _rw_region.used() + bitmap_used + _total_closed_heap_region_size + _total_open_heap_region_size; const double total_u_perc = percent_of(total_bytes, total_reserved); _rw_region.print(total_reserved); _ro_region.print(total_reserved); print_bitmap_region_stats(bitmap_used, total_reserved); if (closed_heap_regions != NULL) { print_heap_region_stats(closed_heap_regions, "ca", total_reserved); print_heap_region_stats(open_heap_regions, "oa", total_reserved); } log_debug(cds)("total : " SIZE_FORMAT_W(9) " [100.0%% of total] out of " SIZE_FORMAT_W(9) " bytes [%5.1f%% used]", total_bytes, total_reserved, total_u_perc); } void ArchiveBuilder::print_bitmap_region_stats(size_t size, size_t total_size) { log_debug(cds)("bm space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [100.0%% used]", size, size/double(total_size)*100.0, size); } void ArchiveBuilder::print_heap_region_stats(GrowableArray<MemRegion> *heap_mem, const char *name, size_t total_size) { int arr_len = heap_mem == NULL ? 0 : heap_mem->length(); for (int i = 0; i < arr_len; i++) { char* start = (char*)heap_mem->at(i).start(); size_t size = heap_mem->at(i).byte_size(); char* top = start + size; log_debug(cds)("%s%d space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [100.0%% used] at " INTPTR_FORMAT, name, i, size, size/double(total_size)*100.0, size, p2i(start)); } } void ArchiveBuilder::report_out_of_space(const char* name, size_t needed_bytes) { // This is highly unlikely to happen on 64-bits because we have reserved a 4GB space. // On 32-bit we reserve only 256MB so you could run out of space with 100,000 classes // or so. _rw_region.print_out_of_space_msg(name, needed_bytes); _ro_region.print_out_of_space_msg(name, needed_bytes); vm_exit_during_initialization(err_msg("Unable to allocate from '%s' region", name), "Please reduce the number of shared classes."); } #ifndef PRODUCT void ArchiveBuilder::assert_is_vm_thread() { assert(Thread::current()->is_VM_thread(), "ArchiveBuilder should be used only inside the VMThread"); } #endif
39.116554
143
0.700026
[ "object" ]
699aa934600508ad29b0a43b8acdb70634ba6984
12,489
cpp
C++
modules/segmentation/src/Slic.cpp
byiii/clone_v4r_j
628359c7ba19389004618defd6a8d8ab5af35967
[ "MIT" ]
null
null
null
modules/segmentation/src/Slic.cpp
byiii/clone_v4r_j
628359c7ba19389004618defd6a8d8ab5af35967
[ "MIT" ]
null
null
null
modules/segmentation/src/Slic.cpp
byiii/clone_v4r_j
628359c7ba19389004618defd6a8d8ab5af35967
[ "MIT" ]
null
null
null
/** * $Id$ * Johann Prankl, 2014-3 * johann.prankl@josephinum.at */ #include <cfloat> #include <cmath> #include <iostream> #include <fstream> #include <opencv2/imgproc/imgproc.hpp> #ifdef _OPENMP #include <omp.h> #endif #include <v4r/segmentation/Slic.h> namespace v4r { using namespace std; Slic::Slic() { } Slic::~Slic() { } /** * convertRGBtoLAB */ void Slic::convertRGBtoLAB(const cv::Mat_<cv::Vec3b> &im_rgb, cv::Mat_<cv::Vec3d> &im_lab) { im_lab = cv::Mat_<cv::Vec3d>(im_rgb.size()); double R, G, B, r, g, b; double X, Y, Z, xr, yr, zr; double fx, fy, fz; double epsilon = 0.008856; //actual CIE standard double kappa = 903.3; //actual CIE standard const double inv_Xr = 1./0.950456; //reference white //const double inv_Yr = 1./1.0; //reference white const double inv_Zr = 1./1.088754; //reference white const double inv_255 = 1./255; const double inv_12 = 1./12.92; const double inv_1 = 1./1.055; const double inv_3 = 1./3.0; const double inv_116 = 1./116.0; #pragma omp parallel for private(R,G,B,r,g,b,X,Y,Z,xr,yr,zr,fx,fy,fz) for (int v=0; v<im_rgb.rows; v++) { for (int u=0; u<im_rgb.cols; u++) { const cv::Vec3b &rgb = im_rgb(v,u); cv::Vec3d &lab = im_lab(v,u); R = rgb[0]*inv_255; G = rgb[1]*inv_255; B = rgb[2]*inv_255; if(R <= 0.04045) r = R*inv_12; else r = pow((R+0.055)*inv_1,2.4); if(G <= 0.04045) g = G*inv_12; else g = pow((G+0.055)*inv_1,2.4); if(B <= 0.04045) b = B*inv_12; else b = pow((B+0.055)*inv_1,2.4); X = r*0.4124564 + g*0.3575761 + b*0.1804375; Y = r*0.2126729 + g*0.7151522 + b*0.0721750; Z = r*0.0193339 + g*0.1191920 + b*0.9503041; xr = X*inv_Xr; yr = Y;//*inv_Yr; zr = Z*inv_Zr; if(xr > epsilon) fx = pow(xr, inv_3); else fx = (kappa*xr + 16.0)*inv_116; if(yr > epsilon) fy = pow(yr, inv_3); else fy = (kappa*yr + 16.0)*inv_116; if(zr > epsilon) fz = pow(zr, inv_3); else fz = (kappa*zr + 16.0)*inv_116; lab[0] = 116.0*fy-16.0; lab[1] = 500.0*(fx-fy); lab[2] = 200.0*(fy-fz); } } } /** * convertRGBtoLAB */ void Slic::convertRGBtoLAB(double r, double g, double b, double &labL, double &labA, double &labB) { double R, G, B; double X, Y, Z, xr, yr, zr; double fx, fy, fz; double epsilon = 0.008856; //actual CIE standard double kappa = 903.3; //actual CIE standard const double inv_Xr = 1./0.950456; //reference white //const double inv_Yr = 1./1.0; //reference white const double inv_Zr = 1./1.088754; //reference white const double inv_255 = 1./255; const double inv_12 = 1./12.92; const double inv_1 = 1./1.055; const double inv_3 = 1./3.0; const double inv_116 = 1./116.0; R = r*inv_255; G = g*inv_255; B = b*inv_255; if(R <= 0.04045) r = R*inv_12; else r = pow((R+0.055)*inv_1,2.4); if(G <= 0.04045) g = G*inv_12; else g = pow((G+0.055)*inv_1,2.4); if(B <= 0.04045) b = B*inv_12; else b = pow((B+0.055)*inv_1,2.4); X = r*0.4124564 + g*0.3575761 + b*0.1804375; Y = r*0.2126729 + g*0.7151522 + b*0.0721750; Z = r*0.0193339 + g*0.1191920 + b*0.9503041; xr = X*inv_Xr; yr = Y;//*inv_Yr; zr = Z*inv_Zr; if(xr > epsilon) fx = pow(xr, inv_3); else fx = (kappa*xr + 16.0)*inv_116; if(yr > epsilon) fy = pow(yr, inv_3); else fy = (kappa*yr + 16.0)*inv_116; if(zr > epsilon) fz = pow(zr, inv_3); else fz = (kappa*zr + 16.0)*inv_116; labL = 116.0*fy-16.0; labA = 500.0*(fx-fy); labB = 200.0*(fy-fz); } /** * drawContours */ void Slic::drawContours(cv::Mat_<cv::Vec3b> &im_rgb, const cv::Mat_<int> &labels, int r, int g, int b) { const int dx8[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 1}; bool have_col=false; if (r!=-1 && g!=-1 && b!=-1) have_col=true; int width = im_rgb.cols; int height = im_rgb.rows; int sz = width*height; vector<bool> istaken(sz, false); vector<int> contourx(sz); vector<int> contoury(sz); int mainindex(0);int cind(0); for( int j = 0; j < height; j++ ) { for( int k = 0; k < width; k++ ) { int np(0); for( int i = 0; i < 8; i++ ) { int x = k + dx8[i]; int y = j + dy8[i]; if( (x >= 0 && x < width) && (y >= 0 && y < height) ) { int index = y*width + x; if( false == istaken[index] ) { if( labels(mainindex) != labels(index) ) np++; } } } if( np > 1 ) { contourx[cind] = k; contoury[cind] = j; istaken[mainindex] = true; cind++; } mainindex++; } } int numboundpix = cind; for( int j = 0; j < numboundpix; j++ ) { int ii = contoury[j]*width + contourx[j]; if (have_col) im_rgb(ii) = cv::Vec3b(b,g,r); else im_rgb(ii) = cv::Vec3b(255,255,255); for( int n = 0; n < 8; n++ ) { int x = contourx[j] + dx8[n]; int y = contoury[j] + dy8[n]; if( (x >= 0 && x < width) && (y >= 0 && y < height) ) { int ind = y*width + x; if(!have_col && !istaken[ind]) im_rgb(ind) = cv::Vec3b(0,0,0); } } } } /** * getSeeds */ void Slic::getSeeds(const cv::Mat_<cv::Vec3d> &im_lab, std::vector<SlicPoint> &seeds, const int &step) { int numseeds(0); int xe, n(0); int width = im_lab.cols; int height = im_lab.rows; int xstrips = (0.5+double(width)/double(step)); int ystrips = (0.5+double(height)/double(step)); int xerr = width - step*xstrips; if(xerr < 0){xstrips--; xerr = width - step*xstrips;} int yerr = height - step*ystrips; if(yerr < 0){ystrips--; yerr = height - step*ystrips;} double xerrperstrip = double(xerr)/double(xstrips); double yerrperstrip = double(yerr)/double(ystrips); int xoff = step/2; int yoff = step/2; numseeds = xstrips*ystrips; seeds.resize(numseeds); for( int y = 0; y < ystrips; y++ ) { int ye = y*yerrperstrip; for( int x = 0; x < xstrips; x++ ) { SlicPoint &pt = seeds[n]; xe = x*xerrperstrip; pt.x = (x*step+xoff+xe); pt.y = (y*step+yoff+ye); const cv::Vec3d &lab = im_lab(pt.y,pt.x); pt.l = lab[0]; pt.a = lab[1]; pt.b = lab[2]; n++; } } } /** * performSlic * Performs k mean segmentation. It is fast because it looks locally, not over the entire image. */ void Slic::performSlic(const cv::Mat_<cv::Vec3d> &im_lab, std::vector<SlicPoint> &seeds, cv::Mat_<int> &labels, const int &step, const double &m) { int width = im_lab.cols; int height = im_lab.rows; int sz = width*height; const int numk = seeds.size(); int offset = step; clustersize.clear(); clustersize.resize(numk,0); sigma.clear(); sigma.resize(numk, SlicPoint()); dists.resize(sz); double invwt = 1.0/((step/m)*(step/m)); int idx, x1, y1, x2, y2; double dist; double distxy; double inv; const cv::Vec3d *ptr_lab = &im_lab(0); int *ptr_labels = &labels(0); for( int itr = 0; itr < 10; itr++ ) { dists.assign(sz, DBL_MAX); for( int n = 0; n < numk; n++ ) { const SlicPoint &pt = seeds[n]; y1 = max(0.0, pt.y-offset); y2 = min((double)height, pt.y+offset); x1 = max(0.0, pt.x-offset); x2 = min((double)width, pt.x+offset); //#pragma omp parallel for private(idx,dist,distxy) for( int y = y1; y < y2; y++ ) { for( int x = x1; x < x2; x++ ) { idx = y*width+x; const cv::Vec3d &lab = ptr_lab[idx]; //dist = sqr(lab[0] - pt.l) + sqr(lab[1] - pt.a) + sqr(lab[2] - pt.b); //distxy = sqr((x - pt.x)) + sqr(y - pt.y); dist = (lab[0]-pt.l)*(lab[0]-pt.l) + (lab[1]-pt.a)*(lab[1]-pt.a) + (lab[2]-pt.b)*(lab[2]-pt.b); distxy = (x-pt.x)*(x-pt.x) + (y-pt.y)*(y-pt.y); dist += distxy*invwt; if( dist < dists[idx] ) { dists[idx] = dist; ptr_labels[idx] = n; } } } } sigma.assign(numk, SlicPoint()); clustersize.assign(numk, 0); idx = 0; for( int r = 0; r < height; r++ ) { for( int c = 0; c < width; c++, idx++ ) { SlicPoint &sig = sigma[ptr_labels[idx]]; const cv::Vec3d &lab = ptr_lab[idx]; sig.l += lab[0]; sig.a += lab[1]; sig.b += lab[2]; sig.x += c; sig.y += r; clustersize[ptr_labels[idx]] += 1.0; } } for( int k = 0; k < numk; k++ ) { if( clustersize[k] <= 0 ) clustersize[k] = 1; inv = 1./clustersize[k]; SlicPoint &pt = seeds[k]; const SlicPoint &sig = sigma[k]; pt.l = sig.l*inv; pt.a = sig.a*inv; pt.b = sig.b*inv; pt.x = sig.x*inv; pt.y = sig.y*inv; } } } /** * enforceLabelConnectivity * 1. finding an adjacent label for each new component at the start * 2. if a certain component is too small, assigning the previously found * adjacent label to this component, and not incrementing the label. */ void Slic::enforceLabelConnectivity(cv::Mat_<int> &labels, cv::Mat_<int> &out_labels, int& numlabels, const int& K) { const int dx4[4] = {-1, 0, 1, 0}; const int dy4[4] = { 0, -1, 0, 1}; int width = labels.cols; int height = labels.rows; const int sz = width*height; const int SUPSZ = sz/K; out_labels = cv::Mat_<int>(height,width); out_labels.setTo(-1); int label(0); int* xvec = new int[sz]; int* yvec = new int[sz]; int oindex(0); int adjlabel(0);//adjacent label int *ol = &out_labels(0); int *il = &labels(0); for( int j = 0; j < height; j++ ) { for( int k = 0; k < width; k++ ) { if( 0 > ol[oindex] ) { ol[oindex] = label; xvec[0] = k; yvec[0] = j; // Quickly find an adjacent label for use later if needed for( int n = 0; n < 4; n++ ) { int x = xvec[0] + dx4[n]; int y = yvec[0] + dy4[n]; if( (x >= 0 && x < width) && (y >= 0 && y < height) ) { int nindex = y*width + x; if(ol[nindex] >= 0) adjlabel = ol[nindex]; } } int count(1); for( int c = 0; c < count; c++ ) { for( int n = 0; n < 4; n++ ) { int x = xvec[c] + dx4[n]; int y = yvec[c] + dy4[n]; if( (x >= 0 && x < width) && (y >= 0 && y < height) ) { int nindex = y*width + x; if( 0 > ol[nindex] && il[oindex] == il[nindex] ) { xvec[count] = x; yvec[count] = y; ol[nindex] = label; count++; } } } } // If segment size is less then a limit, assign an // adjacent label found before, and decrement label count. if(count <= SUPSZ >> 2) { for( int c = 0; c < count; c++ ) { int ind = yvec[c]*width+xvec[c]; ol[ind] = adjlabel; } label--; } label++; } oindex++; } } numlabels = label; if(xvec) delete [] xvec; if(yvec) delete [] yvec; } /** * segmentSuperpixelSize * given an desired size */ void Slic::segmentSuperpixelSize(const cv::Mat_<cv::Vec3b> &im_rgb, cv::Mat_<int> &labels, int &numlabels, const int &superpixelsize, const double& compactness) { int width = im_rgb.cols; int height = im_rgb.rows; int sz = width*height; const int step = sqrt(double(superpixelsize))+0.5; seeds.clear(); labels = cv::Mat_<int>(im_rgb.size()); labels.setTo(-1); Slic::convertRGBtoLAB(im_rgb, im_lab); //cv::cvtColor(im_rgb, im_lab, CV_RGB2Lab); getSeeds(im_lab, seeds, step); performSlic(im_lab, seeds, labels, step, compactness); numlabels = seeds.size(); cv::Mat_<int> new_labels; enforceLabelConnectivity(labels, new_labels, numlabels, double(sz)/double(step*step)); new_labels.copyTo(labels); } /** * segmentSuperpixelNumber * given a desired number of superpixel */ void Slic::segmentSuperpixelNumber(const cv::Mat_<cv::Vec3b> &im_rgb, cv::Mat_<int> &labels, int& numlabels, const int& K, const double& compactness) { const int superpixelsize = 0.5+double(im_rgb.rows*im_rgb.cols)/double(K); segmentSuperpixelSize(im_rgb, labels, numlabels, superpixelsize, compactness); } }
25.230303
161
0.533189
[ "vector" ]
699da0e201c0eb9327d86879473e5185b1bc23cc
411
cc
C++
kattis/bing.cc
Ashindustry007/competitive-programming
2eabd3975c029d235abb7854569593d334acae2f
[ "WTFPL" ]
506
2018-08-22T10:30:38.000Z
2022-03-31T10:01:49.000Z
kattis/bing.cc
Ashindustry007/competitive-programming
2eabd3975c029d235abb7854569593d334acae2f
[ "WTFPL" ]
13
2019-08-07T18:31:18.000Z
2020-12-15T21:54:41.000Z
kattis/bing.cc
Ashindustry007/competitive-programming
2eabd3975c029d235abb7854569593d334acae2f
[ "WTFPL" ]
234
2018-08-06T17:11:41.000Z
2022-03-26T10:56:42.000Z
// https://open.kattis.com/problems/bing #include<bits/stdc++.h> using namespace std; using vi=vector<int>; using vvi=vector<vi>; int main(){ int n,z=1; cin>>n; vvi t(n*32, vi(27)); for(int i=0;i<n;i++){ string s; cin>>s; int k=0; for(char c:s){ t[k][26]++; if(!t[k][c-'a']) t[k][c-'a']=z++; k=t[k][c-'a']; } cout<<t[k][26]<<endl; t[k][26]++; } }
17.125
40
0.474453
[ "vector" ]
69a039bde056e5728b8412f15fa2234c8a7e01ee
2,424
cpp
C++
aws-cpp-sdk-clouddirectory/source/model/BatchListObjectParentPathsResponse.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-clouddirectory/source/model/BatchListObjectParentPathsResponse.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-clouddirectory/source/model/BatchListObjectParentPathsResponse.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2022-03-23T15:17:18.000Z
2022-03-23T15:17:18.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/clouddirectory/model/BatchListObjectParentPathsResponse.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace CloudDirectory { namespace Model { BatchListObjectParentPathsResponse::BatchListObjectParentPathsResponse() : m_pathToObjectIdentifiersListHasBeenSet(false), m_nextTokenHasBeenSet(false) { } BatchListObjectParentPathsResponse::BatchListObjectParentPathsResponse(JsonView jsonValue) : m_pathToObjectIdentifiersListHasBeenSet(false), m_nextTokenHasBeenSet(false) { *this = jsonValue; } BatchListObjectParentPathsResponse& BatchListObjectParentPathsResponse::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("PathToObjectIdentifiersList")) { Array<JsonView> pathToObjectIdentifiersListJsonList = jsonValue.GetArray("PathToObjectIdentifiersList"); for(unsigned pathToObjectIdentifiersListIndex = 0; pathToObjectIdentifiersListIndex < pathToObjectIdentifiersListJsonList.GetLength(); ++pathToObjectIdentifiersListIndex) { m_pathToObjectIdentifiersList.push_back(pathToObjectIdentifiersListJsonList[pathToObjectIdentifiersListIndex].AsObject()); } m_pathToObjectIdentifiersListHasBeenSet = true; } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); m_nextTokenHasBeenSet = true; } return *this; } JsonValue BatchListObjectParentPathsResponse::Jsonize() const { JsonValue payload; if(m_pathToObjectIdentifiersListHasBeenSet) { Array<JsonValue> pathToObjectIdentifiersListJsonList(m_pathToObjectIdentifiersList.size()); for(unsigned pathToObjectIdentifiersListIndex = 0; pathToObjectIdentifiersListIndex < pathToObjectIdentifiersListJsonList.GetLength(); ++pathToObjectIdentifiersListIndex) { pathToObjectIdentifiersListJsonList[pathToObjectIdentifiersListIndex].AsObject(m_pathToObjectIdentifiersList[pathToObjectIdentifiersListIndex].Jsonize()); } payload.WithArray("PathToObjectIdentifiersList", std::move(pathToObjectIdentifiersListJsonList)); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } return payload; } } // namespace Model } // namespace CloudDirectory } // namespace Aws
29.204819
174
0.801568
[ "model" ]
69a1b2b9452c69322fd1bbfd0bf86799de2d157c
21,306
cpp
C++
sensors/cameras/flycapture/flycapture.cpp
mission-systems-pty-ltd/snark
2bc8a20292ee3684d3a9897ba6fee43fed8d89ae
[ "BSD-3-Clause" ]
63
2015-01-14T14:38:02.000Z
2022-02-01T09:56:03.000Z
sensors/cameras/flycapture/flycapture.cpp
NEU-LC/snark
db890f73f4c4bbe679405f3a607fd9ea373deb2c
[ "BSD-3-Clause" ]
39
2015-01-21T00:57:38.000Z
2020-04-22T04:22:35.000Z
sensors/cameras/flycapture/flycapture.cpp
NEU-LC/snark
db890f73f4c4bbe679405f3a607fd9ea373deb2c
[ "BSD-3-Clause" ]
36
2015-01-15T04:17:14.000Z
2022-02-17T17:13:35.000Z
// This file is part of snark, a generic and flexible library for robotics research // Copyright (c) 2011 The University of Sydney // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. Neither the name of the University of Sydney nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE // GRANTED BY THIS LICENSE. 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 <algorithm> #include <boost/lexical_cast.hpp> #include <boost/optional.hpp> #include <boost/thread.hpp> #include <boost/assign.hpp> #include <boost/bimap.hpp> #include <boost/bind.hpp> #include <comma/base/exception.h> #include <comma/csv/stream.h> #include <comma/string/string.h> #include "flycapture.h" #include "helpers.h" #include "attributes.h" namespace snark{ namespace cameras{ namespace flycapture{ boost::posix_time::ptime midpoint(boost::posix_time::ptime const& a, boost::posix_time::ptime const& b) { return a + (b-a)/2; } static const unsigned int max_retries = 15; bool collect_frame(cv::Mat & image, FlyCapture2::CameraBase* handle, bool & started) { FlyCapture2::Error result; FlyCapture2::Image frame_; FlyCapture2::Image raw_image; if( !handle ) { COMMA_THROW(comma::exception, "read from bad camera"); } result = handle->RetrieveBuffer(&raw_image); frame_.DeepCopy(&raw_image); raw_image.ReleaseBuffer(); if( result == FlyCapture2::PGRERROR_OK ) { cv::Mat cv_image( frame_.GetRows(), frame_.GetCols(), get_cv_type( frame_ ), frame_.GetData() ); cv_image.copyTo(image); return true; } else if( result == FlyCapture2::PGRERROR_IMAGE_CONSISTENCY_ERROR ) { // todo: no output to stderr in libraries! //report damaged frame and try again std::cerr << "snark_flycapture error: " << result.GetDescription() << ". Retrying..." << std::endl; return false; } else if( ( result == FlyCapture2::PGRERROR_ISOCH_START_FAILED ) || ( result == FlyCapture2::PGRERROR_ISOCH_ALREADY_STARTED ) || ( result == FlyCapture2::PGRERROR_ISOCH_NOT_STARTED ) ) { // todo: no output to stderr in libraries! //These are errors that result in a retry std::cerr << "snark_flycapture error: " << result.GetDescription() << ". Restarting camera." << std::endl; handle->StopCapture(); started = false; return false; } else { COMMA_THROW( comma::exception, "got frame with invalid status " << result.GetType() << ": " << result.GetDescription() ); } } class camera::impl { //Note, for Point Grey, the serial number is used as ID public: impl( unsigned int id, const attributes_type& attributes, const timestamp_policy & when ) : handle_(nullptr), id_(id), started_( false ), when_( when ) { initialize_(); std::vector< unsigned int > camera_list = list_camera_serials(); // Check if id is in the camera enumeration if(std::find(camera_list.begin(), camera_list.end(), id) == camera_list.end()) { COMMA_THROW(comma::exception, "couldn't find camera with serial " + std::to_string(id)); } if (!connect(id, handle_, guid_)) { COMMA_THROW(comma::exception, "couldn't connect to serial " + std::to_string(id)); } assert_ok( bus_manager().GetInterfaceTypeFromGuid( &guid_, &interface_ ), "cannot determine interface for camera with serial " + std::to_string(id) ); //Get Point grey unique id (guid) from serial number. guid does not exist in CameraInfo, and so it does not appear in the camera list for( attributes_type::const_iterator i = attributes.begin(); i != attributes.end(); ++i ) { set_attribute( handle(), i->first, i->second ); } FlyCapture2::PixelFormat pixel_format; uint width, height; width = boost::lexical_cast<uint>( get_attribute( handle(), "width" ) ); height = boost::lexical_cast<uint>( get_attribute( handle(), "height" ) ); pixel_format = get_pixel_format_map()->right.at( get_attribute( handle(),"PixelFormat" ) ); total_bytes_per_frame_ = width * height * bits_per_pixel( pixel_format ) / 8; } ~impl() { close(); } void close() { if(handle_) { if( handle_->IsConnected() ) { handle_->StopCapture(); handle_->Disconnect(); } id_.reset(); handle_.reset(); } } void test() { FlyCapture2::StrobeInfo pStrobeInfo; FlyCapture2::StrobeControl pStrobe; assert_ok( handle()->GetStrobeInfo( &pStrobeInfo ), "no strobe info" ); std::cerr << "source " << pStrobeInfo.source << std::endl << "present " << pStrobeInfo.present << std::endl << "readOutSupported " << pStrobeInfo.readOutSupported << std::endl << "onOffSupported " << pStrobeInfo.onOffSupported << std::endl << "polaritySupported " << pStrobeInfo.polaritySupported << std::endl << "minValue " << pStrobeInfo.minValue << std::endl << "maxValue " << pStrobeInfo.maxValue << std::endl; assert_ok( handle()->GetStrobe( &pStrobe ), "no strobe" ); pStrobe.onOff = true; pStrobe.duration = 50.0; handle()->SetStrobe(&pStrobe); std::cerr << "source " << pStrobe.source << std::endl << "onOff " << pStrobe.onOff << std::endl << "polarity " << pStrobe.polarity << std::endl << "delay " << pStrobe.delay << std::endl << "duration " << pStrobe.duration << std::endl; } FlyCapture2::InterfaceType get_interface() const { return interface_; } std::pair< boost::posix_time::ptime, cv::Mat > read( ) { return read( when_ ); } std::pair< boost::posix_time::ptime, cv::Mat > read( const timestamp_policy & when ) { cv::Mat image_; std::pair< boost::posix_time::ptime, cv::Mat > pair; bool success = false; unsigned int retries = 0; while( !success && retries < max_retries ) { FlyCapture2::Error result; if( !started_ ) { result = handle_->StartCapture(); } // error is not checked as sometimes the camera will start correctly but return an error started_ = true; boost::posix_time::ptime timestamp = boost::posix_time::microsec_clock::universal_time(); success = collect_frame( image_, handle() , started_ ); if( success ) { pair.second = image_; switch( when.value ) { case camera::timestamp_policy::before: pair.first = timestamp; break; case camera::timestamp_policy::after: pair.first = boost::posix_time::microsec_clock::universal_time(); break; case camera::timestamp_policy::average: pair.first = timestamp + ( boost::posix_time::microsec_clock::universal_time() - timestamp ) / 2.0; break; default: COMMA_THROW( comma::exception, "logical error, moment not specified" ); } } retries++; } if( success ) { return pair; } COMMA_THROW( comma::exception, "snark_flycapture: failed to read frame" << std::endl) } const FlyCapture2::CameraBase* handle() const { return &*handle_; } FlyCapture2::CameraBase* handle() { return &*handle_; } unsigned int id() const { return *id_; } unsigned long total_bytes_per_frame() const { return total_bytes_per_frame_; } static std::vector< unsigned int > list_camera_serials() { std::vector< unsigned int > list; unsigned int num_cameras = 0; assert_ok( bus_manager().GetNumOfCameras( &num_cameras ), "cannot find point grey cameras" ); if ( num_cameras == 0 ) { COMMA_THROW(comma::exception, "no cameras found"); } // USB Cameras for (unsigned int i = 0; i < num_cameras; ++i) { unsigned int serial_number; assert_ok( bus_manager().GetCameraSerialNumberFromIndex(i, &serial_number ), "Error getting camera serial" ); list.push_back(serial_number); } // GigE Cameras // BUG DiscoverGigECameras will sometimes crash if there are devices on a different subnet FlyCapture2::CameraInfo cam_info[num_cameras]; assert_ok( FlyCapture2::BusManager::DiscoverGigECameras( cam_info, &num_cameras ), "cannot discover point grey cameras via GiGe interface" ); for (unsigned int i = 0; i < num_cameras; ++i) { list.push_back(cam_info[i].serialNumber); } return list; } static void disconnect(camerabase_ptr& base) { if (base) { base->StopCapture(); base->Disconnect(); base.reset(); } else { COMMA_THROW(comma::exception, "can't disconnect because camera not connected to this handle"); } } static bool connect(uint serial, camerabase_ptr& base, FlyCapture2::PGRGuid& guid) { // Instantiate the right camera type based on the interface FlyCapture2::InterfaceType interface; if (base) { COMMA_THROW(comma::exception, "camera already connected to this handle"); } assert_ok( bus_manager().GetCameraFromSerialNumber(serial, &guid), "cannot find camera with serial " + std::to_string(serial) ); assert_ok( bus_manager().GetInterfaceTypeFromGuid( &guid, &interface ), "cannot determine interface for camera with serial " + std::to_string(serial) ); switch(interface) { case FlyCapture2::INTERFACE_USB2: case FlyCapture2::INTERFACE_USB3: case FlyCapture2::INTERFACE_IEEE1394: base.reset(dynamic_cast<FlyCapture2::CameraBase*>(new FlyCapture2::Camera())); break; case FlyCapture2::INTERFACE_GIGE: base.reset(dynamic_cast<FlyCapture2::CameraBase*>(new FlyCapture2::GigECamera())); break; default: COMMA_THROW(comma::exception, "unknown interface for camera " + std::to_string(serial)); } FlyCapture2::Error error; if( (error = base->Connect(&guid)) != FlyCapture2::PGRERROR_OK) { std::cerr << "snark_flycapture: Failed to connect (" << error.GetDescription() << ")" << std::endl; return false; } return true; } static const std::string describe_camera(unsigned int serial) { FlyCapture2::CameraInfo camera_info; camerabase_ptr camera; FlyCapture2::PGRGuid guid; FlyCapture2::InterfaceType interface; if (!connect(serial, camera, guid)) { return "serial=" + std::to_string(serial) + ",ERROR"; } assert_ok( bus_manager().GetInterfaceTypeFromGuid( &guid, &interface ), "cannot determine interface for camera with serial " + std::to_string(serial) ); assert_ok( camera->GetCameraInfo( &camera_info ), "couldn't get camera info for camera with serial " + std::to_string(serial) ); disconnect(camera); char escape_chars[] = "\""; return "serial=\"" + std::to_string(camera_info.serialNumber) + "\"" + ",interface=\"" + comma::escape(get_interface_string(interface), escape_chars) + "\"" + ",model=\"" + comma::escape(camera_info.modelName, escape_chars) + "\"" + ",vendor=\"" + comma::escape(camera_info.vendorName, escape_chars) + "\"" + ",sensor=\"" + comma::escape(camera_info.sensorInfo, escape_chars) + "\"" + ",resolution=\"" + comma::escape(camera_info.sensorResolution, escape_chars) + "\"" + ",version=\"" + comma::escape(camera_info.firmwareVersion, escape_chars) + "\"" + ",build_time=\"" + comma::escape(camera_info.firmwareBuildTime, escape_chars) + "\""; } void software_trigger(bool broadcast) { handle_->FireSoftwareTrigger(broadcast); } private: friend class camera::multicam::impl; camerabase_ptr handle_; boost::optional< unsigned int > id_; FlyCapture2::PGRGuid guid_; std::vector< char > buffer_; uint total_bytes_per_frame_; bool started_; const timestamp_policy & when_; FlyCapture2::InterfaceType interface_; static FlyCapture2::BusManager& bus_manager() { static FlyCapture2::BusManager bm; return bm; } static void initialize_() {} /*quick and dirty*/ }; // multicam class camera::multicam::impl { public: impl( std::vector<camera_pair>& camera_pairs, const std::vector< unsigned int >& offsets, const timestamp_policy & when ) : good( false ), when_( when ) { for (camera_pair& pair : camera_pairs) { uint serial = pair.first; const attributes_type attributes = pair.second; cameras_.push_back(std::unique_ptr<camera::impl>(new camera::impl(serial, attributes, when))); } if (cameras_.size()) { good = true; } apply_offsets( offsets ); } ~impl() { } void trigger() { if (good) { for (auto& camera : cameras_) { camera->software_trigger(false); } } } void apply_offsets( const std::vector< unsigned int >& offsets ) { if( offsets.empty() ) { return; } camera::timestamp_policy when( camera::timestamp_policy::before ); // does not matter, read return value is unused if( cameras_.size() != offsets.size() ) { COMMA_THROW( comma::exception, "expected offsets number equal to number of cameras: " << cameras_.size() << "; got: " << offsets.size() ); } for( unsigned int i = 0; i < offsets.size(); ++i ) { for ( unsigned int j = 0; j < offsets[i]; ++j){ const auto pair = cameras_[i]->read( when ); } } } camera::multicam::frames_pair read( bool use_software_trigger ) { return read( when_, use_software_trigger ); } camera::multicam::frames_pair read( const camera::timestamp_policy & when, bool use_software_trigger ) { if (!good) { COMMA_THROW(comma::exception, "multicam read without good cameras"); } camera::multicam::frames_pair image_tuple; boost::posix_time::ptime timestamp = boost::posix_time::microsec_clock::universal_time(); if( use_software_trigger ) { trigger(); boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time(); timestamp = midpoint(timestamp, end); } for (auto& camera : cameras_) { const auto pair = camera->read( when ); image_tuple.second.push_back(pair.second); } if ( !use_software_trigger ) { if ( when.value == camera::timestamp_policy::after ) { timestamp = boost::posix_time::microsec_clock::universal_time(); } if ( when.value == camera::timestamp_policy::average ) { timestamp = timestamp + ( boost::posix_time::microsec_clock::universal_time() - timestamp ) / 2.0; } } image_tuple.first = timestamp; return image_tuple; } bool good; std::vector<std::unique_ptr<camera::impl>> cameras_; const timestamp_policy & when_; }; camera::timestamp_policy::timestamp_policy( const std::string & s ) : value( s == "before" ? before : ( s == "after" ? after : ( s == "average" ? average : none ) ) ) { if ( value == none ) { COMMA_THROW( comma::exception, "timestamp policy is not one of '" << list() << "'" ); } } camera::timestamp_policy::operator std::string() const { switch( value ) { case none : return "none"; case before : return "before"; case after : return "after"; case average: return "average"; } return "none"; // to avoid a warning } } } } //namespace snark{ namespace cameras{ namespace flycapture{ namespace snark{ namespace cameras{ namespace flycapture { // flycapture class camera::camera( unsigned int id, const camera::attributes_type& attributes, const timestamp_policy & when ) : pimpl_( new impl( id, attributes, when ) ) {} camera::~camera() { } FlyCapture2::InterfaceType camera::get_interface() const { return pimpl_->get_interface(); } std::pair< boost::posix_time::ptime, cv::Mat > camera::read( const camera::timestamp_policy & when ) { return pimpl_->read( when ); } std::pair< boost::posix_time::ptime, cv::Mat > camera::read( ) { return pimpl_->read( ); } void camera::close() { pimpl_->close(); } std::vector< unsigned int > camera::list_camera_serials() { return camera::impl::list_camera_serials(); } const std::string camera::describe_camera(unsigned int serial) { return camera::impl::describe_camera(serial); } unsigned int camera::id() const { return pimpl_->id(); } unsigned long camera::total_bytes_per_frame() const { return pimpl_->total_bytes_per_frame(); } camera::attributes_type camera::attributes() const { return get_attributes( pimpl_->handle() ); } // camera::multicam class camera::multicam::multicam( std::vector<camera_pair>& cameras, const std::vector< unsigned int >& offsets, const timestamp_policy & when ) : pimpl_( new multicam::impl( cameras, offsets, when ) ) {} camera::multicam::~multicam() { delete pimpl_; } bool camera::multicam::good() const { return pimpl_->good; } uint camera::multicam::num_cameras() const { return pimpl_->cameras_.size(); } void camera::multicam::trigger() { pimpl_->trigger(); } camera::multicam::frames_pair camera::multicam::read( const camera::timestamp_policy & when, bool use_software_trigger ) { return pimpl_->read( when, use_software_trigger ); } camera::multicam::frames_pair camera::multicam::read( bool use_software_trigger ) { return pimpl_->read( use_software_trigger ); } } } } //namespace snark{ namespace cameras{ namespace flycapture{ // FlyCapture2::BusManager snark::cameras::flycapture::camera::impl::bus_manager();
43.217039
206
0.582183
[ "vector", "model" ]
69a88ce407d3f202a8c5c8aa423291bc25b4b551
2,199
cpp
C++
compiler/src/ast/type/ast_typecreating_node.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
15
2017-08-15T20:46:44.000Z
2021-12-15T02:51:13.000Z
compiler/src/ast/type/ast_typecreating_node.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
null
null
null
compiler/src/ast/type/ast_typecreating_node.cpp
TuplexLanguage/tuplex
fc436c78224522663e40e09d36f83570fd76ba2d
[ "Apache-2.0" ]
1
2017-09-28T14:48:15.000Z
2017-09-28T14:48:15.000Z
#include "ast_typecreating_node.hpp" #include "ast/ast_entitydecls.hpp" #include "symbol/type_registry.hpp" #include "tx_logging.hpp" #include "tx_error.hpp" void TxTypeCreatingNode::typeexpr_declaration_pass() { // The context of this node represents its outer scope. // The type expression's created type entity, if any, represents its inner scope. if (this->declaration) this->lexContext._scope = this->declaration->get_symbol(); } void TxTypeCreatingNode::type_pass() { auto type = this->resolve_type( TXR_TYPE_CREATION ); //const_cast<TxActualType*>(type.type())->integrate(); } TxQualType TxTypeCreatingNode::define_type( TxTypeResLevel typeResLevel ) { return this->create_type( typeResLevel ); } // an attempt to make types resolve base types immediately, and parameters later (here): //TxQualType TxTypeCreatingNode::resolve_type( TxPassInfo typeResLevel ) { // bool previouslyCreated = bool( this->_type ); // auto type = TxTypeExpressionNode::resolve_type( typeResLevel ); // if ( !previouslyCreated && typeResLevel == TXP_TYPE ) // const_cast<TxActualType*>(type.type())->resolve_params( TXP_TYPE ); // return type; //} const TxActualType* TxAliasTypeNode::create_type( TxTypeResLevel typeResLevel ) { // create alias (a declaration referring to a type already declared and defined elsewhere) return this->baseTypeNode->resolve_type( typeResLevel ).type(); } void TxGenParamTypeNode::set_requires_mutable( bool mut ) { TxTypeExpressionNode::set_requires_mutable( mut ); this->constraintTypeNode->set_requires_mutable( mut ); // FIXME: investigate how to determine this } const TxActualType* TxGenParamTypeNode::create_type( TxTypeResLevel typeResLevel ) { // create empty specialization (uniquely named but identical type) return this->registry().create_type( this->get_declaration(), this->constraintTypeNode, std::vector<const TxTypeExpressionNode*>(), true /*this->requires_mutable_type()*/ ); } TxTypeClass TxGenParamTypeNode::resolve_type_class() { return this->constraintTypeNode->resolve_type_class(); }
37.913793
103
0.719873
[ "vector" ]
69b85823c7f4d14c2d6ce9c18557b8381ba0a1a0
21,337
cpp
C++
elfling.cpp
google/elfling
35164742157c2ab04c8fea693256e8a154c02133
[ "Apache-2.0" ]
26
2015-01-28T08:28:22.000Z
2021-06-29T23:08:29.000Z
elfling.cpp
google/elfling
35164742157c2ab04c8fea693256e8a154c02133
[ "Apache-2.0" ]
null
null
null
elfling.cpp
google/elfling
35164742157c2ab04c8fea693256e8a154c02133
[ "Apache-2.0" ]
11
2015-01-25T18:38:56.000Z
2021-07-12T12:25:06.000Z
// Copyright 2014 Google Inc. 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. // // elfling - a linking compressor for ELF files by Minas ^ Calodox #include <elf.h> #include <malloc.h> #include <stdio.h> #include <string.h> #include <map> #include <set> #include <string> #include <vector> #include "header32.h" #include "header64.h" #include "pack.h" bool verbose = false; typedef unsigned char u8; typedef unsigned int u32; typedef unsigned long long u64; template<int bits> struct Elf { }; template<> struct Elf<32> { typedef Elf32_Shdr Shdr; typedef Elf32_Phdr Phdr; typedef Elf32_Ehdr Ehdr; typedef Elf32_Sym Sym; typedef Elf32_Rel Rel; typedef Elf32_Rela Rela; }; template<> struct Elf<64> { typedef Elf64_Shdr Shdr; typedef Elf64_Phdr Phdr; typedef Elf64_Ehdr Ehdr; typedef Elf64_Sym Sym; typedef Elf64_Rel Rel; typedef Elf64_Rela Rela; }; template<int bits> class Section { typedef Elf<bits> E; public: Section(const char* name) : name_(name) {} ~Section() { delete[] data_; } void Set(const void* data, u32 size) { if (size > limit_) { delete[] data_; data_ = new u8[size]; limit_ = size; } memcpy(data_, data, size); size_ = size; } void Reset() { size_ = 0; } void Append(const void* data, u32 size) { if (size + size_ > limit_) { limit_ = (size + size_ + 0x0fff) & (~0x0fff); u8* nd = new u8[limit_]; memcpy(nd, data_, size_); delete[] data_; data_ = nd; } memcpy(&data_[size_], data, size); size_ += size; } void SetHdr(const typename E::Shdr& hdr) { hdr_ = hdr; } const typename E::Shdr& Hdr() const { return hdr_; } const std::string& Name() const { return name_; } const u8* Data() const { return data_; } u32 Size() const { return size_; } protected: std::string name_; u32 size_ = 0; u32 limit_ = 0; u8* data_ = nullptr; typename E::Shdr hdr_; }; class MemFile { public: MemFile() {} ~MemFile() { delete[] data_; } bool Load(const char* fn) { name_ = fn; FILE* fptr = fopen(fn, "rb"); if (!fptr) { printf("Could not open %s\n", fn); return false; } fseek(fptr, 0, SEEK_END); size_ = ftell(fptr); fseek(fptr, 0, 0); data_ = new u8[size_]; u32 rl = fread(data_, 1, size_, fptr); if (size_ != rl) { printf("Could not read %s\n", fn); return false; } fclose(fptr); return true; } const char* Name() const { return name_.c_str(); } const u8* Data() const { return data_; } size_t Size() const { return size_; } private: u8* data_ = nullptr; size_t size_ = 0; std::string name_; }; template<int bits> class Image { typedef Elf<bits> E; public: Image() {} ~Image() { for (Section<bits>* s : sections_) { delete s; } } bool Load(MemFile* f) { const u8* obj = f->Data(); u8 elfMagic[4] = {0x7f, 0x45, 0x4c, 0x46}; memcpy(&ehdr_, obj, sizeof(ehdr_)); if (memcmp(ehdr_.e_ident, elfMagic, 4)) { printf("Invalid header signature in %s\n", f->Name()); return false; } if (ehdr_.e_phnum) { if (ehdr_.e_phentsize != sizeof(typename E::Phdr)) { printf("Object %s has unexpected e_phentsize (%d != %lu)\n", f->Name(), ehdr_.e_phentsize, sizeof(typename E::Phdr)); return false; } memcpy(phdr_, &obj[ehdr_.e_phoff], ehdr_.e_phnum * ehdr_.e_phentsize); } if (ehdr_.e_shentsize != sizeof(typename E::Shdr)) { printf("Object %s has unexpected e_shentsize (%d != %lu)\n", f->Name(), ehdr_.e_shentsize, sizeof(typename E::Shdr)); return false; } memcpy(shdr_, &obj[ehdr_.e_shoff], ehdr_.e_shnum * ehdr_.e_shentsize); // Get the strings for now char* strings = (char*)&obj[shdr_[ehdr_.e_shstrndx].sh_offset]; for (u32 i = 0; i < ehdr_.e_shnum; ++i) { if (verbose) printf("Loading section '%s' at offset 0x%x, %d bytes\n", &strings[shdr_[i].sh_name], (u32)shdr_[i].sh_offset, (int)shdr_[i].sh_size); Section<bits>* s = new Section<bits>(&strings[shdr_[i].sh_name]); if (shdr_[i].sh_type != SHT_NOBITS) { s->Set(&obj[shdr_[i].sh_offset], shdr_[i].sh_size); } s->SetHdr(shdr_[i]); sectionMap_[s->Name()] = s; sections_.push_back(s); } return true; } u32 SectionCount() const { return sections_.size(); } Section<bits>* GetSection(const char* str) { typename std::map<std::string, Section<bits>*>::iterator it = sectionMap_.find(str); if (it == sectionMap_.end()) { return nullptr; } return it->second; } Section<bits>* GetSection(u32 s) { if (s < sections_.size()) { return sections_[s]; } return nullptr; } private: typename E::Ehdr ehdr_; typename E::Phdr phdr_[64]; typename E::Shdr shdr_[256]; std::map<std::string, Section<bits>*> sectionMap_; std::vector<Section<bits>*> sections_; }; const u32 base = 0x08000000; u32 rol(u32 v, u32 s) { return (v << s) | ( v >> (32 - s)); } u32 hash(const char* str) { u32 rv = 0; for (const char* a = str; *a; ++a) { rv ^= *a; rv = rol(rv, 5); } rv = rol(rv, 5); return rv; } std::map<char, std::set<std::string>> args; bool HasFlag(const char* flag) { return args['f'].find(flag) != args['f'].end(); } const char* FlagWithDefault(char f, const char* def) { if (args[f].size() > 0) { return args[f].begin()->c_str(); } else { return def; } } void Invert(u8* data, u32 s) { for (u32 i = 0; i < s >> 1; ++i) { u8 t = data[i]; data[i] = data[s - i - 1]; data[s - i - 1] = t; } } template<int bits> class Linker { typedef typename Elf<bits>::Sym Sym; typedef typename Elf<bits>::Rel Rel; typedef typename Elf<bits>::Rela Rela; public: bool Link(MemFile* o) { Image<bits> obj; if (!obj.Load(o)) { return false; } // Start off by finding the _start symbol. Section<bits>* symtab = obj.GetSection(".symtab"); Sym* symbols = (Sym*)symtab->Data(); char* symbolNames = (char*)obj.GetSection(symtab->Hdr().sh_link)->Data(); u32 startSection = 0; u32 startOffset = 0; { u32 sc = symtab->Size() / sizeof(Sym); for (u32 i = 0; i < sc; ++i) { // The ELF32_ST_XXX macros are identical to ELF64_ST_XXX. if (!strcmp(&symbolNames[symbols[i].st_name], "_start")) { startSection = symbols[i].st_shndx; startOffset = symbols[i].st_value; } } } std::set<std::string> imports; std::map<std::string, u32> sections; std::map<u32, u32> common; u32 commonOff = 0; Section<bits>* bss = obj.GetSection(".bss"); sections[".text"] = 0; if (bss) { commonOff += bss->Size(); } for (u32 i = 0; i < obj.SectionCount(); ++i) { if (!strncmp(obj.GetSection(i)->Name().c_str(), ".rel.", 5) && bits == 32) { if (bits != 32) { printf("Unsupported relocation: .rel with 64 bits\n"); return false; } Section<bits>* rel = obj.GetSection(i); Rel* tr = (Rel*)rel->Data(); for (u32 j = 0; j < rel->Size() / sizeof(Rel); ++j) { u32 sym = ELF32_R_SYM(tr[j].r_info); u32 type = ELF32_R_TYPE(tr[j].r_info); if (symbols[sym].st_shndx && symbols[sym].st_shndx < obj.SectionCount()) { if (obj.GetSection(symbols[sym].st_shndx)->Name() != ".bss") { sections[obj.GetSection(symbols[sym].st_shndx)->Name()] = 0; } } if (ELF32_ST_TYPE(symbols[sym].st_info) == STT_NOTYPE && ELF32_ST_BIND(symbols[sym].st_info) == STB_GLOBAL) { imports.insert(&symbolNames[symbols[sym].st_name]); } if (symbols[sym].st_shndx == SHN_COMMON && common.find(symbols[sym].st_name) == common.end()) { common[symbols[sym].st_name] = commonOff; commonOff += symbols[sym].st_size; } } } else if (!strncmp(obj.GetSection(i)->Name().c_str(), ".rela.", 6)) { if (bits != 64) { printf("Unsupported relocation: .rela with 32 bits\n"); return false; } Section<bits>* rel = obj.GetSection(i); Rela* tr = (Rela*)rel->Data(); for (u32 j = 0; j < rel->Size() / sizeof(Rela); ++j) { u32 sym = ELF64_R_SYM(tr[j].r_info); u32 type = ELF64_R_TYPE(tr[j].r_info); if (symbols[sym].st_shndx && symbols[sym].st_shndx < obj.SectionCount()) { if (obj.GetSection(symbols[sym].st_shndx)->Name() != ".bss") { sections[obj.GetSection(symbols[sym].st_shndx)->Name()] = 0; } } if (ELF32_ST_TYPE(symbols[sym].st_info) == STT_NOTYPE && ELF32_ST_BIND(symbols[sym].st_info) == STB_GLOBAL) { imports.insert(&symbolNames[symbols[sym].st_name]); } if (symbols[sym].st_shndx == SHN_COMMON && common.find(symbols[sym].st_name) == common.end()) { common[symbols[sym].st_name] = commonOff; commonOff += symbols[sym].st_size; } } } } const char* sig = "XXXX-Compressed code here-XXXX"; u32 sz = 0; for (const u8* compoff = Header(); compoff < Header() + HeaderSize() - strlen(sig); ++compoff) { if (!memcmp(compoff, sig, strlen(sig))) { sz = compoff - Header(); break; } } u8* finalout = (u8*)malloc(65536); u32 finalsize = HeaderSize() - strlen(sig) - sz; memcpy(finalout, &Header()[sz + strlen(sig)], finalsize); u32 tailoff = finalsize; u32 hashoff = finalsize; for (const std::string& imp : imports) { if (verbose) printf("Import %-15s @ 0x%8.8x\n", imp.c_str(), finalsize); if (bits == 32) { // 5 byte jump table entries: // e9 xx xx xx xx jmp dword relative finalout[finalsize++] = 0xe9; *(u32*)&finalout[finalsize] = hash(imp.c_str()); finalsize += 4; } else { // 14 byte jump table entries: // ff 25 00 00 00 00 jmp [rip + rel] // xx xx xx xx xx xx xx xx absolute destination of jump finalout[finalsize++] = 0xff; finalout[finalsize++] = 0x25; *(u32*)&finalout[finalsize] = 0; finalsize += 4; *(u64*)&finalout[finalsize] = hash(imp.c_str()); finalsize += 8; } } // Add one more entry with all zeroes for termination. for (int i = 0; i < (bits == 32 ? 5 : 14); ++i) { finalout[finalsize++] = 0; } // Put in entry point as relative 32-bit address. The assembly header ends // with a relative jump. *(u32*)&finalout[tailoff - 4] = finalsize + startOffset - tailoff; // We now have a list of all referenced sections, locate them in the final // binary. u32 textoff = 0; for (auto& sec : sections) { // Take all sections starting with ".text" if (!strncmp(sec.first.c_str(), ".text", 5)) { sec.second = finalsize; textoff = finalsize; printf("Section %-15s @ 0x%8.8x\n", sec.first.c_str(), finalsize); finalsize += obj.GetSection(sec.first.c_str())->Size(); } } for (auto& sec : sections) { // Take all sections not starting with ".text" if (strncmp(sec.first.c_str(), ".text", 5)) { sec.second = finalsize; printf("Section %-15s @ 0x%8.8x\n", sec.first.c_str(), finalsize); finalsize += obj.GetSection(sec.first.c_str())->Size(); } } for (auto& sec : sections) { // Copy section contents. memcpy(&finalout[sec.second], obj.GetSection(sec.first.c_str())->Data(), obj.GetSection(sec.first.c_str())->Size()); } u32 commonbase = (finalsize + 255) & (~255); if (bss) { sections[".bss"] = commonbase; printf("Section .bss @ 0x%8.8x\n", commonbase); commonbase += bss->Size(); } // Apply text relocations. for (u32 i = 0; i < obj.SectionCount(); ++i) { if (!strncmp(obj.GetSection(i)->Name().c_str(), ".rel.", 5)) { const char* secName = obj.GetSection(i)->Name().c_str() + 4; if (sections.find(secName) == sections.end()) continue; if (verbose) printf("Relocating %s\n", secName); Section<bits>* rel = obj.GetSection(i); Rel* tr = (Rel*)rel->Data(); u32 trc = rel->Size() / sizeof(Rel); Sym* st = (Sym*)obj.GetSection(rel->Hdr().sh_link)->Data(); char* sn = (char*)obj.GetSection(obj.GetSection(rel->Hdr().sh_link)->Hdr().sh_link)->Data(); u32 secoff = sections[secName]; for (u32 j = 0; j < trc; ++j) { u32 sym, type; sym = ELF32_R_SYM(tr[j].r_info); type = ELF32_R_TYPE(tr[j].r_info); u32* off = (u32*)&finalout[secoff + tr[j].r_offset]; u32 b = 0; const char* bind = "*"; switch (ELF32_ST_BIND(symbols[sym].st_info)) { case STB_LOCAL: bind = "STB_LOCAL"; break; case STB_GLOBAL: bind = "STB_GLOBAL"; break; case STB_WEAK: bind = "STB_WEAK"; break; } const char* types = "*"; switch (ELF32_ST_TYPE(symbols[sym].st_info)) { case STT_NOTYPE: types = "STT_NOTYPE"; break; case STT_OBJECT: types = "STT_OBJECT"; break; case STT_FUNC: types = "STT_FUNC"; break; case STT_SECTION: types = "STT_SECTION"; break; case STT_FILE: types = "STT_FILE"; break; } if (verbose) printf(" %3d %4x %2d %3d %-20s %-10s %-10s %4x %4x %x %-s %x\n", j, (u32)tr[j].r_offset, type, sym, &symbolNames[symbols[sym].st_name], bind, types, (u32)symbols[sym].st_value, (u32)symbols[sym].st_size, symbols[sym].st_other, symbols[sym].st_shndx < obj.SectionCount() ? obj.GetSection(symbols[sym].st_shndx)->Name().c_str() : "*", symbols[sym].st_shndx); u32 sec = st[sym].st_shndx; if (sec && sec < obj.SectionCount()) { b = base + sections[obj.GetSection(st[sym].st_shndx)->Name()] + symbols[sym].st_value; } else if (sec == SHN_COMMON) { b = base + commonbase + common[st[sym].st_name]; } else if (sec == 0) { u32 func = 0; for (const std::string& imp : imports) { if (imp == &symbolNames[symbols[sym].st_name]) break; ++func; } b = hashoff + 5 * func + base; } else { printf("Unknown section %x\n", sec); } if (type == R_386_32) { *off += b + 0x10000; } else if (type == R_386_PC32) { *off += b - tr[j].r_offset - secoff - base; } else { printf("Unknown type %d\n", type); } } } else if (!strncmp(obj.GetSection(i)->Name().c_str(), ".rela.", 6)) { const char* secName = obj.GetSection(i)->Name().c_str() + 5; if (sections.find(secName) == sections.end()) continue; if (verbose) printf("Relocating %s\n", secName); Section<bits>* rel = obj.GetSection(i); Rela* tr = (Rela*)rel->Data(); u32 trc = rel->Size() / sizeof(Rela); Sym* st = (Sym*)obj.GetSection(rel->Hdr().sh_link)->Data(); char* sn = (char*)obj.GetSection(obj.GetSection(rel->Hdr().sh_link)->Hdr().sh_link)->Data(); u32 secoff = sections[secName]; for (u32 j = 0; j < trc; ++j) { u32 sym, type; sym = ELF64_R_SYM(tr[j].r_info); type = ELF64_R_TYPE(tr[j].r_info); u32* off = (u32*)&finalout[secoff + tr[j].r_offset]; u32 b = 0; const char* bind = "*"; switch (ELF32_ST_BIND(symbols[sym].st_info)) { case STB_LOCAL: bind = "STB_LOCAL"; break; case STB_GLOBAL: bind = "STB_GLOBAL"; break; case STB_WEAK: bind = "STB_WEAK"; break; } const char* types = "*"; switch (ELF32_ST_TYPE(symbols[sym].st_info)) { case STT_NOTYPE: types = "STT_NOTYPE"; break; case STT_OBJECT: types = "STT_OBJECT"; break; case STT_FUNC: types = "STT_FUNC"; break; case STT_SECTION: types = "STT_SECTION"; break; case STT_FILE: types = "STT_FILE"; break; } if (verbose) printf(" %3d %4x[%4x] %d %3d %-20s %-10s %-10s %4x %4x %x %-s %x\n", j, (u32)tr[j].r_offset, (u32)(secoff + tr[j].r_offset), type, sym, &symbolNames[symbols[sym].st_name], bind, types, (u32)symbols[sym].st_value, (u32)symbols[sym].st_size, symbols[sym].st_other, symbols[sym].st_shndx < obj.SectionCount() ? obj.GetSection(symbols[sym].st_shndx)->Name().c_str() : "*", symbols[sym].st_shndx); u32 sec = st[sym].st_shndx; if (sec && sec < obj.SectionCount()) { b = base + sections[obj.GetSection(st[sym].st_shndx)->Name()] + symbols[sym].st_value; } else if (sec == SHN_COMMON) { b = base + commonbase + common[st[sym].st_name]; } else if (sec == 0) { u32 func = 0; for (const std::string& imp : imports) { if (imp == &symbolNames[symbols[sym].st_name]) break; ++func; } b = hashoff + 14 * func + base; } else { printf("Unknown section %x\n", sec); } if (type == R_X86_64_64) { *(u64*)off += b + 0x10000 + tr[j].r_addend; } else if (type == R_X86_64_32) { *off += b + 0x10000 + tr[j].r_addend; } else if (type == R_X86_64_PC32) { *off += b - tr[j].r_offset - secoff - base + tr[j].r_addend; } else { printf("Unknown type %d\n", type); } } } } FILE* tmpout = fopen("test/tmp", "wb"); fwrite(finalout, finalsize, 1, tmpout); fclose(tmpout); u8* bin = (u8*)malloc(65536); u8* data = (u8*)malloc(65536); int ds = 65536; Compressor* c = new Compressor(); CompressionParameters params; params.FromString(FlagWithDefault('c', "")); c->Compress(&params, finalout, finalsize, data + 8, &ds); Invert(data + 8, ds); memcpy(data, &Header()[sz - 8], 8); // Sanity check our compressed data by decompressing it again. memset(bin, 0, 65536); c->Decompress(&params, &data[8 + ds - 4], bin + 8, finalsize); if (memcmp(finalout, bin + 8, finalsize)) { printf("Decompression failed, first 10 different bytes\n"); int c = 0; for (int i = 0; i < finalsize; ++i) { if (finalout[i] != bin[i + 8]) { printf("%6x: %2.2x != %2.2x\n", i, finalout[i], bin[i + 8]); c++; if (c == 10) break; } } } memcpy(bin, Header(), sz); memcpy(&bin[sz], data + 8, ds); sz += ds; // Set pointer to last 4 bytes of compressed data in code. The address may // need adjusting if the header assembly changes. if (bits == 32) { *(u32*)&bin[0xd8] = 0x08000000 + sz - 4; } else { *(u32*)&bin[0x169] = 0x08000000 + sz - 4; } // Place size of decompressed data in bits at end of image. *(u32*)&bin[sz] = finalsize * 8; // Add compression parameters to end of image. memcpy(&bin[sz + 4], params.weights, params.contextCount); memcpy(&bin[sz + 4 + params.contextCount], params.contexts, params.contextCount); sz += 4 + 2 * params.contextCount; // Place file size in ELF header. if (bits == 32) { *(u32*)&bin[0x7c] = sz; } else { *(u64*)&bin[0xc8] = sz; } FILE* fptr = fopen(FlagWithDefault('o', "c.out"), "wb"); fwrite(bin, sz, 1, fptr); fclose(fptr); printf("Wrote %d bytes\n", sz); } private: inline const u8* Header(); inline u32 HeaderSize(); }; template<> const u8* Linker<32>::Header() { return header32; } template<> const u8* Linker<64>::Header() { return header64; } template<> u32 Linker<32>::HeaderSize() { return sizeof(header32); } template<> u32 Linker<64>::HeaderSize() { return sizeof(header64); } int main(int argc, char* argv[]) { for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-') { if (argv[i][1]) { args[argv[i][1]].insert(std::string(&argv[i][2])); } } else { args['i'].insert(argv[i]); } } verbose = HasFlag("verbose"); if (args['i'].size() == 0) { printf("No obj specified\n"); return 1; } const char* fn = args['i'].begin()->c_str(); MemFile o; if (!o.Load(fn)) { return 0; } u16 arch = *(u16*)&o.Data()[18]; if (arch == 3) { printf("Arch: i386\n"); Linker<32> l; l.Link(&o); } else if (arch == 62) { printf("Arch: x86_64\n"); Linker<64> l; l.Link(&o); } else { printf("Cannot handle architecture in %s (arch = %2.2x)\n", fn, arch); return 1; } }
33.976115
144
0.558982
[ "object", "vector", "3d" ]
69bdf820f02cf9e2ffc86bcc6b694adc60db790a
825
cpp
C++
PolynomialCalculator/src/checker.cpp
Austin4705/CodingQuestions
78742097c450d307c7015a2d9e072c42584fb099
[ "MIT" ]
null
null
null
PolynomialCalculator/src/checker.cpp
Austin4705/CodingQuestions
78742097c450d307c7015a2d9e072c42584fb099
[ "MIT" ]
null
null
null
PolynomialCalculator/src/checker.cpp
Austin4705/CodingQuestions
78742097c450d307c7015a2d9e072c42584fb099
[ "MIT" ]
null
null
null
// // Created by austi on 8/30/2020. // #include <string> #include "checker.h" #include <vector> using std::string; bool checker::rudimentaryCheck(string input) {//checks if all characters in the string are valid, invalid char are put into a dynamic array to be shown to the user bool badCharFlag = false; for (char c: input) { switch (c) { case ' ': case '0' ... '9': case '+': case '-': //case '/': case '^': case '*': //case '%': case 'x': break; default: badCharFlag = true; flagChar.push_back(c); break; } } if (badCharFlag == 1) { return true; } else{ return false; } }
20.625
163
0.455758
[ "vector" ]
69c2b0badedba0b0089397b9f15e9b1bc9e24a48
1,231
hpp
C++
cpp_make/include/request_manager.hpp
likun97/Low_quality_classification_with_mobilenetv3
a9e6f66caad937fc7c8e101cddb76f116219b255
[ "Apache-2.0" ]
null
null
null
cpp_make/include/request_manager.hpp
likun97/Low_quality_classification_with_mobilenetv3
a9e6f66caad937fc7c8e101cddb76f116219b255
[ "Apache-2.0" ]
null
null
null
cpp_make/include/request_manager.hpp
likun97/Low_quality_classification_with_mobilenetv3
a9e6f66caad937fc7c8e101cddb76f116219b255
[ "Apache-2.0" ]
null
null
null
#ifndef REQUEST_MANAGET_HPP #define REQUEST_MANAGET_HPP #include "base_task.hpp" #include "request.hpp" #include "configuration.hpp" #include "wait_list.hpp" #include <list> #include <vector> #include <FreeImage.h> class request_manager : public base_task { public: static request_manager *Instance() { static request_manager r; return &r; } int open(client_configuration *conf) { int num = conf->reqmng_num; pthread_mutex_init(&qo_mutex, NULL); FreeImage_Initialise(); return base_task::open(num); } int close() { active = false; pthread_mutex_destroy(&qo_mutex); base_task::close(); FreeImage_DeInitialise(); return 0; } ~request_manager() { } //void insert_request(void *r); public: std::list<void *> _qo_request; //to qo pthread_mutex_t qo_mutex; private: int svc(); cv::Mat bitMap2Mat(FIBITMAP* fiBmp, const FREE_IMAGE_FORMAT &fif); int gif2Mat(char* data, size_t dataSize, cv::Mat& singleImg); }; #endif
21.224138
74
0.562145
[ "vector" ]
69cde0113f4cb1f2dca59872aa53110359ddbe8d
2,055
cpp
C++
test/sorted_static_vector_test.cpp
decimad/microlib
49abf34316d06839fbef618726d4a8e77c062210
[ "BSL-1.0" ]
null
null
null
test/sorted_static_vector_test.cpp
decimad/microlib
49abf34316d06839fbef618726d4a8e77c062210
[ "BSL-1.0" ]
null
null
null
test/sorted_static_vector_test.cpp
decimad/microlib
49abf34316d06839fbef618726d4a8e77c062210
[ "BSL-1.0" ]
null
null
null
// Copyright Michael Steinberg 2015 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include "sorted_static_vector_test.hpp" #include "stdafx.h" #include <chrono> #include <iostream> #include <microlib/sorted_static_vector.hpp> namespace { unsigned int a = 1140671485; unsigned int c = 12820163; unsigned int seed = 123541236; unsigned int myrand() { return seed = ((seed * a + c) & 0xFFFFFF); } } // namespace void sorted_static_vector_test() { ulib::sorted_static_vector<int, 1024> heap; unsigned int pushes = 0; unsigned int pops = 0; std::cout << "Sorted Vector test:\n\n"; auto begin = std::chrono::high_resolution_clock::now(); for (unsigned int i = 0; i < 10000000; ++i) { for (unsigned int j = 0; j < (myrand() % (heap.capacity() - heap.size() + 1)); ++j) { heap.emplace_binary(myrand()); ++pushes; } for (unsigned int j = 0; j < (myrand() % (heap.size() + 1)); ++j) { if (myrand() % 2) { heap.pop_back(); // pop_max(); } else { heap.pop_front(); // pop_min(); } ++pops; } } auto end = std::chrono::high_resolution_clock::now(); std::cout << "Pushes: " << pushes << "\n"; std::cout << "Pops: " << pops << "\n"; std::cout << "Time: " << std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << "us\n"; std::cout << "Ops/us: " << double(pushes + pops) / std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << "\n\n"; std::cout << "Popping: " << heap.max_element() << "\n"; heap.pop_back(); /* while (heap.size()) { std::cout << "Popping: " << heap.max_element() << "\n"; heap.pop_back(); } */ std::cout << "\n"; bool break_here = true; }
26.688312
140
0.53382
[ "vector" ]
69d020dde1751186e00972d40a3ceb84c82adf09
1,136
cpp
C++
src/debugger/client/tcp_attach.cpp
HaiyongLi/LuaDebugCode
8a12e5b21ab5fb74b7b5cd1b50393191df1382ca
[ "MIT" ]
2
2019-09-29T07:06:32.000Z
2021-09-10T09:46:19.000Z
src/debugger/client/tcp_attach.cpp
HaiyongLi/LuaDebugCode
8a12e5b21ab5fb74b7b5cd1b50393191df1382ca
[ "MIT" ]
null
null
null
src/debugger/client/tcp_attach.cpp
HaiyongLi/LuaDebugCode
8a12e5b21ab5fb74b7b5cd1b50393191df1382ca
[ "MIT" ]
null
null
null
#include <debugger/client/tcp_attach.h> #include <debugger/client/stdinput.h> #include <base/util/format.h> tcp_attach::tcp_attach(stdinput& io_) : poller() , io(io_) , base_type(&poller) { net::socket::initialize(); } bool tcp_attach::event_in() { if (!base_type::event_in()) return false; std::vector<char> tmp(base_type::recv_size()); size_t len = base_type::recv(tmp.data(), tmp.size()); if (len == 0) return true; io.raw_output(tmp.data(), len); return true; } void tcp_attach::send(const std::string& rp) { base_type::send(base::format("Content-Length: %d\r\n\r\n", rp.size())); base_type::send(rp.data(), rp.size()); } void tcp_attach::send(const vscode::rprotocol& rp) { rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); rp.Accept(writer); base_type::send(base::format("Content-Length: %d\r\n\r\n", buffer.GetSize())); base_type::send(buffer.GetString(), buffer.GetSize()); } void tcp_attach::event_close() { base_type::event_close(); exit(0); } void tcp_attach::update() { poller.wait(1000, 0); std::string buf; while (io.input(buf)) { send(buf); } }
21.037037
79
0.685739
[ "vector" ]
69d059c330109e6c261aed27d9d54c5b013f5214
934
cpp
C++
tests/cosma_test.cpp
simonpintarelli/COSMA
db26aeac475e3b0a15d36d74e56514392d3e8e00
[ "BSD-3-Clause" ]
null
null
null
tests/cosma_test.cpp
simonpintarelli/COSMA
db26aeac475e3b0a15d36d74e56514392d3e8e00
[ "BSD-3-Clause" ]
1
2020-04-29T17:46:25.000Z
2020-04-29T17:46:25.000Z
tests/cosma_test.cpp
simonpintarelli/COSMA
db26aeac475e3b0a15d36d74e56514392d3e8e00
[ "BSD-3-Clause" ]
null
null
null
#include <algorithm> #include <cctype> #include <cstdlib> #include <fstream> #include <iostream> #include <string> #include <vector> #include "../utils/parse_strategy.hpp" #include "../utils/cosma_utils.hpp" using namespace cosma; int main(int argc, char **argv) { MPI_Init(&argc, &argv); int P, rank; MPI_Comm_size(MPI_COMM_WORLD, &P); MPI_Comm_rank(MPI_COMM_WORLD, &rank); Strategy strategy = (Strategy) parse_strategy(argc, argv); auto ctx = cosma::make_context<double>(); if (rank == 0) { std::cout << "Strategy = " << strategy << std::endl; } // first run without overlapping communication and computation bool isOK = test_cosma<double>(strategy, ctx, MPI_COMM_WORLD, false); // then run with the overlap of communication and computation isOK = isOK && test_cosma<double>(strategy, ctx, MPI_COMM_WORLD, true); MPI_Finalize(); return rank == 0 ? !isOK : 0; }
26.685714
75
0.672377
[ "vector" ]
69d11179144a05416af55fbd5e65c507f5624219
377
hpp
C++
src/include/types/function.hpp
Yukikamome316/MineCode
65ffbd06a05f09c11cbd43c4de934f97eaffca6d
[ "MIT" ]
17
2020-12-07T10:58:03.000Z
2021-09-10T05:49:38.000Z
src/include/types/function.hpp
Yukikamome316/MineCode
65ffbd06a05f09c11cbd43c4de934f97eaffca6d
[ "MIT" ]
2
2021-05-16T18:45:36.000Z
2021-10-20T13:02:35.000Z
src/include/types/function.hpp
Yukikamome316/MineCode
65ffbd06a05f09c11cbd43c4de934f97eaffca6d
[ "MIT" ]
8
2021-01-11T09:11:21.000Z
2021-09-02T17:52:46.000Z
#pragma once #ifndef PARSER_FUNCTION_H #define PARSER_FUNCTION_H #include <inttypes.h> #include <expr/expr_t.hpp> #include <vector> namespace parserTypes { enum funcArgType { INT, CSTR, WSTR, PTR }; struct funcArg { funcArgType type; struct expr defaultValue; }; struct function { uint32_t addr; std::vector<struct funcArg> args; }; } // namespace parserTypes #endif
18.85
42
0.745358
[ "vector" ]
69d2156da2be205e072625a662b6161b41df6336
2,031
cpp
C++
cpp/expressionTemplates/expTmplt.cpp
jl-wynen/code_stuffs
91ee6cd9075a7bc8697b03ce2eec13cb4fffb3ad
[ "MIT" ]
null
null
null
cpp/expressionTemplates/expTmplt.cpp
jl-wynen/code_stuffs
91ee6cd9075a7bc8697b03ce2eec13cb4fffb3ad
[ "MIT" ]
null
null
null
cpp/expressionTemplates/expTmplt.cpp
jl-wynen/code_stuffs
91ee6cd9075a7bc8697b03ce2eec13cb4fffb3ad
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <assert.h> #include <cmath> #include <chrono> using namespace std; template <typename E> class VecExpression { public: double operator[](size_t i) const { return static_cast<E const&>(*this)[i]; } size_t size() const { return static_cast<E const&>(*this).size(); } E &operator()() { return static_cast<E&>(*this); } E const &operator()() const { return static_cast<E const&>(*this); } }; class Vec : public VecExpression<Vec> { vector<double> elems; public: double operator[](size_t i) const { return elems[i]; } double &operator[](size_t i) { return elems[i]; } size_t size() const { return elems.size(); } Vec(size_t n) : elems(n) {} // construct Vec from a VecExpression, evaluating the latter template <typename E> Vec(VecExpression<E> const &vec) : elems(vec.size()) { for (size_t i = 0; i < vec.size(); i++) elems[i] = vec[i]; } }; template <typename E1, typename E2> class VecSum : public VecExpression<VecSum<E1,E2>> { E1 const &_u; E2 const &_v; public: VecSum(E1 const &u, E2 const &v) : _u(u), _v(v) { } double operator[](size_t i) const { return _u[i] + _v[i]; } size_t size() const { return _v.size(); } }; template <typename E1, typename E2> VecSum<E1,E2> const operator+(E1 const &u, E2 const &v) { return VecSum<E1,E2>(u,v); } using Clock = chrono::high_resolution_clock; int main() { size_t const N = 100000; Vec x(N), y(N), z(N), w(N); for (size_t i = 0; i < N; i++) { x[i] = sqrt(exp(i)); y[i] = log(sqrt(i+1)); z[i] = cos(sin(i*i)); w[i] = x[i]*y[i]; } chrono::time_point<Clock> start = Clock::now(); Vec r = x + y + z + w; chrono::time_point<Clock> end = Clock::now(); chrono::microseconds diff = chrono::duration_cast<chrono::microseconds>(end-start); cout << "time: " << diff.count() << "µs" << endl; return 0; }
23.344828
87
0.576071
[ "vector" ]
69d33ddd3fb11b567980940bbe975bf325872ee7
9,092
cpp
C++
GenreHash.cpp
kyb1206/git_song
d8437eb1e8ce814a814621be9b0c5e82ac989304
[ "MIT" ]
3
2019-10-18T05:32:03.000Z
2020-05-06T05:51:27.000Z
GenreHash.cpp
gabriel-madera/TopNStreaming
31940546e450b8d5b057bade0b0251e4b4c27713
[ "MIT" ]
null
null
null
GenreHash.cpp
gabriel-madera/TopNStreaming
31940546e450b8d5b057bade0b0251e4b4c27713
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> using namespace std; #include "GenreHash.hpp" //Genre Key //Rap == 0 //Alternative == 1 //Country == 2 //Hip Hop == 3 //Pop == 4 //Rock == 5 //EDM == 6 //r&b == 7 GenreHash :: GenreHash(int hashTableSize) { hashTable = new Song*[hashTableSize]; this->hashTableSize = hashTableSize; numSongs = 0; for(int i =0; i < hashTableSize;i++) { hashTable[i] = NULL; } // userPlaylistHead = NULL; // recommendedPlaylistHead = NULL; } GenreHash:: ~GenreHash() { for(int i =0; i < hashTableSize;i++) { while(hashTable[i] != NULL) { Song *temp = hashTable[i]; hashTable[i] = hashTable[i]->next; delete temp; } } } unsigned int hashFunction(string genre) { if(genre == "rap") { return 0; } else if(genre == "alternative") { return 1; } else if(genre == "country") { return 2; } else if(genre == "hip-hop") { return 3; } else if(genre == "pop") { return 4; } else if(genre == "rock") { return 5; } else if(genre == "edm") { return 6; } else if(genre == "r&b") { return 7; } else { return 8; } } User* GenreHash :: addUser(string name) { User *insert = new User(); insert->username = name; insert->numberSongs = 10; insert->playlistHead = NULL; insert->recommendListHead = NULL; users.push_back(insert); return insert; } User* GenreHash :: searchUser(string name) { for(int i =0 ;i < users.size();i++) { if(users[i]->username == name) { return users[i]; } } return NULL; } void GenreHash :: add(string newTitle, string newGenre, string newArtist, int gPlays) { int index = hashFunction(newGenre); Song *insert = new Song(); insert->title = newTitle; insert->genre = newGenre; insert->artist = newArtist; insert->globalPlays = gPlays; if (hashTable[index]== NULL) { hashTable[index] = insert; numSongs++; return; } Song* temp = hashTable[index]; if(temp->globalPlays<insert->globalPlays) { insert->next = hashTable[index]; hashTable[index] = insert; numSongs++; return; } while(temp != NULL) { if((temp->next == NULL)||(temp->next->globalPlays<insert->globalPlays)) { break; } temp=temp->next; } insert->next = temp->next; temp->next = insert; numSongs++; } void GenreHash :: printTable() { Song *temp; cout << "Songs will be printed according to genre. Rap -> Alternative -> Country -> Hip-Hop -> Pop -> Rock -> EDM -> R&B -> Other Genres" << endl; for(int i =0; i < hashTableSize;i++) { temp = hashTable[i]; cout << "-----------------------------------------------------------------" << endl; if(temp != NULL) { while(temp != NULL) { cout <<"|Title: " << temp->title <<" Artist: " << temp->artist << " Genre: " << temp->genre << " Plays: " << temp->globalPlays << endl; temp = temp->next; } cout << endl; } } } void GenreHash::getGenreCount() { cout << "Genre Counts: " << endl; Song *temp; for(int i =0; i < hashTableSize-1;i++)//Wont get OTHER genre counts { int count = 0; temp = hashTable[i]; cout << "genre: " << temp->genre; while(temp != NULL) { //cout <<"|Title: " << temp->title << " Genre: " << temp->genre << " Plays: " << temp->globalPlays << "| -> "; count = count + 1; temp = temp->next; } cout << " -> count: " << count << endl; } //gets count for other Genres cout << "Other Genres"; int count = 0; temp = hashTable[hashTableSize-1]; while(temp != NULL) { count = count + 1; temp = temp->next; } cout << " -> count: " << count << endl; } void GenreHash :: printGenreTop10(string word) { int index = hashFunction(word); Song *temp = hashTable[index]; int count = 0; while(temp != NULL && count < 10) { cout << "Title: " << temp->title << " Artist: " << temp->artist << " Plays: " << temp->globalPlays << endl; temp = temp->next; count++; } } Song* GenreHash :: searchSong(string ntitle, string ngenre) { int index = hashFunction(ngenre); Song *current = hashTable[index]; if(hashTable[index] == NULL) { return NULL; } while(current != NULL) { if(current->title == ntitle) { return current; } current = current->next; } return NULL; } int GenreHash :: recommend_helper(Song* head) { int genreBreakdown[hashTableSize] = {0}; Song* temp = head; while(temp!=NULL) { genreBreakdown[hashFunction(temp->genre)]++; temp = temp->next; } delete temp; int max_temp = 0; int max_genre = 0; for( int i=0; i<hashTableSize; i++) { if(genreBreakdown[i]>max_temp) { max_temp = genreBreakdown[i]; max_genre = i; } } return max_genre; } bool GenreHash ::isInPlaylist(Song* head, Song* check) { Song* temp = head; while(temp!=NULL) { if((temp->title==check->title)&&(temp->artist==check->artist)) { return true; } temp=temp->next; } delete temp; return false; } void GenreHash :: deleteRecommendedPlaylist(User* u1) { if(u1->recommendListHead == NULL) { return; } Song *temp; while(u1->recommendListHead != NULL) { temp = u1->recommendListHead; u1->recommendListHead = u1->recommendListHead->next; } } void GenreHash :: recommend_songs(User* u1) { //deleteRecommendedPlaylist(u1); int rec_genre = recommend_helper(u1->playlistHead); int recommended = 0; Song* genreHead = hashTable[rec_genre]; Song* temp = genreHead; Song* adder; while((recommended<u1->numberSongs)&&(temp!=NULL)) { if(!isInPlaylist(u1->playlistHead, temp)) { Song* added = new Song(); added->title = temp->title; added->artist = temp->artist; added->genre = temp->genre; added->globalPlays = temp->globalPlays; added->next = NULL; if(u1->recommendListHead == NULL) { u1->recommendListHead = added; adder = u1->recommendListHead; } else { adder->next = added; adder = adder->next; } recommended++; } temp=temp->next; } Song* current = u1->recommendListHead; while(current!=NULL) { cout << "| Title: " << current->title << " Artist: " << current->artist << " Genre: " << current->genre << " Global Plays: " << current->globalPlays << endl; current = current->next; } } void GenreHash:: addSongToPlaylist(Song *name, User* curr_user) { Song *insert = new Song(); insert->title = name->title; insert->artist = name->artist; insert->genre = name->genre; insert->globalPlays = name->globalPlays; insert->next = NULL; if(curr_user->playlistHead == NULL) { curr_user->playlistHead = insert; return; } Song *current = curr_user->playlistHead; while(current != NULL) { if(current->next == NULL) { current->next = insert; return; } current = current->next; } } void GenreHash :: printUserPlaylist(User* curr_user) { if(curr_user->playlistHead == NULL) { cout << "Nothing in your playlist" << endl; return; } Song *current = curr_user->playlistHead; while(current != NULL) { cout << "| Title: " << current->title << " Artist: " << current->artist << " Genre: " << current->genre << " Global Plays: " << current->globalPlays << endl; current = current->next; } } void GenreHash :: deleteSongFromPlaylist(Song *deleteS, User* u1) { Song* current = u1->playlistHead; Song *prev = NULL; while(current != NULL && current->title != deleteS->title) { prev = current; current = current->next; } if(current == NULL) { cout << "Song is not in playlist" << endl; } else { if(prev == NULL) { u1->playlistHead = current->next; delete current; } else { prev->next = current->next; delete current; } } }
23.43299
167
0.5022
[ "vector" ]
69ed4464cb236acf1e304956c335b1b330e430e3
854
hpp
C++
src/GameLevel.hpp
HoraGladiis/HoraGladiis
86a600af001441edda357c504ac54f3f9a43cf18
[ "MIT" ]
1
2021-12-16T11:47:24.000Z
2021-12-16T11:47:24.000Z
src/GameLevel.hpp
HoraGladiis/HoraGladiis
86a600af001441edda357c504ac54f3f9a43cf18
[ "MIT" ]
11
2021-12-01T15:39:20.000Z
2021-12-29T22:04:52.000Z
src/GameLevel.hpp
HoraGladiis/HoraGladiis
86a600af001441edda357c504ac54f3f9a43cf18
[ "MIT" ]
null
null
null
#include <SFML/Graphics.hpp> #include "Tilemap.hpp" #include "Tileset.hpp" #include <iostream> #include <vector> #include <map> class GameLevel : public sf::Drawable { private: std::vector<IsoTileMap> tileLayers; std::map<std::string, sf::Texture> textures; std::string name; virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const { // std::cout << "Drawing level = " << name << std::endl; for (IsoTileMap layer : tileLayers) { target.draw(layer, states); } } public: void init(std::string name, Tileset *tileset); bool collidePoint(sf::Vector2f point) { for (IsoTileMap layer : tileLayers) { if (layer.collidePoint(point)) { return true; } } return false; } };
21.897436
78
0.5726
[ "vector" ]
69f4afbc7ff29f484b62ea9c35f6dc120dd71ae7
435
cpp
C++
leetcode/.template/solution.cpp
mkmark/leetcode
638a9d37fb3223107d2852ce493d831996a7649e
[ "MIT" ]
null
null
null
leetcode/.template/solution.cpp
mkmark/leetcode
638a9d37fb3223107d2852ce493d831996a7649e
[ "MIT" ]
null
null
null
leetcode/.template/solution.cpp
mkmark/leetcode
638a9d37fb3223107d2852ce493d831996a7649e
[ "MIT" ]
null
null
null
/* author: mark@mkmark.net time: O() space: O() Runtime: Memory Usage: */ #include <bits/stdc++.h> using namespace std; #define all(x) begin(x), end(x) typedef vector<int> vi; typedef vector<vector<int>> vvi; class Solution { public: int solution() { } }; const static auto initialize = [] { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); return nullptr; }();
14.032258
37
0.622989
[ "vector" ]
69f63579d2dc7cffd3be92ef9fa9d4c62551beb1
3,724
hpp
C++
extra/facs/cytolib/include/cytolib/readFCSHeader.hpp
scignscape/PGVM
e24f46cdf657a8bdb990c7883c6bd3d0a0c9cff0
[ "BSL-1.0" ]
null
null
null
extra/facs/cytolib/include/cytolib/readFCSHeader.hpp
scignscape/PGVM
e24f46cdf657a8bdb990c7883c6bd3d0a0c9cff0
[ "BSL-1.0" ]
null
null
null
extra/facs/cytolib/include/cytolib/readFCSHeader.hpp
scignscape/PGVM
e24f46cdf657a8bdb990c7883c6bd3d0a0c9cff0
[ "BSL-1.0" ]
null
null
null
/* Copyright 2019 Fred Hutchinson Cancer Research Center * See the included LICENSE file for details on the license that is granted to the * user of this software. * readFCSHeader.hpp * * Created on: Sep 21, 2017 * Author: wjiang2 */ #ifndef INST_INCLUDE_CYTOLIB_READFCSHEADER_HPP_ #define INST_INCLUDE_CYTOLIB_READFCSHEADER_HPP_ #include <fstream> #include <cstring> #include <vector> #include <numeric> #include <unordered_map> #include <iostream> #include <algorithm> using namespace std; #include <armadillo> using namespace arma; #include "datatype.hpp" namespace cytolib { typedef arma::Mat<EVENT_DATA_TYPE> EVENT_DATA_VEC; enum class TransformType {none, linearize, scale,linearize_with_PnG_scaling}; enum class endianType {big, small, mixed}; struct FCS_Header{ float FCSversion; long textstart, textend, datastart, dataend, anastart, anaend, additional; }; //typedef unordered_map <string, string> KEY_WORDS; typedef vector<pair <string, string>> KW_PAIR; /** * this class mimic the map behavior so that the same code * can be used for both map and vector based container */ class vec_kw_constainer{ KW_PAIR kw; public: typedef KW_PAIR::iterator iterator; typedef KW_PAIR::const_iterator const_iterator; void clear(){kw.clear();} void resize(size_t n){kw.resize(n);} size_t size() const{return kw.size();} const KW_PAIR & getPairs() const{return kw;} void setPairs(const KW_PAIR & _kw){kw = _kw;} iterator end() {return kw.end();} const_iterator end() const{return kw.end();} iterator begin(){return kw.begin();} const_iterator begin() const{return kw.begin();} iterator find(const string &key){ return std::find_if(kw.begin(), kw.end(), [key](const pair<string, string> & p){return p.first == key;}); } const_iterator find(const string &key) const{ return std::find_if(kw.begin(), kw.end(), [key](const pair<string, string> & p){return p.first == key;}); } string & operator [](const string & key){ iterator it = find(key); if(it==end()) { kw.push_back(pair<string, string>(key, "")); return kw.back().second; } else return it->second; } pair <string, string> & operator [](const int & n){ return kw[n]; } }; typedef vec_kw_constainer KEY_WORDS; /** * the struct that stores the FCS header parse arguments */ struct FCS_READ_HEADER_PARAM{ bool is_fix_slash_in_channel_name; bool isEmptyKeyValue; //whether allow the keyword value to be empty. When true, then double delimiter will be considered as empty keyword value. bool ignoreTextOffset; //whether to ignore the offset recorded in the text segment of FCS int nDataset; // which data set to be parsed when multi-data segments are detected FCS_READ_HEADER_PARAM(){ is_fix_slash_in_channel_name = false; isEmptyKeyValue = false; ignoreTextOffset = false; nDataset = 0; }; }; /** * parameters parsed from keywords, but may be accessed frequently later thus saved as the copy * in this struct for fast and easy query */ struct cytoParam{ string channel, marker; EVENT_DATA_TYPE min, max, PnG; // pair<EVENT_DATA_TYPE, EVENT_DATA_TYPE> PnE;//replace pair with simple array since it is not clear how to create compound type for pair EVENT_DATA_TYPE PnE[2]; int PnB; }; //for writing to h5 since writing vlen string causes segfault on mac struct cytoParam_cstr{ const char * channel; const char * marker; EVENT_DATA_TYPE min, max, PnG; // pair<EVENT_DATA_TYPE, EVENT_DATA_TYPE> PnE;//replace pair with simple array since it is not clear how to create compound type for pair EVENT_DATA_TYPE PnE[2]; int PnB; }; }; #endif /* INST_INCLUDE_CYTOLIB_READFCSHEADER_HPP_ */
30.276423
145
0.719656
[ "vector" ]
69f782f28dd3fb98d69e66cf96ae4cf9345a1b37
2,203
hpp
C++
src/rendering/include/rendering/rendering_interface.hpp
Sampas/cavez
b89185554477b92bf987c9e5d26b0a8abe1ae568
[ "MIT" ]
2
2019-03-11T11:26:52.000Z
2019-09-26T07:50:55.000Z
src/rendering/include/rendering/rendering_interface.hpp
Sampas/cavez
b89185554477b92bf987c9e5d26b0a8abe1ae568
[ "MIT" ]
1
2020-10-29T15:44:47.000Z
2020-10-29T15:44:47.000Z
src/rendering/include/rendering/rendering_interface.hpp
Sampas/cavez
b89185554477b92bf987c9e5d26b0a8abe1ae568
[ "MIT" ]
1
2020-10-28T18:56:46.000Z
2020-10-28T18:56:46.000Z
/// Copyright (c) 2019 Joni Louhela /// /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to /// 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. #ifndef RENDERING_INTERFACE_HPP #define RENDERING_INTERFACE_HPP #include <memory> #include "assets/image.hpp" #include "rendering/render_items.hpp" #include "math/rect.hpp" #include "math/vector.hpp" namespace asset { class Texture_manager_interface; } struct Rendering_target; class Rendering_interface { public: virtual ~Rendering_interface() = default; // TODO consider rendering inot framebuffer and finally render_frame to screen virtual void render(const Render_tex& render_tex) = 0; virtual std::int32_t init_render_buffer(const asset::Image& image) = 0; virtual void free_render_buffer(std::int32_t buffer_idx) = 0; virtual void update_render_buffer(std::int32_t buffer_idx, const std::vector<Render_buffer_update>& updates) = 0; virtual void render(std::int32_t buffer_idx, const math::Rect& buffer_rect, const math::Vector2I& screen_topleft) = 0; }; std::unique_ptr<Rendering_interface> make_rendering( const asset::Texture_manager_interface& texture_manager, const Rendering_target& rendering_target); #endif
36.716667
92
0.733545
[ "render", "vector" ]
0e035c3fcb108a57fa3ad1c45dd95d973197a808
3,740
cc
C++
test/thread_pool_benchmarks.cc
cbraley/threadpool
0ff006429439698e716d78ba665c51b33b67e395
[ "MIT" ]
5
2019-10-09T03:08:45.000Z
2021-12-06T15:37:55.000Z
test/thread_pool_benchmarks.cc
cbraley/threadpool
0ff006429439698e716d78ba665c51b33b67e395
[ "MIT" ]
1
2021-09-19T05:23:18.000Z
2022-01-02T05:59:10.000Z
test/thread_pool_benchmarks.cc
cbraley/threadpool
0ff006429439698e716d78ba665c51b33b67e395
[ "MIT" ]
2
2020-05-09T01:22:24.000Z
2022-01-24T08:06:17.000Z
#include <benchmark/benchmark.h> #include <array> #include <cmath> #include <cstdint> #include <iostream> #include "src/thread_pool.h" // Default number of iterations when simulating a CPU bound task. constexpr uint64_t kNumIterations = 50000; // When comparing std::async to launching using a thread pool, we spawn this // many tasks per benchmark iteration. constexpr int kNumTasks = 10000; // Synthetic CPU bound task that applies std::cos repeatedly. // This computes http://mathworld.wolfram.com/DottieNumber.html void CpuTask(uint64_t n = kNumIterations) { constexpr double kStartValue = 1.24; double curr_value = kStartValue; for (uint64_t i = 0; i < n; ++i) { curr_value = std::cos(curr_value); } benchmark::DoNotOptimize(curr_value); } static void BM_CpuTask(benchmark::State& state) { for (auto _ : state) { CpuTask(); } } BENCHMARK(BM_CpuTask); static void BM_LargeCapturedVariables(benchmark::State& state) { // Number of threads to use in thread pool. cb::ThreadPool pool(cb::ThreadPool::GetNumLogicalCores()); // Make a large array of strings. std::vector<std::string> strings; const std::string kChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int i = 0; i < 1000; ++i) { strings.emplace_back(500, kChars[i % kChars.size()]); } for (auto _ : state) { std::vector<std::future<void>> results; for (int i = 0; i < 100; ++i) { results.emplace_back(pool.ScheduleAndGetFuture([strings]() { const std::thread::id tid = std::this_thread::get_id(); std::hash<std::thread::id> hasher; const int string_index = hasher(tid) % strings.size(); const bool result = strings[string_index].find("C") != std::string::npos; benchmark::DoNotOptimize(result); })); } for (auto& f : results) { f.wait(); } } } BENCHMARK(BM_LargeCapturedVariables)->UseRealTime(); static void BM_ThreadPoolUsage(benchmark::State& state) { const int num_threads = state.range(0); cb::ThreadPool pool(num_threads); for (auto _ : state) { std::array<std::future<void>, kNumTasks> futures; for (std::size_t i = 0; i < futures.size(); ++i) { futures[i] = pool.ScheduleAndGetFuture([]() { CpuTask(); }); } for (auto& future : futures) { future.wait(); } } state.SetItemsProcessed(state.iterations() * kNumTasks); } BENCHMARK(BM_ThreadPoolUsage) ->UseRealTime() ->RangeMultiplier(2) ->Range(1, 128) ->Arg(1000); static void BM_AsyncUsage(benchmark::State& state) { for (auto _ : state) { std::array<std::future<void>, kNumTasks> futures; for (std::size_t i = 0; i < futures.size(); ++i) { futures[i] = std::async(std::launch::async, &CpuTask, kNumIterations); } for (auto& future : futures) { future.wait(); } } state.SetItemsProcessed(state.iterations() * kNumTasks); } BENCHMARK(BM_AsyncUsage)->UseRealTime(); // Benchmark the overhead of waiting for a single a "no-op" function // executed via std::async. static void BM_AsyncOverhead(benchmark::State& state) { for (auto _ : state) { std::async(std::launch::async, []() {}).wait(); } } BENCHMARK(BM_AsyncOverhead)->UseRealTime(); // Benchmark the overhead of waiting for a single a "no-op" function // executed on a thread pool. static void BM_ThreadpoolOverhead(benchmark::State& state) { // Number of threads to use in thread pool. constexpr int kNumThreads = 4; cb::ThreadPool pool(kNumThreads); for (auto _ : state) { pool.ScheduleAndGetFuture([]() {}).wait(); } } BENCHMARK(BM_ThreadpoolOverhead)->UseRealTime(); int main(int argc, char** argv) { ::benchmark::Initialize(&argc, argv); ::benchmark::RunSpecifiedBenchmarks(); return EXIT_SUCCESS; }
29.92
76
0.668449
[ "vector" ]
0e083bb320e2f165d0da3961a38e5e0b4e359a69
18,832
cpp
C++
include/delfem2/opengl/color_glold.cpp
fixedchaos/delfem2
c8a7a000ec6a51c44bc45bc6ad0d0106d9315ade
[ "MIT" ]
null
null
null
include/delfem2/opengl/color_glold.cpp
fixedchaos/delfem2
c8a7a000ec6a51c44bc45bc6ad0d0106d9315ade
[ "MIT" ]
null
null
null
include/delfem2/opengl/color_glold.cpp
fixedchaos/delfem2
c8a7a000ec6a51c44bc45bc6ad0d0106d9315ade
[ "MIT" ]
null
null
null
/* * Copyright (c) 2019 Nobuyuki Umetani * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <cstring> #include "delfem2/color.h" #if defined(__APPLE__) && defined(__MACH__) #include <OpenGL/gl.h> #elif defined(__MINGW32__) // probably I'm using Qt and don't want to use GLUT #include <GL/gl.h> #elif defined(_WIN32) // windows #include <windows.h> #include <GL/gl.h> #else #include <GL/gl.h> #endif #include "delfem2/opengl/color_glold.h" // header ends here // ------------------------------------------------- namespace delfem2 { namespace opengl { namespace color_glold { DFM2_INLINE void UnitNormalAreaTri3D (double n[3], double& a, const double v1[3], const double v2[3], const double v3[3]) { n[0] = ( v2[1] - v1[1] )*( v3[2] - v1[2] ) - ( v3[1] - v1[1] )*( v2[2] - v1[2] ); n[1] = ( v2[2] - v1[2] )*( v3[0] - v1[0] ) - ( v3[2] - v1[2] )*( v2[0] - v1[0] ); n[2] = ( v2[0] - v1[0] )*( v3[1] - v1[1] ) - ( v3[0] - v1[0] )*( v2[1] - v1[1] ); a = sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2])*0.5; const double invlen = 0.5/a; n[0]*=invlen; n[1]*=invlen; n[2]*=invlen; } DFM2_INLINE void myGlVertex3d(int i, const std::vector<double>& aV) { glVertex3d(aV[i*3+0],aV[i*3+1],aV[i*3+2]); } DFM2_INLINE void DrawSingleTri3D_Scalar_Vtx (const double* aXYZ, const unsigned int* tri, const double* aValVtx, const std::vector<std::pair<double, CColor> >& colorMap) { const int i0 = tri[0]; const int i1 = tri[1]; const int i2 = tri[2]; if (i0==-1){ assert(i1==-1); assert(i2==-1); return; } // assert(i0>=0&&i0<(int)aXYZ.size()/3); // assert(i1>=0&&i1<(int)aXYZ.size()/3); // assert(i2>=0&&i2<(int)aXYZ.size()/3); const double p0[3] = { aXYZ[i0*3+0], aXYZ[i0*3+1], aXYZ[i0*3+2] }; const double p1[3] = { aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2] }; const double p2[3] = { aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2] }; { double n[3], a; UnitNormalAreaTri3D(n, a, p0, p1, p2); ::glNormal3dv(n); } const double vt0 = aValVtx[i0]; const double vt1 = aValVtx[i1]; const double vt2 = aValVtx[i2]; heatmap(vt0, colorMap); glVertex3dv(p0); heatmap(vt1, colorMap); glVertex3dv(p1); heatmap(vt2, colorMap); glVertex3dv(p2); } DFM2_INLINE void DrawSingleQuad3D_Scalar_Vtx (const std::vector<double>& aXYZ, const unsigned int* quad, const double* aValVtx, const std::vector<std::pair<double, CColor> >& colorMap) { const unsigned int i0 = quad[0]; const unsigned int i1 = quad[1]; const unsigned int i2 = quad[2]; const unsigned int i3 = quad[3]; assert(i0<aXYZ.size()/3); assert(i1<aXYZ.size()/3); assert(i2<aXYZ.size()/3); assert(i3<aXYZ.size()/3); const double p0[3] = { aXYZ[i0*3+0], aXYZ[i0*3+1], aXYZ[i0*3+2] }; const double p1[3] = { aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2] }; const double p2[3] = { aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2] }; const double p3[3] = { aXYZ[i3*3+0], aXYZ[i3*3+1], aXYZ[i3*3+2] }; { double n[3], a; UnitNormalAreaTri3D(n, a, p0, p1, p2); ::glNormal3dv(n); } const double vt0 = aValVtx[i0]; const double vt1 = aValVtx[i1]; const double vt2 = aValVtx[i2]; const double vt3 = aValVtx[i3]; heatmap(vt0, colorMap); glVertex3dv(p0); heatmap(vt1, colorMap); glVertex3dv(p1); heatmap(vt2, colorMap); glVertex3dv(p2); heatmap(vt3, colorMap); glVertex3dv(p3); } DFM2_INLINE bool IsAbovePlane(const double p[3], const double org[3], const double n[3]) { const double dot = (p[0]-org[0])*n[0] + (p[1]-org[1])*n[1] + (p[2]-org[2])*n[2]; return dot > 0; } // 0: no, 1:lighting, 2:no-lighting DFM2_INLINE void DrawMeshTri3DFlag_FaceNorm (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aTri, const std::vector<int>& aIndGroup, std::vector< std::pair<int,CColor> >& aColor) { const unsigned int nTri = aTri.size()/3; for(unsigned int itri=0;itri<nTri;++itri){ const int ig0 = aIndGroup[itri]; if( ig0 < 0 || ig0 >= (int)aColor.size() ) continue; const int imode = aColor[ig0].first; if( imode == 0 ) continue; else if( imode == 1 ){ ::glEnable(GL_LIGHTING); } else if( imode == 2 ){ ::glDisable(GL_LIGHTING); } myGlColorDiffuse(aColor[ig0].second); const int i1 = aTri[itri*3+0]; const int i2 = aTri[itri*3+1]; const int i3 = aTri[itri*3+2]; if( i1 == -1 ){ assert(i2==-1); assert(i3==-1); continue; } ::glBegin(GL_TRIANGLES); assert( i1 >= 0 && i1 < (int)aXYZ.size()/3 ); assert( i2 >= 0 && i2 < (int)aXYZ.size()/3 ); assert( i3 >= 0 && i3 < (int)aXYZ.size()/3 ); double p1[3] = {aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2]}; double p2[3] = {aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2]}; double p3[3] = {aXYZ[i3*3+0], aXYZ[i3*3+1], aXYZ[i3*3+2]}; double un[3], area; UnitNormalAreaTri3D(un,area, p1,p2,p3); ::glNormal3dv(un); myGlVertex3d(i1,aXYZ); myGlVertex3d(i2,aXYZ); myGlVertex3d(i3,aXYZ); ::glEnd(); } } } } } // ----------------------------------------------------------------- DFM2_INLINE void delfem2::opengl::myGlMaterialDiffuse(const CColor& color){ float c[4]; c[0] = color.r; c[1] = color.g; c[2] = color.b; c[3] = color.a; ::glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, c); } DFM2_INLINE void delfem2::opengl::myGlColor(const CColor& c){ ::glColor4d(c.r, c.g, c.b, c.a ); } DFM2_INLINE void delfem2::opengl::myGlColorDiffuse(const CColor& color){ ::glColor4d(color.r, color.g, color.b, color.a ); float c[4] = {color.r, color.g, color.b, color.a}; ::glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, c); } DFM2_INLINE void delfem2::opengl::myGlDiffuse(const CColor& color){ float c[4] = {color.r, color.g, color.b, color.a}; ::glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, c); } DFM2_INLINE void delfem2::opengl::DrawBackground (const CColor& c) { glPushAttrib(GL_TRANSFORM_BIT|GL_CURRENT_BIT|GL_ENABLE_BIT); ::glShadeModel(GL_SMOOTH); GLboolean is_lighting = (glIsEnabled(GL_LIGHTING)); GLboolean is_texture = (glIsEnabled(GL_TEXTURE_2D)); ::glDisable(GL_LIGHTING); ::glDisable(GL_TEXTURE_2D); ::glDisable(GL_DEPTH_TEST); ::glMatrixMode(GL_MODELVIEW); ::glPushMatrix(); ::glLoadIdentity(); ::glMatrixMode(GL_PROJECTION); ::glPushMatrix(); ::glLoadIdentity(); ::glBegin(GL_QUADS); ::glColor3f(c.r,c.g,c.b); ::glVertex3d(-1,-1,0); ::glVertex3d(+1,-1,0); ::glColor3d(1,1,1); ::glVertex3d(+1,+1,0); ::glVertex3d(-1,+1,0); ::glEnd(); ::glMatrixMode(GL_PROJECTION); ::glPopMatrix(); ::glMatrixMode(GL_MODELVIEW); ::glPopMatrix(); ::glPopAttrib(); ::glEnable(GL_DEPTH_TEST); if( is_lighting ){ ::glEnable(GL_LIGHTING); } if( is_texture ){ ::glEnable(GL_TEXTURE_2D); } } DFM2_INLINE void delfem2::opengl::DrawBackground() { // ::glColor3d(0.2,0.7,0.7); opengl::DrawBackground( CColor(0.5, 0.5, 0.5) ); } // ------------------------------------------------------------ DFM2_INLINE void delfem2::opengl::heatmap_glColor(double input) { double c[3]; ::delfem2::heatmap(input,c); ::glColor3dv(c); } DFM2_INLINE void delfem2::opengl::heatmap_glDiffuse(double input) { double c[3]; ::delfem2::heatmap(input,c); float cf[4] = {(float)c[0],(float)c[1],(float)c[2],1.f}; glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,cf); } DFM2_INLINE void delfem2::opengl::heatmap (double input, const std::vector<std::pair<double, CColor> >& colorMap) { const CColor& c = getColor(input, colorMap); opengl::myGlColorDiffuse(c); } // ------------------------------------------------------------- DFM2_INLINE void delfem2::opengl::DrawMeshTri2D_ScalarP1 (const double* aXY, unsigned int nXY, const unsigned int* aTri, unsigned int nTri, const double* paVal, int nstride, const std::vector< std::pair<double,CColor> >& colorMap) { // const unsigned int ntri = (int)aTri.size()/3; // const unsigned int nxys = (int)aXY.size()/2; glShadeModel(GL_SMOOTH); ::glColor3d(1,1,1); ::glBegin(GL_TRIANGLES); for(unsigned int itri=0;itri<nTri;++itri){ const unsigned int ino0 = aTri[itri*3+0]; assert(ino0<nXY); const unsigned int ino1 = aTri[itri*3+1]; assert(ino1<nXY); const unsigned int ino2 = aTri[itri*3+2]; assert(ino2<nXY); const double v0 = paVal[ino0*nstride]; const double v1 = paVal[ino1*nstride]; const double v2 = paVal[ino2*nstride]; opengl::heatmap(v0,colorMap); ::glVertex2d( aXY[ino0*2+0], aXY[ino0*2+1] ); opengl::heatmap(v1,colorMap); ::glVertex2d( aXY[ino1*2+0], aXY[ino1*2+1] ); opengl::heatmap(v2,colorMap); ::glVertex2d( aXY[ino2*2+0], aXY[ino2*2+1] ); } ::glEnd(); } DFM2_INLINE void delfem2::opengl::DrawMeshTri2D_ScalarP0 (std::vector<int>& aTri, std::vector<double>& aXY, std::vector<double>& aVal, int nstride, int noffset, const std::vector< std::pair<double,CColor> >& colorMap) { const unsigned int ntri = (int)aTri.size()/3; ::glColor3d(1,1,1); ::glBegin(GL_TRIANGLES); for(unsigned int itri=0;itri<ntri;++itri){ const int ino0 = aTri[itri*3+0]; const int ino1 = aTri[itri*3+1]; const int ino2 = aTri[itri*3+2]; const double v0 = aVal[itri*nstride+noffset]; opengl::heatmap(v0,colorMap); ::glVertex2d( aXY[ino0*2+0], aXY[ino0*2+1] ); ::glVertex2d( aXY[ino1*2+0], aXY[ino1*2+1] ); ::glVertex2d( aXY[ino2*2+0], aXY[ino2*2+1] ); } ::glEnd(); } // vetex value DFM2_INLINE void delfem2::opengl::DrawMeshTri3D_ScalarP1 (const double* aXYZ, int nXYZ, const unsigned int* aTri, int nTri, const double* aValSrf, const std::vector<std::pair<double, CColor> >& colorMap) { ::glBegin(GL_TRIANGLES); for (int itri = 0; itri<nTri; ++itri){ color_glold::DrawSingleTri3D_Scalar_Vtx(aXYZ, aTri+itri*3, aValSrf, colorMap); } ::glEnd(); } // vetex value DFM2_INLINE void delfem2::opengl::DrawMeshTri3D_ScalarP1 (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aTri, const double* aValSrf, const std::vector<std::pair<double, CColor> >& colorMap) { const int nTri = (int)aTri.size()/3; const int nXYZ = (int)aXYZ.size()/3; DrawMeshTri3D_ScalarP1(aXYZ.data(), nXYZ, aTri.data(), nTri, aValSrf, colorMap); } // vetex value DFM2_INLINE void delfem2::opengl::DrawMeshElem3D_Scalar_Vtx (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aElemInd, const std::vector<unsigned int>& aElem, const double* aValVtx, const std::vector<std::pair<double, CColor> >& colorMap) { if( aElemInd.empty() ) return; // for(size_t ielem=0;ielem<aElemInd.size()-1;++ielem){ const int ielemind0 = aElemInd[ielem]; const int ielemind1 = aElemInd[ielem+1]; if( ielemind1 - ielemind0 == 3 ){ ::glBegin(GL_TRIANGLES); color_glold::DrawSingleTri3D_Scalar_Vtx(aXYZ.data(), aElem.data()+ielemind0, aValVtx, colorMap); ::glEnd(); } else if(ielemind1-ielemind0 == 4){ ::glBegin(GL_QUADS); color_glold::DrawSingleQuad3D_Scalar_Vtx(aXYZ, aElem.data()+ielemind0, aValVtx, colorMap); ::glEnd(); } } } // element-wise DFM2_INLINE void delfem2::opengl::drawMeshTri3D_ScalarP0 (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aTri, const std::vector<double>& aValSrf, const std::vector<std::pair<double, CColor> >& colorMap) { const unsigned int nTri = aTri.size()/3; if( aValSrf.size()!=nTri) return; ///// ::glBegin(GL_TRIANGLES); for (unsigned int itri = 0; itri<nTri; ++itri){ const int i0 = aTri[itri*3+0]; const int i1 = aTri[itri*3+1]; const int i2 = aTri[itri*3+2]; if (i0==-1){ assert(i1==-1); assert(i2==-1); continue; } assert(i0>=0&&i0 < (int)aXYZ.size()/3 ); assert(i1>=0&&i1 < (int)aXYZ.size()/3 ); assert(i2>=0&&i2 < (int)aXYZ.size()/3 ); const double p0[3] = { aXYZ[i0*3+0], aXYZ[i0*3+1], aXYZ[i0*3+2] }; const double p1[3] = { aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2] }; const double p2[3] = { aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2] }; double n[3], a; color_glold::UnitNormalAreaTri3D(n, a, p0, p1, p2); const double vt = aValSrf[itri]; ::glNormal3dv(n); heatmap(vt, colorMap); glVertex3dv(p0); glVertex3dv(p1); glVertex3dv(p2); } ::glEnd(); } DFM2_INLINE void delfem2::opengl::DrawMeshTri3D_VtxColor (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aTri, std::vector<CColor>& aColor) { const int nTri = (int)aTri.size()/3; ///// for(int itri=0;itri<nTri;++itri){ const int i1 = aTri[itri*3+0]; const int i2 = aTri[itri*3+1]; const int i3 = aTri[itri*3+2]; if( i1 == -1 ){ assert(i2==-1); assert(i3==-1); continue; } ::glBegin(GL_TRIANGLES); assert( i1 >= 0 && i1 < (int)aXYZ.size()/3 ); assert( i2 >= 0 && i2 < (int)aXYZ.size()/3 ); assert( i3 >= 0 && i3 < (int)aXYZ.size()/3 ); double p1[3] = {aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2]}; double p2[3] = {aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2]}; double p3[3] = {aXYZ[i3*3+0], aXYZ[i3*3+1], aXYZ[i3*3+2]}; double un[3], area; color_glold::UnitNormalAreaTri3D(un,area, p1,p2,p3); ::glNormal3dv(un); myGlColorDiffuse(aColor[i1]); color_glold::myGlVertex3d(i1,aXYZ); myGlColorDiffuse(aColor[i2]); color_glold::myGlVertex3d(i2,aXYZ); myGlColorDiffuse(aColor[i3]); color_glold::myGlVertex3d(i3,aXYZ); ::glEnd(); } } // ------------------------------------------------- // tet from here // 3D value DFM2_INLINE void delfem2::opengl::DrawMeshTet3D_ScalarP1 (const double* aXYZ, unsigned int nXYZ, const unsigned int* aTet, unsigned int nTet, const double* aValSrf, const std::vector<std::pair<double, CColor> >& colorMap) { ::glBegin(GL_TRIANGLES); for (unsigned itri = 0; itri<nTet; ++itri){ const unsigned int i0 = aTet[itri*4+0]; assert(i0<nXYZ); const unsigned int i1 = aTet[itri*4+1]; assert(i1<nXYZ); const unsigned int i2 = aTet[itri*4+2]; assert(i2<nXYZ); const unsigned int i3 = aTet[itri*4+3]; assert(i3<nXYZ); const double p0[3] = { aXYZ[i0*3+0], aXYZ[i0*3+1], aXYZ[i0*3+2] }; const double p1[3] = { aXYZ[i1*3+0], aXYZ[i1*3+1], aXYZ[i1*3+2] }; const double p2[3] = { aXYZ[i2*3+0], aXYZ[i2*3+1], aXYZ[i2*3+2] }; const double p3[3] = { aXYZ[i3*3+0], aXYZ[i3*3+1], aXYZ[i3*3+2] }; double un0[3], a0; color_glold::UnitNormalAreaTri3D(un0,a0, p1,p2,p3); double un1[3], a1; color_glold::UnitNormalAreaTri3D(un1,a1, p2,p0,p3); double un2[3], a2; color_glold::UnitNormalAreaTri3D(un2,a2, p3,p0,p1); double un3[3], a3; color_glold::UnitNormalAreaTri3D(un3,a3, p0,p2,p1); const double vt0 = aValSrf[i0]; const double vt1 = aValSrf[i1]; const double vt2 = aValSrf[i2]; const double vt3 = aValSrf[i3]; ::glNormal3dv(un0); heatmap(vt1, colorMap); glVertex3dv(p1); heatmap(vt2, colorMap); glVertex3dv(p2); heatmap(vt3, colorMap); glVertex3dv(p3); ::glNormal3dv(un1); heatmap(vt2, colorMap); glVertex3dv(p2); heatmap(vt3, colorMap); glVertex3dv(p3); heatmap(vt0, colorMap); glVertex3dv(p0); ::glNormal3dv(un2); heatmap(vt3, colorMap); glVertex3dv(p3); heatmap(vt0, colorMap); glVertex3dv(p0); heatmap(vt1, colorMap); glVertex3dv(p1); ::glNormal3dv(un3); heatmap(vt0, colorMap); glVertex3dv(p0); heatmap(vt1, colorMap); glVertex3dv(p1); heatmap(vt2, colorMap); glVertex3dv(p2); } ::glEnd(); } DFM2_INLINE void delfem2::opengl::DrawMeshTet3D_Cut (const std::vector<double>& aXYZ, const std::vector<unsigned int>& aTet, const std::vector<CColor>& aColor, const double org[3], const double ncut[3]) { glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT, GL_DIFFUSE); ::glColor3d(1,1,1); ::glBegin(GL_TRIANGLES); for(size_t itet=0;itet<aTet.size()/4;itet++){ const int ino0 = aTet[itet*4+0]; const int ino1 = aTet[itet*4+1]; const int ino2 = aTet[itet*4+2]; const int ino3 = aTet[itet*4+3]; const double p0[3] = {aXYZ[ino0*3+0], aXYZ[ino0*3+1], aXYZ[ino0*3+2]}; const double p1[3] = {aXYZ[ino1*3+0], aXYZ[ino1*3+1], aXYZ[ino1*3+2]}; const double p2[3] = {aXYZ[ino2*3+0], aXYZ[ino2*3+1], aXYZ[ino2*3+2]}; const double p3[3] = {aXYZ[ino3*3+0], aXYZ[ino3*3+1], aXYZ[ino3*3+2]}; if( color_glold::IsAbovePlane(p0, org, ncut) ) continue; if( color_glold::IsAbovePlane(p1, org, ncut) ) continue; if( color_glold::IsAbovePlane(p2, org, ncut) ) continue; if( color_glold::IsAbovePlane(p3, org, ncut) ) continue; // ::glColor3d(1,1,0); opengl::myGlColorDiffuse(aColor[itet]); // double n[3], area; color_glold::UnitNormalAreaTri3D(n, area, p0, p2, p1); ::glNormal3dv(n); ::glVertex3dv(p0); ::glVertex3dv(p2); ::glVertex3dv(p1); // color_glold::UnitNormalAreaTri3D(n, area, p0, p1, p3); ::glNormal3dv(n); ::glVertex3dv(p0); ::glVertex3dv(p1); ::glVertex3dv(p3); // color_glold::UnitNormalAreaTri3D(n, area, p1, p2, p3); ::glNormal3dv(n); ::glVertex3dv(p1); ::glVertex3dv(p2); ::glVertex3dv(p3); // color_glold::UnitNormalAreaTri3D(n, area, p2, p0, p3); ::glNormal3dv(n); ::glVertex3dv(p2); ::glVertex3dv(p0); ::glVertex3dv(p3); } ::glEnd(); bool is_lighting = glIsEnabled(GL_LIGHTING); ::glDisable(GL_LIGHTING); ::glColor3d(0,0,0); ::glBegin(GL_LINES); for(size_t itet=0;itet<aTet.size()/4;itet++){ const int ino0 = aTet[itet*4+0]; const int ino1 = aTet[itet*4+1]; const int ino2 = aTet[itet*4+2]; const int ino3 = aTet[itet*4+3]; const double p0[3] = {aXYZ[ino0*3+0], aXYZ[ino0*3+1], aXYZ[ino0*3+2]}; const double p1[3] = {aXYZ[ino1*3+0], aXYZ[ino1*3+1], aXYZ[ino1*3+2]}; const double p2[3] = {aXYZ[ino2*3+0], aXYZ[ino2*3+1], aXYZ[ino2*3+2]}; const double p3[3] = {aXYZ[ino3*3+0], aXYZ[ino3*3+1], aXYZ[ino3*3+2]}; if( color_glold::IsAbovePlane(p0, org, ncut) ) continue; if( color_glold::IsAbovePlane(p1, org, ncut) ) continue; if( color_glold::IsAbovePlane(p2, org, ncut) ) continue; if( color_glold::IsAbovePlane(p3, org, ncut) ) continue; //// ::glVertex3dv(p0); ::glVertex3dv(p1); ::glVertex3dv(p0); ::glVertex3dv(p2); ::glVertex3dv(p0); ::glVertex3dv(p3); ::glVertex3dv(p1); ::glVertex3dv(p2); ::glVertex3dv(p1); ::glVertex3dv(p3); ::glVertex3dv(p2); ::glVertex3dv(p3); } ::glEnd(); //// /* ::glColor3d(0,0,0); ::glPointSize(3); ::glBegin(GL_POINTS); for(unsigned int ino=0;ino<nXYZ_;ino++){ ::glVertex3dv(pXYZ_+ino*3); } ::glEnd(); */ if( is_lighting ){ glEnable(GL_LIGHTING); } }
32.027211
88
0.615123
[ "vector", "3d" ]
97c1ec8e906694ebe9c215be1b1a0ebd68112271
1,279
cpp
C++
MEIClient/AMTHIClient/Src/GetIPv6LanInterfaceStatusCommand.cpp
rgl/lms
cda6a25e0f39b2a18f10415560ee6a2cfc5fbbcb
[ "Apache-2.0" ]
18
2019-04-17T10:43:35.000Z
2022-03-22T22:30:39.000Z
MEIClient/AMTHIClient/Src/GetIPv6LanInterfaceStatusCommand.cpp
rgl/lms
cda6a25e0f39b2a18f10415560ee6a2cfc5fbbcb
[ "Apache-2.0" ]
9
2019-10-03T15:29:51.000Z
2021-12-27T14:03:33.000Z
MEIClient/AMTHIClient/Src/GetIPv6LanInterfaceStatusCommand.cpp
isabella232/lms
50d16f81b49aba6007388c001e8137352c5eb42e
[ "Apache-2.0" ]
8
2019-06-13T23:30:50.000Z
2021-06-25T15:51:59.000Z
/* SPDX-License-Identifier: Apache-2.0 */ /* * Copyright (C) 2010-2019 Intel Corporation */ /*++ @file: GetIPv6LanInterfaceStatusCommand.cpp --*/ #include "GetIPv6LanInterfaceStatusCommand.h" namespace Intel { namespace MEI_Client { namespace AMTHI_Client { GetIPv6LanInterfaceStatusCommand::GetIPv6LanInterfaceStatusCommand(uint32_t interfaceIndex) //INTERFACE_SETTINGS { std::shared_ptr<MEICommandRequest> tmp(new GetIPv6LanInterfaceStatusRequest(interfaceIndex)); m_request = tmp; Transact(); } GET_IPv6_LAN_INTERFACE_STATUS_RESPONSE GetIPv6LanInterfaceStatusCommand::getResponse() { return m_response->getResponse(); } void GetIPv6LanInterfaceStatusCommand::parseResponse(const std::vector<uint8_t>& buffer) { std::shared_ptr<AMTHICommandResponse<GET_IPv6_LAN_INTERFACE_STATUS_RESPONSE>> tmp(new AMTHICommandResponse<GET_IPv6_LAN_INTERFACE_STATUS_RESPONSE>(buffer, RESPONSE_COMMAND_NUMBER)); m_response = tmp; } std::vector<uint8_t> GetIPv6LanInterfaceStatusRequest::SerializeData() { std::vector<uint8_t> output((std::uint8_t*)&m_interfaceIndex, (std::uint8_t*)&m_interfaceIndex + sizeof(uint32_t)); return output; } } // namespace AMTHI_Client } // namespace MEI_Client } // namespace Intel
31.195122
185
0.76466
[ "vector" ]
97d27602f59a887ef47aecc25fcf43988d421bb5
62,846
cpp
C++
src/uvmsc/base/uvm_component.cpp
stoitchog/uvm-systemc-1.0-beta2
67a445dc5f587d2fd16c5b5ee913d086b2242583
[ "ECL-2.0", "Apache-2.0" ]
4
2021-11-04T14:37:00.000Z
2022-03-14T12:57:50.000Z
src/uvmsc/base/uvm_component.cpp
stoitchog/uvm-systemc-1.0-beta2
67a445dc5f587d2fd16c5b5ee913d086b2242583
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/uvmsc/base/uvm_component.cpp
stoitchog/uvm-systemc-1.0-beta2
67a445dc5f587d2fd16c5b5ee913d086b2242583
[ "ECL-2.0", "Apache-2.0" ]
1
2021-02-22T05:46:04.000Z
2021-02-22T05:46:04.000Z
//---------------------------------------------------------------------- //! Copyright 2012-2015 NXP B.V. //! Copyright 2013-2014 Fraunhofer-Gesellschaft zur Foerderung // der angewandten Forschung e.V. //! Copyright 2007-2011 Mentor Graphics Corporation //! Copyright 2007-2011 Cadence Design Systems, Inc. //! Copyright 2010-2011 Synopsys, Inc. //! All Rights Reserved Worldwide // //! Licensed under the Apache License, Version 2.0 (the //! "License"); you may not use this file except in //! compliance with the License. You may obtain a copy of //! the License at // //! http://www.apache.org/licenses/LICENSE-2.0 // //! Unless required by applicable law or agreed to in //! writing, software distributed under the License is //! distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR //! CONDITIONS OF ANY KIND, either express or implied. See //! the License for the specific language governing //! permissions and limitations under the License. //---------------------------------------------------------------------- #include <iostream> #include <string> #include <cstring> #include <algorithm> #ifndef SC_INCLUDE_DYNAMIC_PROCESSES #define SC_INCLUDE_DYNAMIC_PROCESSES #endif #include <systemc> #include "sysc/kernel/sc_dynamic_processes.h" #include "uvmsc/base/uvm_root.h" #include "uvmsc/base/uvm_component.h" #include "uvmsc/base/uvm_component_name.h" #include "uvmsc/base/uvm_coreservice_t.h" #include "uvmsc/factory/uvm_factory.h" #include "uvmsc/base/uvm_object_globals.h" #include "uvmsc/phasing/uvm_common_phases.h" #include "uvmsc/phasing/uvm_phase.h" #include "uvmsc/conf/uvm_config_db.h" #include "uvmsc/seq/uvm_sequencer_base.h" #include "uvmsc/print/uvm_printer.h" #include "uvmsc/macros/uvm_message_defines.h" #include "uvmsc/report/uvm_report_object.h" using namespace sc_core; namespace uvm { //---------------------------------------------------------------------------- // Class: uvm_component //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Initialization of data members //---------------------------------------------------------------------------- bool uvm_component::global_timeout_spawned_ = false; bool uvm_component::_print_config_matches = false; //---------------------------------------------------------------------------- // Constructor //---------------------------------------------------------------------------- uvm_component::uvm_component( uvm_component_name nm ) : sc_module( nm.name() ), uvm_report_object((std::string)nm.name()) { // prevent recursive registration of uvm_root module bool top = ( strstr(nm, "uvm_top") != NULL ); set_name(std::string(nm)); start_report_handler(this->name()); if (!top) { print_enabled = true; sc_object* sc_parent = this->get_parent_object(); uvm_component* uvm_parent = dynamic_cast<uvm_component*>(sc_parent); if ( uvm_parent == NULL) { std::ostringstream str; str << "The parent of UVM component '" << nm << "' is not a UVM component. uvm_top is used instead."; uvm_report_info("NOPARENT", str.str(), UVM_HIGH); uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_root* root = cs->get_root(); m_comp_parent = root; } else m_comp_parent = uvm_parent; if (!m_comp_parent->m_add_child(this)) { std::ostringstream str; str << "Unable to add child '" << nm << "' to parent '" << m_comp_parent->get_name() << "'."; UVM_WARNING("NOPARENT", str.str()); m_comp_parent = NULL; } else { //m_domain = m_comp_parent->m_domain; //!inherit domains from parents (or uvm_top) uvm_domain::get_common_domain(); m_domain = uvm_domain::get_uvm_domain(); } } else { print_enabled = false; } //!default settings m_build_done = false; m_phasing_active = 0; recording_detail = UVM_NONE; m_current_phase = NULL; m_children.clear(); } //---------------------------------------------------------------------------- // member function: get_parent (virtual) // //! Returns a handle to this component's parent, or null if it has no parent. //---------------------------------------------------------------------------- uvm_component* uvm_component::get_parent() const { return m_comp_parent; } //---------------------------------------------------------------------------- // member function: get_full_name (virtual) // //! Returns the full hierarchical name of this object. The default //! implementation concatenates the hierarchical name of the parent, if any, //! with the leaf name of this object, as given by uvm_object::get_name. //---------------------------------------------------------------------------- const std::string uvm_component::get_full_name() const { // Note--Implementation choice to construct full name once since the // full name may be used often for lookups. if (m_name.empty()) return get_name(); else return m_name; } //---------------------------------------------------------------------------- // member function: get_children // //! This function populates the end of the children array with the //! list of this component's children. //---------------------------------------------------------------------------- void uvm_component::get_children( std::vector<uvm_component*>& children ) const { for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) children.push_back((*it).second); } //---------------------------------------------------------------------------- // member function: get_child // //! Member function to iterate through his component�s children, if any. //---------------------------------------------------------------------------- uvm_component* uvm_component::get_child( const std::string& name ) const { if (m_children.find(name) != m_children.end() ) //!exists return m_children.find(name)->second; std::ostringstream str; str << "Component with name '" << name << "' is not a child of component '" << get_full_name() << "'."; uvm_report_warning("NOCHILD",str.str()); return NULL; } //---------------------------------------------------------------------------- // member function: get_next_child // //! Member function to iterate through his component�s children, if any. //---------------------------------------------------------------------------- int uvm_component::get_next_child( std::string& name ) const { m_children_cnt++; if (m_children_cnt >= m_children.size()) return 0; m_children_mapcItT it = m_children.begin(); for (unsigned int i = 0; i < m_children_cnt; i++ ) it++; name = it->first; if (!name.empty()) return 1; else return 0; } //---------------------------------------------------------------------------- // member function: get_first_child // //! Member function to iterate through his component�s children, if any. //---------------------------------------------------------------------------- int uvm_component::get_first_child( std::string& name ) const { m_children_mapcItT it = m_children.begin(); m_children_cnt = 0; if (m_children.size() == 0) return 0; name = it->first; if (!name.empty()) return 1; else return 0; } //---------------------------------------------------------------------------- // member function: get_num_children // //! Returns the number of this component's children. //---------------------------------------------------------------------------- int uvm_component::get_num_children() const { return m_children.size(); } //---------------------------------------------------------------------------- // member function: has_child // //! Returns true if this component has a child with the given name, and false otherwise. //---------------------------------------------------------------------------- bool uvm_component::has_child( const std::string& name) const { return (m_children.find(name) != m_children.end()); } //---------------------------------------------------------------------------- // member function: lookup // //! Looks for a component with the given hierarchical name relative to this //! component. If the given name is preceded with a '.' (dot), then the search //! begins relative to the top level (absolute lookup). The handle of the //! matching component is returned, else NULL. The name must not contain //! wildcards. //---------------------------------------------------------------------------- uvm_component* uvm_component::lookup( const std::string& name ) const { std::string leaf, remainder; const uvm_component* comp; const uvm_root* top; uvm_coreservice_t* cs; cs = uvm_coreservice_t::get(); top = cs->get_root(); comp = this; m_extract_name(name, leaf, remainder); if (leaf.empty()) { comp = top; //!absolute lookup m_extract_name(remainder, leaf, remainder); } if (!comp->has_child(leaf)) { UVM_WARNING("Lookup Error", "Cannot find child " + leaf); return NULL; } if(!remainder.empty()) return comp->m_children.find(leaf)->second->lookup(remainder); return comp->m_children.find(leaf)->second; } //---------------------------------------------------------------------------- // member function: get_depth // //! Returns the component's depth from the root level. uvm_top has a //! depth of 0. The test and any other top level components have a depth //! of 1, and so on. //---------------------------------------------------------------------------- unsigned int uvm_component::get_depth() const { std::string nm = name(); if( nm.size() == 0 ) return 0; int depth; depth = count(nm.begin(), nm.end(), '.'); return depth+1; } //---------------------------------------------------------------------------- // Group: Phasing Interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: build_phase // //! Any override should call build_phase(uvm_phase&) of its base class to execute //! the automatic configuration of fields registered in the component by calling //! apply_config_settings. //! To turn off automatic configuration for a component, //! do not call the build_phase(uvm_phase&) of its base class //! //! This member function should never be called directly. //---------------------------------------------------------------------------- void uvm_component::build_phase( uvm_phase& phase ) { m_build_done = true; apply_config_settings(_print_config_matches); if(m_phasing_active == 0) uvm_report_warning("BUILD", "The member function build_phase() has been called explicitly, outside of the phasing system. This may lead to unexpected behavior."); } //---------------------------------------------------------------------------- // member function: connect_phase // //! Placeholder for the connect phase base class implementation //! //! This member function should never be called directly. //---------------------------------------------------------------------------- void uvm_component::connect_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: end_of_elaboration_phase // //! Placeholder for the sc_module::end_of_elaboration_phase base class implementation //! //! This member function should never be called directly. //---------------------------------------------------------------------------- void uvm_component::end_of_elaboration_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: start_of_simulation_phase // //! Placeholder for the sc_module::start_of_simulation_phase base class implementation //! //! This member function should never be called directly. //---------------------------------------------------------------------------- void uvm_component::start_of_simulation_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: run phase. // //! The main thread of execution. //! The component should not declare run_phase as a thread process - it is //! automatically spawned by uvm_component's constructor. //! //! The member function should never be called directly. //---------------------------------------------------------------------------- void uvm_component::run_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: pre_reset_phase // //! Placeholder for the pre_reset_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::pre_reset_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: reset_phase // //! Placeholder for the reset_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::reset_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: post_reset_phase // //! Placeholder for the post_reset_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::post_reset_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: pre_configure_phase // //! Placeholder for the pre_configure_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::pre_configure_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: configure_phase // //! Placeholder for the configure_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::configure_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: post_configure_phase // //! Placeholder for the post_configure_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::post_configure_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: pre_main_phase // //! Placeholder for the pre_main_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::pre_main_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: main_phase // //! Placeholder for the main_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::main_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: post_main_phase // //! Placeholder for the post_main_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::post_main_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: pre_shutdown_phase // //! Placeholder for the pre_shutdown_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::pre_shutdown_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function:shutdown_phase // //! Placeholder for the shutdown_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::shutdown_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: post_shutdown_phase // //! Placeholder for the post_shutdown_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::post_shutdown_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: extract_phase // //! Placeholder for the extract_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::extract_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: check_phase // //! Placeholder for the check_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::check_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: report_phase // //! Placeholder for the report_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::report_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: final_phase // //! Placeholder for the final_phase base class implementation //! //! This member function should not be called directly. //---------------------------------------------------------------------------- void uvm_component::final_phase( uvm_phase& phase ) {} //---------------------------------------------------------------------------- // member function: phase_started // //! Invoked at the start of each phase. The \p phase argument specifies //! the phase being started. Any threads spawned in this callback are //! not affected when the phase ends. //---------------------------------------------------------------------------- void uvm_component::phase_started( uvm_phase& phase ) { // placeholder for application to use this phase } //---------------------------------------------------------------------------- // member function: phase_ready_to_end // //! Invoked when all objections to ending the given \p phase and all //! sibling phases have been dropped, thus indicating that ~phase~ is //! ready to begin a clean exit. Sibling phases are any phases that //! have a common successor phase in the schedule plus any phases that //! sync'd to the current phase. Components needing to consume delta //! cycles or advance time to perform a clean exit from the phase //! may raise the phase's objection. //---------------------------------------------------------------------------- void uvm_component::phase_ready_to_end( uvm_phase& phase ) { // placeholder for application to use this phase } //---------------------------------------------------------------------------- // member function: phase_ended // //! Invoked at the end of each phase. The \p phase argument specifies //! the phase that is ending. Any threads spawned in this callback are //! not affected when the phase ends. //---------------------------------------------------------------------------- void uvm_component::phase_ended( uvm_phase& phase ) { // placeholder for application to use this phase } //-------------------------------------------------------------------- //!phase / schedule / domain API //-------------------------------------------------------------------- //-------------------------------------------------------------------- // member function: set_domain // //! Apply a phase domain to this component and, if \p hier is set, //! recursively to all its children. //! //! Calls the virtual define_domain method, which derived components can //! override to augment or replace the domain definition of its base class. //-------------------------------------------------------------------- void uvm_component::set_domain( uvm_domain& domain, int hier ) { m_domain = &domain; define_domain(domain); if (hier) for ( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_domain(domain); } //-------------------------------------------------------------------- // member function: get_domain // //! Return handle to the phase domain set on this component //-------------------------------------------------------------------- uvm_domain* uvm_component::get_domain() const { return m_domain; } //-------------------------------------------------------------------- // member function: define_domain // //! Builds custom phase schedules into the provided domain handle. //! //! This member function is called by set_domain(), //! which integrators use to specify //! this component belongs in a domain apart from the default 'uvm' domain. //-------------------------------------------------------------------- void uvm_component::define_domain( uvm_domain& domain ) { m_schedule = domain.find_by_name("uvm_sched"); if (m_schedule == NULL) { m_schedule = new uvm_phase("uvm_sched", UVM_PHASE_SCHEDULE); m_schedule_list.push_back(m_schedule); // TODO keep track of added schedules (to be deleted afterwards) uvm_domain::add_uvm_phases(m_schedule); domain.add(m_schedule); m_common = uvm_domain::get_common_domain(); if (m_common->find(&domain, false) == NULL) m_common->add(&domain, m_common->find(uvm_run_phase::get()) ); } else uvm_report_warning("SETDOM", "User-specified domain '" + domain.get_name() + "' already exists for component '" + get_name() + "' and will be ignored", UVM_DEBUG); } //-------------------------------------------------------------------- // member function: set_phase_imp // //! Override the default implementation for a phase on this component (tree) with a //! custom one, which must be created as a singleton object extending the default //! one and implementing required behavior in exec and traverse methods //! //! The optional argument \p hier specifies whether to apply the custom functor //! to the whole tree or just this component. //-------------------------------------------------------------------- void uvm_component::set_phase_imp( uvm_phase* phase, uvm_phase* imp, int hier ) { m_phase_imps[phase] = imp; if (hier) for ( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_phase_imp(phase,imp,hier); } //-------------------------------------------------------------------- // member function: suspend // //! Suspend the component. //! A suspended component can be subsequently resumed using resume(). //-------------------------------------------------------------------- bool uvm_component::suspend() { if (m_run_handle.valid() && !m_run_handle.terminated()) { m_run_handle.suspend(SC_INCLUDE_DESCENDANTS); return true; } else return false; } //-------------------------------------------------------------------- // member function: resume // //! Resume the component. //! Member function to resume a component that was previously suspended //! using suspend. //! A component may start in the suspended state and //! may need to be explicitly resumed. //-------------------------------------------------------------------- bool uvm_component::resume() { if (m_run_handle.valid() && !m_run_handle.terminated()) { m_run_handle.resume(SC_INCLUDE_DESCENDANTS); return true; } else return false; } //---------------------------------------------------------------------------- // Configuration interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: check_config_usage // //! Check all configuration settings in a components configuration table //! to determine if the setting has been used, overridden or not used. //! When \p recurse is true (default), configuration for this and all child //! components are recursively checked. This function is automatically //! called in the check phase, but can be manually called at any time. //---------------------------------------------------------------------------- void uvm_component::check_config_usage( bool recurse ) { // TODO - do we really need this? } //---------------------------------------------------------------------------- // member function: apply_config_settings // //! Searches for all config settings matching this component's instance path. //! For each match, the appropriate set_*_local method is called using the //! matching config setting's field_name and value. Provided the set_*_local //! method is implemented, the component property associated with the //! field_name is assigned the given value. //---------------------------------------------------------------------------- void uvm_component::apply_config_settings( bool verbose ) { // TODO - do we really need this? } //---------------------------------------------------------------------------- // member function: print_config // //! Print_config_settings prints all configuration information for this //! component, as set by previous calls to set_config_* and exports to //! the resources pool. The settings are printing in the order of //! their precedence. //! If recurse is set to true, then configuration information for all //! children and below are printed as well. //! if audit is set to true, then the audit trail for each resource is printed //! along with the resource name and value //---------------------------------------------------------------------------- void uvm_component::print_config( bool recurse, bool audit ) const { uvm_resource_pool* rp = uvm_resource_pool::get(); uvm_report_info("CFGPRT","visible resources:", UVM_INFO); rp->print_resources(rp->lookup_scope(get_full_name()), audit); if(recurse) { uvm_component* c; for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) { c = (*it).second; c->print_config(recurse, audit); } } } //---------------------------------------------------------------------------- // member function: print_config_with_audit // //! Operates the same as print_config except that the audit argument is //! forced to true. This interface makes user code a bit more readable as //! it avoids multiple arbitrary bit settings in the argument list. //! //! If recurse is set to true, then configuration information for all //! children and below are printed as well. //---------------------------------------------------------------------------- void uvm_component::print_config_with_audit( bool recurse ) const { print_config(recurse, true); } //---------------------------------------------------------------------------- // member function: print_config_matches // //! If enabled, all configuration getters will print info about //! matching configuration settings as they are being applied. //---------------------------------------------------------------------------- void uvm_component::print_config_matches( bool enable ) { if (enable) _print_config_matches = true; } //---------------------------------------------------------------------------- // Group: Objection Interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: raised // //! The member function raised shall be called when this or a descendant of this component //! instance raises the specfied \p objection. The \p source_obj is the object //! that originally raised the objection. //! The \p description is optionally provided by the \p source_obj to give a //! reason for raising the objection. The \p count indicates the number of //! objections raised by the \p source_obj. //---------------------------------------------------------------------------- void uvm_component::raised( uvm_objection* objection, uvm_object* source_obj, const std::string& description, int count ) { // callback for application } //---------------------------------------------------------------------------- // member function: dropped // //! The member function dropped shall be called when this or a descendant of this component //! instance drops the specfied \p objection. The \p source_obj is the object //! that originally dropped the objection. //! The \p description is optionally provided by the \p source_obj to give a //! reason for dropping the objection. The \p count indicates the number of //! objections dropped by the the \p source_obj. //---------------------------------------------------------------------------- void uvm_component::dropped( uvm_objection* objection, uvm_object* source_obj, const std::string& description, int count ) { // callback for application } //---------------------------------------------------------------------------- // member function: all_dropped // //! The member function all_droppped shall be called when all objections have been //! dropped by this component and all its descendants. The \p source_obj is the //! object that dropped the last objection. //! The \p description is optionally provided by the \p source_obj to give a //! reason for raising the objection. The \p count indicates the number of //! objections dropped by the the \p source_obj. //---------------------------------------------------------------------------- void uvm_component::all_dropped( uvm_objection* objection, uvm_object* source_obj, const std::string& description, int count ) { // callback for application } //---------------------------------------------------------------------------- // Group: Factory Interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: create_component // //! A convenience function for uvm_factory::create_component_by_name, //! this method calls upon the factory to create a new child component //! whose type corresponds to the preregistered type name, \p requested_type_name, //! and instance name, \p name. //---------------------------------------------------------------------------- uvm_component* uvm_component::create_component( const std::string& requested_type_name, const std::string& name ) { uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); return factory->create_component_by_name( requested_type_name, get_full_name(), name, this ); } //---------------------------------------------------------------------------- // member function: create_object // //! A convenience function for uvm_factory::create_object_by_name, //! this method calls upon the factory to create a new object //! whose type corresponds to the preregistered type name, //! \p requested_type_name, and instance name, \p name. //---------------------------------------------------------------------------- uvm_object* uvm_component::create_object( const std::string& requested_type_name, const std::string& name ) { uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); return factory->create_object_by_name( requested_type_name, get_full_name(), name ); } //---------------------------------------------------------------------------- // member function: set_type_override_by_type (static) // //! A convenience function for uvm_factory::set_type_override_by_type, this //! member function registers a factory override for components and objects created at //! this level of hierarchy or below. //---------------------------------------------------------------------------- void uvm_component::set_type_override_by_type( uvm_object_wrapper* original_type, uvm_object_wrapper* override_type, bool replace ) { uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); factory->set_type_override_by_type( original_type, override_type, replace ); } //---------------------------------------------------------------------------- // member function: set_inst_override_by_type // //! A convenience function for uvm_factory::set_inst_override_by_type, this //! member function registers a factory override for components and objects created at //! this level of hierarchy or below. //---------------------------------------------------------------------------- void uvm_component::set_inst_override_by_type( const std::string& relative_inst_path, uvm_object_wrapper* original_type, uvm_object_wrapper* override_type ) { std::string full_inst_path = prepend_name(relative_inst_path); // TODO note: for some reason, the parameter order is slightly different between component and factory uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); factory->set_inst_override_by_type( original_type, override_type, full_inst_path ); } //---------------------------------------------------------------------------- // member function: set_type_override (static) // //! A convenience function for uvm_factory::set_type_override_by_name, //! this method configures the factory to create an object of type //! \p override_type_name whenever the factory is asked to produce a type //! represented by \p original_type_name. //---------------------------------------------------------------------------- void uvm_component::set_type_override( const std::string& original_type_name, const std::string& override_type_name, bool replace ) { uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); factory->set_type_override_by_name( original_type_name, override_type_name, replace ); } //---------------------------------------------------------------------------- // member function: set_inst_override // //! A convenience function for uvm_factory::set_inst_override_by_name, this //! method registers a factory override for components created at this level //! of hierarchy or below. //---------------------------------------------------------------------------- void uvm_component::set_inst_override( const std::string& relative_inst_path, const std::string& original_type_name, const std::string& override_type_name ) { std::string path = prepend_name(relative_inst_path); uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); factory->set_inst_override_by_name( original_type_name, override_type_name, path ); } //---------------------------------------------------------------------------- // member function: print_override_info // //! This factory debug method performs the same lookup process as #create_object //! and #create_component, but instead of creating an object, it prints //! information about what type of object would be created given the //! provided arguments. //---------------------------------------------------------------------------- void uvm_component::print_override_info( const std::string& requested_type_name, const std::string& name ) { uvm_coreservice_t* cs = uvm_coreservice_t::get(); uvm_factory* factory = cs->get_factory(); factory->debug_create_by_name(requested_type_name, get_full_name(), name); } //---------------------------------------------------------------------------- // Group: Hierarchical Reporting Interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: set_report_id_verbosity_hier //! The member function #set_report_id_verbosity_hier shall recursively associate //! the specified \p verbosity with reports of the given \p id. A verbosity associated //! with a particular severity-id pair, using member function //! #set_report_severity_id_verbosity_hier, shall take precedence over a verbosity //! associated by this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_id_verbosity_hier( const std::string& id, int verbosity ) { set_report_id_verbosity(id, verbosity); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_id_verbosity_hier(id, verbosity); } //---------------------------------------------------------------------------- // member function: set_report_severity_id_verbosity_hier // //! The member function #set_report_severity_id_verbosity_hier shall recursively //! associate the specified \p verbosity with reports of the given \p severity with //! \p id pair. An verbosity associated with a particular severity-id pair takes //! precedence over an verbosity associated with id, which takes precedence //! over a verbosity associated with a severity. //---------------------------------------------------------------------------- void uvm_component::set_report_severity_id_verbosity_hier( uvm_severity severity, const std::string& id, int verbosity ) { set_report_severity_id_verbosity(severity, id, verbosity); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_severity_id_verbosity_hier(severity, id, verbosity); } //---------------------------------------------------------------------------- // member function: set_report_severity_action_hier // //! The member function #set_report_severity_action_hier shall recursively //! associate the specified \p action with reports of the given \p severity. //! An action associated with a particular severity-id pair shall take //! precedence over an action associated with id, which shall take precedence //! over an action associated with a severity as defined in this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_severity_action_hier( uvm_severity severity, uvm_action action ) { set_report_severity_action(severity, action); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_severity_action_hier(severity, action); } //---------------------------------------------------------------------------- // member function: set_report_id_action_hier //! The member function #set_report_id_action_hier shall recursively associate //! the specified \p action with reports of the given \p id. An action associated //! with a particular severity-id pair shall take precedence over an action //! associated with id as defined in this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_id_action_hier( const std::string& id, uvm_action action ) { set_report_id_action(id, action); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_id_action_hier(id, action); } //---------------------------------------------------------------------------- // member function: set_report_severity_id_action_hier // //! The member function #set_report_severity_id_action_hier shall recursively //! associate the specified \p action with reports of the given \p severity with //! \p id pair. An action associated with a particular severity-id pair shall //! take precedence over an action associated with id, which shall take //! precedence over an action associated with a severity. //---------------------------------------------------------------------------- void uvm_component::set_report_severity_id_action_hier( uvm_severity severity, const std::string& id, uvm_action action ) { set_report_severity_id_action(severity, id, action); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_severity_id_action_hier(severity, id, action); } //---------------------------------------------------------------------------- // member function: set_report_default_file_hier // //! The member function #set_report_default_file_hier shall recursively associate //! the report to the default \p file descriptor. A file associated with a particular //! severity-id pair shall take precedence over a file associated with id, which //! shall take precedence over a file associated with a severity, which shall take //! precedence over the default file descriptor as defined in this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_default_file_hier( UVM_FILE file ) { set_report_default_file(file); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_default_file_hier(file); } //---------------------------------------------------------------------------- // member function: set_report_severity_file_hier // //! The member function #set_report_severity_file_hier shall recursively associate //! the specified \p file descriptor with reports of the given \p severity. A file //! associated with a particular severity-id pair shall take precedence over //! a file associated with id, which shall take precedence over a file associated //! with a severity as defined in this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_severity_file_hier( uvm_severity severity, UVM_FILE file ) { set_report_severity_file(severity, file); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_severity_file_hier(severity, file); } //---------------------------------------------------------------------------- // member function: set_report_id_file_hier // //! The member function #set_report_id_file_hier shall recursively associate //! the specified \p file descriptor with reports of the given \p id. A file //! associated with a particular severity-id pair shall take precedence over //! a file associated with id as defined in this member function. //---------------------------------------------------------------------------- void uvm_component::set_report_id_file_hier( const std::string& id, UVM_FILE file) { set_report_id_file(id, file); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_id_file_hier(id, file); } //---------------------------------------------------------------------------- // member function: set_report_severity_id_file_hier // //! The member function #set_report_severity_id_file_hier shall recursively //! associate the specified \p file descriptor with reports of the given \p severity //! and \p id pair. A file associated with a particular severity-id pair shall //! take precedence over a file associated with id, which shall take precedence //! over a file associated with a severity, which shall take precedence over //! the default file descriptor. //---------------------------------------------------------------------------- void uvm_component::set_report_severity_id_file_hier( uvm_severity severity, const std::string& id, UVM_FILE file ) { set_report_severity_id_file(severity, id, file); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_severity_id_file_hier(severity, id, file); } //---------------------------------------------------------------------------- // member function: set_report_verbosity_level_hier // //! The member function #set_report_verbosity_level_hier shall recursively set //! the maximum \p verbosity level for reports for this component and all those //! below it. Any report from this component subtree whose verbosity exceeds //! this maximum will be ignored. //---------------------------------------------------------------------------- void uvm_component::set_report_verbosity_level_hier( int verbosity ) { set_report_verbosity_level(verbosity); for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->set_report_verbosity_level_hier(verbosity); } //---------------------------------------------------------------------------- // member function: pre_abort (virtual) // //! The member function #pre_abort shall be executed when the message system is executing a //! uvm::UVM_EXIT action. The exit action causes an immediate termination of //! the simulation, but the pre_abort callback hook gives components an //! opportunity to provide additional information to the user before //! the termination happens. //! The pre_abort() callback hooks are called in a bottom-up fashion. //---------------------------------------------------------------------------- void uvm_component::pre_abort() { // callback for application } //---------------------------------------------------------------------------- // Group: Recording Interface //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // member function: accept_tr // //! This function marks the acceptance of a transaction, ~tr~, by this //! component. //---------------------------------------------------------------------------- void uvm_component::accept_tr( const uvm_transaction& tr, const sc_time& accept_time ) { //TODO - add transaction recording } //---------------------------------------------------------------------------- // member function: do_accept_tr // //! The <accept_tr> method calls this function to accommodate any user-defined //! post-accept action. Implementations should call super.do_accept_tr to //! ensure correct operation. //---------------------------------------------------------------------------- void uvm_component::do_accept_tr( const uvm_transaction& tr ) { //TODO - add transaction recording } //---------------------------------------------------------------------------- // member function: begin_tr // //! This function marks the start of a transaction, \p tr, by this component. //---------------------------------------------------------------------------- int uvm_component::begin_tr( const uvm_transaction& tr, const std::string& stream_name, const std::string& label, const std::string& desc, const sc_time& begin_time, int parent_handle ) { // TODO - add transaction recording return 0; //!dummy } //---------------------------------------------------------------------------- // member function: begin_child_tr // //! This function marks the start of a child transaction, \p tr, by this //! component. Its operation is identical to that of #begin_tr, except that //! an association is made between this transaction and the provided parent //! transaction. //! This association is vendor-specific. //---------------------------------------------------------------------------- int uvm_component::begin_child_tr( const uvm_transaction& tr, int parent_handle, const std::string& stream_name, const std::string& label, const std::string& desc, const sc_time& begin_time ) { // TODO - add transaction recording return 0; // dummy } //---------------------------------------------------------------------------- // member function: do_begin_tr // //! The member functions #begin_tr and #begin_child_tr shall call this function to //! accommodate any user-defined post-begin action. Implementations should call //! the base class member function to ensure correct operation. //---------------------------------------------------------------------------- void uvm_component::do_begin_tr( const uvm_transaction& tr, const std::string& stream_name, int tr_handle ) { // TODO - add transaction recording } //---------------------------------------------------------------------------- // member function: end_tr // //! This function marks the end of a transaction, \p tr, by this component. //---------------------------------------------------------------------------- void uvm_component::end_tr( const uvm_transaction& tr, const sc_time& end_time, bool free_handle ) { // TODO - add transaction recording uvm_transaction* t; t = const_cast<uvm_transaction*>(&tr); t->end_tr(end_time, free_handle); // TODO make const method to avoid const_casting? } //---------------------------------------------------------------------------- // member function: do_end_tr // //! The member function #end_tr calls this function to accommodate any user-defined //! post-end action. Implementations should call this base class member //! function to ensure correct operation. //---------------------------------------------------------------------------- void uvm_component::do_end_tr( const uvm_transaction& tr, int tr_handle ) { // TODO - add transaction recording } //---------------------------------------------------------------------------- // member function: record_error_tr // //! This function marks an error transaction by a component. Properties of the //! given #uvm_object, \p info, as implemented in its member function //! uvm_object::do_record, are recorded to the transaction database. //---------------------------------------------------------------------------- int uvm_component::record_error_tr( const std::string& stream_name, uvm_object* info, const std::string& label, const std::string& desc, const sc_time& error_time, bool keep_active ) { // TODO - add transaction recording return 0; // dummy } //---------------------------------------------------------------------------- // member function: record_event_tr // //! This function marks an event transaction by a component. //---------------------------------------------------------------------------- int uvm_component::record_event_tr( const std::string& stream_name, uvm_object* info, const std::string& label, const std::string& desc, const sc_time& event_time, bool keep_active ) { // TODO - add transaction recording return 0; // dummy } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////// Implementation-defined member functions start here //////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //---------------------------------------------------------------------------- // Destructor //---------------------------------------------------------------------------- uvm_component::~uvm_component() { // clean memory of dynamically added elements while(!m_schedule_list.empty()) delete m_schedule_list.back(), m_schedule_list.pop_back(); while(!m_config_object_wrapper_list.empty()) delete m_config_object_wrapper_list.back(), m_config_object_wrapper_list.pop_back(); } //---------------------------------------------------------------------------- // member function: print_config_settings - DEPRECATED // //! Called without arguments, print_config_settings prints all configuration //! information for this component, as set by previous calls to set_config_*. //! The settings are printing in the order of their precedence. //---------------------------------------------------------------------------- void uvm_component::print_config_settings( const std::string& field, uvm_component* comp, bool recurse ) { UVM_FATAL("DEPRD", "This function has been deprecated. Use print_config instead."); } //---------------------------------------------------------------------------- // member function: do_print (override) // // Implementation defined //---------------------------------------------------------------------------- void uvm_component::do_print( const uvm_printer& printer ) const { std::string v; uvm_object::do_print(printer); // It is printed only if its value is other than the default (UVM_NONE) if(recording_detail != UVM_NONE) { int size = 0 ; // TODO get real size of recording_detail? static char separator[] = "."; switch (recording_detail) { case UVM_LOW : printer.print_generic("recording_detail", "uvm_verbosity", size, "UVM_LOW"); break; case UVM_MEDIUM : printer.print_generic("recording_detail", "uvm_verbosity", size, "UVM_MEDIUM"); break; case UVM_HIGH : printer.print_generic("recording_detail", "uvm_verbosity", size, "UVM_HIGH"); break; case UVM_FULL : printer.print_generic("recording_detail", "uvm_verbosity", size, "UVM_FULL"); break; default : printer.print_field_int("recording_detail", recording_detail, size, UVM_DEC, separator, "integer"); break; } //!switch } //!if } //---------------------------------------------------------------------------- // member function: set_name // //! Implementation defined // //! Renames this component to ~name~ and recalculates all descendants' //! full names. //---------------------------------------------------------------------------- void uvm_component::set_name( const std::string& name ) { if(!m_name.empty()) { uvm_report_error("INVSTNM", "It is illegal to change the name of a component. The component name will not be changed to '"+ std::string(name) + "'."); return; } uvm_object::set_name(name); m_set_full_name(); } //---------------------------------------------------------------------------- // member function: before_end_of_elaboration (virtual) // //! Implementation defined - not part of UVM standard //! note: directly called by SystemC kernel //---------------------------------------------------------------------------- void uvm_component::before_end_of_elaboration() {} //---------------------------------------------------------------------------- // member function: end_of_elaboration (virtual) // //! Implementation defined - not part of UVM standard //! note: directly called by SystemC kernel //---------------------------------------------------------------------------- void uvm_component::end_of_elaboration() {} //---------------------------------------------------------------------------- // member function: start_of_simulation (virtual) // //! Implementation defined - not part of UVM standard //! note: directly called by SystemC kernel //---------------------------------------------------------------------------- void uvm_component::start_of_simulation() {} //---------------------------------------------------------------------------- // member function: end_of_simulation (virtual) // //! Implementation defined - not part of UVM standard //! note: directly called by SystemC kernel //---------------------------------------------------------------------------- void uvm_component::end_of_simulation() {} //---------------------------------------------------------------------------- // member function: m_apply_verbosity_settings // //! Implementation defined //---------------------------------------------------------------------------- void uvm_component::m_apply_verbosity_settings( uvm_phase* phase ) { // TODO } //---------------------------------------------------------------------------- // member function: m_set_run_handle // //! Implementation defined //---------------------------------------------------------------------------- void uvm_component::m_set_run_handle( sc_process_handle h ) { m_run_handle = h; } //---------------------------------------------------------------------------- // member function: prepend_name // //! Implementation defined //---------------------------------------------------------------------------- std::string uvm_component::prepend_name( const std::string& s ) { std::string n = name(); if (!s.empty()) { n += std::string("."); n += s; } return n; } //---------------------------------------------------------------------------- // member function: m_add_child // //! Implementation defined //---------------------------------------------------------------------------- bool uvm_component::m_add_child( uvm_component* child, const std::string& name ) { std::string chname; if (name.empty()) chname = child->get_name(); if ( ( m_children.find(chname) != m_children.end() ) //!if exists && m_children[chname] != child ) { std::ostringstream str; str << "A child with the name '" << chname << "' (type=" << m_children[chname]->get_type_name() << ") already exists."; uvm_report_warning("BDCHLD",str.str(), UVM_NONE); return false; } if (m_children_by_handle.find(child) != m_children_by_handle.end() ) { std::ostringstream str; str << "A child with the name '" << chname << "' already exists in parent under name '" << m_children_by_handle[child]->get_name(); uvm_report_warning("BDCHLD",str.str(), UVM_NONE); return false; } m_children[chname] = child; m_children_by_handle[child] = child; return true; } //---------------------------------------------------------------------------- // member function: kind (virtual, SystemC API) // //! Added for compatibility reasons //---------------------------------------------------------------------------- const char* uvm_component::kind() const { return "uvm::uvm_component"; } //---------------------------------------------------------------------------- // member function: get_type_name // //! Implementation defined //! Return the type name of this class - e.g., "my_component". //! Inherits this pure virtual method from base class #uvm_typed. //---------------------------------------------------------------------------- const std::string uvm_component::get_type_name() const { return std::string(kind()); } //---------------------------------------------------------------------------- // member function: m_set_full_name // //! Implementation defined //---------------------------------------------------------------------------- void uvm_component::m_set_full_name() { m_name = std::string(this->name()); //!use SystemC method } //---------------------------------------------------------------------------- // member function: m_extract_name // //! Implementation defined //---------------------------------------------------------------------------- void uvm_component::m_extract_name( const std::string& name, std::string& leaf, std::string& remainder ) const { unsigned int i, len; std::string extract_str; len = name.length(); for( i = 0; i < name.length(); i++ ) { if( name[i] == '.' ) break; } if( i == len ) { leaf = name; remainder = ""; return; } leaf = name.substr( 0 , i - 1 ); remainder = name.substr( i + 1 , len - 1 ); return; } //---------------------------------------------------------------------------- // m_do_pre_abort // //! Implementation defined //---------------------------------------------------------------------------- void uvm_component::m_do_pre_abort() { for( m_children_mapcItT it = m_children.begin(); it != m_children.end(); it++ ) (*it).second->m_do_pre_abort(); pre_abort(); } } // namespace uvm
36.602213
166
0.513605
[ "object", "vector" ]
97d7ea85d4ab0f5193e2055071487aab706d12b9
607
cpp
C++
week5_dynamic_programming1/1_money_change_again/change_dp.cpp
michaelehab/Algorithmic-Toolbox-San-Diego
550ba930482b2e59021dae36053c548cd029b8ae
[ "MIT" ]
2
2022-02-23T02:43:38.000Z
2022-02-23T21:39:39.000Z
week5_dynamic_programming1/1_money_change_again/change_dp.cpp
michaelehab/Algorithmic-Toolbox-San-Diego
550ba930482b2e59021dae36053c548cd029b8ae
[ "MIT" ]
null
null
null
week5_dynamic_programming1/1_money_change_again/change_dp.cpp
michaelehab/Algorithmic-Toolbox-San-Diego
550ba930482b2e59021dae36053c548cd029b8ae
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <climits> #include <algorithm> using namespace std; // The possible coins are 1, 3, 4 int coins[3] = {1, 3, 4}; int get_change(int m) { vector<int> total(m + 1, INT_MAX); total[0] = 0; for(int i = 1; i <= m; i++){ for(int c = 0; c < 3; c++){ if(i >= coins[c]){ int prev = total[i - coins[c]]; // Check if the number can be obtained by adding this coin value to a previous number if(prev != INT_MAX) total[i] = min(total[i], prev + 1); } } } return total[m]; } int main() { int m; cin >> m; cout << get_change(m) << '\n'; }
19.580645
89
0.574959
[ "vector" ]
97eac7300316b1ae11e983cd683d784b5b1367c6
1,109
hpp
C++
third_party/boost/simd/function/cosd.hpp
SylvainCorlay/pythran
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
[ "BSD-3-Clause" ]
6
2018-02-25T22:23:33.000Z
2021-01-15T15:13:12.000Z
third_party/boost/simd/function/cosd.hpp
SylvainCorlay/pythran
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
[ "BSD-3-Clause" ]
null
null
null
third_party/boost/simd/function/cosd.hpp
SylvainCorlay/pythran
908ec070d837baf77d828d01c3e35e2f4bfa2bfa
[ "BSD-3-Clause" ]
7
2017-12-12T12:36:31.000Z
2020-02-10T14:27:07.000Z
//================================================================================================== /*! @file @copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //================================================================================================== #ifndef BOOST_SIMD_FUNCTION_COSD_HPP_INCLUDED #define BOOST_SIMD_FUNCTION_COSD_HPP_INCLUDED #if defined(DOXYGEN_ONLY) namespace boost { namespace simd { /*! @ingroup group-trigonometric This function object returns the cosine of the input in degree: \f$\cos(\pi x/180)\f$. @par Header <boost/simd/function/cosd.hpp> @par Note - The semantics of the function are similar to @ref cos ones. @see sincosd, cos, cospi @par Example: @snippet cosd.cpp cosd @par Possible output: @snippet cosd.txt cosd **/ IEEEValue cosd(IEEEValue const& x); } } #endif #include <boost/simd/function/scalar/cosd.hpp> #include <boost/simd/function/simd/cosd.hpp> #endif
22.18
100
0.575293
[ "object" ]
97ebe91cf0393b5ca7b477280309841f8ec9172a
2,319
cpp
C++
tests/test_parser.cpp
newenclave/parserstuff
7bd799d3ec80eea23a713fc131e957b877c1b2ed
[ "MIT" ]
null
null
null
tests/test_parser.cpp
newenclave/parserstuff
7bd799d3ec80eea23a713fc131e957b877c1b2ed
[ "MIT" ]
null
null
null
tests/test_parser.cpp
newenclave/parserstuff
7bd799d3ec80eea23a713fc131e957b877c1b2ed
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include "erules/objects.h" #include "erules/parser.h" #include "erules/rule_lexem.h" #include "erules/rule_lexer.h" #include "erules/rule_parser.h" #include "erules/rules_basic_operations.h" using namespace erules; using namespace erules::objects; using namespace erules::filters; using mlexer = filters::lexer<char>; using lexem_type = typename mlexer::lexem_type; using mparser = rule_parser<lexem_type>; using operations_type = oprerations::transform; namespace test_parser { void run() { operations_type to_string; using string_obj = string<char>; namespace east = ast; auto make_string = [](std::string val) { return std::make_unique<string_obj>(std::move(val)); }; auto string_transform = [&to_string](auto obj) { return to_string.call<string_obj>(obj); }; to_string.set<east::ident<lexem_type>, string_obj>( [&](auto ident) { return make_string(ident->lexem().raw_value()); }); to_string.set<east::value<lexem_type>, string_obj>( [&](auto value) { return make_string(value->lexem().raw_value()); }); to_string.set<east::binary_operation<lexem_type>, string_obj>( [&](auto value) { auto left = string_transform(value->left().get()); auto right = string_transform(value->right().get()); return make_string('(' + left->value() + ' ' + value->lexem().raw_value() + ' ' + right->value() + ')'); }); to_string.set<east::prefix_operation<lexem_type>, string_obj>( [&](auto value) { auto left = string_transform(value->value().get()); return make_string('(' + value->lexem().raw_value() + ' ' + left->value() + ')'); }); std::string val = "a in 100..9000 and b in 0...1000 and true or false"; mlexer lex; lex.reset(val); auto tokens = lex.read_all(val); for (auto& t : tokens) { std::cout << t.raw_value() << "\n"; } mparser pars(std::move(tokens)); auto n = pars.parse(); auto nc = n->clone(); auto transform = to_string.get<string_obj>(n.get()); std::cout << string_transform(n.get())->value() << "\n"; std::cout << transform(n.get())->value() << "\n"; } }
33.608696
77
0.601121
[ "vector", "transform" ]
97ecb7d6b9ed511ec56a88887e54646e71390186
597,864
cpp
C++
hphp/parser/hphp.7.tab.cpp
MaxSem/hhvm
8e8544c324e0157404374cf313a237bfa70b35d4
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
hphp/parser/hphp.7.tab.cpp
MaxSem/hhvm
8e8544c324e0157404374cf313a237bfa70b35d4
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
hphp/parser/hphp.7.tab.cpp
MaxSem/hhvm
8e8544c324e0157404374cf313a237bfa70b35d4
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
// @generated /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ #define yyparse Compiler7parse #define yylex Compiler7lex #define yyerror Compiler7error #define yylval Compiler7lval #define yychar Compiler7char #define yydebug Compiler7debug #define yynerrs Compiler7nerrs #define yylloc Compiler7lloc /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 1 "hphp.y" // macros for bison #define YYSTYPE HPHP::HPHP_PARSER_NS::Token #define YYSTYPE_IS_TRIVIAL false #define YYLTYPE HPHP::Location #define YYLTYPE_IS_TRIVIAL true #define YYERROR_VERBOSE #define YYINITDEPTH 500 #define YYLEX_PARAM _p #include "hphp/compiler/parser/parser.h" #include <folly/Conv.h> #include <folly/String.h> #include "hphp/util/logger.h" #define line0 r.line0 #define char0 r.char0 #define line1 r.line1 #define char1 r.char1 #ifdef yyerror #undef yyerror #endif #define yyerror(loc,p,msg) p->parseFatal(loc,msg) #ifdef YYLLOC_DEFAULT # undef YYLLOC_DEFAULT #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) { \ (Current).first(YYRHSLOC (Rhs, 1)); \ (Current).last (YYRHSLOC (Rhs, N)); \ } else { \ (Current).line0 = (Current).line1 = YYRHSLOC (Rhs, 0).line1;\ (Current).char0 = (Current).char1 = YYRHSLOC (Rhs, 0).char1;\ } \ while (0); \ _p->setRuleLocation(&Current); #define YYCOPY(To, From, Count) \ do { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) { \ (To)[yyi] = (From)[yyi]; \ } \ if (From != From ## a) { \ YYSTACK_FREE (From); \ } \ } \ while (0) #define YYCOPY_RESET(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) { \ (To)[yyi] = (From)[yyi]; \ (From)[yyi].reset(); \ } \ if (From != From ## a) { \ YYSTACK_FREE (From); \ } \ } \ while (0) #define YYTOKEN_RESET(From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) { \ (From)[yyi].reset(); \ } \ if (From != From ## a) { \ YYSTACK_FREE (From); \ } \ } \ while (0) # define YYSTACK_RELOCATE_RESET(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY_RESET (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #define YYSTACK_CLEANUP \ YYTOKEN_RESET (yyvs, yystacksize); \ if (yyvs != yyvsa) { \ YYSTACK_FREE (yyvs); \ } \ if (yyls != yylsa) { \ YYSTACK_FREE (yyls); \ } \ // macros for rules #define BEXP(...) _p->onBinaryOpExp(__VA_ARGS__); #define UEXP(...) _p->onUnaryOpExp(__VA_ARGS__); using namespace HPHP::HPHP_PARSER_NS; typedef HPHP::ClosureType ClosureType; /////////////////////////////////////////////////////////////////////////////// // helpers static void scalar_num(Parser *_p, Token &out, const char *num) { Token t; t.setText(num); _p->onScalar(out, T_LNUMBER, t); } static void scalar_num(Parser *_p, Token &out, int num) { Token t; t.setText(folly::to<std::string>(num)); _p->onScalar(out, T_LNUMBER, t); } static void scalar_null(Parser *_p, Token &out) { Token tnull; tnull.setText("null"); _p->onConstantValue(out, tnull); } static void scalar_file(Parser *_p, Token &out) { Token file; file.setText("__FILE__"); _p->onScalar(out, T_FILE, file); } static void scalar_line(Parser *_p, Token &out) { Token line; line.setText("__LINE__"); _p->onScalar(out, T_LINE, line); } /////////////////////////////////////////////////////////////////////////////// static void constant_ae(Parser *_p, Token &out, Token &value) { const std::string& valueStr = value.text(); if (valueStr.size() < 3 || valueStr.size() > 5 || (strcasecmp("true", valueStr.c_str()) != 0 && strcasecmp("false", valueStr.c_str()) != 0 && strcasecmp("null", valueStr.c_str()) != 0 && strcasecmp("inf", valueStr.c_str()) != 0 && strcasecmp("nan", valueStr.c_str()) != 0)) { HPHP_PARSER_ERROR("User-defined constants are not allowed in user " "attribute expressions", _p); } _p->onConstantValue(out, value); } /////////////////////////////////////////////////////////////////////////////// /** * XHP functions: They are defined here, so different parsers don't have to * handle XHP rules at all. */ static void xhp_tag(Parser *_p, Token &out, Token &label, Token &body) { if (!body.text().empty() && body.text() != label.text()) { HPHP_PARSER_ERROR("XHP: mismatched tag: '%s' not the same as '%s'", _p, body.text().c_str(), label.text().c_str()); } label.xhpLabel(); Token name; _p->onName(name, label, Parser::StringName); _p->onNewObject(out, name, body); } static void xhp_attribute(Parser *_p, Token &out, Token &type, Token &label, Token &def, Token &req) { /** * The bool, int, float, and string typenames are not given any special * treatment by the parser and are treated the same as regular class names * (which initially gets marked as type code 5). However, XHP wants to use * different type codes for bool, int, float, and string, so we need to fix * up the type code here to make XHP happy. */ if (type.num() == 5) { auto* str = type.text().c_str(); if (_p->scanner().isHHSyntaxEnabled()) { switch (type.text().size()) { case 6: if (!strcasecmp(str, "HH\\int")) { type.reset(); type.setNum(3); } break; case 7: if (!strcasecmp(str, "HH\\bool")) { type.reset(); type.setNum(2); } break; case 8: if (!strcasecmp(str, "HH\\float")) { type.reset(); type.setNum(8); } else if (!strcasecmp(str, "HH\\mixed")) { type.reset(); type.setNum(6); } break; case 9: if (!strcasecmp(str, "HH\\string")) { type.reset(); type.setNum(1); } break; default: break; } } else { switch (type.text().size()) { case 3: if (!strcasecmp(str, "int")) { type.reset(); type.setNum(3); } break; case 4: if (!strcasecmp(str, "bool")) { type.reset(); type.setNum(2); } else if (!strcasecmp(str, "real")) { type.reset(); type.setNum(8); } break; case 5: if (!strcasecmp(str, "float")) { type.reset(); type.setNum(8); } else if (!strcasecmp(str, "mixed")) { type.reset(); type.setNum(6); } break; case 6: if (!strcasecmp(str, "string")) { type.reset(); type.setNum(1); } else if (!strcasecmp(str, "double")) { type.reset(); type.setNum(8); } break; case 7: if (!strcasecmp(str, "integer")) { type.reset(); type.setNum(3); } else if (!strcasecmp(str, "boolean")) { type.reset(); type.setNum(2); } break; default: break; } } } Token num; scalar_num(_p, num, type.num()); Token arr1; _p->onArrayPair(arr1, 0, 0, num, 0); Token arr2; switch (type.num()) { case 5: /* class */ { Token cls; _p->onScalar(cls, T_CONSTANT_ENCAPSED_STRING, type); _p->onArrayPair(arr2, &arr1, 0, cls, 0); break; } case 7: /* enum */ { Token arr; _p->onArray(arr, type); _p->onArrayPair(arr2, &arr1, 0, arr, 0); break; } default: { Token tnull; scalar_null(_p, tnull); _p->onArrayPair(arr2, &arr1, 0, tnull, 0); break; } } Token arr3; _p->onArrayPair(arr3, &arr2, 0, def, 0); Token arr4; _p->onArrayPair(arr4, &arr3, 0, req, 0); _p->onArray(out, arr4); out.setText(label); } static void xhp_attribute_list(Parser *_p, Token &out, Token *list, Token &decl) { if (decl.num() == 0) { decl.xhpLabel(); if (list) { out = *list; out.setText(list->text() + ":" + decl.text()); // avoiding vector<string> } else { out.setText(decl); } } else { Token name; _p->onScalar(name, T_CONSTANT_ENCAPSED_STRING, decl); _p->onArrayPair(out, list, &name, decl, 0); if (list) { out.setText(list->text()); } else { out.setText(""); } } } static void xhp_attribute_stmt(Parser *_p, Token &out, Token &attributes) { Token modifiers; Token fname; fname.setText("__xhpAttributeDeclaration"); { Token m; Token m1; m1.setNum(T_PROTECTED); _p->onMemberModifier(m, NULL, m1); Token m2; m2.setNum(T_STATIC); _p->onMemberModifier(modifiers, &m, m2); } _p->pushFuncLocation(); _p->onMethodStart(fname, modifiers); std::vector<std::string> classes; folly::split(':', attributes.text(), classes, true); Token arrAttributes; _p->onArray(arrAttributes, attributes); Token dummy; Token stmts0; { _p->onStatementListStart(stmts0); } Token stmts1; { // static $_ = -1; Token one; scalar_num(_p, one, "1"); Token mone; UEXP(mone, one, '-', 1); Token var; var.set(T_VARIABLE, "_"); Token decl; _p->onStaticVariable(decl, 0, var, &mone); Token sdecl; _p->onStatic(sdecl, decl); _p->addStatement(stmts1, stmts0, sdecl); } Token stmts2; { // if ($_ === -1) { // $_ = array_merge(parent::__xhpAttributeDeclaration(), // attributes); // } Token parent; parent.set(T_STRING, "parent"); Token cls; _p->onName(cls, parent, Parser::StringName); Token fname; fname.setText("__xhpAttributeDeclaration"); Token param1; _p->onCall(param1, 0, fname, dummy, &cls); Token params1; _p->onCallParam(params1, NULL, param1, false, false); for (unsigned int i = 0; i < classes.size(); i++) { Token parent; parent.set(T_STRING, classes[i]); Token cls; _p->onName(cls, parent, Parser::StringName); Token fname; fname.setText("__xhpAttributeDeclaration"); Token param; _p->onCall(param, 0, fname, dummy, &cls); Token params; _p->onCallParam(params, &params1, param, false, false); params1 = params; } Token params2; _p->onCallParam(params2, &params1, arrAttributes, false, false); Token name; name.set(T_STRING, "array_merge"); Token call; _p->onCall(call, 0, name, params2, NULL); Token tvar; tvar.set(T_VARIABLE, "_"); Token var; _p->onSimpleVariable(var, tvar); Token assign; _p->onAssign(assign, var, call, 0); Token exp; _p->onExpStatement(exp, assign); Token block; _p->onBlock(block, exp); Token tvar2; tvar2.set(T_VARIABLE, "_"); Token var2; _p->onSimpleVariable(var2, tvar2); Token one; scalar_num(_p, one, "1"); Token mone; UEXP(mone, one, '-', 1); Token cond; BEXP(cond, var2, mone, T_IS_IDENTICAL); Token dummy1, dummy2; Token sif; _p->onIf(sif, cond, block, dummy1, dummy2); _p->addStatement(stmts2, stmts1, sif); } Token stmts3; { // return $_; Token tvar; tvar.set(T_VARIABLE, "_"); Token var; _p->onSimpleVariable(var, tvar); Token ret; _p->onReturn(ret, &var); _p->addStatement(stmts3, stmts2, ret); } Token stmt; { _p->finishStatement(stmt, stmts3); stmt = 1; } { Token params, ret, ref; ref = 0; _p->onMethod(out, modifiers, ret, ref, fname, params, stmt, nullptr, false); } } static void xhp_collect_attributes(Parser *_p, Token &out, Token &stmts) { Token *attr = _p->xhpGetAttributes(); if (attr) { Token stmt; xhp_attribute_stmt(_p, stmt, *attr); _p->onClassStatement(out, stmts, stmt); } else { out = stmts; } } static void xhp_category_stmt(Parser *_p, Token &out, Token &categories) { Token fname; fname.setText("__xhpCategoryDeclaration"); Token m1; m1.setNum(T_PROTECTED); Token modifiers; _p->onMemberModifier(modifiers, 0, m1); _p->pushFuncLocation(); _p->onMethodStart(fname, modifiers); Token stmts0; { _p->onStatementListStart(stmts0); } Token stmts1; { // static $_ = categories; Token arr; _p->onArray(arr, categories); Token var; var.set(T_VARIABLE, "_"); Token decl; _p->onStaticVariable(decl, 0, var, &arr); Token sdecl; _p->onStatic(sdecl, decl); _p->addStatement(stmts1, stmts0, sdecl); } Token stmts2; { // return $_; Token tvar; tvar.set(T_VARIABLE, "_"); Token var; _p->onSimpleVariable(var, tvar); Token ret; _p->onReturn(ret, &var); _p->addStatement(stmts2, stmts1, ret); } Token stmt; { _p->finishStatement(stmt, stmts2); stmt = 1; } { Token params, ret, ref; ref = 0; _p->onMethod(out, modifiers, ret, ref, fname, params, stmt, nullptr, false); } } static void xhp_children_decl_tag(Parser *_p, Token &arr, Token &tag) { Token num; scalar_num(_p, num, tag.num()); Token arr1; _p->onArrayPair(arr1, &arr, 0, num, 0); Token name; if (tag.num() == 3 || tag.num() == 4) { _p->onScalar(name, T_CONSTANT_ENCAPSED_STRING, tag); } else if (tag.num() >= 0) { scalar_null(_p, name); } else { HPHP_PARSER_ERROR("XHP: unknown children declaration", _p); } Token arr2; _p->onArrayPair(arr2, &arr1, 0, name, 0); arr = arr2; } static void xhp_children_decl(Parser *_p, Token &out, Token &op1, int op, Token *op2) { Token num; scalar_num(_p, num, op); Token arr; _p->onArrayPair(arr, 0, 0, num, 0); if (op2) { Token arr1; _p->onArrayPair(arr1, &arr, 0, op1, 0); Token arr2; _p->onArrayPair(arr2, &arr1, 0, *op2, 0); _p->onArray(out, arr2); } else { xhp_children_decl_tag(_p, arr, op1); _p->onArray(out, arr); } } static void xhp_children_paren(Parser *_p, Token &out, Token exp, int op) { Token num; scalar_num(_p, num, op); Token arr1; _p->onArrayPair(arr1, 0, 0, num, 0); Token num5; scalar_num(_p, num5, 5); Token arr2; _p->onArrayPair(arr2, &arr1, 0, num5, 0); Token arr3; _p->onArrayPair(arr3, &arr2, 0, exp, 0); _p->onArray(out, arr3); } static void xhp_children_stmt(Parser *_p, Token &out, Token &children) { Token fname; fname.setText("__xhpChildrenDeclaration"); Token m1; m1.setNum(T_PROTECTED); Token modifiers; _p->onMemberModifier(modifiers, 0, m1); _p->pushFuncLocation(); _p->onMethodStart(fname, modifiers); Token stmts0; { _p->onStatementListStart(stmts0); } Token stmts1; { // static $_ = children; Token arr; if (children.num() == 2) { arr = children; } else if (children.num() >= 0) { scalar_num(_p, arr, children.num()); } else { HPHP_PARSER_ERROR("XHP: XHP unknown children declaration", _p); } Token var; var.set(T_VARIABLE, "_"); Token decl; _p->onStaticVariable(decl, 0, var, &arr); Token sdecl; _p->onStatic(sdecl, decl); _p->addStatement(stmts1, stmts0, sdecl); } Token stmts2; { // return $_; Token tvar; tvar.set(T_VARIABLE, "_"); Token var; _p->onSimpleVariable(var, tvar); Token ret; _p->onReturn(ret, &var); _p->addStatement(stmts2, stmts1, ret); } Token stmt; { _p->finishStatement(stmt, stmts2); stmt = 1; } { Token params, ret, ref; ref = 0; _p->onMethod(out, modifiers, ret, ref, fname, params, stmt, nullptr, false); } } static void only_in_hh_syntax(Parser *_p) { if (!_p->scanner().isHHSyntaxEnabled()) { HPHP_PARSER_ERROR( "Syntax only allowed in Hack files (<?hh) or with -v " "Eval.EnableHipHopSyntax=true", _p); } } static void validate_hh_variadic_variant(Parser* _p, Token& userAttrs, Token& typehint, Token* mod) { if (!userAttrs.text().empty() || !typehint.text().empty() || (mod && !mod->text().empty())) { HPHP_PARSER_ERROR("Variadic '...' should be followed by a '$variable'", _p); } only_in_hh_syntax(_p); } // Shapes may not have leading integers in key names, considered as a // parse time error. This is because at runtime they are currently // hphp arrays, which will treat leading integer keys as numbers. static void validate_shape_keyname(Token& tok, Parser* _p) { if (tok.text().empty()) { HPHP_PARSER_ERROR("Shape key names may not be empty", _p); } if (isdigit(tok.text()[0])) { HPHP_PARSER_ERROR("Shape key names may not start with integers", _p); } } /////////////////////////////////////////////////////////////////////////////// static int yylex(YYSTYPE* token, HPHP::Location* loc, Parser* _p) { return _p->scan(token, loc); } /* Line 189 of yacc.c */ #line 653 "hphp.7.tab.cpp" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { T_REQUIRE_ONCE = 258, T_REQUIRE = 259, T_EVAL = 260, T_INCLUDE_ONCE = 261, T_INCLUDE = 262, T_LAMBDA_ARROW = 263, T_LOGICAL_OR = 264, T_LOGICAL_XOR = 265, T_LOGICAL_AND = 266, T_PRINT = 267, T_POW_EQUAL = 268, T_SR_EQUAL = 269, T_SL_EQUAL = 270, T_XOR_EQUAL = 271, T_OR_EQUAL = 272, T_AND_EQUAL = 273, T_MOD_EQUAL = 274, T_CONCAT_EQUAL = 275, T_DIV_EQUAL = 276, T_MUL_EQUAL = 277, T_MINUS_EQUAL = 278, T_PLUS_EQUAL = 279, T_YIELD = 280, T_AWAIT = 281, T_YIELD_FROM = 282, T_PIPE = 283, T_COALESCE = 284, T_BOOLEAN_OR = 285, T_BOOLEAN_AND = 286, T_IS_NOT_IDENTICAL = 287, T_IS_IDENTICAL = 288, T_IS_NOT_EQUAL = 289, T_IS_EQUAL = 290, T_SPACESHIP = 291, T_IS_GREATER_OR_EQUAL = 292, T_IS_SMALLER_OR_EQUAL = 293, T_SR = 294, T_SL = 295, T_INSTANCEOF = 296, T_UNSET_CAST = 297, T_BOOL_CAST = 298, T_OBJECT_CAST = 299, T_ARRAY_CAST = 300, T_STRING_CAST = 301, T_DOUBLE_CAST = 302, T_INT_CAST = 303, T_DEC = 304, T_INC = 305, T_POW = 306, T_CLONE = 307, T_NEW = 308, T_EXIT = 309, T_IF = 310, T_ELSEIF = 311, T_ELSE = 312, T_ENDIF = 313, T_LNUMBER = 314, T_DNUMBER = 315, T_ONUMBER = 316, T_STRING = 317, T_STRING_VARNAME = 318, T_VARIABLE = 319, T_PIPE_VAR = 320, T_NUM_STRING = 321, T_INLINE_HTML = 322, T_HASHBANG = 323, T_CHARACTER = 324, T_BAD_CHARACTER = 325, T_ENCAPSED_AND_WHITESPACE = 326, T_CONSTANT_ENCAPSED_STRING = 327, T_ECHO = 328, T_DO = 329, T_WHILE = 330, T_ENDWHILE = 331, T_FOR = 332, T_ENDFOR = 333, T_FOREACH = 334, T_ENDFOREACH = 335, T_DECLARE = 336, T_ENDDECLARE = 337, T_AS = 338, T_SUPER = 339, T_SWITCH = 340, T_ENDSWITCH = 341, T_CASE = 342, T_DEFAULT = 343, T_BREAK = 344, T_GOTO = 345, T_CONTINUE = 346, T_FUNCTION = 347, T_CONST = 348, T_RETURN = 349, T_TRY = 350, T_CATCH = 351, T_THROW = 352, T_USE = 353, T_GLOBAL = 354, T_PUBLIC = 355, T_PROTECTED = 356, T_PRIVATE = 357, T_FINAL = 358, T_ABSTRACT = 359, T_STATIC = 360, T_VAR = 361, T_UNSET = 362, T_ISSET = 363, T_EMPTY = 364, T_HALT_COMPILER = 365, T_CLASS = 366, T_INTERFACE = 367, T_EXTENDS = 368, T_IMPLEMENTS = 369, T_OBJECT_OPERATOR = 370, T_NULLSAFE_OBJECT_OPERATOR = 371, T_DOUBLE_ARROW = 372, T_LIST = 373, T_ARRAY = 374, T_DICT = 375, T_VEC = 376, T_KEYSET = 377, T_CALLABLE = 378, T_CLASS_C = 379, T_METHOD_C = 380, T_FUNC_C = 381, T_LINE = 382, T_FILE = 383, T_COMMENT = 384, T_DOC_COMMENT = 385, T_OPEN_TAG = 386, T_OPEN_TAG_WITH_ECHO = 387, T_CLOSE_TAG = 388, T_WHITESPACE = 389, T_START_HEREDOC = 390, T_END_HEREDOC = 391, T_DOLLAR_OPEN_CURLY_BRACES = 392, T_CURLY_OPEN = 393, T_DOUBLE_COLON = 394, T_NAMESPACE = 395, T_NS_C = 396, T_DIR = 397, T_NS_SEPARATOR = 398, T_XHP_LABEL = 399, T_XHP_TEXT = 400, T_XHP_ATTRIBUTE = 401, T_XHP_CATEGORY = 402, T_XHP_CATEGORY_LABEL = 403, T_XHP_CHILDREN = 404, T_ENUM = 405, T_XHP_REQUIRED = 406, T_TRAIT = 407, T_ELLIPSIS = 408, T_INSTEADOF = 409, T_TRAIT_C = 410, T_HH_ERROR = 411, T_FINALLY = 412, T_XHP_TAG_LT = 413, T_XHP_TAG_GT = 414, T_TYPELIST_LT = 415, T_TYPELIST_GT = 416, T_UNRESOLVED_LT = 417, T_COLLECTION = 418, T_SHAPE = 419, T_TYPE = 420, T_UNRESOLVED_TYPE = 421, T_NEWTYPE = 422, T_UNRESOLVED_NEWTYPE = 423, T_COMPILER_HALT_OFFSET = 424, T_ASYNC = 425, T_LAMBDA_OP = 426, T_LAMBDA_CP = 427, T_UNRESOLVED_OP = 428 }; #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int line0; int char0; int line1; int char1; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 881 "hphp.7.tab.cpp" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ struct yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (struct yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 18047 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 203 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 291 /* YYNRULES -- Number of rules. */ #define YYNRULES 1047 /* YYNRULES -- Number of states. */ #define YYNSTATES 1924 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 428 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 56, 201, 2, 198, 55, 38, 202, 193, 194, 53, 50, 9, 51, 52, 54, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 32, 195, 43, 14, 44, 31, 59, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 70, 2, 200, 37, 2, 199, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 196, 36, 197, 58, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 39, 40, 41, 42, 45, 46, 47, 48, 49, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 4, 7, 10, 11, 13, 15, 17, 19, 21, 23, 28, 32, 33, 40, 41, 47, 51, 56, 61, 68, 76, 84, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 240, 244, 248, 250, 253, 255, 258, 262, 267, 271, 273, 276, 278, 281, 284, 286, 290, 292, 296, 299, 302, 305, 311, 316, 319, 320, 322, 324, 326, 328, 332, 338, 347, 348, 353, 354, 361, 362, 373, 374, 379, 382, 386, 389, 393, 396, 400, 404, 408, 412, 416, 420, 426, 428, 430, 432, 433, 443, 444, 455, 461, 462, 476, 477, 483, 487, 491, 494, 497, 500, 503, 506, 509, 513, 516, 519, 523, 526, 529, 530, 535, 545, 546, 547, 552, 555, 556, 558, 559, 561, 562, 572, 573, 584, 585, 597, 598, 608, 609, 620, 621, 630, 631, 641, 642, 650, 651, 660, 661, 670, 671, 679, 680, 689, 691, 693, 695, 697, 699, 702, 706, 710, 713, 716, 717, 720, 721, 724, 725, 727, 731, 733, 737, 740, 741, 743, 746, 751, 753, 758, 760, 765, 767, 772, 774, 779, 783, 789, 793, 798, 803, 809, 815, 820, 821, 823, 825, 830, 831, 837, 838, 841, 842, 846, 847, 855, 864, 871, 874, 880, 887, 892, 893, 898, 904, 912, 919, 926, 934, 944, 953, 960, 968, 974, 977, 982, 988, 992, 993, 997, 1002, 1009, 1015, 1021, 1028, 1037, 1045, 1048, 1049, 1051, 1054, 1057, 1061, 1066, 1071, 1075, 1077, 1079, 1082, 1087, 1091, 1097, 1099, 1103, 1106, 1107, 1110, 1114, 1117, 1118, 1119, 1124, 1125, 1131, 1134, 1137, 1140, 1141, 1152, 1153, 1165, 1169, 1173, 1177, 1182, 1187, 1191, 1197, 1200, 1203, 1204, 1211, 1217, 1222, 1226, 1228, 1230, 1234, 1239, 1241, 1244, 1246, 1248, 1254, 1261, 1263, 1265, 1270, 1272, 1274, 1278, 1281, 1284, 1285, 1288, 1289, 1291, 1295, 1297, 1299, 1301, 1303, 1307, 1312, 1317, 1322, 1324, 1326, 1329, 1332, 1335, 1339, 1343, 1345, 1347, 1349, 1351, 1355, 1357, 1361, 1363, 1365, 1367, 1368, 1370, 1373, 1375, 1377, 1379, 1381, 1383, 1385, 1387, 1389, 1390, 1392, 1394, 1396, 1400, 1406, 1408, 1412, 1418, 1423, 1427, 1431, 1435, 1440, 1444, 1448, 1452, 1455, 1458, 1460, 1462, 1466, 1470, 1472, 1474, 1475, 1477, 1480, 1485, 1489, 1493, 1500, 1503, 1507, 1510, 1514, 1521, 1523, 1525, 1527, 1529, 1531, 1538, 1542, 1547, 1554, 1558, 1562, 1566, 1570, 1574, 1578, 1582, 1586, 1590, 1594, 1598, 1602, 1605, 1608, 1611, 1614, 1618, 1622, 1626, 1630, 1634, 1638, 1642, 1646, 1650, 1654, 1658, 1662, 1666, 1670, 1674, 1678, 1682, 1686, 1689, 1692, 1695, 1698, 1702, 1706, 1710, 1714, 1718, 1722, 1726, 1730, 1734, 1738, 1742, 1748, 1753, 1757, 1759, 1762, 1765, 1768, 1771, 1774, 1777, 1780, 1783, 1786, 1788, 1790, 1792, 1794, 1796, 1798, 1802, 1805, 1807, 1813, 1814, 1815, 1828, 1829, 1843, 1844, 1849, 1850, 1858, 1859, 1865, 1866, 1870, 1871, 1878, 1881, 1884, 1889, 1891, 1893, 1899, 1903, 1909, 1913, 1916, 1917, 1920, 1921, 1926, 1931, 1935, 1938, 1939, 1945, 1949, 1956, 1961, 1964, 1965, 1971, 1975, 1978, 1979, 1985, 1989, 1994, 1999, 2004, 2009, 2014, 2019, 2024, 2029, 2034, 2037, 2038, 2041, 2042, 2045, 2046, 2051, 2056, 2061, 2066, 2068, 2070, 2072, 2074, 2076, 2078, 2080, 2084, 2086, 2090, 2095, 2097, 2100, 2105, 2108, 2115, 2116, 2118, 2123, 2124, 2127, 2128, 2130, 2132, 2136, 2138, 2142, 2144, 2146, 2150, 2154, 2156, 2158, 2160, 2162, 2164, 2166, 2168, 2170, 2172, 2174, 2176, 2178, 2180, 2182, 2184, 2186, 2188, 2190, 2192, 2194, 2196, 2198, 2200, 2202, 2204, 2206, 2208, 2210, 2212, 2214, 2216, 2218, 2220, 2222, 2224, 2226, 2228, 2230, 2232, 2234, 2236, 2238, 2240, 2242, 2244, 2246, 2248, 2250, 2252, 2254, 2256, 2258, 2260, 2262, 2264, 2266, 2268, 2270, 2272, 2274, 2276, 2278, 2280, 2282, 2284, 2286, 2288, 2290, 2292, 2294, 2296, 2298, 2300, 2302, 2304, 2306, 2308, 2310, 2312, 2314, 2316, 2321, 2323, 2325, 2327, 2329, 2331, 2333, 2337, 2339, 2343, 2345, 2347, 2351, 2353, 2355, 2357, 2360, 2362, 2363, 2364, 2366, 2368, 2372, 2373, 2375, 2377, 2379, 2381, 2383, 2385, 2387, 2389, 2391, 2393, 2395, 2397, 2399, 2403, 2406, 2408, 2410, 2415, 2419, 2424, 2426, 2428, 2430, 2432, 2434, 2438, 2442, 2446, 2450, 2454, 2458, 2462, 2466, 2470, 2474, 2478, 2482, 2486, 2490, 2494, 2498, 2502, 2506, 2509, 2512, 2515, 2518, 2522, 2526, 2530, 2534, 2538, 2542, 2546, 2550, 2554, 2560, 2565, 2569, 2571, 2575, 2579, 2583, 2587, 2589, 2591, 2593, 2595, 2599, 2603, 2607, 2610, 2611, 2613, 2614, 2616, 2617, 2623, 2627, 2631, 2633, 2635, 2637, 2639, 2643, 2646, 2648, 2650, 2652, 2654, 2656, 2660, 2662, 2664, 2666, 2669, 2672, 2677, 2681, 2686, 2688, 2690, 2692, 2696, 2698, 2701, 2702, 2708, 2712, 2716, 2718, 2722, 2724, 2727, 2728, 2734, 2738, 2741, 2742, 2746, 2747, 2752, 2755, 2756, 2760, 2764, 2766, 2767, 2769, 2771, 2773, 2775, 2779, 2781, 2783, 2785, 2789, 2791, 2793, 2797, 2801, 2804, 2809, 2812, 2817, 2823, 2829, 2835, 2841, 2843, 2845, 2847, 2849, 2851, 2853, 2857, 2861, 2866, 2871, 2875, 2877, 2879, 2881, 2883, 2887, 2889, 2894, 2898, 2902, 2904, 2906, 2908, 2910, 2912, 2916, 2920, 2925, 2930, 2934, 2936, 2938, 2946, 2956, 2964, 2971, 2980, 2982, 2987, 2992, 2994, 2996, 2998, 3003, 3006, 3008, 3009, 3011, 3013, 3015, 3019, 3023, 3027, 3028, 3030, 3032, 3036, 3040, 3043, 3047, 3054, 3055, 3057, 3062, 3065, 3066, 3072, 3076, 3080, 3082, 3089, 3094, 3099, 3102, 3105, 3106, 3112, 3116, 3120, 3122, 3125, 3126, 3132, 3136, 3140, 3142, 3145, 3148, 3150, 3153, 3155, 3160, 3164, 3168, 3175, 3179, 3181, 3183, 3185, 3190, 3195, 3200, 3205, 3210, 3215, 3218, 3221, 3226, 3229, 3232, 3234, 3238, 3242, 3246, 3247, 3250, 3256, 3263, 3270, 3278, 3280, 3283, 3285, 3288, 3290, 3295, 3297, 3302, 3306, 3307, 3309, 3313, 3316, 3320, 3322, 3324, 3325, 3326, 3329, 3332, 3335, 3338, 3340, 3343, 3348, 3351, 3357, 3361, 3363, 3365, 3366, 3370, 3375, 3381, 3385, 3387, 3390, 3391, 3396, 3398, 3402, 3405, 3410, 3416, 3419, 3422, 3424, 3426, 3428, 3430, 3434, 3437, 3439, 3448, 3455, 3457 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { 204, 0, -1, -1, 205, 206, -1, 206, 207, -1, -1, 227, -1, 244, -1, 251, -1, 248, -1, 258, -1, 470, -1, 129, 193, 194, 195, -1, 159, 220, 195, -1, -1, 159, 220, 196, 208, 206, 197, -1, -1, 159, 196, 209, 206, 197, -1, 117, 215, 195, -1, 117, 111, 215, 195, -1, 117, 112, 215, 195, -1, 117, 213, 196, 218, 197, 195, -1, 117, 111, 213, 196, 215, 197, 195, -1, 117, 112, 213, 196, 215, 197, 195, -1, 224, 195, -1, 81, -1, 103, -1, 165, -1, 166, -1, 168, -1, 170, -1, 169, -1, 139, -1, 140, -1, 141, -1, 210, -1, 142, -1, 171, -1, 132, -1, 133, -1, 124, -1, 123, -1, 122, -1, 121, -1, 120, -1, 119, -1, 112, -1, 101, -1, 97, -1, 99, -1, 77, -1, 95, -1, 12, -1, 118, -1, 109, -1, 57, -1, 173, -1, 131, -1, 159, -1, 72, -1, 10, -1, 11, -1, 114, -1, 117, -1, 125, -1, 73, -1, 137, -1, 71, -1, 7, -1, 6, -1, 116, -1, 138, -1, 13, -1, 92, -1, 4, -1, 3, -1, 113, -1, 76, -1, 75, -1, 107, -1, 108, -1, 110, -1, 104, -1, 27, -1, 29, -1, 111, -1, 74, -1, 105, -1, 176, -1, 96, -1, 98, -1, 100, -1, 106, -1, 93, -1, 94, -1, 102, -1, 115, -1, 126, -1, 211, -1, 130, -1, 220, 162, -1, 162, 220, 162, -1, 214, 9, 216, -1, 216, -1, 214, 414, -1, 220, -1, 162, 220, -1, 220, 102, 210, -1, 162, 220, 102, 210, -1, 217, 9, 219, -1, 219, -1, 217, 414, -1, 216, -1, 111, 216, -1, 112, 216, -1, 210, -1, 220, 162, 210, -1, 220, -1, 159, 162, 220, -1, 162, 220, -1, 221, 475, -1, 221, 475, -1, 224, 9, 471, 14, 408, -1, 112, 471, 14, 408, -1, 225, 226, -1, -1, 227, -1, 244, -1, 251, -1, 258, -1, 196, 225, 197, -1, 74, 334, 227, 280, 282, -1, 74, 334, 32, 225, 281, 283, 77, 195, -1, -1, 94, 334, 228, 274, -1, -1, 93, 229, 227, 94, 334, 195, -1, -1, 96, 193, 336, 195, 336, 195, 336, 194, 230, 272, -1, -1, 104, 334, 231, 277, -1, 108, 195, -1, 108, 345, 195, -1, 110, 195, -1, 110, 345, 195, -1, 113, 195, -1, 113, 345, 195, -1, 27, 108, 195, -1, 118, 290, 195, -1, 124, 292, 195, -1, 92, 335, 195, -1, 151, 335, 195, -1, 126, 193, 467, 194, 195, -1, 195, -1, 86, -1, 87, -1, -1, 98, 193, 345, 102, 271, 270, 194, 232, 273, -1, -1, 98, 193, 345, 28, 102, 271, 270, 194, 233, 273, -1, 100, 193, 276, 194, 275, -1, -1, 114, 236, 115, 193, 399, 83, 194, 196, 225, 197, 238, 234, 241, -1, -1, 114, 236, 176, 235, 239, -1, 116, 345, 195, -1, 109, 210, 195, -1, 345, 195, -1, 337, 195, -1, 338, 195, -1, 339, 195, -1, 340, 195, -1, 341, 195, -1, 113, 340, 195, -1, 342, 195, -1, 343, 195, -1, 113, 342, 195, -1, 344, 195, -1, 210, 32, -1, -1, 196, 237, 225, 197, -1, 238, 115, 193, 399, 83, 194, 196, 225, 197, -1, -1, -1, 196, 240, 225, 197, -1, 176, 239, -1, -1, 38, -1, -1, 111, -1, -1, 243, 242, 474, 245, 193, 286, 194, 479, 320, -1, -1, 324, 243, 242, 474, 246, 193, 286, 194, 479, 320, -1, -1, 431, 323, 243, 242, 474, 247, 193, 286, 194, 479, 320, -1, -1, 169, 210, 249, 32, 492, 469, 196, 293, 197, -1, -1, 431, 169, 210, 250, 32, 492, 469, 196, 293, 197, -1, -1, 264, 261, 252, 265, 266, 196, 296, 197, -1, -1, 431, 264, 261, 253, 265, 266, 196, 296, 197, -1, -1, 131, 262, 254, 267, 196, 296, 197, -1, -1, 431, 131, 262, 255, 267, 196, 296, 197, -1, -1, 130, 257, 406, 265, 266, 196, 296, 197, -1, -1, 171, 263, 259, 266, 196, 296, 197, -1, -1, 431, 171, 263, 260, 266, 196, 296, 197, -1, 474, -1, 163, -1, 474, -1, 474, -1, 130, -1, 123, 130, -1, 123, 122, 130, -1, 122, 123, 130, -1, 122, 130, -1, 132, 399, -1, -1, 133, 268, -1, -1, 132, 268, -1, -1, 399, -1, 268, 9, 399, -1, 399, -1, 269, 9, 399, -1, 136, 271, -1, -1, 443, -1, 38, 443, -1, 137, 193, 456, 194, -1, 227, -1, 32, 225, 97, 195, -1, 227, -1, 32, 225, 99, 195, -1, 227, -1, 32, 225, 95, 195, -1, 227, -1, 32, 225, 101, 195, -1, 210, 14, 408, -1, 276, 9, 210, 14, 408, -1, 196, 278, 197, -1, 196, 195, 278, 197, -1, 32, 278, 105, 195, -1, 32, 195, 278, 105, 195, -1, 278, 106, 345, 279, 225, -1, 278, 107, 279, 225, -1, -1, 32, -1, 195, -1, 280, 75, 334, 227, -1, -1, 281, 75, 334, 32, 225, -1, -1, 76, 227, -1, -1, 76, 32, 225, -1, -1, 285, 9, 432, 326, 493, 172, 83, -1, 285, 9, 432, 326, 493, 38, 172, 83, -1, 285, 9, 432, 326, 493, 172, -1, 285, 414, -1, 432, 326, 493, 172, 83, -1, 432, 326, 493, 38, 172, 83, -1, 432, 326, 493, 172, -1, -1, 432, 326, 493, 83, -1, 432, 326, 493, 38, 83, -1, 432, 326, 493, 38, 83, 14, 345, -1, 432, 326, 493, 83, 14, 345, -1, 285, 9, 432, 326, 493, 83, -1, 285, 9, 432, 326, 493, 38, 83, -1, 285, 9, 432, 326, 493, 38, 83, 14, 345, -1, 285, 9, 432, 326, 493, 83, 14, 345, -1, 287, 9, 432, 493, 172, 83, -1, 287, 9, 432, 493, 38, 172, 83, -1, 287, 9, 432, 493, 172, -1, 287, 414, -1, 432, 493, 172, 83, -1, 432, 493, 38, 172, 83, -1, 432, 493, 172, -1, -1, 432, 493, 83, -1, 432, 493, 38, 83, -1, 432, 493, 38, 83, 14, 345, -1, 432, 493, 83, 14, 345, -1, 287, 9, 432, 493, 83, -1, 287, 9, 432, 493, 38, 83, -1, 287, 9, 432, 493, 38, 83, 14, 345, -1, 287, 9, 432, 493, 83, 14, 345, -1, 289, 414, -1, -1, 345, -1, 38, 443, -1, 172, 345, -1, 289, 9, 345, -1, 289, 9, 172, 345, -1, 289, 9, 38, 443, -1, 290, 9, 291, -1, 291, -1, 83, -1, 198, 443, -1, 198, 196, 345, 197, -1, 292, 9, 83, -1, 292, 9, 83, 14, 408, -1, 83, -1, 83, 14, 408, -1, 293, 294, -1, -1, 295, 195, -1, 472, 14, 408, -1, 296, 297, -1, -1, -1, 322, 298, 328, 195, -1, -1, 324, 492, 299, 328, 195, -1, 329, 195, -1, 330, 195, -1, 331, 195, -1, -1, 323, 243, 242, 473, 193, 300, 284, 194, 479, 321, -1, -1, 431, 323, 243, 242, 474, 193, 301, 284, 194, 479, 321, -1, 165, 306, 195, -1, 166, 314, 195, -1, 168, 316, 195, -1, 4, 132, 399, 195, -1, 4, 133, 399, 195, -1, 117, 269, 195, -1, 117, 269, 196, 302, 197, -1, 302, 303, -1, 302, 304, -1, -1, 223, 158, 210, 173, 269, 195, -1, 305, 102, 323, 210, 195, -1, 305, 102, 324, 195, -1, 223, 158, 210, -1, 210, -1, 307, -1, 306, 9, 307, -1, 308, 396, 312, 313, -1, 163, -1, 31, 309, -1, 309, -1, 138, -1, 138, 179, 492, 413, 180, -1, 138, 179, 492, 9, 492, 180, -1, 399, -1, 125, -1, 169, 196, 311, 197, -1, 142, -1, 407, -1, 310, 9, 407, -1, 310, 413, -1, 14, 408, -1, -1, 59, 170, -1, -1, 315, -1, 314, 9, 315, -1, 167, -1, 317, -1, 210, -1, 128, -1, 193, 318, 194, -1, 193, 318, 194, 53, -1, 193, 318, 194, 31, -1, 193, 318, 194, 50, -1, 317, -1, 319, -1, 319, 53, -1, 319, 31, -1, 319, 50, -1, 318, 9, 318, -1, 318, 36, 318, -1, 210, -1, 163, -1, 167, -1, 195, -1, 196, 225, 197, -1, 195, -1, 196, 225, 197, -1, 324, -1, 125, -1, 324, -1, -1, 325, -1, 324, 325, -1, 119, -1, 120, -1, 121, -1, 124, -1, 123, -1, 122, -1, 189, -1, 327, -1, -1, 119, -1, 120, -1, 121, -1, 328, 9, 83, -1, 328, 9, 83, 14, 408, -1, 83, -1, 83, 14, 408, -1, 329, 9, 472, 14, 408, -1, 112, 472, 14, 408, -1, 330, 9, 472, -1, 123, 112, 472, -1, 123, 332, 469, -1, 332, 469, 14, 492, -1, 112, 184, 474, -1, 193, 333, 194, -1, 72, 403, 406, -1, 72, 256, -1, 71, 345, -1, 388, -1, 383, -1, 193, 345, 194, -1, 335, 9, 345, -1, 345, -1, 335, -1, -1, 27, -1, 27, 345, -1, 27, 345, 136, 345, -1, 193, 337, 194, -1, 443, 14, 337, -1, 137, 193, 456, 194, 14, 337, -1, 29, 345, -1, 443, 14, 340, -1, 28, 345, -1, 443, 14, 342, -1, 137, 193, 456, 194, 14, 342, -1, 346, -1, 443, -1, 333, -1, 447, -1, 446, -1, 137, 193, 456, 194, 14, 345, -1, 443, 14, 345, -1, 443, 14, 38, 443, -1, 443, 14, 38, 72, 403, 406, -1, 443, 26, 345, -1, 443, 25, 345, -1, 443, 24, 345, -1, 443, 23, 345, -1, 443, 22, 345, -1, 443, 21, 345, -1, 443, 20, 345, -1, 443, 19, 345, -1, 443, 18, 345, -1, 443, 17, 345, -1, 443, 16, 345, -1, 443, 15, 345, -1, 443, 68, -1, 68, 443, -1, 443, 67, -1, 67, 443, -1, 345, 34, 345, -1, 345, 35, 345, -1, 345, 10, 345, -1, 345, 12, 345, -1, 345, 11, 345, -1, 345, 36, 345, -1, 345, 38, 345, -1, 345, 37, 345, -1, 345, 52, 345, -1, 345, 50, 345, -1, 345, 51, 345, -1, 345, 53, 345, -1, 345, 54, 345, -1, 345, 69, 345, -1, 345, 55, 345, -1, 345, 30, 345, -1, 345, 49, 345, -1, 345, 48, 345, -1, 50, 345, -1, 51, 345, -1, 56, 345, -1, 58, 345, -1, 345, 40, 345, -1, 345, 39, 345, -1, 345, 42, 345, -1, 345, 41, 345, -1, 345, 43, 345, -1, 345, 47, 345, -1, 345, 44, 345, -1, 345, 46, 345, -1, 345, 45, 345, -1, 345, 57, 403, -1, 193, 346, 194, -1, 345, 31, 345, 32, 345, -1, 345, 31, 32, 345, -1, 345, 33, 345, -1, 466, -1, 66, 345, -1, 65, 345, -1, 64, 345, -1, 63, 345, -1, 62, 345, -1, 61, 345, -1, 60, 345, -1, 73, 404, -1, 59, 345, -1, 411, -1, 364, -1, 371, -1, 374, -1, 377, -1, 363, -1, 199, 405, 199, -1, 13, 345, -1, 385, -1, 117, 193, 387, 414, 194, -1, -1, -1, 243, 242, 193, 349, 286, 194, 479, 347, 479, 196, 225, 197, -1, -1, 324, 243, 242, 193, 350, 286, 194, 479, 347, 479, 196, 225, 197, -1, -1, 189, 83, 352, 357, -1, -1, 189, 190, 353, 286, 191, 479, 357, -1, -1, 189, 196, 354, 225, 197, -1, -1, 83, 355, 357, -1, -1, 190, 356, 286, 191, 479, 357, -1, 8, 345, -1, 8, 342, -1, 8, 196, 225, 197, -1, 91, -1, 468, -1, 359, 9, 358, 136, 345, -1, 358, 136, 345, -1, 360, 9, 358, 136, 408, -1, 358, 136, 408, -1, 359, 413, -1, -1, 360, 413, -1, -1, 183, 193, 361, 194, -1, 138, 193, 457, 194, -1, 70, 457, 200, -1, 366, 413, -1, -1, 366, 9, 345, 136, 345, -1, 345, 136, 345, -1, 366, 9, 345, 136, 38, 443, -1, 345, 136, 38, 443, -1, 368, 413, -1, -1, 368, 9, 408, 136, 408, -1, 408, 136, 408, -1, 370, 413, -1, -1, 370, 9, 419, 136, 419, -1, 419, 136, 419, -1, 139, 70, 365, 200, -1, 139, 70, 367, 200, -1, 139, 70, 369, 200, -1, 140, 70, 380, 200, -1, 140, 70, 381, 200, -1, 140, 70, 382, 200, -1, 141, 70, 380, 200, -1, 141, 70, 381, 200, -1, 141, 70, 382, 200, -1, 335, 413, -1, -1, 409, 413, -1, -1, 420, 413, -1, -1, 399, 196, 459, 197, -1, 399, 196, 461, 197, -1, 385, 70, 453, 200, -1, 386, 70, 453, 200, -1, 364, -1, 371, -1, 374, -1, 377, -1, 468, -1, 446, -1, 91, -1, 193, 346, 194, -1, 81, -1, 387, 9, 83, -1, 387, 9, 38, 83, -1, 83, -1, 38, 83, -1, 177, 163, 389, 178, -1, 391, 54, -1, 391, 178, 392, 177, 54, 390, -1, -1, 163, -1, 391, 393, 14, 394, -1, -1, 392, 395, -1, -1, 163, -1, 164, -1, 196, 345, 197, -1, 164, -1, 196, 345, 197, -1, 388, -1, 397, -1, 396, 32, 397, -1, 396, 51, 397, -1, 210, -1, 73, -1, 111, -1, 112, -1, 113, -1, 27, -1, 29, -1, 28, -1, 114, -1, 115, -1, 176, -1, 116, -1, 74, -1, 75, -1, 77, -1, 76, -1, 94, -1, 95, -1, 93, -1, 96, -1, 97, -1, 98, -1, 99, -1, 100, -1, 101, -1, 57, -1, 102, -1, 104, -1, 105, -1, 106, -1, 107, -1, 108, -1, 110, -1, 109, -1, 92, -1, 13, -1, 130, -1, 131, -1, 132, -1, 133, -1, 72, -1, 71, -1, 125, -1, 5, -1, 7, -1, 6, -1, 4, -1, 3, -1, 159, -1, 117, -1, 118, -1, 127, -1, 128, -1, 129, -1, 124, -1, 123, -1, 122, -1, 121, -1, 120, -1, 119, -1, 189, -1, 126, -1, 137, -1, 138, -1, 10, -1, 12, -1, 11, -1, 143, -1, 145, -1, 144, -1, 146, -1, 147, -1, 161, -1, 160, -1, 188, -1, 171, -1, 174, -1, 173, -1, 184, -1, 186, -1, 183, -1, 222, 193, 288, 194, -1, 223, -1, 163, -1, 399, -1, 407, -1, 124, -1, 451, -1, 193, 346, 194, -1, 400, -1, 401, 158, 452, -1, 400, -1, 449, -1, 402, 158, 452, -1, 399, -1, 124, -1, 454, -1, 193, 194, -1, 334, -1, -1, -1, 90, -1, 463, -1, 193, 288, 194, -1, -1, 78, -1, 79, -1, 80, -1, 91, -1, 146, -1, 147, -1, 161, -1, 143, -1, 174, -1, 144, -1, 145, -1, 160, -1, 188, -1, 154, 90, 155, -1, 154, 155, -1, 407, -1, 221, -1, 138, 193, 412, 194, -1, 70, 412, 200, -1, 183, 193, 362, 194, -1, 372, -1, 375, -1, 378, -1, 410, -1, 384, -1, 193, 408, 194, -1, 408, 34, 408, -1, 408, 35, 408, -1, 408, 10, 408, -1, 408, 12, 408, -1, 408, 11, 408, -1, 408, 36, 408, -1, 408, 38, 408, -1, 408, 37, 408, -1, 408, 52, 408, -1, 408, 50, 408, -1, 408, 51, 408, -1, 408, 53, 408, -1, 408, 54, 408, -1, 408, 55, 408, -1, 408, 49, 408, -1, 408, 48, 408, -1, 408, 69, 408, -1, 56, 408, -1, 58, 408, -1, 50, 408, -1, 51, 408, -1, 408, 40, 408, -1, 408, 39, 408, -1, 408, 42, 408, -1, 408, 41, 408, -1, 408, 43, 408, -1, 408, 47, 408, -1, 408, 44, 408, -1, 408, 46, 408, -1, 408, 45, 408, -1, 408, 31, 408, 32, 408, -1, 408, 31, 32, 408, -1, 409, 9, 408, -1, 408, -1, 223, 158, 211, -1, 163, 158, 211, -1, 163, 158, 130, -1, 223, 158, 130, -1, 221, -1, 82, -1, 468, -1, 407, -1, 201, 463, 201, -1, 202, 463, 202, -1, 154, 463, 155, -1, 415, 413, -1, -1, 9, -1, -1, 9, -1, -1, 415, 9, 408, 136, 408, -1, 415, 9, 408, -1, 408, 136, 408, -1, 408, -1, 78, -1, 79, -1, 80, -1, 154, 90, 155, -1, 154, 155, -1, 78, -1, 79, -1, 80, -1, 210, -1, 91, -1, 91, 52, 418, -1, 416, -1, 418, -1, 210, -1, 50, 417, -1, 51, 417, -1, 138, 193, 421, 194, -1, 70, 421, 200, -1, 183, 193, 424, 194, -1, 373, -1, 376, -1, 379, -1, 420, 9, 419, -1, 419, -1, 422, 413, -1, -1, 422, 9, 419, 136, 419, -1, 422, 9, 419, -1, 419, 136, 419, -1, 419, -1, 423, 9, 419, -1, 419, -1, 425, 413, -1, -1, 425, 9, 358, 136, 419, -1, 358, 136, 419, -1, 423, 413, -1, -1, 193, 426, 194, -1, -1, 428, 9, 210, 427, -1, 210, 427, -1, -1, 430, 428, 413, -1, 49, 429, 48, -1, 431, -1, -1, 134, -1, 135, -1, 210, -1, 163, -1, 196, 345, 197, -1, 434, -1, 452, -1, 210, -1, 196, 345, 197, -1, 436, -1, 452, -1, 70, 453, 200, -1, 196, 345, 197, -1, 444, 438, -1, 193, 333, 194, 438, -1, 455, 438, -1, 193, 333, 194, 438, -1, 193, 333, 194, 433, 435, -1, 193, 346, 194, 433, 435, -1, 193, 333, 194, 433, 434, -1, 193, 346, 194, 433, 434, -1, 450, -1, 398, -1, 448, -1, 449, -1, 439, -1, 441, -1, 443, 433, 435, -1, 402, 158, 452, -1, 445, 193, 288, 194, -1, 446, 193, 288, 194, -1, 193, 443, 194, -1, 398, -1, 448, -1, 449, -1, 439, -1, 443, 433, 435, -1, 442, -1, 445, 193, 288, 194, -1, 193, 443, 194, -1, 402, 158, 452, -1, 450, -1, 439, -1, 398, -1, 364, -1, 407, -1, 193, 443, 194, -1, 193, 346, 194, -1, 446, 193, 288, 194, -1, 445, 193, 288, 194, -1, 193, 447, 194, -1, 348, -1, 351, -1, 443, 433, 437, 475, 193, 288, 194, -1, 193, 333, 194, 433, 437, 475, 193, 288, 194, -1, 402, 158, 212, 475, 193, 288, 194, -1, 402, 158, 452, 193, 288, 194, -1, 402, 158, 196, 345, 197, 193, 288, 194, -1, 451, -1, 451, 70, 453, 200, -1, 451, 196, 345, 197, -1, 452, -1, 83, -1, 84, -1, 198, 196, 345, 197, -1, 198, 452, -1, 345, -1, -1, 450, -1, 440, -1, 441, -1, 454, 433, 435, -1, 401, 158, 450, -1, 193, 443, 194, -1, -1, 440, -1, 442, -1, 454, 433, 434, -1, 193, 443, 194, -1, 456, 9, -1, 456, 9, 443, -1, 456, 9, 137, 193, 456, 194, -1, -1, 443, -1, 137, 193, 456, 194, -1, 458, 413, -1, -1, 458, 9, 345, 136, 345, -1, 458, 9, 345, -1, 345, 136, 345, -1, 345, -1, 458, 9, 345, 136, 38, 443, -1, 458, 9, 38, 443, -1, 345, 136, 38, 443, -1, 38, 443, -1, 460, 413, -1, -1, 460, 9, 345, 136, 345, -1, 460, 9, 345, -1, 345, 136, 345, -1, 345, -1, 462, 413, -1, -1, 462, 9, 408, 136, 408, -1, 462, 9, 408, -1, 408, 136, 408, -1, 408, -1, 463, 464, -1, 463, 90, -1, 464, -1, 90, 464, -1, 83, -1, 83, 70, 465, 200, -1, 83, 433, 210, -1, 156, 345, 197, -1, 156, 82, 70, 345, 200, 197, -1, 157, 443, 197, -1, 210, -1, 85, -1, 83, -1, 127, 193, 335, 194, -1, 128, 193, 443, 194, -1, 128, 193, 346, 194, -1, 128, 193, 447, 194, -1, 128, 193, 446, 194, -1, 128, 193, 333, 194, -1, 7, 345, -1, 6, 345, -1, 5, 193, 345, 194, -1, 4, 345, -1, 3, 345, -1, 443, -1, 467, 9, 443, -1, 402, 158, 211, -1, 402, 158, 130, -1, -1, 102, 492, -1, 184, 474, 14, 492, 195, -1, 431, 184, 474, 14, 492, 195, -1, 186, 474, 469, 14, 492, 195, -1, 431, 186, 474, 469, 14, 492, 195, -1, 212, -1, 492, 212, -1, 211, -1, 492, 211, -1, 212, -1, 212, 179, 481, 180, -1, 210, -1, 210, 179, 481, 180, -1, 179, 477, 180, -1, -1, 492, -1, 476, 9, 492, -1, 476, 413, -1, 476, 9, 172, -1, 477, -1, 172, -1, -1, -1, 32, 492, -1, 102, 492, -1, 103, 492, -1, 483, 413, -1, 480, -1, 482, 480, -1, 483, 9, 484, 210, -1, 484, 210, -1, 483, 9, 484, 210, 482, -1, 484, 210, 482, -1, 50, -1, 51, -1, -1, 91, 136, 492, -1, 31, 91, 136, 492, -1, 223, 158, 210, 136, 492, -1, 486, 9, 485, -1, 485, -1, 486, 413, -1, -1, 183, 193, 487, 194, -1, 223, -1, 210, 158, 490, -1, 210, 475, -1, 179, 492, 413, 180, -1, 179, 492, 9, 492, 180, -1, 31, 492, -1, 59, 492, -1, 223, -1, 138, -1, 142, -1, 488, -1, 489, 158, 490, -1, 138, 491, -1, 163, -1, 193, 111, 193, 478, 194, 32, 492, 194, -1, 193, 492, 9, 476, 413, 194, -1, 492, -1, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 735, 735, 735, 744, 746, 749, 750, 751, 752, 753, 754, 755, 758, 760, 760, 762, 762, 764, 766, 769, 772, 776, 780, 784, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 867, 871, 872, 876, 877, 882, 884, 889, 894, 895, 896, 898, 903, 905, 910, 915, 917, 919, 924, 925, 929, 930, 932, 936, 943, 950, 954, 960, 962, 965, 966, 967, 968, 971, 972, 976, 981, 981, 987, 987, 994, 993, 999, 999, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1022, 1020, 1029, 1027, 1034, 1044, 1038, 1048, 1046, 1050, 1051, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1074, 1074, 1079, 1085, 1089, 1089, 1097, 1098, 1102, 1103, 1107, 1113, 1111, 1126, 1123, 1139, 1136, 1153, 1152, 1161, 1159, 1171, 1170, 1189, 1187, 1206, 1205, 1214, 1212, 1223, 1223, 1230, 1229, 1241, 1239, 1252, 1253, 1257, 1260, 1263, 1264, 1265, 1268, 1269, 1272, 1274, 1277, 1278, 1281, 1282, 1285, 1286, 1290, 1291, 1296, 1297, 1300, 1301, 1302, 1306, 1307, 1311, 1312, 1316, 1317, 1321, 1322, 1327, 1328, 1334, 1335, 1336, 1337, 1340, 1343, 1345, 1348, 1349, 1353, 1355, 1358, 1361, 1364, 1365, 1368, 1369, 1373, 1379, 1385, 1392, 1394, 1399, 1404, 1410, 1414, 1418, 1422, 1427, 1432, 1437, 1442, 1448, 1457, 1462, 1467, 1473, 1475, 1479, 1483, 1488, 1492, 1495, 1498, 1502, 1506, 1510, 1514, 1519, 1527, 1529, 1532, 1533, 1534, 1535, 1537, 1539, 1544, 1545, 1548, 1549, 1550, 1554, 1555, 1557, 1558, 1562, 1564, 1567, 1571, 1577, 1579, 1582, 1582, 1586, 1585, 1589, 1591, 1594, 1597, 1595, 1611, 1607, 1621, 1623, 1625, 1627, 1629, 1631, 1633, 1637, 1638, 1639, 1642, 1648, 1652, 1658, 1661, 1666, 1668, 1673, 1678, 1682, 1683, 1687, 1688, 1690, 1692, 1698, 1699, 1701, 1705, 1706, 1711, 1715, 1716, 1720, 1721, 1725, 1727, 1733, 1738, 1739, 1741, 1745, 1746, 1747, 1748, 1752, 1753, 1754, 1755, 1756, 1757, 1759, 1764, 1767, 1768, 1772, 1773, 1777, 1778, 1781, 1782, 1785, 1786, 1789, 1790, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1804, 1805, 1808, 1809, 1810, 1813, 1815, 1817, 1818, 1821, 1823, 1827, 1829, 1833, 1837, 1841, 1846, 1847, 1849, 1850, 1851, 1852, 1855, 1859, 1860, 1864, 1865, 1869, 1870, 1871, 1872, 1876, 1880, 1885, 1889, 1893, 1897, 1901, 1906, 1907, 1908, 1909, 1910, 1914, 1916, 1917, 1918, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1966, 1967, 1969, 1970, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1998, 2002, 2007, 2006, 2021, 2019, 2037, 2036, 2055, 2054, 2073, 2072, 2090, 2090, 2105, 2105, 2123, 2124, 2125, 2130, 2132, 2136, 2140, 2146, 2150, 2156, 2158, 2162, 2164, 2168, 2172, 2173, 2177, 2179, 2183, 2185, 2186, 2189, 2193, 2195, 2199, 2202, 2207, 2209, 2213, 2216, 2221, 2225, 2229, 2233, 2237, 2241, 2245, 2249, 2253, 2257, 2259, 2263, 2265, 2269, 2271, 2275, 2282, 2289, 2291, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2304, 2305, 2309, 2310, 2311, 2312, 2316, 2322, 2331, 2344, 2345, 2348, 2351, 2354, 2355, 2358, 2362, 2365, 2368, 2375, 2376, 2380, 2381, 2383, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2472, 2477, 2478, 2482, 2483, 2484, 2485, 2487, 2491, 2492, 2503, 2504, 2506, 2518, 2519, 2520, 2524, 2525, 2526, 2530, 2531, 2532, 2535, 2537, 2541, 2542, 2543, 2544, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2558, 2563, 2564, 2565, 2567, 2568, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2578, 2580, 2582, 2584, 2586, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2604, 2606, 2608, 2610, 2611, 2614, 2615, 2619, 2623, 2625, 2629, 2630, 2634, 2637, 2640, 2643, 2649, 2650, 2651, 2652, 2653, 2654, 2655, 2660, 2662, 2666, 2667, 2670, 2671, 2675, 2678, 2680, 2682, 2686, 2687, 2688, 2689, 2692, 2696, 2697, 2698, 2699, 2703, 2705, 2712, 2713, 2714, 2715, 2716, 2717, 2719, 2720, 2722, 2723, 2724, 2728, 2730, 2734, 2736, 2739, 2742, 2744, 2746, 2749, 2751, 2755, 2757, 2760, 2763, 2769, 2771, 2774, 2775, 2780, 2783, 2787, 2787, 2792, 2795, 2796, 2800, 2801, 2805, 2806, 2807, 2811, 2816, 2821, 2822, 2826, 2831, 2836, 2837, 2841, 2842, 2847, 2849, 2854, 2865, 2879, 2891, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2922, 2931, 2933, 2935, 2939, 2940, 2941, 2942, 2943, 2959, 2960, 2962, 2964, 2971, 2972, 2973, 2974, 2975, 2976, 2977, 2978, 2980, 2985, 2989, 2990, 2994, 2997, 3004, 3008, 3017, 3024, 3032, 3034, 3035, 3039, 3040, 3041, 3043, 3048, 3049, 3060, 3061, 3062, 3063, 3074, 3077, 3080, 3081, 3082, 3083, 3094, 3098, 3099, 3100, 3102, 3103, 3104, 3108, 3110, 3113, 3115, 3116, 3117, 3118, 3121, 3123, 3124, 3128, 3130, 3133, 3135, 3136, 3137, 3141, 3143, 3146, 3149, 3151, 3153, 3157, 3158, 3160, 3161, 3167, 3168, 3170, 3180, 3182, 3184, 3187, 3188, 3189, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3207, 3208, 3212, 3214, 3222, 3224, 3228, 3232, 3237, 3241, 3249, 3250, 3254, 3255, 3261, 3262, 3271, 3272, 3280, 3283, 3287, 3290, 3295, 3300, 3302, 3303, 3304, 3308, 3309, 3313, 3314, 3317, 3322, 3323, 3327, 3330, 3332, 3336, 3342, 3343, 3344, 3348, 3352, 3362, 3370, 3372, 3376, 3378, 3383, 3389, 3392, 3397, 3402, 3404, 3411, 3414, 3417, 3418, 3421, 3424, 3425, 3430, 3432, 3436, 3442, 3452, 3453 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "T_REQUIRE_ONCE", "T_REQUIRE", "T_EVAL", "T_INCLUDE_ONCE", "T_INCLUDE", "T_LAMBDA_ARROW", "','", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "'='", "T_POW_EQUAL", "T_SR_EQUAL", "T_SL_EQUAL", "T_XOR_EQUAL", "T_OR_EQUAL", "T_AND_EQUAL", "T_MOD_EQUAL", "T_CONCAT_EQUAL", "T_DIV_EQUAL", "T_MUL_EQUAL", "T_MINUS_EQUAL", "T_PLUS_EQUAL", "T_YIELD", "T_AWAIT", "T_YIELD_FROM", "T_PIPE", "'?'", "':'", "\"??\"", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "'|'", "'^'", "'&'", "T_IS_NOT_IDENTICAL", "T_IS_IDENTICAL", "T_IS_NOT_EQUAL", "T_IS_EQUAL", "'<'", "'>'", "T_SPACESHIP", "T_IS_GREATER_OR_EQUAL", "T_IS_SMALLER_OR_EQUAL", "T_SR", "T_SL", "'+'", "'-'", "'.'", "'*'", "'/'", "'%'", "'!'", "T_INSTANCEOF", "'~'", "'@'", "T_UNSET_CAST", "T_BOOL_CAST", "T_OBJECT_CAST", "T_ARRAY_CAST", "T_STRING_CAST", "T_DOUBLE_CAST", "T_INT_CAST", "T_DEC", "T_INC", "T_POW", "'['", "T_CLONE", "T_NEW", "T_EXIT", "T_IF", "T_ELSEIF", "T_ELSE", "T_ENDIF", "T_LNUMBER", "T_DNUMBER", "T_ONUMBER", "T_STRING", "T_STRING_VARNAME", "T_VARIABLE", "T_PIPE_VAR", "T_NUM_STRING", "T_INLINE_HTML", "T_HASHBANG", "T_CHARACTER", "T_BAD_CHARACTER", "T_ENCAPSED_AND_WHITESPACE", "T_CONSTANT_ENCAPSED_STRING", "T_ECHO", "T_DO", "T_WHILE", "T_ENDWHILE", "T_FOR", "T_ENDFOR", "T_FOREACH", "T_ENDFOREACH", "T_DECLARE", "T_ENDDECLARE", "T_AS", "T_SUPER", "T_SWITCH", "T_ENDSWITCH", "T_CASE", "T_DEFAULT", "T_BREAK", "T_GOTO", "T_CONTINUE", "T_FUNCTION", "T_CONST", "T_RETURN", "T_TRY", "T_CATCH", "T_THROW", "T_USE", "T_GLOBAL", "T_PUBLIC", "T_PROTECTED", "T_PRIVATE", "T_FINAL", "T_ABSTRACT", "T_STATIC", "T_VAR", "T_UNSET", "T_ISSET", "T_EMPTY", "T_HALT_COMPILER", "T_CLASS", "T_INTERFACE", "T_EXTENDS", "T_IMPLEMENTS", "T_OBJECT_OPERATOR", "T_NULLSAFE_OBJECT_OPERATOR", "T_DOUBLE_ARROW", "T_LIST", "T_ARRAY", "T_DICT", "T_VEC", "T_KEYSET", "T_CALLABLE", "T_CLASS_C", "T_METHOD_C", "T_FUNC_C", "T_LINE", "T_FILE", "T_COMMENT", "T_DOC_COMMENT", "T_OPEN_TAG", "T_OPEN_TAG_WITH_ECHO", "T_CLOSE_TAG", "T_WHITESPACE", "T_START_HEREDOC", "T_END_HEREDOC", "T_DOLLAR_OPEN_CURLY_BRACES", "T_CURLY_OPEN", "T_DOUBLE_COLON", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR", "T_XHP_LABEL", "T_XHP_TEXT", "T_XHP_ATTRIBUTE", "T_XHP_CATEGORY", "T_XHP_CATEGORY_LABEL", "T_XHP_CHILDREN", "T_ENUM", "T_XHP_REQUIRED", "T_TRAIT", "\"...\"", "T_INSTEADOF", "T_TRAIT_C", "T_HH_ERROR", "T_FINALLY", "T_XHP_TAG_LT", "T_XHP_TAG_GT", "T_TYPELIST_LT", "T_TYPELIST_GT", "T_UNRESOLVED_LT", "T_COLLECTION", "T_SHAPE", "T_TYPE", "T_UNRESOLVED_TYPE", "T_NEWTYPE", "T_UNRESOLVED_NEWTYPE", "T_COMPILER_HALT_OFFSET", "T_ASYNC", "T_LAMBDA_OP", "T_LAMBDA_CP", "T_UNRESOLVED_OP", "'('", "')'", "';'", "'{'", "'}'", "'$'", "'`'", "']'", "'\"'", "'\\''", "$accept", "start", "$@1", "top_statement_list", "top_statement", "$@2", "$@3", "ident_no_semireserved", "ident_for_class_const", "ident", "group_use_prefix", "non_empty_use_declarations", "use_declarations", "use_declaration", "non_empty_mixed_use_declarations", "mixed_use_declarations", "mixed_use_declaration", "namespace_name", "namespace_string", "namespace_string_typeargs", "class_namespace_string_typeargs", "constant_declaration", "inner_statement_list", "inner_statement", "statement", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "try_statement_list", "$@12", "additional_catches", "finally_statement_list", "$@13", "optional_finally", "is_reference", "function_loc", "function_declaration_statement", "$@14", "$@15", "$@16", "enum_declaration_statement", "$@17", "$@18", "class_declaration_statement", "$@19", "$@20", "$@21", "$@22", "class_expression", "$@23", "trait_declaration_statement", "$@24", "$@25", "class_decl_name", "interface_decl_name", "trait_decl_name", "class_entry_type", "extends_from", "implements_list", "interface_extends_list", "interface_list", "trait_list", "foreach_optional_arg", "foreach_variable", "for_statement", "foreach_statement", "while_statement", "declare_statement", "declare_list", "switch_case_list", "case_list", "case_separator", "elseif_list", "new_elseif_list", "else_single", "new_else_single", "method_parameter_list", "non_empty_method_parameter_list", "parameter_list", "non_empty_parameter_list", "function_call_parameter_list", "non_empty_fcall_parameter_list", "global_var_list", "global_var", "static_var_list", "enum_statement_list", "enum_statement", "enum_constant_declaration", "class_statement_list", "class_statement", "$@26", "$@27", "$@28", "$@29", "trait_rules", "trait_precedence_rule", "trait_alias_rule", "trait_alias_rule_method", "xhp_attribute_stmt", "xhp_attribute_decl", "xhp_nullable_attribute_decl_type", "xhp_attribute_decl_type", "non_empty_xhp_attribute_enum", "xhp_attribute_enum", "xhp_attribute_default", "xhp_attribute_is_required", "xhp_category_stmt", "xhp_category_decl", "xhp_children_stmt", "xhp_children_paren_expr", "xhp_children_decl_expr", "xhp_children_decl_tag", "function_body", "method_body", "variable_modifiers", "method_modifiers", "non_empty_member_modifiers", "member_modifier", "parameter_modifiers", "parameter_modifier", "class_variable_declaration", "class_constant_declaration", "class_abstract_constant_declaration", "class_type_constant_declaration", "class_type_constant", "expr_with_parens", "parenthesis_expr", "expr_list", "for_expr", "yield_expr", "yield_assign_expr", "yield_list_assign_expr", "yield_from_expr", "yield_from_assign_expr", "await_expr", "await_assign_expr", "await_list_assign_expr", "expr", "expr_no_variable", "lambda_use_vars", "closure_expression", "$@30", "$@31", "lambda_expression", "$@32", "$@33", "$@34", "$@35", "$@36", "lambda_body", "shape_keyname", "non_empty_shape_pair_list", "non_empty_static_shape_pair_list", "shape_pair_list", "static_shape_pair_list", "shape_literal", "array_literal", "dict_pair_list", "non_empty_dict_pair_list", "static_dict_pair_list", "non_empty_static_dict_pair_list", "static_dict_pair_list_ae", "non_empty_static_dict_pair_list_ae", "dict_literal", "static_dict_literal", "static_dict_literal_ae", "vec_literal", "static_vec_literal", "static_vec_literal_ae", "keyset_literal", "static_keyset_literal", "static_keyset_literal_ae", "vec_ks_expr_list", "static_vec_ks_expr_list", "static_vec_ks_expr_list_ae", "collection_literal", "static_collection_literal", "dim_expr", "dim_expr_base", "lexical_var_list", "xhp_tag", "xhp_tag_body", "xhp_opt_end_label", "xhp_attributes", "xhp_children", "xhp_attribute_name", "xhp_attribute_value", "xhp_child", "xhp_label_ws", "xhp_bareword", "simple_function_call", "fully_qualified_class_name", "static_class_name_base", "static_class_name_no_calls", "static_class_name", "class_name_reference", "exit_expr", "backticks_expr", "ctor_arguments", "common_scalar", "static_expr", "static_expr_list", "static_class_constant", "scalar", "static_array_pair_list", "possible_comma", "hh_possible_comma", "non_empty_static_array_pair_list", "common_scalar_ae", "static_numeric_scalar_ae", "static_string_expr_ae", "static_scalar_ae", "static_scalar_ae_list", "static_array_pair_list_ae", "non_empty_static_array_pair_list_ae", "non_empty_static_scalar_list_ae", "static_shape_pair_list_ae", "non_empty_static_shape_pair_list_ae", "static_scalar_list_ae", "attribute_static_scalar_list", "non_empty_user_attribute_list", "user_attribute_list", "$@37", "non_empty_user_attributes", "optional_user_attributes", "object_operator", "object_property_name_no_variables", "object_property_name", "object_method_name_no_variables", "object_method_name", "array_access", "dimmable_variable_access", "dimmable_variable_no_calls_access", "object_property_access_on_expr", "object_property_access_on_expr_no_variables", "variable", "dimmable_variable", "callable_variable", "lambda_or_closure_with_parens", "lambda_or_closure", "object_method_call", "class_method_call", "variable_no_objects", "reference_variable", "compound_variable", "dim_offset", "variable_no_calls", "dimmable_variable_no_calls", "assignment_list", "array_pair_list", "non_empty_array_pair_list", "collection_init", "non_empty_collection_init", "static_collection_init", "non_empty_static_collection_init", "encaps_list", "encaps_var", "encaps_var_offset", "internal_functions", "variable_list", "class_constant", "hh_opt_constraint", "hh_type_alias_statement", "hh_name_with_type", "hh_constname_with_type", "hh_name_with_typevar", "hh_name_no_semireserved_with_typevar", "hh_typeargs_opt", "hh_non_empty_type_list", "hh_type_list", "hh_func_type_list", "opt_return_type", "hh_constraint", "hh_typevar_list", "hh_non_empty_constraint_list", "hh_non_empty_typevar_list", "hh_typevar_variance", "hh_shape_member_type", "hh_non_empty_shape_member_list", "hh_shape_member_list", "hh_shape_type", "hh_access_type_start", "hh_access_type", "array_typelist", "hh_type", "hh_type_opt", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 44, 264, 265, 266, 267, 61, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 63, 58, 284, 285, 286, 124, 94, 38, 287, 288, 289, 290, 60, 62, 291, 292, 293, 294, 295, 43, 45, 46, 42, 47, 37, 33, 296, 126, 64, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 91, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 40, 41, 59, 123, 125, 36, 96, 93, 34, 39 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 203, 205, 204, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 208, 207, 209, 207, 207, 207, 207, 207, 207, 207, 207, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 213, 213, 214, 214, 215, 216, 216, 216, 216, 217, 217, 218, 219, 219, 219, 220, 220, 221, 221, 221, 222, 223, 224, 224, 225, 225, 226, 226, 226, 226, 227, 227, 227, 228, 227, 229, 227, 230, 227, 231, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 232, 227, 233, 227, 227, 234, 227, 235, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 237, 236, 238, 238, 240, 239, 241, 241, 242, 242, 243, 245, 244, 246, 244, 247, 244, 249, 248, 250, 248, 252, 251, 253, 251, 254, 251, 255, 251, 257, 256, 259, 258, 260, 258, 261, 261, 262, 263, 264, 264, 264, 264, 264, 265, 265, 266, 266, 267, 267, 268, 268, 269, 269, 270, 270, 271, 271, 271, 272, 272, 273, 273, 274, 274, 275, 275, 276, 276, 277, 277, 277, 277, 278, 278, 278, 279, 279, 280, 280, 281, 281, 282, 282, 283, 283, 284, 284, 284, 284, 284, 284, 284, 284, 285, 285, 285, 285, 285, 285, 285, 285, 286, 286, 286, 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, 287, 287, 287, 288, 288, 289, 289, 289, 289, 289, 289, 290, 290, 291, 291, 291, 292, 292, 292, 292, 293, 293, 294, 295, 296, 296, 298, 297, 299, 297, 297, 297, 297, 300, 297, 301, 297, 297, 297, 297, 297, 297, 297, 297, 302, 302, 302, 303, 304, 304, 305, 305, 306, 306, 307, 307, 308, 308, 309, 309, 309, 309, 309, 309, 309, 310, 310, 311, 312, 312, 313, 313, 314, 314, 315, 316, 316, 316, 317, 317, 317, 317, 318, 318, 318, 318, 318, 318, 318, 319, 319, 319, 320, 320, 321, 321, 322, 322, 323, 323, 324, 324, 325, 325, 325, 325, 325, 325, 325, 326, 326, 327, 327, 327, 328, 328, 328, 328, 329, 329, 330, 330, 331, 331, 332, 333, 333, 333, 333, 333, 333, 334, 335, 335, 336, 336, 337, 337, 337, 337, 338, 339, 340, 341, 342, 343, 344, 345, 345, 345, 345, 345, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 347, 347, 349, 348, 350, 348, 352, 351, 353, 351, 354, 351, 355, 351, 356, 351, 357, 357, 357, 358, 358, 359, 359, 360, 360, 361, 361, 362, 362, 363, 364, 364, 365, 365, 366, 366, 366, 366, 367, 367, 368, 368, 369, 369, 370, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 380, 381, 381, 382, 382, 383, 384, 385, 385, 386, 386, 386, 386, 386, 386, 386, 386, 386, 387, 387, 387, 387, 388, 389, 389, 390, 390, 391, 391, 392, 392, 393, 394, 394, 395, 395, 395, 396, 396, 396, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 398, 399, 399, 400, 400, 400, 400, 400, 401, 401, 402, 402, 402, 403, 403, 403, 404, 404, 404, 405, 405, 405, 406, 406, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 409, 409, 410, 410, 410, 410, 411, 411, 411, 411, 411, 411, 411, 412, 412, 413, 413, 414, 414, 415, 415, 415, 415, 416, 416, 416, 416, 416, 417, 417, 417, 417, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 420, 420, 421, 421, 422, 422, 422, 422, 423, 423, 424, 424, 425, 425, 426, 426, 427, 427, 428, 428, 430, 429, 431, 432, 432, 433, 433, 434, 434, 434, 435, 435, 436, 436, 437, 437, 438, 438, 439, 439, 440, 440, 441, 441, 442, 442, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 444, 444, 444, 444, 444, 444, 444, 444, 444, 445, 445, 445, 445, 445, 445, 445, 445, 445, 446, 447, 447, 448, 448, 449, 449, 449, 450, 451, 451, 451, 452, 452, 452, 452, 453, 453, 454, 454, 454, 454, 454, 454, 455, 455, 455, 455, 455, 456, 456, 456, 456, 456, 456, 457, 457, 458, 458, 458, 458, 458, 458, 458, 458, 459, 459, 460, 460, 460, 460, 461, 461, 462, 462, 462, 462, 463, 463, 463, 463, 464, 464, 464, 464, 464, 464, 465, 465, 465, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 467, 467, 468, 468, 469, 469, 470, 470, 470, 470, 471, 471, 472, 472, 473, 473, 474, 474, 475, 475, 476, 476, 477, 478, 478, 478, 478, 479, 479, 480, 480, 481, 482, 482, 483, 483, 483, 483, 484, 484, 484, 485, 485, 485, 486, 486, 487, 487, 488, 489, 490, 490, 491, 491, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 493, 493 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 2, 0, 1, 1, 1, 1, 1, 1, 4, 3, 0, 6, 0, 5, 3, 4, 4, 6, 7, 7, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 1, 2, 1, 2, 3, 4, 3, 1, 2, 1, 2, 2, 1, 3, 1, 3, 2, 2, 2, 5, 4, 2, 0, 1, 1, 1, 1, 3, 5, 8, 0, 4, 0, 6, 0, 10, 0, 4, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, 0, 9, 0, 10, 5, 0, 13, 0, 5, 3, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 0, 4, 9, 0, 0, 4, 2, 0, 1, 0, 1, 0, 9, 0, 10, 0, 11, 0, 9, 0, 10, 0, 8, 0, 9, 0, 7, 0, 8, 0, 8, 0, 7, 0, 8, 1, 1, 1, 1, 1, 2, 3, 3, 2, 2, 0, 2, 0, 2, 0, 1, 3, 1, 3, 2, 0, 1, 2, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 5, 3, 4, 4, 5, 5, 4, 0, 1, 1, 4, 0, 5, 0, 2, 0, 3, 0, 7, 8, 6, 2, 5, 6, 4, 0, 4, 5, 7, 6, 6, 7, 9, 8, 6, 7, 5, 2, 4, 5, 3, 0, 3, 4, 6, 5, 5, 6, 8, 7, 2, 0, 1, 2, 2, 3, 4, 4, 3, 1, 1, 2, 4, 3, 5, 1, 3, 2, 0, 2, 3, 2, 0, 0, 4, 0, 5, 2, 2, 2, 0, 10, 0, 11, 3, 3, 3, 4, 4, 3, 5, 2, 2, 0, 6, 5, 4, 3, 1, 1, 3, 4, 1, 2, 1, 1, 5, 6, 1, 1, 4, 1, 1, 3, 2, 2, 0, 2, 0, 1, 3, 1, 1, 1, 1, 3, 4, 4, 4, 1, 1, 2, 2, 2, 3, 3, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 3, 5, 1, 3, 5, 4, 3, 3, 3, 4, 3, 3, 3, 2, 2, 1, 1, 3, 3, 1, 1, 0, 1, 2, 4, 3, 3, 6, 2, 3, 2, 3, 6, 1, 1, 1, 1, 1, 6, 3, 4, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 3, 2, 1, 5, 0, 0, 12, 0, 13, 0, 4, 0, 7, 0, 5, 0, 3, 0, 6, 2, 2, 4, 1, 1, 5, 3, 5, 3, 2, 0, 2, 0, 4, 4, 3, 2, 0, 5, 3, 6, 4, 2, 0, 5, 3, 2, 0, 5, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 0, 2, 0, 2, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 4, 1, 2, 4, 2, 6, 0, 1, 4, 0, 2, 0, 1, 1, 3, 1, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 2, 1, 0, 0, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 4, 3, 4, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, 3, 2, 0, 1, 0, 1, 0, 5, 3, 3, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 4, 3, 4, 1, 1, 1, 3, 1, 2, 0, 5, 3, 3, 1, 3, 1, 2, 0, 5, 3, 2, 0, 3, 0, 4, 2, 0, 3, 3, 1, 0, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 3, 2, 4, 2, 4, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 3, 1, 1, 1, 1, 3, 1, 4, 3, 3, 1, 1, 1, 1, 1, 3, 3, 4, 4, 3, 1, 1, 7, 9, 7, 6, 8, 1, 4, 4, 1, 1, 1, 4, 2, 1, 0, 1, 1, 1, 3, 3, 3, 0, 1, 1, 3, 3, 2, 3, 6, 0, 1, 4, 2, 0, 5, 3, 3, 1, 6, 4, 4, 2, 2, 0, 5, 3, 3, 1, 2, 0, 5, 3, 3, 1, 2, 2, 1, 2, 1, 4, 3, 3, 6, 3, 1, 1, 1, 4, 4, 4, 4, 4, 4, 2, 2, 4, 2, 2, 1, 3, 3, 3, 0, 2, 5, 6, 6, 7, 1, 2, 1, 2, 1, 4, 1, 4, 3, 0, 1, 3, 2, 3, 1, 1, 0, 0, 2, 2, 2, 2, 1, 2, 4, 2, 5, 3, 1, 1, 0, 3, 4, 5, 3, 1, 2, 0, 4, 1, 3, 2, 4, 5, 2, 2, 1, 1, 1, 1, 3, 2, 1, 8, 6, 1, 0 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { 2, 0, 5, 1, 3, 0, 0, 0, 0, 0, 0, 430, 0, 0, 845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 936, 0, 924, 716, 0, 722, 723, 724, 25, 787, 912, 913, 154, 155, 725, 0, 135, 0, 0, 0, 0, 26, 0, 0, 0, 0, 189, 0, 0, 0, 0, 0, 0, 396, 397, 398, 401, 400, 399, 0, 0, 0, 0, 218, 0, 0, 0, 32, 33, 34, 729, 731, 732, 726, 727, 0, 0, 0, 733, 728, 0, 700, 27, 28, 29, 31, 30, 0, 730, 0, 0, 0, 0, 734, 402, 535, 0, 153, 125, 0, 717, 0, 0, 4, 115, 117, 786, 0, 699, 0, 6, 188, 7, 9, 8, 10, 0, 0, 394, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 901, 902, 517, 513, 514, 515, 516, 424, 520, 0, 423, 872, 701, 708, 0, 789, 512, 393, 875, 876, 887, 442, 0, 0, 445, 444, 873, 874, 871, 908, 911, 502, 788, 11, 401, 400, 399, 0, 0, 31, 0, 115, 188, 0, 980, 442, 979, 0, 977, 976, 519, 0, 431, 438, 436, 0, 0, 484, 485, 486, 487, 511, 509, 508, 507, 506, 505, 504, 503, 25, 912, 725, 703, 32, 33, 34, 0, 0, 1000, 894, 701, 0, 702, 465, 0, 463, 0, 940, 0, 796, 422, 712, 208, 0, 1000, 421, 711, 706, 0, 721, 702, 919, 920, 926, 918, 713, 0, 0, 715, 510, 0, 0, 0, 0, 427, 0, 133, 429, 0, 0, 139, 141, 0, 0, 143, 0, 75, 74, 69, 68, 60, 61, 52, 72, 83, 84, 0, 55, 0, 67, 59, 65, 86, 78, 77, 50, 73, 93, 94, 51, 89, 48, 90, 49, 91, 47, 95, 82, 87, 92, 79, 80, 54, 81, 85, 46, 76, 62, 96, 70, 63, 53, 45, 44, 43, 42, 41, 40, 64, 97, 99, 57, 38, 39, 66, 1038, 1039, 58, 1043, 37, 56, 88, 0, 0, 115, 98, 991, 1037, 0, 1040, 0, 0, 145, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 798, 0, 103, 105, 307, 0, 0, 306, 0, 222, 0, 219, 312, 0, 0, 0, 0, 0, 997, 204, 216, 932, 936, 554, 577, 577, 0, 961, 0, 736, 0, 0, 0, 959, 0, 16, 0, 119, 196, 210, 217, 605, 547, 0, 985, 527, 529, 531, 849, 430, 443, 0, 0, 441, 442, 444, 0, 0, 915, 718, 0, 719, 0, 0, 0, 178, 0, 0, 121, 298, 0, 24, 187, 0, 215, 200, 214, 399, 402, 188, 395, 168, 169, 170, 171, 172, 174, 175, 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 924, 0, 167, 917, 917, 946, 0, 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 464, 462, 850, 851, 0, 917, 0, 863, 298, 298, 917, 0, 932, 0, 188, 0, 0, 147, 0, 847, 842, 796, 0, 443, 441, 0, 944, 0, 552, 795, 935, 721, 443, 441, 442, 121, 0, 298, 420, 0, 865, 714, 0, 125, 258, 0, 534, 0, 150, 0, 0, 428, 0, 0, 0, 0, 0, 142, 166, 144, 1038, 1039, 1035, 1036, 0, 1042, 1028, 0, 0, 0, 0, 71, 36, 58, 35, 992, 173, 176, 146, 125, 0, 163, 165, 0, 0, 0, 0, 106, 0, 797, 104, 18, 0, 100, 0, 308, 0, 148, 221, 220, 0, 0, 149, 981, 0, 0, 443, 441, 442, 445, 444, 0, 1021, 228, 0, 933, 0, 0, 0, 0, 796, 796, 0, 0, 151, 0, 0, 735, 960, 787, 0, 0, 958, 792, 957, 118, 5, 13, 14, 0, 226, 0, 0, 540, 0, 0, 796, 0, 0, 709, 704, 541, 0, 0, 0, 0, 849, 125, 0, 798, 848, 1047, 419, 433, 498, 881, 900, 130, 124, 126, 127, 128, 129, 393, 0, 518, 790, 791, 116, 796, 0, 1001, 0, 0, 0, 798, 299, 0, 523, 190, 224, 0, 468, 470, 469, 481, 0, 0, 501, 466, 467, 471, 473, 472, 489, 488, 491, 490, 492, 494, 496, 495, 493, 483, 482, 475, 476, 474, 477, 478, 480, 497, 479, 916, 0, 0, 950, 0, 796, 984, 0, 983, 1000, 878, 206, 198, 212, 0, 985, 202, 188, 0, 434, 437, 439, 447, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 853, 0, 852, 855, 877, 859, 1000, 856, 0, 0, 0, 0, 0, 0, 0, 0, 978, 432, 840, 844, 795, 846, 0, 705, 0, 939, 0, 938, 224, 0, 705, 923, 922, 908, 911, 0, 0, 852, 855, 921, 856, 425, 260, 262, 125, 538, 537, 426, 0, 125, 242, 134, 429, 0, 0, 0, 0, 0, 254, 254, 140, 796, 0, 0, 0, 1026, 796, 0, 1007, 0, 0, 0, 0, 0, 794, 0, 32, 33, 34, 700, 0, 0, 738, 699, 742, 743, 744, 746, 0, 737, 123, 745, 1000, 1041, 0, 0, 0, 0, 19, 0, 20, 0, 101, 0, 0, 0, 112, 798, 0, 110, 105, 102, 107, 0, 305, 313, 310, 0, 0, 970, 975, 972, 971, 974, 973, 12, 1019, 1020, 0, 796, 0, 0, 0, 932, 929, 0, 551, 0, 567, 795, 553, 795, 576, 570, 573, 969, 968, 967, 0, 963, 0, 964, 966, 0, 5, 0, 0, 0, 599, 600, 608, 607, 0, 441, 0, 795, 546, 550, 0, 0, 986, 0, 528, 0, 0, 1008, 849, 284, 1046, 0, 0, 864, 0, 914, 795, 1003, 999, 300, 301, 698, 797, 297, 0, 849, 0, 0, 226, 525, 192, 500, 0, 584, 585, 0, 582, 795, 945, 0, 0, 298, 228, 0, 226, 0, 0, 224, 0, 924, 448, 0, 0, 861, 862, 879, 880, 909, 910, 0, 0, 0, 828, 803, 804, 805, 812, 0, 32, 33, 34, 0, 0, 816, 822, 823, 824, 814, 815, 834, 796, 0, 842, 943, 942, 0, 226, 0, 866, 720, 0, 264, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 234, 235, 246, 0, 125, 244, 160, 254, 0, 254, 0, 795, 0, 0, 0, 0, 795, 1027, 1029, 1006, 796, 1005, 0, 796, 767, 768, 765, 766, 802, 0, 796, 794, 560, 579, 579, 0, 549, 0, 0, 952, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1032, 180, 0, 183, 164, 0, 0, 108, 113, 114, 106, 797, 111, 0, 309, 0, 982, 152, 998, 1021, 1012, 1016, 227, 229, 319, 0, 0, 930, 0, 0, 556, 0, 962, 0, 17, 0, 985, 225, 319, 0, 0, 705, 543, 0, 710, 987, 0, 1008, 532, 0, 0, 1047, 0, 289, 287, 855, 867, 1000, 855, 868, 1002, 0, 0, 302, 122, 0, 849, 223, 0, 849, 0, 499, 949, 948, 0, 298, 0, 0, 0, 0, 0, 0, 226, 194, 721, 854, 298, 0, 808, 809, 810, 811, 817, 818, 832, 0, 796, 0, 828, 564, 581, 581, 0, 807, 836, 795, 839, 841, 843, 0, 937, 0, 854, 0, 0, 0, 0, 261, 539, 136, 0, 429, 234, 236, 932, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 0, 1033, 0, 1022, 0, 1025, 795, 0, 0, 0, 740, 795, 793, 0, 0, 796, 0, 0, 781, 796, 0, 784, 783, 0, 796, 0, 747, 785, 782, 956, 0, 796, 750, 752, 751, 0, 0, 748, 749, 753, 755, 754, 770, 769, 772, 771, 773, 775, 777, 776, 774, 763, 762, 757, 758, 756, 759, 760, 761, 764, 1031, 0, 125, 0, 0, 109, 21, 311, 0, 0, 0, 1013, 1018, 0, 393, 934, 932, 435, 440, 446, 558, 0, 0, 15, 0, 393, 611, 0, 0, 613, 606, 609, 0, 604, 0, 989, 0, 1009, 536, 0, 290, 0, 0, 285, 0, 304, 303, 1008, 0, 319, 0, 849, 0, 298, 0, 906, 319, 985, 319, 988, 0, 0, 0, 449, 0, 0, 820, 795, 827, 813, 0, 0, 796, 0, 0, 826, 796, 0, 806, 0, 0, 796, 833, 941, 319, 0, 125, 0, 257, 243, 0, 0, 0, 233, 156, 247, 0, 0, 250, 0, 255, 256, 125, 249, 1034, 1023, 0, 1004, 0, 1045, 801, 800, 739, 568, 795, 559, 0, 571, 795, 578, 574, 0, 795, 548, 741, 0, 583, 795, 951, 779, 0, 0, 0, 22, 23, 1015, 1010, 1011, 1014, 230, 0, 0, 0, 400, 391, 0, 0, 0, 205, 318, 320, 0, 390, 0, 0, 0, 985, 393, 0, 0, 555, 965, 315, 211, 602, 0, 0, 542, 530, 0, 293, 283, 0, 286, 292, 298, 522, 1008, 393, 1008, 0, 947, 0, 905, 393, 0, 393, 990, 319, 849, 903, 831, 830, 819, 569, 795, 563, 0, 572, 795, 580, 575, 0, 821, 795, 835, 393, 125, 263, 132, 137, 158, 237, 0, 245, 251, 125, 253, 1024, 0, 0, 0, 562, 780, 545, 0, 955, 954, 778, 125, 184, 1017, 0, 0, 0, 993, 0, 0, 0, 231, 0, 985, 0, 356, 352, 358, 700, 31, 0, 346, 0, 351, 355, 368, 0, 366, 371, 0, 370, 0, 369, 0, 188, 322, 0, 324, 0, 325, 326, 0, 0, 931, 557, 0, 603, 601, 612, 610, 294, 0, 0, 281, 291, 0, 0, 1008, 0, 201, 522, 1008, 907, 207, 315, 213, 393, 0, 0, 0, 566, 825, 838, 0, 209, 259, 0, 0, 125, 240, 157, 252, 1044, 799, 0, 0, 0, 0, 0, 0, 418, 0, 994, 0, 336, 340, 415, 416, 350, 0, 0, 0, 331, 664, 663, 660, 662, 661, 681, 683, 682, 652, 622, 624, 623, 642, 658, 657, 618, 629, 630, 632, 631, 651, 635, 633, 634, 636, 637, 638, 639, 640, 641, 643, 644, 645, 646, 647, 648, 650, 649, 619, 620, 621, 625, 626, 628, 666, 667, 676, 675, 674, 673, 672, 671, 659, 678, 668, 669, 670, 653, 654, 655, 656, 679, 680, 684, 686, 685, 687, 688, 665, 690, 689, 692, 694, 693, 627, 697, 695, 696, 691, 677, 617, 363, 614, 0, 332, 384, 385, 383, 376, 0, 377, 333, 410, 0, 0, 0, 0, 414, 0, 188, 197, 314, 0, 0, 0, 282, 296, 904, 0, 0, 386, 125, 191, 1008, 0, 0, 203, 1008, 829, 0, 0, 125, 238, 138, 159, 0, 561, 544, 953, 182, 334, 335, 413, 232, 0, 796, 796, 0, 359, 347, 0, 0, 0, 365, 367, 0, 0, 372, 379, 380, 378, 0, 0, 321, 995, 0, 0, 0, 417, 0, 316, 0, 295, 0, 597, 798, 125, 0, 0, 193, 199, 0, 565, 837, 0, 0, 161, 337, 115, 0, 338, 339, 0, 795, 0, 795, 361, 357, 362, 615, 616, 0, 348, 381, 382, 374, 375, 373, 411, 408, 1021, 327, 323, 412, 0, 317, 598, 797, 0, 0, 387, 125, 195, 0, 241, 0, 186, 0, 393, 0, 353, 360, 364, 0, 0, 849, 329, 0, 595, 521, 524, 0, 239, 0, 0, 162, 344, 0, 392, 354, 409, 996, 0, 798, 404, 849, 596, 526, 0, 185, 0, 0, 343, 1008, 849, 268, 405, 406, 407, 1047, 403, 0, 0, 0, 342, 0, 404, 0, 1008, 0, 341, 388, 125, 328, 1047, 0, 273, 271, 0, 125, 0, 0, 274, 0, 0, 269, 330, 0, 389, 0, 277, 267, 0, 270, 276, 181, 278, 0, 0, 265, 275, 0, 266, 280, 279 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 2, 4, 112, 909, 633, 180, 1523, 729, 351, 352, 353, 354, 862, 863, 864, 114, 115, 116, 117, 118, 408, 665, 666, 547, 254, 1592, 553, 1501, 1593, 1835, 851, 346, 576, 1795, 1097, 1290, 1854, 425, 181, 667, 949, 1163, 1350, 122, 636, 966, 668, 687, 970, 610, 965, 234, 528, 669, 637, 967, 427, 371, 391, 125, 951, 912, 887, 1115, 1526, 1219, 1025, 1742, 1596, 806, 1031, 552, 815, 1033, 1390, 798, 1014, 1017, 1208, 1861, 1862, 655, 656, 681, 682, 358, 359, 365, 1561, 1720, 1721, 1302, 1437, 1549, 1714, 1844, 1864, 1753, 1799, 1800, 1801, 1536, 1537, 1538, 1539, 1755, 1756, 1762, 1811, 1542, 1543, 1547, 1707, 1708, 1709, 1731, 1892, 1438, 1439, 182, 127, 1878, 1879, 1712, 1441, 1442, 1443, 1444, 128, 247, 548, 549, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 1573, 139, 948, 1162, 140, 652, 653, 654, 251, 400, 543, 642, 643, 1252, 644, 1253, 141, 142, 616, 617, 1242, 1243, 1359, 1360, 143, 839, 997, 144, 840, 998, 145, 841, 999, 619, 1245, 1362, 146, 842, 147, 148, 1784, 149, 638, 1563, 639, 1132, 917, 1321, 1318, 1700, 1701, 150, 151, 152, 237, 153, 238, 248, 412, 535, 154, 1053, 1247, 846, 155, 1054, 940, 587, 1055, 1000, 1185, 1001, 1187, 1364, 1188, 1189, 1003, 1368, 1369, 1004, 774, 518, 194, 195, 670, 658, 501, 1148, 1149, 760, 761, 936, 157, 240, 158, 159, 184, 161, 162, 163, 164, 165, 166, 167, 168, 169, 721, 244, 245, 613, 227, 228, 724, 725, 1258, 1259, 384, 385, 903, 170, 601, 171, 651, 172, 337, 1722, 1774, 372, 420, 676, 677, 1047, 1143, 1299, 883, 1300, 884, 885, 820, 821, 822, 338, 339, 848, 562, 1525, 934 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -1592 static const yytype_int16 yypact[] = { -1592, 170, -1592, -1592, 5612, 13612, 13612, -20, 13612, 13612, 13612, 11012, 13612, 13612, -1592, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 16749, 16749, 11212, 13612, 17357, 4, 7, -1592, -1592, -1592, 150, -1592, 176, -1592, -1592, -1592, 153, 13612, -1592, 7, 144, 174, 190, -1592, 7, 11412, 4337, 11612, -1592, 14655, 4941, 197, 13612, 3483, 62, -1592, -1592, -1592, 55, 47, 35, 202, 207, 227, 234, -1592, 4337, 240, 242, 177, 396, 405, -1592, -1592, -1592, -1592, -1592, 13612, 563, 712, -1592, -1592, 4337, -1592, -1592, -1592, -1592, 4337, -1592, 4337, -1592, 308, 285, 4337, 4337, -1592, 409, -1592, 11812, -1592, -1592, 430, 505, 520, 520, -1592, 488, 370, 557, 355, -1592, 81, -1592, 502, -1592, -1592, -1592, -1592, 2361, 589, -1592, -1592, 358, 364, 377, 385, 397, 407, 412, 425, 5116, -1592, -1592, -1592, -1592, 77, 534, 555, 560, -1592, 562, 585, -1592, 137, 470, -1592, 501, -3, -1592, 3081, 146, -1592, -1592, 2956, 86, 476, 91, -1592, 94, 169, 499, 201, -1592, -1592, 625, -1592, -1592, -1592, 540, 509, 544, -1592, 13612, -1592, 502, 589, 17840, 2977, 17840, 13612, 17840, 17840, 14013, 528, 16915, 14013, 17840, 680, 4337, 666, 666, 103, 666, 666, 666, 666, 666, 666, 666, 666, 666, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 60, 13612, 558, -1592, -1592, 587, 556, 401, 570, 401, 16749, 16963, 588, 747, -1592, 540, -1592, 13612, 558, -1592, 627, -1592, 647, 583, -1592, 152, -1592, -1592, -1592, 401, 86, 12012, -1592, -1592, 13612, 9012, 801, 90, 17840, 10012, -1592, 13612, 13612, 4337, -1592, -1592, 10996, 619, -1592, 11396, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 4401, -1592, 4401, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 88, 96, 544, -1592, -1592, -1592, -1592, 623, 1379, 99, -1592, -1592, 659, 806, -1592, 672, 15405, -1592, 636, 640, 11996, -1592, 12, 13596, 3547, 3547, 4337, 642, 827, 646, -1592, 64, -1592, 16345, 102, -1592, 714, -1592, 715, -1592, 833, 105, 16749, 13612, 13612, 660, 677, -1592, -1592, 16446, 11212, 13612, 13612, 13612, 107, 283, 275, -1592, 13812, 16749, 634, -1592, 4337, -1592, 218, 370, -1592, -1592, -1592, -1592, 17455, 844, 757, -1592, -1592, -1592, 58, 13612, 667, 669, 17840, 679, 2149, 682, 5812, 13612, -1592, 618, 661, 574, 618, 466, 485, -1592, 4337, 4401, 673, 10212, 14655, -1592, -1592, 2457, -1592, -1592, -1592, -1592, -1592, 502, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 13612, 13612, 13612, 13612, 12212, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 17553, 13612, -1592, 13612, 13612, 13612, 14012, 4337, 4337, 4337, 4337, 4337, 2361, 760, 960, 4735, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, 13612, -1592, -1592, -1592, -1592, 974, 13612, 13612, -1592, 10212, 10212, 13612, 13612, 16446, 686, 502, 12412, 13796, -1592, 13612, -1592, 691, 876, 731, 694, 696, 14157, 401, 12612, -1592, 12812, -1592, 583, 698, 700, 2177, -1592, 65, 10212, -1592, 1602, -1592, -1592, 15345, -1592, -1592, 10412, -1592, 13612, -1592, 802, 9212, 889, 704, 17719, 890, 121, 57, -1592, -1592, -1592, 724, -1592, -1592, -1592, 4401, -1592, 2782, 713, 896, 16244, 4337, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 720, -1592, -1592, 711, 721, 719, 723, 78, 4671, 4207, -1592, -1592, 4337, 4337, 13612, 401, 62, -1592, -1592, -1592, 16244, 843, -1592, 401, 122, 124, 716, 734, 2279, 147, 735, 736, 597, 807, 739, 401, 126, 740, 17019, 742, 934, 935, 745, 749, -1592, 2039, 4337, -1592, -1592, 881, 2441, 28, -1592, -1592, -1592, 370, -1592, -1592, -1592, 920, 821, 778, 365, 799, 13612, 824, 953, 770, 809, -1592, 154, -1592, 4401, 4401, 955, 801, 58, -1592, 781, 964, -1592, 4401, 69, -1592, 463, 164, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 1083, 2735, -1592, -1592, -1592, -1592, 966, 797, -1592, 16749, 13612, 784, 970, 17840, 967, -1592, -1592, 848, 3078, 11597, 17978, 14013, 14480, 13612, 17792, 14654, 12591, 12990, 13389, 12188, 14997, 15169, 15169, 15169, 15169, 2084, 2084, 2084, 2084, 2084, 1289, 1289, 768, 768, 768, 103, 103, 103, -1592, 666, 17840, 783, 787, 17067, 793, 975, 3, 13612, 212, 558, 319, -1592, -1592, -1592, 977, 757, -1592, 502, 16547, -1592, -1592, -1592, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, 14013, -1592, 13612, 352, -1592, 185, -1592, 558, 400, 795, 2807, 808, 810, 796, 3091, 127, 812, -1592, 17840, 5042, -1592, 4337, -1592, 69, 442, 16749, 17840, 16749, 17123, 848, 69, 401, 186, -1592, 154, 842, 813, 13612, -1592, 188, -1592, -1592, -1592, 8812, 564, -1592, -1592, 17840, 17840, 7, -1592, -1592, -1592, 13612, 899, 16123, 16244, 4337, 9412, 811, 817, -1592, 999, 922, 879, 858, -1592, 1008, 825, 3194, 4401, 16244, 16244, 16244, 16244, 16244, 829, 948, 958, 959, 873, 839, 16244, 448, 875, -1592, -1592, -1592, -1592, 838, -1592, 17934, -1592, 220, -1592, 6012, 4328, 841, 4207, -1592, 4207, -1592, 4337, 4337, 4207, 4207, 4337, -1592, 1029, 845, -1592, 104, -1592, -1592, 3492, -1592, 17934, 1026, 16749, 852, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 863, 1041, 4337, 4328, 855, 16446, 16648, 1046, -1592, 13012, -1592, 13612, -1592, 13612, -1592, -1592, -1592, -1592, -1592, -1592, 864, -1592, 13612, -1592, -1592, 5186, -1592, 4401, 4328, 872, -1592, -1592, -1592, -1592, 1056, 878, 13612, 17455, -1592, -1592, 14012, 880, -1592, 4401, -1592, 883, 6212, 1054, 44, -1592, -1592, 108, 974, -1592, 1602, -1592, 4401, -1592, -1592, 401, 17840, -1592, 10612, -1592, 16244, 54, 895, 4328, 821, -1592, -1592, 14654, 13612, -1592, -1592, 13612, -1592, 13612, -1592, 3900, 902, 10212, 807, 1057, 821, 4401, 1086, 848, 4337, 17553, 401, 3992, 909, -1592, -1592, 180, 910, -1592, -1592, 1087, 3204, 3204, 5042, -1592, -1592, -1592, 1052, 912, 1040, 1042, 1047, 266, 925, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 1113, 929, 691, 401, 401, 13212, 821, 1602, -1592, -1592, 4069, 576, 7, 10012, -1592, 6412, 930, 6612, 931, 16123, 16749, 936, 992, 401, 17934, 1116, -1592, -1592, -1592, -1592, 579, -1592, 367, 4401, 951, 998, 4401, 4337, 2782, -1592, -1592, -1592, 1127, -1592, 947, 966, 814, 814, 1076, 1076, 4206, 961, 1150, 16244, 16244, 16244, 16244, 15550, 17455, 1771, 15695, 16244, 16244, 16244, 16244, 16012, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 16244, 4337, -1592, -1592, 1077, -1592, -1592, 965, 968, -1592, -1592, -1592, 262, 4671, -1592, 969, -1592, 16244, 401, -1592, -1592, 101, -1592, 571, 1158, -1592, -1592, 132, 980, 401, 10812, 16749, 17840, 17171, -1592, 2217, -1592, 5412, 757, 1158, -1592, 210, -10, -1592, 17840, 1048, 984, -1592, 983, 1054, -1592, 4401, 801, 4401, 46, 1168, 1100, 189, -1592, 558, 238, -1592, -1592, 16749, 13612, 17840, 17934, 993, 54, -1592, 994, 54, 995, 14654, 17840, 17227, 996, 10212, 997, 1001, 4401, 1002, 1000, 4401, 821, -1592, 583, 445, 10212, 13612, -1592, -1592, -1592, -1592, -1592, -1592, 1058, 1010, 1183, 1109, 5042, 5042, 5042, 5042, 1053, -1592, 17455, 5042, -1592, -1592, -1592, 16749, 17840, 1005, -1592, 7, 1180, 1138, 10012, -1592, -1592, -1592, 1021, 13612, 992, 401, 16446, 16123, 1023, 16244, 6812, 674, 1031, 13612, 59, 494, -1592, 1038, -1592, 4401, -1592, 1096, -1592, 3538, 1203, 1043, 16244, -1592, 16244, -1592, 1050, 1036, 1231, 4620, 1045, 17934, 1232, 1063, -1592, -1592, 1106, 1239, 1072, -1592, -1592, -1592, 16317, 1060, 1258, 10192, 10592, 11192, 16244, 17888, 12791, 13190, 14152, 14823, 15396, 15543, 15543, 15543, 15543, 3026, 3026, 3026, 3026, 3026, 1170, 1170, 814, 814, 814, 1076, 1076, 1076, 1076, -1592, 1075, -1592, 1078, 1081, -1592, -1592, 17934, 4337, 4401, 4401, -1592, 571, 4328, 645, -1592, 16446, -1592, -1592, 14013, 401, 13412, 1074, -1592, 1088, 800, -1592, 191, 13612, -1592, -1592, -1592, 13612, -1592, 13612, -1592, 801, -1592, -1592, 145, 1268, 1200, 13612, -1592, 1092, 401, 17840, 1054, 1094, -1592, 1098, 54, 13612, 10212, 1099, -1592, -1592, 757, -1592, -1592, 1095, 1101, 1102, -1592, 1105, 5042, -1592, 5042, -1592, -1592, 1111, 1103, 1285, 1164, 1107, -1592, 1297, 1110, -1592, 1173, 1118, 1305, -1592, 401, -1592, 1281, -1592, 1121, -1592, -1592, 1124, 1128, 134, -1592, -1592, 17934, 1129, 1131, -1592, 4570, -1592, -1592, -1592, -1592, -1592, -1592, 4401, -1592, 4401, -1592, 17934, 17275, -1592, -1592, 16244, -1592, 16244, -1592, 16244, -1592, -1592, 16244, 17455, -1592, -1592, 16244, -1592, 16244, -1592, 12392, 16244, 1135, 7012, -1592, -1592, 571, -1592, -1592, -1592, -1592, 546, 14829, 4328, 1220, -1592, 2518, 1166, 3474, -1592, -1592, -1592, 760, 15936, 110, 111, 1152, 757, 960, 135, 16749, 17840, -1592, -1592, -1592, 1185, 4284, 4348, 17840, -1592, 70, 1335, 1267, 13612, -1592, 17840, 10212, 1245, 1054, 1247, 1054, 1162, 17840, 1169, -1592, 1304, 1177, 1854, -1592, -1592, 54, -1592, -1592, 1229, -1592, -1592, 5042, -1592, 5042, -1592, 5042, -1592, -1592, 5042, -1592, 17455, -1592, 1904, -1592, 8812, -1592, -1592, -1592, -1592, 9612, -1592, -1592, -1592, 8812, -1592, 1181, 16244, 17330, 17934, 17934, 17934, 1238, 17934, 17378, 12392, -1592, -1592, 571, 4328, 4328, 4337, -1592, 1362, 15840, 83, -1592, 14829, 757, 4066, -1592, 1201, -1592, 112, 1187, 114, -1592, 15178, -1592, -1592, -1592, 115, -1592, -1592, 2263, -1592, 1184, -1592, 1298, 502, -1592, 15004, -1592, 15004, -1592, -1592, 1370, 760, -1592, 401, 14307, -1592, -1592, -1592, -1592, 1371, 1303, 13612, -1592, 17840, 1193, 1195, 1054, 486, -1592, 1245, 1054, -1592, -1592, -1592, -1592, 1992, 1196, 5042, 1253, -1592, -1592, -1592, 1256, -1592, 8812, 9812, 9612, -1592, -1592, -1592, 8812, -1592, 17934, 16244, 16244, 16244, 7212, 1198, 1199, -1592, 16244, -1592, 4328, -1592, -1592, -1592, -1592, -1592, 4401, 1320, 2518, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 347, -1592, 1166, -1592, -1592, -1592, -1592, -1592, 79, 372, -1592, 1381, 116, 15405, 1298, 1382, -1592, 4401, 502, -1592, -1592, 1206, 1388, 13612, -1592, 17840, -1592, 129, 1207, -1592, -1592, -1592, 1054, 486, 14481, -1592, 1054, -1592, 5042, 5042, -1592, -1592, -1592, -1592, 7412, 17934, 17934, 17934, -1592, -1592, -1592, 17934, -1592, 1090, 1395, 1396, 1209, -1592, -1592, 16244, 15178, 15178, 1348, -1592, 2263, 2263, 474, -1592, -1592, -1592, 16244, 1325, -1592, 1230, 1221, 117, 16244, -1592, 4337, -1592, 16244, 17840, 1339, -1592, 1421, -1592, 7612, 1237, -1592, -1592, 486, -1592, -1592, 7812, 1242, 1319, -1592, 1337, 1282, -1592, -1592, 1340, 4401, 1261, 1320, -1592, -1592, 17934, -1592, -1592, 1273, -1592, 1409, -1592, -1592, -1592, -1592, 17934, 1433, 597, -1592, -1592, 17934, 1255, 17934, -1592, 138, 1259, 8012, -1592, -1592, -1592, 1254, -1592, 1257, 1278, 4337, 960, 1276, -1592, -1592, -1592, 16244, 1279, 63, -1592, 1378, -1592, -1592, -1592, 8212, -1592, 4328, 841, -1592, 1295, 4337, 675, -1592, 17934, -1592, 1277, 1453, 663, 63, -1592, -1592, 1390, -1592, 4328, 1280, -1592, 1054, 68, -1592, -1592, -1592, -1592, 4401, -1592, 1283, 1284, 119, -1592, 565, 663, 160, 1054, 1287, -1592, -1592, -1592, -1592, 4401, 92, 1462, 1401, 565, -1592, 8412, 163, 1465, 1402, 13612, -1592, -1592, 8612, -1592, 292, 1472, 1404, 13612, -1592, 17840, -1592, 1478, 1412, 13612, -1592, 17840, 13612, -1592, 17840, 17840 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -1592, -1592, -1592, -558, -1592, -1592, -1592, 136, 48, -54, 341, -1592, -263, -514, -1592, -1592, 392, 233, 1498, -1592, 2755, -1592, -242, -1592, 38, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -356, -1592, -1592, -159, 161, 19, -1592, -1592, -1592, -1592, -1592, -1592, 29, -1592, -1592, -1592, -1592, -1592, -1592, 30, -1592, -1592, 1019, 1027, 1024, -99, -701, -871, 539, 595, -359, 298, -944, -1592, -77, -1592, -1592, -1592, -1592, -733, 140, -1592, -1592, -1592, -1592, -342, -1592, -612, -1592, -439, -1592, -1592, 937, -1592, -57, -1592, -1592, -1069, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -93, -1592, -2, -1592, -1592, -1592, -1592, -1592, -171, -1592, 97, -1023, -1592, -1591, -364, -1592, -124, 133, -117, -351, -1592, -179, -1592, -1592, -1592, 106, -22, 5, 25, -720, -69, -1592, -1592, 20, -1592, -12, -1592, -1592, -5, -45, -40, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -578, -859, -1592, -1592, -1592, -1592, -1592, 1866, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, 1163, 487, 356, -1592, -1592, -1592, -1592, -1592, 419, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -1592, -988, -1592, 2370, 37, -1592, 908, -405, -1592, -1592, -478, 3627, 2669, -1592, -1592, -1592, 496, -9, -629, -1592, -1592, 573, 368, -460, -1592, 369, -1592, -1592, -1592, -1592, -1592, 550, -1592, -1592, -1592, 118, -903, -30, -442, -438, -1592, 626, -113, -1592, -1592, 39, 42, 489, -1592, -1592, 297, -21, -1592, -357, 27, -365, 51, -294, -1592, -1592, -465, 1190, -1592, -1592, -1592, -1592, -1592, 717, 683, -1592, -1592, -1592, -354, -700, -1592, 1144, -1323, -1592, -70, -187, -23, 744, -1592, -1039, -1224, -251, 151, -1592, 457, 529, -1592, -1592, -1592, -1592, 483, -1592, 1791, -1101 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1031 static const yytype_int16 yytable[] = { 183, 185, 335, 187, 188, 189, 191, 192, 193, 432, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 510, 121, 226, 229, 392, 932, 1144, 647, 395, 396, 482, 123, 124, 969, 403, 646, 250, 253, 648, 928, 119, 1327, 769, 343, 532, 261, 504, 264, 783, 255, 344, 946, 347, 428, 259, 481, 243, 758, 405, 1136, 1313, 759, 718, 432, 765, 766, 236, 252, 241, 861, 866, 242, 927, 908, 1426, 342, 1215, 253, 1161, 1035, 1009, 402, 407, 581, 583, 1021, 1764, 813, 422, 1388, 1609, 14, 793, 790, 1172, -71, 794, 544, 404, 1324, -71, 14, 334, -36, 1524, 14, -35, 378, -36, 593, 14, -35, 598, 1765, 544, 14, 364, 1552, 1554, -349, 156, 1617, 1702, 1771, 1771, 577, 1609, 1328, 811, 872, 537, 544, 405, 889, 889, 126, 1204, 502, 113, 889, 1788, 889, 889, 356, 1145, -586, 209, 40, 519, 881, 882, 1566, 1319, -702, 502, 402, 407, 410, 469, -591, 499, 500, -883, 120, 589, 1782, 788, 362, 3, 521, 470, 186, 404, 1901, 1846, 363, 360, 722, 856, 513, -99, 1457, -533, 361, 1320, 530, 578, 262, -895, 1146, 333, -703, 520, 407, -99, 246, 1894, 1831, 249, 1908, 1251, 499, 500, 1612, 589, -882, 763, 370, 529, 404, 1783, 767, 536, 381, -885, -591, 1329, 527, -594, 1847, -925, -592, 507, 907, 590, 404, 1458, 1715, 390, 1716, 370, 1105, -889, -797, 370, 370, -797, -884, 857, 539, 1567, 1895, 539, 1452, 1909, 375, -288, -288, -888, 253, 550, 814, 1389, -886, -928, -272, -927, -869, 357, 370, -797, 108, 1902, 503, 418, 561, 1466, 1175, -894, 507, 688, 1766, 1381, 1472, 423, 1474, 1610, 1611, 1147, -795, 503, -71, 506, 545, 572, 431, 541, 483, -883, -36, 546, 355, -35, 1426, 1464, 594, 797, 1222, 599, 1226, 621, 1494, 1349, 1553, 1555, -349, -870, 1618, 1703, 1772, 1821, 1002, 1889, 812, 873, 1459, 874, 388, 890, 982, 389, 604, 223, 223, 1303, -709, 1500, 1559, -893, 517, 1896, -882, 849, 1910, 1158, 256, 1367, -892, 506, 878, -885, 511, 1101, 1102, 603, 607, -925, 623, 508, 1128, 770, 622, 393, 686, 1195, -896, 379, -704, -889, 1759, 253, 404, 856, -884, 432, 257, 335, 226, 615, 253, 253, -899, 1314, 1915, -888, 627, 1092, 1760, 418, -886, -928, 258, -927, -869, 113, 1315, 334, -890, 113, -98, 602, 345, 551, 366, 191, 508, 1761, 419, 367, 618, 618, 1767, 671, -98, 1316, 1582, 392, 734, 735, 428, 929, 634, 635, 739, 683, 499, 500, 914, 368, 1196, 1768, 1118, 418, 1769, 1574, 369, 1576, 1312, 624, 382, 383, 373, -870, 374, 689, 690, 691, 692, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 1916, 719, 376, 720, 720, 723, 334, 393, 741, 1224, 1225, 377, 571, -710, 394, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 397, 160, 1378, 1151, 243, 720, 764, 1152, 683, 683, 720, 768, 740, 1814, 236, 742, 241, 776, 772, 242, 964, 209, 40, -890, 222, 224, 657, 780, 417, 782, 223, 728, 1815, 1169, 730, 1816, 915, 683, 800, -857, 418, -593, 1728, 499, 500, 801, 1733, 802, 424, 126, 963, 916, 113, -857, 482, 1336, 421, 379, 1338, 1513, 762, 433, 675, 647, 629, 1018, 333, 434, 787, 370, 1020, 646, 1227, 1326, 648, 1177, 379, 120, 334, 481, 435, 730, 975, 629, 499, 500, 971, -860, 436, 355, 355, 584, 789, 805, 868, 795, 379, 1098, 861, 1099, 437, -860, 406, 411, 918, 499, 500, 398, 1224, 1225, 438, 379, -587, 399, -1000, 439, 895, 897, 414, 571, 370, 732, 370, 370, 370, 370, 953, 632, 440, -705, 382, 383, -858, -588, 409, 419, 108, 935, -589, 937, 472, 1589, 921, -897, 404, 757, -858, 1015, 1016, 382, 383, 737, -1000, 1473, 379, 881, 882, 1428, 532, 1206, 1207, 380, 223, 473, -897, 379, 571, 475, 1093, 382, 383, 223, 629, 606, 474, 673, 406, 505, 223, 1011, 792, 1297, 1298, 943, 382, 383, 1520, 1521, 223, 1729, 1730, 113, 1223, 1224, 1225, 674, 954, 580, 582, 1391, -891, 1787, 14, -590, 647, 1790, -703, 1351, 55, 379, 509, 847, 646, 406, 386, 648, 62, 63, 64, 173, 174, 429, 523, -1000, 961, 379, 381, 382, 383, 531, 962, 514, 629, 867, 675, 1468, 516, 1342, 382, 383, 1361, 1363, 1363, 470, 419, 419, 1370, 160, 1352, 1812, 1813, 160, 1557, 522, 1456, 935, 937, -895, -1000, 974, 1380, -1000, 1010, 937, 526, 1429, 902, 904, 1890, 1891, 1430, 506, 62, 63, 64, 173, 1431, 429, 1432, 657, 1808, 1809, 382, 383, 534, 1886, 430, 1385, 1224, 1225, 1875, 1876, 1877, -701, 1013, 1221, 525, 630, 382, 383, 1900, 208, 62, 63, 64, 173, 174, 429, 1045, 1048, 253, 483, 1428, 533, 223, 1037, 1019, 542, 1433, 1434, 1042, 1435, 555, 50, 563, -1030, 865, 865, 566, 466, 467, 468, 370, 469, 413, 415, 416, 1613, 567, 573, 647, 1884, 430, 574, 586, 470, 585, 1446, 646, 588, 1436, 648, 595, 596, 592, 597, 1897, 14, 1030, 212, 213, 214, 608, 600, 609, 605, 649, 650, 672, 659, 612, 660, 430, 1583, -120, 1088, 1089, 1090, 1871, 55, 628, 661, 386, 1113, 663, 91, 92, 685, 93, 178, 95, 1091, 773, 775, 624, 1123, 777, 1124, 778, 802, 784, 1479, 785, 1480, 803, 160, 544, 807, 1126, 1176, 1470, 561, 810, 824, 823, 852, 387, 996, 875, 1005, 1429, 850, 1135, 854, 853, 1430, 855, 62, 63, 64, 173, 1431, 429, 1432, 871, 121, 876, 879, 126, 880, 888, 113, 891, 220, 220, 123, 124, 886, 1156, 1863, 893, 894, 896, 898, 119, 1028, 113, 899, 1164, 905, 910, 1165, 911, 1166, 913, -725, 120, 683, 919, 1863, 920, 1332, 922, 1433, 1434, 923, 1435, 926, 1885, 728, 930, 931, 1137, 939, 223, 941, 944, 945, 950, 947, 126, 956, 960, 113, 762, 957, 795, 430, 959, 968, 1100, 675, 1199, 976, 980, 1451, 612, 243, -707, 1022, 978, 1203, 979, 952, 1032, 1012, 1036, 236, 120, 241, 1034, 1038, 242, 1039, 1040, 1041, 1057, 1043, 1209, 1114, 1056, 1585, 1571, 1586, 156, 1587, 1058, 1059, 1588, 1060, 1061, 1063, 1064, 223, 160, 1096, 1104, 1236, 1108, 126, 1106, 1111, 113, 647, 1240, 1110, 1420, 657, 1112, 1117, 1305, 646, 1210, 208, 648, 209, 40, 571, 1121, 795, 126, 625, 1125, 113, 657, 631, 1131, 120, 1133, 757, 1134, 792, 1140, 1138, 223, 50, 223, 62, 63, 64, 173, 174, 429, 865, 1142, 865, 1159, 1171, 120, 865, 865, 1103, 625, 1168, 631, 625, 631, 631, 1174, 1180, 1179, -898, 1190, 1191, 223, 370, 1250, 1306, 1192, 1256, 1193, 212, 213, 214, 1307, 1194, 1197, 1184, 1184, 996, 1198, 1200, 1737, 1212, 1214, 647, 1218, 1217, 1220, 1229, 1496, 220, 1230, 646, 1234, 755, 648, 91, 92, 1235, 93, 178, 95, 1091, 792, 121, 1505, 430, 1334, 126, 113, 126, 113, 1827, 113, 123, 124, 1239, 1289, 1238, 1291, 683, 1294, 1292, 119, 1301, 942, 223, 756, 208, 108, 1304, 683, 1307, 1232, 964, 1323, 120, 1356, 120, 1330, 1331, 1322, 223, 223, 1335, 1339, 1341, 1337, 1343, 1355, 50, 1353, 1347, 571, 1344, 1346, 571, 989, 1372, 62, 63, 64, 65, 66, 429, 1366, 253, 1354, 1373, 1374, 72, 476, 1375, 1377, 1382, 1392, 1387, 1085, 1086, 1087, 1088, 1089, 1090, 1386, 973, 847, 212, 213, 214, 1394, 1874, 1403, 1396, 1401, 1397, 1407, 1091, 1402, 1406, 1409, 1411, 1400, 1405, 156, 1376, 1410, 177, 1416, 1428, 89, 1591, 478, 91, 92, 1414, 93, 178, 95, 126, 1597, 1408, 113, 220, 1412, 1415, 1006, 1419, 1007, 1449, 430, 1421, 220, 1603, 1422, 657, 1791, 1792, 657, 220, 1460, 1461, 1450, 1463, 160, 1796, 1465, 120, 1475, 220, 1467, 1471, 1483, 1477, 14, 1476, 1026, 1478, 1485, 160, 645, 1482, 1448, 1481, 1487, 1486, 1428, 1490, 1489, 1453, 1491, 1495, 1492, 1454, 1497, 1455, 1498, 223, 223, 1558, 1499, 432, 1502, 1462, 1503, 996, 996, 996, 996, 1517, 1528, 1541, 996, 1469, 683, 865, 160, 463, 464, 465, 466, 467, 468, 113, 469, 1556, 1562, 1568, 1569, 1484, 1744, 14, 126, 1488, 1577, 113, 470, 1429, 1493, 1109, 1572, 1578, 1430, 1584, 62, 63, 64, 173, 1431, 429, 1432, 1580, 1601, 1598, 1607, 612, 1120, 1710, 1615, 1711, 120, 1616, 1717, 1723, 1724, 1726, 1727, 1738, 1736, 1713, 1739, 1749, 1750, 1770, 1776, 160, 34, 35, 36, 1779, 1780, 1785, 1802, 1804, 1806, 1810, 1818, 1819, 275, 210, 1433, 1434, 1820, 1435, 1429, 220, 160, 223, 1445, 1430, 1825, 62, 63, 64, 173, 1431, 429, 1432, 1826, 1445, 1423, 1830, 1834, 1440, 430, 1833, 277, -345, 1836, 1839, 1837, 1841, 1575, 1765, 1440, 1842, 1845, 1851, 1852, 223, 1606, 1848, 1853, 1570, 1858, 657, 683, 1860, 208, 1865, 1873, 79, 80, 81, 82, 83, 1869, 1433, 1434, 1872, 1435, 1881, 215, 1883, 1903, 1887, 1888, 1911, 87, 88, 50, 1898, 1904, 1912, 1917, 1918, 1786, 996, 564, 996, 1920, 430, 97, 1921, 1293, 1868, 1793, 223, 736, 1579, 733, 731, 1170, 160, 1130, 160, 102, 160, 1882, 1026, 1216, 1379, 223, 223, 1743, 557, 212, 213, 214, 558, 1880, 1734, 1758, 217, 217, 1504, 1614, 233, 869, 1763, 1548, 1905, 1893, 1775, 1732, 1529, 177, 1595, 620, 89, 327, 1828, 91, 92, 1248, 93, 178, 95, 1365, 1317, 1241, 126, 233, 1201, 113, 1186, 1357, 1778, 1358, 1150, 331, 1725, 614, 333, 684, 1046, 1843, 1296, 1233, 1546, 332, 1608, 1519, 1288, 0, 0, 483, 0, 0, 120, 0, 0, 1445, 0, 0, 220, 1850, 0, 1445, 0, 1445, 0, 0, 657, 0, 0, 0, 1440, 1550, 223, 0, 0, 0, 1440, 0, 1440, 0, 0, 0, 1308, 1445, 0, 0, 0, 0, 160, 0, 996, 0, 996, 0, 996, 0, 0, 996, 1440, 0, 126, 1741, 1595, 113, 0, 0, 0, 0, 113, 126, 0, 0, 113, 0, 1333, 0, 0, 220, 0, 0, 1899, 0, 0, 0, 0, 0, 0, 1906, 120, 370, 1773, 0, 571, 0, 0, 333, 0, 120, 0, 0, 0, 0, 0, 0, 0, 1699, 0, 0, 0, 0, 0, 0, 1706, 0, 208, 0, 209, 40, 220, 333, 220, 333, 1371, 0, 0, 0, 0, 0, 333, 160, 0, 1445, 0, 0, 0, 0, 50, 612, 1026, 1823, 0, 160, 0, 0, 1856, 0, 1440, 0, 220, 1781, 1718, 996, 0, 0, 217, 126, 0, 0, 113, 113, 113, 126, 0, 0, 113, 0, 0, 126, 0, 0, 113, 432, 212, 213, 214, 223, 1803, 1805, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 120, 0, 0, 334, 0, 0, 120, 755, 0, 91, 92, 0, 93, 178, 95, 233, 0, 233, 0, 0, 0, 0, 220, 1065, 1066, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 612, 0, 0, 220, 220, 791, 0, 108, 0, 1068, 0, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 645, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 340, 0, 571, 0, 0, 0, 0, 0, 217, 0, 0, 1428, 0, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 333, 217, 0, 0, 996, 996, 0, 126, 0, 0, 113, 217, 0, 0, 0, 0, 0, 0, 0, 1797, 0, 0, 233, 218, 218, 0, 1699, 1699, 1913, 0, 1706, 1706, 0, 14, 0, 120, 1919, 0, 1428, 160, 0, 0, 1922, 0, 370, 1923, 0, 233, 0, 126, 233, 0, 113, 0, 0, 0, 126, 0, 0, 113, 220, 220, 0, 0, 0, 0, 1560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 14, 120, 0, 0, 0, 0, 0, 0, 126, 657, 0, 113, 1254, 1429, 233, 0, 645, 1857, 1430, 1855, 62, 63, 64, 173, 1431, 429, 1432, 0, 0, 657, 126, 0, 160, 113, 0, 0, 120, 160, 657, 1870, 0, 160, 0, 1428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 120, 0, 0, 0, 0, 1429, 0, 0, 1433, 1434, 1430, 1435, 62, 63, 64, 173, 1431, 429, 1432, 220, 0, 126, 0, 0, 113, 0, 0, 0, 126, 0, 14, 113, 430, 0, 0, 0, 0, 0, 0, 0, 1581, 0, 0, 0, 0, 0, 0, 0, 233, 120, 233, 220, 0, 837, 0, 559, 120, 560, 1433, 1434, 0, 1435, 0, 0, 0, 0, 0, 0, 0, 160, 160, 160, 0, 0, 0, 160, 0, 0, 0, 0, 218, 160, 430, 0, 837, 0, 0, 0, 0, 0, 1590, 0, 0, 1429, 645, 0, 0, 0, 1430, 220, 62, 63, 64, 173, 1431, 429, 1432, 0, 0, 208, 0, 900, 565, 901, 220, 220, -1031, -1031, -1031, -1031, -1031, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 50, 0, 0, 0, 0, 233, 233, 0, 0, 0, 0, 470, 0, 0, 233, 1433, 1434, 0, 1435, 0, 0, 512, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 0, 217, 212, 213, 214, 430, 0, 0, 0, 0, 0, 0, 0, 1735, 0, 512, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 91, 92, 0, 93, 178, 95, 678, 0, 220, 340, 0, 0, 497, 498, 0, 0, 0, 0, 0, 218, 0, 0, 0, 441, 442, 443, 0, 0, 218, 160, 0, 0, 217, 0, 0, 218, 0, 0, 0, 0, 497, 498, 0, 444, 445, 218, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 160, 0, 217, 0, 217, 0, 0, 160, 499, 500, 0, 470, 0, 0, 0, 0, 0, 0, 512, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 0, 217, 837, 0, 0, 499, 500, 0, 0, 0, 0, 160, 645, 0, 0, 233, 233, 837, 837, 837, 837, 837, 0, 0, 0, 0, 0, 0, 837, 0, 0, 0, 0, 160, 0, 0, 0, 662, 208, 0, 497, 498, 233, 0, 0, 0, 816, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 217, 786, 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 217, 217, 160, 0, 0, 0, 0, 0, 0, 160, 0, 219, 219, 0, 645, 235, 212, 213, 214, 0, 0, 0, 233, 233, 0, 0, 0, 499, 500, 0, 0, 1310, 233, 0, 0, 0, 0, 0, 233, 0, 1704, 0, 91, 92, 1705, 93, 178, 95, 0, 0, 0, 233, 0, 0, 924, 925, 208, 0, 0, 837, 0, 0, 233, 933, 0, 441, 442, 443, 0, 0, 1545, 0, 0, 0, 0, 0, 0, 0, 50, 0, 233, 0, 0, 0, 233, 444, 445, 877, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 217, 0, 0, 426, 0, 91, 92, 0, 93, 178, 95, 0, 0, 233, 0, 0, 233, 208, 233, 0, 0, 0, 0, 0, 218, 0, 0, 0, 1530, 0, 0, 0, 0, 837, 837, 837, 837, 0, 233, 50, 0, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 0, 0, 0, 0, 0, 219, 212, 213, 214, 208, 0, 0, 0, 0, 218, 0, 837, 0, 0, 0, 0, 0, 0, 0, 678, 678, 0, 0, 0, 0, 217, 50, 91, 92, 0, 93, 178, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 906, 0, 233, 0, 233, 1531, 0, 218, 0, 218, 0, 0, 685, 0, 217, 0, 0, 0, 1532, 212, 213, 214, 1533, 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 233, 0, 0, 218, 0, 177, 0, 0, 89, 1534, 0, 91, 92, 0, 93, 1535, 95, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 217, 1129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 217, 1139, 837, 0, 0, 0, 0, 0, 0, 0, 0, 219, 233, 0, 1153, 0, 233, 0, 0, 837, 219, 837, 218, 0, 0, 0, 0, 219, 0, 441, 442, 443, 0, 0, 0, 0, 0, 219, 218, 218, 0, 0, 0, 1173, 0, 837, 0, 0, 219, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 233, 233, 0, 0, 233, 0, 0, 217, 0, 470, 0, 0, 0, 0, 0, 0, 336, 0, 817, 0, 0, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 1228, 0, 0, 1231, 0, 0, 0, 0, 0, 0, 444, 445, 235, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 208, 469, 0, 0, 0, 0, 0, 0, 0, 0, 818, 0, 0, 470, 0, 0, 219, 0, 0, 0, 0, 0, 50, 0, 0, 218, 218, 0, 0, 233, 0, 233, 0, 0, 0, 0, 0, 837, 0, 837, 0, 837, 0, 0, 837, 233, 0, 0, 837, 0, 837, 0, 0, 837, 0, 0, 0, 0, 212, 213, 214, 0, 0, 0, 233, 233, 0, 0, 233, 938, 1325, 0, 933, 843, 0, 233, 0, 0, 177, 0, 0, 89, 217, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1345, 0, 0, 1348, 0, 843, 0, 0, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 0, 0, 0, 0, 0, 218, 0, 233, 512, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 977, 0, 837, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 233, 218, 1393, 0, 497, 498, 1153, 233, 0, 233, 0, 336, 0, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 497, 498, 0, 0, 0, 219, 233, 0, 233, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 218, -1031, -1031, -1031, -1031, -1031, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 218, 218, 0, 0, 336, 1424, 1425, 499, 500, 0, 0, 0, 1091, 0, 0, 837, 837, 837, 441, 442, 443, 0, 837, 0, 233, 219, 0, 0, 499, 500, 233, 0, 233, 0, 0, 0, 0, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 219, 0, 219, 0, 0, 0, 0, 0, 0, 0, 208, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, 336, 0, 0, 336, 0, 219, 843, 50, 0, 0, 0, 1506, 0, 1507, 0, 0, 0, 0, 0, 0, 0, 843, 843, 843, 843, 843, 62, 63, 64, 65, 66, 429, 843, 0, 0, 0, 0, 72, 476, 0, 0, 233, 0, 212, 213, 214, 1095, 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, 1551, 233, 0, 0, 845, 0, 0, 0, 0, 0, 0, 219, 91, 92, 0, 93, 178, 95, 0, 477, 233, 478, 277, 0, 0, 1116, 837, 219, 219, 0, 0, 0, 0, 0, 479, 870, 480, 837, 0, 430, 952, 0, 0, 837, 208, 0, 0, 837, 0, 0, 1116, 1181, 1182, 1183, 208, 0, 0, 981, 0, 219, 0, 0, 0, 0, 0, 0, 50, 0, 0, 233, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 218, 0, 0, 336, 843, 819, 0, 1160, 838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 557, 212, 213, 214, 558, 0, 0, 0, 837, 0, 235, 212, 213, 214, 0, 0, 0, 0, 233, 0, 838, 177, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 0, 1044, 233, 0, 91, 92, 0, 93, 178, 95, 0, 233, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, 0, 233, 219, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 336, 336, 1754, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843, 843, 843, 843, 0, 219, 0, 0, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 0, 1049, 1050, 1051, 1052, 0, 0, 0, 0, 441, 442, 443, 1062, 0, 0, 1777, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 219, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 470, 0, 0, 208, 838, 0, 219, 0, 275, 0, 0, 219, 0, 0, 0, 0, 50, 336, 336, 838, 838, 838, 838, 838, 0, 50, 219, 219, 0, 843, 838, 0, 1838, 348, 349, 0, 277, 0, 0, 0, 0, 1544, 0, 0, 0, 0, 843, 0, 843, 0, 0, 0, 212, 213, 214, 1157, 0, 0, 208, 0, 0, 212, 213, 214, 0, 0, 0, 208, 0, 0, 0, 0, 843, 0, 0, 0, 0, 0, 91, 92, 50, 93, 178, 95, 350, 0, 0, 91, 92, 50, 93, 178, 95, 221, 221, 0, 0, 239, 0, 0, 0, 0, 0, 0, 336, 0, 1545, 0, 933, 0, 1427, 0, 0, 219, 0, 557, 212, 213, 214, 558, 336, 0, 0, 933, 0, 212, 213, 214, 1107, 0, 0, 0, 0, 336, 0, 0, 177, 0, 0, 89, 327, 838, 91, 92, 0, 93, 178, 95, 350, 1395, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 331, 0, 336, 0, 0, 1244, 1246, 1246, 0, 0, 332, 0, 1257, 1260, 1261, 1262, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843, 0, 843, 0, 843, 1295, 0, 843, 219, 0, 0, 843, 0, 843, 0, 0, 843, 0, 0, 336, 0, 0, 336, 0, 819, 0, 0, 0, 1527, 0, 0, 1540, 0, 0, 0, 0, 0, 0, 0, 838, 838, 838, 838, 0, 0, 219, 0, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 838, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1383, 1604, 1605, 0, 0, 0, 0, 0, 336, 0, 336, 1540, 0, 0, 0, 0, 0, 1398, 0, 1399, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 336, 0, 0, 336, 444, 445, 1417, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 843, 843, 843, 0, 0, 838, 0, 843, 0, 1752, 0, 0, 0, 0, 221, 336, 0, 1540, 0, 336, 0, 0, 838, 221, 838, 0, 0, 0, 0, 0, 221, 0, 441, 442, 443, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 838, 0, 0, 239, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 336, 336, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1509, 0, 1510, 0, 1511, 0, 0, 1512, 441, 442, 443, 1514, 0, 1515, 0, 0, 1516, 0, 0, 0, 0, 0, 0, 0, 0, 239, 1167, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 843, 0, 0, 0, 0, 0, 0, 221, 0, 470, 0, 843, 0, 0, 0, 0, 0, 843, 208, 0, 336, 843, 336, 0, 0, 0, 0, 0, 838, 0, 838, 0, 838, 0, 0, 838, 0, 0, 0, 838, 50, 838, 0, 0, 838, 0, 0, 0, 1599, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 1178, 0, 1531, 0, 844, 0, 336, 0, 0, 0, 0, 0, 0, 0, 0, 1532, 212, 213, 214, 1533, 0, 0, 0, 843, 0, 0, 0, 1065, 1066, 1067, 0, 0, 0, 1867, 0, 844, 177, 0, 0, 89, 90, 0, 91, 92, 0, 93, 1535, 95, 1068, 0, 1527, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 838, 0, 0, 1205, 0, 0, 1745, 1746, 1747, 0, 0, 0, 1091, 1751, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 336, 0, 336, 50, 0, 0, 0, 444, 445, 336, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 1237, 0, 0, 0, 212, 213, 214, 0, 0, 0, 0, 470, 0, 838, 838, 838, 441, 442, 443, 0, 838, 0, 0, 221, 0, 0, 0, 860, 336, 0, 91, 92, 0, 93, 178, 95, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 221, 0, 221, 208, 0, 0, 0, 0, 0, 0, 0, 470, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1807, 0, 0, 50, 275, 0, 0, 0, 221, 844, 0, 1817, 50, 0, 0, 0, 0, 1822, 0, 0, 0, 1824, 0, 0, 844, 844, 844, 844, 844, 0, 0, 0, 277, 0, 0, 844, 0, 0, 0, 212, 213, 214, 0, 0, 336, 0, 0, 0, 212, 213, 214, 0, 0, 1564, 208, 0, 0, 0, 0, 177, 0, 336, 89, 90, 0, 91, 92, 0, 93, 178, 95, 221, 0, 0, 91, 92, 50, 93, 178, 95, 1798, 0, 0, 1859, 0, 0, 838, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 838, 0, 0, 0, 0, 0, 838, 0, 0, 0, 838, 0, 0, 0, 557, 212, 213, 214, 558, 0, 1565, 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 336, 0, 0, 177, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 0, 0, 844, 0, 0, 0, 0, 0, 441, 442, 443, 0, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, 838, 0, 239, 444, 445, 1388, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 1065, 1066, 1067, 336, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 336, 221, 221, 1068, 0, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 844, 844, 844, 844, 0, 239, 1091, 0, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 844, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 221, 0, 0, 208, 0, 0, 0, 1404, 0, 0, 0, 0, 0, 401, 12, 13, 1389, 0, 0, 0, 0, 0, 0, 0, 738, 50, 0, 0, 0, 0, 0, 0, 221, 858, 859, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 212, 213, 214, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 239, 0, 43, 0, 0, 221, 0, 0, 0, 860, 0, 0, 91, 92, 50, 93, 178, 95, 0, 0, 221, 221, 55, 844, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 844, 0, 844, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 844, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 0, 221, 0, 108, 109, 0, 110, 111, 0, 0, 0, 0, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 844, 0, 844, 43, 844, 0, 0, 844, 239, 0, 0, 844, 0, 844, 0, 50, 844, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 221, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 983, 984, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 985, 0, 0, 97, 0, 0, 98, 239, 986, 987, 988, 208, 99, 0, 441, 442, 443, 102, 103, 104, 0, 989, 179, 844, 341, 0, 0, 108, 109, 0, 110, 111, 0, 50, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 990, 991, 992, 993, 0, 470, 0, 0, 0, 5, 6, 7, 8, 9, 0, 0, 994, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 995, 0, 844, 844, 844, 0, 0, 0, 0, 844, 14, 15, 16, 0, 0, 0, 0, 17, 1757, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 0, 59, 60, 61, 62, 63, 64, 65, 66, 67, 471, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 86, 87, 88, 89, 90, 0, 91, 92, 0, 93, 94, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 100, 0, 101, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1127, 108, 109, 844, 110, 111, 0, 0, 0, 0, 0, 0, 0, 0, 844, 0, 0, 0, 0, 0, 844, 0, 0, 0, 844, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1840, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 844, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 0, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 86, 87, 88, 89, 90, 0, 91, 92, 0, 93, 94, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 100, 0, 101, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1311, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 0, 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 86, 87, 88, 89, 90, 0, 91, 92, 0, 93, 94, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 100, 0, 101, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 664, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1094, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1141, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1211, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 1213, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 1384, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1518, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1748, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 1794, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1829, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 1832, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1849, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1866, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1907, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 1914, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 65, 66, 67, 0, 68, 69, 70, 0, 72, 73, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 96, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 1029, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 1594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 1740, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, 0, 0, 0, 43, 44, 45, 46, 0, 47, 0, 48, 0, 49, 0, 0, 50, 51, 0, 0, 0, 52, 53, 54, 55, 0, 57, 58, 0, 59, 0, 61, 62, 63, 64, 173, 174, 67, 0, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 84, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 1066, 1067, 105, 0, 106, 107, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 1068, 0, 10, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 680, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 1067, 179, 0, 0, 799, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 1068, 0, 10, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 1154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 1155, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 401, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 441, 442, 443, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 470, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 190, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 554, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 1068, 0, 10, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 441, 442, 443, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 470, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 556, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 260, 442, 443, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 470, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 263, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 105, 441, 442, 443, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 470, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 575, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 538, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 693, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 781, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 1122, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 1202, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 1447, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 15, 16, 0, 0, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 441, 442, 443, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 470, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 0, 579, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 441, 442, 443, 0, 108, 109, 0, 110, 111, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 470, 0, 0, 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, 32, 0, 0, 0, 0, 34, 35, 36, 37, 626, 39, 40, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 175, 0, 0, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 176, 75, 76, 77, 78, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 98, 771, 0, 0, 0, 0, 99, 0, 0, 0, 0, 102, 103, 104, 0, 0, 179, 0, 0, 0, 0, 108, 109, 0, 110, 111, 265, 266, 0, 267, 268, 0, 0, 269, 270, 271, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 273, 0, 274, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 276, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 209, 40, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 726, 320, 321, 322, 0, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 0, 269, 270, 271, 272, 570, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 328, 273, 329, 274, 0, 330, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 727, 0, 108, 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 209, 40, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 319, 320, 321, 322, 0, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 570, 269, 270, 271, 272, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 273, 0, 274, 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 727, 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 0, 320, 321, 322, 0, 0, 0, 323, 324, 212, 213, 214, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 265, 266, 0, 267, 268, 0, 331, 269, 270, 271, 272, 0, 0, 0, 0, 0, 332, 0, 0, 0, 1719, 0, 0, 0, 273, 0, 274, 445, 275, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 276, 0, 277, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 0, 320, 321, 322, 0, 0, 0, 323, 324, 212, 213, 214, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 265, 266, 0, 267, 268, 0, 331, 269, 270, 271, 272, 0, 0, 0, 0, 0, 332, 0, 0, 0, 1789, 0, 0, 0, 273, 0, 274, 0, 275, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 276, 0, 277, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 319, 320, 321, 322, 0, 0, 0, 323, 324, 212, 213, 214, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 265, 266, 0, 267, 268, 0, 331, 269, 270, 271, 272, 0, 0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 273, 0, 274, 0, 275, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 276, 0, 277, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 0, 320, 321, 322, 0, 0, 0, 323, 324, 212, 213, 214, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 0, 265, 266, 0, 267, 268, 331, 1522, 269, 270, 271, 272, 0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 273, 0, 274, 0, 275, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 276, 0, 277, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 0, 320, 321, 322, 0, 0, 0, 323, 324, 212, 213, 214, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 89, 327, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 1619, 1620, 1621, 1622, 1623, 0, 331, 1624, 1625, 1626, 1627, 0, 0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 1628, 1629, 1630, -1031, -1031, -1031, -1031, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 1631, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 50, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 0, 0, 0, 1680, 1681, 212, 213, 214, 0, 1682, 1683, 1684, 1685, 1686, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1687, 1688, 1689, 0, 0, 0, 91, 92, 0, 93, 178, 95, 1690, 0, 1691, 1692, 0, 1693, 441, 442, 443, 0, 0, 0, 1694, 1695, 0, 1696, 0, 1697, 1698, 0, 0, 0, 0, 0, 0, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 470, 269, 270, 271, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 273, 0, 274, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 319, 320, 321, 322, 796, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 0, 269, 270, 271, 272, 570, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 328, 273, 329, 274, 0, 330, -1031, -1031, -1031, -1031, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 1249, 320, 321, 322, 0, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 0, 269, 270, 271, 272, 570, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 328, 273, 329, 274, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 0, 0, 0, 1255, 320, 321, 322, 0, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 265, 266, 0, 267, 268, 0, 0, 269, 270, 271, 272, 570, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 328, 273, 329, 274, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 279, 280, 281, 282, 283, 284, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 50, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 275, 0, 0, 0, 320, 321, 322, 0, 0, 0, 323, 568, 212, 213, 214, 569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, 0, 570, 0, 0, 0, 0, 0, 91, 92, 0, 93, 178, 95, 328, 0, 329, 0, 0, 330, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 1263, 0, 0, -392, 0, 0, 0, 0, 0, 0, 0, 62, 63, 64, 173, 174, 429, 0, 825, 826, 0, 0, 0, 0, 827, 0, 828, 0, 0, 0, 557, 212, 213, 214, 558, 0, 0, 0, 829, 0, 0, 0, 0, 0, 0, 0, 34, 35, 36, 208, 0, 177, 0, 0, 89, 327, 0, 91, 92, 210, 93, 178, 95, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 331, 0, 0, 0, 0, 0, 430, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 830, 831, 832, 833, 0, 79, 80, 81, 82, 83, 0, 1023, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 834, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 29, 0, 835, 0, 0, 0, 0, 102, 34, 35, 36, 208, 836, 209, 40, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 825, 826, 0, 97, 0, 0, 827, 0, 828, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 829, 0, 216, 0, 0, 0, 0, 108, 34, 35, 36, 208, 0, 1065, 1066, 1067, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 1068, 0, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 830, 831, 832, 833, 1091, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 834, 0, 91, 92, 0, 93, 178, 95, 29, 0, 0, 97, 0, 0, 0, 0, 34, 35, 36, 208, 835, 209, 40, 0, 0, 102, 0, 0, 0, 210, 836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 1413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 29, 0, 0, 97, 0, 0, 0, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 102, 0, 0, 0, 210, 216, 0, 0, 591, 0, 108, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 611, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 29, 0, 972, 97, 0, 0, 0, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 102, 0, 0, 0, 210, 216, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 29, 0, 0, 97, 0, 0, 0, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 102, 0, 0, 0, 210, 216, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1119, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 29, 0, 0, 97, 0, 0, 0, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 102, 0, 0, 0, 210, 216, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 216, 0, 0, 444, 445, 108, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 441, 442, 443, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 515, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 524, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 441, 442, 443, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 892, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 958, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 441, 442, 443, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 1008, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 1065, 1066, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 1309, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1065, 1066, 1067, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 1340, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 0, 1065, 1066, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 1508, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 0, 0, 0, 1091, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 1602, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 0, 0, 0, 102, 640, 0, 0, 0, 232, 0, 0, 0, 0, 108, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 34, 35, 36, 208, 0, 209, 40, 0, 0, 0, 0, 0, 102, 210, 0, 0, 0, 641, 0, 0, 0, 0, 108, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 177, 87, 88, 89, 90, 0, 91, 92, 0, 93, 178, 95, 0, 0, 0, 97, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 232, 808, 0, 444, 445, 108, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 809, 444, 445, 955, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 441, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 1065, 1066, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1068, 1418, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1065, 1066, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 1068, 0, 0, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 444, 445, 0, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470 }; static const yytype_int16 yycheck[] = { 5, 6, 56, 8, 9, 10, 11, 12, 13, 126, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 181, 4, 29, 30, 96, 656, 931, 394, 100, 101, 156, 4, 4, 735, 105, 394, 33, 44, 394, 653, 4, 1144, 509, 57, 233, 52, 161, 54, 528, 46, 57, 682, 59, 125, 51, 156, 31, 501, 105, 920, 1131, 501, 469, 182, 505, 506, 31, 44, 31, 585, 586, 31, 652, 633, 1300, 57, 1022, 84, 951, 814, 783, 105, 105, 348, 349, 807, 9, 32, 9, 32, 9, 49, 536, 534, 967, 9, 536, 9, 105, 1140, 14, 49, 56, 9, 1429, 49, 9, 84, 14, 9, 49, 14, 9, 36, 9, 49, 83, 9, 9, 9, 4, 9, 9, 9, 9, 115, 9, 83, 9, 9, 245, 9, 179, 9, 9, 4, 1009, 70, 4, 9, 1733, 9, 9, 83, 38, 70, 83, 84, 90, 50, 51, 83, 164, 158, 70, 179, 179, 108, 57, 70, 134, 135, 70, 4, 102, 38, 533, 122, 0, 216, 69, 193, 179, 83, 38, 130, 123, 473, 102, 186, 179, 38, 8, 130, 196, 232, 176, 53, 193, 83, 56, 158, 216, 216, 193, 193, 38, 1790, 193, 38, 1061, 134, 135, 1528, 102, 70, 502, 73, 232, 216, 83, 507, 244, 155, 70, 70, 172, 228, 70, 83, 70, 70, 70, 197, 162, 232, 83, 1552, 94, 1554, 96, 862, 70, 191, 100, 101, 194, 70, 162, 246, 172, 83, 249, 54, 83, 70, 194, 191, 70, 256, 257, 196, 195, 70, 70, 194, 70, 70, 198, 125, 194, 198, 172, 196, 162, 179, 1337, 970, 193, 70, 431, 194, 1218, 1344, 195, 1346, 195, 196, 172, 180, 196, 195, 193, 195, 340, 126, 250, 156, 196, 195, 254, 60, 195, 1519, 1335, 195, 540, 1032, 195, 1034, 195, 1372, 1175, 195, 195, 195, 70, 195, 195, 195, 195, 773, 195, 194, 194, 172, 194, 86, 194, 194, 89, 368, 27, 28, 194, 158, 194, 194, 193, 195, 172, 196, 576, 172, 948, 193, 1197, 193, 193, 194, 196, 182, 858, 859, 368, 368, 196, 379, 196, 909, 511, 70, 163, 425, 90, 193, 83, 158, 196, 14, 367, 368, 102, 196, 483, 193, 422, 374, 375, 376, 377, 193, 164, 83, 196, 382, 158, 32, 162, 196, 196, 193, 196, 196, 250, 177, 340, 70, 254, 179, 367, 196, 258, 193, 401, 196, 51, 179, 193, 376, 377, 31, 409, 193, 196, 1476, 478, 479, 480, 481, 654, 195, 196, 484, 421, 134, 135, 54, 193, 155, 50, 888, 162, 53, 1465, 193, 1467, 1129, 155, 156, 157, 193, 196, 193, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 172, 470, 70, 472, 473, 474, 422, 163, 484, 106, 107, 70, 340, 158, 193, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 83, 4, 1214, 937, 469, 502, 503, 937, 505, 506, 507, 508, 484, 31, 469, 512, 469, 518, 515, 469, 193, 83, 84, 196, 27, 28, 400, 524, 32, 526, 225, 475, 50, 964, 475, 53, 163, 534, 542, 179, 162, 70, 1573, 134, 135, 542, 1577, 544, 38, 408, 729, 178, 408, 193, 670, 1159, 193, 83, 1162, 1410, 501, 195, 418, 920, 90, 799, 422, 195, 533, 425, 804, 920, 197, 1143, 920, 972, 83, 408, 522, 670, 195, 522, 761, 90, 134, 135, 737, 179, 195, 348, 349, 350, 533, 547, 591, 536, 83, 852, 1104, 854, 195, 193, 105, 90, 641, 134, 135, 190, 106, 107, 195, 83, 70, 196, 158, 195, 617, 618, 90, 475, 476, 477, 478, 479, 480, 481, 688, 386, 195, 158, 156, 157, 179, 70, 196, 179, 198, 659, 70, 661, 70, 1492, 643, 193, 641, 501, 193, 75, 76, 156, 157, 482, 196, 1345, 83, 50, 51, 4, 837, 75, 76, 90, 357, 70, 193, 83, 522, 158, 847, 156, 157, 366, 90, 368, 196, 201, 179, 193, 373, 784, 536, 102, 103, 680, 156, 157, 132, 133, 383, 195, 196, 547, 105, 106, 107, 202, 693, 348, 349, 197, 193, 1732, 49, 70, 1061, 1736, 158, 1177, 111, 83, 193, 567, 1061, 216, 162, 1061, 119, 120, 121, 122, 123, 124, 225, 158, 725, 83, 155, 156, 157, 232, 727, 195, 90, 589, 590, 1339, 48, 1168, 156, 157, 1192, 1193, 1194, 69, 179, 179, 1198, 250, 1179, 1764, 1765, 254, 1444, 158, 1324, 777, 778, 193, 193, 756, 1217, 196, 784, 785, 9, 112, 622, 623, 195, 196, 117, 193, 119, 120, 121, 122, 123, 124, 125, 653, 1760, 1761, 156, 157, 193, 1878, 189, 105, 106, 107, 119, 120, 121, 158, 791, 1029, 200, 155, 156, 157, 1893, 81, 119, 120, 121, 122, 123, 124, 823, 824, 807, 670, 4, 158, 509, 816, 803, 8, 165, 166, 821, 168, 195, 103, 193, 158, 585, 586, 14, 53, 54, 55, 688, 57, 109, 110, 111, 1529, 158, 195, 1197, 1872, 189, 195, 9, 69, 196, 1304, 1197, 195, 197, 1197, 130, 130, 357, 14, 1887, 49, 812, 139, 140, 141, 194, 366, 179, 368, 14, 102, 199, 194, 373, 194, 189, 1477, 193, 53, 54, 55, 195, 111, 383, 194, 162, 884, 194, 165, 166, 193, 168, 169, 170, 69, 193, 9, 155, 892, 194, 894, 194, 896, 194, 1353, 194, 1355, 94, 408, 9, 195, 905, 971, 1341, 179, 14, 9, 193, 196, 196, 773, 194, 775, 112, 193, 919, 196, 195, 117, 195, 119, 120, 121, 122, 123, 124, 125, 83, 908, 194, 194, 797, 195, 193, 797, 194, 27, 28, 908, 908, 132, 945, 1844, 200, 9, 9, 200, 908, 811, 812, 200, 955, 70, 32, 958, 133, 960, 178, 158, 797, 964, 136, 1864, 9, 1150, 194, 165, 166, 158, 168, 14, 1873, 923, 191, 9, 923, 9, 679, 180, 194, 9, 132, 14, 849, 200, 9, 849, 935, 200, 937, 189, 197, 14, 856, 857, 1003, 200, 200, 197, 509, 972, 158, 102, 194, 1008, 194, 193, 195, 194, 9, 972, 849, 972, 195, 91, 972, 136, 158, 9, 70, 194, 1015, 885, 193, 1483, 1463, 1485, 908, 1487, 70, 70, 1490, 158, 193, 158, 196, 738, 547, 196, 9, 1048, 14, 908, 197, 180, 908, 1410, 1055, 195, 1290, 931, 9, 196, 1121, 1410, 1016, 81, 1410, 83, 84, 923, 14, 1010, 929, 380, 200, 929, 948, 384, 196, 908, 14, 935, 194, 937, 191, 195, 779, 103, 781, 119, 120, 121, 122, 123, 124, 852, 32, 854, 193, 32, 929, 858, 859, 860, 411, 193, 413, 414, 415, 416, 14, 14, 193, 193, 52, 193, 809, 971, 1060, 1121, 70, 1063, 70, 139, 140, 141, 1121, 70, 193, 983, 984, 985, 9, 194, 1584, 195, 195, 1492, 136, 193, 14, 180, 1374, 225, 136, 1492, 9, 163, 1492, 165, 166, 194, 168, 169, 170, 69, 1010, 1128, 1390, 189, 1155, 1018, 1016, 1020, 1018, 1784, 1020, 1128, 1128, 9, 83, 200, 197, 1168, 195, 197, 1128, 9, 679, 872, 196, 81, 198, 193, 1179, 1180, 1040, 193, 195, 1018, 1189, 1020, 14, 83, 136, 888, 889, 194, 193, 193, 196, 194, 9, 103, 136, 195, 1060, 196, 196, 1063, 91, 196, 119, 120, 121, 122, 123, 124, 155, 1214, 200, 1206, 32, 130, 131, 77, 195, 194, 180, 1224, 50, 51, 52, 53, 54, 55, 195, 738, 1092, 139, 140, 141, 136, 1862, 1243, 32, 200, 194, 1247, 69, 9, 9, 136, 1252, 194, 200, 1128, 1209, 9, 159, 1259, 4, 162, 1495, 171, 165, 166, 197, 168, 169, 170, 1128, 1504, 200, 1128, 357, 194, 9, 779, 194, 781, 197, 189, 195, 366, 1517, 195, 1159, 1738, 1739, 1162, 373, 14, 83, 196, 193, 797, 197, 194, 1128, 195, 383, 194, 194, 9, 193, 49, 196, 809, 194, 136, 812, 394, 200, 1309, 194, 9, 200, 4, 136, 200, 1316, 194, 32, 9, 1320, 195, 1322, 194, 1022, 1023, 1445, 194, 1440, 195, 1330, 195, 1191, 1192, 1193, 1194, 196, 112, 167, 1198, 1340, 1341, 1104, 849, 50, 51, 52, 53, 54, 55, 1209, 57, 195, 163, 14, 83, 1360, 1594, 49, 1221, 1364, 194, 1221, 69, 112, 1369, 872, 117, 194, 117, 136, 119, 120, 121, 122, 123, 124, 125, 196, 136, 194, 14, 888, 889, 195, 179, 83, 1221, 196, 14, 14, 83, 194, 193, 136, 194, 1550, 136, 195, 195, 14, 14, 908, 78, 79, 80, 195, 14, 196, 9, 9, 197, 59, 83, 179, 31, 91, 165, 166, 193, 168, 112, 509, 929, 1122, 1302, 117, 83, 119, 120, 121, 122, 123, 124, 125, 9, 1313, 1296, 196, 115, 1302, 189, 195, 59, 102, 158, 180, 102, 170, 197, 36, 1313, 14, 193, 195, 193, 1154, 1522, 194, 176, 1460, 180, 1339, 1463, 180, 81, 83, 9, 143, 144, 145, 146, 147, 173, 165, 166, 194, 168, 83, 154, 195, 14, 194, 194, 14, 160, 161, 103, 196, 83, 83, 14, 83, 1730, 1353, 111, 1355, 14, 189, 174, 83, 1104, 1853, 1740, 1202, 481, 197, 478, 476, 965, 1016, 911, 1018, 188, 1020, 1869, 1022, 1023, 1215, 1217, 1218, 1593, 138, 139, 140, 141, 142, 1864, 1580, 1617, 27, 28, 1387, 1530, 31, 593, 1702, 1435, 1897, 1885, 1714, 1576, 1431, 159, 1501, 377, 162, 163, 1785, 165, 166, 1059, 168, 169, 170, 1194, 1132, 1056, 1420, 56, 1005, 1420, 984, 1190, 1718, 1191, 935, 183, 1568, 374, 1429, 422, 823, 1819, 1112, 1041, 1435, 193, 1525, 1423, 1092, -1, -1, 1445, -1, -1, 1420, -1, -1, 1466, -1, -1, 679, 1830, -1, 1472, -1, 1474, -1, -1, 1477, -1, -1, -1, 1466, 1439, 1304, -1, -1, -1, 1472, -1, 1474, -1, -1, -1, 1122, 1494, -1, -1, -1, -1, 1128, -1, 1483, -1, 1485, -1, 1487, -1, -1, 1490, 1494, -1, 1496, 1592, 1593, 1496, -1, -1, -1, -1, 1501, 1505, -1, -1, 1505, -1, 1154, -1, -1, 738, -1, -1, 1891, -1, -1, -1, -1, -1, -1, 1898, 1496, 1522, 1713, -1, 1525, -1, -1, 1528, -1, 1505, -1, -1, -1, -1, -1, -1, -1, 1538, -1, -1, -1, -1, -1, -1, 1545, -1, 81, -1, 83, 84, 779, 1552, 781, 1554, 1202, -1, -1, -1, -1, -1, 1561, 1209, -1, 1582, -1, -1, -1, -1, 103, 1217, 1218, 1778, -1, 1221, -1, -1, 1837, -1, 1582, -1, 809, 1723, 1558, 1584, -1, -1, 225, 1591, -1, -1, 1591, 1592, 1593, 1597, -1, -1, 1597, -1, -1, 1603, -1, -1, 1603, 1857, 139, 140, 141, 1447, 1754, 1755, -1, -1, -1, -1, -1, 1591, -1, -1, -1, -1, -1, 1597, -1, -1, 1713, -1, -1, 1603, 163, -1, 165, 166, -1, 168, 169, 170, 275, -1, 277, -1, -1, -1, -1, 872, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1304, -1, -1, 888, 889, 196, -1, 198, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 920, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, 56, -1, 1713, -1, -1, -1, -1, -1, 357, -1, -1, 4, -1, -1, -1, -1, -1, 366, -1, -1, -1, -1, -1, 1734, 373, -1, -1, 1738, 1739, -1, 1744, -1, -1, 1744, 383, -1, -1, -1, -1, -1, -1, -1, 1753, -1, -1, 394, 27, 28, -1, 1760, 1761, 1903, -1, 1764, 1765, -1, 49, -1, 1744, 1911, -1, 4, 1420, -1, -1, 1917, -1, 1778, 1920, -1, 419, -1, 1786, 422, -1, 1786, -1, -1, -1, 1793, -1, -1, 1793, 1022, 1023, -1, -1, -1, -1, 1447, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1786, -1, -1, -1, -1, -1, 49, 1793, -1, -1, -1, -1, -1, -1, 1828, 1844, -1, 1828, 194, 112, 469, -1, 1061, 1837, 117, 1836, 119, 120, 121, 122, 123, 124, 125, -1, -1, 1864, 1850, -1, 1496, 1850, -1, -1, 1828, 1501, 1873, 1856, -1, 1505, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, -1, -1, -1, 1850, -1, -1, -1, -1, 112, -1, -1, 165, 166, 117, 168, 119, 120, 121, 122, 123, 124, 125, 1122, -1, 1899, -1, -1, 1899, -1, -1, -1, 1906, -1, 49, 1906, 189, -1, -1, -1, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, -1, 561, 1899, 563, 1154, -1, 566, -1, 275, 1906, 277, 165, 166, -1, 168, -1, -1, -1, -1, -1, -1, -1, 1591, 1592, 1593, -1, -1, -1, 1597, -1, -1, -1, -1, 225, 1603, 189, -1, 597, -1, -1, -1, -1, -1, 197, -1, -1, 112, 1197, -1, -1, -1, 117, 1202, 119, 120, 121, 122, 123, 124, 125, -1, -1, 81, -1, 83, 332, 85, 1217, 1218, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 103, -1, -1, -1, -1, 649, 650, -1, -1, -1, -1, 69, -1, -1, 658, 165, 166, -1, 168, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, 679, 139, 140, 141, 189, -1, -1, -1, -1, -1, -1, -1, 197, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 165, 166, -1, 168, 169, 170, 419, -1, 1304, 422, -1, -1, 67, 68, -1, -1, -1, -1, -1, 357, -1, -1, -1, 10, 11, 12, -1, -1, 366, 1744, -1, -1, 738, -1, -1, 373, -1, -1, -1, -1, 67, 68, -1, 30, 31, 383, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 1786, -1, 779, -1, 781, -1, -1, 1793, 134, 135, -1, 69, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, 809, 810, -1, -1, 134, 135, -1, -1, -1, -1, 1828, 1410, -1, -1, 823, 824, 825, 826, 827, 828, 829, -1, -1, -1, -1, -1, -1, 836, -1, -1, -1, -1, 1850, -1, -1, -1, 194, 81, -1, 67, 68, 850, -1, -1, -1, 561, -1, -1, 1447, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, 872, 194, -1, -1, -1, 509, -1, -1, -1, -1, -1, -1, -1, -1, 886, -1, 888, 889, 1899, -1, -1, -1, -1, -1, -1, 1906, -1, 27, 28, -1, 1492, 31, 139, 140, 141, -1, -1, -1, 910, 911, -1, -1, -1, 134, 135, -1, -1, 200, 920, -1, -1, -1, -1, -1, 926, -1, 163, -1, 165, 166, 167, 168, 169, 170, -1, -1, -1, 939, -1, -1, 649, 650, 81, -1, -1, 947, -1, -1, 950, 658, -1, 10, 11, 12, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, 103, -1, 968, -1, -1, -1, 972, 30, 31, 194, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, 139, 140, 141, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1022, 1023, -1, -1, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, 1036, -1, -1, 1039, 81, 1041, -1, -1, -1, -1, -1, 679, -1, -1, -1, 31, -1, -1, -1, -1, 1056, 1057, 1058, 1059, -1, 1061, 103, -1, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, -1, -1, -1, -1, -1, 225, 139, 140, 141, 81, -1, -1, -1, -1, 738, -1, 1108, -1, -1, -1, -1, -1, -1, -1, 823, 824, -1, -1, -1, -1, 1122, 103, 165, 166, -1, 168, 169, 170, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 197, -1, 1142, -1, 1144, 125, -1, 779, -1, 781, -1, -1, 193, -1, 1154, -1, -1, -1, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, 1171, -1, -1, 1174, -1, -1, 809, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, -1, -1, -1, 1197, -1, -1, -1, -1, 1202, 910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1217, 1218, 926, 1220, -1, -1, -1, -1, -1, -1, -1, -1, 357, 1230, -1, 939, -1, 1234, -1, -1, 1237, 366, 1239, 872, -1, -1, -1, -1, 373, -1, 10, 11, 12, -1, -1, -1, -1, -1, 383, 888, 889, -1, -1, -1, 968, -1, 1263, -1, -1, 394, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, 1297, 1298, -1, -1, 1301, -1, -1, 1304, -1, 69, -1, -1, -1, -1, -1, -1, 56, -1, 31, -1, -1, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 1036, -1, -1, 1039, -1, -1, -1, -1, -1, -1, 30, 31, 469, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 81, 57, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, -1, 69, -1, -1, 509, -1, -1, -1, -1, -1, 103, -1, -1, 1022, 1023, -1, -1, 1394, -1, 1396, -1, -1, -1, -1, -1, 1402, -1, 1404, -1, 1406, -1, -1, 1409, 1410, -1, -1, 1413, -1, 1415, -1, -1, 1418, -1, -1, -1, -1, 139, 140, 141, -1, -1, -1, 1429, 1430, -1, -1, 1433, 197, 1142, -1, 1144, 566, -1, 1440, -1, -1, 159, -1, -1, 162, 1447, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1171, -1, -1, 1174, -1, 597, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, 1122, -1, 1492, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 197, -1, 1508, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1520, 1521, 1154, 1230, -1, 67, 68, 1234, 1528, -1, 1530, -1, 275, -1, 277, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, 68, -1, -1, -1, 679, 1552, -1, 1554, -1, -1, -1, -1, -1, -1, 1561, -1, -1, -1, -1, -1, -1, -1, -1, 1202, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 1217, 1218, -1, -1, 332, 1297, 1298, 134, 135, -1, -1, -1, 69, -1, -1, 1600, 1601, 1602, 10, 11, 12, -1, 1607, -1, 1609, 738, -1, -1, 134, 135, 1615, -1, 1617, -1, -1, -1, -1, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 779, -1, 781, -1, -1, -1, -1, -1, -1, -1, 81, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1304, -1, -1, -1, 419, -1, -1, 422, -1, 809, 810, 103, -1, -1, -1, 1394, -1, 1396, -1, -1, -1, -1, -1, -1, -1, 825, 826, 827, 828, 829, 119, 120, 121, 122, 123, 124, 836, -1, -1, -1, -1, 130, 131, -1, -1, 1717, -1, 139, 140, 141, 850, -1, -1, -1, -1, 31, -1, -1, -1, -1, -1, 1440, 1734, -1, -1, 566, -1, -1, -1, -1, -1, -1, 872, 165, 166, -1, 168, 169, 170, -1, 169, 1753, 171, 59, -1, -1, 886, 1759, 888, 889, -1, -1, -1, -1, -1, 184, 597, 186, 1770, -1, 189, 193, -1, -1, 1776, 81, -1, -1, 1780, -1, -1, 911, 78, 79, 80, 81, -1, -1, 197, -1, 920, -1, -1, -1, -1, -1, -1, 103, -1, -1, 1802, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, 1447, -1, -1, 561, 947, 563, -1, 950, 566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, 142, -1, -1, -1, 1842, -1, 972, 139, 140, 141, -1, -1, -1, -1, 1852, -1, 597, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, 172, 1869, -1, 165, 166, -1, 168, 169, 170, -1, 1878, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, -1, 1893, 1022, 1023, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 649, 650, 1615, -1, -1, -1, -1, -1, -1, 658, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1056, 1057, 1058, 1059, -1, 1061, -1, -1, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1108, 810, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1122, -1, 825, 826, 827, 828, -1, -1, -1, -1, 10, 11, 12, 836, -1, -1, 1717, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 1154, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, 69, -1, -1, 81, 810, -1, 1197, -1, 31, -1, -1, 1202, -1, -1, -1, -1, 103, 823, 824, 825, 826, 827, 828, 829, -1, 103, 1217, 1218, -1, 1220, 836, -1, 1802, 111, 112, -1, 59, -1, -1, -1, -1, 128, -1, -1, -1, -1, 1237, -1, 1239, -1, -1, -1, 139, 140, 141, 947, -1, -1, 81, -1, -1, 139, 140, 141, -1, -1, -1, 81, -1, -1, -1, -1, 1263, -1, -1, -1, -1, -1, 165, 166, 103, 168, 169, 170, 162, -1, -1, 165, 166, 103, 168, 169, 170, 27, 28, -1, -1, 31, -1, -1, -1, -1, -1, -1, 910, -1, 193, -1, 1878, -1, 1301, -1, -1, 1304, -1, 138, 139, 140, 141, 142, 926, -1, -1, 1893, -1, 139, 140, 141, 197, -1, -1, -1, -1, 939, -1, -1, 159, -1, -1, 162, 163, 947, 165, 166, -1, 168, 169, 170, 162, 172, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 183, -1, 968, -1, -1, 1057, 1058, 1059, -1, -1, 193, -1, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1402, -1, 1404, -1, 1406, 1108, -1, 1409, 1410, -1, -1, 1413, -1, 1415, -1, -1, 1418, -1, -1, 1036, -1, -1, 1039, -1, 1041, -1, -1, -1, 1430, -1, -1, 1433, -1, -1, -1, -1, -1, -1, -1, 1056, 1057, 1058, 1059, -1, -1, 1447, -1, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, -1, -1, -1, -1, -1, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1492, 1108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1508, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1220, 1520, 1521, -1, -1, -1, -1, -1, 1142, -1, 1144, 1530, -1, -1, -1, -1, -1, 1237, -1, 1239, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1171, -1, -1, 1174, 30, 31, 1263, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 1600, 1601, 1602, -1, -1, 1220, -1, 1607, -1, 1609, -1, -1, -1, -1, 357, 1230, -1, 1617, -1, 1234, -1, -1, 1237, 366, 1239, -1, -1, -1, -1, -1, 373, -1, 10, 11, 12, -1, -1, -1, -1, -1, 383, -1, -1, -1, -1, -1, -1, -1, 1263, -1, -1, 394, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, 1297, 1298, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1402, -1, 1404, -1, 1406, -1, -1, 1409, 10, 11, 12, 1413, -1, 1415, -1, -1, 1418, -1, -1, -1, -1, -1, -1, -1, -1, 469, 197, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, 1759, -1, -1, -1, -1, -1, -1, 509, -1, 69, -1, 1770, -1, -1, -1, -1, -1, 1776, 81, -1, 1394, 1780, 1396, -1, -1, -1, -1, -1, 1402, -1, 1404, -1, 1406, -1, -1, 1409, -1, -1, -1, 1413, 103, 1415, -1, -1, 1418, -1, -1, -1, 1508, -1, -1, -1, -1, -1, -1, 1429, -1, -1, -1, -1, 197, -1, 125, -1, 566, -1, 1440, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, 142, -1, -1, -1, 1842, -1, -1, -1, 10, 11, 12, -1, -1, -1, 1852, -1, 597, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 31, -1, 1869, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 1508, -1, -1, 197, -1, -1, 1600, 1601, 1602, -1, -1, -1, 69, 1607, -1, -1, -1, -1, -1, -1, 1528, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, 679, 1552, -1, 1554, 103, -1, -1, -1, 30, 31, 1561, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 136, -1, -1, -1, 139, 140, 141, -1, -1, -1, -1, 69, -1, 1600, 1601, 1602, 10, 11, 12, -1, 1607, -1, -1, 738, -1, -1, -1, 162, 1615, -1, 165, 166, -1, 168, 169, 170, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 779, -1, 781, 81, -1, -1, -1, -1, -1, -1, -1, 69, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1759, -1, -1, 103, 31, -1, -1, -1, 809, 810, -1, 1770, 103, -1, -1, -1, -1, 1776, -1, -1, -1, 1780, -1, -1, 825, 826, 827, 828, 829, -1, -1, -1, 59, -1, -1, 836, -1, -1, -1, 139, 140, 141, -1, -1, 1717, -1, -1, -1, 139, 140, 141, -1, -1, 197, 81, -1, -1, -1, -1, 159, -1, 1734, 162, 163, -1, 165, 166, -1, 168, 169, 170, 872, -1, -1, 165, 166, 103, 168, 169, 170, 1753, -1, -1, 1842, -1, -1, 1759, 888, 889, -1, -1, -1, -1, -1, -1, -1, -1, 1770, -1, -1, -1, -1, -1, 1776, -1, -1, -1, 1780, -1, -1, -1, 138, 139, 140, 141, 142, -1, 197, -1, 920, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1802, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, 947, -1, -1, -1, -1, -1, 10, 11, 12, -1, 183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, 1842, -1, 972, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, 10, 11, 12, 1878, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 1893, 1022, 1023, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, 1056, 1057, 1058, 1059, -1, 1061, 69, -1, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1108, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 1122, -1, -1, 81, -1, -1, -1, 136, -1, -1, -1, -1, -1, 27, 28, 29, 195, -1, -1, -1, -1, -1, -1, -1, 38, 103, -1, -1, -1, -1, -1, -1, 1154, 111, 112, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, 139, 140, 141, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, 1197, -1, 91, -1, -1, 1202, -1, -1, -1, 162, -1, -1, 165, 166, 103, 168, 169, 170, -1, -1, 1217, 1218, 111, 1220, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, 1237, -1, 1239, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, 1263, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, 1304, -1, 198, 199, -1, 201, 202, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, 1402, -1, 1404, 91, 1406, -1, -1, 1409, 1410, -1, -1, 1413, -1, 1415, -1, 103, 1418, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, 1447, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 50, 51, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, -1, 174, -1, -1, 177, 1492, 78, 79, 80, 81, 183, -1, 10, 11, 12, 188, 189, 190, -1, 91, 193, 1508, 195, -1, -1, 198, 199, -1, 201, 202, -1, 103, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, -1, 69, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, 154, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, 1600, 1601, 1602, -1, -1, -1, -1, 1607, 49, 50, 51, -1, -1, -1, -1, 56, 1616, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, 112, 113, 114, -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, 195, 126, 127, 128, 129, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, 184, -1, 186, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, 1759, 201, 202, -1, -1, -1, -1, -1, -1, -1, -1, 1770, -1, -1, -1, -1, -1, 1776, -1, -1, -1, 1780, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, 1804, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, 1842, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, 112, 113, 114, -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, 129, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, 184, -1, 186, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, 112, 113, 114, -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, 129, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, 184, -1, 186, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, 95, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, 101, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, 99, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, 97, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, 197, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, 130, 131, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, 86, 87, -1, -1, -1, 91, 92, 93, 94, -1, 96, -1, 98, -1, 100, -1, -1, 103, 104, -1, -1, -1, 108, 109, 110, 111, -1, 113, 114, -1, 116, -1, 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, 151, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, 11, 12, 193, -1, 195, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, 31, -1, 13, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, 172, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, 12, 193, -1, -1, 196, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, 31, -1, 13, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, 172, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 10, 11, 12, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, 69, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, 108, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, 195, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, 31, -1, 13, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 10, 11, 12, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, 69, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, 195, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, 11, 12, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, 69, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, 195, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 10, 11, 12, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, 69, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, 195, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 194, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 32, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 10, 11, 12, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, 69, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, -1, 195, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, 10, 11, 12, -1, 198, 199, -1, 201, 202, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, 13, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, 69, -1, -1, 56, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, 70, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, -1, 127, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, 177, 194, -1, -1, -1, -1, 183, -1, -1, -1, -1, 188, 189, 190, -1, -1, 193, -1, -1, -1, -1, 198, 199, -1, 201, 202, 3, 4, -1, 6, 7, -1, -1, 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, 29, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, 83, 84, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, -1, 10, 11, 12, 13, 159, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, 27, 173, 29, -1, 176, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 196, -1, 198, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, 83, 84, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, 159, 10, 11, 12, 13, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 27, -1, 29, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196, -1, 198, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, -1, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 3, 4, -1, 6, 7, -1, 183, 10, 11, 12, 13, -1, -1, -1, -1, -1, 193, -1, -1, -1, 197, -1, -1, -1, 27, -1, 29, 31, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 57, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, -1, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 3, 4, -1, 6, 7, -1, 183, 10, 11, 12, 13, -1, -1, -1, -1, -1, 193, -1, -1, -1, 197, -1, -1, -1, 27, -1, 29, -1, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 57, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 3, 4, -1, 6, 7, -1, 183, 10, 11, 12, 13, -1, -1, -1, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, 27, -1, 29, -1, 31, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, 57, -1, 59, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, -1, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, -1, 3, 4, -1, 6, 7, 183, 184, 10, 11, 12, 13, -1, -1, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, 29, -1, 31, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, 57, -1, 59, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, -1, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 162, 163, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 3, 4, 5, 6, 7, -1, 183, 10, 11, 12, 13, -1, -1, -1, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, 27, 28, 29, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, 160, 161, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, 174, -1, 176, 10, 11, 12, -1, -1, -1, 183, 184, -1, 186, -1, 188, 189, -1, -1, -1, -1, -1, -1, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, 69, 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, 29, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, 194, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, -1, 10, 11, 12, 13, 159, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, 27, 173, 29, -1, 176, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, -1, 10, 11, 12, 13, 159, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, 27, 173, 29, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, -1, -1, -1, 130, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, 3, 4, -1, 6, 7, -1, -1, 10, 11, 12, 13, 159, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, 27, 173, 29, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 31, -1, -1, -1, 131, 132, 133, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, 159, -1, -1, -1, -1, -1, 165, 166, -1, 168, 169, 170, 171, -1, 173, -1, -1, 176, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, 32, -1, -1, 111, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, -1, 50, 51, -1, -1, -1, -1, 56, -1, 58, -1, -1, -1, 138, 139, 140, 141, 142, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, 78, 79, 80, 81, -1, 159, -1, -1, 162, 163, -1, 165, 166, 91, 168, 169, 170, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, 183, -1, -1, -1, -1, -1, 189, -1, -1, -1, 193, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, 38, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, -1, -1, -1, -1, -1, 70, -1, 183, -1, -1, -1, -1, 188, 78, 79, 80, 81, 193, 83, 84, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 50, 51, -1, 174, -1, -1, 56, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, 188, -1, -1, 70, -1, 193, -1, -1, -1, -1, 198, 78, 79, 80, 81, -1, 10, 11, 12, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, 69, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, -1, 174, -1, -1, -1, -1, 78, 79, 80, 81, 183, 83, 84, -1, -1, 188, -1, -1, -1, 91, 193, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, 136, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, -1, 174, -1, -1, -1, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, 188, -1, -1, -1, 91, 193, -1, -1, 196, -1, 198, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, 72, 174, -1, -1, -1, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, 188, -1, -1, -1, 91, 193, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, -1, 174, -1, -1, -1, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, 188, -1, -1, -1, 91, 193, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, 70, -1, -1, 174, -1, -1, -1, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, 188, -1, -1, -1, 91, 193, -1, -1, -1, -1, 198, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 138, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, 188, -1, -1, -1, -1, 193, -1, -1, 30, 31, 198, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 136, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 136, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 136, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 136, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 136, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, 136, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, 136, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, 136, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, -1, -1, -1, 69, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, -1, -1, -1, -1, -1, 136, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, 130, -1, -1, -1, -1, -1, -1, -1, -1, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, 136, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, -1, -1, -1, 188, 91, -1, -1, -1, 193, -1, -1, -1, -1, 198, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, 78, 79, 80, 81, -1, 83, 84, -1, -1, -1, -1, -1, 188, 91, -1, -1, -1, 193, -1, -1, -1, -1, 198, -1, -1, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, 140, 141, -1, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, 159, 160, 161, 162, 163, -1, 165, 166, -1, 168, 169, 170, -1, -1, -1, 174, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, 188, -1, -1, -1, -1, 193, 28, -1, 30, 31, 198, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, 32, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 204, 205, 0, 206, 3, 4, 5, 6, 7, 13, 27, 28, 29, 49, 50, 51, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 78, 79, 80, 81, 82, 83, 84, 86, 87, 91, 92, 93, 94, 96, 98, 100, 103, 104, 108, 109, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 137, 138, 139, 140, 141, 143, 144, 145, 146, 147, 151, 154, 159, 160, 161, 162, 163, 165, 166, 168, 169, 170, 171, 174, 177, 183, 184, 186, 188, 189, 190, 193, 195, 196, 198, 199, 201, 202, 207, 210, 220, 221, 222, 223, 224, 227, 243, 244, 248, 251, 258, 264, 324, 325, 333, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 348, 351, 363, 364, 371, 374, 377, 383, 385, 386, 388, 398, 399, 400, 402, 407, 411, 431, 439, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 466, 468, 470, 122, 123, 124, 137, 159, 169, 193, 210, 243, 324, 345, 443, 345, 193, 345, 345, 345, 108, 345, 345, 345, 429, 430, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 81, 83, 91, 124, 139, 140, 141, 154, 193, 221, 364, 399, 402, 407, 443, 446, 443, 38, 345, 457, 458, 345, 124, 130, 193, 221, 256, 399, 400, 401, 403, 407, 440, 441, 442, 450, 454, 455, 193, 334, 404, 193, 334, 355, 335, 345, 229, 334, 193, 193, 193, 334, 195, 345, 210, 195, 345, 3, 4, 6, 7, 10, 11, 12, 13, 27, 29, 31, 57, 59, 71, 72, 73, 74, 75, 76, 77, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 130, 131, 132, 133, 137, 138, 142, 159, 163, 171, 173, 176, 183, 193, 210, 211, 212, 223, 471, 488, 489, 492, 195, 340, 342, 345, 196, 236, 345, 111, 112, 162, 213, 214, 215, 216, 220, 83, 198, 290, 291, 123, 130, 122, 130, 83, 292, 193, 193, 193, 193, 210, 262, 474, 193, 193, 70, 70, 70, 335, 83, 90, 155, 156, 157, 463, 464, 162, 196, 220, 220, 210, 263, 474, 163, 193, 474, 474, 83, 190, 196, 356, 27, 333, 337, 345, 346, 443, 447, 225, 196, 452, 90, 405, 463, 90, 463, 463, 32, 162, 179, 475, 193, 9, 195, 38, 242, 163, 261, 474, 124, 189, 243, 325, 195, 195, 195, 195, 195, 195, 195, 195, 10, 11, 12, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 69, 195, 70, 70, 196, 158, 131, 169, 171, 184, 186, 264, 323, 324, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 67, 68, 134, 135, 433, 70, 196, 438, 193, 193, 70, 196, 193, 242, 243, 14, 345, 195, 136, 48, 210, 428, 90, 333, 346, 158, 443, 136, 200, 9, 413, 257, 333, 346, 443, 475, 158, 193, 406, 433, 438, 194, 345, 32, 227, 8, 357, 9, 195, 227, 228, 335, 336, 345, 210, 276, 231, 195, 195, 195, 138, 142, 492, 492, 179, 491, 193, 111, 492, 14, 158, 138, 142, 159, 210, 212, 195, 195, 195, 237, 115, 176, 195, 213, 215, 213, 215, 220, 196, 9, 414, 195, 102, 162, 196, 443, 9, 195, 130, 130, 14, 9, 195, 443, 467, 335, 333, 346, 443, 446, 447, 194, 179, 254, 137, 443, 456, 457, 345, 365, 366, 335, 380, 380, 195, 70, 433, 155, 464, 82, 345, 443, 90, 155, 464, 220, 209, 195, 196, 249, 259, 389, 391, 91, 193, 358, 359, 361, 402, 449, 451, 468, 14, 102, 469, 352, 353, 354, 286, 287, 431, 432, 194, 194, 194, 194, 194, 197, 226, 227, 244, 251, 258, 431, 345, 199, 201, 202, 210, 476, 477, 492, 38, 172, 288, 289, 345, 471, 193, 474, 252, 242, 345, 345, 345, 345, 32, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 403, 345, 345, 453, 453, 345, 459, 460, 130, 196, 211, 212, 452, 262, 210, 263, 474, 474, 261, 243, 38, 337, 340, 342, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 163, 196, 210, 434, 435, 436, 437, 452, 453, 345, 288, 288, 453, 345, 456, 242, 194, 345, 193, 427, 9, 413, 194, 194, 38, 345, 38, 345, 406, 194, 194, 194, 450, 451, 452, 288, 196, 210, 434, 435, 452, 194, 225, 280, 196, 342, 345, 345, 94, 32, 227, 274, 195, 28, 102, 14, 9, 194, 32, 196, 277, 492, 31, 91, 223, 485, 486, 487, 193, 9, 50, 51, 56, 58, 70, 138, 139, 140, 141, 163, 183, 193, 221, 223, 372, 375, 378, 384, 399, 407, 408, 410, 210, 490, 225, 193, 235, 196, 195, 196, 195, 102, 162, 111, 112, 162, 216, 217, 218, 219, 220, 216, 210, 345, 291, 408, 83, 9, 194, 194, 194, 194, 194, 194, 194, 195, 50, 51, 481, 483, 484, 132, 267, 193, 9, 194, 194, 136, 200, 9, 413, 9, 413, 200, 200, 83, 85, 210, 465, 210, 70, 197, 197, 206, 208, 32, 133, 266, 178, 54, 163, 178, 393, 346, 136, 9, 413, 194, 158, 492, 492, 14, 357, 286, 225, 191, 9, 414, 492, 493, 433, 438, 433, 197, 9, 413, 180, 443, 345, 194, 9, 414, 14, 349, 245, 132, 265, 193, 474, 345, 32, 200, 200, 136, 197, 9, 413, 345, 475, 193, 255, 250, 260, 14, 469, 253, 242, 72, 443, 345, 475, 200, 197, 194, 194, 200, 197, 194, 50, 51, 70, 78, 79, 80, 91, 138, 139, 140, 141, 154, 183, 210, 373, 376, 379, 416, 418, 419, 423, 426, 210, 443, 443, 136, 265, 433, 438, 194, 345, 281, 75, 76, 282, 225, 334, 225, 336, 102, 38, 137, 271, 443, 408, 210, 32, 227, 275, 195, 278, 195, 278, 9, 413, 91, 136, 158, 9, 413, 194, 172, 476, 477, 478, 476, 408, 408, 408, 408, 408, 412, 415, 193, 70, 70, 70, 158, 193, 408, 158, 196, 10, 11, 12, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 69, 158, 475, 197, 399, 196, 239, 215, 215, 210, 216, 216, 220, 9, 414, 197, 197, 14, 443, 195, 180, 9, 413, 210, 268, 399, 196, 456, 137, 443, 14, 38, 345, 345, 200, 345, 197, 206, 492, 268, 196, 392, 14, 194, 345, 358, 452, 195, 492, 191, 197, 32, 479, 432, 38, 83, 172, 434, 435, 437, 434, 435, 492, 38, 172, 345, 408, 286, 193, 399, 266, 350, 246, 345, 345, 345, 197, 193, 288, 267, 32, 266, 492, 14, 265, 474, 403, 197, 193, 14, 78, 79, 80, 210, 417, 417, 419, 421, 422, 52, 193, 70, 70, 70, 90, 155, 193, 9, 413, 194, 427, 38, 345, 266, 197, 75, 76, 283, 334, 227, 197, 195, 95, 195, 271, 443, 193, 136, 270, 14, 225, 278, 105, 106, 107, 278, 197, 492, 180, 136, 492, 210, 485, 9, 194, 413, 136, 200, 9, 413, 412, 367, 368, 408, 381, 408, 409, 381, 130, 211, 358, 360, 362, 194, 130, 211, 408, 461, 462, 408, 408, 408, 32, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, 490, 83, 240, 197, 197, 219, 195, 408, 484, 102, 103, 480, 482, 9, 296, 194, 193, 337, 342, 345, 443, 136, 200, 197, 469, 296, 164, 177, 196, 388, 395, 164, 196, 394, 136, 195, 479, 492, 357, 493, 83, 172, 14, 83, 475, 443, 345, 194, 286, 196, 286, 193, 136, 193, 288, 194, 196, 492, 196, 195, 492, 266, 247, 406, 288, 136, 200, 9, 413, 418, 421, 369, 370, 419, 382, 419, 420, 382, 155, 358, 424, 425, 419, 443, 196, 334, 32, 77, 227, 195, 336, 270, 456, 271, 194, 408, 101, 105, 195, 345, 32, 195, 279, 197, 180, 492, 136, 172, 32, 194, 408, 408, 194, 200, 9, 413, 136, 200, 9, 413, 200, 136, 9, 413, 194, 136, 197, 9, 413, 408, 32, 194, 225, 195, 195, 210, 492, 492, 480, 399, 4, 112, 117, 123, 125, 165, 166, 168, 197, 297, 322, 323, 324, 329, 330, 331, 332, 431, 456, 38, 345, 197, 196, 197, 54, 345, 345, 345, 357, 38, 83, 172, 14, 83, 345, 193, 479, 194, 296, 194, 286, 345, 288, 194, 296, 469, 296, 195, 196, 193, 194, 419, 419, 194, 200, 9, 413, 136, 200, 9, 413, 200, 136, 194, 9, 413, 296, 32, 225, 195, 194, 194, 194, 232, 195, 195, 279, 225, 492, 492, 136, 408, 408, 408, 408, 358, 408, 408, 408, 196, 197, 482, 132, 133, 184, 211, 472, 492, 269, 399, 112, 332, 31, 125, 138, 142, 163, 169, 306, 307, 308, 309, 399, 167, 314, 315, 128, 193, 210, 316, 317, 298, 243, 492, 9, 195, 9, 195, 195, 469, 323, 194, 443, 293, 163, 390, 197, 197, 83, 172, 14, 83, 345, 288, 117, 347, 479, 197, 479, 194, 194, 197, 196, 197, 296, 286, 136, 419, 419, 419, 419, 358, 197, 225, 230, 233, 32, 227, 273, 225, 194, 408, 136, 136, 136, 225, 399, 399, 474, 14, 211, 9, 195, 196, 472, 469, 309, 179, 196, 9, 195, 3, 4, 5, 6, 7, 10, 11, 12, 13, 27, 28, 29, 57, 71, 72, 73, 74, 75, 76, 77, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 137, 138, 143, 144, 145, 146, 147, 159, 160, 161, 171, 173, 174, 176, 183, 184, 186, 188, 189, 210, 396, 397, 9, 195, 163, 167, 210, 317, 318, 319, 195, 83, 328, 242, 299, 472, 472, 14, 243, 197, 294, 295, 472, 14, 83, 345, 194, 193, 479, 195, 196, 320, 347, 479, 293, 197, 194, 419, 136, 136, 32, 227, 272, 273, 225, 408, 408, 408, 197, 195, 195, 408, 399, 302, 492, 310, 311, 407, 307, 14, 32, 51, 312, 315, 9, 36, 194, 31, 50, 53, 14, 9, 195, 212, 473, 328, 14, 492, 242, 195, 14, 345, 38, 83, 387, 196, 225, 479, 320, 197, 479, 419, 419, 225, 99, 238, 197, 210, 223, 303, 304, 305, 9, 413, 9, 413, 197, 408, 397, 397, 59, 313, 318, 318, 31, 50, 53, 408, 83, 179, 193, 195, 408, 474, 408, 83, 9, 414, 225, 197, 196, 320, 97, 195, 115, 234, 158, 102, 492, 180, 407, 170, 14, 481, 300, 193, 38, 83, 194, 197, 225, 195, 193, 176, 241, 210, 323, 324, 180, 408, 180, 284, 285, 432, 301, 83, 197, 399, 239, 173, 210, 195, 194, 9, 414, 119, 120, 121, 326, 327, 284, 83, 269, 195, 479, 432, 493, 194, 194, 195, 195, 196, 321, 326, 38, 83, 172, 479, 196, 225, 493, 83, 172, 14, 83, 321, 225, 197, 38, 83, 172, 14, 83, 345, 197, 83, 172, 14, 83, 345, 14, 83, 345, 345 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (&yylloc, _p, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).line0 = YYRHSLOC (Rhs, 1).line0; \ (Current).char0 = YYRHSLOC (Rhs, 1).char0; \ (Current).line1 = YYRHSLOC (Rhs, N).line1; \ (Current).char1 = YYRHSLOC (Rhs, N).char1; \ } \ else \ { \ (Current).line0 = (Current).line1 = \ YYRHSLOC (Rhs, 0).line1; \ (Current).char0 = (Current).char1 = \ YYRHSLOC (Rhs, 0).char1; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).line0, (Loc).char0, \ (Loc).line1, (Loc).char1) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) #else # define YYLEX yylex (&yylval, &yylloc, _p) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location, _p); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, HPHP::HPHP_PARSER_NS::Parser *_p) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, _p) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; HPHP::HPHP_PARSER_NS::Parser *_p; #endif { if (!yyvaluep) return; YYUSE (yylocationp); YYUSE (_p); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, HPHP::HPHP_PARSER_NS::Parser *_p) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, _p) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; HPHP::HPHP_PARSER_NS::Parser *_p; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, _p); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, HPHP::HPHP_PARSER_NS::Parser *_p) #else static void yy_reduce_print (yyvsp, yylsp, yyrule, _p) YYSTYPE *yyvsp; YYLTYPE *yylsp; int yyrule; HPHP::HPHP_PARSER_NS::Parser *_p; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , _p); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, yylsp, Rule, _p); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, HPHP::HPHP_PARSER_NS::Parser *_p) #else static void yydestruct (yymsg, yytype, yyvaluep, yylocationp, _p) const char *yymsg; int yytype; YYSTYPE *yyvaluep; YYLTYPE *yylocationp; HPHP::HPHP_PARSER_NS::Parser *_p; #endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (_p); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (HPHP::HPHP_PARSER_NS::Parser *_p); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (HPHP::HPHP_PARSER_NS::Parser *_p) #else int yyparse (_p) HPHP::HPHP_PARSER_NS::Parser *_p; #endif #endif { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Location data for the lookahead symbol. */ YYLTYPE yylloc; /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[2]; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yyls = yylsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; yylsp = yyls; #if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.line0 = yylloc.line1 = 1; yylloc.char0 = yylloc.char1 = 1; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; struct yyalloc *yyptr = (struct yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); memset(yyptr, 0, YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE_RESET (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 1455 of yacc.c */ #line 735 "hphp.y" { _p->onNewLabelScope(true); _p->initParseTree();;} break; case 3: /* Line 1455 of yacc.c */ #line 738 "hphp.y" { _p->popLabelInfo(); _p->finiParseTree(); _p->onCompleteLabelScope(true);;} break; case 4: /* Line 1455 of yacc.c */ #line 745 "hphp.y" { _p->addTopStatement((yyvsp[(2) - (2)]));;} break; case 5: /* Line 1455 of yacc.c */ #line 746 "hphp.y" { ;} break; case 6: /* Line 1455 of yacc.c */ #line 749 "hphp.y" { _p->nns((yyvsp[(1) - (1)]).num(), (yyvsp[(1) - (1)]).text()); (yyval) = (yyvsp[(1) - (1)]);;} break; case 7: /* Line 1455 of yacc.c */ #line 750 "hphp.y" { _p->nns(); (yyval) = (yyvsp[(1) - (1)]);;} break; case 8: /* Line 1455 of yacc.c */ #line 751 "hphp.y" { _p->nns(); (yyval) = (yyvsp[(1) - (1)]);;} break; case 9: /* Line 1455 of yacc.c */ #line 752 "hphp.y" { _p->nns(); (yyval) = (yyvsp[(1) - (1)]);;} break; case 10: /* Line 1455 of yacc.c */ #line 753 "hphp.y" { _p->nns(); (yyval) = (yyvsp[(1) - (1)]);;} break; case 11: /* Line 1455 of yacc.c */ #line 754 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 12: /* Line 1455 of yacc.c */ #line 755 "hphp.y" { _p->onHaltCompiler(); _p->finiParseTree(); YYACCEPT;;} break; case 13: /* Line 1455 of yacc.c */ #line 758 "hphp.y" { _p->onNamespaceStart((yyvsp[(2) - (3)]).text(), true); (yyval).reset();;} break; case 14: /* Line 1455 of yacc.c */ #line 760 "hphp.y" { _p->onNamespaceStart((yyvsp[(2) - (3)]).text());;} break; case 15: /* Line 1455 of yacc.c */ #line 761 "hphp.y" { _p->onNamespaceEnd(); (yyval) = (yyvsp[(5) - (6)]);;} break; case 16: /* Line 1455 of yacc.c */ #line 762 "hphp.y" { _p->onNamespaceStart("");;} break; case 17: /* Line 1455 of yacc.c */ #line 763 "hphp.y" { _p->onNamespaceEnd(); (yyval) = (yyvsp[(4) - (5)]);;} break; case 18: /* Line 1455 of yacc.c */ #line 764 "hphp.y" { _p->onUse((yyvsp[(2) - (3)]), &Parser::useClass); _p->nns(T_USE); (yyval).reset();;} break; case 19: /* Line 1455 of yacc.c */ #line 767 "hphp.y" { _p->onUse((yyvsp[(3) - (4)]), &Parser::useFunction); _p->nns(T_USE); (yyval).reset();;} break; case 20: /* Line 1455 of yacc.c */ #line 770 "hphp.y" { _p->onUse((yyvsp[(3) - (4)]), &Parser::useConst); _p->nns(T_USE); (yyval).reset();;} break; case 21: /* Line 1455 of yacc.c */ #line 773 "hphp.y" { _p->onGroupUse((yyvsp[(2) - (6)]).text(), (yyvsp[(4) - (6)]), nullptr); _p->nns(T_USE); (yyval).reset();;} break; case 22: /* Line 1455 of yacc.c */ #line 777 "hphp.y" { _p->onGroupUse((yyvsp[(3) - (7)]).text(), (yyvsp[(5) - (7)]), &Parser::useFunction); _p->nns(T_USE); (yyval).reset();;} break; case 23: /* Line 1455 of yacc.c */ #line 781 "hphp.y" { _p->onGroupUse((yyvsp[(3) - (7)]).text(), (yyvsp[(5) - (7)]), &Parser::useConst); _p->nns(T_USE); (yyval).reset();;} break; case 24: /* Line 1455 of yacc.c */ #line 784 "hphp.y" { _p->nns(); _p->finishStatement((yyval), (yyvsp[(1) - (2)])); (yyval) = 1;;} break; case 25: /* Line 1455 of yacc.c */ #line 789 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 26: /* Line 1455 of yacc.c */ #line 790 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 27: /* Line 1455 of yacc.c */ #line 791 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 28: /* Line 1455 of yacc.c */ #line 792 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 29: /* Line 1455 of yacc.c */ #line 793 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 30: /* Line 1455 of yacc.c */ #line 794 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 31: /* Line 1455 of yacc.c */ #line 795 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 32: /* Line 1455 of yacc.c */ #line 796 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 33: /* Line 1455 of yacc.c */ #line 797 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 34: /* Line 1455 of yacc.c */ #line 798 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 100: /* Line 1455 of yacc.c */ #line 876 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 101: /* Line 1455 of yacc.c */ #line 878 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 102: /* Line 1455 of yacc.c */ #line 883 "hphp.y" { _p->addStatement((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 103: /* Line 1455 of yacc.c */ #line 884 "hphp.y" { (yyval).reset(); _p->addStatement((yyval),(yyval),(yyvsp[(1) - (1)]));;} break; case 104: /* Line 1455 of yacc.c */ #line 890 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 105: /* Line 1455 of yacc.c */ #line 894 "hphp.y" { _p->onUseDeclaration((yyval), (yyvsp[(1) - (1)]).text(),"");;} break; case 106: /* Line 1455 of yacc.c */ #line 895 "hphp.y" { _p->onUseDeclaration((yyval), (yyvsp[(2) - (2)]).text(),"");;} break; case 107: /* Line 1455 of yacc.c */ #line 897 "hphp.y" { _p->onUseDeclaration((yyval), (yyvsp[(1) - (3)]).text(),(yyvsp[(3) - (3)]).text());;} break; case 108: /* Line 1455 of yacc.c */ #line 899 "hphp.y" { _p->onUseDeclaration((yyval), (yyvsp[(2) - (4)]).text(),(yyvsp[(4) - (4)]).text());;} break; case 109: /* Line 1455 of yacc.c */ #line 904 "hphp.y" { _p->addStatement((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 110: /* Line 1455 of yacc.c */ #line 905 "hphp.y" { (yyval).reset(); _p->addStatement((yyval),(yyval),(yyvsp[(1) - (1)]));;} break; case 111: /* Line 1455 of yacc.c */ #line 911 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 112: /* Line 1455 of yacc.c */ #line 915 "hphp.y" { _p->onMixedUseDeclaration((yyval), (yyvsp[(1) - (1)]), &Parser::useClass);;} break; case 113: /* Line 1455 of yacc.c */ #line 917 "hphp.y" { _p->onMixedUseDeclaration((yyval), (yyvsp[(2) - (2)]), &Parser::useFunction);;} break; case 114: /* Line 1455 of yacc.c */ #line 919 "hphp.y" { _p->onMixedUseDeclaration((yyval), (yyvsp[(2) - (2)]), &Parser::useConst);;} break; case 115: /* Line 1455 of yacc.c */ #line 924 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 116: /* Line 1455 of yacc.c */ #line 926 "hphp.y" { (yyval) = (yyvsp[(1) - (3)]) + (yyvsp[(2) - (3)]) + (yyvsp[(3) - (3)]); (yyval) = (yyvsp[(1) - (3)]).num() | 2;;} break; case 117: /* Line 1455 of yacc.c */ #line 929 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = (yyval).num() | 1;;} break; case 118: /* Line 1455 of yacc.c */ #line 931 "hphp.y" { (yyval).set((yyvsp[(3) - (3)]).num() | 2, _p->nsDecl((yyvsp[(3) - (3)]).text()));;} break; case 119: /* Line 1455 of yacc.c */ #line 932 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]); (yyval) = (yyval).num() | 2;;} break; case 120: /* Line 1455 of yacc.c */ #line 937 "hphp.y" { if ((yyvsp[(1) - (2)]).num() & 1) { (yyvsp[(1) - (2)]).setText(_p->resolve((yyvsp[(1) - (2)]).text(),0)); } (yyval) = (yyvsp[(1) - (2)]);;} break; case 121: /* Line 1455 of yacc.c */ #line 944 "hphp.y" { if ((yyvsp[(1) - (2)]).num() & 1) { (yyvsp[(1) - (2)]).setText(_p->resolve((yyvsp[(1) - (2)]).text(),1)); } _p->onTypeAnnotation((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 122: /* Line 1455 of yacc.c */ #line 952 "hphp.y" { (yyvsp[(3) - (5)]).setText(_p->nsDecl((yyvsp[(3) - (5)]).text())); _p->onConst((yyval),(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 123: /* Line 1455 of yacc.c */ #line 955 "hphp.y" { (yyvsp[(2) - (4)]).setText(_p->nsDecl((yyvsp[(2) - (4)]).text())); _p->onConst((yyval),(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)]));;} break; case 124: /* Line 1455 of yacc.c */ #line 961 "hphp.y" { _p->addStatement((yyval),(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 125: /* Line 1455 of yacc.c */ #line 962 "hphp.y" { _p->onStatementListStart((yyval));;} break; case 126: /* Line 1455 of yacc.c */ #line 965 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 127: /* Line 1455 of yacc.c */ #line 966 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 128: /* Line 1455 of yacc.c */ #line 967 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 129: /* Line 1455 of yacc.c */ #line 968 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 130: /* Line 1455 of yacc.c */ #line 971 "hphp.y" { _p->onBlock((yyval), (yyvsp[(2) - (3)]));;} break; case 131: /* Line 1455 of yacc.c */ #line 975 "hphp.y" { _p->onIf((yyval),(yyvsp[(2) - (5)]),(yyvsp[(3) - (5)]),(yyvsp[(4) - (5)]),(yyvsp[(5) - (5)]));;} break; case 132: /* Line 1455 of yacc.c */ #line 980 "hphp.y" { _p->onIf((yyval),(yyvsp[(2) - (8)]),(yyvsp[(4) - (8)]),(yyvsp[(5) - (8)]),(yyvsp[(6) - (8)]));;} break; case 133: /* Line 1455 of yacc.c */ #line 981 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 134: /* Line 1455 of yacc.c */ #line 983 "hphp.y" { _p->popLabelScope(); _p->onWhile((yyval),(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)])); _p->onCompleteLabelScope(false);;} break; case 135: /* Line 1455 of yacc.c */ #line 987 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 136: /* Line 1455 of yacc.c */ #line 990 "hphp.y" { _p->popLabelScope(); _p->onDo((yyval),(yyvsp[(3) - (6)]),(yyvsp[(5) - (6)])); _p->onCompleteLabelScope(false);;} break; case 137: /* Line 1455 of yacc.c */ #line 994 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 138: /* Line 1455 of yacc.c */ #line 996 "hphp.y" { _p->popLabelScope(); _p->onFor((yyval),(yyvsp[(3) - (10)]),(yyvsp[(5) - (10)]),(yyvsp[(7) - (10)]),(yyvsp[(10) - (10)])); _p->onCompleteLabelScope(false);;} break; case 139: /* Line 1455 of yacc.c */ #line 999 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 140: /* Line 1455 of yacc.c */ #line 1001 "hphp.y" { _p->popLabelScope(); _p->onSwitch((yyval),(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)])); _p->onCompleteLabelScope(false);;} break; case 141: /* Line 1455 of yacc.c */ #line 1004 "hphp.y" { _p->onBreakContinue((yyval), true, NULL);;} break; case 142: /* Line 1455 of yacc.c */ #line 1005 "hphp.y" { _p->onBreakContinue((yyval), true, &(yyvsp[(2) - (3)]));;} break; case 143: /* Line 1455 of yacc.c */ #line 1006 "hphp.y" { _p->onBreakContinue((yyval), false, NULL);;} break; case 144: /* Line 1455 of yacc.c */ #line 1007 "hphp.y" { _p->onBreakContinue((yyval), false, &(yyvsp[(2) - (3)]));;} break; case 145: /* Line 1455 of yacc.c */ #line 1008 "hphp.y" { _p->onReturn((yyval), NULL);;} break; case 146: /* Line 1455 of yacc.c */ #line 1009 "hphp.y" { _p->onReturn((yyval), &(yyvsp[(2) - (3)]));;} break; case 147: /* Line 1455 of yacc.c */ #line 1010 "hphp.y" { _p->onYieldBreak((yyval));;} break; case 148: /* Line 1455 of yacc.c */ #line 1011 "hphp.y" { _p->onGlobal((yyval), (yyvsp[(2) - (3)]));;} break; case 149: /* Line 1455 of yacc.c */ #line 1012 "hphp.y" { _p->onStatic((yyval), (yyvsp[(2) - (3)]));;} break; case 150: /* Line 1455 of yacc.c */ #line 1013 "hphp.y" { _p->onEcho((yyval), (yyvsp[(2) - (3)]), 0);;} break; case 151: /* Line 1455 of yacc.c */ #line 1014 "hphp.y" { _p->onEcho((yyval), (yyvsp[(2) - (3)]), 0);;} break; case 152: /* Line 1455 of yacc.c */ #line 1015 "hphp.y" { _p->onUnset((yyval), (yyvsp[(3) - (5)]));;} break; case 153: /* Line 1455 of yacc.c */ #line 1016 "hphp.y" { (yyval).reset(); (yyval) = ';';;} break; case 154: /* Line 1455 of yacc.c */ #line 1017 "hphp.y" { _p->onEcho((yyval), (yyvsp[(1) - (1)]), 1);;} break; case 155: /* Line 1455 of yacc.c */ #line 1018 "hphp.y" { _p->onHashBang((yyval), (yyvsp[(1) - (1)])); (yyval) = T_HASHBANG;;} break; case 156: /* Line 1455 of yacc.c */ #line 1022 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 157: /* Line 1455 of yacc.c */ #line 1024 "hphp.y" { _p->popLabelScope(); _p->onForEach((yyval),(yyvsp[(3) - (9)]),(yyvsp[(5) - (9)]),(yyvsp[(6) - (9)]),(yyvsp[(9) - (9)]), false); _p->onCompleteLabelScope(false);;} break; case 158: /* Line 1455 of yacc.c */ #line 1029 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 159: /* Line 1455 of yacc.c */ #line 1031 "hphp.y" { _p->popLabelScope(); _p->onForEach((yyval),(yyvsp[(3) - (10)]),(yyvsp[(6) - (10)]),(yyvsp[(7) - (10)]),(yyvsp[(10) - (10)]), true); _p->onCompleteLabelScope(false);;} break; case 160: /* Line 1455 of yacc.c */ #line 1035 "hphp.y" { _p->onDeclare((yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); (yyval) = (yyvsp[(3) - (5)]); (yyval) = T_DECLARE;;} break; case 161: /* Line 1455 of yacc.c */ #line 1044 "hphp.y" { _p->onCompleteLabelScope(false);;} break; case 162: /* Line 1455 of yacc.c */ #line 1045 "hphp.y" { _p->onTry((yyval),(yyvsp[(2) - (13)]),(yyvsp[(5) - (13)]),(yyvsp[(6) - (13)]),(yyvsp[(9) - (13)]),(yyvsp[(11) - (13)]),(yyvsp[(13) - (13)]));;} break; case 163: /* Line 1455 of yacc.c */ #line 1048 "hphp.y" { _p->onCompleteLabelScope(false);;} break; case 164: /* Line 1455 of yacc.c */ #line 1049 "hphp.y" { _p->onTry((yyval), (yyvsp[(2) - (5)]), (yyvsp[(5) - (5)]));;} break; case 165: /* Line 1455 of yacc.c */ #line 1050 "hphp.y" { _p->onThrow((yyval), (yyvsp[(2) - (3)]));;} break; case 166: /* Line 1455 of yacc.c */ #line 1051 "hphp.y" { _p->onGoto((yyval), (yyvsp[(2) - (3)]), true); _p->addGoto((yyvsp[(2) - (3)]).text(), _p->getRange(), &(yyval));;} break; case 167: /* Line 1455 of yacc.c */ #line 1055 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 168: /* Line 1455 of yacc.c */ #line 1056 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 169: /* Line 1455 of yacc.c */ #line 1057 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 170: /* Line 1455 of yacc.c */ #line 1058 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 171: /* Line 1455 of yacc.c */ #line 1059 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 172: /* Line 1455 of yacc.c */ #line 1060 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 173: /* Line 1455 of yacc.c */ #line 1061 "hphp.y" { _p->onReturn((yyval), &(yyvsp[(2) - (3)]));;} break; case 174: /* Line 1455 of yacc.c */ #line 1062 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 175: /* Line 1455 of yacc.c */ #line 1063 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 176: /* Line 1455 of yacc.c */ #line 1064 "hphp.y" { _p->onReturn((yyval), &(yyvsp[(2) - (3)])); ;} break; case 177: /* Line 1455 of yacc.c */ #line 1065 "hphp.y" { _p->onExpStatement((yyval), (yyvsp[(1) - (2)]));;} break; case 178: /* Line 1455 of yacc.c */ #line 1066 "hphp.y" { _p->onLabel((yyval), (yyvsp[(1) - (2)])); _p->addLabel((yyvsp[(1) - (2)]).text(), _p->getRange(), &(yyval)); _p->onScopeLabel((yyval), (yyvsp[(1) - (2)]));;} break; case 179: /* Line 1455 of yacc.c */ #line 1074 "hphp.y" { _p->onNewLabelScope(false);;} break; case 180: /* Line 1455 of yacc.c */ #line 1075 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]);;} break; case 181: /* Line 1455 of yacc.c */ #line 1084 "hphp.y" { _p->onCatch((yyval), (yyvsp[(1) - (9)]), (yyvsp[(4) - (9)]), (yyvsp[(5) - (9)]), (yyvsp[(8) - (9)]));;} break; case 182: /* Line 1455 of yacc.c */ #line 1085 "hphp.y" { (yyval).reset();;} break; case 183: /* Line 1455 of yacc.c */ #line 1089 "hphp.y" { _p->onNewLabelScope(false); _p->pushLabelScope();;} break; case 184: /* Line 1455 of yacc.c */ #line 1091 "hphp.y" { _p->popLabelScope(); _p->onFinally((yyval), (yyvsp[(3) - (4)])); _p->onCompleteLabelScope(false);;} break; case 185: /* Line 1455 of yacc.c */ #line 1097 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 186: /* Line 1455 of yacc.c */ #line 1098 "hphp.y" { (yyval).reset();;} break; case 187: /* Line 1455 of yacc.c */ #line 1102 "hphp.y" { (yyval) = 1;;} break; case 188: /* Line 1455 of yacc.c */ #line 1103 "hphp.y" { (yyval).reset();;} break; case 189: /* Line 1455 of yacc.c */ #line 1107 "hphp.y" { _p->pushFuncLocation(); ;} break; case 190: /* Line 1455 of yacc.c */ #line 1113 "hphp.y" { (yyvsp[(3) - (3)]).setText(_p->nsDecl((yyvsp[(3) - (3)]).text())); _p->onNewLabelScope(true); _p->onFunctionStart((yyvsp[(3) - (3)])); _p->pushLabelInfo();;} break; case 191: /* Line 1455 of yacc.c */ #line 1119 "hphp.y" { _p->onFunction((yyval),nullptr,(yyvsp[(8) - (9)]),(yyvsp[(2) - (9)]),(yyvsp[(3) - (9)]),(yyvsp[(6) - (9)]),(yyvsp[(9) - (9)]),nullptr); _p->popLabelInfo(); _p->popTypeScope(); _p->onCompleteLabelScope(true);;} break; case 192: /* Line 1455 of yacc.c */ #line 1126 "hphp.y" { (yyvsp[(4) - (4)]).setText(_p->nsDecl((yyvsp[(4) - (4)]).text())); _p->onNewLabelScope(true); _p->onFunctionStart((yyvsp[(4) - (4)])); _p->pushLabelInfo();;} break; case 193: /* Line 1455 of yacc.c */ #line 1132 "hphp.y" { _p->onFunction((yyval),&(yyvsp[(1) - (10)]),(yyvsp[(9) - (10)]),(yyvsp[(3) - (10)]),(yyvsp[(4) - (10)]),(yyvsp[(7) - (10)]),(yyvsp[(10) - (10)]),nullptr); _p->popLabelInfo(); _p->popTypeScope(); _p->onCompleteLabelScope(true);;} break; case 194: /* Line 1455 of yacc.c */ #line 1139 "hphp.y" { (yyvsp[(5) - (5)]).setText(_p->nsDecl((yyvsp[(5) - (5)]).text())); _p->onNewLabelScope(true); _p->onFunctionStart((yyvsp[(5) - (5)])); _p->pushLabelInfo();;} break; case 195: /* Line 1455 of yacc.c */ #line 1145 "hphp.y" { _p->onFunction((yyval),&(yyvsp[(2) - (11)]),(yyvsp[(10) - (11)]),(yyvsp[(4) - (11)]),(yyvsp[(5) - (11)]),(yyvsp[(8) - (11)]),(yyvsp[(11) - (11)]),&(yyvsp[(1) - (11)])); _p->popLabelInfo(); _p->popTypeScope(); _p->onCompleteLabelScope(true);;} break; case 196: /* Line 1455 of yacc.c */ #line 1153 "hphp.y" { (yyvsp[(2) - (2)]).setText(_p->nsClassDecl((yyvsp[(2) - (2)]).text())); _p->onClassStart(T_ENUM,(yyvsp[(2) - (2)]));;} break; case 197: /* Line 1455 of yacc.c */ #line 1157 "hphp.y" { _p->onEnum((yyval),(yyvsp[(2) - (9)]),(yyvsp[(5) - (9)]),(yyvsp[(8) - (9)]),0); ;} break; case 198: /* Line 1455 of yacc.c */ #line 1161 "hphp.y" { (yyvsp[(3) - (3)]).setText(_p->nsClassDecl((yyvsp[(3) - (3)]).text())); _p->onClassStart(T_ENUM,(yyvsp[(3) - (3)]));;} break; case 199: /* Line 1455 of yacc.c */ #line 1165 "hphp.y" { _p->onEnum((yyval),(yyvsp[(3) - (10)]),(yyvsp[(6) - (10)]),(yyvsp[(9) - (10)]),&(yyvsp[(1) - (10)])); ;} break; case 200: /* Line 1455 of yacc.c */ #line 1171 "hphp.y" { (yyvsp[(2) - (2)]).setText(_p->nsClassDecl((yyvsp[(2) - (2)]).text())); _p->onClassStart((yyvsp[(1) - (2)]).num(),(yyvsp[(2) - (2)]));;} break; case 201: /* Line 1455 of yacc.c */ #line 1174 "hphp.y" { Token stmts; if (_p->peekClass()) { xhp_collect_attributes(_p,stmts,(yyvsp[(7) - (8)])); } else { stmts = (yyvsp[(7) - (8)]); } _p->onClass((yyval),(yyvsp[(1) - (8)]).num(),(yyvsp[(2) - (8)]),(yyvsp[(4) - (8)]),(yyvsp[(5) - (8)]), stmts,0,nullptr); if (_p->peekClass()) { _p->xhpResetAttributes(); } _p->popClass(); _p->popTypeScope();;} break; case 202: /* Line 1455 of yacc.c */ #line 1189 "hphp.y" { (yyvsp[(3) - (3)]).setText(_p->nsClassDecl((yyvsp[(3) - (3)]).text())); _p->onClassStart((yyvsp[(2) - (3)]).num(),(yyvsp[(3) - (3)]));;} break; case 203: /* Line 1455 of yacc.c */ #line 1192 "hphp.y" { Token stmts; if (_p->peekClass()) { xhp_collect_attributes(_p,stmts,(yyvsp[(8) - (9)])); } else { stmts = (yyvsp[(8) - (9)]); } _p->onClass((yyval),(yyvsp[(2) - (9)]).num(),(yyvsp[(3) - (9)]),(yyvsp[(5) - (9)]),(yyvsp[(6) - (9)]), stmts,&(yyvsp[(1) - (9)]),nullptr); if (_p->peekClass()) { _p->xhpResetAttributes(); } _p->popClass(); _p->popTypeScope();;} break; case 204: /* Line 1455 of yacc.c */ #line 1206 "hphp.y" { (yyvsp[(2) - (2)]).setText(_p->nsClassDecl((yyvsp[(2) - (2)]).text())); _p->onClassStart(T_INTERFACE,(yyvsp[(2) - (2)]));;} break; case 205: /* Line 1455 of yacc.c */ #line 1209 "hphp.y" { _p->onInterface((yyval),(yyvsp[(2) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(6) - (7)]),0); _p->popClass(); _p->popTypeScope();;} break; case 206: /* Line 1455 of yacc.c */ #line 1214 "hphp.y" { (yyvsp[(3) - (3)]).setText(_p->nsClassDecl((yyvsp[(3) - (3)]).text())); _p->onClassStart(T_INTERFACE,(yyvsp[(3) - (3)]));;} break; case 207: /* Line 1455 of yacc.c */ #line 1217 "hphp.y" { _p->onInterface((yyval),(yyvsp[(3) - (8)]),(yyvsp[(5) - (8)]),(yyvsp[(7) - (8)]),&(yyvsp[(1) - (8)])); _p->popClass(); _p->popTypeScope();;} break; case 208: /* Line 1455 of yacc.c */ #line 1223 "hphp.y" { _p->onClassExpressionStart(); ;} break; case 209: /* Line 1455 of yacc.c */ #line 1226 "hphp.y" { _p->onClassExpression((yyval), (yyvsp[(3) - (8)]), (yyvsp[(4) - (8)]), (yyvsp[(5) - (8)]), (yyvsp[(7) - (8)])); ;} break; case 210: /* Line 1455 of yacc.c */ #line 1230 "hphp.y" { (yyvsp[(2) - (2)]).setText(_p->nsClassDecl((yyvsp[(2) - (2)]).text())); _p->onClassStart(T_TRAIT, (yyvsp[(2) - (2)]));;} break; case 211: /* Line 1455 of yacc.c */ #line 1233 "hphp.y" { Token t_ext; t_ext.reset(); _p->onClass((yyval),T_TRAIT,(yyvsp[(2) - (7)]),t_ext,(yyvsp[(4) - (7)]), (yyvsp[(6) - (7)]), 0, nullptr); _p->popClass(); _p->popTypeScope();;} break; case 212: /* Line 1455 of yacc.c */ #line 1241 "hphp.y" { (yyvsp[(3) - (3)]).setText(_p->nsClassDecl((yyvsp[(3) - (3)]).text())); _p->onClassStart(T_TRAIT, (yyvsp[(3) - (3)]));;} break; case 213: /* Line 1455 of yacc.c */ #line 1244 "hphp.y" { Token t_ext; t_ext.reset(); _p->onClass((yyval),T_TRAIT,(yyvsp[(3) - (8)]),t_ext,(yyvsp[(5) - (8)]), (yyvsp[(7) - (8)]), &(yyvsp[(1) - (8)]), nullptr); _p->popClass(); _p->popTypeScope();;} break; case 214: /* Line 1455 of yacc.c */ #line 1252 "hphp.y" { _p->pushClass(false); (yyval) = (yyvsp[(1) - (1)]);;} break; case 215: /* Line 1455 of yacc.c */ #line 1253 "hphp.y" { (yyvsp[(1) - (1)]).xhpLabel(); _p->pushTypeScope(); _p->pushClass(true); (yyval) = (yyvsp[(1) - (1)]);;} break; case 216: /* Line 1455 of yacc.c */ #line 1257 "hphp.y" { _p->pushClass(false); (yyval) = (yyvsp[(1) - (1)]);;} break; case 217: /* Line 1455 of yacc.c */ #line 1260 "hphp.y" { _p->pushClass(false); (yyval) = (yyvsp[(1) - (1)]);;} break; case 218: /* Line 1455 of yacc.c */ #line 1263 "hphp.y" { (yyval) = T_CLASS;;} break; case 219: /* Line 1455 of yacc.c */ #line 1264 "hphp.y" { (yyval) = T_ABSTRACT; ;} break; case 220: /* Line 1455 of yacc.c */ #line 1265 "hphp.y" { only_in_hh_syntax(_p); /* hacky, but transforming to a single token is quite convenient */ (yyval) = T_STATIC; ;} break; case 221: /* Line 1455 of yacc.c */ #line 1268 "hphp.y" { only_in_hh_syntax(_p); (yyval) = T_STATIC; ;} break; case 222: /* Line 1455 of yacc.c */ #line 1269 "hphp.y" { (yyval) = T_FINAL;;} break; case 223: /* Line 1455 of yacc.c */ #line 1273 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 224: /* Line 1455 of yacc.c */ #line 1274 "hphp.y" { (yyval).reset();;} break; case 225: /* Line 1455 of yacc.c */ #line 1277 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 226: /* Line 1455 of yacc.c */ #line 1278 "hphp.y" { (yyval).reset();;} break; case 227: /* Line 1455 of yacc.c */ #line 1281 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 228: /* Line 1455 of yacc.c */ #line 1282 "hphp.y" { (yyval).reset();;} break; case 229: /* Line 1455 of yacc.c */ #line 1285 "hphp.y" { _p->onInterfaceName((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 230: /* Line 1455 of yacc.c */ #line 1287 "hphp.y" { _p->onInterfaceName((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 231: /* Line 1455 of yacc.c */ #line 1290 "hphp.y" { _p->onTraitName((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 232: /* Line 1455 of yacc.c */ #line 1292 "hphp.y" { _p->onTraitName((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 233: /* Line 1455 of yacc.c */ #line 1296 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 234: /* Line 1455 of yacc.c */ #line 1297 "hphp.y" { (yyval).reset();;} break; case 235: /* Line 1455 of yacc.c */ #line 1300 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = 0;;} break; case 236: /* Line 1455 of yacc.c */ #line 1301 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]); (yyval) = 1;;} break; case 237: /* Line 1455 of yacc.c */ #line 1302 "hphp.y" { _p->onListAssignment((yyval), (yyvsp[(3) - (4)]), NULL);;} break; case 238: /* Line 1455 of yacc.c */ #line 1306 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 239: /* Line 1455 of yacc.c */ #line 1308 "hphp.y" { (yyval) = (yyvsp[(2) - (4)]);;} break; case 240: /* Line 1455 of yacc.c */ #line 1311 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 241: /* Line 1455 of yacc.c */ #line 1313 "hphp.y" { (yyval) = (yyvsp[(2) - (4)]);;} break; case 242: /* Line 1455 of yacc.c */ #line 1316 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 243: /* Line 1455 of yacc.c */ #line 1318 "hphp.y" { (yyval) = (yyvsp[(2) - (4)]);;} break; case 244: /* Line 1455 of yacc.c */ #line 1321 "hphp.y" { _p->onBlock((yyval), (yyvsp[(1) - (1)]));;} break; case 245: /* Line 1455 of yacc.c */ #line 1323 "hphp.y" { _p->onBlock((yyval), (yyvsp[(2) - (4)]));;} break; case 246: /* Line 1455 of yacc.c */ #line 1327 "hphp.y" {_p->onDeclareList((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 247: /* Line 1455 of yacc.c */ #line 1329 "hphp.y" {_p->onDeclareList((yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); (yyval) = (yyvsp[(1) - (5)]);;} break; case 248: /* Line 1455 of yacc.c */ #line 1334 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 249: /* Line 1455 of yacc.c */ #line 1335 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]);;} break; case 250: /* Line 1455 of yacc.c */ #line 1336 "hphp.y" { (yyval) = (yyvsp[(2) - (4)]);;} break; case 251: /* Line 1455 of yacc.c */ #line 1337 "hphp.y" { (yyval) = (yyvsp[(3) - (5)]);;} break; case 252: /* Line 1455 of yacc.c */ #line 1342 "hphp.y" { _p->onCase((yyval),(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 253: /* Line 1455 of yacc.c */ #line 1344 "hphp.y" { _p->onCase((yyval),(yyvsp[(1) - (4)]),NULL,(yyvsp[(4) - (4)]));;} break; case 254: /* Line 1455 of yacc.c */ #line 1345 "hphp.y" { (yyval).reset();;} break; case 255: /* Line 1455 of yacc.c */ #line 1348 "hphp.y" { (yyval).reset();;} break; case 256: /* Line 1455 of yacc.c */ #line 1349 "hphp.y" { (yyval).reset();;} break; case 257: /* Line 1455 of yacc.c */ #line 1354 "hphp.y" { _p->onElseIf((yyval),(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),(yyvsp[(4) - (4)]));;} break; case 258: /* Line 1455 of yacc.c */ #line 1355 "hphp.y" { (yyval).reset();;} break; case 259: /* Line 1455 of yacc.c */ #line 1360 "hphp.y" { _p->onElseIf((yyval),(yyvsp[(1) - (5)]),(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 260: /* Line 1455 of yacc.c */ #line 1361 "hphp.y" { (yyval).reset();;} break; case 261: /* Line 1455 of yacc.c */ #line 1364 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 262: /* Line 1455 of yacc.c */ #line 1365 "hphp.y" { (yyval).reset();;} break; case 263: /* Line 1455 of yacc.c */ #line 1368 "hphp.y" { (yyval) = (yyvsp[(3) - (3)]);;} break; case 264: /* Line 1455 of yacc.c */ #line 1369 "hphp.y" { (yyval).reset();;} break; case 265: /* Line 1455 of yacc.c */ #line 1377 "hphp.y" { _p->onVariadicParam((yyval),&(yyvsp[(1) - (7)]),(yyvsp[(5) - (7)]),(yyvsp[(7) - (7)]),false, &(yyvsp[(3) - (7)]),&(yyvsp[(4) - (7)])); ;} break; case 266: /* Line 1455 of yacc.c */ #line 1383 "hphp.y" { _p->onVariadicParam((yyval),&(yyvsp[(1) - (8)]),(yyvsp[(5) - (8)]),(yyvsp[(8) - (8)]),true, &(yyvsp[(3) - (8)]),&(yyvsp[(4) - (8)])); ;} break; case 267: /* Line 1455 of yacc.c */ #line 1389 "hphp.y" { validate_hh_variadic_variant( _p, (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]), &(yyvsp[(4) - (6)])); (yyval) = (yyvsp[(1) - (6)]); ;} break; case 268: /* Line 1455 of yacc.c */ #line 1393 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 269: /* Line 1455 of yacc.c */ #line 1397 "hphp.y" { _p->onVariadicParam((yyval),NULL,(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),false, &(yyvsp[(1) - (5)]),&(yyvsp[(2) - (5)])); ;} break; case 270: /* Line 1455 of yacc.c */ #line 1402 "hphp.y" { _p->onVariadicParam((yyval),NULL,(yyvsp[(3) - (6)]),(yyvsp[(6) - (6)]),true, &(yyvsp[(1) - (6)]),&(yyvsp[(2) - (6)])); ;} break; case 271: /* Line 1455 of yacc.c */ #line 1407 "hphp.y" { validate_hh_variadic_variant( _p, (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]), &(yyvsp[(2) - (4)])); (yyval).reset(); ;} break; case 272: /* Line 1455 of yacc.c */ #line 1410 "hphp.y" { (yyval).reset(); ;} break; case 273: /* Line 1455 of yacc.c */ #line 1416 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(3) - (4)]),(yyvsp[(4) - (4)]),0, NULL,&(yyvsp[(1) - (4)]),&(yyvsp[(2) - (4)]));;} break; case 274: /* Line 1455 of yacc.c */ #line 1420 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),1, NULL,&(yyvsp[(1) - (5)]),&(yyvsp[(2) - (5)]));;} break; case 275: /* Line 1455 of yacc.c */ #line 1425 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(3) - (7)]),(yyvsp[(5) - (7)]),1, &(yyvsp[(7) - (7)]),&(yyvsp[(1) - (7)]),&(yyvsp[(2) - (7)]));;} break; case 276: /* Line 1455 of yacc.c */ #line 1430 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(3) - (6)]),(yyvsp[(4) - (6)]),0, &(yyvsp[(6) - (6)]),&(yyvsp[(1) - (6)]),&(yyvsp[(2) - (6)]));;} break; case 277: /* Line 1455 of yacc.c */ #line 1435 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (6)]),(yyvsp[(5) - (6)]),(yyvsp[(6) - (6)]),0, NULL,&(yyvsp[(3) - (6)]),&(yyvsp[(4) - (6)]));;} break; case 278: /* Line 1455 of yacc.c */ #line 1440 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (7)]),(yyvsp[(5) - (7)]),(yyvsp[(7) - (7)]),1, NULL,&(yyvsp[(3) - (7)]),&(yyvsp[(4) - (7)]));;} break; case 279: /* Line 1455 of yacc.c */ #line 1446 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (9)]),(yyvsp[(5) - (9)]),(yyvsp[(7) - (9)]),1, &(yyvsp[(9) - (9)]),&(yyvsp[(3) - (9)]),&(yyvsp[(4) - (9)]));;} break; case 280: /* Line 1455 of yacc.c */ #line 1452 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (8)]),(yyvsp[(5) - (8)]),(yyvsp[(6) - (8)]),0, &(yyvsp[(8) - (8)]),&(yyvsp[(3) - (8)]),&(yyvsp[(4) - (8)]));;} break; case 281: /* Line 1455 of yacc.c */ #line 1460 "hphp.y" { _p->onVariadicParam((yyval),&(yyvsp[(1) - (6)]),(yyvsp[(4) - (6)]),(yyvsp[(6) - (6)]), false,&(yyvsp[(3) - (6)]),NULL); ;} break; case 282: /* Line 1455 of yacc.c */ #line 1465 "hphp.y" { _p->onVariadicParam((yyval),&(yyvsp[(1) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(7) - (7)]), true,&(yyvsp[(3) - (7)]),NULL); ;} break; case 283: /* Line 1455 of yacc.c */ #line 1470 "hphp.y" { validate_hh_variadic_variant( _p, (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), NULL); (yyval) = (yyvsp[(1) - (5)]); ;} break; case 284: /* Line 1455 of yacc.c */ #line 1474 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 285: /* Line 1455 of yacc.c */ #line 1477 "hphp.y" { _p->onVariadicParam((yyval),NULL,(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)]), false,&(yyvsp[(1) - (4)]),NULL); ;} break; case 286: /* Line 1455 of yacc.c */ #line 1481 "hphp.y" { _p->onVariadicParam((yyval),NULL,(yyvsp[(2) - (5)]),(yyvsp[(5) - (5)]), true,&(yyvsp[(1) - (5)]),NULL); ;} break; case 287: /* Line 1455 of yacc.c */ #line 1485 "hphp.y" { validate_hh_variadic_variant( _p, (yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), NULL); (yyval).reset(); ;} break; case 288: /* Line 1455 of yacc.c */ #line 1488 "hphp.y" { (yyval).reset();;} break; case 289: /* Line 1455 of yacc.c */ #line 1493 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(2) - (3)]),(yyvsp[(3) - (3)]),false, NULL,&(yyvsp[(1) - (3)]),NULL); ;} break; case 290: /* Line 1455 of yacc.c */ #line 1496 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)]),true, NULL,&(yyvsp[(1) - (4)]),NULL); ;} break; case 291: /* Line 1455 of yacc.c */ #line 1500 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(2) - (6)]),(yyvsp[(4) - (6)]),true, &(yyvsp[(6) - (6)]),&(yyvsp[(1) - (6)]),NULL); ;} break; case 292: /* Line 1455 of yacc.c */ #line 1504 "hphp.y" { _p->onParam((yyval),NULL,(yyvsp[(2) - (5)]),(yyvsp[(3) - (5)]),false, &(yyvsp[(5) - (5)]),&(yyvsp[(1) - (5)]),NULL); ;} break; case 293: /* Line 1455 of yacc.c */ #line 1508 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (5)]),(yyvsp[(4) - (5)]),(yyvsp[(5) - (5)]),false, NULL,&(yyvsp[(3) - (5)]),NULL); ;} break; case 294: /* Line 1455 of yacc.c */ #line 1512 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (6)]),(yyvsp[(4) - (6)]),(yyvsp[(6) - (6)]),true, NULL,&(yyvsp[(3) - (6)]),NULL); ;} break; case 295: /* Line 1455 of yacc.c */ #line 1517 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (8)]),(yyvsp[(4) - (8)]),(yyvsp[(6) - (8)]),true, &(yyvsp[(8) - (8)]),&(yyvsp[(3) - (8)]),NULL); ;} break; case 296: /* Line 1455 of yacc.c */ #line 1522 "hphp.y" { _p->onParam((yyval),&(yyvsp[(1) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(5) - (7)]),false, &(yyvsp[(7) - (7)]),&(yyvsp[(3) - (7)]),NULL); ;} break; case 297: /* Line 1455 of yacc.c */ #line 1528 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 298: /* Line 1455 of yacc.c */ #line 1529 "hphp.y" { (yyval).reset();;} break; case 299: /* Line 1455 of yacc.c */ #line 1532 "hphp.y" { _p->onCallParam((yyval),NULL,(yyvsp[(1) - (1)]),false,false);;} break; case 300: /* Line 1455 of yacc.c */ #line 1533 "hphp.y" { _p->onCallParam((yyval),NULL,(yyvsp[(2) - (2)]),true,false);;} break; case 301: /* Line 1455 of yacc.c */ #line 1534 "hphp.y" { _p->onCallParam((yyval),NULL,(yyvsp[(2) - (2)]),false,true);;} break; case 302: /* Line 1455 of yacc.c */ #line 1536 "hphp.y" { _p->onCallParam((yyval),&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),false, false);;} break; case 303: /* Line 1455 of yacc.c */ #line 1538 "hphp.y" { _p->onCallParam((yyval),&(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),false,true);;} break; case 304: /* Line 1455 of yacc.c */ #line 1540 "hphp.y" { _p->onCallParam((yyval),&(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),true, false);;} break; case 305: /* Line 1455 of yacc.c */ #line 1544 "hphp.y" { _p->onGlobalVar((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 306: /* Line 1455 of yacc.c */ #line 1545 "hphp.y" { _p->onGlobalVar((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 307: /* Line 1455 of yacc.c */ #line 1548 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 308: /* Line 1455 of yacc.c */ #line 1549 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]); (yyval) = 1;;} break; case 309: /* Line 1455 of yacc.c */ #line 1550 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]); (yyval) = 1;;} break; case 310: /* Line 1455 of yacc.c */ #line 1554 "hphp.y" { _p->onStaticVariable((yyval),&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 311: /* Line 1455 of yacc.c */ #line 1556 "hphp.y" { _p->onStaticVariable((yyval),&(yyvsp[(1) - (5)]),(yyvsp[(3) - (5)]),&(yyvsp[(5) - (5)]));;} break; case 312: /* Line 1455 of yacc.c */ #line 1557 "hphp.y" { _p->onStaticVariable((yyval),0,(yyvsp[(1) - (1)]),0);;} break; case 313: /* Line 1455 of yacc.c */ #line 1558 "hphp.y" { _p->onStaticVariable((yyval),0,(yyvsp[(1) - (3)]),&(yyvsp[(3) - (3)]));;} break; case 314: /* Line 1455 of yacc.c */ #line 1563 "hphp.y" { _p->onClassStatement((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 315: /* Line 1455 of yacc.c */ #line 1564 "hphp.y" { (yyval).reset();;} break; case 316: /* Line 1455 of yacc.c */ #line 1567 "hphp.y" { _p->onClassVariableStart ((yyval),NULL,(yyvsp[(1) - (2)]),NULL);;} break; case 317: /* Line 1455 of yacc.c */ #line 1572 "hphp.y" { _p->onClassConstant((yyval),0,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 318: /* Line 1455 of yacc.c */ #line 1578 "hphp.y" { _p->onClassStatement((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 319: /* Line 1455 of yacc.c */ #line 1579 "hphp.y" { (yyval).reset();;} break; case 320: /* Line 1455 of yacc.c */ #line 1582 "hphp.y" { _p->onClassVariableModifer((yyvsp[(1) - (1)]));;} break; case 321: /* Line 1455 of yacc.c */ #line 1583 "hphp.y" { _p->onClassVariableStart ((yyval),&(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 322: /* Line 1455 of yacc.c */ #line 1586 "hphp.y" { _p->onClassVariableModifer((yyvsp[(1) - (2)]));;} break; case 323: /* Line 1455 of yacc.c */ #line 1587 "hphp.y" { _p->onClassVariableStart ((yyval),&(yyvsp[(1) - (5)]),(yyvsp[(4) - (5)]),&(yyvsp[(2) - (5)]));;} break; case 324: /* Line 1455 of yacc.c */ #line 1589 "hphp.y" { _p->onClassVariableStart ((yyval),NULL,(yyvsp[(1) - (2)]),NULL);;} break; case 325: /* Line 1455 of yacc.c */ #line 1592 "hphp.y" { _p->onClassVariableStart ((yyval),NULL,(yyvsp[(1) - (2)]),NULL, true);;} break; case 326: /* Line 1455 of yacc.c */ #line 1594 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 327: /* Line 1455 of yacc.c */ #line 1597 "hphp.y" { _p->onNewLabelScope(true); _p->onMethodStart((yyvsp[(4) - (5)]), (yyvsp[(1) - (5)])); _p->pushLabelInfo();;} break; case 328: /* Line 1455 of yacc.c */ #line 1603 "hphp.y" { _p->onMethod((yyval),(yyvsp[(1) - (10)]),(yyvsp[(9) - (10)]),(yyvsp[(3) - (10)]),(yyvsp[(4) - (10)]),(yyvsp[(7) - (10)]),(yyvsp[(10) - (10)]),nullptr); _p->popLabelInfo(); _p->popTypeScope(); _p->onCompleteLabelScope(true);;} break; case 329: /* Line 1455 of yacc.c */ #line 1611 "hphp.y" { _p->onNewLabelScope(true); _p->onMethodStart((yyvsp[(5) - (6)]), (yyvsp[(2) - (6)])); _p->pushLabelInfo();;} break; case 330: /* Line 1455 of yacc.c */ #line 1617 "hphp.y" { _p->onMethod((yyval),(yyvsp[(2) - (11)]),(yyvsp[(10) - (11)]),(yyvsp[(4) - (11)]),(yyvsp[(5) - (11)]),(yyvsp[(8) - (11)]),(yyvsp[(11) - (11)]),&(yyvsp[(1) - (11)])); _p->popLabelInfo(); _p->popTypeScope(); _p->onCompleteLabelScope(true);;} break; case 331: /* Line 1455 of yacc.c */ #line 1622 "hphp.y" { _p->xhpSetAttributes((yyvsp[(2) - (3)]));;} break; case 332: /* Line 1455 of yacc.c */ #line 1624 "hphp.y" { xhp_category_stmt(_p,(yyval),(yyvsp[(2) - (3)]));;} break; case 333: /* Line 1455 of yacc.c */ #line 1626 "hphp.y" { xhp_children_stmt(_p,(yyval),(yyvsp[(2) - (3)]));;} break; case 334: /* Line 1455 of yacc.c */ #line 1628 "hphp.y" { _p->onClassRequire((yyval), (yyvsp[(3) - (4)]), true); ;} break; case 335: /* Line 1455 of yacc.c */ #line 1630 "hphp.y" { _p->onClassRequire((yyval), (yyvsp[(3) - (4)]), false); ;} break; case 336: /* Line 1455 of yacc.c */ #line 1631 "hphp.y" { Token t; t.reset(); _p->onTraitUse((yyval),(yyvsp[(2) - (3)]),t); ;} break; case 337: /* Line 1455 of yacc.c */ #line 1634 "hphp.y" { _p->onTraitUse((yyval),(yyvsp[(2) - (5)]),(yyvsp[(4) - (5)])); ;} break; case 338: /* Line 1455 of yacc.c */ #line 1637 "hphp.y" { _p->onTraitRule((yyval),(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); ;} break; case 339: /* Line 1455 of yacc.c */ #line 1638 "hphp.y" { _p->onTraitRule((yyval),(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); ;} break; case 340: /* Line 1455 of yacc.c */ #line 1639 "hphp.y" { (yyval).reset(); ;} break; case 341: /* Line 1455 of yacc.c */ #line 1645 "hphp.y" { _p->onTraitPrecRule((yyval),(yyvsp[(1) - (6)]),(yyvsp[(3) - (6)]),(yyvsp[(5) - (6)]));;} break; case 342: /* Line 1455 of yacc.c */ #line 1650 "hphp.y" { _p->onTraitAliasRuleModify((yyval),(yyvsp[(1) - (5)]),(yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]));;} break; case 343: /* Line 1455 of yacc.c */ #line 1653 "hphp.y" { Token t; t.reset(); _p->onTraitAliasRuleModify((yyval),(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]), t);;} break; case 344: /* Line 1455 of yacc.c */ #line 1660 "hphp.y" { _p->onTraitAliasRuleStart((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 345: /* Line 1455 of yacc.c */ #line 1661 "hphp.y" { Token t; t.reset(); _p->onTraitAliasRuleStart((yyval),t,(yyvsp[(1) - (1)]));;} break; case 346: /* Line 1455 of yacc.c */ #line 1666 "hphp.y" { xhp_attribute_list(_p,(yyval), _p->xhpGetAttributes(),(yyvsp[(1) - (1)]));;} break; case 347: /* Line 1455 of yacc.c */ #line 1669 "hphp.y" { xhp_attribute_list(_p,(yyval), &(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 348: /* Line 1455 of yacc.c */ #line 1676 "hphp.y" { xhp_attribute(_p,(yyval),(yyvsp[(1) - (4)]),(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(yyvsp[(4) - (4)])); (yyval) = 1;;} break; case 349: /* Line 1455 of yacc.c */ #line 1678 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = 0;;} break; case 350: /* Line 1455 of yacc.c */ #line 1682 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 352: /* Line 1455 of yacc.c */ #line 1687 "hphp.y" { (yyval) = 4;;} break; case 353: /* Line 1455 of yacc.c */ #line 1689 "hphp.y" { (yyval) = 4;;} break; case 354: /* Line 1455 of yacc.c */ #line 1691 "hphp.y" { (yyval) = 4;;} break; case 355: /* Line 1455 of yacc.c */ #line 1692 "hphp.y" { /* This case handles all types other than "array", "var" and "enum". For now we just use type code 5; later xhp_attribute() will fix up the type code as appropriate. */ (yyval) = 5; (yyval).setText((yyvsp[(1) - (1)]));;} break; case 356: /* Line 1455 of yacc.c */ #line 1698 "hphp.y" { (yyval) = 6;;} break; case 357: /* Line 1455 of yacc.c */ #line 1700 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]); (yyval) = 7;;} break; case 358: /* Line 1455 of yacc.c */ #line 1701 "hphp.y" { (yyval) = 9; ;} break; case 359: /* Line 1455 of yacc.c */ #line 1705 "hphp.y" { _p->onArrayPair((yyval), 0,0,(yyvsp[(1) - (1)]),0);;} break; case 360: /* Line 1455 of yacc.c */ #line 1707 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]),0,(yyvsp[(3) - (3)]),0);;} break; case 361: /* Line 1455 of yacc.c */ #line 1712 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 362: /* Line 1455 of yacc.c */ #line 1715 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 363: /* Line 1455 of yacc.c */ #line 1716 "hphp.y" { scalar_null(_p, (yyval));;} break; case 364: /* Line 1455 of yacc.c */ #line 1720 "hphp.y" { scalar_num(_p, (yyval), "1");;} break; case 365: /* Line 1455 of yacc.c */ #line 1721 "hphp.y" { scalar_num(_p, (yyval), "0");;} break; case 366: /* Line 1455 of yacc.c */ #line 1725 "hphp.y" { Token t; scalar_num(_p, t, "1"); _p->onArrayPair((yyval),0,&(yyvsp[(1) - (1)]),t,0);;} break; case 367: /* Line 1455 of yacc.c */ #line 1728 "hphp.y" { Token t; scalar_num(_p, t, "1"); _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]),&(yyvsp[(3) - (3)]),t,0);;} break; case 368: /* Line 1455 of yacc.c */ #line 1733 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)]));;} break; case 369: /* Line 1455 of yacc.c */ #line 1738 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = 2;;} break; case 370: /* Line 1455 of yacc.c */ #line 1739 "hphp.y" { (yyval) = -1; if ((yyvsp[(1) - (1)]).same("any")) (yyval) = 1;;} break; case 371: /* Line 1455 of yacc.c */ #line 1741 "hphp.y" { (yyval) = 0;;} break; case 372: /* Line 1455 of yacc.c */ #line 1745 "hphp.y" { xhp_children_paren(_p, (yyval), (yyvsp[(2) - (3)]), 0);;} break; case 373: /* Line 1455 of yacc.c */ #line 1746 "hphp.y" { xhp_children_paren(_p, (yyval), (yyvsp[(2) - (4)]), 1);;} break; case 374: /* Line 1455 of yacc.c */ #line 1747 "hphp.y" { xhp_children_paren(_p, (yyval), (yyvsp[(2) - (4)]), 2);;} break; case 375: /* Line 1455 of yacc.c */ #line 1748 "hphp.y" { xhp_children_paren(_p, (yyval), (yyvsp[(2) - (4)]), 3);;} break; case 376: /* Line 1455 of yacc.c */ #line 1752 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 377: /* Line 1455 of yacc.c */ #line 1753 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (1)]),0, 0);;} break; case 378: /* Line 1455 of yacc.c */ #line 1754 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (2)]),1, 0);;} break; case 379: /* Line 1455 of yacc.c */ #line 1755 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (2)]),2, 0);;} break; case 380: /* Line 1455 of yacc.c */ #line 1756 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (2)]),3, 0);;} break; case 381: /* Line 1455 of yacc.c */ #line 1758 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (3)]),4,&(yyvsp[(3) - (3)]));;} break; case 382: /* Line 1455 of yacc.c */ #line 1760 "hphp.y" { xhp_children_decl(_p,(yyval),(yyvsp[(1) - (3)]),5,&(yyvsp[(3) - (3)]));;} break; case 383: /* Line 1455 of yacc.c */ #line 1764 "hphp.y" { (yyval) = -1; if ((yyvsp[(1) - (1)]).same("any")) (yyval) = 1; else if ((yyvsp[(1) - (1)]).same("pcdata")) (yyval) = 2;;} break; case 384: /* Line 1455 of yacc.c */ #line 1767 "hphp.y" { (yyvsp[(1) - (1)]).xhpLabel(); (yyval) = (yyvsp[(1) - (1)]); (yyval) = 3;;} break; case 385: /* Line 1455 of yacc.c */ #line 1768 "hphp.y" { (yyvsp[(1) - (1)]).xhpLabel(0); (yyval) = (yyvsp[(1) - (1)]); (yyval) = 4;;} break; case 386: /* Line 1455 of yacc.c */ #line 1772 "hphp.y" { (yyval).reset();;} break; case 387: /* Line 1455 of yacc.c */ #line 1773 "hphp.y" { _p->finishStatement((yyval), (yyvsp[(2) - (3)])); (yyval) = 1;;} break; case 388: /* Line 1455 of yacc.c */ #line 1777 "hphp.y" { (yyval).reset();;} break; case 389: /* Line 1455 of yacc.c */ #line 1778 "hphp.y" { _p->finishStatement((yyval), (yyvsp[(2) - (3)])); (yyval) = 1;;} break; case 390: /* Line 1455 of yacc.c */ #line 1781 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 391: /* Line 1455 of yacc.c */ #line 1782 "hphp.y" { (yyval).reset();;} break; case 392: /* Line 1455 of yacc.c */ #line 1785 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 393: /* Line 1455 of yacc.c */ #line 1786 "hphp.y" { (yyval).reset();;} break; case 394: /* Line 1455 of yacc.c */ #line 1789 "hphp.y" { _p->onMemberModifier((yyval),NULL,(yyvsp[(1) - (1)]));;} break; case 395: /* Line 1455 of yacc.c */ #line 1791 "hphp.y" { _p->onMemberModifier((yyval),&(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 396: /* Line 1455 of yacc.c */ #line 1794 "hphp.y" { (yyval) = T_PUBLIC;;} break; case 397: /* Line 1455 of yacc.c */ #line 1795 "hphp.y" { (yyval) = T_PROTECTED;;} break; case 398: /* Line 1455 of yacc.c */ #line 1796 "hphp.y" { (yyval) = T_PRIVATE;;} break; case 399: /* Line 1455 of yacc.c */ #line 1797 "hphp.y" { (yyval) = T_STATIC;;} break; case 400: /* Line 1455 of yacc.c */ #line 1798 "hphp.y" { (yyval) = T_ABSTRACT;;} break; case 401: /* Line 1455 of yacc.c */ #line 1799 "hphp.y" { (yyval) = T_FINAL;;} break; case 402: /* Line 1455 of yacc.c */ #line 1800 "hphp.y" { (yyval) = T_ASYNC;;} break; case 403: /* Line 1455 of yacc.c */ #line 1804 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 404: /* Line 1455 of yacc.c */ #line 1805 "hphp.y" { (yyval).reset();;} break; case 405: /* Line 1455 of yacc.c */ #line 1808 "hphp.y" { (yyval) = T_PUBLIC;;} break; case 406: /* Line 1455 of yacc.c */ #line 1809 "hphp.y" { (yyval) = T_PROTECTED;;} break; case 407: /* Line 1455 of yacc.c */ #line 1810 "hphp.y" { (yyval) = T_PRIVATE;;} break; case 408: /* Line 1455 of yacc.c */ #line 1814 "hphp.y" { _p->onClassVariable((yyval),&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 409: /* Line 1455 of yacc.c */ #line 1816 "hphp.y" { _p->onClassVariable((yyval),&(yyvsp[(1) - (5)]),(yyvsp[(3) - (5)]),&(yyvsp[(5) - (5)]));;} break; case 410: /* Line 1455 of yacc.c */ #line 1817 "hphp.y" { _p->onClassVariable((yyval),0,(yyvsp[(1) - (1)]),0);;} break; case 411: /* Line 1455 of yacc.c */ #line 1818 "hphp.y" { _p->onClassVariable((yyval),0,(yyvsp[(1) - (3)]),&(yyvsp[(3) - (3)]));;} break; case 412: /* Line 1455 of yacc.c */ #line 1822 "hphp.y" { _p->onClassConstant((yyval),&(yyvsp[(1) - (5)]),(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 413: /* Line 1455 of yacc.c */ #line 1824 "hphp.y" { _p->onClassConstant((yyval),0,(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)]));;} break; case 414: /* Line 1455 of yacc.c */ #line 1828 "hphp.y" { _p->onClassAbstractConstant((yyval),&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 415: /* Line 1455 of yacc.c */ #line 1830 "hphp.y" { _p->onClassAbstractConstant((yyval),NULL,(yyvsp[(3) - (3)]));;} break; case 416: /* Line 1455 of yacc.c */ #line 1834 "hphp.y" { Token t; _p->onClassTypeConstant((yyval), (yyvsp[(2) - (3)]), t); _p->popTypeScope(); ;} break; case 417: /* Line 1455 of yacc.c */ #line 1838 "hphp.y" { _p->onClassTypeConstant((yyval), (yyvsp[(1) - (4)]), (yyvsp[(4) - (4)])); _p->popTypeScope(); ;} break; case 418: /* Line 1455 of yacc.c */ #line 1842 "hphp.y" { (yyval) = (yyvsp[(3) - (3)]); ;} break; case 419: /* Line 1455 of yacc.c */ #line 1846 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 420: /* Line 1455 of yacc.c */ #line 1848 "hphp.y" { _p->onNewObject((yyval), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]));;} break; case 421: /* Line 1455 of yacc.c */ #line 1849 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]);;} break; case 422: /* Line 1455 of yacc.c */ #line 1850 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_CLONE,1);;} break; case 423: /* Line 1455 of yacc.c */ #line 1851 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 424: /* Line 1455 of yacc.c */ #line 1852 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 425: /* Line 1455 of yacc.c */ #line 1855 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 426: /* Line 1455 of yacc.c */ #line 1859 "hphp.y" { _p->onExprListElem((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 427: /* Line 1455 of yacc.c */ #line 1860 "hphp.y" { _p->onExprListElem((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 428: /* Line 1455 of yacc.c */ #line 1864 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 429: /* Line 1455 of yacc.c */ #line 1865 "hphp.y" { (yyval).reset();;} break; case 430: /* Line 1455 of yacc.c */ #line 1869 "hphp.y" { _p->onYield((yyval), NULL);;} break; case 431: /* Line 1455 of yacc.c */ #line 1870 "hphp.y" { _p->onYield((yyval), &(yyvsp[(2) - (2)]));;} break; case 432: /* Line 1455 of yacc.c */ #line 1871 "hphp.y" { _p->onYieldPair((yyval), &(yyvsp[(2) - (4)]), &(yyvsp[(4) - (4)]));;} break; case 433: /* Line 1455 of yacc.c */ #line 1872 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 434: /* Line 1455 of yacc.c */ #line 1876 "hphp.y" { _p->onAssign((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0, true);;} break; case 435: /* Line 1455 of yacc.c */ #line 1881 "hphp.y" { _p->onListAssignment((yyval), (yyvsp[(3) - (6)]), &(yyvsp[(6) - (6)]), true);;} break; case 436: /* Line 1455 of yacc.c */ #line 1885 "hphp.y" { _p->onYieldFrom((yyval),&(yyvsp[(2) - (2)]));;} break; case 437: /* Line 1455 of yacc.c */ #line 1889 "hphp.y" { _p->onAssign((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0, true);;} break; case 438: /* Line 1455 of yacc.c */ #line 1893 "hphp.y" { _p->onAwait((yyval), (yyvsp[(2) - (2)])); ;} break; case 439: /* Line 1455 of yacc.c */ #line 1897 "hphp.y" { _p->onAssign((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0, true);;} break; case 440: /* Line 1455 of yacc.c */ #line 1902 "hphp.y" { _p->onListAssignment((yyval), (yyvsp[(3) - (6)]), &(yyvsp[(6) - (6)]), true);;} break; case 441: /* Line 1455 of yacc.c */ #line 1906 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 442: /* Line 1455 of yacc.c */ #line 1907 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 443: /* Line 1455 of yacc.c */ #line 1908 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 444: /* Line 1455 of yacc.c */ #line 1909 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 445: /* Line 1455 of yacc.c */ #line 1910 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 446: /* Line 1455 of yacc.c */ #line 1915 "hphp.y" { _p->onListAssignment((yyval), (yyvsp[(3) - (6)]), &(yyvsp[(6) - (6)]));;} break; case 447: /* Line 1455 of yacc.c */ #line 1916 "hphp.y" { _p->onAssign((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0);;} break; case 448: /* Line 1455 of yacc.c */ #line 1917 "hphp.y" { _p->onAssign((yyval), (yyvsp[(1) - (4)]), (yyvsp[(4) - (4)]), 1);;} break; case 449: /* Line 1455 of yacc.c */ #line 1920 "hphp.y" { _p->onAssignNew((yyval),(yyvsp[(1) - (6)]),(yyvsp[(5) - (6)]),(yyvsp[(6) - (6)]));;} break; case 450: /* Line 1455 of yacc.c */ #line 1921 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_PLUS_EQUAL);;} break; case 451: /* Line 1455 of yacc.c */ #line 1922 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_MINUS_EQUAL);;} break; case 452: /* Line 1455 of yacc.c */ #line 1923 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_MUL_EQUAL);;} break; case 453: /* Line 1455 of yacc.c */ #line 1924 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_DIV_EQUAL);;} break; case 454: /* Line 1455 of yacc.c */ #line 1925 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_CONCAT_EQUAL);;} break; case 455: /* Line 1455 of yacc.c */ #line 1926 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_MOD_EQUAL);;} break; case 456: /* Line 1455 of yacc.c */ #line 1927 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_AND_EQUAL);;} break; case 457: /* Line 1455 of yacc.c */ #line 1928 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_OR_EQUAL);;} break; case 458: /* Line 1455 of yacc.c */ #line 1929 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_XOR_EQUAL);;} break; case 459: /* Line 1455 of yacc.c */ #line 1930 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SL_EQUAL);;} break; case 460: /* Line 1455 of yacc.c */ #line 1931 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SR_EQUAL);;} break; case 461: /* Line 1455 of yacc.c */ #line 1932 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_POW_EQUAL);;} break; case 462: /* Line 1455 of yacc.c */ #line 1933 "hphp.y" { UEXP((yyval),(yyvsp[(1) - (2)]),T_INC,0);;} break; case 463: /* Line 1455 of yacc.c */ #line 1934 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_INC,1);;} break; case 464: /* Line 1455 of yacc.c */ #line 1935 "hphp.y" { UEXP((yyval),(yyvsp[(1) - (2)]),T_DEC,0);;} break; case 465: /* Line 1455 of yacc.c */ #line 1936 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_DEC,1);;} break; case 466: /* Line 1455 of yacc.c */ #line 1937 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_BOOLEAN_OR);;} break; case 467: /* Line 1455 of yacc.c */ #line 1938 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_BOOLEAN_AND);;} break; case 468: /* Line 1455 of yacc.c */ #line 1939 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_OR);;} break; case 469: /* Line 1455 of yacc.c */ #line 1940 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_AND);;} break; case 470: /* Line 1455 of yacc.c */ #line 1941 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_XOR);;} break; case 471: /* Line 1455 of yacc.c */ #line 1942 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'|');;} break; case 472: /* Line 1455 of yacc.c */ #line 1943 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'&');;} break; case 473: /* Line 1455 of yacc.c */ #line 1944 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'^');;} break; case 474: /* Line 1455 of yacc.c */ #line 1945 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'.');;} break; case 475: /* Line 1455 of yacc.c */ #line 1946 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'+');;} break; case 476: /* Line 1455 of yacc.c */ #line 1947 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'-');;} break; case 477: /* Line 1455 of yacc.c */ #line 1948 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'*');;} break; case 478: /* Line 1455 of yacc.c */ #line 1949 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'/');;} break; case 479: /* Line 1455 of yacc.c */ #line 1950 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_POW);;} break; case 480: /* Line 1455 of yacc.c */ #line 1951 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'%');;} break; case 481: /* Line 1455 of yacc.c */ #line 1952 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_PIPE);;} break; case 482: /* Line 1455 of yacc.c */ #line 1953 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SL);;} break; case 483: /* Line 1455 of yacc.c */ #line 1954 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SR);;} break; case 484: /* Line 1455 of yacc.c */ #line 1955 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'+',1);;} break; case 485: /* Line 1455 of yacc.c */ #line 1956 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'-',1);;} break; case 486: /* Line 1455 of yacc.c */ #line 1957 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'!',1);;} break; case 487: /* Line 1455 of yacc.c */ #line 1958 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'~',1);;} break; case 488: /* Line 1455 of yacc.c */ #line 1959 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_IDENTICAL);;} break; case 489: /* Line 1455 of yacc.c */ #line 1960 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_NOT_IDENTICAL);;} break; case 490: /* Line 1455 of yacc.c */ #line 1961 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_EQUAL);;} break; case 491: /* Line 1455 of yacc.c */ #line 1962 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_NOT_EQUAL);;} break; case 492: /* Line 1455 of yacc.c */ #line 1963 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'<');;} break; case 493: /* Line 1455 of yacc.c */ #line 1964 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]), T_IS_SMALLER_OR_EQUAL);;} break; case 494: /* Line 1455 of yacc.c */ #line 1966 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'>');;} break; case 495: /* Line 1455 of yacc.c */ #line 1967 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]), T_IS_GREATER_OR_EQUAL);;} break; case 496: /* Line 1455 of yacc.c */ #line 1969 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SPACESHIP);;} break; case 497: /* Line 1455 of yacc.c */ #line 1971 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_INSTANCEOF);;} break; case 498: /* Line 1455 of yacc.c */ #line 1972 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 499: /* Line 1455 of yacc.c */ #line 1973 "hphp.y" { _p->onQOp((yyval), (yyvsp[(1) - (5)]), &(yyvsp[(3) - (5)]), (yyvsp[(5) - (5)]));;} break; case 500: /* Line 1455 of yacc.c */ #line 1974 "hphp.y" { _p->onQOp((yyval), (yyvsp[(1) - (4)]), 0, (yyvsp[(4) - (4)]));;} break; case 501: /* Line 1455 of yacc.c */ #line 1975 "hphp.y" { _p->onNullCoalesce((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 502: /* Line 1455 of yacc.c */ #line 1976 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 503: /* Line 1455 of yacc.c */ #line 1977 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_INT_CAST,1);;} break; case 504: /* Line 1455 of yacc.c */ #line 1978 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_DOUBLE_CAST,1);;} break; case 505: /* Line 1455 of yacc.c */ #line 1979 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_STRING_CAST,1);;} break; case 506: /* Line 1455 of yacc.c */ #line 1980 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_ARRAY_CAST,1);;} break; case 507: /* Line 1455 of yacc.c */ #line 1981 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_OBJECT_CAST,1);;} break; case 508: /* Line 1455 of yacc.c */ #line 1982 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_BOOL_CAST,1);;} break; case 509: /* Line 1455 of yacc.c */ #line 1983 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_UNSET_CAST,1);;} break; case 510: /* Line 1455 of yacc.c */ #line 1984 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_EXIT,1);;} break; case 511: /* Line 1455 of yacc.c */ #line 1985 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'@',1);;} break; case 512: /* Line 1455 of yacc.c */ #line 1986 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 513: /* Line 1455 of yacc.c */ #line 1987 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 514: /* Line 1455 of yacc.c */ #line 1988 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 515: /* Line 1455 of yacc.c */ #line 1989 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 516: /* Line 1455 of yacc.c */ #line 1990 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 517: /* Line 1455 of yacc.c */ #line 1991 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 518: /* Line 1455 of yacc.c */ #line 1992 "hphp.y" { _p->onEncapsList((yyval),'`',(yyvsp[(2) - (3)]));;} break; case 519: /* Line 1455 of yacc.c */ #line 1993 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_PRINT,1);;} break; case 520: /* Line 1455 of yacc.c */ #line 1994 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 521: /* Line 1455 of yacc.c */ #line 2001 "hphp.y" { (yyval) = (yyvsp[(3) - (5)]);;} break; case 522: /* Line 1455 of yacc.c */ #line 2002 "hphp.y" { (yyval).reset();;} break; case 523: /* Line 1455 of yacc.c */ #line 2007 "hphp.y" { Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo(); ;} break; case 524: /* Line 1455 of yacc.c */ #line 2013 "hphp.y" { _p->finishStatement((yyvsp[(11) - (12)]), (yyvsp[(11) - (12)])); (yyvsp[(11) - (12)]) = 1; (yyval) = _p->onClosure( ClosureType::Long, nullptr, (yyvsp[(2) - (12)]),(yyvsp[(5) - (12)]),(yyvsp[(8) - (12)]),(yyvsp[(11) - (12)]),(yyvsp[(7) - (12)]),&(yyvsp[(9) - (12)])); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 525: /* Line 1455 of yacc.c */ #line 2021 "hphp.y" { Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo(); ;} break; case 526: /* Line 1455 of yacc.c */ #line 2027 "hphp.y" { _p->finishStatement((yyvsp[(12) - (13)]), (yyvsp[(12) - (13)])); (yyvsp[(12) - (13)]) = 1; (yyval) = _p->onClosure( ClosureType::Long, &(yyvsp[(1) - (13)]), (yyvsp[(3) - (13)]),(yyvsp[(6) - (13)]),(yyvsp[(9) - (13)]),(yyvsp[(12) - (13)]),(yyvsp[(8) - (13)]),&(yyvsp[(10) - (13)])); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 527: /* Line 1455 of yacc.c */ #line 2037 "hphp.y" { _p->pushFuncLocation(); Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo(); Token u; _p->onParam((yyvsp[(2) - (2)]),NULL,u,(yyvsp[(2) - (2)]),0, NULL,NULL,NULL);;} break; case 528: /* Line 1455 of yacc.c */ #line 2045 "hphp.y" { Token v; Token w; Token x; (yyvsp[(1) - (4)]) = T_ASYNC; _p->onMemberModifier((yyvsp[(1) - (4)]), nullptr, (yyvsp[(1) - (4)])); _p->finishStatement((yyvsp[(4) - (4)]), (yyvsp[(4) - (4)])); (yyvsp[(4) - (4)]) = 1; (yyval) = _p->onClosure(ClosureType::Short, &(yyvsp[(1) - (4)]), v,(yyvsp[(2) - (4)]),w,(yyvsp[(4) - (4)]),x); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 529: /* Line 1455 of yacc.c */ #line 2055 "hphp.y" { _p->pushFuncLocation(); Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo();;} break; case 530: /* Line 1455 of yacc.c */ #line 2063 "hphp.y" { Token u; Token v; (yyvsp[(1) - (7)]) = T_ASYNC; _p->onMemberModifier((yyvsp[(1) - (7)]), nullptr, (yyvsp[(1) - (7)])); _p->finishStatement((yyvsp[(7) - (7)]), (yyvsp[(7) - (7)])); (yyvsp[(7) - (7)]) = 1; (yyval) = _p->onClosure(ClosureType::Short, &(yyvsp[(1) - (7)]), u,(yyvsp[(4) - (7)]),v,(yyvsp[(7) - (7)]),(yyvsp[(6) - (7)])); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 531: /* Line 1455 of yacc.c */ #line 2073 "hphp.y" { _p->pushFuncLocation(); Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo();;} break; case 532: /* Line 1455 of yacc.c */ #line 2079 "hphp.y" { Token u; Token v; Token w; Token x; Token y; (yyvsp[(1) - (5)]) = T_ASYNC; _p->onMemberModifier((yyvsp[(1) - (5)]), nullptr, (yyvsp[(1) - (5)])); _p->finishStatement((yyvsp[(4) - (5)]), (yyvsp[(4) - (5)])); (yyvsp[(4) - (5)]) = 1; (yyval) = _p->onClosure(ClosureType::Short, &(yyvsp[(1) - (5)]), u,v,w,(yyvsp[(4) - (5)]),x); _p->popLabelInfo(); _p->onCompleteLabelScope(true); _p->onCall((yyval),1,(yyval),y,NULL);;} break; case 533: /* Line 1455 of yacc.c */ #line 2090 "hphp.y" { _p->pushFuncLocation(); Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo(); Token u; _p->onParam((yyvsp[(1) - (1)]),NULL,u,(yyvsp[(1) - (1)]),0, NULL,NULL,NULL);;} break; case 534: /* Line 1455 of yacc.c */ #line 2098 "hphp.y" { Token v; Token w; Token x; _p->finishStatement((yyvsp[(3) - (3)]), (yyvsp[(3) - (3)])); (yyvsp[(3) - (3)]) = 1; (yyval) = _p->onClosure(ClosureType::Short, nullptr, v,(yyvsp[(1) - (3)]),w,(yyvsp[(3) - (3)]),x); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 535: /* Line 1455 of yacc.c */ #line 2105 "hphp.y" { _p->pushFuncLocation(); Token t; _p->onNewLabelScope(true); _p->onClosureStart(t); _p->pushLabelInfo();;} break; case 536: /* Line 1455 of yacc.c */ #line 2113 "hphp.y" { Token u; Token v; _p->finishStatement((yyvsp[(6) - (6)]), (yyvsp[(6) - (6)])); (yyvsp[(6) - (6)]) = 1; (yyval) = _p->onClosure(ClosureType::Short, nullptr, u,(yyvsp[(3) - (6)]),v,(yyvsp[(6) - (6)]),(yyvsp[(5) - (6)])); _p->popLabelInfo(); _p->onCompleteLabelScope(true);;} break; case 537: /* Line 1455 of yacc.c */ #line 2123 "hphp.y" { (yyval) = _p->onExprForLambda((yyvsp[(2) - (2)]));;} break; case 538: /* Line 1455 of yacc.c */ #line 2124 "hphp.y" { (yyval) = _p->onExprForLambda((yyvsp[(2) - (2)]));;} break; case 539: /* Line 1455 of yacc.c */ #line 2126 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]); ;} break; case 540: /* Line 1455 of yacc.c */ #line 2130 "hphp.y" { validate_shape_keyname((yyvsp[(1) - (1)]), _p); _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)])); ;} break; case 541: /* Line 1455 of yacc.c */ #line 2132 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 542: /* Line 1455 of yacc.c */ #line 2139 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0); ;} break; case 543: /* Line 1455 of yacc.c */ #line 2142 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0); ;} break; case 544: /* Line 1455 of yacc.c */ #line 2149 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0); ;} break; case 545: /* Line 1455 of yacc.c */ #line 2152 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0); ;} break; case 546: /* Line 1455 of yacc.c */ #line 2157 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 547: /* Line 1455 of yacc.c */ #line 2158 "hphp.y" { (yyval).reset(); ;} break; case 548: /* Line 1455 of yacc.c */ #line 2163 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 549: /* Line 1455 of yacc.c */ #line 2164 "hphp.y" { (yyval).reset(); ;} break; case 550: /* Line 1455 of yacc.c */ #line 2168 "hphp.y" { _p->onArray((yyval), (yyvsp[(3) - (4)]), T_ARRAY);;} break; case 551: /* Line 1455 of yacc.c */ #line 2172 "hphp.y" { _p->onArray((yyval),(yyvsp[(3) - (4)]),T_ARRAY);;} break; case 552: /* Line 1455 of yacc.c */ #line 2173 "hphp.y" { _p->onArray((yyval),(yyvsp[(2) - (3)]),T_ARRAY);;} break; case 553: /* Line 1455 of yacc.c */ #line 2178 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 554: /* Line 1455 of yacc.c */ #line 2179 "hphp.y" { (yyval).reset();;} break; case 555: /* Line 1455 of yacc.c */ #line 2184 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 556: /* Line 1455 of yacc.c */ #line 2185 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 557: /* Line 1455 of yacc.c */ #line 2188 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (6)]),&(yyvsp[(3) - (6)]),(yyvsp[(6) - (6)]),1);;} break; case 558: /* Line 1455 of yacc.c */ #line 2189 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),1);;} break; case 559: /* Line 1455 of yacc.c */ #line 2194 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 560: /* Line 1455 of yacc.c */ #line 2195 "hphp.y" { (yyval).reset();;} break; case 561: /* Line 1455 of yacc.c */ #line 2201 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 562: /* Line 1455 of yacc.c */ #line 2203 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 563: /* Line 1455 of yacc.c */ #line 2208 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 564: /* Line 1455 of yacc.c */ #line 2209 "hphp.y" { (yyval).reset();;} break; case 565: /* Line 1455 of yacc.c */ #line 2215 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 566: /* Line 1455 of yacc.c */ #line 2217 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 567: /* Line 1455 of yacc.c */ #line 2221 "hphp.y" { _p->onDict((yyval), (yyvsp[(3) - (4)])); ;} break; case 568: /* Line 1455 of yacc.c */ #line 2225 "hphp.y" { _p->onDict((yyval), (yyvsp[(3) - (4)])); ;} break; case 569: /* Line 1455 of yacc.c */ #line 2229 "hphp.y" { _p->onDict((yyval), (yyvsp[(3) - (4)])); ;} break; case 570: /* Line 1455 of yacc.c */ #line 2233 "hphp.y" { _p->onVec((yyval), (yyvsp[(3) - (4)])); ;} break; case 571: /* Line 1455 of yacc.c */ #line 2237 "hphp.y" { _p->onVec((yyval), (yyvsp[(3) - (4)])); ;} break; case 572: /* Line 1455 of yacc.c */ #line 2241 "hphp.y" { _p->onVec((yyval), (yyvsp[(3) - (4)])); ;} break; case 573: /* Line 1455 of yacc.c */ #line 2245 "hphp.y" { _p->onKeyset((yyval), (yyvsp[(3) - (4)])); ;} break; case 574: /* Line 1455 of yacc.c */ #line 2249 "hphp.y" { _p->onKeyset((yyval), (yyvsp[(3) - (4)])); ;} break; case 575: /* Line 1455 of yacc.c */ #line 2253 "hphp.y" { _p->onKeyset((yyval), (yyvsp[(3) - (4)])); ;} break; case 576: /* Line 1455 of yacc.c */ #line 2258 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 577: /* Line 1455 of yacc.c */ #line 2259 "hphp.y" { (yyval).reset();;} break; case 578: /* Line 1455 of yacc.c */ #line 2264 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 579: /* Line 1455 of yacc.c */ #line 2265 "hphp.y" { (yyval).reset();;} break; case 580: /* Line 1455 of yacc.c */ #line 2270 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 581: /* Line 1455 of yacc.c */ #line 2271 "hphp.y" { (yyval).reset();;} break; case 582: /* Line 1455 of yacc.c */ #line 2276 "hphp.y" { Token t; _p->onName(t,(yyvsp[(1) - (4)]),Parser::StringName); BEXP((yyval),t,(yyvsp[(3) - (4)]),T_COLLECTION);;} break; case 583: /* Line 1455 of yacc.c */ #line 2283 "hphp.y" { Token t; _p->onName(t,(yyvsp[(1) - (4)]),Parser::StringName); BEXP((yyval),t,(yyvsp[(3) - (4)]),T_COLLECTION);;} break; case 584: /* Line 1455 of yacc.c */ #line 2290 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]));;} break; case 585: /* Line 1455 of yacc.c */ #line 2292 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]));;} break; case 586: /* Line 1455 of yacc.c */ #line 2296 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 587: /* Line 1455 of yacc.c */ #line 2297 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 588: /* Line 1455 of yacc.c */ #line 2298 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 589: /* Line 1455 of yacc.c */ #line 2299 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 590: /* Line 1455 of yacc.c */ #line 2300 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 591: /* Line 1455 of yacc.c */ #line 2301 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 592: /* Line 1455 of yacc.c */ #line 2302 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)])); ;} break; case 593: /* Line 1455 of yacc.c */ #line 2304 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 594: /* Line 1455 of yacc.c */ #line 2305 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 595: /* Line 1455 of yacc.c */ #line 2309 "hphp.y" { _p->onClosureParam((yyval),&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 596: /* Line 1455 of yacc.c */ #line 2310 "hphp.y" { _p->onClosureParam((yyval),&(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),1);;} break; case 597: /* Line 1455 of yacc.c */ #line 2311 "hphp.y" { _p->onClosureParam((yyval), 0,(yyvsp[(1) - (1)]),0);;} break; case 598: /* Line 1455 of yacc.c */ #line 2312 "hphp.y" { _p->onClosureParam((yyval), 0,(yyvsp[(2) - (2)]),1);;} break; case 599: /* Line 1455 of yacc.c */ #line 2319 "hphp.y" { xhp_tag(_p,(yyval),(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]));;} break; case 600: /* Line 1455 of yacc.c */ #line 2322 "hphp.y" { Token t1; _p->onArray(t1,(yyvsp[(1) - (2)])); Token t2; _p->onArray(t2,(yyvsp[(2) - (2)])); Token file; scalar_file(_p, file); Token line; scalar_line(_p, line); _p->onCallParam((yyvsp[(1) - (2)]),NULL,t1,0,0); _p->onCallParam((yyval), &(yyvsp[(1) - (2)]),t2,0,0); _p->onCallParam((yyvsp[(1) - (2)]), &(yyvsp[(1) - (2)]),file,0,0); _p->onCallParam((yyvsp[(1) - (2)]), &(yyvsp[(1) - (2)]),line,0,0); (yyval).setText("");;} break; case 601: /* Line 1455 of yacc.c */ #line 2333 "hphp.y" { Token file; scalar_file(_p, file); Token line; scalar_line(_p, line); _p->onArray((yyvsp[(4) - (6)]),(yyvsp[(1) - (6)])); _p->onArray((yyvsp[(5) - (6)]),(yyvsp[(3) - (6)])); _p->onCallParam((yyvsp[(2) - (6)]),NULL,(yyvsp[(4) - (6)]),0,0); _p->onCallParam((yyval), &(yyvsp[(2) - (6)]),(yyvsp[(5) - (6)]),0,0); _p->onCallParam((yyvsp[(2) - (6)]), &(yyvsp[(2) - (6)]),file,0,0); _p->onCallParam((yyvsp[(2) - (6)]), &(yyvsp[(2) - (6)]),line,0,0); (yyval).setText((yyvsp[(6) - (6)]).text());;} break; case 602: /* Line 1455 of yacc.c */ #line 2344 "hphp.y" { (yyval).reset(); (yyval).setText("");;} break; case 603: /* Line 1455 of yacc.c */ #line 2345 "hphp.y" { (yyval).reset(); (yyval).setText((yyvsp[(1) - (1)]));;} break; case 604: /* Line 1455 of yacc.c */ #line 2350 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (4)]),&(yyvsp[(2) - (4)]),(yyvsp[(4) - (4)]),0);;} break; case 605: /* Line 1455 of yacc.c */ #line 2351 "hphp.y" { (yyval).reset();;} break; case 606: /* Line 1455 of yacc.c */ #line 2354 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (2)]),0,(yyvsp[(2) - (2)]),0);;} break; case 607: /* Line 1455 of yacc.c */ #line 2355 "hphp.y" { (yyval).reset();;} break; case 608: /* Line 1455 of yacc.c */ #line 2358 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)]));;} break; case 609: /* Line 1455 of yacc.c */ #line 2362 "hphp.y" { (yyvsp[(1) - (1)]).xhpDecode(); _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)]));;} break; case 610: /* Line 1455 of yacc.c */ #line 2365 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 611: /* Line 1455 of yacc.c */ #line 2368 "hphp.y" { (yyval).reset(); if ((yyvsp[(1) - (1)]).htmlTrim()) { (yyvsp[(1) - (1)]).xhpDecode(); _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)])); } ;} break; case 612: /* Line 1455 of yacc.c */ #line 2375 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 613: /* Line 1455 of yacc.c */ #line 2376 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 614: /* Line 1455 of yacc.c */ #line 2380 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 615: /* Line 1455 of yacc.c */ #line 2382 "hphp.y" { (yyval) = (yyvsp[(1) - (3)]) + ":" + (yyvsp[(3) - (3)]);;} break; case 616: /* Line 1455 of yacc.c */ #line 2384 "hphp.y" { (yyval) = (yyvsp[(1) - (3)]) + "-" + (yyvsp[(3) - (3)]);;} break; case 617: /* Line 1455 of yacc.c */ #line 2388 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 618: /* Line 1455 of yacc.c */ #line 2389 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 619: /* Line 1455 of yacc.c */ #line 2390 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 620: /* Line 1455 of yacc.c */ #line 2391 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 621: /* Line 1455 of yacc.c */ #line 2392 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 622: /* Line 1455 of yacc.c */ #line 2393 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 623: /* Line 1455 of yacc.c */ #line 2394 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 624: /* Line 1455 of yacc.c */ #line 2395 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 625: /* Line 1455 of yacc.c */ #line 2396 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 626: /* Line 1455 of yacc.c */ #line 2397 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 627: /* Line 1455 of yacc.c */ #line 2398 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 628: /* Line 1455 of yacc.c */ #line 2399 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 629: /* Line 1455 of yacc.c */ #line 2400 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 630: /* Line 1455 of yacc.c */ #line 2401 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 631: /* Line 1455 of yacc.c */ #line 2402 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 632: /* Line 1455 of yacc.c */ #line 2403 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 633: /* Line 1455 of yacc.c */ #line 2404 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 634: /* Line 1455 of yacc.c */ #line 2405 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 635: /* Line 1455 of yacc.c */ #line 2406 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 636: /* Line 1455 of yacc.c */ #line 2407 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 637: /* Line 1455 of yacc.c */ #line 2408 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 638: /* Line 1455 of yacc.c */ #line 2409 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 639: /* Line 1455 of yacc.c */ #line 2410 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 640: /* Line 1455 of yacc.c */ #line 2411 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 641: /* Line 1455 of yacc.c */ #line 2412 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 642: /* Line 1455 of yacc.c */ #line 2413 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 643: /* Line 1455 of yacc.c */ #line 2414 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 644: /* Line 1455 of yacc.c */ #line 2415 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 645: /* Line 1455 of yacc.c */ #line 2416 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 646: /* Line 1455 of yacc.c */ #line 2417 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 647: /* Line 1455 of yacc.c */ #line 2418 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 648: /* Line 1455 of yacc.c */ #line 2419 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 649: /* Line 1455 of yacc.c */ #line 2420 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 650: /* Line 1455 of yacc.c */ #line 2421 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 651: /* Line 1455 of yacc.c */ #line 2422 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 652: /* Line 1455 of yacc.c */ #line 2423 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 653: /* Line 1455 of yacc.c */ #line 2424 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 654: /* Line 1455 of yacc.c */ #line 2425 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 655: /* Line 1455 of yacc.c */ #line 2426 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 656: /* Line 1455 of yacc.c */ #line 2427 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 657: /* Line 1455 of yacc.c */ #line 2428 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 658: /* Line 1455 of yacc.c */ #line 2429 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 659: /* Line 1455 of yacc.c */ #line 2430 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 660: /* Line 1455 of yacc.c */ #line 2431 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 661: /* Line 1455 of yacc.c */ #line 2432 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 662: /* Line 1455 of yacc.c */ #line 2433 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 663: /* Line 1455 of yacc.c */ #line 2434 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 664: /* Line 1455 of yacc.c */ #line 2435 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 665: /* Line 1455 of yacc.c */ #line 2436 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 666: /* Line 1455 of yacc.c */ #line 2437 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 667: /* Line 1455 of yacc.c */ #line 2438 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 668: /* Line 1455 of yacc.c */ #line 2439 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 669: /* Line 1455 of yacc.c */ #line 2440 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 670: /* Line 1455 of yacc.c */ #line 2441 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 671: /* Line 1455 of yacc.c */ #line 2442 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 672: /* Line 1455 of yacc.c */ #line 2443 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 673: /* Line 1455 of yacc.c */ #line 2444 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 674: /* Line 1455 of yacc.c */ #line 2445 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 675: /* Line 1455 of yacc.c */ #line 2446 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 676: /* Line 1455 of yacc.c */ #line 2447 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 677: /* Line 1455 of yacc.c */ #line 2448 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 678: /* Line 1455 of yacc.c */ #line 2449 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 679: /* Line 1455 of yacc.c */ #line 2450 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 680: /* Line 1455 of yacc.c */ #line 2451 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 681: /* Line 1455 of yacc.c */ #line 2452 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 682: /* Line 1455 of yacc.c */ #line 2453 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 683: /* Line 1455 of yacc.c */ #line 2454 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 684: /* Line 1455 of yacc.c */ #line 2455 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 685: /* Line 1455 of yacc.c */ #line 2456 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 686: /* Line 1455 of yacc.c */ #line 2457 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 687: /* Line 1455 of yacc.c */ #line 2458 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 688: /* Line 1455 of yacc.c */ #line 2459 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 689: /* Line 1455 of yacc.c */ #line 2460 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 690: /* Line 1455 of yacc.c */ #line 2461 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 691: /* Line 1455 of yacc.c */ #line 2462 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 692: /* Line 1455 of yacc.c */ #line 2463 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 693: /* Line 1455 of yacc.c */ #line 2464 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 694: /* Line 1455 of yacc.c */ #line 2465 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 695: /* Line 1455 of yacc.c */ #line 2466 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 696: /* Line 1455 of yacc.c */ #line 2467 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 697: /* Line 1455 of yacc.c */ #line 2468 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 698: /* Line 1455 of yacc.c */ #line 2473 "hphp.y" { _p->onCall((yyval),0,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 699: /* Line 1455 of yacc.c */ #line 2477 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 700: /* Line 1455 of yacc.c */ #line 2478 "hphp.y" { (yyvsp[(1) - (1)]).xhpLabel(); (yyval) = (yyvsp[(1) - (1)]);;} break; case 701: /* Line 1455 of yacc.c */ #line 2482 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::StringName);;} break; case 702: /* Line 1455 of yacc.c */ #line 2483 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::StringName);;} break; case 703: /* Line 1455 of yacc.c */ #line 2484 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::StaticName);;} break; case 704: /* Line 1455 of yacc.c */ #line 2485 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]), Parser::StaticClassExprName);;} break; case 705: /* Line 1455 of yacc.c */ #line 2487 "hphp.y" { _p->onName((yyval),(yyvsp[(2) - (3)]), Parser::StaticClassExprName);;} break; case 706: /* Line 1455 of yacc.c */ #line 2491 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 707: /* Line 1455 of yacc.c */ #line 2500 "hphp.y" { _p->onStaticMember((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 708: /* Line 1455 of yacc.c */ #line 2503 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 709: /* Line 1455 of yacc.c */ #line 2504 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]), Parser::StaticClassExprName);;} break; case 710: /* Line 1455 of yacc.c */ #line 2514 "hphp.y" { _p->onStaticMember((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 711: /* Line 1455 of yacc.c */ #line 2518 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::StringName);;} break; case 712: /* Line 1455 of yacc.c */ #line 2519 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::StaticName);;} break; case 713: /* Line 1455 of yacc.c */ #line 2520 "hphp.y" { _p->onName((yyval),(yyvsp[(1) - (1)]),Parser::ExprName);;} break; case 714: /* Line 1455 of yacc.c */ #line 2524 "hphp.y" { (yyval).reset();;} break; case 715: /* Line 1455 of yacc.c */ #line 2525 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 716: /* Line 1455 of yacc.c */ #line 2526 "hphp.y" { (yyval).reset();;} break; case 717: /* Line 1455 of yacc.c */ #line 2530 "hphp.y" { (yyval).reset();;} break; case 718: /* Line 1455 of yacc.c */ #line 2531 "hphp.y" { _p->addEncap((yyval), NULL, (yyvsp[(1) - (1)]), 0);;} break; case 719: /* Line 1455 of yacc.c */ #line 2532 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 720: /* Line 1455 of yacc.c */ #line 2536 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 721: /* Line 1455 of yacc.c */ #line 2537 "hphp.y" { (yyval).reset();;} break; case 722: /* Line 1455 of yacc.c */ #line 2541 "hphp.y" { _p->onScalar((yyval), T_LNUMBER, (yyvsp[(1) - (1)]));;} break; case 723: /* Line 1455 of yacc.c */ #line 2542 "hphp.y" { _p->onScalar((yyval), T_DNUMBER, (yyvsp[(1) - (1)]));;} break; case 724: /* Line 1455 of yacc.c */ #line 2543 "hphp.y" { _p->onScalar((yyval), T_ONUMBER, (yyvsp[(1) - (1)]));;} break; case 725: /* Line 1455 of yacc.c */ #line 2544 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (1)]));;} break; case 726: /* Line 1455 of yacc.c */ #line 2546 "hphp.y" { _p->onScalar((yyval), T_LINE, (yyvsp[(1) - (1)]));;} break; case 727: /* Line 1455 of yacc.c */ #line 2547 "hphp.y" { _p->onScalar((yyval), T_FILE, (yyvsp[(1) - (1)]));;} break; case 728: /* Line 1455 of yacc.c */ #line 2548 "hphp.y" { _p->onScalar((yyval), T_DIR, (yyvsp[(1) - (1)]));;} break; case 729: /* Line 1455 of yacc.c */ #line 2549 "hphp.y" { _p->onScalar((yyval), T_CLASS_C, (yyvsp[(1) - (1)]));;} break; case 730: /* Line 1455 of yacc.c */ #line 2550 "hphp.y" { _p->onScalar((yyval), T_TRAIT_C, (yyvsp[(1) - (1)]));;} break; case 731: /* Line 1455 of yacc.c */ #line 2551 "hphp.y" { _p->onScalar((yyval), T_METHOD_C, (yyvsp[(1) - (1)]));;} break; case 732: /* Line 1455 of yacc.c */ #line 2552 "hphp.y" { _p->onScalar((yyval), T_FUNC_C, (yyvsp[(1) - (1)]));;} break; case 733: /* Line 1455 of yacc.c */ #line 2553 "hphp.y" { _p->onScalar((yyval), T_NS_C, (yyvsp[(1) - (1)]));;} break; case 734: /* Line 1455 of yacc.c */ #line 2554 "hphp.y" { _p->onScalar((yyval), T_COMPILER_HALT_OFFSET, (yyvsp[(1) - (1)]));;} break; case 735: /* Line 1455 of yacc.c */ #line 2557 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(2) - (3)]));;} break; case 736: /* Line 1455 of yacc.c */ #line 2559 "hphp.y" { (yyval).setText(""); _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyval));;} break; case 737: /* Line 1455 of yacc.c */ #line 2563 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 738: /* Line 1455 of yacc.c */ #line 2564 "hphp.y" { _p->onConstantValue((yyval), (yyvsp[(1) - (1)]));;} break; case 739: /* Line 1455 of yacc.c */ #line 2566 "hphp.y" { _p->onArray((yyval),(yyvsp[(3) - (4)]),T_ARRAY); ;} break; case 740: /* Line 1455 of yacc.c */ #line 2567 "hphp.y" { _p->onArray((yyval),(yyvsp[(2) - (3)]),T_ARRAY); ;} break; case 741: /* Line 1455 of yacc.c */ #line 2569 "hphp.y" { _p->onArray((yyval),(yyvsp[(3) - (4)]),T_ARRAY); ;} break; case 742: /* Line 1455 of yacc.c */ #line 2570 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 743: /* Line 1455 of yacc.c */ #line 2571 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 744: /* Line 1455 of yacc.c */ #line 2572 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 745: /* Line 1455 of yacc.c */ #line 2573 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 746: /* Line 1455 of yacc.c */ #line 2574 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 747: /* Line 1455 of yacc.c */ #line 2575 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 748: /* Line 1455 of yacc.c */ #line 2577 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_BOOLEAN_OR);;} break; case 749: /* Line 1455 of yacc.c */ #line 2579 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_BOOLEAN_AND);;} break; case 750: /* Line 1455 of yacc.c */ #line 2581 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_OR);;} break; case 751: /* Line 1455 of yacc.c */ #line 2583 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_AND);;} break; case 752: /* Line 1455 of yacc.c */ #line 2585 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_LOGICAL_XOR);;} break; case 753: /* Line 1455 of yacc.c */ #line 2586 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'|');;} break; case 754: /* Line 1455 of yacc.c */ #line 2587 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'&');;} break; case 755: /* Line 1455 of yacc.c */ #line 2588 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'^');;} break; case 756: /* Line 1455 of yacc.c */ #line 2589 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'.');;} break; case 757: /* Line 1455 of yacc.c */ #line 2590 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'+');;} break; case 758: /* Line 1455 of yacc.c */ #line 2591 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'-');;} break; case 759: /* Line 1455 of yacc.c */ #line 2592 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'*');;} break; case 760: /* Line 1455 of yacc.c */ #line 2593 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'/');;} break; case 761: /* Line 1455 of yacc.c */ #line 2594 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'%');;} break; case 762: /* Line 1455 of yacc.c */ #line 2595 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SL);;} break; case 763: /* Line 1455 of yacc.c */ #line 2596 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SR);;} break; case 764: /* Line 1455 of yacc.c */ #line 2597 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_POW);;} break; case 765: /* Line 1455 of yacc.c */ #line 2598 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'!',1);;} break; case 766: /* Line 1455 of yacc.c */ #line 2599 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'~',1);;} break; case 767: /* Line 1455 of yacc.c */ #line 2600 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'+',1);;} break; case 768: /* Line 1455 of yacc.c */ #line 2601 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'-',1);;} break; case 769: /* Line 1455 of yacc.c */ #line 2603 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_IDENTICAL);;} break; case 770: /* Line 1455 of yacc.c */ #line 2605 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_NOT_IDENTICAL);;} break; case 771: /* Line 1455 of yacc.c */ #line 2607 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_EQUAL);;} break; case 772: /* Line 1455 of yacc.c */ #line 2609 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_IS_NOT_EQUAL);;} break; case 773: /* Line 1455 of yacc.c */ #line 2610 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'<');;} break; case 774: /* Line 1455 of yacc.c */ #line 2612 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]), T_IS_SMALLER_OR_EQUAL);;} break; case 775: /* Line 1455 of yacc.c */ #line 2614 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),'>');;} break; case 776: /* Line 1455 of yacc.c */ #line 2617 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]), T_IS_GREATER_OR_EQUAL);;} break; case 777: /* Line 1455 of yacc.c */ #line 2621 "hphp.y" { BEXP((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),T_SPACESHIP);;} break; case 778: /* Line 1455 of yacc.c */ #line 2624 "hphp.y" { _p->onQOp((yyval), (yyvsp[(1) - (5)]), &(yyvsp[(3) - (5)]), (yyvsp[(5) - (5)]));;} break; case 779: /* Line 1455 of yacc.c */ #line 2625 "hphp.y" { _p->onQOp((yyval), (yyvsp[(1) - (4)]), 0, (yyvsp[(4) - (4)]));;} break; case 780: /* Line 1455 of yacc.c */ #line 2629 "hphp.y" { _p->onExprListElem((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 781: /* Line 1455 of yacc.c */ #line 2630 "hphp.y" { _p->onExprListElem((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 782: /* Line 1455 of yacc.c */ #line 2636 "hphp.y" { _p->onClassConst((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 1);;} break; case 783: /* Line 1455 of yacc.c */ #line 2638 "hphp.y" { (yyvsp[(1) - (3)]).xhpLabel(); _p->onClassConst((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 1);;} break; case 784: /* Line 1455 of yacc.c */ #line 2641 "hphp.y" { (yyvsp[(1) - (3)]).xhpLabel(); _p->onClassClass((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 1);;} break; case 785: /* Line 1455 of yacc.c */ #line 2645 "hphp.y" { _p->onClassClass((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 1);;} break; case 786: /* Line 1455 of yacc.c */ #line 2649 "hphp.y" { _p->onConstantValue((yyval), (yyvsp[(1) - (1)]));;} break; case 787: /* Line 1455 of yacc.c */ #line 2650 "hphp.y" { _p->onConstantValue((yyval), (yyvsp[(1) - (1)]));;} break; case 788: /* Line 1455 of yacc.c */ #line 2651 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 789: /* Line 1455 of yacc.c */ #line 2652 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 790: /* Line 1455 of yacc.c */ #line 2653 "hphp.y" { _p->onEncapsList((yyval),'"',(yyvsp[(2) - (3)]));;} break; case 791: /* Line 1455 of yacc.c */ #line 2654 "hphp.y" { _p->onEncapsList((yyval),'\'',(yyvsp[(2) - (3)]));;} break; case 792: /* Line 1455 of yacc.c */ #line 2656 "hphp.y" { _p->onEncapsList((yyval),T_START_HEREDOC, (yyvsp[(2) - (3)]));;} break; case 793: /* Line 1455 of yacc.c */ #line 2661 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 794: /* Line 1455 of yacc.c */ #line 2662 "hphp.y" { (yyval).reset();;} break; case 795: /* Line 1455 of yacc.c */ #line 2666 "hphp.y" { (yyval).reset();;} break; case 796: /* Line 1455 of yacc.c */ #line 2667 "hphp.y" { (yyval).reset();;} break; case 797: /* Line 1455 of yacc.c */ #line 2670 "hphp.y" { only_in_hh_syntax(_p); (yyval).reset();;} break; case 798: /* Line 1455 of yacc.c */ #line 2671 "hphp.y" { (yyval).reset();;} break; case 799: /* Line 1455 of yacc.c */ #line 2677 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 800: /* Line 1455 of yacc.c */ #line 2679 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]),0);;} break; case 801: /* Line 1455 of yacc.c */ #line 2681 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 802: /* Line 1455 of yacc.c */ #line 2682 "hphp.y" { _p->onArrayPair((yyval), 0, 0,(yyvsp[(1) - (1)]),0);;} break; case 803: /* Line 1455 of yacc.c */ #line 2686 "hphp.y" { _p->onScalar((yyval), T_LNUMBER, (yyvsp[(1) - (1)]));;} break; case 804: /* Line 1455 of yacc.c */ #line 2687 "hphp.y" { _p->onScalar((yyval), T_DNUMBER, (yyvsp[(1) - (1)]));;} break; case 805: /* Line 1455 of yacc.c */ #line 2688 "hphp.y" { _p->onScalar((yyval), T_ONUMBER, (yyvsp[(1) - (1)]));;} break; case 806: /* Line 1455 of yacc.c */ #line 2691 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(2) - (3)]));;} break; case 807: /* Line 1455 of yacc.c */ #line 2693 "hphp.y" { (yyval).setText(""); _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyval));;} break; case 808: /* Line 1455 of yacc.c */ #line 2696 "hphp.y" { _p->onScalar((yyval),T_LNUMBER,(yyvsp[(1) - (1)]));;} break; case 809: /* Line 1455 of yacc.c */ #line 2697 "hphp.y" { _p->onScalar((yyval),T_DNUMBER,(yyvsp[(1) - (1)]));;} break; case 810: /* Line 1455 of yacc.c */ #line 2698 "hphp.y" { _p->onScalar((yyval),T_ONUMBER,(yyvsp[(1) - (1)]));;} break; case 811: /* Line 1455 of yacc.c */ #line 2699 "hphp.y" { constant_ae(_p,(yyval),(yyvsp[(1) - (1)]));;} break; case 812: /* Line 1455 of yacc.c */ #line 2703 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING,(yyvsp[(1) - (1)]));;} break; case 813: /* Line 1455 of yacc.c */ #line 2706 "hphp.y" { _p->onScalar((yyval), T_CONSTANT_ENCAPSED_STRING, (yyvsp[(1) - (3)]) + (yyvsp[(3) - (3)]));;} break; case 815: /* Line 1455 of yacc.c */ #line 2713 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 816: /* Line 1455 of yacc.c */ #line 2714 "hphp.y" { constant_ae(_p,(yyval),(yyvsp[(1) - (1)]));;} break; case 817: /* Line 1455 of yacc.c */ #line 2715 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'+',1);;} break; case 818: /* Line 1455 of yacc.c */ #line 2716 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),'-',1);;} break; case 819: /* Line 1455 of yacc.c */ #line 2718 "hphp.y" { _p->onArray((yyval),(yyvsp[(3) - (4)]),T_ARRAY);;} break; case 820: /* Line 1455 of yacc.c */ #line 2719 "hphp.y" { _p->onArray((yyval),(yyvsp[(2) - (3)]),T_ARRAY);;} break; case 821: /* Line 1455 of yacc.c */ #line 2721 "hphp.y" { _p->onArray((yyval),(yyvsp[(3) - (4)]),T_ARRAY); ;} break; case 822: /* Line 1455 of yacc.c */ #line 2722 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 823: /* Line 1455 of yacc.c */ #line 2723 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 824: /* Line 1455 of yacc.c */ #line 2724 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 825: /* Line 1455 of yacc.c */ #line 2729 "hphp.y" { _p->onExprListElem((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 826: /* Line 1455 of yacc.c */ #line 2730 "hphp.y" { _p->onExprListElem((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 827: /* Line 1455 of yacc.c */ #line 2735 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 828: /* Line 1455 of yacc.c */ #line 2736 "hphp.y" { (yyval).reset();;} break; case 829: /* Line 1455 of yacc.c */ #line 2741 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 830: /* Line 1455 of yacc.c */ #line 2743 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]),0);;} break; case 831: /* Line 1455 of yacc.c */ #line 2745 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 832: /* Line 1455 of yacc.c */ #line 2746 "hphp.y" { _p->onArrayPair((yyval), 0, 0,(yyvsp[(1) - (1)]),0);;} break; case 833: /* Line 1455 of yacc.c */ #line 2750 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]),0);;} break; case 834: /* Line 1455 of yacc.c */ #line 2751 "hphp.y" { _p->onArrayPair((yyval), 0, 0,(yyvsp[(1) - (1)]),0);;} break; case 835: /* Line 1455 of yacc.c */ #line 2756 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 836: /* Line 1455 of yacc.c */ #line 2757 "hphp.y" { (yyval).reset(); ;} break; case 837: /* Line 1455 of yacc.c */ #line 2762 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0); ;} break; case 838: /* Line 1455 of yacc.c */ #line 2765 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0); ;} break; case 839: /* Line 1455 of yacc.c */ #line 2770 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 840: /* Line 1455 of yacc.c */ #line 2771 "hphp.y" { (yyval).reset();;} break; case 841: /* Line 1455 of yacc.c */ #line 2774 "hphp.y" { _p->onArray((yyval),(yyvsp[(2) - (3)]),T_ARRAY);;} break; case 842: /* Line 1455 of yacc.c */ #line 2775 "hphp.y" { Token t; t.reset(); _p->onArray((yyval),t,T_ARRAY);;} break; case 843: /* Line 1455 of yacc.c */ #line 2782 "hphp.y" { _p->onUserAttribute((yyval),&(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),(yyvsp[(4) - (4)]));;} break; case 844: /* Line 1455 of yacc.c */ #line 2784 "hphp.y" { _p->onUserAttribute((yyval), 0,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 845: /* Line 1455 of yacc.c */ #line 2787 "hphp.y" { only_in_hh_syntax(_p);;} break; case 846: /* Line 1455 of yacc.c */ #line 2789 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 847: /* Line 1455 of yacc.c */ #line 2792 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 848: /* Line 1455 of yacc.c */ #line 2795 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 849: /* Line 1455 of yacc.c */ #line 2796 "hphp.y" { (yyval).reset();;} break; case 850: /* Line 1455 of yacc.c */ #line 2800 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = 0;;} break; case 851: /* Line 1455 of yacc.c */ #line 2801 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = 1;;} break; case 852: /* Line 1455 of yacc.c */ #line 2805 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = HPHP::ObjPropNormal;;} break; case 853: /* Line 1455 of yacc.c */ #line 2806 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = HPHP::ObjPropXhpAttr;;} break; case 854: /* Line 1455 of yacc.c */ #line 2807 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]); (yyval) = HPHP::ObjPropNormal;;} break; case 855: /* Line 1455 of yacc.c */ #line 2811 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 856: /* Line 1455 of yacc.c */ #line 2816 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = HPHP::ObjPropNormal;;} break; case 857: /* Line 1455 of yacc.c */ #line 2821 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 858: /* Line 1455 of yacc.c */ #line 2822 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 859: /* Line 1455 of yacc.c */ #line 2826 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 860: /* Line 1455 of yacc.c */ #line 2831 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 861: /* Line 1455 of yacc.c */ #line 2836 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 862: /* Line 1455 of yacc.c */ #line 2837 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 863: /* Line 1455 of yacc.c */ #line 2841 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 864: /* Line 1455 of yacc.c */ #line 2843 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));;} break; case 865: /* Line 1455 of yacc.c */ #line 2848 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 866: /* Line 1455 of yacc.c */ #line 2850 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));;} break; case 867: /* Line 1455 of yacc.c */ #line 2856 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(2) - (5)]), !(yyvsp[(4) - (5)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(5) - (5)]) ); ;} break; case 868: /* Line 1455 of yacc.c */ #line 2867 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(2) - (5)]), !(yyvsp[(4) - (5)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(5) - (5)]) ); ;} break; case 869: /* Line 1455 of yacc.c */ #line 2882 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(2) - (5)]), !(yyvsp[(4) - (5)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(5) - (5)]) ); ;} break; case 870: /* Line 1455 of yacc.c */ #line 2894 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(2) - (5)]), !(yyvsp[(4) - (5)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(5) - (5)]) ); ;} break; case 871: /* Line 1455 of yacc.c */ #line 2906 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 872: /* Line 1455 of yacc.c */ #line 2907 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 873: /* Line 1455 of yacc.c */ #line 2908 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 874: /* Line 1455 of yacc.c */ #line 2909 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 875: /* Line 1455 of yacc.c */ #line 2910 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 876: /* Line 1455 of yacc.c */ #line 2911 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 877: /* Line 1455 of yacc.c */ #line 2913 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(1) - (3)]), !(yyvsp[(2) - (3)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(3) - (3)]) ); ;} break; case 878: /* Line 1455 of yacc.c */ #line 2930 "hphp.y" { _p->onStaticMember((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 879: /* Line 1455 of yacc.c */ #line 2932 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 880: /* Line 1455 of yacc.c */ #line 2934 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 881: /* Line 1455 of yacc.c */ #line 2935 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 882: /* Line 1455 of yacc.c */ #line 2939 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 883: /* Line 1455 of yacc.c */ #line 2940 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 884: /* Line 1455 of yacc.c */ #line 2941 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 885: /* Line 1455 of yacc.c */ #line 2942 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 886: /* Line 1455 of yacc.c */ #line 2950 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(1) - (3)]), !(yyvsp[(2) - (3)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(3) - (3)]) ); ;} break; case 887: /* Line 1455 of yacc.c */ #line 2959 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 888: /* Line 1455 of yacc.c */ #line 2961 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 889: /* Line 1455 of yacc.c */ #line 2962 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 890: /* Line 1455 of yacc.c */ #line 2966 "hphp.y" { _p->onStaticMember((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 891: /* Line 1455 of yacc.c */ #line 2971 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 892: /* Line 1455 of yacc.c */ #line 2972 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 893: /* Line 1455 of yacc.c */ #line 2973 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 894: /* Line 1455 of yacc.c */ #line 2974 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 895: /* Line 1455 of yacc.c */ #line 2975 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 896: /* Line 1455 of yacc.c */ #line 2976 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 897: /* Line 1455 of yacc.c */ #line 2977 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 898: /* Line 1455 of yacc.c */ #line 2979 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 899: /* Line 1455 of yacc.c */ #line 2981 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]),NULL);;} break; case 900: /* Line 1455 of yacc.c */ #line 2985 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 901: /* Line 1455 of yacc.c */ #line 2989 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 902: /* Line 1455 of yacc.c */ #line 2990 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 903: /* Line 1455 of yacc.c */ #line 2996 "hphp.y" { _p->onObjectMethodCall((yyval),(yyvsp[(1) - (7)]),(yyvsp[(2) - (7)]).num(),(yyvsp[(3) - (7)]),(yyvsp[(6) - (7)]));;} break; case 904: /* Line 1455 of yacc.c */ #line 3000 "hphp.y" { _p->onObjectMethodCall((yyval),(yyvsp[(2) - (9)]),(yyvsp[(4) - (9)]).num(),(yyvsp[(5) - (9)]),(yyvsp[(8) - (9)]));;} break; case 905: /* Line 1455 of yacc.c */ #line 3007 "hphp.y" { _p->onCall((yyval),0,(yyvsp[(3) - (7)]),(yyvsp[(6) - (7)]),&(yyvsp[(1) - (7)]));;} break; case 906: /* Line 1455 of yacc.c */ #line 3016 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(3) - (6)]),(yyvsp[(5) - (6)]),&(yyvsp[(1) - (6)]));;} break; case 907: /* Line 1455 of yacc.c */ #line 3020 "hphp.y" { _p->onCall((yyval),1,(yyvsp[(4) - (8)]),(yyvsp[(7) - (8)]),&(yyvsp[(1) - (8)]));;} break; case 908: /* Line 1455 of yacc.c */ #line 3024 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 909: /* Line 1455 of yacc.c */ #line 3033 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]));;} break; case 910: /* Line 1455 of yacc.c */ #line 3034 "hphp.y" { _p->onRefDim((yyval), (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]));;} break; case 911: /* Line 1455 of yacc.c */ #line 3035 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 912: /* Line 1455 of yacc.c */ #line 3039 "hphp.y" { _p->onSimpleVariable((yyval), (yyvsp[(1) - (1)]));;} break; case 913: /* Line 1455 of yacc.c */ #line 3040 "hphp.y" { _p->onPipeVariable((yyval));;} break; case 914: /* Line 1455 of yacc.c */ #line 3041 "hphp.y" { _p->onDynamicVariable((yyval), (yyvsp[(3) - (4)]), 0);;} break; case 915: /* Line 1455 of yacc.c */ #line 3043 "hphp.y" { (yyvsp[(1) - (2)]) = 1; _p->onIndirectRef((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));;} break; case 916: /* Line 1455 of yacc.c */ #line 3048 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 917: /* Line 1455 of yacc.c */ #line 3049 "hphp.y" { (yyval).reset();;} break; case 918: /* Line 1455 of yacc.c */ #line 3060 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 919: /* Line 1455 of yacc.c */ #line 3061 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 920: /* Line 1455 of yacc.c */ #line 3062 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 921: /* Line 1455 of yacc.c */ #line 3065 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(1) - (3)]), !(yyvsp[(2) - (3)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(3) - (3)]) ); ;} break; case 922: /* Line 1455 of yacc.c */ #line 3076 "hphp.y" { _p->onStaticMember((yyval),(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 923: /* Line 1455 of yacc.c */ #line 3077 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 925: /* Line 1455 of yacc.c */ #line 3081 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 926: /* Line 1455 of yacc.c */ #line 3082 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]);;} break; case 927: /* Line 1455 of yacc.c */ #line 3085 "hphp.y" { _p->onObjectProperty( (yyval), (yyvsp[(1) - (3)]), !(yyvsp[(2) - (3)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(3) - (3)]) ); ;} break; case 928: /* Line 1455 of yacc.c */ #line 3094 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 929: /* Line 1455 of yacc.c */ #line 3098 "hphp.y" { _p->onAListVar((yyval),&(yyvsp[(1) - (2)]),NULL);;} break; case 930: /* Line 1455 of yacc.c */ #line 3099 "hphp.y" { _p->onAListVar((yyval),&(yyvsp[(1) - (3)]),&(yyvsp[(3) - (3)]));;} break; case 931: /* Line 1455 of yacc.c */ #line 3101 "hphp.y" { _p->onAListSub((yyval),&(yyvsp[(1) - (6)]),(yyvsp[(5) - (6)]));;} break; case 932: /* Line 1455 of yacc.c */ #line 3102 "hphp.y" { _p->onAListVar((yyval),NULL,NULL);;} break; case 933: /* Line 1455 of yacc.c */ #line 3103 "hphp.y" { _p->onAListVar((yyval),NULL,&(yyvsp[(1) - (1)]));;} break; case 934: /* Line 1455 of yacc.c */ #line 3104 "hphp.y" { _p->onAListSub((yyval),NULL,(yyvsp[(3) - (4)]));;} break; case 935: /* Line 1455 of yacc.c */ #line 3109 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 936: /* Line 1455 of yacc.c */ #line 3110 "hphp.y" { (yyval).reset();;} break; case 937: /* Line 1455 of yacc.c */ #line 3114 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]),0);;} break; case 938: /* Line 1455 of yacc.c */ #line 3115 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]),0);;} break; case 939: /* Line 1455 of yacc.c */ #line 3116 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),0);;} break; case 940: /* Line 1455 of yacc.c */ #line 3117 "hphp.y" { _p->onArrayPair((yyval), 0, 0,(yyvsp[(1) - (1)]),0);;} break; case 941: /* Line 1455 of yacc.c */ #line 3120 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (6)]),&(yyvsp[(3) - (6)]),(yyvsp[(6) - (6)]),1);;} break; case 942: /* Line 1455 of yacc.c */ #line 3122 "hphp.y" { _p->onArrayPair((yyval),&(yyvsp[(1) - (4)]), 0,(yyvsp[(4) - (4)]),1);;} break; case 943: /* Line 1455 of yacc.c */ #line 3123 "hphp.y" { _p->onArrayPair((yyval), 0,&(yyvsp[(1) - (4)]),(yyvsp[(4) - (4)]),1);;} break; case 944: /* Line 1455 of yacc.c */ #line 3124 "hphp.y" { _p->onArrayPair((yyval), 0, 0,(yyvsp[(2) - (2)]),1);;} break; case 945: /* Line 1455 of yacc.c */ #line 3129 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 946: /* Line 1455 of yacc.c */ #line 3130 "hphp.y" { _p->onEmptyCollection((yyval));;} break; case 947: /* Line 1455 of yacc.c */ #line 3134 "hphp.y" { _p->onCollectionPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 948: /* Line 1455 of yacc.c */ #line 3135 "hphp.y" { _p->onCollectionPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]));;} break; case 949: /* Line 1455 of yacc.c */ #line 3136 "hphp.y" { _p->onCollectionPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 950: /* Line 1455 of yacc.c */ #line 3137 "hphp.y" { _p->onCollectionPair((yyval), 0, 0,(yyvsp[(1) - (1)]));;} break; case 951: /* Line 1455 of yacc.c */ #line 3142 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]);;} break; case 952: /* Line 1455 of yacc.c */ #line 3143 "hphp.y" { _p->onEmptyCollection((yyval));;} break; case 953: /* Line 1455 of yacc.c */ #line 3148 "hphp.y" { _p->onCollectionPair((yyval),&(yyvsp[(1) - (5)]),&(yyvsp[(3) - (5)]),(yyvsp[(5) - (5)]));;} break; case 954: /* Line 1455 of yacc.c */ #line 3150 "hphp.y" { _p->onCollectionPair((yyval),&(yyvsp[(1) - (3)]), 0,(yyvsp[(3) - (3)]));;} break; case 955: /* Line 1455 of yacc.c */ #line 3152 "hphp.y" { _p->onCollectionPair((yyval), 0,&(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]));;} break; case 956: /* Line 1455 of yacc.c */ #line 3153 "hphp.y" { _p->onCollectionPair((yyval), 0, 0,(yyvsp[(1) - (1)]));;} break; case 957: /* Line 1455 of yacc.c */ #line 3157 "hphp.y" { _p->addEncap((yyval), &(yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]), -1);;} break; case 958: /* Line 1455 of yacc.c */ #line 3159 "hphp.y" { _p->addEncap((yyval), &(yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]), 0);;} break; case 959: /* Line 1455 of yacc.c */ #line 3160 "hphp.y" { _p->addEncap((yyval), NULL, (yyvsp[(1) - (1)]), -1);;} break; case 960: /* Line 1455 of yacc.c */ #line 3162 "hphp.y" { _p->addEncap((yyval), NULL, (yyvsp[(1) - (2)]), 0); _p->addEncap((yyval), &(yyval), (yyvsp[(2) - (2)]), -1); ;} break; case 961: /* Line 1455 of yacc.c */ #line 3167 "hphp.y" { _p->onSimpleVariable((yyval), (yyvsp[(1) - (1)]));;} break; case 962: /* Line 1455 of yacc.c */ #line 3169 "hphp.y" { _p->encapRefDim((yyval), (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]));;} break; case 963: /* Line 1455 of yacc.c */ #line 3171 "hphp.y" { _p->encapObjProp( (yyval), (yyvsp[(1) - (3)]), !(yyvsp[(2) - (3)]).num() ? HPHP::PropAccessType::Normal : HPHP::PropAccessType::NullSafe, (yyvsp[(3) - (3)]) ); ;} break; case 964: /* Line 1455 of yacc.c */ #line 3181 "hphp.y" { _p->onDynamicVariable((yyval), (yyvsp[(2) - (3)]), 1);;} break; case 965: /* Line 1455 of yacc.c */ #line 3183 "hphp.y" { _p->encapArray((yyval), (yyvsp[(2) - (6)]), (yyvsp[(4) - (6)]));;} break; case 966: /* Line 1455 of yacc.c */ #line 3184 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]);;} break; case 967: /* Line 1455 of yacc.c */ #line 3187 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = T_STRING;;} break; case 968: /* Line 1455 of yacc.c */ #line 3188 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = T_NUM_STRING;;} break; case 969: /* Line 1455 of yacc.c */ #line 3189 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); (yyval) = T_VARIABLE;;} break; case 970: /* Line 1455 of yacc.c */ #line 3193 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),T_ISSET,1);;} break; case 971: /* Line 1455 of yacc.c */ #line 3194 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),T_EMPTY,1);;} break; case 972: /* Line 1455 of yacc.c */ #line 3195 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),'!',1);;} break; case 973: /* Line 1455 of yacc.c */ #line 3196 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),'!',1);;} break; case 974: /* Line 1455 of yacc.c */ #line 3197 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),'!',1);;} break; case 975: /* Line 1455 of yacc.c */ #line 3198 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),'!',1);;} break; case 976: /* Line 1455 of yacc.c */ #line 3199 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_INCLUDE,1);;} break; case 977: /* Line 1455 of yacc.c */ #line 3200 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_INCLUDE_ONCE,1);;} break; case 978: /* Line 1455 of yacc.c */ #line 3201 "hphp.y" { UEXP((yyval),(yyvsp[(3) - (4)]),T_EVAL,1);;} break; case 979: /* Line 1455 of yacc.c */ #line 3202 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_REQUIRE,1);;} break; case 980: /* Line 1455 of yacc.c */ #line 3203 "hphp.y" { UEXP((yyval),(yyvsp[(2) - (2)]),T_REQUIRE_ONCE,1);;} break; case 981: /* Line 1455 of yacc.c */ #line 3207 "hphp.y" { _p->onExprListElem((yyval), NULL, (yyvsp[(1) - (1)]));;} break; case 982: /* Line 1455 of yacc.c */ #line 3208 "hphp.y" { _p->onExprListElem((yyval), &(yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));;} break; case 983: /* Line 1455 of yacc.c */ #line 3213 "hphp.y" { _p->onClassConst((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0);;} break; case 984: /* Line 1455 of yacc.c */ #line 3215 "hphp.y" { _p->onClassClass((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), 0);;} break; case 987: /* Line 1455 of yacc.c */ #line 3229 "hphp.y" { (yyvsp[(2) - (5)]).setText(_p->nsClassDecl((yyvsp[(2) - (5)]).text())); _p->onTypedef((yyval), (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)])); _p->popTypeScope(); ;} break; case 988: /* Line 1455 of yacc.c */ #line 3234 "hphp.y" { (yyvsp[(3) - (6)]).setText(_p->nsClassDecl((yyvsp[(3) - (6)]).text())); _p->onTypedef((yyval), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]), &(yyvsp[(1) - (6)])); _p->popTypeScope(); ;} break; case 989: /* Line 1455 of yacc.c */ #line 3238 "hphp.y" { (yyvsp[(2) - (6)]).setText(_p->nsClassDecl((yyvsp[(2) - (6)]).text())); _p->onTypedef((yyval), (yyvsp[(2) - (6)]), (yyvsp[(5) - (6)])); _p->popTypeScope(); ;} break; case 990: /* Line 1455 of yacc.c */ #line 3243 "hphp.y" { (yyvsp[(3) - (7)]).setText(_p->nsClassDecl((yyvsp[(3) - (7)]).text())); _p->onTypedef((yyval), (yyvsp[(3) - (7)]), (yyvsp[(6) - (7)]), &(yyvsp[(1) - (7)])); _p->popTypeScope(); ;} break; case 991: /* Line 1455 of yacc.c */ #line 3249 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 992: /* Line 1455 of yacc.c */ #line 3250 "hphp.y" { only_in_hh_syntax(_p); (yyval) = (yyvsp[(2) - (2)]); ;} break; case 993: /* Line 1455 of yacc.c */ #line 3254 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 994: /* Line 1455 of yacc.c */ #line 3255 "hphp.y" { only_in_hh_syntax(_p); (yyval) = (yyvsp[(2) - (2)]); ;} break; case 995: /* Line 1455 of yacc.c */ #line 3261 "hphp.y" { _p->pushTypeScope(); (yyval) = (yyvsp[(1) - (1)]); ;} break; case 996: /* Line 1455 of yacc.c */ #line 3265 "hphp.y" { _p->pushTypeScope(); (yyval) = (yyvsp[(1) - (4)]); ;} break; case 997: /* Line 1455 of yacc.c */ #line 3271 "hphp.y" { _p->pushTypeScope(); (yyval) = (yyvsp[(1) - (1)]); ;} break; case 998: /* Line 1455 of yacc.c */ #line 3275 "hphp.y" { Token t; _p->setTypeVars(t, (yyvsp[(1) - (4)])); _p->pushTypeScope(); (yyval) = t; ;} break; case 999: /* Line 1455 of yacc.c */ #line 3282 "hphp.y" { (yyval) = (yyvsp[(2) - (3)]); ;} break; case 1000: /* Line 1455 of yacc.c */ #line 3283 "hphp.y" { (yyval).reset(); ;} break; case 1001: /* Line 1455 of yacc.c */ #line 3287 "hphp.y" { Token t; t.reset(); _p->onTypeList((yyvsp[(1) - (1)]), t); (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1002: /* Line 1455 of yacc.c */ #line 3290 "hphp.y" { _p->onTypeList((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); (yyval) = (yyvsp[(1) - (3)]); ;} break; case 1003: /* Line 1455 of yacc.c */ #line 3296 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 1004: /* Line 1455 of yacc.c */ #line 3301 "hphp.y" { (yyval) = (yyvsp[(1) - (3)]); ;} break; case 1005: /* Line 1455 of yacc.c */ #line 3302 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1006: /* Line 1455 of yacc.c */ #line 3303 "hphp.y" { (yyval).reset(); ;} break; case 1007: /* Line 1455 of yacc.c */ #line 3304 "hphp.y" { (yyval).reset(); ;} break; case 1008: /* Line 1455 of yacc.c */ #line 3308 "hphp.y" { (yyval).reset(); ;} break; case 1009: /* Line 1455 of yacc.c */ #line 3309 "hphp.y" { (yyval) = (yyvsp[(2) - (2)]); (yyval) = 1; ;} break; case 1012: /* Line 1455 of yacc.c */ #line 3318 "hphp.y" { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 1015: /* Line 1455 of yacc.c */ #line 3329 "hphp.y" { _p->addTypeVar((yyvsp[(4) - (4)]).text()); ;} break; case 1016: /* Line 1455 of yacc.c */ #line 3331 "hphp.y" { _p->addTypeVar((yyvsp[(2) - (2)]).text()); ;} break; case 1017: /* Line 1455 of yacc.c */ #line 3335 "hphp.y" { _p->addTypeVar((yyvsp[(4) - (5)]).text()); ;} break; case 1018: /* Line 1455 of yacc.c */ #line 3338 "hphp.y" { _p->addTypeVar((yyvsp[(2) - (3)]).text()); ;} break; case 1019: /* Line 1455 of yacc.c */ #line 3342 "hphp.y" {;} break; case 1020: /* Line 1455 of yacc.c */ #line 3343 "hphp.y" {;} break; case 1021: /* Line 1455 of yacc.c */ #line 3344 "hphp.y" {;} break; case 1022: /* Line 1455 of yacc.c */ #line 3350 "hphp.y" { validate_shape_keyname((yyvsp[(1) - (3)]), _p); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} break; case 1023: /* Line 1455 of yacc.c */ #line 3355 "hphp.y" { /* should not reach here as * optional shape fields are not * supported in strict mode */ validate_shape_keyname((yyvsp[(2) - (4)]), _p); _p->onTypeAnnotation((yyval), (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])); ;} break; case 1024: /* Line 1455 of yacc.c */ #line 3366 "hphp.y" { _p->onClsCnsShapeField((yyval), (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); ;} break; case 1025: /* Line 1455 of yacc.c */ #line 3371 "hphp.y" { _p->onTypeList((yyval), (yyvsp[(3) - (3)])); ;} break; case 1026: /* Line 1455 of yacc.c */ #line 3372 "hphp.y" { ;} break; case 1027: /* Line 1455 of yacc.c */ #line 3377 "hphp.y" { _p->onShape((yyval), (yyvsp[(1) - (2)])); ;} break; case 1028: /* Line 1455 of yacc.c */ #line 3378 "hphp.y" { Token t; t.reset(); _p->onShape((yyval), t); ;} break; case 1029: /* Line 1455 of yacc.c */ #line 3384 "hphp.y" { (yyval) = (yyvsp[(3) - (4)]); (yyval).setText("array"); ;} break; case 1030: /* Line 1455 of yacc.c */ #line 3389 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1031: /* Line 1455 of yacc.c */ #line 3394 "hphp.y" { Token t; t.reset(); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (3)]), t); _p->onTypeList((yyval), (yyvsp[(3) - (3)])); ;} break; case 1032: /* Line 1455 of yacc.c */ #line 3398 "hphp.y" { _p->onTypeAnnotation((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); ;} break; case 1033: /* Line 1455 of yacc.c */ #line 3403 "hphp.y" { (yyval) = (yyvsp[(2) - (4)]);;} break; case 1034: /* Line 1455 of yacc.c */ #line 3405 "hphp.y" { _p->onTypeList((yyvsp[(2) - (5)]), (yyvsp[(4) - (5)])); (yyval) = (yyvsp[(2) - (5)]);;} break; case 1035: /* Line 1455 of yacc.c */ #line 3411 "hphp.y" { only_in_hh_syntax(_p); _p->onTypeSpecialization((yyvsp[(2) - (2)]), '?'); (yyval) = (yyvsp[(2) - (2)]); ;} break; case 1036: /* Line 1455 of yacc.c */ #line 3414 "hphp.y" { only_in_hh_syntax(_p); _p->onTypeSpecialization((yyvsp[(2) - (2)]), '@'); (yyval) = (yyvsp[(2) - (2)]); ;} break; case 1037: /* Line 1455 of yacc.c */ #line 3417 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1038: /* Line 1455 of yacc.c */ #line 3418 "hphp.y" { Token t; t.reset(); (yyvsp[(1) - (1)]).setText("array"); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (1)]), t); ;} break; case 1039: /* Line 1455 of yacc.c */ #line 3421 "hphp.y" { Token t; t.reset(); (yyvsp[(1) - (1)]).setText("callable"); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (1)]), t); ;} break; case 1040: /* Line 1455 of yacc.c */ #line 3424 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1041: /* Line 1455 of yacc.c */ #line 3427 "hphp.y" { only_in_hh_syntax(_p); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); _p->onTypeSpecialization((yyval), 'a'); ;} break; case 1042: /* Line 1455 of yacc.c */ #line 3430 "hphp.y" { (yyvsp[(1) - (2)]).setText("array"); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); ;} break; case 1043: /* Line 1455 of yacc.c */ #line 3432 "hphp.y" { (yyvsp[(1) - (1)]).xhpLabel(); Token t; t.reset(); _p->onTypeAnnotation((yyval), (yyvsp[(1) - (1)]), t); _p->onTypeSpecialization((yyval), 'x'); ;} break; case 1044: /* Line 1455 of yacc.c */ #line 3438 "hphp.y" { only_in_hh_syntax(_p); _p->onTypeList((yyvsp[(7) - (8)]), (yyvsp[(4) - (8)])); _p->onTypeAnnotation((yyval), (yyvsp[(2) - (8)]), (yyvsp[(7) - (8)])); _p->onTypeSpecialization((yyval), 'f'); ;} break; case 1045: /* Line 1455 of yacc.c */ #line 3444 "hphp.y" { only_in_hh_syntax(_p); _p->onTypeList((yyvsp[(2) - (6)]), (yyvsp[(4) - (6)])); Token t; t.reset(); t.setText("array"); _p->onTypeAnnotation((yyval), t, (yyvsp[(2) - (6)])); _p->onTypeSpecialization((yyval), 't'); ;} break; case 1046: /* Line 1455 of yacc.c */ #line 3452 "hphp.y" { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 1047: /* Line 1455 of yacc.c */ #line 3453 "hphp.y" { (yyval).reset(); ;} break; /* Line 1455 of yacc.c */ #line 14519 "hphp.7.tab.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (&yylloc, _p, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (&yylloc, _p, yymsg); } else { yyerror (&yylloc, _p, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } yyerror_range[0] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc, _p); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, _p); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, _p, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, _p); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp, _p); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); YYSTACK_CLEANUP; #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 3456 "hphp.y" /* !PHP5_ONLY*/ /* REMOVED */ /* !END */ /* !PHP7_ONLY*/ bool Parser::parseImpl7() { /* !END */ return yyparse(this) == 0; }
40.530405
174
0.3726
[ "shape", "vector" ]
97f258cb2d23b0167d768425236a08570742510d
3,151
cpp
C++
src/MushMesh/MushMeshUtils.cpp
quimnuss/adanaxis
a04eb945fe808aeb9be5da305a37ff47e04dd006
[ "MIT" ]
null
null
null
src/MushMesh/MushMeshUtils.cpp
quimnuss/adanaxis
a04eb945fe808aeb9be5da305a37ff47e04dd006
[ "MIT" ]
null
null
null
src/MushMesh/MushMeshUtils.cpp
quimnuss/adanaxis
a04eb945fe808aeb9be5da305a37ff47e04dd006
[ "MIT" ]
null
null
null
//%Header { /***************************************************************************** * * File: src/MushMesh/MushMeshUtils.cpp * * Author: Andy Southgate 2002-2005 * * This file contains original work by Andy Southgate. The author and his * employer (Mushware Limited) irrevocably waive all of their copyright rights * vested in this particular version of this file to the furthest extent * permitted. The author and Mushware Limited also irrevocably waive any and * all of their intellectual property rights arising from said file and its * creation that would otherwise restrict the rights of any party to use and/or * distribute the use of, the techniques and methods used herein. A written * waiver can be obtained via http://www.mushware.com/. * * This software carries NO WARRANTY of any kind. * ****************************************************************************/ //%Header } vwV6SiVDpdczt8FUUII4/g /* * $Id: MushMeshUtils.cpp,v 1.11 2005/07/04 15:59:00 southa Exp $ * $Log: MushMeshUtils.cpp,v $ * Revision 1.11 2005/07/04 15:59:00 southa * Adanaxis work * * Revision 1.10 2005/05/19 13:02:11 southa * Mac release work * * Revision 1.9 2005/02/10 12:34:07 southa * Template fixes * * Revision 1.8 2005/01/27 21:00:39 southa * Division and rendering * * Revision 1.7 2004/12/13 11:09:11 southa * Quaternion and vector tweaks * * Revision 1.6 2004/01/02 21:13:11 southa * Source conditioning * * Revision 1.5 2003/10/24 12:39:09 southa * Triangular mesh work * * Revision 1.4 2003/10/23 20:03:58 southa * End mesh work * * Revision 1.3 2003/10/15 12:26:59 southa * MushMeshArray neighbour testing and subdivision work * * Revision 1.2 2003/10/15 07:08:29 southa * MushMeshArray creation * * Revision 1.1 2003/10/14 13:07:25 southa * MushMesh vector creation * */ #include "MushMeshUtils.h" #include "MushMeshBox.h" #include "MushMeshGroup.h" #include "MushMeshSTL.h" using namespace Mushware; using namespace std; const tVal MushMeshUtils::m_alphaTable[kMaxValence] = { 0, 3.26667, 1.28205, 2.33333, 4.25806, 6.89157, 10, 13.3978 }; tVal MushMeshUtils::SubdivisionAlphaCalculate(Mushware::U32 inN) { MUSHCOREASSERT(inN > 0); tVal a; a = 3.0 + 2.0 * cos((2*M_PI) / inN); a = 0.625 - a*a/64.0; return inN * (1.0 - a) / a; } void MushMeshUtils::SimpleDivide4Mesh(MushMeshGroup& outGroup, const MushMeshGroup& inGroup, const tVal inScale) { outGroup.OrderResize(2); for (U32 i=0; i < inGroup.SuperGroupSize(1); ++i) { for (U32 j=0; j < inGroup.GroupSize(1, i); ++j) { MushMeshGroup::tValue value; value = inGroup.Value(1, i, j); outGroup.ValueAdd(value, 1, i, j); } } for (U32 i=0; i < inGroup.SuperGroupSize(0); ++i) { for (U32 j=0; j < inGroup.GroupSize(0, i); ++j) { MushMeshGroup::tValue value; value = inGroup.Value(0, i, j); outGroup.ValueAdd(value, 0, i, j); } } }
25.41129
107
0.60457
[ "mesh", "vector" ]
97f46c794f5346eb3044b7fa93bda54c984dd09b
1,792
cpp
C++
REDSI_1160929_1161573/boost_1_67_0/libs/container_hash/test/hash_vector_test.cpp
Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo
eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8
[ "MIT" ]
32
2019-02-27T06:57:07.000Z
2021-08-29T10:56:19.000Z
REDSI_1160929_1161573/boost_1_67_0/libs/container_hash/test/hash_vector_test.cpp
Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo
eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8
[ "MIT" ]
1
2019-04-04T18:00:00.000Z
2019-04-04T18:00:00.000Z
REDSI_1160929_1161573/boost_1_67_0/libs/container_hash/test/hash_vector_test.cpp
Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo
eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8
[ "MIT" ]
5
2019-08-20T13:45:04.000Z
2022-03-01T18:23:49.000Z
// Copyright 2005-2009 Daniel James. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "./config.hpp" #ifdef BOOST_HASH_TEST_EXTENSIONS # ifdef BOOST_HASH_TEST_STD_INCLUDES # include <functional> # else # include <boost/container_hash/hash.hpp> # endif #endif #include <boost/core/lightweight_test.hpp> #ifdef BOOST_HASH_TEST_EXTENSIONS #include <vector> using std::vector; #define CONTAINER_TYPE vector #include "./hash_sequence_test.hpp" #endif // BOOST_HASH_TEST_EXTENSIONS namespace vector_bool_tests { void vector_bool_test() { std::vector<bool> x_empty1,x_empty2,x1,x1a,x2,x3; x1.push_back(0); x1a.push_back(0); x2.push_back(1); x3.push_back(0); x3.push_back(0); BOOST_HASH_TEST_NAMESPACE::hash<std::vector<bool> > hasher; BOOST_TEST_EQ(hasher(x_empty1), hasher(x_empty1)); BOOST_TEST_EQ(hasher(x_empty1), hasher(x_empty2)); BOOST_TEST_NE(hasher(x_empty1), hasher(x1)); BOOST_TEST_NE(hasher(x_empty1), hasher(x2)); BOOST_TEST_NE(hasher(x_empty1), hasher(x3)); BOOST_TEST_EQ(hasher(x1), hasher(x1)); BOOST_TEST_EQ(hasher(x1), hasher(x1a)); BOOST_TEST_NE(hasher(x1), hasher(x2)); BOOST_TEST_NE(hasher(x1), hasher(x3)); BOOST_TEST_EQ(hasher(x2), hasher(x2)); BOOST_TEST_NE(hasher(x2), hasher(x3)); BOOST_TEST_EQ(hasher(x3), hasher(x3)); } } int main() { #ifdef BOOST_HASH_TEST_EXTENSIONS vector_tests::vector_hash_integer_tests(); #endif vector_bool_tests::vector_bool_test(); return boost::report_errors(); }
25.971014
80
0.663504
[ "vector" ]
97fbb3032cbfb44d82cce04a85be9ef404bfb26a
4,675
cpp
C++
test/hash/sha_test.cpp
Warchant/ed25519-sha3
b25f5f25b999ae7e86fe779db628c486c5bae24a
[ "Apache-2.0" ]
24
2018-02-08T05:28:44.000Z
2022-01-16T07:43:47.000Z
test/hash/sha_test.cpp
Warchant/ed25519-sha3
b25f5f25b999ae7e86fe779db628c486c5bae24a
[ "Apache-2.0" ]
6
2018-03-23T20:31:57.000Z
2019-09-29T09:47:25.000Z
test/hash/sha_test.cpp
Warchant/ed25519-sha3
b25f5f25b999ae7e86fe779db628c486c5bae24a
[ "Apache-2.0" ]
19
2018-02-05T15:54:24.000Z
2022-01-29T20:08:32.000Z
#include <ed25519/ed25519/sha256.h> #include <ed25519/ed25519/sha512.h> #include <gtest/gtest.h> #include "hexutil.hpp" #define STRINGIFY2(x) #x #define STRINGIFY(x) STRINGIFY2(x) #ifndef TESTDATA_PATH #error "Define TESTDATA_PATH" #endif struct TestCase { std::string msg; std::string sha256; std::string sha512; }; const std::vector<TestCase> testdata = { #include STRINGIFY(TESTDATA_PATH) }; TEST(SHA_512, IUF_partial) { // search for test case where msg.size > 1 uint32_t tcase = 0; while (testdata[tcase].msg.size() <= 1) { tcase++; if (tcase > testdata.size()) throw std::runtime_error("can not find test case with msg.size() > 1"); } std::string expected = testdata[tcase].sha512; std::string msg = testdata[tcase].msg; std::string out(SHA_512_SIZE, 0); // first half std::string first = msg.substr(0, msg.size() / 2); // second half std::string second = msg.substr(msg.size() / 2, msg.size() - 1); sha_context ctx; sha512_init(&ctx); /* first half */ sha512_update(&ctx, reinterpret_cast<const unsigned char *>(first.data()), first.size()); /* second half */ sha512_update(&ctx, reinterpret_cast<const unsigned char *>(second.data()), second.size()); sha512_final(&ctx, (unsigned char *)out.data()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase; } TEST(SHA_512, IUF) { uint32_t tcase = 0; for (const auto &c : testdata) { std::string expected = c.sha512; std::string msg = c.msg; std::string out(SHA_512_SIZE, 0); sha_context ctx; sha512_init(&ctx); sha512_update(&ctx, reinterpret_cast<const unsigned char *>(msg.data()), msg.size()); sha512_final(&ctx, (unsigned char *)out.data()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase++; } } TEST(SHA_512, Immediate) { uint32_t tcase = 0; for (const auto &c : testdata) { std::string expected = c.sha512; std::string msg = c.msg; std::string out(SHA_512_SIZE, 0); sha512((unsigned char *)out.data(), reinterpret_cast<const unsigned char *>(msg.data()), msg.size()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase++; } } TEST(SHA_256, IUF_partial) { // search for test case where msg.size > 1 uint32_t tcase = 0; while (testdata[tcase].msg.size() <= 1) { tcase++; if (tcase > testdata.size()) throw std::runtime_error("can not find test case with msg.size() > 1"); } std::string expected = testdata[tcase].sha256; std::string msg = testdata[tcase].msg; std::string out(SHA_256_SIZE, 0); // first half std::string first = msg.substr(0, msg.size() / 2); // second half std::string second = msg.substr(msg.size() / 2, msg.size() - 1); sha_context ctx; sha256_init(&ctx); /* first half */ sha256_update(&ctx, reinterpret_cast<const unsigned char *>(first.data()), first.size()); /* second half */ sha256_update(&ctx, reinterpret_cast<const unsigned char *>(second.data()), second.size()); sha256_final(&ctx, (unsigned char *)out.data()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase; } TEST(SHA_256, IUF) { uint32_t tcase = 0; for (const auto &c : testdata) { std::string expected = c.sha256; std::string msg = c.msg; std::string out(SHA_256_SIZE, 0); sha_context ctx; sha256_init(&ctx); sha256_update(&ctx, reinterpret_cast<const unsigned char *>(msg.data()), msg.size()); sha256_final(&ctx, (unsigned char *)out.data()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase++; } } TEST(SHA_256, Immediate) { uint32_t tcase = 0; for (const auto &c : testdata) { std::string expected = c.sha256; std::string msg = c.msg; std::string out(SHA_256_SIZE, 0); sha256((unsigned char *)out.data(), reinterpret_cast<const unsigned char *>(msg.data()), msg.size()); std::string actual = bytes2hex((unsigned char *)out.data(), out.size()); EXPECT_EQ(expected, actual) << "different hashes: case " << tcase++; } }
28.162651
77
0.614118
[ "vector" ]
3f0dcde8d36c707beb956d06e58ca916db3c0bf2
431
cpp
C++
fcpp/fenwick_tree1.cpp
iddoroshenko/Team-Reference-document-ICPC-2019
6c2146e2598ccf91d556201c4672063344ba0aae
[ "MIT" ]
null
null
null
fcpp/fenwick_tree1.cpp
iddoroshenko/Team-Reference-document-ICPC-2019
6c2146e2598ccf91d556201c4672063344ba0aae
[ "MIT" ]
null
null
null
fcpp/fenwick_tree1.cpp
iddoroshenko/Team-Reference-document-ICPC-2019
6c2146e2598ccf91d556201c4672063344ba0aae
[ "MIT" ]
1
2020-01-10T19:53:06.000Z
2020-01-10T19:53:06.000Z
vector<int> t; int n; void init (int nn) { n = nn; t.assign (n, 0); } int sum (int r) { int result = 0; for (; r >= 0; r = (r & (r+1)) - 1) result += t[r]; return result; } void inc (int i, int delta) { for (; i < n; i = (i | (i+1))) t[i] += delta; } int sum (int l, int r) { return sum (r) - sum (l-1); } void init (vector<int> a) { init ((int) a.size()); for (unsigned i = 0; i < a.size(); i++) inc (i, a[i]); }
13.46875
40
0.484919
[ "vector" ]
3f2058d277b536c2c9df85e63b97a01cd4aacb81
16,406
cpp
C++
compiler/Engines/multithread-engine/specific/src/InteractionValue.cpp
toandv/IFinder
7d7c48c87034fb1f66ceb5473f516dd833f49450
[ "CECILL-B" ]
null
null
null
compiler/Engines/multithread-engine/specific/src/InteractionValue.cpp
toandv/IFinder
7d7c48c87034fb1f66ceb5473f516dd833f49450
[ "CECILL-B" ]
null
null
null
compiler/Engines/multithread-engine/specific/src/InteractionValue.cpp
toandv/IFinder
7d7c48c87034fb1f66ceb5473f516dd833f49450
[ "CECILL-B" ]
null
null
null
/** * Copyright Verimag laboratory. * * contributors: * Jacques Combaz (jacques.combaz@univ-grenoble-alpes.fr) * * This software is a computer program whose purpose is to generate * executable code from BIP models. * * This software is governed by the CeCILL-B license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL-B * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, * that may mean that it is complicated to manipulate, and that also * therefore means that it is reserved for developers and experienced * professionals having in-depth computer knowledge. Users are therefore * encouraged to load and test the software's suitability as regards their * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-B license and that you accept its terms. */ #include <InteractionValue.hpp> #include <PortValue.hpp> #include <Connector.hpp> #include <Port.hpp> #include <AtomExportPort.hpp> #include <CompoundExportPort.hpp> #include <Atom.hpp> #include <Compound.hpp> #include <BipError.hpp> #include <Job.hpp> #include <TimeValue.hpp> #include <TimingConstraint.hpp> // constructors InteractionValue::InteractionValue() : InteractionValueItf() { } // destructor InteractionValue::~InteractionValue() { /* implement your destructor here */ } /** * \brief Execute the interaction. * * Executing an interaction corresponds to executing all the involved * components and connetors. This might trigger recursive calls to * execute() methods through the hierarchy of connectors and components. * * For compounds and atoms, execute() method is called using the * corresponding port value as a parameter. * * For connectors, execute() method of their exported ports is * called using the corresponding port value as a parameter. * * \return An error if found during the execution of involved atoms or * during the update of port values, BipError::NoError otherwise. */ BipError &InteractionValue::execute(const TimeValue &time) { // executed all connected connectors, atoms or compounds for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; PortValue &portValue = *portValues()[i]; // recursive call to execute of port BipError &error = port.execute(portValue, time); if (error.type() != NO_ERROR) { return error; } } return BipError::NoError; } void InteractionValue::configureReserver(Resource::DynamicReserver &reserver) const { // executed all connected connectors, atoms or compounds for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; PortValue &portValue = *portValues()[i]; port.configureReserver(reserver, portValue); } } /** * \brief Determine if an interaction is defined by a its holding connector. * * \return true if 'this' is define by its holding connector. */ bool InteractionValue::isAllDefined() const { bool ret = true; if (!interaction().isDefined()) { ret = false; } for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; // if there is a sub-connector if (port.type() == CONNECTOR_EXPORT) { PortValue &value = *portValues()[i]; const InteractionValue &subInteraction = value.interaction(); // check interactions of subconnectors if (!subInteraction.isAllDefined()) { ret = false; } } } return ret; } /** * \brief Compute enabledness of an interaction in its holding connector. * * Enabledness is computed without applying priorities. It corresponds to * the existance of an interaction value in the holding connector that * equals interaction value 'this'. * * \return true if interaction 'this' is enabled. */ bool InteractionValue::isEnabled() const { // should be a defined interaction assert(isAllDefined()); bool ret = false; // get enabled interactions const vector<InteractionValue *> &enabledInteractions = connector().enabledInteractions(); for (vector<InteractionValue *>::const_iterator interactionIt = enabledInteractions.begin() ; interactionIt != enabledInteractions.end() ; ++interactionIt) { const InteractionValue &interaction = **interactionIt; // if 'this' is in the set of enabled interactions if (*this == interaction) { ret = true; break; } } return ret; } /** * \brief Tests inclusion of interaction values. * Inclusion of interactions corresponds to inclusion of corresponding * sets of ports given by ports(), and it only applies for interactions * of the same connector. It also checks inclusion of interaction values * of sub-connectors. * * \param interaction corresponds to the higher interaction value in the * inclusion relation, whereas 'this' is the smaller interaction. * * \return true if 'this' is included in interaction. */ bool InteractionValue::operator<=(const InteractionValue &interactionValue) const { bool ret = true; // check if interaction values are from the same connector if (!(interaction() <= interactionValue.interaction())) { ret = false; } else { // ...and do the same for interactions of subconnectors for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; if (port.type() == CONNECTOR_EXPORT) { unsigned int targetIndex = interactionValue.interaction().index(port); PortValue &value = *portValues()[i]; PortValue &targetValue = *interactionValue.portValues()[targetIndex]; const InteractionValue &subInteraction = value.interaction(); const InteractionValue &targetSubInteraction = targetValue.interaction(); // check interactions of subconnectors if (!(subInteraction <= targetSubInteraction)) { ret = false; break; } } } } return ret; } bool InteractionValue::operator==(const InteractionValue &interactionValue) const { bool ret = true; // check if interaction values are from the same connector if (!(interaction() == interactionValue.interaction())) { ret = false; } else { // ...and do the same for interactions of subconnectors for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; if (port.type() == CONNECTOR_EXPORT) { unsigned int targetIndex = interactionValue.interaction().index(port); PortValue &value = *portValues()[i]; PortValue &targetValue = *interactionValue.portValues()[targetIndex]; const InteractionValue &subInteraction = value.interaction(); const InteractionValue &targetSubInteraction = targetValue.interaction(); // check interactions of subconnectors if (subInteraction != targetSubInteraction) { ret = false; break; } } } } return ret; } /** * \brief Restrict input timing constraint considering priorities. * * \param constraint is the target timing constraint to restrict w.r.t. * priorities. */ void InteractionValue::applyDomination(TimingConstraint &constraint) const { // apply maximal progress locally (in the same connector) applyLocalDomination(constraint); // apply priority rules applyPrioritiesDomination(constraint); } /** * \brief Restrict input timing constraint considering maximal progress * priorities. * * \param constraint is the target timing constraint to restrict w.r.t. * maximal progress priorities. */ void InteractionValue::applyLocalDomination(TimingConstraint &constraint) const { // should be a defined interaction assert(isAllDefined()); const vector<InteractionValue *> &interactions = connector().locallyMaximalInteractions(); // look for interactions with higher priority for (vector<InteractionValue *>::const_iterator targetIt = interactions.begin() ; targetIt != interactions.end() ; ++targetIt) { InteractionValue &target = **targetIt; // check if maximal progress applies if (*this < target) { applyDominationBy(target, constraint); } } } void InteractionValue::applyPrioritiesDomination(TimingConstraint &constraint) const { // must be a defined interaction assert(interaction().isDefined()); const vector<Priority *> &priorities = connector().dominatingPriorities().value(); for (vector<Priority *>::const_iterator priorityIt = priorities.begin() ; priorityIt != priorities.end() ; ++priorityIt) { Priority &priority = **priorityIt; assert(priority.detectCycles().type() == NO_ERROR); if (priority.appliesLow(interaction())) { priority.applyPrioritiesDomination(*this, constraint); } } } void InteractionValue::applyDominationBy(const InteractionValue &interaction, TimingConstraint &constraint) const { const TimingConstraint &dominatorConstraint = interaction.timingConstraint(); Interval invariant = connector().invariant(); invariant &= interaction.connector().invariant(); constraint.applyPriority(dominatorConstraint, invariant, time()); } /** * \brief Restrict input timing constraint considering priorities. * * \param constraint is the target timing constraint to restrict w.r.t. * priorities. */ void InteractionValue::inheritDominatedUrgencies(TimingConstraint &constraint) const { // apply maximal progress locally (in the same connector) inheritLocalDominatedUrgencies(constraint); // apply priority rules inheritPrioritiesDominatedUrgencies(constraint); } /** * \brief Restrict input timing constraint considering maximal progress * priorities. * * \param constraint is the target timing constraint to restrict w.r.t. * maximal progress priorities. */ void InteractionValue::inheritLocalDominatedUrgencies(TimingConstraint &constraint) const { // should be a defined interaction assert(isAllDefined()); const vector<InteractionValue *> interactions = connector().locallyMaximalInteractions(); // look for interactions with higher priority for (vector<InteractionValue *>::const_iterator targetIt = interactions.begin() ; targetIt != interactions.end() ; ++targetIt) { InteractionValue &target = **targetIt; // check if maximal progress applies if (target < *this) { inheritDominatedUrgencyOf(target, constraint); } } } void InteractionValue::inheritPrioritiesDominatedUrgencies(TimingConstraint &constraint) const { // must be a defined interaction assert(interaction().isDefined()); const vector<Priority *> &priorities = connector().dominatedPriorities().value(); for (vector<Priority *>::const_iterator priorityIt = priorities.begin() ; priorityIt != priorities.end() ; ++priorityIt) { Priority &priority = **priorityIt; assert(priority.detectCycles().type() == NO_ERROR); if (priority.appliesHigh(interaction())) { priority.inheritPrioritiesDominatedUrgencies(*this, constraint); } } } void InteractionValue::inheritDominatedUrgencyOf(const InteractionValue &interaction, TimingConstraint &constraint) const { const TimingConstraint &dominatedConstraint = interaction.timingConstraint(); Interval invariant = connector().invariant(); invariant &= interaction.connector().invariant(); constraint.applyUrgencyInheritance(dominatedConstraint, invariant, interaction.time()); } /** * \brief Tests strict inclusion of interaction values. * * Strict inclusion of interactions corresponds to strict inclusion of * corresponding sets of ports given by ports(), and it only applies for * interactions of the same connector. It also checks inclusion of * interaction values of sub-connectors. * * \param interaction corresponds to the higher interaction value in the * strict inclusion relation, whereas 'this' is the smaller interaction. * * \return true if 'this' is strictly included in interaction. */ bool InteractionValue::includedIn(const InteractionValue &interactionValue, bool &eq) const { bool inc = true; eq = true; // check if interaction values are from the same connector if (!(interaction() <= interactionValue.interaction())) { inc = false; } else { eq = eq && (interaction() == interactionValue.interaction()); // ...and do the same for interactions of subconnectors for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; if (port.type() == CONNECTOR_EXPORT) { unsigned int targetIndex = interactionValue.interaction().index(port); PortValue &value = *portValues()[i]; PortValue &targetValue = *interactionValue.portValues()[targetIndex]; const InteractionValue &subLeft = value.interaction(); const InteractionValue &subRight = targetValue.interaction(); // check interactions of subconnectors bool subEq; if (!subLeft.includedIn(subRight, subEq)) { inc = false; break; } else { eq = eq && subEq; } } } } return inc; } void InteractionValue::recomputeTime() { mTime = TimeValue::MIN; // executed all connected connectors, atoms or compounds for (unsigned int i = 0 ; i < ports().size() ; ++i) { Port &port = *ports()[i]; PortValue &portValue = *portValues()[i]; TimeValue portTime = port.time(portValue); if (portTime > mTime) { mTime = portTime; } } } void InteractionValue::recomputeTimingConstraint() { // re-initialize to default constraint [-infty,+infty] lazy mTimingConstraint = TimingConstraint(LAZY, Interval(TimeValue::MIN, TimeValue::MAX)); // intersect with the constraints of the ports (values) for (vector<PortValue *>::const_iterator portValueIt = portValues().begin() ; portValueIt != portValues().end() ; ++portValueIt) { const PortValue &portValue = **portValueIt; if (portValue.hasInterval()) { mTimingConstraint &= TimingConstraint(portValue.urgency(), portValue.interval()); } else { mTimingConstraint &= TimingConstraint(portValue.urgency(), Interval(TimeValue::MIN, TimeValue::MAX)); } } } void InteractionValue::recomputeTimingConstraintAfterPriorities() { // reinitialize with the timing constraint mTimingConstraintAfterPriorities = timingConstraint(); // inherit urgencies of lower-levels inheritDominatedUrgencies(mTimingConstraintAfterPriorities); // restrict w.r.t. higher-priority interactions applyDomination(mTimingConstraintAfterPriorities); } ostream& operator<<(ostream &o, const InteractionValue &value) { for (unsigned int i = 0 ; i < value.ports().size() ; ++i) { const Port &port = *(value.ports()[i]); if (i > 0) o << " "; if (port.type() == ATOM_EXPORT) { const AtomExportPort &atomPort = dynamic_cast<const AtomExportPort &>(port); o << atomPort.holder().name(); } else if (port.type() == COMPOUND_EXPORT) { const CompoundExportPort &compoundPort = dynamic_cast<const CompoundExportPort &>(port); o << compoundPort.holder().name(); } else if (port.type() == CONNECTOR_EXPORT) { const ConnectorExportPort &connectorPort = dynamic_cast<const ConnectorExportPort &>(port); o << connectorPort.holder().name(); } else { assert(false); } o << "."; o << value.ports()[i]->name(); o << "(" << value.portValues()[i] << ")"; } return o; } ostream& operator<<(ostream &o, const InteractionValue *value) { return o << *value; }
31.429119
123
0.695965
[ "vector" ]
3f273a60fc057a2519333a5f5a73560bd8e18bb1
733
cpp
C++
codes/leetcode/SingleNumberlll.cpp
smmehrab/problem-solving
4aeab1673f18d3270ee5fc9b64ed6805eacf4af5
[ "MIT" ]
null
null
null
codes/leetcode/SingleNumberlll.cpp
smmehrab/problem-solving
4aeab1673f18d3270ee5fc9b64ed6805eacf4af5
[ "MIT" ]
null
null
null
codes/leetcode/SingleNumberlll.cpp
smmehrab/problem-solving
4aeab1673f18d3270ee5fc9b64ed6805eacf4af5
[ "MIT" ]
null
null
null
/* ************************************************ username : smmehrab fullname : s.m.mehrabul islam email : mehrab.24csedu.001@gmail.com institute : university of dhaka, bangladesh session : 2017-2018 ************************************************ */ class Solution { public: vector<int> singleNumber(vector<int> numbers) { int x, m, r1, r2; x = 0; for (int number : numbers) { x ^= number; } m = -x & x; r1 = 0; r2 = 0; for (int number : numbers) { if ((number & m) == 0) r1 ^= number; else r2 ^= number; } return vector<int> {r1, r2}; } };
22.90625
51
0.39427
[ "vector" ]
3f31cce28e8fee08169290e5ef8a5c4cf9b12de3
37,833
hh
C++
include/tchecker/parsing/declaration.hh
pictavien/tchecker
5db2430b5b75a5b94cfbbe885840a4809b267be8
[ "MIT" ]
4
2019-04-09T16:28:45.000Z
2021-09-21T08:25:40.000Z
include/tchecker/parsing/declaration.hh
pictavien/tchecker
5db2430b5b75a5b94cfbbe885840a4809b267be8
[ "MIT" ]
8
2019-04-05T12:53:12.000Z
2019-06-22T05:49:31.000Z
include/tchecker/parsing/declaration.hh
pictavien/tchecker
5db2430b5b75a5b94cfbbe885840a4809b267be8
[ "MIT" ]
3
2019-04-01T21:23:51.000Z
2021-03-03T14:16:18.000Z
/* * This file is a part of the TChecker project. * * See files AUTHORS and LICENSE for copyright details. * */ #ifndef TCHECKER_PARSING_DECLARATION_HH #define TCHECKER_PARSING_DECLARATION_HH #include <cassert> #include <iostream> #include <string> #include <unordered_map> #include <vector> #include <boost/core/noncopyable.hpp> #include "tchecker/basictypes.hh" #include "tchecker/utils/iterator.hh" /*! \file declaration.hh \brief System declarations */ namespace tchecker { namespace parsing { /* Forward declaration */ class declaration_visitor_t; /*! \class declaration_t \brief Declaration from input file \note Abstract base class */ class declaration_t : private boost::noncopyable { public: /*! \brief Constructor */ declaration_t() = default; /*! \brief Destructor */ virtual ~declaration_t() = default; /*! \brief Assignment operator (DELETED) */ tchecker::parsing::declaration_t & operator= (tchecker::parsing::declaration_t const &) = delete; /*! \brief Move assignment operator (DELETED) */ tchecker::parsing::declaration_t & operator= (tchecker::parsing::declaration_t &&) = delete; /*! \brief Clone \return Returns a clone of this */ tchecker::parsing::declaration_t * clone() const; /*! \brief Visit \param v : visitor \post this has been visited by v */ void visit(tchecker::parsing::declaration_visitor_t & v) const; private: /*! \brief Clone */ virtual tchecker::parsing::declaration_t * do_clone() const = 0; /*! \brief Visit */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const = 0; /*! \brief Output the declaration \param os : output stream */ virtual std::ostream & do_output(std::ostream & os) const = 0; friend std::ostream & operator<< (std::ostream & os, tchecker::parsing::declaration_t const & decl); }; /*! \brief Output declaration \param os : output stream \param decl : declaration \post decl has been output to os \return os after outputing decl has been output */ inline std::ostream & operator<< (std::ostream & os, tchecker::parsing::declaration_t const & decl) { return decl.do_output(os); } /*! \class inner_declaration_t */ class inner_declaration_t : public tchecker::parsing::declaration_t { public: /*! \brief Destructor */ virtual ~inner_declaration_t() = default; }; /*! \class clock_declaration_t \brief Declaration of an (array of) clock variable */ class clock_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param name : clock name \param size : size of array \pre name is not empty and size >= 1 \throw std::invalid_argument : if name is empty or size < 1 */ clock_declaration_t(std::string const & name, unsigned int size); /*! \brief Destructor */ virtual ~clock_declaration_t() = default; /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } /*! \brief Accessor \return Size */ inline unsigned int size() const { return _size; } private: /*! \brief Clone \return A clone of this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::string const _name; /*!< Name */ unsigned int const _size; /*!< Size */ }; /*! \class int_declaration_t \brief Declaration of an (array of) int variable */ class int_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param name : int name \param size : size of array \param min : minimal value \param max : maximal value \param init : initial value \pre name is not empty, size >= 1, min <= init <= max \throws std::invalid_argument : name is empty, or if size < 1, or not (min <= init <= max) */ int_declaration_t(std::string const & name, unsigned int size, tchecker::integer_t min, tchecker::integer_t max, tchecker::integer_t init); /*! \brief Destructor */ virtual ~int_declaration_t() = default; /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } /*! \brief Accessor \return Size */ inline unsigned int size() const { return _size; } /*! \brief Accessor \return Min value */ inline tchecker::integer_t min() const { return _min; } /*! \brief Accessor \return Max value */ inline tchecker::integer_t max() const { return _max; } /*! \brief Accessor \return Initial value */ inline tchecker::integer_t init() const { return _init; } private: /*! \brief Clone \returns A clone of this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::string const _name; /*!< Name */ unsigned int const _size; /*!< Size */ tchecker::integer_t const _min; /*!< Min value */ tchecker::integer_t const _max; /*!< Max value */ tchecker::integer_t const _init; /*!< Initial value */ }; /* \class process_declaration_t \brief Declaration of a process */ class process_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param name : process name \pre name is not empty \throws std::invalid_argument : if name is empty */ process_declaration_t(std::string const & name); /*! \brief Destructor */ virtual ~process_declaration_t() = default; /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } private: /*! \brief Clone \return A clone of this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::string const _name; /*!< Process name */ }; /*! \class event_declaration_t \brief Declaration of an event */ class event_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param name : event name \pre name is not empty \throws std::invalid_argument : if name is empty */ event_declaration_t(std::string const & name); /*! \brief Destructor */ virtual ~event_declaration_t() = default; /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } private: /*! \brief Clone \return A clone of this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::string const _name; /*!< Event name */ }; /*! \class attr_t \brief Attribute for locations and edges */ class attr_t { public: /*! \brief Constructor \param key : attribute key \param value : attribute value \param key_context : contextual information for key (position in input file, etc) \param value_context : contextual information for value (position in input file, etc) */ attr_t(std::string const & key, std::string const & value, std::string const & key_context, std::string const & value_context); /*! \brief Copy constructor \param attr : attribute \post this is a copy of attr */ attr_t(tchecker::parsing::attr_t const & attr) = default; /*! \brief Move constructor \param attr : attribute \post attr has been moved to this */ attr_t(tchecker::parsing::attr_t && attr) = default; /*! \brief Destructor */ ~attr_t() = default; /*! \brief Assignment operator \param attr : attribute \post this is a copy of attr */ tchecker::parsing::attr_t & operator= (tchecker::parsing::attr_t const & attr) = default; /*! \brief Move assignment operator \param attr : attribute \post attr has been moved to this */ tchecker::parsing::attr_t & operator= (tchecker::parsing::attr_t && attr) = default; /*! \brief Accessor \return Attribute key */ inline std::string const & key() const { return _key; } /*! \brief Accessor \return Attribute value */ inline std::string const & value() const { return _value; } /*! \brief Accessor \return Contextual information for key */ inline std::string const & key_context() const { return _key_context; } /*! \brief Accessor \return Contextual information for value */ inline std::string const & value_context() const { return _value_context; } private: std::string _key; /*!< Key */ std::string _value; /*!< Value */ std::string _key_context; /*!< Contextual information for key */ std::string _value_context; /*!< Contextual information for value */ }; /*! \brief Output operator \param os : output stream \param attr : attribute \post attr has been output to os \return os after attr has been output */ std::ostream & operator<< (std::ostream & os, tchecker::parsing::attr_t const & attr); /*! \class attributes_t \brief Attributes map for locations and edges */ class attributes_t { public: /*! \brief Type of attributes map */ using map_t = std::unordered_map<std::string, tchecker::parsing::attr_t const *>; /*! \brief Constructor \post this is an empty attributes map */ attributes_t() = default; /*! \brief Copy constructor \param attr : attributes to copy from \post this is a copy of attr */ attributes_t(attributes_t const & attr); /*! \brief Move constructor \param attr : attributes to move \post attr has been moved to this */ attributes_t(attributes_t && attr); /*! \brief Destructor \post All attributes in the map have been deleted */ ~attributes_t(); /*! \brief Assignement operator \param attr : attributes to assign from \post this is a copy of attr \return this */ attributes_t & operator= (attributes_t const & attr); /*! \brief Move assignement operator \param attr : attributes to move \post attr has been moved to this \return this */ attributes_t & operator= (attributes_t && attr); /*! \brief Empties the map \post this map is empty */ void clear(); /*! \brief Emptiness check \return true if this map is empty, false otherwise */ bool empty() const; /*! \brief Accessor \return size of the map */ std::size_t size() const; /*! \brief Insert \param attr : attribute to insert in the map \return true if attr has been inserted in the map, false otherwise (when an attribute with the same key is already in the map) \note this takes ownership on attr */ bool insert(tchecker::parsing::attr_t const * attr); /*! \class const_iterator_t \brief Const iterator on the map */ class const_iterator_t : public map_t::const_iterator { public: /*! \brief Constructor \param it : map iterator \post this iterator point to it */ const_iterator_t(map_t::const_iterator const & it); /*! \brief Accessor \return attribute at pointed map entry */ inline tchecker::parsing::attr_t const & operator*() const { return *(*this)->second; } }; /*! \brief Accessor \param key : key of attribute to access \return attribute at key in the map if any \throw std::out_of_range if there is no attibute with key in map */ tchecker::parsing::attr_t const & at(std::string const & key) const; /*! \brief Accessor \param key : key of attribute to access \return iterator on atribute at key if any, end() otherwise */ const_iterator_t find(std::string const & key) const; /*! \brief Accessor \return iterator to the first entry of the map (if any) */ const_iterator_t begin() const; /*! \brief Accessor \return iteratot to the past-the-end "entry" of the map */ const_iterator_t end() const; private: map_t _attr; /*!< Attributes */ }; /*! \brief Output operator \param os : output stream \param attr : attributes map \post attr has been output to os \return os after attr has been output */ std::ostream & operator<< (std::ostream & os, tchecker::parsing::attributes_t const & attr); /*! \class location_declaration_t \brief Declaration of a location */ class location_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param name : location name \param process : location process \param attr : location attributes \pre name is not empty \throws std::invalid_argument : if name is empty \note attr is moved to this. */ location_declaration_t(std::string const & name, tchecker::parsing::process_declaration_t const & process, tchecker::parsing::attributes_t && attr); /*! \brief Destructor */ virtual ~location_declaration_t() = default; /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } /*! \brief Accessor \return Location process */ inline tchecker::parsing::process_declaration_t const & process() const { return _process; } /*! \brief Accessor \return Attributes */ inline tchecker::parsing::attributes_t const & attributes() const { return _attr; } private: /*! \brief Clone \return A clone of this \note The clone shares pointers with this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::string const _name; /*!< Name */ tchecker::parsing::process_declaration_t const & _process; /*!< Process */ tchecker::parsing::attributes_t const _attr; /*!< Attributes */ }; /*! \class edge_declaration_t \brief Declaration of an edge */ class edge_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param process : process \param src : source location \param tgt : target location \param event : edge event \param attr : edge attributes \pre src and tgt belong to process \throws std::invalid_argument : if src and tgt do not belong to process \note attr is moved to this */ edge_declaration_t(tchecker::parsing::process_declaration_t const & process, tchecker::parsing::location_declaration_t const & src, tchecker::parsing::location_declaration_t const & tgt, tchecker::parsing::event_declaration_t const & event, tchecker::parsing::attributes_t && attr); /*! \brief Destructor */ virtual ~edge_declaration_t() = default; /*! \brief Accessor \return Process */ inline tchecker::parsing::process_declaration_t const & process() const { return _process; } /*! \brief Accessor \return Source location */ inline tchecker::parsing::location_declaration_t const & src() const { return _src; } /*! \brief Accessor \return Target location */ inline tchecker::parsing::location_declaration_t const & tgt() const { return _tgt; } /*! \brief Accessor \return Event */ inline tchecker::parsing::event_declaration_t const & event() const { return _event; } /*! \brief Accessor \return Attributes */ inline tchecker::parsing::attributes_t const & attributes() const { return _attr; } private: /*! \brief Clone \return A clone of this \note The clone shares pointers with this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; tchecker::parsing::process_declaration_t const & _process; /*!< Process */ tchecker::parsing::location_declaration_t const & _src; /*!< Source loc */ tchecker::parsing::location_declaration_t const & _tgt; /*!< Target loc */ tchecker::parsing::event_declaration_t const & _event; /*!< Event */ tchecker::parsing::attributes_t const _attr; /*!< Attributes */ }; /*! \class sync_constraint_t \brief Synchronization constraint */ class sync_constraint_t { public: /*! \brief Constructor \param process : synchronized process \param event : synchronized event \param strength : strength of synchronization */ sync_constraint_t(tchecker::parsing::process_declaration_t const & process, tchecker::parsing::event_declaration_t const & event, enum tchecker::sync_strength_t strength); /*! \brief Copy constructor \param sync : synchronization constraint \post this is copy of sync */ sync_constraint_t(tchecker::parsing::sync_constraint_t const & sync) = default; /*! \brief Move constructor \param sync : synchronization constraint \post sync has been moved to this */ sync_constraint_t(tchecker::parsing::sync_constraint_t && sync) = default; /*! \brief Destructor */ ~sync_constraint_t() = default; /*! \brief Assignment operator (DELETED) */ tchecker::parsing::sync_constraint_t & operator= (tchecker::parsing::sync_constraint_t const &) = delete; /*! \brief Move assignment operator (DELETED) */ tchecker::parsing::sync_constraint_t & operator= (tchecker::parsing::sync_constraint_t &&) = delete; /*! \brief Clone \return A clone of this */ sync_constraint_t * clone() const; /*! \brief Accessor \return Process */ inline tchecker::parsing::process_declaration_t const & process() const { return _process; } /*! \brief Accessor \return Event */ inline tchecker::parsing::event_declaration_t const & event() const { return _event; } /*! \brief Accessor \return Strength */ inline enum tchecker::sync_strength_t strength() const { return _strength; } private: tchecker::parsing::process_declaration_t const & _process; /*!< Process */ tchecker::parsing::event_declaration_t const & _event; /*!< Event */ enum tchecker::sync_strength_t const _strength; /*!< Strength */ friend std::ostream & operator<< (std::ostream & os, tchecker::parsing::sync_constraint_t const & c); }; /*! \brief Output operator \param os : output stream \param c : synchronization constraint \return os after c has been output */ std::ostream & operator<< (std::ostream & os, tchecker::parsing::sync_constraint_t const & c); /*! \class sync_declaration_t \brief Declaration of synchronized process events */ class sync_declaration_t final : public tchecker::parsing::inner_declaration_t { public: /*! \brief Constructor \param syncs : synchronization constraints \pre syncs has size > 0, syncs does not contain nullptr, and there is no two events with the same process in syncs \throws std::invalid_argument : if syncs size == 0, or if syncs contains nullptr, or two events in syncs have the same process \note syncs has been moved to this */ sync_declaration_t(std::vector<tchecker::parsing::sync_constraint_t const *> && syncs); /*! \brief Destructor */ virtual ~sync_declaration_t(); /*! \brief Iterator over attributes */ using const_iterator_t = std::vector<tchecker::parsing::sync_constraint_t const *>::const_iterator; /*! \brief Accessor \return Range [begin;end) of process events */ inline tchecker::range_t<const_iterator_t> sync_constraints() const { return tchecker::make_range(_syncs.begin(), _syncs.end()); } private: /*! \brief Clone \return A clone of this \note The clone shares pointers with this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; std::vector<tchecker::parsing::sync_constraint_t const *> const _syncs; /*!< Synchronization vector */ }; /*! \class system_declaration_t \brief System declaration */ class system_declaration_t final : public tchecker::parsing::declaration_t { public: /*! \brief Constructor \param name : system name \pre name is not empty \throw std::invalid_argument : if name is empty */ system_declaration_t(std::string const & name); /*! \brief Destructor \post */ virtual ~system_declaration_t(); /*! \brief Accessor \return Name */ inline std::string const & name() const { return _name; } /*! \brief Type of iterator on declarations */ using const_iterator_t = std::vector<tchecker::parsing::inner_declaration_t const *>::const_iterator; /*! \brief Accessor \return Range [begin;end) of declarations */ inline tchecker::range_t<const_iterator_t> declarations() const { return tchecker::make_range(_decl.begin(), _decl.end()); } /*! \brief Accessor \param name : name of declaration \return int declaration with name if any, nullptr otherwise */ inline tchecker::parsing::int_declaration_t const * get_int_declaration(std::string const & name) const { return get_declaration(name, _ints); } /*! \brief Insert an int declaration \param d : int declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes owenship on d if inserted */ inline bool insert_int_declaration(tchecker::parsing::int_declaration_t const * d) { assert(d != nullptr); return insert_declaration(d->name(), d, _ints); } /*! \brief Accessor \param name : name of declaration \return clock declaration with name if any, nullptr otherwise */ inline tchecker::parsing::clock_declaration_t const * get_clock_declaration(std::string const & name) const { return get_declaration(name, _clocks); } /*! \brief Insert a clock declaration \param d : clock declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes ownership on d if inserted */ inline bool insert_clock_declaration(tchecker::parsing::clock_declaration_t const * d) { assert(d != nullptr); return insert_declaration(d->name(), d, _clocks); } /*! \brief Accessor \param name : name of declaration \return process declaration with name if any, nullptr otherwise */ inline tchecker::parsing::process_declaration_t const * get_process_declaration(std::string const & name) const { return get_declaration(name, _procs); } /*! \brief Insert a process declaration \param d : process declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes iwnership on d if inserted */ inline bool insert_process_declaration(tchecker::parsing::process_declaration_t const * d) { assert(d != nullptr); return insert_declaration(d->name(), d, _procs); } /*! \brief Accessor \param name : name of declaration \return event declaration with name if any, nullptr otherwise */ inline tchecker::parsing::event_declaration_t const * get_event_declaration(std::string const & name) const { return get_declaration(name, _events); } /*! \brief Insert an event declaration \param d : event declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes ownership on d if inserted */ inline bool insert_event_declaration(tchecker::parsing::event_declaration_t const * d) { assert(d != nullptr); return insert_declaration(d->name(), d, _events); } /*! \brief Accessor \param proc : process name \param name : location name \return location declaration with process proc and name if any, nullptr otherwise */ inline tchecker::parsing::location_declaration_t const * get_location_declaration(std::string const & proc, std::string const & name) const { return get_declaration(location_map_key(proc, name), _locs); } /*! \brief Insert a location declaration \param d : location declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes ownership on d if inserted */ inline bool insert_location_declaration(tchecker::parsing::location_declaration_t const * d) { assert(d != nullptr); auto key = location_map_key(d->process().name(), d->name()); return insert_declaration(key, d, _locs); } /*! \brief Insert an edge declaration \param d : edge declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes ownership on d if inserted */ inline bool insert_edge_declaration(tchecker::parsing::edge_declaration_t const * d) { assert(d != nullptr); _decl.push_back(d); return true; } /*! \brief Insert a synchronization declaration \param d : synchronization declaration \pre d != nullptr (checked by assertion) \return true if d has been inserted, false otherwise \note this takes ownership on d if inserted */ inline bool insert_sync_declaration(tchecker::parsing::sync_declaration_t const * d) { assert(d != nullptr); _decl.push_back(d); return true; } private: /*! \brief Clone \return A clone of this */ virtual tchecker::parsing::declaration_t * do_clone() const; /*! \brief Visit \post this has been visited by v */ virtual void do_visit(tchecker::parsing::declaration_visitor_t & v) const; /*! \brief Output the declaration \param os : output stream \post this declaration has been output to os \return os after this declaration has been output */ virtual std::ostream & do_output(std::ostream & os) const; /*! \brief Type of declarations index */ template <class T> using declaration_map_t = std::unordered_map<std::string, T const *>; /*! \brief Accessor \tparam T : type of declaration \param name : name of declaration \param m : declaration map \return declaration of type T with key name in map m, nullptr if no such declaration in m */ template <class T> T const * get_declaration(std::string const & name, declaration_map_t<T> const & m) const { auto it = m.find(name); if (it == m.end()) return nullptr; return it->second; } /*! \brief Insert a declaration \tparam T : type of declaration \param name : name of declaration \param d : declaration \param m : declaration map \pre d is not nullptr (checked by assertion), m does not already contain a declaration with key name \return true if d has been inserted in m with key name, false otherwise (m already contains a declaration with key name) \post d has been inserted in m with key name and in the list of declarations if returned value is true */ template <class T> bool insert_declaration(std::string const & name, T const * d, declaration_map_t<T> & m) { assert( d != nullptr ); if ( ! m.insert({name, d}).second ) return false; _decl.push_back(d); return true; } /*! \brief Accessor \param process_name : process name \param name : location name \return key to location map for location name in process process_name */ inline static std::string location_map_key(std::string const & process_name, std::string const & name) { return (process_name + ":" + name); } std::string const _name; /*!< Name */ std::vector<inner_declaration_t const *> _decl; /*!< Declarations */ declaration_map_t<tchecker::parsing::int_declaration_t> _ints; /*!< int declarations index */ declaration_map_t<tchecker::parsing::clock_declaration_t> _clocks; /*!< clock declaration index */ declaration_map_t<tchecker::parsing::process_declaration_t> _procs; /*!< process declaration index */ declaration_map_t<tchecker::parsing::event_declaration_t> _events; /*!< event declaration index */ declaration_map_t<tchecker::parsing::location_declaration_t> _locs; /*!< location declaration index */ }; /*! \class declaration_visitor_t \brief Visitor for declarations */ class declaration_visitor_t { public: /*! \brief Constructor */ declaration_visitor_t() = default; /*! \brief Copy constructor */ declaration_visitor_t(tchecker::parsing::declaration_visitor_t const &) = default; /*! \brief Move constructor */ declaration_visitor_t(tchecker::parsing::declaration_visitor_t &&) = default; /*! \brief Destructor */ virtual ~declaration_visitor_t() = default; /*! \brief Assignment operator */ tchecker::parsing::declaration_visitor_t & operator= (tchecker::parsing::declaration_visitor_t const &) = default; /*! \brief Move assignment operator */ tchecker::parsing::declaration_visitor_t & operator= (tchecker::parsing::declaration_visitor_t &&) = default; /*! \brief Visitors */ virtual void visit(tchecker::parsing::system_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::clock_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::int_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::process_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::event_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::location_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::edge_declaration_t const & d) = 0; virtual void visit(tchecker::parsing::sync_declaration_t const & d) = 0; }; } // end of namespace parsing } // end of namespace tchecker #endif // TCHECKER_PARSING_DECLARATION_HH
28.212528
120
0.570296
[ "vector" ]
3f3406d8f49938a8575461ee75cbd3bfcca857ed
4,739
cpp
C++
src/QtAIV/AIV/nSelectionListFilter.cpp
Vladimir-Lin/QtAIV
a96b52a1df9c85dbadfc1dfcfc38d60948462c89
[ "MIT" ]
null
null
null
src/QtAIV/AIV/nSelectionListFilter.cpp
Vladimir-Lin/QtAIV
a96b52a1df9c85dbadfc1dfcfc38d60948462c89
[ "MIT" ]
null
null
null
src/QtAIV/AIV/nSelectionListFilter.cpp
Vladimir-Lin/QtAIV
a96b52a1df9c85dbadfc1dfcfc38d60948462c89
[ "MIT" ]
null
null
null
#include <qtaiv.h> N::SelectionListFilter:: SelectionListFilter (int row, int column) : AbstractFilter (SelectionListFilter::Type, row, column) { setProperty("dataSource", N::SelectionListFilter::Filter); } N::SelectionListFilter::~SelectionListFilter(void) { } QWidget* N::SelectionListFilter::createEditor(FilterViewItemDelegate* delegate, QWidget* parent, const QStyleOptionViewItem & option, const QModelIndex & index) const { Q_UNUSED(option); Q_UNUSED(index); SelectionListFilterEditor* e = new SelectionListFilterEditor(parent); QObject::connect(e, SIGNAL(cancelAndClose(QAbstractItemDelegate::EndEditHint)), delegate, SLOT(cancelAndClose(QAbstractItemDelegate::EndEditHint))); QObject::connect(e, SIGNAL(commitAndClose(QAbstractItemDelegate::EndEditHint)), delegate, SLOT(commitAndClose(QAbstractItemDelegate::EndEditHint))); return e; } QVariant N::SelectionListFilter::data(int role) const { if (role == Qt::DisplayRole){ if (property("mode").toInt() == 0){ if (property("selectedValues").toList().isEmpty()){ return QObject::tr("<none>"); } else { if (property("selectedValues").toList().size() == 1){ return QString(QObject::tr("%1 entry")).arg(property("selectedValues").toList().size()); } else { return QString(QObject::tr("%1 entries")).arg(property("selectedValues").toList().size()); } } } else if (property("mode").toInt() == 1){ return QObject::tr("Empty"); } else if (property("mode").toInt() == 2){ return QObject::tr("Not Empty"); } } return QVariant(); } N::SelectionListFilter::DataSource N::SelectionListFilter::dataSource() const { return static_cast<N::SelectionListFilter::DataSource>(property("dataSource").toInt()); } bool N::SelectionListFilter::matches(const QVariant & value, int type) const { Q_UNUSED(type); if (property("mode").toInt() == 1){ return value.toString().isEmpty(); } else if (property("mode").toInt() == 2){ return !value.toString().isEmpty(); } return property("selectedValues").toList().contains(value); } void N::SelectionListFilter::setDataSource(N::SelectionListFilter::DataSource source) { setProperty("dataSource", source); } void N::SelectionListFilter::setEditorData(QWidget* editor, const QModelIndex & index) { Q_UNUSED(index); SelectionListFilterEditor* w = qobject_cast<SelectionListFilterEditor*>(editor); if (w){ SelectionListFilterEditorPopup* p = qobject_cast<SelectionListFilterEditorPopup*>(w->popup()); if (dataSource() == N::SelectionListFilter::Filter){ p->setValues(property("values").toList()); } else if (dataSource() == N::SelectionListFilter::Model){ const FilterModel* m = qobject_cast<const FilterModel*>(index.model()); if (m){ p->setValues(m->sourceModel()->index(0, index.column()).data(AdvancedItemViews::SelectionListFilterDataRole).toList()); } } p->setSelectedValues(property("selectedValues").toList()); } } void N::SelectionListFilter::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex & index) { Q_UNUSED(index); SelectionListFilterEditor* w = qobject_cast<SelectionListFilterEditor*>(editor); if (w){ SelectionListFilterEditorPopup* p = qobject_cast<SelectionListFilterEditorPopup*>(w->popup()); QVariantMap properties(index.data(Qt::EditRole).toMap()); if (p->mode() > 0){ properties["selectedValues"] = QVariantList(); } else { properties["selectedValues"] = p->selectedValues(); } if (property("enableOnCommit").toBool()){ properties["enabled"] = true; } model->setData(index, properties); } } void N::SelectionListFilter::setValues(const QVariantList &values) { setProperty("values", values); } void N::SelectionListFilter::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem & option, const QModelIndex & index) { Q_UNUSED(index); SelectionListFilterEditor* e = qobject_cast<SelectionListFilterEditor*>(editor); if (e){ e->setGeometry(option.rect); e->showPopup(); } }
40.504274
166
0.604558
[ "model" ]
3f34d58a2e178bbaa1c34e0aaab7931b17aca8a6
137,469
cpp
C++
openrave/plugins/qtcoinrave/qtcoinviewer.cpp
jdsika/TUM_HOly
a2ac55fa1751a3a8038cf61d29b95005f36d6264
[ "MIT" ]
2
2015-11-13T16:40:57.000Z
2017-09-15T15:37:19.000Z
openrave/plugins/qtcoinrave/qtcoinviewer.cpp
jdsika/holy
a2ac55fa1751a3a8038cf61d29b95005f36d6264
[ "MIT" ]
1
2016-06-13T01:29:51.000Z
2016-06-14T00:38:27.000Z
openrave/plugins/qtcoinrave/qtcoinviewer.cpp
jdsika/holy
a2ac55fa1751a3a8038cf61d29b95005f36d6264
[ "MIT" ]
null
null
null
// -*- coding: utf-8 -*- // Copyright (C) 2006-2013 Rosen Diankov <rosen.diankov@gmail.com> // // OpenRAVE is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #include "qtcoin.h" #include <Inventor/elements/SoGLCacheContextElement.h> #include <Inventor/actions/SoToVRML2Action.h> #include <Inventor/actions/SoWriteAction.h> #include <Inventor/nodes/SoComplexity.h> #include <Inventor/nodes/SoCoordinate3.h> #include <Inventor/nodes/SoFaceSet.h> #include <Inventor/nodes/SoPointSet.h> #include <Inventor/nodes/SoLightModel.h> #include <Inventor/nodes/SoLineSet.h> #include <Inventor/nodes/SoMaterialBinding.h> #include <Inventor/nodes/SoTextureCombine.h> #include <Inventor/nodes/SoTextureCoordinate2.h> #include <Inventor/nodes/SoTextureScalePolicy.h> #include <Inventor/nodes/SoTransparencyType.h> #include <Inventor/misc/SoGLImage.h> #include <Inventor/events/SoLocation2Event.h> #include <Inventor/SoPickedPoint.h> #include <Inventor/VRMLnodes/SoVRMLGroup.h> #if QT_VERSION >= 0x040000 // check for qt4 #include <QtOpenGL/QGLWidget> #else #include <qgl.h> #endif #include <locale> const float TIMER_SENSOR_INTERVAL = (1.0f/60.0f); #define VIDEO_WIDTH 640 #define VIDEO_HEIGHT 480 #define VIDEO_FRAMERATE (30000.0/1001.0) // 29.97 //60 void DeleteItemCallbackSafe(QtCoinViewerWeakPtr wpt, Item* pItem) { QtCoinViewerPtr pviewer = wpt.lock(); if( !!pviewer ) { pviewer->_DeleteItemCallback(pItem); } } #define ITEM_DELETER boost::bind(DeleteItemCallbackSafe,weak_viewer(),_1) class ItemSelectionCallbackData : public UserData { public: ItemSelectionCallbackData(const ViewerBase::ItemSelectionCallbackFn& callback, boost::shared_ptr<QtCoinViewer> pviewer) : _callback(callback), _pweakviewer(pviewer) { } virtual ~ItemSelectionCallbackData() { boost::shared_ptr<QtCoinViewer> pviewer = _pweakviewer.lock(); if( !!pviewer ) { boost::mutex::scoped_lock lock(pviewer->_mutexCallbacks); pviewer->_listRegisteredItemSelectionCallbacks.erase(_iterator); } } list<UserDataWeakPtr>::iterator _iterator; ViewerBase::ItemSelectionCallbackFn _callback; protected: boost::weak_ptr<QtCoinViewer> _pweakviewer; }; typedef boost::shared_ptr<ItemSelectionCallbackData> ItemSelectionCallbackDataPtr; class ViewerImageCallbackData : public UserData { public: ViewerImageCallbackData(const ViewerBase::ViewerImageCallbackFn& callback, boost::shared_ptr<QtCoinViewer> pviewer) : _callback(callback), _pweakviewer(pviewer) { } virtual ~ViewerImageCallbackData() { boost::shared_ptr<QtCoinViewer> pviewer = _pweakviewer.lock(); if( !!pviewer ) { boost::mutex::scoped_lock lock(pviewer->_mutexCallbacks); pviewer->_listRegisteredViewerImageCallbacks.erase(_iterator); } } list<UserDataWeakPtr>::iterator _iterator; ViewerBase::ViewerImageCallbackFn _callback; protected: boost::weak_ptr<QtCoinViewer> _pweakviewer; }; typedef boost::shared_ptr<ViewerImageCallbackData> ViewerImageCallbackDataPtr; class ViewerThreadCallbackData : public UserData { public: ViewerThreadCallbackData(const ViewerBase::ViewerThreadCallbackFn& callback, boost::shared_ptr<QtCoinViewer> pviewer) : _callback(callback), _pweakviewer(pviewer) { } virtual ~ViewerThreadCallbackData() { boost::shared_ptr<QtCoinViewer> pviewer = _pweakviewer.lock(); if( !!pviewer ) { boost::mutex::scoped_lock lock(pviewer->_mutexCallbacks); pviewer->_listRegisteredViewerThreadCallbacks.erase(_iterator); } } list<UserDataWeakPtr>::iterator _iterator; ViewerBase::ViewerThreadCallbackFn _callback; protected: boost::weak_ptr<QtCoinViewer> _pweakviewer; }; typedef boost::shared_ptr<ViewerThreadCallbackData> ViewerThreadCallbackDataPtr; static SoErrorCB* s_DefaultHandlerCB=NULL; void CustomCoinHandlerCB(const class SoError * error, void * data) { if( error != NULL ) { // extremely annoying errors if((strstr(error->getDebugString().getString(),"Coin warning in SbLine::setValue()") != NULL)|| ( strstr(error->getDebugString().getString(),"Coin warning in SbDPLine::setValue()") != NULL) || ( strstr(error->getDebugString().getString(),"Coin warning in SbVec3f::setValue()") != NULL) || ( strstr(error->getDebugString().getString(),"Coin warning in SoNormalGenerator::calcFaceNormal()") != NULL) || ( strstr(error->getDebugString().getString(),"Coin error in SoGroup::removeChild(): tried to remove non-existent child") != NULL) || ( strstr(error->getDebugString().getString(),"Coin error in SoSwitch::doAction(): whichChild 0 out of range -- switch node has no children!") != NULL) || ( strstr(error->getDebugString().getString(),"Coin warning in SbPlane::SbPlane(): The three points defining the plane cannot be on line.") != NULL ) ) { return; } } if( s_DefaultHandlerCB != NULL ) { s_DefaultHandlerCB(error,data); } } static QtCoinViewer* s_pviewer = NULL; QtCoinViewer::QtCoinViewer(EnvironmentBasePtr penv, std::istream& sinput) : QMainWindow(NULL, Qt::Window), ViewerBase(penv), _ivOffscreen(SbViewportRegion(_nRenderWidth, _nRenderHeight)) { s_pviewer = this; _InitConstructor(sinput); } void QtCoinViewer::_InitConstructor(std::istream& sinput) { int qtcoinbuild = SoQtExaminerViewer::BUILD_ALL; bool bCreateStatusBar = true, bCreateMenu = true; int nAlwaysOnTopFlag = 0; // 1 - add on top flag (keep others), 2 - add on top flag (remove others) sinput >> qtcoinbuild >> bCreateStatusBar >> bCreateMenu >> nAlwaysOnTopFlag; _nQuitMainLoop = 0; _name = str(boost::format("OpenRAVE %s")%OPENRAVE_VERSION_STRING); if( (OPENRAVE_VERSION_MINOR%2) || (OPENRAVE_VERSION_PATCH%2) ) { _name += " (Development Version)"; } else { _name += " (Stable Release)"; } #if QT_VERSION >= 0x040000 // check for qt4 setWindowTitle(_name.c_str()); if( bCreateStatusBar ) { statusBar()->showMessage(tr("Status Bar")); } #endif __description = ":Interface Author: Rosen Diankov\n\nProvides a GUI using the Qt4, Coin3D, and SoQt libraries. Depending on the version, Coin3D and SoQt might be licensed under GPL.\n\nIf the current directory contains a filename **environment.iv** when the qtcoin viewer is loaded, then this file will define the scene file all other elements are loaded under. This allows users to define their own lighting model. For example, the following **environment.iv** file will force every object to be draw as wirefire:\n\n\ .. code-block:: c\n\ \n\ #Inventor V2.1 ascii\n\ \n\ Separator {\n\ DrawStyle { style LINES lineWidth 2 }\n\ }\n\n"; RegisterCommand("SetFiguresInCamera",boost::bind(&QtCoinViewer::_SetFiguresInCamera,this,_1,_2), "Accepts 0/1 value that decides whether to render the figure plots in the camera image through GetCameraImage"); RegisterCommand("SetFeedbackVisibility",boost::bind(&QtCoinViewer::_SetFeedbackVisibility,this,_1,_2), "Accepts 0/1 value that decides whether to render the cross hairs"); RegisterCommand("ShowWorldAxes",boost::bind(&QtCoinViewer::_SetFeedbackVisibility,this,_1,_2), "Accepts 0/1 value that decides whether to render the cross hairs"); RegisterCommand("Resize",boost::bind(&QtCoinViewer::_CommandResize,this,_1,_2), "Accepts width x height to resize internal video frame"); RegisterCommand("SaveBodyLinkToVRML",boost::bind(&QtCoinViewer::_SaveBodyLinkToVRMLCommand,this,_1,_2), "Saves a body and/or a link to VRML. Format is::\n\n bodyname linkindex filename\\n\n\nwhere linkindex >= 0 to save for a specific link, or < 0 to save all links"); RegisterCommand("SetNearPlane", boost::bind(&QtCoinViewer::_SetNearPlaneCommand, this, _1, _2), "Sets the near plane for rendering of the image. Useful when tweaking rendering units"); RegisterCommand("StartViewerLoop", boost::bind(&QtCoinViewer::_StartViewerLoopCommand, this, _1, _2), "starts the viewer sync loop and shows the viewer. expects someone else will call the qapplication exec fn"); RegisterCommand("Show", boost::bind(&QtCoinViewer::_ShowCommand, this, _1, _2), "executs the show directly"); RegisterCommand("TrackLink", boost::bind(&QtCoinViewer::_TrackLinkCommand, this, _1, _2), "camera tracks the link maintaining a specific relative transform: robotname, manipname, _fTrackingRadius"); RegisterCommand("TrackManipulator", boost::bind(&QtCoinViewer::_TrackManipulatorCommand, this, _1, _2), "camera tracks the manipulator maintaining a specific relative transform: robotname, manipname, _fTrackingRadius"); RegisterCommand("SetTrackingAngleToUp", boost::bind(&QtCoinViewer::_SetTrackingAngleToUpCommand, this, _1, _2), "sets a new angle to up"); _fTrackAngleToUp = 0.3; _bLockEnvironment = true; _pToggleDebug = NULL; _pSelectedCollisionChecker = NULL; _pSelectedPhysicsEngine = NULL; _pToggleSimulation = NULL; _bInIdleThread = false; _bAutoSetCamera = true; _videocodec = -1; _bRenderFiguresInCamera = false; _fTrackingRadius = 0.1; //vlayout = new QVBoxLayout(this); view1 = new QGroupBox(this); //vlayout->addWidget(view1, 1); setCentralWidget (view1); _nRenderWidth=VIDEO_WIDTH; _nRenderHeight=VIDEO_HEIGHT; resize(_nRenderWidth, _nRenderHeight); _pviewer = new SoQtExaminerViewer(view1, "qtcoinopenrave", 1, (SoQtExaminerViewer::BuildFlag)qtcoinbuild, SoQtViewer::BROWSER); _selectedNode = NULL; s_DefaultHandlerCB = SoDebugError::getHandlerCallback(); SoDebugError::setHandlerCallback(CustomCoinHandlerCB,NULL); // initialize the environment _ivRoot = new SoSelection(); _ivRoot->ref(); _ivRoot->policy.setValue(SoSelection::SHIFT); _ivCamera = new SoPerspectiveCamera(); _ivStyle = new SoDrawStyle(); _ivCamera->position.setValue(-0.5f, 1.5f, 0.8f); _ivCamera->orientation.setValue(SbVec3f(1,0,0), -0.5f); _ivCamera->aspectRatio = (float)view1->size().width() / (float)view1->size().height(); _ivBodies = NULL; if( !!ifstream("environment.iv") ) { SoInput mySceneInput; if( mySceneInput.openFile("environment.iv") ) { _ivBodies = SoDB::readAll(&mySceneInput); if( !!_ivBodies ) { // environment should take care of this _pviewer->setHeadlight(false); } } } if( _ivBodies == NULL ) { _ivBodies = new SoSeparator(); } // add the message texts SoSeparator* pmsgsep = new SoSeparator(); SoTranslation* pmsgtrans0 = new SoTranslation(); pmsgtrans0->translation.setValue(SbVec3f(-0.978f,0.93f,0)); pmsgsep->addChild(pmsgtrans0); SoBaseColor* pcolor0 = new SoBaseColor(); pcolor0->rgb.setValue(0.0f,0.0f,0.0f); pmsgsep->addChild(pcolor0); _messageNodes[0] = new SoText2(); pmsgsep->addChild(_messageNodes[0]); _messageShadowTranslation = new SoTranslation(); _messageShadowTranslation->translation.setValue(SbVec3f(-0.002f,0.032f,0)); pmsgsep->addChild(_messageShadowTranslation); SoBaseColor* pcolor1 = new SoBaseColor(); pcolor1->rgb.setValue(0.99f,0.99f,0.99f); pmsgsep->addChild(pcolor1); _messageNodes[1] = new SoText2(); pmsgsep->addChild(_messageNodes[1]); _ivRoot->addChild(pmsgsep); _ivRoot->addChild(_ivCamera); SoEventCallback * ecb = new SoEventCallback; ecb->addEventCallback(SoLocation2Event::getClassTypeId(), mousemove_cb, this); _ivRoot->addChild(ecb); _ivRoot->addChild(_ivStyle); _ivRoot->addChild(_ivBodies); // add Inventor selection callbacks _ivRoot->addSelectionCallback(_SelectHandler, this); _ivRoot->addDeselectionCallback(_DeselectHandler, this); SoComplexity* pcomplexity = new SoComplexity(); pcomplexity->value = 0.1f; // default =0.5, lower is faster pcomplexity->type = SoComplexity::SCREEN_SPACE; pcomplexity->textureQuality = 1.0; // good texture quality _ivRoot->addChild(pcomplexity); SoTextureScalePolicy* ppolicy = new SoTextureScalePolicy(); ppolicy->policy = SoTextureScalePolicy::FRACTURE; // requires in order to support non-power of 2 textures _ivRoot->addChild(ppolicy); _pFigureRoot = new SoSeparator(); { SoLightModel* plightmodel = new SoLightModel(); plightmodel->model = SoLightModel::BASE_COLOR; // disable lighting _pFigureRoot->addChild(plightmodel); } _ivRoot->addChild(_pFigureRoot); _pviewer->setSceneGraph(_ivRoot); _pviewer->setAutoClippingStrategy(SoQtViewer::CONSTANT_NEAR_PLANE, 0.01f); _pviewer->setSeekTime(1.0f); _SetBkgndColor(Vector(1,1,1)); // setup a callback handler for keyboard events _eventKeyboardCB = new SoEventCallback; _ivRoot->addChild(_eventKeyboardCB); _eventKeyboardCB->addEventCallback(SoKeyboardEvent::getClassTypeId(), _KeyHandler, this); _altDown[0] = _altDown[1] = false; _ctrlDown[0] = _ctrlDown[1] = false; _bUpdateEnvironment = true; // toggle switches _nFrameNum = 0; _bDisplayGrid = false; _bDisplayIK = false; _bDisplayFPS = false; _bJointHilit = true; _bDynamicReplan = false; _bVelPredict = true; _bDynSim = false; _bControl = true; _bGravity = true; _bTimeElapsed = false; _bSensing = false; _bMemory = true; _bHardwarePlan = false; _bShareBitmap = true; _bManipTracking = false; _bAntialiasing = false; _viewGeometryMode = VG_RenderOnly; if( bCreateMenu ) { SetupMenus(); } InitOffscreenRenderer(); _timerSensor = new SoTimerSensor(GlobAdvanceFrame, this); _timerSensor->setInterval(SbTime(TIMER_SENSOR_INTERVAL)); _timerVideo = new SoTimerSensor(GlobVideoFrame, this); _timerVideo->setInterval(SbTime(0.7/VIDEO_FRAMERATE)); // better to produce more frames than get slow video if (!_timerVideo->isScheduled()) { _timerVideo->schedule(); } SoDB::setRealTimeInterval(SbTime(0.7/VIDEO_FRAMERATE)); // better to produce more frames than get slow video // set to the classic locale so that number serialization/hashing works correctly // for some reason qt4 resets the locale to the default locale at some point, and openrave stops working std::locale::global(std::locale::classic()); if( nAlwaysOnTopFlag != 0 ) { Qt::WindowFlags flags = Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint; if( nAlwaysOnTopFlag == 1 ) { flags |= this->windowFlags(); } this->setWindowFlags(flags); } } QtCoinViewer::~QtCoinViewer() { RAVELOG_DEBUG("destroying qtcoinviewer\n"); { boost::mutex::scoped_lock lock(_mutexMessages); list<EnvMessagePtr>::iterator itmsg; FORIT(itmsg, _listMessages) { try { (*itmsg)->viewerexecute(); // have to execute instead of deleteing since there can be threads waiting } catch(const boost::bad_weak_ptr& ex) { // most likely viewer } } _listMessages.clear(); } _ivRoot->deselectAll(); if (_timerSensor->isScheduled()) { _timerSensor->unschedule(); } if (_timerVideo->isScheduled()) { _timerVideo->unschedule(); } _eventKeyboardCB->removeEventCallback(SoKeyboardEvent::getClassTypeId(), _KeyHandler, this); _ivRoot->removeSelectionCallback(_SelectHandler, this); _ivRoot->removeDeselectionCallback(_DeselectHandler, this); _eventKeyboardCB->unref(); _condUpdateModels.notify_all(); _pvideorecorder.reset(); // don't dereference // if( --s_InitRefCount <= 0 ) // SoQt::done(); } void QtCoinViewer::resize ( int w, int h) { QMainWindow::resize(w,h); } void QtCoinViewer::resize ( const QSize & qs) { resize(qs.width(), qs.height()); } void QtCoinViewer::mousemove_cb(void * userdata, SoEventCallback * node) { ((QtCoinViewer*)userdata)->_mousemove_cb(node); } void QtCoinViewer::_mousemove_cb(SoEventCallback * node) { SoRayPickAction rp( _pviewer->getViewportRegion() ); rp.setPoint(node->getEvent()->getPosition()); rp.apply(_ivRoot); SoPickedPoint * pt = rp.getPickedPoint(0); if( pt != NULL ) { SoPath* path = pt->getPath(); ItemPtr pItem; SoNode* node = NULL; for(int i = path->getLength()-1; i >= 0; --i) { node = path->getNode(i); // search the environment FOREACH(it, _mapbodies) { BOOST_ASSERT( !!it->second ); if (it->second->ContainsIvNode(node)) { pItem = it->second; break; } } if( !!pItem ) { break; } } if (!!pItem) { boost::mutex::scoped_lock lock(_mutexMessages); KinBodyItemPtr pKinBody = boost::dynamic_pointer_cast<KinBodyItem>(pItem); KinBody::LinkPtr pSelectedLink; if( !!pKinBody ) { pSelectedLink = pKinBody->GetLinkFromIv(node); } _pMouseOverLink = pSelectedLink; _vMouseSurfacePosition.x = pt->getPoint()[0]; _vMouseSurfacePosition.y = pt->getPoint()[1]; _vMouseSurfacePosition.z = pt->getPoint()[2]; _vMouseSurfaceNormal.x = pt->getNormal()[0]; _vMouseSurfaceNormal.y = pt->getNormal()[1]; _vMouseSurfaceNormal.z = pt->getNormal()[2]; SbVec3f cp = GetCamera()->position.getValue(); RaveVector<float> camerapos (cp[0],cp[1],cp[2]); _vMouseRayDirection = _vMouseSurfacePosition-camerapos; if( _vMouseRayDirection.lengthsqr3() > 0 ) { _vMouseRayDirection.normalize3(); } else { _vMouseRayDirection = Vector(0,0,0); } stringstream ss; ss << "mouse on " << pKinBody->GetBody()->GetName() << ":"; if( !!pSelectedLink ) { ss << pSelectedLink->GetName() << "(" << pSelectedLink->GetIndex() << ")"; } else { ss << "(NULL)"; } ss << " (" << std::fixed << std::setprecision(5) << std::setw(8) << std::left << pt->getPoint()[0] << ", " << std::setw(8) << std::left << pt->getPoint()[1] << ", " << std::setw(8) << std::left << pt->getPoint()[2] << ")"; ss << ", n=(" << std::setw(8) << std::left << _vMouseSurfaceNormal.x << ", " << std::setw(8) << std::left << _vMouseSurfaceNormal.y << ", " << std::setw(8) << std::left << _vMouseSurfaceNormal.z << ")"; ss << endl; _strMouseMove = ss.str(); } else { boost::mutex::scoped_lock lock(_mutexMessages); _strMouseMove.resize(0); } } else { boost::mutex::scoped_lock lock(_mutexMessages); _strMouseMove.resize(0); } } class ViewerSetSizeMessage : public QtCoinViewer::EnvMessage { public: ViewerSetSizeMessage(QtCoinViewerPtr pviewer, void** ppreturn, int width, int height) : EnvMessage(pviewer, ppreturn, false), _width(width), _height(height) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !!pviewer ) { pviewer->_SetSize(_width, _height); } EnvMessage::viewerexecute(); } private: int _width, _height; }; void QtCoinViewer::SetSize(int w, int h) { EnvMessagePtr pmsg(new ViewerSetSizeMessage(shared_viewer(), (void**)NULL, w, h)); pmsg->callerexecute(false); } void QtCoinViewer::_SetSize(int w, int h) { resize(w,h); } class ViewerMoveMessage : public QtCoinViewer::EnvMessage { public: ViewerMoveMessage(QtCoinViewerPtr pviewer, void** ppreturn, int x, int y) : EnvMessage(pviewer, ppreturn, false), _x(x), _y(y) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !!pviewer ) { pviewer->_Move(_x, _y); } EnvMessage::viewerexecute(); } private: int _x, _y; }; void QtCoinViewer::Move(int x, int y) { EnvMessagePtr pmsg(new ViewerMoveMessage(shared_viewer(), (void**)NULL, x, y)); pmsg->callerexecute(false); } void QtCoinViewer::_Move(int x, int y) { move(x,y); } class ViewerShowMessage : public QtCoinViewer::EnvMessage { public: ViewerShowMessage(QtCoinViewerPtr pviewer, void** ppreturn, int showtype) : EnvMessage(pviewer, ppreturn, false), _showtype(showtype) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !!pviewer ) { pviewer->_Show(_showtype); } EnvMessage::viewerexecute(); } private: int _showtype; }; void QtCoinViewer::Show(int showtype) { EnvMessagePtr pmsg(new ViewerShowMessage(shared_viewer(), (void**)NULL, showtype)); pmsg->callerexecute(false); } void QtCoinViewer::_Show(int showtype) { if( showtype ) { _pviewer->show(); } else { _pviewer->hide(); } } class ViewerSetNameMessage : public QtCoinViewer::EnvMessage { public: ViewerSetNameMessage(QtCoinViewerPtr pviewer, void** ppreturn, const string& ptitle) : EnvMessage(pviewer, ppreturn, false), _title(ptitle) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !!pviewer ) { pviewer->_SetName(_title.c_str()); } EnvMessage::viewerexecute(); } private: string _title; }; void QtCoinViewer::SetName(const string& ptitle) { _name = ptitle; EnvMessagePtr pmsg(new ViewerSetNameMessage(shared_viewer(), (void**)NULL, ptitle)); pmsg->callerexecute(false); } void QtCoinViewer::_SetName(const string& ptitle) { setWindowTitle(ptitle.c_str()); } bool QtCoinViewer::LoadModel(const string& pfilename) { SoInput mySceneInput; if (mySceneInput.openFile(pfilename.c_str())) { GetBodiesRoot()->addChild(SoDB::readAll(&mySceneInput)); return true; } return false; } void QtCoinViewer::_StartPlaybackTimer() { if (!_timerSensor->isScheduled()) { _timerSensor->schedule(); } } void QtCoinViewer::_StopPlaybackTimer() { if (_timerSensor->isScheduled()) { _timerSensor->unschedule(); } boost::mutex::scoped_lock lock(_mutexUpdateModels); _condUpdateModels.notify_all(); } class GetCameraImageMessage : public QtCoinViewer::EnvMessage { public: GetCameraImageMessage(QtCoinViewerPtr pviewer, void** ppreturn, std::vector<uint8_t>& memory, int width, int height, const RaveTransform<float>& extrinsic, const SensorBase::CameraIntrinsics& KK) : EnvMessage(pviewer, ppreturn, true), _memory(memory), _width(width), _height(height), _extrinsic(extrinsic), _KK(KK) { } virtual void viewerexecute() { void* ret = (void*)QtCoinViewerPtr(_pviewer)->_GetCameraImage(_memory, _width, _height, _extrinsic, _KK); if( _ppreturn != NULL ) *_ppreturn = ret; EnvMessage::viewerexecute(); } private: vector<uint8_t>& _memory; int _width, _height; const RaveTransform<float>& _extrinsic; const SensorBase::CameraIntrinsics& _KK; }; bool QtCoinViewer::GetCameraImage(std::vector<uint8_t>& memory, int width, int height, const RaveTransform<float>& t, const SensorBase::CameraIntrinsics& KK) { void* ret = NULL; if (_timerSensor->isScheduled() && _bUpdateEnvironment) { if( !ForceUpdatePublishedBodies() ) { RAVELOG_WARN("failed to GetCameraImage: force update failed\n"); return false; } EnvMessagePtr pmsg(new GetCameraImageMessage(shared_viewer(), &ret, memory, width, height, t, KK)); pmsg->callerexecute(false); } else { RAVELOG_VERBOSE("failed to GetCameraImage: viewer is not updating\n"); } return *(bool*)&ret; } class WriteCameraImageMessage : public QtCoinViewer::EnvMessage { public: WriteCameraImageMessage(QtCoinViewerPtr pviewer, void** ppreturn, int width, int height, const RaveTransform<float>& t, const SensorBase::CameraIntrinsics& KK, const std::string& fileName, const std::string& extension) : EnvMessage(pviewer, ppreturn, true), _width(width), _height(height), _t(t), _KK(KK), _fileName(fileName), _extension(extension) { } virtual void viewerexecute() { void* ret = (void*)QtCoinViewerPtr(_pviewer)->_WriteCameraImage(_width, _height, _t, _KK, _fileName, _extension); if( _ppreturn != NULL ) *_ppreturn = ret; EnvMessage::viewerexecute(); } private: int _width, _height; const RaveTransform<float>& _t; const SensorBase::CameraIntrinsics& _KK; const string& _fileName, &_extension; }; bool QtCoinViewer::WriteCameraImage(int width, int height, const RaveTransform<float>& t, const SensorBase::CameraIntrinsics& KK, const std::string& fileName, const std::string& extension) { void* ret; if (_timerSensor->isScheduled() && _bUpdateEnvironment) { if( !ForceUpdatePublishedBodies() ) { RAVELOG_WARN("failed to WriteCameraImage\n"); return false; } EnvMessagePtr pmsg(new WriteCameraImageMessage(shared_viewer(), &ret, width, height, t, KK, fileName, extension)); pmsg->callerexecute(false); } else { RAVELOG_WARN("failed to WriteCameraImage: viewer is not updating\n"); } return *(bool*)&ret; } class SetCameraMessage : public QtCoinViewer::EnvMessage { public: SetCameraMessage(QtCoinViewerPtr pviewer, void** ppreturn, const RaveTransform<float>& trans, float focalDistance) : EnvMessage(pviewer, ppreturn, false), _trans(trans),_focalDistance(focalDistance) { } virtual void viewerexecute() { QtCoinViewerPtr(_pviewer)->_SetCamera(_trans,_focalDistance); EnvMessage::viewerexecute(); } private: const RaveTransform<float> _trans; float _focalDistance; }; void QtCoinViewer::SetCamera(const RaveTransform<float>& trans,float focalDistance) { EnvMessagePtr pmsg(new SetCameraMessage(shared_viewer(), (void**)NULL, trans,focalDistance)); pmsg->callerexecute(false); } class DrawMessage : public QtCoinViewer::EnvMessage { public: enum DrawType { DT_Point = 0, DT_Sphere, DT_LineStrip, DT_LineList, }; DrawMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const float* colors, DrawType type, bool bhasalpha) : EnvMessage(pviewer, NULL, false), _numPoints(numPoints), _fwidth(fwidth), _handle(handle), _type(type), _bhasalpha(bhasalpha) { _vpoints.resize(3*numPoints); for(int i = 0; i < numPoints; ++i) { _vpoints[3*i+0] = ppoints[0]; _vpoints[3*i+1] = ppoints[1]; _vpoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } _stride = 3*sizeof(float); _vcolors.resize((_bhasalpha ? 4 : 3)*numPoints); if( colors != NULL ) memcpy(&_vcolors[0], colors, sizeof(float)*_vcolors.size()); _bManyColors = true; } DrawMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const RaveVector<float>& color, DrawType type) : EnvMessage(pviewer, NULL, false), _numPoints(numPoints), _fwidth(fwidth), _color(color), _handle(handle), _type(type) { _vpoints.resize(3*numPoints); for(int i = 0; i < numPoints; ++i) { _vpoints[3*i+0] = ppoints[0]; _vpoints[3*i+1] = ppoints[1]; _vpoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } _stride = 3*sizeof(float); _bManyColors = false; } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret=NULL; switch(_type) { case DT_Point: if( _bManyColors ) { ret = pviewer->_plot3(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, &_vcolors[0],_bhasalpha); } else { ret = pviewer->_plot3(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, _color); } break; case DT_Sphere: if( _bManyColors ) { ret = pviewer->_drawspheres(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, &_vcolors[0],_bhasalpha); } else { ret = pviewer->_drawspheres(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, _color); } break; case DT_LineStrip: if( _bManyColors ) { ret = pviewer->_drawlinestrip(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, &_vcolors[0]); } else { ret = pviewer->_drawlinestrip(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, _color); } break; case DT_LineList: if( _bManyColors ) { ret = pviewer->_drawlinelist(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, &_vcolors[0]); } else { ret = pviewer->_drawlinelist(_handle, &_vpoints[0], _numPoints, _stride, _fwidth, _color); } break; } BOOST_ASSERT( _handle == ret); EnvMessage::viewerexecute(); } private: vector<float> _vpoints; int _numPoints, _stride; float _fwidth; const RaveVector<float> _color; vector<float> _vcolors; SoSwitch* _handle; bool _bManyColors; DrawType _type; bool _bhasalpha; }; SoSwitch* QtCoinViewer::_createhandle() { SoSwitch* handle = new SoSwitch(); handle->whichChild = SO_SWITCH_ALL; return handle; } GraphHandlePtr QtCoinViewer::plot3(const float* ppoints, int numPoints, int stride, float fPointSize, const RaveVector<float>& color, int drawstyle) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fPointSize, color, drawstyle ? DrawMessage::DT_Sphere : DrawMessage::DT_Point)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::plot3(const float* ppoints, int numPoints, int stride, float fPointSize, const float* colors, int drawstyle, bool bhasalpha) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fPointSize, colors, drawstyle ? DrawMessage::DT_Sphere : DrawMessage::DT_Point, bhasalpha)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::drawlinestrip(const float* ppoints, int numPoints, int stride, float fwidth, const RaveVector<float>& color) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fwidth, color,DrawMessage::DT_LineStrip)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::drawlinestrip(const float* ppoints, int numPoints, int stride, float fwidth, const float* colors) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fwidth, colors, DrawMessage::DT_LineStrip,false)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::drawlinelist(const float* ppoints, int numPoints, int stride, float fwidth, const RaveVector<float>& color) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fwidth, color, DrawMessage::DT_LineList)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::drawlinelist(const float* ppoints, int numPoints, int stride, float fwidth, const float* colors) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawMessage(shared_viewer(), handle, ppoints, numPoints, stride, fwidth, colors, DrawMessage::DT_LineList,false)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } class DrawArrowMessage : public QtCoinViewer::EnvMessage { public: DrawArrowMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const RaveVector<float>& p1, const RaveVector<float>& p2, float fwidth, const RaveVector<float>& color) : EnvMessage(pviewer, NULL, false), _p1(p1), _p2(p2), _color(color), _handle(handle), _fwidth(fwidth) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret = pviewer->_drawarrow(_handle, _p1, _p2, _fwidth, _color); BOOST_ASSERT( _handle == ret ); EnvMessage::viewerexecute(); } private: RaveVector<float> _p1, _p2, _color; SoSwitch* _handle; float _fwidth; }; GraphHandlePtr QtCoinViewer::drawarrow(const RaveVector<float>& p1, const RaveVector<float>& p2, float fwidth, const RaveVector<float>& color) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawArrowMessage(shared_viewer(), handle, p1, p2, fwidth, color)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } class DrawBoxMessage : public QtCoinViewer::EnvMessage { public: DrawBoxMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const RaveVector<float>& vpos, const RaveVector<float>& vextents) : EnvMessage(pviewer, NULL, false), _vpos(vpos), _vextents(vextents), _handle(handle) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret = pviewer->_drawbox(_handle, _vpos, _vextents); BOOST_ASSERT( _handle == ret); EnvMessage::viewerexecute(); } private: RaveVector<float> _vpos, _vextents; SoSwitch* _handle; }; GraphHandlePtr QtCoinViewer::drawbox(const RaveVector<float>& vpos, const RaveVector<float>& vextents) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawBoxMessage(shared_viewer(), handle, vpos, vextents)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } class DrawPlaneMessage : public QtCoinViewer::EnvMessage { public: DrawPlaneMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const Transform& tplane, const RaveVector<float>& vextents, const boost::multi_array<float,3>& vtexture) : EnvMessage(pviewer, NULL, false), _tplane(tplane), _vextents(vextents),_vtexture(vtexture), _handle(handle) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret = pviewer->_drawplane(_handle, _tplane,_vextents,_vtexture); BOOST_ASSERT( _handle == ret); EnvMessage::viewerexecute(); } private: RaveTransform<float> _tplane; RaveVector<float> _vextents; boost::multi_array<float,3> _vtexture; SoSwitch* _handle; }; GraphHandlePtr QtCoinViewer::drawplane(const RaveTransform<float>& tplane, const RaveVector<float>& vextents, const boost::multi_array<float,3>& vtexture) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawPlaneMessage(shared_viewer(), handle, tplane,vextents,vtexture)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } class DrawTriMeshMessage : public QtCoinViewer::EnvMessage { public: DrawTriMeshMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const float* ppoints, int stride, const int* pIndices, int numTriangles, const RaveVector<float>& color) : EnvMessage(pviewer, NULL, false), _color(color), _handle(handle) { _vpoints.resize(3*3*numTriangles); if( pIndices == NULL ) { for(int i = 0; i < 3*numTriangles; ++i) { _vpoints[3*i+0] = ppoints[0]; _vpoints[3*i+1] = ppoints[1]; _vpoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } } else { for(int i = 0; i < numTriangles*3; ++i) { float* p = (float*)((char*)ppoints + stride * pIndices[i]); _vpoints[3*i+0] = p[0]; _vpoints[3*i+1] = p[1]; _vpoints[3*i+2] = p[2]; } } } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret = pviewer->_drawtrimesh(_handle, &_vpoints[0], 3*sizeof(float), NULL, _vpoints.size()/9,_color); BOOST_ASSERT( _handle == ret); EnvMessage::viewerexecute(); } private: vector<float> _vpoints; RaveVector<float> _color; SoSwitch* _handle; }; class DrawTriMeshColorMessage : public QtCoinViewer::EnvMessage { public: DrawTriMeshColorMessage(QtCoinViewerPtr pviewer, SoSwitch* handle, const float* ppoints, int stride, const int* pIndices, int numTriangles, const boost::multi_array<float,2>& colors) : EnvMessage(pviewer, NULL, false), _colors(colors), _handle(handle) { _vpoints.resize(3*3*numTriangles); if( pIndices == NULL ) { for(int i = 0; i < 3*numTriangles; ++i) { _vpoints[3*i+0] = ppoints[0]; _vpoints[3*i+1] = ppoints[1]; _vpoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } } else { for(int i = 0; i < numTriangles*3; ++i) { float* p = (float*)((char*)ppoints + stride * pIndices[i]); _vpoints[3*i+0] = p[0]; _vpoints[3*i+1] = p[1]; _vpoints[3*i+2] = p[2]; } } } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } void* ret = pviewer->_drawtrimesh(_handle, &_vpoints[0], 3*sizeof(float), NULL, _vpoints.size()/9,_colors); BOOST_ASSERT( _handle == ret); EnvMessage::viewerexecute(); } private: vector<float> _vpoints; boost::multi_array<float,2> _colors; SoSwitch* _handle; }; GraphHandlePtr QtCoinViewer::drawtrimesh(const float* ppoints, int stride, const int* pIndices, int numTriangles, const RaveVector<float>& color) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawTriMeshMessage(shared_viewer(), handle, ppoints, stride, pIndices, numTriangles, color)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } GraphHandlePtr QtCoinViewer::drawtrimesh(const float* ppoints, int stride, const int* pIndices, int numTriangles, const boost::multi_array<float,2>& colors) { SoSwitch* handle = _createhandle(); EnvMessagePtr pmsg(new DrawTriMeshColorMessage(shared_viewer(), handle, ppoints, stride, pIndices, numTriangles, colors)); pmsg->callerexecute(false); return GraphHandlePtr(new PrivateGraphHandle(shared_viewer(), handle)); } class CloseGraphMessage : public QtCoinViewer::EnvMessage { public: CloseGraphMessage(QtCoinViewerPtr pviewer, void** ppreturn, SoSwitch* handle) : EnvMessage(pviewer, ppreturn, false), _handle(handle) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_closegraph(_handle); EnvMessage::viewerexecute(); } private: SoSwitch* _handle; }; void QtCoinViewer::closegraph(SoSwitch* handle) { EnvMessagePtr pmsg(new CloseGraphMessage(shared_viewer(), (void**)NULL, handle)); pmsg->callerexecute(false); } class SetGraphTransformMessage : public QtCoinViewer::EnvMessage { public: SetGraphTransformMessage(QtCoinViewerPtr pviewer, void** ppreturn, SoSwitch* handle, const RaveTransform<float>& t) : EnvMessage(pviewer, ppreturn, false), _handle(handle), _t(t) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_SetGraphTransform(_handle,_t); EnvMessage::viewerexecute(); } private: SoSwitch* _handle; RaveTransform<float> _t; }; void QtCoinViewer::SetGraphTransform(SoSwitch* handle, const RaveTransform<float>& t) { EnvMessagePtr pmsg(new SetGraphTransformMessage(shared_viewer(), (void**)NULL, handle, t)); pmsg->callerexecute(false); } class SetGraphShowMessage : public QtCoinViewer::EnvMessage { public: SetGraphShowMessage(QtCoinViewerPtr pviewer, void** ppreturn, SoSwitch* handle, bool bshow) : EnvMessage(pviewer, ppreturn, false), _handle(handle), _bshow(bshow) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_SetGraphShow(_handle,_bshow); EnvMessage::viewerexecute(); } private: SoSwitch* _handle; bool _bshow; }; void QtCoinViewer::SetGraphShow(SoSwitch* handle, bool bshow) { EnvMessagePtr pmsg(new SetGraphShowMessage(shared_viewer(), (void**)NULL, handle, bshow)); pmsg->callerexecute(false); } class DeselectMessage : public QtCoinViewer::EnvMessage { public: DeselectMessage(QtCoinViewerPtr pviewer, void** ppreturn) : EnvMessage(pviewer, ppreturn, false) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_deselect(); EnvMessage::viewerexecute(); } }; void QtCoinViewer::deselect() { EnvMessagePtr pmsg(new DeselectMessage(shared_viewer(), (void**)NULL)); pmsg->callerexecute(false); } class ResetMessage : public QtCoinViewer::EnvMessage { public: ResetMessage(QtCoinViewerPtr pviewer, void** ppreturn) : EnvMessage(pviewer, ppreturn, true) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_Reset(); EnvMessage::viewerexecute(); } }; void QtCoinViewer::Reset() { if (_timerSensor->isScheduled() && _bUpdateEnvironment) { EnvMessagePtr pmsg(new ResetMessage(shared_viewer(), (void**)NULL)); pmsg->callerexecute(false); } } boost::shared_ptr<void> QtCoinViewer::LockGUI() { boost::shared_ptr<boost::mutex::scoped_lock> lock(new boost::mutex::scoped_lock(_mutexGUI)); while(!_bInIdleThread) { boost::this_thread::sleep(boost::posix_time::milliseconds(1)); } return lock; } class SetBkgndColorMessage : public QtCoinViewer::EnvMessage { public: SetBkgndColorMessage(QtCoinViewerPtr pviewer, void** ppreturn, const RaveVector<float>& color) : EnvMessage(pviewer, ppreturn, false), _color(color) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_SetBkgndColor(_color); EnvMessage::viewerexecute(); } private: RaveVector<float> _color; }; void QtCoinViewer::SetBkgndColor(const RaveVector<float>& color) { if (_timerSensor->isScheduled() && _bUpdateEnvironment) { EnvMessagePtr pmsg(new SetBkgndColorMessage(shared_viewer(), (void**)NULL, color)); pmsg->callerexecute(false); } } void QtCoinViewer::SetEnvironmentSync(bool bUpdate) { boost::mutex::scoped_lock lockupdating(_mutexUpdating); boost::mutex::scoped_lock lock(_mutexUpdateModels); _bUpdateEnvironment = bUpdate; _condUpdateModels.notify_all(); if( !bUpdate ) { // remove all messages in order to release the locks boost::mutex::scoped_lock lockmsg(_mutexMessages); FOREACH(it,_listMessages) { (*it)->releasemutex(); } _listMessages.clear(); } } void QtCoinViewer::EnvironmentSync() { { boost::mutex::scoped_lock lockupdating(_mutexUpdating); if( !_bUpdateEnvironment ) { RAVELOG_WARN("cannot update models from environment sync\n"); return; } } boost::mutex::scoped_lock lock(_mutexUpdateModels); _bModelsUpdated = false; _condUpdateModels.wait(lock); if( !_bModelsUpdated ) { RAVELOG_WARN("failed to update models from environment sync\n"); } } void QtCoinViewer::_SetCamera(const RaveTransform<float>& _t, float focalDistance) { _bAutoSetCamera = false; RaveTransform<float> trot; trot.rot = quatFromAxisAngle(RaveVector<float>(1,0,0),(float)PI); RaveTransform<float> t = _t*trot; GetCamera()->position.setValue(t.trans.x, t.trans.y, t.trans.z); GetCamera()->orientation.setValue(t.rot.y, t.rot.z, t.rot.w, t.rot.x); if( focalDistance > 0 ) { GetCamera()->focalDistance = focalDistance; } _UpdateCameraTransform(0); } void QtCoinViewer::_SetBkgndColor(const RaveVector<float>& color) { _pviewer->setBackgroundColor(SbColor(color.x, color.y, color.z)); _ivOffscreen.setBackgroundColor(SbColor(color.x, color.y, color.z)); } void QtCoinViewer::_closegraph(SoSwitch* handle) { if( handle != NULL ) { _pFigureRoot->removeChild(handle); } } void QtCoinViewer::_SetGraphTransform(SoSwitch* handle, const RaveTransform<float>& t) { if( handle != NULL ) { SoNode* pparent = handle->getChild(0); if((pparent != NULL)&&(pparent->getTypeId() == SoSeparator::getClassTypeId())) { SoNode* ptrans = ((SoSeparator*)pparent)->getChild(0); if((ptrans != NULL)&&(ptrans->getTypeId() == SoTransform::getClassTypeId())) { SetSoTransform((SoTransform*)ptrans, t); } } } } void QtCoinViewer::_SetGraphShow(SoSwitch* handle, bool bshow) { if( handle != NULL ) { handle->whichChild = bshow ? SO_SWITCH_ALL : SO_SWITCH_NONE; } } void QtCoinViewer::PrintCamera() { _UpdateCameraTransform(0); // have to flip Z axis RaveTransform<float> trot; trot.rot = quatFromAxisAngle(RaveVector<float>(1,0,0),(float)PI); RaveTransform<float> T = _Tcamera*trot; Vector vaxis = axisAngleFromQuat(T.rot); dReal fangle = RaveSqrt(vaxis.lengthsqr3()); vaxis *= (1/fangle); RAVELOG_INFO(str(boost::format("Camera Transformation:\n" "<camtrans>%f %f %f</camtrans>\n" "<camrotationaxis>%f %f %f %f</camrotationaxis>\n" "<camfocal>%f</camfocal>\n" "height angle: %f\n")%T.trans[0]%T.trans[1]%T.trans[2]%vaxis[0]%vaxis[1]%vaxis[2]%(fangle*180.0f/PI)%GetCamera()->focalDistance.getValue()%GetCamera()->heightAngle.getValue())); } RaveTransform<float> QtCoinViewer::GetCameraTransform() const { boost::mutex::scoped_lock lock(_mutexMessages); // have to flip Z axis RaveTransform<float> trot; trot.rot = quatFromAxisAngle(RaveVector<float>(1,0,0),(float)PI); return _Tcamera*trot; } geometry::RaveCameraIntrinsics<float> QtCoinViewer::GetCameraIntrinsics() const { boost::mutex::scoped_lock lock(_mutexMessages); return _camintrinsics; } SensorBase::CameraIntrinsics QtCoinViewer::GetCameraIntrinsics2() const { boost::mutex::scoped_lock lock(_mutexMessages); SensorBase::CameraIntrinsics intr; intr.fx = _camintrinsics.fx; intr.fy = _camintrinsics.fy; intr.cx = _camintrinsics.cx; intr.cy = _camintrinsics.cy; intr.distortion_model = _camintrinsics.distortion_model; intr.distortion_coeffs.resize(_camintrinsics.distortion_coeffs.size()); std::copy(_camintrinsics.distortion_coeffs.begin(), _camintrinsics.distortion_coeffs.end(), intr.distortion_coeffs.begin()); intr.focal_length = _camintrinsics.focal_length; return intr; } void* QtCoinViewer::_plot3(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fPointSize, const RaveVector<float>& color) { if((handle == NULL)||(numPoints <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); SoMaterial* mtrl = new SoMaterial; mtrl->diffuseColor = SbColor(color.x, color.y, color.z); mtrl->ambientColor = SbColor(0,0,0); mtrl->transparency = max(0.0f,1.0f-color.w); mtrl->setOverride(true); pparent->addChild(mtrl); if( color.w < 1.0f ) { SoTransparencyType* ptype = new SoTransparencyType(); ptype->value = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND; pparent->addChild(ptype); } SoCoordinate3* vprop = new SoCoordinate3(); if( stride != sizeof(float)*3 ) { vector<float> mypoints(numPoints*3); for(int i = 0; i < numPoints; ++i) { mypoints[3*i+0] = ppoints[0]; mypoints[3*i+1] = ppoints[1]; mypoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } vprop->point.setValues(0,numPoints,(float(*)[3])&mypoints[0]); } else { vprop->point.setValues(0,numPoints,(float(*)[3])ppoints); } pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::POINTS; style->pointSize = fPointSize; pparent->addChild(style); SoPointSet* pointset = new SoPointSet(); pointset->numPoints.setValue(-1); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_plot3(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fPointSize, const float* colors, bool bhasalpha) { if((handle == NULL)||(numPoints <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); SoMaterial* mtrl = new SoMaterial; if( bhasalpha ) { vector<float> colorsonly(numPoints*3),alphaonly(numPoints); for(int i = 0; i < numPoints; ++i) { colorsonly[3*i+0] = colors[4*i+0]; colorsonly[3*i+1] = colors[4*i+1]; colorsonly[3*i+2] = colors[4*i+2]; alphaonly[i] = 1-colors[4*i+3]; } mtrl->diffuseColor.setValues(0, numPoints, (float(*)[3])&colorsonly[0]); mtrl->transparency.setValues(0,numPoints,(float*)&alphaonly[0]); } else mtrl->diffuseColor.setValues(0, numPoints, (float(*)[3])colors); mtrl->setOverride(true); pparent->addChild(mtrl); if( bhasalpha ) { SoTransparencyType* ptype = new SoTransparencyType(); // SORTED_OBJECT_SORTED_TRIANGLE_BLEND fails to render points correctly if each have a different transparency value ptype->value = SoGLRenderAction::SORTED_OBJECT_BLEND; pparent->addChild(ptype); } SoMaterialBinding* pbinding = new SoMaterialBinding(); pbinding->value = SoMaterialBinding::PER_VERTEX; pparent->addChild(pbinding); SoCoordinate3* vprop = new SoCoordinate3(); if( stride != sizeof(float)*3 ) { vector<float> mypoints(numPoints*3); for(int i = 0; i < numPoints; ++i) { mypoints[3*i+0] = ppoints[0]; mypoints[3*i+1] = ppoints[1]; mypoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } vprop->point.setValues(0,numPoints,(float(*)[3])&mypoints[0]); } else vprop->point.setValues(0,numPoints,(float(*)[3])ppoints); pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::POINTS; style->pointSize = fPointSize; pparent->addChild(style); SoPointSet* pointset = new SoPointSet(); pointset->numPoints.setValue(-1); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawspheres(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fPointSize, const RaveVector<float>& color) { if((handle == NULL)||(ppoints == NULL)||(numPoints <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); for(int i = 0; i < numPoints; ++i) { SoSeparator* psep = new SoSeparator(); SoTransform* ptrans = new SoTransform(); ptrans->translation.setValue(ppoints[0], ppoints[1], ppoints[2]); psep->addChild(ptrans); pparent->addChild(psep); _SetMaterial(psep,color); SoSphere* c = new SoSphere(); c->radius = fPointSize; psep->addChild(c); ppoints = (float*)((char*)ppoints + stride); } _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawspheres(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fPointSize, const float* colors, bool bhasalpha) { if((handle == NULL)||(ppoints == NULL)||(numPoints <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); int colorstride = bhasalpha ? 4 : 3; for(int i = 0; i < numPoints; ++i) { SoSeparator* psep = new SoSeparator(); SoTransform* ptrans = new SoTransform(); ptrans->translation.setValue(ppoints[0], ppoints[1], ppoints[2]); psep->addChild(ptrans); pparent->addChild(psep); // set a diffuse color SoMaterial* mtrl = new SoMaterial; mtrl->diffuseColor = SbColor(colors[colorstride*i +0], colors[colorstride*i +1], colors[colorstride*i +2]); mtrl->ambientColor = SbColor(0,0,0); if( bhasalpha ) mtrl->transparency = max(0.0f,1-colors[colorstride*i+3]); mtrl->setOverride(true); psep->addChild(mtrl); if( bhasalpha &&(colors[colorstride*i+3] < 1)) { SoTransparencyType* ptype = new SoTransparencyType(); ptype->value = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND; pparent->addChild(ptype); } SoSphere* c = new SoSphere(); c->radius = fPointSize; psep->addChild(c); ppoints = (float*)((char*)ppoints + stride); } _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawlinestrip(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const RaveVector<float>& color) { if((handle == NULL)||(numPoints < 2)||(ppoints == NULL)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); _SetMaterial(pparent,color); vector<float> mypoints((numPoints-1)*6); float* next; for(int i = 0; i < numPoints-1; ++i) { next = (float*)((char*)ppoints + stride); mypoints[6*i+0] = ppoints[0]; mypoints[6*i+1] = ppoints[1]; mypoints[6*i+2] = ppoints[2]; mypoints[6*i+3] = next[0]; mypoints[6*i+4] = next[1]; mypoints[6*i+5] = next[2]; ppoints = next; } SoCoordinate3* vprop = new SoCoordinate3(); vprop->point.setValues(0,2*(numPoints-1),(float(*)[3])&mypoints[0]); pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::LINES; style->lineWidth = fwidth; pparent->addChild(style); SoLineSet* pointset = new SoLineSet(); vector<int> vinds(numPoints-1,2); pointset->numVertices.setValues(0,vinds.size(), &vinds[0]); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawlinestrip(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const float* colors) { if((handle == NULL)||(numPoints < 2)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); SoMaterial* mtrl = new SoMaterial; mtrl->setOverride(true); pparent->addChild(mtrl); SoMaterialBinding* pbinding = new SoMaterialBinding(); pbinding->value = SoMaterialBinding::PER_VERTEX; pparent->addChild(pbinding); vector<float> mypoints((numPoints-1)*6), mycolors((numPoints-1)*6); float* next; for(int i = 0; i < numPoints-1; ++i) { next = (float*)((char*)ppoints + stride); mypoints[6*i+0] = ppoints[0]; mypoints[6*i+1] = ppoints[1]; mypoints[6*i+2] = ppoints[2]; mypoints[6*i+3] = next[0]; mypoints[6*i+4] = next[1]; mypoints[6*i+5] = next[2]; mycolors[6*i+0] = colors[3*i+0]; mycolors[6*i+1] = colors[3*i+1]; mycolors[6*i+2] = colors[3*i+2]; mycolors[6*i+3] = colors[3*i+3]; mycolors[6*i+4] = colors[3*i+4]; mycolors[6*i+5] = colors[3*i+5]; ppoints = next; } mtrl->diffuseColor.setValues(0, 2*(numPoints-1), (float(*)[3])&mycolors[0]); SoCoordinate3* vprop = new SoCoordinate3(); vprop->point.setValues(0,2*(numPoints-1),(float(*)[3])&mypoints[0]); pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::LINES; style->lineWidth = fwidth; pparent->addChild(style); SoLineSet* pointset = new SoLineSet(); vector<int> vinds(numPoints-1,2); pointset->numVertices.setValues(0,vinds.size(), &vinds[0]); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawlinelist(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const RaveVector<float>& color) { if((handle == NULL)||(numPoints < 2)||(ppoints == NULL)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); _SetMaterial(pparent,color); vector<float> mypoints(numPoints*3); for(int i = 0; i < numPoints; ++i) { mypoints[3*i+0] = ppoints[0]; mypoints[3*i+1] = ppoints[1]; mypoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } SoCoordinate3* vprop = new SoCoordinate3(); vprop->point.setValues(0,numPoints,(float(*)[3])&mypoints[0]); pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::LINES; style->lineWidth = fwidth; pparent->addChild(style); SoLineSet* pointset = new SoLineSet(); vector<int> vinds(numPoints/2,2); pointset->numVertices.setValues(0,vinds.size(), &vinds[0]); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawlinelist(SoSwitch* handle, const float* ppoints, int numPoints, int stride, float fwidth, const float* colors) { if((handle == NULL)||(numPoints < 2)||(ppoints == NULL)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); boost::multi_array<float,2> vcolors; vcolors.resize(boost::extents[numPoints][3]); for(int i = 0; i < numPoints; ++i) { vcolors[i][0] = colors[3*i+0]; vcolors[i][1] = colors[3*i+1]; vcolors[i][2] = colors[3*i+2]; } _SetMaterial(pparent,vcolors); vector<float> mypoints(numPoints*3); for(int i = 0; i < numPoints; ++i) { mypoints[3*i+0] = ppoints[0]; mypoints[3*i+1] = ppoints[1]; mypoints[3*i+2] = ppoints[2]; ppoints = (float*)((char*)ppoints + stride); } SoCoordinate3* vprop = new SoCoordinate3(); vprop->point.setValues(0,numPoints,(float(*)[3])&mypoints[0]); pparent->addChild(vprop); SoDrawStyle* style = new SoDrawStyle(); style->style = SoDrawStyle::LINES; style->lineWidth = fwidth; pparent->addChild(style); SoLineSet* pointset = new SoLineSet(); vector<int> vinds(numPoints/2,2); pointset->numVertices.setValues(0,vinds.size(), &vinds[0]); pparent->addChild(pointset); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawarrow(SoSwitch* handle, const RaveVector<float>& p1, const RaveVector<float>& p2, float fwidth, const RaveVector<float>& color) { if( handle == NULL ) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); SoSeparator* psep = new SoSeparator(); SoTransform* ptrans = new SoTransform(); SoDrawStyle* _style = new SoDrawStyle(); _style->style = SoDrawStyle::FILLED; pparent->addChild(_style); RaveVector<float> direction = p2-p1; float fheight = RaveSqrt(direction.lengthsqr3()); float coneheight = fheight/10.0f; direction.normalize3(); //check to make sure points aren't the same if(RaveSqrt(direction.lengthsqr3()) < 0.9f) { RAVELOG_WARN("QtCoinViewer::drawarrow - Error: End points are the same.\n"); return handle; } //rotate to face point RaveVector<float> qrot = quatRotateDirection(RaveVector<dReal>(0,1,0),RaveVector<dReal>(direction)); RaveVector<float> vaxis = axisAngleFromQuat(qrot); dReal angle = RaveSqrt(vaxis.lengthsqr3()); if( angle > 0 ) { vaxis *= 1/angle; } else { vaxis = RaveVector<float>(1,0,0); } ptrans->rotation.setValue(SbVec3f(vaxis.x, vaxis.y, vaxis.z), angle); //reusing direction vector for efficieny RaveVector<float> linetranslation = p1 + (fheight/2.0f-coneheight/2.0f)*direction; ptrans->translation.setValue(linetranslation.x, linetranslation.y, linetranslation.z); psep->addChild(ptrans); pparent->addChild(psep); // set a diffuse color _SetMaterial(pparent, color); SoCylinder* c = new SoCylinder(); c->radius = fwidth; c->height = fheight-coneheight; psep->addChild(c); //place a cone for the arrow tip SoCone* cn = new SoCone(); cn->bottomRadius = fwidth; cn->height = coneheight; ptrans = new SoTransform(); ptrans->rotation.setValue(SbVec3f(vaxis.x, vaxis.y, vaxis.z), angle); linetranslation = p2 - coneheight/2.0f*direction; ptrans->translation.setValue(linetranslation.x, linetranslation.y, linetranslation.z); psep = new SoSeparator(); psep->addChild(ptrans); psep->addChild(cn); pparent->addChild(psep); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawbox(SoSwitch* handle, const RaveVector<float>& vpos, const RaveVector<float>& vextents) { if( handle == NULL ) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); RAVELOG_ERROR("drawbox not implemented\n"); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawplane(SoSwitch* handle, const RaveTransform<float>& tplane, const RaveVector<float>& vextents, const boost::multi_array<float,3>& vtexture) { if( handle == NULL ) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); RaveTransformMatrix<float> m(tplane); Vector vright(m.m[0],m.m[4],m.m[8]),vup(m.m[1],m.m[5],m.m[9]),vdir(m.m[2],m.m[6],m.m[10]); SoTextureCombine* pcombine = new SoTextureCombine(); pcombine->rgbSource = SoTextureCombine::TEXTURE; pcombine->rgbOperation = SoTextureCombine::REPLACE; if( vtexture.shape()[2] == 4 ) { SoTransparencyType* ptype = new SoTransparencyType(); ptype->value = SoGLRenderAction::SORTED_OBJECT_BLEND; pparent->addChild(ptype); pcombine->alphaSource = SoTextureCombine::TEXTURE; pcombine->alphaOperation = SoTextureCombine::REPLACE; } pparent->addChild(pcombine); // the texture image SoTexture2 *tex = new SoTexture2; vector<unsigned char> vimagedata(vtexture.shape()[0]*vtexture.shape()[1]*vtexture.shape()[2]); if( vimagedata.size() > 0 ) { vector<unsigned char>::iterator itdst = vimagedata.begin(); FOREACHC(ith,vtexture) { FOREACHC(itw,*ith) { FOREACHC(itp,*itw) { *itdst++ = (unsigned char)(255.0f*CLAMP_ON_RANGE(*itp,0.0f,1.0f)); } } } tex->image.setValue(SbVec2s(vtexture.shape()[1],vtexture.shape()[0]),vtexture.shape()[2],&vimagedata[0]); } tex->model = SoTexture2::REPLACE; // new features, but supports grayscale images tex->wrapS = SoTexture2::CLAMP; tex->wrapT = SoTexture2::CLAMP; pparent->addChild(tex); boost::array<RaveVector<float>, 4> vplanepoints = { { m.trans-vextents[0]*vright-vextents[1]*vup, m.trans-vextents[0]*vright+vextents[1]*vup, m.trans+vextents[0]*vright-vextents[1]*vup, m.trans+vextents[0]*vright+vextents[1]*vup}}; boost::array<float,8> texpoints = { { 0,0,0,1,1,0,1,1}}; boost::array<int,6> indices = { { 0,1,2,1,2,3}}; boost::array<float,18> vtripoints; boost::array<float,12> vtexpoints; /// points of plane for(int i = 0; i < 6; ++i) { RaveVector<float> v = vplanepoints[indices[i]]; vtripoints[3*i+0] = v[0]; vtripoints[3*i+1] = v[1]; vtripoints[3*i+2] = v[2]; vtexpoints[2*i+0] = texpoints[2*indices[i]+0]; vtexpoints[2*i+1] = texpoints[2*indices[i]+1]; } SoCoordinate3* vprop = new SoCoordinate3(); vprop->point.setValues(0,6,(float(*)[3])&vtripoints[0]); pparent->addChild(vprop); SoTextureCoordinate2* tprop = new SoTextureCoordinate2(); tprop->point.setValues(0,6,(float(*)[2])&vtexpoints[0]); pparent->addChild(tprop); SoFaceSet* faceset = new SoFaceSet(); faceset->numVertices.set1Value(0,3); faceset->numVertices.set1Value(1,3); //faceset->generateDefaultNormals(SoShape, SoNormalCache); pparent->addChild(faceset); _pFigureRoot->addChild(handle); return handle; } void QtCoinViewer::_SetMaterial(SoGroup* pparent, const RaveVector<float>& color) { SoMaterial* mtrl = new SoMaterial; mtrl->diffuseColor = SbColor(color.x, color.y, color.z); mtrl->ambientColor = SbColor(0,0,0); mtrl->transparency = max(0.0f,1-color.w); mtrl->setOverride(true); pparent->addChild(mtrl); SoMaterialBinding* pbinding = new SoMaterialBinding(); pbinding->value = SoMaterialBinding::OVERALL; pparent->addChild(pbinding); if( color.w < 1.0f ) { SoTransparencyType* ptype = new SoTransparencyType(); ptype->value = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND; pparent->addChild(ptype); } } void QtCoinViewer::_SetMaterial(SoGroup* pparent, const boost::multi_array<float,2>& colors) { if( colors.size() == 0 ) return; SoMaterial* mtrl = new SoMaterial; mtrl->ambientColor = SbColor(0,0,0); vector<float> vcolors(colors.shape()[0]*3); switch(colors.shape()[1]) { case 1: for(size_t i = 0; i < colors.shape()[0]; ++i) { vcolors[3*i+0] = colors[i][0]; vcolors[3*i+1] = colors[i][0]; vcolors[3*i+2] = colors[i][0]; } break; case 4: for(size_t i = 0; i < colors.shape()[0]; ++i) vcolors[i] = 1.0f-colors[i][3]; mtrl->transparency.setValues(0,colors.shape()[0],&vcolors[0]); case 3: for(size_t i = 0; i < colors.shape()[0]; ++i) { vcolors[3*i+0] = colors[i][0]; vcolors[3*i+1] = colors[i][1]; vcolors[3*i+2] = colors[i][2]; } break; default: RAVELOG_WARN(str(boost::format("unsupported color dimension %d\n")%colors.shape()[1])); return; } mtrl->diffuseColor.setValues(0, colors.shape()[0], (float(*)[3])&vcolors[0]); mtrl->setOverride(true); pparent->addChild(mtrl); SoMaterialBinding* pbinding = new SoMaterialBinding(); pbinding->value = SoMaterialBinding::PER_VERTEX; pparent->addChild(pbinding); if( colors.shape()[1] == 4 ) { SoTransparencyType* ptype = new SoTransparencyType(); ptype->value = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND; pparent->addChild(ptype); } } void QtCoinViewer::_SetTriangleMesh(SoSeparator* pparent, const float* ppoints, int stride, const int* pIndices, int numTriangles) { SoCoordinate3* vprop = new SoCoordinate3(); if( pIndices != NULL ) { // this makes it crash! //vprop->point.set1Value(3*numTriangles-1,SbVec3f(0,0,0)); // resize for(int i = 0; i < 3*numTriangles; ++i) { float* p = (float*)((char*)ppoints + stride * pIndices[i]); vprop->point.set1Value(i, SbVec3f(p[0], p[1], p[2])); } } else { if( stride != sizeof(float)*3 ) { // this makes it crash! //vprop->point.set1Value(3*numTriangles-1,SbVec3f(0,0,0)); // resize for(int i = 0; i < 3*numTriangles; ++i) { vprop->point.set1Value(i, SbVec3f(ppoints[0], ppoints[1], ppoints[2])); ppoints = (float*)((char*)ppoints + stride); } } else { vprop->point.setValues(0,numTriangles*3,(float(*)[3])ppoints); } } pparent->addChild(vprop); SoFaceSet* faceset = new SoFaceSet(); // this makes it crash! //faceset->numVertices.set1Value(numTriangles-1,3); for(int i = 0; i < numTriangles; ++i) { faceset->numVertices.set1Value(i,3); } //faceset->generateDefaultNormals(SoShape, SoNormalCache); pparent->addChild(faceset); } void* QtCoinViewer::_drawtrimesh(SoSwitch* handle, const float* ppoints, int stride, const int* pIndices, int numTriangles, const RaveVector<float>& color) { if((handle == NULL)||(ppoints == NULL)||(numTriangles <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); _SetMaterial(pparent,color); _SetTriangleMesh(pparent, ppoints,stride,pIndices,numTriangles); _pFigureRoot->addChild(handle); return handle; } void* QtCoinViewer::_drawtrimesh(SoSwitch* handle, const float* ppoints, int stride, const int* pIndices, int numTriangles, const boost::multi_array<float,2>& colors) { if((handle == NULL)||(ppoints == NULL)||(numTriangles <= 0)) { return handle; } SoSeparator* pparent = new SoSeparator(); handle->addChild(pparent); pparent->addChild(new SoTransform()); _SetMaterial(pparent, colors); _SetTriangleMesh(pparent, ppoints,stride,pIndices,numTriangles); _pFigureRoot->addChild(handle); return handle; } #define ADD_MENU(name, checkable, shortcut, tip, fn) { \ pact = new QAction(tr(name), this); \ if( checkable ) pact->setCheckable(checkable); \ if( shortcut != NULL ) pact->setShortcut(tr(shortcut)); \ if( tip != NULL ) pact->setStatusTip(tr(tip)); \ if( checkable ) \ connect(pact, SIGNAL(triggered(bool)), this, SLOT(fn(bool))); \ else \ connect(pact, SIGNAL(triggered()), this, SLOT(fn())); \ pcurmenu->addAction(pact); \ if( pgroup != NULL ) pgroup->addAction(pact); \ } void QtCoinViewer::SetupMenus() { #if QT_VERSION >= 0x040000 // check for qt4 QMenu* pcurmenu; QAction* pact; QActionGroup* pgroup = NULL; pcurmenu = menuBar()->addMenu(tr("&File")); ADD_MENU("Load Environment...", false, NULL, NULL, LoadEnvironment); ADD_MENU("Import Environment...", false, NULL, NULL, ImportEnvironment); ADD_MENU("Save Environment...", false, NULL, NULL, SaveEnvironment); pcurmenu->addSeparator(); ADD_MENU("&Quit", false, NULL, NULL, Quit); pcurmenu = menuBar()->addMenu(tr("&View")); ADD_MENU("View Camera Params", false, NULL, NULL, ViewCameraParams); QMenu* psubmenu = pcurmenu->addMenu(tr("&Geometry")); pgroup = new QActionGroup(this); { pact = new QAction(tr("Render Only"), this); pact->setCheckable(true); pact->setChecked(_viewGeometryMode==VG_RenderOnly); pact->setData(VG_RenderOnly); psubmenu->addAction(pact); pgroup->addAction(pact); } { pact = new QAction(tr("Collision Only"), this); pact->setCheckable(true); pact->setChecked(_viewGeometryMode==VG_CollisionOnly); pact->setData(VG_CollisionOnly); psubmenu->addAction(pact); pgroup->addAction(pact); } { pact = new QAction(tr("Render/Collision"), this); pact->setCheckable(true); pact->setChecked(_viewGeometryMode==VG_RenderCollision); pact->setData(VG_RenderCollision); psubmenu->addAction(pact); pgroup->addAction(pact); } connect( pgroup, SIGNAL(triggered(QAction*)), this, SLOT(ViewGeometryChanged(QAction*)) ); pgroup = NULL; // add debug levels psubmenu = pcurmenu->addMenu(tr("&Debug Levels")); _pToggleDebug = new QActionGroup(this); { pact = new QAction(tr("Fatal"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Fatal); pact->setData(Level_Fatal); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } { pact = new QAction(tr("Error"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Error); pact->setData(Level_Error); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } { pact = new QAction(tr("Warn"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Warn); pact->setData(Level_Warn); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } { pact = new QAction(tr("Info"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Info); pact->setData(Level_Info); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } { pact = new QAction(tr("Debug"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Debug); pact->setData(Level_Debug); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } { pact = new QAction(tr("Verbose"), this); pact->setCheckable(true); pact->setChecked((RaveGetDebugLevel()&Level_OutputMask)==Level_Verbose); pact->setData(Level_Verbose); psubmenu->addAction(pact); _pToggleDebug->addAction(pact); } connect( _pToggleDebug, SIGNAL(triggered(QAction*)), this, SLOT(ViewDebugLevelChanged(QAction*)) ); ADD_MENU("Show Framerate", true, NULL, "Toggle showing the framerate", ViewToggleFPS); ADD_MENU("Show World Axes", true, NULL, "Toggle showing the axis cross", ViewToggleFeedBack); pcurmenu = menuBar()->addMenu(tr("&Options")); ADD_MENU("&Record Real-time Video", true, NULL, "Start recording an AVI in real clock time. Clicking this menu item again will pause the recording", RecordRealtimeVideo); ADD_MENU("R&ecord Sim-time Video", true, NULL, "Start recording an AVI in simulation time. Clicking this menu item again will pause the recording", RecordSimtimeVideo); { psubmenu = pcurmenu->addMenu(tr("Video &Codecs")); QActionGroup* pVideoCodecs = new QActionGroup(this); ModuleBasePtr pvideocodecs = RaveCreateModule(GetEnv(),"viewerrecorder"); stringstream scodecs, sin; if( !!pvideocodecs ) { sin << "GetCodecs"; if (pvideocodecs->SendCommand(scodecs,sin) ) { pact = new QAction(tr("Default (mpeg4)"), this); pact->setCheckable(true); pact->setChecked(true); pact->setData((int)-1); psubmenu->addAction(pact); pVideoCodecs->addAction(pact); string mime_type, name; while(!scodecs.eof()) { int index = -1; scodecs >> index >> mime_type; if( !scodecs ) { break; } getline(scodecs,name); boost::trim(name); pact = new QAction(tr(name.c_str()), this); pact->setCheckable(true); pact->setChecked(false); pact->setData(index); psubmenu->addAction(pact); pVideoCodecs->addAction(pact); } connect(pVideoCodecs, SIGNAL(triggered(QAction*)), this, SLOT(VideoCodecChanged(QAction*)) ); } } } ADD_MENU("&Simulation", true, NULL, "Control environment simulation loop", ToggleSimulation); _pToggleSimulation = pact; std::map<InterfaceType, std::vector<std::string> > interfacenames; RaveGetLoadedInterfaces(interfacenames); psubmenu = pcurmenu->addMenu(tr("&Collision Checkers")); _pSelectedCollisionChecker = new QActionGroup(this); { pact = new QAction(tr("[None]"), this); pact->setCheckable(true); pact->setChecked(false); psubmenu->addAction(pact); _pSelectedCollisionChecker->addAction(pact); } FOREACH(itname,interfacenames[PT_CollisionChecker]) { pact = new QAction(tr(itname->c_str()), this); pact->setCheckable(true); pact->setChecked(false); psubmenu->addAction(pact); _pSelectedCollisionChecker->addAction(pact); } connect( _pSelectedCollisionChecker, SIGNAL(triggered(QAction*)), this, SLOT(CollisionCheckerChanged(QAction*)) ); psubmenu = pcurmenu->addMenu(tr("&Physics Engines")); _pSelectedPhysicsEngine = new QActionGroup(this); { pact = new QAction(tr("[None]"), this); pact->setCheckable(true); pact->setChecked(false); psubmenu->addAction(pact); _pSelectedPhysicsEngine->addAction(pact); } FOREACH(itname,interfacenames[PT_PhysicsEngine]) { pact = new QAction(tr(itname->c_str()), this); pact->setCheckable(true); pact->setChecked(false); psubmenu->addAction(pact); _pSelectedPhysicsEngine->addAction(pact); } connect( _pSelectedPhysicsEngine, SIGNAL(triggered(QAction*)), this, SLOT(PhysicsEngineChanged(QAction*)) ); pcurmenu = menuBar()->addMenu(tr("&Interfaces")); connect(pcurmenu, SIGNAL(aboutToShow()), this, SLOT(UpdateInterfaces())); _pMenuSendCommand = pcurmenu->addMenu(tr("&Send Command")); _pActionSendCommand = new QActionGroup(this); connect( _pActionSendCommand, SIGNAL(triggered(QAction*)), this, SLOT(InterfaceSendCommand(QAction*)) ); psubmenu = pcurmenu->addMenu(tr("&Physics")); { pact = new QAction(tr("Self Collision"), this); pact->setCheckable(true); connect(pact, SIGNAL(triggered(bool)), this, SLOT(DynamicSelfCollision(bool))); psubmenu->addAction(pact); _pToggleSelfCollision = pact; } { pact = new QAction(tr("Set Gravity to -Z"), this); connect(pact, SIGNAL(triggered(bool)), this, SLOT(DynamicGravity())); psubmenu->addAction(pact); } pcurmenu = menuBar()->addMenu(tr("&Help")); ADD_MENU("About", false, NULL, NULL, About); #endif } void QtCoinViewer::customEvent(QEvent * e) { if (e->type() == CALLBACK_EVENT) { MyCallbackEvent* pe = dynamic_cast<MyCallbackEvent*>(e); if( !pe ) { RAVELOG_WARN("got a qt message that isn't of MyCallbackEvent, converting statically (dangerous)\n"); pe = static_cast<MyCallbackEvent*>(e); } pe->_fn(); e->setAccepted(true); } } bool QtCoinViewer::_StartViewerLoopCommand(ostream& sout, istream& sinput) { bool bcallmain = false; sinput >> bcallmain; _nQuitMainLoop = -1; _StartPlaybackTimer(); _pviewer->show(); if( bcallmain ) { // calls the main GUI loop SoQt::mainLoop(); } return true; } bool QtCoinViewer::_ShowCommand(ostream& sout, istream& sinput) { int showtype=1; sinput >> showtype; if( showtype ) { _pviewer->show(); } else { _pviewer->hide(); } return true; } bool QtCoinViewer::_TrackLinkCommand(ostream& sout, istream& sinput) { bool bresetvelocity = true; std::string bodyname, linkname; sinput >> bodyname >> linkname >> _fTrackingRadius >> bresetvelocity; _ptrackinglink.reset(); _ptrackingmanip.reset(); EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); KinBodyPtr pbody = GetEnv()->GetKinBody(bodyname); if( !pbody ) { return false; } _ptrackinglink = pbody->GetLink(linkname); if( bresetvelocity ) { _tTrackingCameraVelocity.trans = _tTrackingCameraVelocity.rot = Vector(); // reset velocity? } return !!_ptrackinglink; } bool QtCoinViewer::_TrackManipulatorCommand(ostream& sout, istream& sinput) { bool bresetvelocity = true; std::string robotname, manipname; sinput >> robotname >> manipname >> _fTrackingRadius >> bresetvelocity; _ptrackinglink.reset(); _ptrackingmanip.reset(); EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); RobotBasePtr probot = GetEnv()->GetRobot(robotname); if( !probot ) { return false; } _ptrackingmanip = probot->GetManipulator(manipname); if( bresetvelocity ) { _tTrackingCameraVelocity.trans = _tTrackingCameraVelocity.rot = Vector(); // reset velocity? } return !!_ptrackingmanip; } bool QtCoinViewer::_SetTrackingAngleToUpCommand(ostream& sout, istream& sinput) { sinput >> _fTrackAngleToUp; return true; } int QtCoinViewer::main(bool bShow) { _nQuitMainLoop = -1; _StartPlaybackTimer(); // need the _nQuitMainLoop in case _pviewer->show() exits after a quitmainloop is called if( bShow ) { if( _nQuitMainLoop < 0 ) { _pviewer->show(); } //SoQt::show(this); } if( _nQuitMainLoop < 0 ) { SoQt::mainLoop(); } SetEnvironmentSync(false); return 0; } void QtCoinViewer::quitmainloop() { _nQuitMainLoop = 1; bool bGuiThread = QThread::currentThread() == QCoreApplication::instance()->thread(); if( !bGuiThread ) { SetEnvironmentSync(false); } SoQt::exitMainLoop(); _nQuitMainLoop = 2; } void QtCoinViewer::InitOffscreenRenderer() { _ivOffscreen.setComponents(SoOffscreenRenderer::RGB); _bCanRenderOffscreen = true; } void QtCoinViewer::DumpIvRoot(const char *filename, bool bBinaryFile ) { SoOutput outfile; if (!outfile.openFile(filename)) { std::cerr << "could not open the file: " << filename << endl; return; } if (bBinaryFile) outfile.setBinary(true); // useful for debugging hierarchy SoWriteAction writeAction(&outfile); writeAction.apply(_ivRoot); outfile.closeFile(); } void QtCoinViewer::_SelectHandler(void * userData, class SoPath * path) { ((QtCoinViewer*)userData)->_HandleSelection(path); } void QtCoinViewer::_DeselectHandler(void * userData, class SoPath * path) { ((QtCoinViewer*)userData)->_HandleDeselection(path->getTail()); } bool QtCoinViewer::_HandleSelection(SoPath *path) { ItemPtr pItem; float scale = 1.0; bool bAllowRotation = true; // search the robots KinBody::JointPtr pjoint; bool bIK = false; // for loop necessary for 3D models that include files SoNode* node = NULL; for(int i = path->getLength()-1; i >= 0; --i) { node = path->getNode(i); // search the environment FOREACH(it, _mapbodies) { BOOST_ASSERT( !!it->second ); if (it->second->ContainsIvNode(node)) { pItem = it->second; break; } } if( !!pItem ) break; } if (!pItem) { _ivRoot->deselectAll(); return false; } KinBodyItemPtr pKinBody = boost::dynamic_pointer_cast<KinBodyItem>(pItem); KinBody::LinkPtr pSelectedLink; if( !!pKinBody ) { pSelectedLink = pKinBody->GetLinkFromIv(node); } bool bProceedSelection = true; // check the callbacks if( !!pSelectedLink ) { boost::mutex::scoped_lock lock(_mutexCallbacks); FOREACH(it,_listRegisteredItemSelectionCallbacks) { bool bSame; { boost::mutex::scoped_lock lock(_mutexMessages); bSame = !_pMouseOverLink.expired() && KinBody::LinkPtr(_pMouseOverLink) == pSelectedLink; } if( bSame ) { ItemSelectionCallbackDataPtr pdata = boost::dynamic_pointer_cast<ItemSelectionCallbackData>(it->lock()); if( !!pdata ) { if( pdata->_callback(pSelectedLink,_vMouseSurfacePosition,_vMouseRayDirection) ) { bProceedSelection = false; } } } } } if( !bProceedSelection ) { _ivRoot->deselectAll(); return false; } boost::shared_ptr<EnvironmentMutex::scoped_try_lock> lockenv = LockEnvironment(100000); if( !lockenv ) { _ivRoot->deselectAll(); RAVELOG_WARN("failed to grab environment lock\n"); return false; } if( ControlDown() ) { if( !!pSelectedLink ) { // search the joint nodes FOREACHC(itjoint, pKinBody->GetBody()->GetJoints()) { if( (((*itjoint)->GetFirstAttached()==pSelectedLink)||((*itjoint)->GetSecondAttached()==pSelectedLink)) ) { if( !(*itjoint)->IsStatic() ) { // joint has a range, so consider it for selection if( pKinBody->GetBody()->DoesAffect((*itjoint)->GetJointIndex(), pSelectedLink->GetIndex()) ) pjoint = *itjoint; } else { KinBody::LinkPtr pother; if( (*itjoint)->GetFirstAttached()==pSelectedLink ) pother = (*itjoint)->GetSecondAttached(); else if( (*itjoint)->GetSecondAttached()==pSelectedLink ) pother = (*itjoint)->GetFirstAttached(); if( !!pother ) { FOREACHC(itjoint2, pKinBody->GetBody()->GetJoints()) { if( !(*itjoint2)->IsStatic() && pKinBody->GetBody()->DoesAffect((*itjoint2)->GetJointIndex(), pother->GetIndex()) && (((*itjoint2)->GetFirstAttached()==pother)||((*itjoint2)->GetSecondAttached()==pother)) ) { pjoint = *itjoint2; break; } } } } if( !!pjoint ) break; } } if( !pjoint ) { std::vector<int> vmimicdofs; FOREACHC(itjoint, pKinBody->GetBody()->GetPassiveJoints()) { if( (*itjoint)->IsMimic() ) { for(int idof = 0; idof < (*itjoint)->GetDOF(); ++idof) { if( (*itjoint)->IsMimic(idof) ) { (*itjoint)->GetMimicDOFIndices(vmimicdofs,idof); FOREACHC(itmimicdof, vmimicdofs) { KinBody::JointPtr ptempjoint = pKinBody->GetBody()->GetJointFromDOFIndex(*itmimicdof); if( !ptempjoint->IsStatic() && pKinBody->GetBody()->DoesAffect(ptempjoint->GetJointIndex(), pSelectedLink->GetIndex()) && (((*itjoint)->GetFirstAttached()==pSelectedLink)||((*itjoint)->GetSecondAttached()==pSelectedLink)) ) { pjoint = ptempjoint; break; } } if( !!pjoint ) { break; } } } } else { KinBody::LinkPtr pother; if( (*itjoint)->GetFirstAttached()==pSelectedLink ) { pother = (*itjoint)->GetSecondAttached(); } else if( (*itjoint)->GetSecondAttached()==pSelectedLink ) { pother = (*itjoint)->GetFirstAttached(); } if( !!pother ) { FOREACHC(itjoint2, pKinBody->GetBody()->GetJoints()) { if( !(*itjoint2)->IsStatic() && pKinBody->GetBody()->DoesAffect((*itjoint2)->GetJointIndex(), pother->GetIndex()) && (((*itjoint2)->GetFirstAttached()==pother)||((*itjoint2)->GetSecondAttached()==pother)) ) { pjoint = *itjoint2; break; } } } if( !!pjoint ) { break; } } } } if( !pjoint ) { return false; } } } // construct an appropriate _pdragger if (!!pjoint) { _pdragger.reset(new IvJointDragger(shared_viewer(), pItem, pSelectedLink->GetIndex(), scale, pjoint->GetJointIndex(), _bJointHilit)); } else if (!bIK) { _pdragger.reset(new IvObjectDragger(shared_viewer(), pItem, scale, bAllowRotation)); } else { //_pdragger = new IvIKDragger(this, pItem, scale, bAxis); } _pdragger->CheckCollision(true); pItem->SetGrab(true); BOOST_ASSERT(!_pSelectedItem); _pSelectedItem = pItem; // record the initially selected transform _initSelectionTrans = GetRaveTransform(pItem->GetIvTransform()); return true; } void QtCoinViewer::_deselect() { _pdragger.reset(); _plistdraggers.clear(); if( !!_pSelectedItem ) { _pSelectedItem->SetGrab(false); _pSelectedItem.reset(); _ivRoot->deselectAll(); } } boost::shared_ptr<EnvironmentMutex::scoped_try_lock> QtCoinViewer::LockEnvironment(uint64_t timeout,bool bUpdateEnvironment) { // try to acquire the lock #if BOOST_VERSION >= 103500 boost::shared_ptr<EnvironmentMutex::scoped_try_lock> lockenv(new EnvironmentMutex::scoped_try_lock(GetEnv()->GetMutex(),boost::defer_lock_t())); #else boost::shared_ptr<EnvironmentMutex::scoped_try_lock> lockenv(new EnvironmentMutex::scoped_try_lock(GetEnv()->GetMutex(),false)); #endif uint64_t basetime = utils::GetMicroTime(); while(utils::GetMicroTime()-basetime<timeout ) { if( lockenv->try_lock() ) { break; } if( bUpdateEnvironment ) { _UpdateEnvironment(0); } } if( !*lockenv ) { lockenv.reset(); } return lockenv; } bool QtCoinViewer::_HandleDeselection(SoNode *node) { _pdragger.reset(); _plistdraggers.clear(); if( !!_pSelectedItem ) { _pSelectedItem->SetGrab(false); _pSelectedItem.reset(); } return true; } // Keyboard callback handler void QtCoinViewer::_KeyHandler(void * userData, class SoEventCallback * eventCB) { QtCoinViewer* viewer = (QtCoinViewer*) userData; const SoEvent *event = eventCB->getEvent(); if (SO_KEY_PRESS_EVENT(event, LEFT_ALT) ) viewer->_altDown[0] = true; else if (SO_KEY_RELEASE_EVENT(event, LEFT_ALT) ) viewer->_altDown[0] = false; if(SO_KEY_PRESS_EVENT(event, RIGHT_ALT)) viewer->_altDown[1] = true; else if(SO_KEY_RELEASE_EVENT(event, RIGHT_ALT)) viewer->_altDown[1] = false; if (SO_KEY_PRESS_EVENT(event, LEFT_CONTROL) ) { viewer->_ctrlDown[0] = true; } else if (SO_KEY_RELEASE_EVENT(event, LEFT_CONTROL) ) { viewer->_ctrlDown[0] = false; } if( SO_KEY_PRESS_EVENT(event, RIGHT_CONTROL)) { viewer->_ctrlDown[1] = true; } else if( SO_KEY_RELEASE_EVENT(event, RIGHT_CONTROL)) { viewer->_ctrlDown[1] = false; } } void QtCoinViewer::GlobAdvanceFrame(void* p, SoSensor*) { BOOST_ASSERT( p != NULL ); ((QtCoinViewer*)p)->AdvanceFrame(true); } void QtCoinViewer::AdvanceFrame(bool bForward) { // frame counting static int nToNextFPSUpdate = 1; static int UPDATE_FRAMES = 16; static uint32_t basetime = utils::GetMilliTime(); static uint32_t nFrame = 0; static float fFPS = 0; // { // _bInIdleThread = true; // boost::mutex::scoped_lock lock(_mutexGUI); // _bInIdleThread = false; // } if( --nToNextFPSUpdate <= 0 ) { uint32_t newtime = utils::GetMilliTime(); fFPS = UPDATE_FRAMES * 1000.0f / (float)max((int)(newtime-basetime),1); basetime = newtime; if( fFPS < 16 ) { UPDATE_FRAMES = 4; } else if( fFPS < 32 ) { UPDATE_FRAMES = 8; } else { UPDATE_FRAMES = 16; } nToNextFPSUpdate = UPDATE_FRAMES; } if( (nFrame++%16) == 0 ) { stringstream ss; if( _bDisplayFPS ) { ss << "fps: " << fixed << setprecision(2) << fFPS << ", simulation time: " << setprecision(4) << GetEnv()->GetSimulationTime()*1e-6 << "s" << endl; } if( !_pviewer->isViewing() ) { boost::mutex::scoped_lock lock(_mutexMessages); ss << _strMouseMove; } if( !!_pdragger ) { _pdragger->GetMessage(ss); } // adjust the shadow text SbViewportRegion v = _pviewer->getViewportRegion(); float fwratio = 964.0f/v.getWindowSize()[0], fhratio = 688.0f/v.getWindowSize()[1]; _messageShadowTranslation->translation.setValue(SbVec3f(-0.002f*fwratio,0.032f*fhratio,0)); // search for all new lines string msg = ss.str(); for(size_t i = 0; i < _messageNodes.size(); ++i) { _messageNodes[i]->string.setValue(""); } int index = 0; std::string::size_type pos = 0, newpos=0; while( pos < msg.size() ) { newpos = msg.find('\n', pos); std::string::size_type n = newpos == std::string::npos ? msg.size()-pos : (newpos-pos); for(size_t i = 0; i < _messageNodes.size(); ++i) { _messageNodes[i]->string.set1Value(index++, msg.substr(pos, n).c_str()); } if( newpos == std::string::npos ) { break; } pos = newpos+1; } } if( !!_pToggleDebug ) { _pToggleDebug->actions().at(RaveGetDebugLevel()&Level_OutputMask)->setChecked(true); } _UpdateToggleSimulation(); _UpdateCollisionChecker(); _UpdatePhysicsEngine(); _UpdateEnvironment(TIMER_SENSOR_INTERVAL); { std::list<UserDataWeakPtr> listRegisteredViewerThreadCallbacks; { boost::mutex::scoped_lock lock(_mutexCallbacks); listRegisteredViewerThreadCallbacks = _listRegisteredViewerThreadCallbacks; } FOREACH(it,listRegisteredViewerThreadCallbacks) { ViewerThreadCallbackDataPtr pdata = boost::dynamic_pointer_cast<ViewerThreadCallbackData>(it->lock()); if( !!pdata ) { try { pdata->_callback(); } catch(const std::exception& e) { RAVELOG_ERROR(str(boost::format("Viewer Thread Callback Failed with error %s")%e.what())); } } } } if( ControlDown() ) { } } void QtCoinViewer::_UpdateEnvironment(float fTimeElapsed) { boost::mutex::scoped_lock lockupd(_mutexUpdating); if( _bUpdateEnvironment ) { // process all messages list<EnvMessagePtr> listmessages; { boost::mutex::scoped_lock lockmsg(_mutexMessages); listmessages.swap(_listMessages); BOOST_ASSERT( _listMessages.size() == 0 ); } FOREACH(itmsg, listmessages) { (*itmsg)->viewerexecute(); } // have to update model after messages since it can lock the environment UpdateFromModel(); _UpdateCameraTransform(fTimeElapsed); // this causes the GUI links to jitter when moving the joints, perhaps there is fighting somewhere? // if( !!_pdragger ) { // _pdragger->UpdateSkeleton(); // } } } bool QtCoinViewer::ForceUpdatePublishedBodies() { { boost::mutex::scoped_lock lockupdating(_mutexUpdating); if( !_bUpdateEnvironment ) return false; } boost::mutex::scoped_lock lock(_mutexUpdateModels); EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); GetEnv()->UpdatePublishedBodies(); _bModelsUpdated = false; _bLockEnvironment = false; // notify UpdateFromModel to update without acquiring the lock _condUpdateModels.wait(lock); _bLockEnvironment = true; // reste return _bModelsUpdated; } void QtCoinViewer::GlobVideoFrame(void* p, SoSensor*) { BOOST_ASSERT( p != NULL ); ((QtCoinViewer*)p)->_VideoFrame(); } void QtCoinViewer::_VideoFrame() { std::list<UserDataWeakPtr> listRegisteredViewerImageCallbacks; { boost::mutex::scoped_lock lock(_mutexCallbacks); if( _listRegisteredViewerImageCallbacks.size() == 0 ) { return; } listRegisteredViewerImageCallbacks = _listRegisteredViewerImageCallbacks; } const uint8_t* memory; memory = _GetVideoFrame(); if( !memory ) { RAVELOG_WARN("cannot record video\n"); return; } FOREACH(it,listRegisteredViewerImageCallbacks) { ViewerImageCallbackDataPtr pdata = boost::dynamic_pointer_cast<ViewerImageCallbackData>(it->lock()); if( !!pdata ) { try { pdata->_callback(memory,_nRenderWidth,_nRenderHeight,3); } catch(const std::exception& e) { RAVELOG_ERROR(str(boost::format("Viewer Image Callback Failed with error %s")%e.what())); } } } } void QtCoinViewer::UpdateFromModel() { { boost::mutex::scoped_lock lock(_mutexItems); FOREACH(it,_listRemoveItems) { delete *it; } _listRemoveItems.clear(); } boost::mutex::scoped_lock lock(_mutexUpdateModels); vector<KinBody::BodyState> vecbodies; #if BOOST_VERSION >= 103500 EnvironmentMutex::scoped_try_lock lockenv(GetEnv()->GetMutex(),boost::defer_lock_t()); #else EnvironmentMutex::scoped_try_lock lockenv(GetEnv()->GetMutex(),false); #endif if( _bLockEnvironment && !lockenv ) { uint64_t basetime = utils::GetMicroTime(); while(utils::GetMicroTime()-basetime<1000 ) { if( lockenv.try_lock() ) { // acquired the lock, so update the bodies! GetEnv()->UpdatePublishedBodies(); break; } } } try { GetEnv()->GetPublishedBodies(vecbodies,100000); // 0.1s } catch(const std::exception& ex) { RAVELOG_WARN("timeout of GetPublishedBodies\n"); return; } FOREACH(it, _mapbodies) { it->second->SetUserData(0); } FOREACH(itbody, vecbodies) { BOOST_ASSERT( !!itbody->pbody ); KinBodyPtr pbody = itbody->pbody; // try to use only as an id, don't call any methods! KinBodyItemPtr pitem = boost::dynamic_pointer_cast<KinBodyItem>(pbody->GetUserData("qtcoinviewer")); if( !!pitem ) { if( !pitem->GetBody() ) { // looks like item has been destroyed, so remove from data pbody->RemoveUserData("qtcoinviewer"); pitem.reset(); } } if( !pitem ) { // make sure pbody is actually present if( GetEnv()->GetBodyFromEnvironmentId(itbody->environmentid) == pbody ) { // check to make sure the real GUI data is also NULL if( !pbody->GetUserData("qtcoinviewer") ) { if( _mapbodies.find(pbody) != _mapbodies.end() ) { RAVELOG_WARN_FORMAT("body %s already registered!", pbody->GetName()); continue; } if( _bLockEnvironment && !lockenv ) { uint64_t basetime = utils::GetMicroTime(); while(utils::GetMicroTime()-basetime<1000 ) { if( lockenv.try_lock() ) { break; } } if( !lockenv ) { return; // couldn't acquire the lock, try next time. This prevents deadlock situations } } if( pbody->IsRobot() ) { pitem = boost::shared_ptr<RobotItem>(new RobotItem(shared_viewer(), RaveInterfaceCast<RobotBase>(pbody), _viewGeometryMode),ITEM_DELETER); } else { pitem = boost::shared_ptr<KinBodyItem>(new KinBodyItem(shared_viewer(), pbody, _viewGeometryMode),ITEM_DELETER); } if( !!_pdragger && _pdragger->GetSelectedItem() == pitem ) { _deselect(); } pitem->Load(); pbody->SetUserData("qtcoinviewer",pitem); _mapbodies[pbody] = pitem; } else { pitem = boost::dynamic_pointer_cast<KinBodyItem>(pbody->GetUserData("qtcoinviewer")); BOOST_ASSERT( _mapbodies.find(pbody) != _mapbodies.end() && _mapbodies[pbody] == pitem ); } } else { // body is gone continue; } } map<KinBodyPtr, KinBodyItemPtr>::iterator itmap = _mapbodies.find(pbody); if( itmap == _mapbodies.end() ) { //RAVELOG_VERBOSE("body %s doesn't have a map associated with it!\n", itbody->strname.c_str()); continue; } BOOST_ASSERT( pitem->GetBody() == pbody); BOOST_ASSERT( itmap->second == pitem ); pitem->SetUserData(1); pitem->UpdateFromModel(itbody->jointvalues,itbody->vectrans); } FOREACH_NOINC(it, _mapbodies) { if( !it->second->GetUserData() ) { // item doesn't exist anymore, remove it it->first->RemoveUserData("qtcoinviewer"); if( _pSelectedItem == it->second ) { _pdragger.reset(); _pSelectedItem.reset(); _ivRoot->deselectAll(); } _mapbodies.erase(it++); } else { ++it; } } _bModelsUpdated = true; _condUpdateModels.notify_all(); if( _bAutoSetCamera &&(_mapbodies.size() > 0)) { RAVELOG_DEBUG("auto-setting camera location\n"); _bAutoSetCamera = false; _pviewer->viewAll(); } } void QtCoinViewer::_Reset() { _deselect(); UpdateFromModel(); _condUpdateModels.notify_all(); FOREACH(itbody, _mapbodies) { BOOST_ASSERT( itbody->first->GetUserData("qtcoinviewer") == itbody->second ); itbody->first->RemoveUserData("qtcoinviewer"); } _mapbodies.clear(); if( !!_pvideorecorder ) { SoDB::enableRealTimeSensor(true); SoSceneManager::enableRealTimeUpdate(true); _pvideorecorder.reset(); } { boost::mutex::scoped_lock lock(_mutexItems); FOREACH(it,_listRemoveItems) { delete *it; } _listRemoveItems.clear(); } } void QtCoinViewer::_UpdateCameraTransform(float fTimeElapsed) { boost::mutex::scoped_lock lock(_mutexMessages); SbVec3f pos = GetCamera()->position.getValue(); _Tcamera.trans = RaveVector<float>(pos[0], pos[1], pos[2]); SbVec3f axis; float fangle; GetCamera()->orientation.getValue(axis, fangle); _Tcamera.rot = quatFromAxisAngle(RaveVector<float>(axis[0],axis[1],axis[2]),fangle); if( fTimeElapsed > 0 ) { // animate the camera if necessary bool bTracking=false; Transform tTrack; KinBody::LinkPtr ptrackinglink = _ptrackinglink; if( !!ptrackinglink ) { bTracking = true; tTrack = ptrackinglink->GetTransform(); tTrack.trans = ptrackinglink->ComputeAABB().pos; } RobotBase::ManipulatorPtr ptrackingmanip=_ptrackingmanip; if( !!ptrackingmanip ) { bTracking = true; tTrack = ptrackingmanip->GetTransform(); } if( bTracking ) { RaveVector<float> vup(0,0,1); // up vector that camera should always be oriented to RaveVector<float> vlookatdir = _Tcamera.trans - tTrack.trans; vlookatdir -= vup*vup.dot3(vlookatdir); float flookatlen = sqrtf(vlookatdir.lengthsqr3()); vlookatdir = vlookatdir*cosf(_fTrackAngleToUp) + flookatlen*sinf(_fTrackAngleToUp)*vup; // flookatlen shouldn't change if( flookatlen > g_fEpsilon ) { vlookatdir *= 1/flookatlen; } else { vlookatdir = Vector(1,0,0); } vup -= vlookatdir*vlookatdir.dot3(vup); vup.normalize3(); //RaveVector<float> vcameradir = ExtractAxisFromQuat(_Tcamera.rot, 2); //RaveVector<float> vToDesiredQuat = quatRotateDirection(vcameradir, vlookatdir); //RaveVector<float> vDestQuat = quatMultiply(vToDesiredQuat, _Tcamera.rot); //vDestQuat = quatMultiply(quatRotateDirection(ExtractAxisFromQuat(vDestQuat,1), vup), vDestQuat); float angle = normalizeAxisRotation(vup, _Tcamera.rot).first; RaveVector<float> vDestQuat = quatMultiply(quatFromAxisAngle(vup, -angle), quatRotateDirection(RaveVector<float>(0,1,0), vup)); //transformLookat(tTrack.trans, _Tcamera.trans, vup); RaveVector<float> vDestPos = tTrack.trans + ExtractAxisFromQuat(vDestQuat,2)*_fTrackingRadius; if(1) { // PID animation float pconst = 0.02; float dconst = 0.2; RaveVector<float> newtrans = _Tcamera.trans + fTimeElapsed*_tTrackingCameraVelocity.trans; newtrans += pconst*(vDestPos - _Tcamera.trans); // proportional term newtrans -= dconst*_tTrackingCameraVelocity.trans*fTimeElapsed; // derivative term (target is zero velocity) pconst = 0.001; dconst = 0.04; RaveVector<float> newquat = _Tcamera.rot + fTimeElapsed*_tTrackingCameraVelocity.rot; newquat += pconst*(vDestQuat - _Tcamera.rot); newquat -= dconst*_tTrackingCameraVelocity.rot*fTimeElapsed; newquat.normalize4(); // have to make sure newquat's y vector aligns with vup _tTrackingCameraVelocity.trans = (newtrans-_Tcamera.trans)*(2/fTimeElapsed) - _tTrackingCameraVelocity.trans; _tTrackingCameraVelocity.rot = (newquat-_Tcamera.rot)*(2/fTimeElapsed) - _tTrackingCameraVelocity.rot; _Tcamera.trans = newtrans; _Tcamera.rot = newquat; } else { _Tcamera.trans = vDestPos; _Tcamera.rot = vDestQuat; } GetCamera()->position.setValue(_Tcamera.trans.x, _Tcamera.trans.y, _Tcamera.trans.z); GetCamera()->orientation.setValue(_Tcamera.rot.y, _Tcamera.rot.z, _Tcamera.rot.w, _Tcamera.rot.x); } } int width = centralWidget()->size().width(); int height = centralWidget()->size().height(); _ivCamera->aspectRatio = (float)view1->size().width() / (float)view1->size().height(); _camintrinsics.fy = 0.5*height/RaveTan(0.5f*GetCamera()->heightAngle.getValue()); _camintrinsics.fx = (float)width*_camintrinsics.fy/((float)height*GetCamera()->aspectRatio.getValue()); _camintrinsics.cx = (float)width/2; _camintrinsics.cy = (float)height/2; _camintrinsics.focal_length = GetCamera()->nearDistance.getValue(); _camintrinsics.distortion_model = ""; } // menu items void QtCoinViewer::LoadEnvironment() { #if QT_VERSION >= 0x040000 // check for qt4 QString s = QFileDialog::getOpenFileName( this, "Load Environment", NULL, "Environment Files (*.xml *.dae *.zae)"); if( s.length() == 0 ) return; bool bReschedule = false; if (_timerSensor->isScheduled()) { _timerSensor->unschedule(); bReschedule = true; } _Reset(); GetEnv()->Reset(); _bAutoSetCamera = true; GetEnv()->Load(s.toAscii().data()); if( bReschedule ) { _timerSensor->schedule(); } #endif } void QtCoinViewer::ImportEnvironment() { #if QT_VERSION >= 0x040000 // check for qt4 QString s = QFileDialog::getOpenFileName( this, "Load Environment", NULL, "Environment Files (*.xml *.dae *.zae)"); if( s.length() == 0 ) return; GetEnv()->Load(s.toAscii().data()); #endif } void QtCoinViewer::SaveEnvironment() { #if QT_VERSION >= 0x040000 // check for qt4 QString s = QFileDialog::getSaveFileName( this, "Save Environment", NULL, "COLLADA Files (*.dae)"); if( s.length() == 0 ) return; GetEnv()->Save(s.toAscii().data()); #endif } void QtCoinViewer::Quit() { close(); } void QtCoinViewer::ViewCameraParams() { stringstream ss; ss << "BarrettWAM_camera"; PrintCamera(); } void QtCoinViewer::ViewGeometryChanged(QAction* pact) { _viewGeometryMode = (ViewGeometry)pact->data().toInt(); // destroy all bodies _deselect(); UpdateFromModel(); FOREACH(itbody, _mapbodies) { BOOST_ASSERT( itbody->first->GetUserData("qtcoinviewer") == itbody->second ); itbody->first->RemoveUserData("qtcoinviewer"); } _mapbodies.clear(); { boost::mutex::scoped_lock lock(_mutexItems); FOREACH(it,_listRemoveItems) { delete *it; } _listRemoveItems.clear(); } } void QtCoinViewer::ViewDebugLevelChanged(QAction* pact) { GetEnv()->SetDebugLevel((DebugLevel)pact->data().toInt()); } void QtCoinViewer::VideoCodecChanged(QAction* pact) { _videocodec = pact->data().toInt(); } void QtCoinViewer::ViewToggleFPS(bool on) { _bDisplayFPS = on; if( !_bDisplayFPS ) { for(size_t i = 0; i < _messageNodes.size(); ++i) { _messageNodes[i]->string.setValue(""); } } } void QtCoinViewer::ViewToggleFeedBack(bool on) { _bDisplayFeedBack = on; _pviewer->setFeedbackVisibility(on); if( !_bDisplayFeedBack ) { for(size_t i = 0; i < _messageNodes.size(); ++i) { _messageNodes[i]->string.setValue("Feedback Visibility OFF"); } } } void QtCoinViewer::RecordSimtimeVideo(bool on) { _RecordSetup(on,false); } void QtCoinViewer::RecordRealtimeVideo(bool on) { _RecordSetup(on,true); } void QtCoinViewer::ToggleSimulation(bool on) { boost::shared_ptr<EnvironmentMutex::scoped_try_lock> lockenv = LockEnvironment(200000); if( !!lockenv ) { if( on ) { GetEnv()->StartSimulation(0.01f); } else { GetEnv()->StopSimulation(); } lockenv.reset(); } else { RAVELOG_WARN("failed to lock environment\n"); } } void QtCoinViewer::_UpdateToggleSimulation() { if( !!_pToggleSimulation ) { _pToggleSimulation->setChecked(GetEnv()->IsSimulationRunning()); } if( !!_pToggleSelfCollision ) { PhysicsEngineBasePtr p = GetEnv()->GetPhysicsEngine(); if( !!p ) { _pToggleSelfCollision->setChecked(!!(p->GetPhysicsOptions()&PEO_SelfCollisions)); } } } void QtCoinViewer::_RecordSetup(bool bOn, bool bRealtimeVideo) { if( !bOn ) { if( !!_pvideorecorder ) { SoDB::enableRealTimeSensor(true); SoSceneManager::enableRealTimeUpdate(true); _pvideorecorder.reset(); } return; } #if QT_VERSION >= 0x040000 // check for qt4 if( bOn ) { _pvideorecorder = RaveCreateModule(GetEnv(),"viewerrecorder"); if( !!_pvideorecorder ) { #ifdef _WIN32 QString s = QFileDialog::getSaveFileName( this, "Choose video filename", NULL, "AVI Files (*.avi)"); #else QString s = QFileDialog::getSaveFileName( this, "Choose video filename", NULL, "Video Files (*.*)"); #endif if( s.length() == 0 ) { return; } stringstream sout, sin; sin << "Start " << _nRenderWidth << " " << _nRenderHeight << " " << VIDEO_FRAMERATE << " codec " << _videocodec << " "; if( bRealtimeVideo ) { sin << "timing realtime "; } else { sin << "timing simtime "; } sin << " viewer " << GetName() << endl << " filename " << s.toAscii().data() << endl; if( !_pvideorecorder->SendCommand(sout,sin) ) { _pvideorecorder.reset(); RAVELOG_DEBUG("video recording failed"); return; } SoDB::enableRealTimeSensor(false); SoSceneManager::enableRealTimeUpdate(false); } } #endif } bool QtCoinViewer::_GetCameraImage(std::vector<uint8_t>& memory, int width, int height, const RaveTransform<float>& _t, const SensorBase::CameraIntrinsics& intrinsics) { if( !_bCanRenderOffscreen ) { RAVELOG_WARN("cannot render offscreen\n"); return false; } // have to flip Z axis RaveTransform<float> trot; trot.rot = quatFromAxisAngle(RaveVector<float>(1,0,0),(float)PI); RaveTransform<float> t = _t * trot; SoSFVec3f position = GetCamera()->position; SoSFRotation orientation = GetCamera()->orientation; SoSFFloat aspectRatio = GetCamera()->aspectRatio; SoSFFloat heightAngle = GetCamera()->heightAngle; SoSFFloat nearDistance = GetCamera()->nearDistance; SoSFFloat farDistance = GetCamera()->farDistance; SoOffscreenRenderer* ivOffscreen = &_ivOffscreen; SbViewportRegion vpr(width, height); vpr.setViewport(SbVec2f(intrinsics.cx/(float)(width)-0.5f, 0.5f-intrinsics.cy/(float)(height)), SbVec2f(1,1)); ivOffscreen->setViewportRegion(vpr); GetCamera()->position.setValue(t.trans.x, t.trans.y, t.trans.z); GetCamera()->orientation.setValue(t.rot.y, t.rot.z, t.rot.w, t.rot.x); GetCamera()->aspectRatio = (intrinsics.fy/(float)height) / (intrinsics.fx/(float)width); GetCamera()->heightAngle = 2.0f*atanf(0.5f*height/intrinsics.fy); GetCamera()->nearDistance = intrinsics.focal_length; GetCamera()->farDistance = intrinsics.focal_length*50000; // control the precision GetCamera()->viewportMapping = SoCamera::LEAVE_ALONE; _pFigureRoot->ref(); bool bRenderFiguresInCamera = *(bool*)&_bRenderFiguresInCamera; // will this be optimized by compiler? if( !bRenderFiguresInCamera ) { _ivRoot->removeChild(_pFigureRoot); } bool bSuccess = ivOffscreen->render(_pviewer->getSceneManager()->getSceneGraph()); if( !bRenderFiguresInCamera ) { _ivRoot->addChild(_pFigureRoot); } _pFigureRoot->unref(); if( bSuccess ) { // vertically flip since we want upper left corner to correspond to (0,0) memory.resize(width*height*3); for(int i = 0; i < height; ++i) { memcpy(&memory[i*width*3], ivOffscreen->getBuffer()+(height-i-1)*width*3, width*3); } } else { RAVELOG_WARN("offscreen renderer failed (check video driver), disabling\n"); _bCanRenderOffscreen = false; // need this or ivOffscreen.render will freeze next time } GetCamera()->position = position; GetCamera()->orientation = orientation; GetCamera()->aspectRatio = aspectRatio; GetCamera()->heightAngle = heightAngle; GetCamera()->nearDistance = nearDistance; GetCamera()->farDistance = farDistance; GetCamera()->viewportMapping = SoCamera::ADJUST_CAMERA; return bSuccess; } bool QtCoinViewer::_WriteCameraImage(int width, int height, const RaveTransform<float>& _t, const SensorBase::CameraIntrinsics& intrinsics, const std::string& filename, const std::string& extension) { if( !_bCanRenderOffscreen ) { return false; } // have to flip Z axis RaveTransform<float> trot; trot.rot = quatFromAxisAngle(RaveVector<float>(1,0,0),(float)PI); RaveTransform<float> t = _t * trot; SoSFVec3f position = GetCamera()->position; SoSFRotation orientation = GetCamera()->orientation; SoSFFloat aspectRatio = GetCamera()->aspectRatio; SoSFFloat heightAngle = GetCamera()->heightAngle; SoSFFloat nearDistance = GetCamera()->nearDistance; SoSFFloat farDistance = GetCamera()->farDistance; SbViewportRegion vpr(width, height); vpr.setViewport(SbVec2f(intrinsics.cx/(float)(width)-0.5f, 0.5f-intrinsics.cy/(float)(height)), SbVec2f(1,1)); _ivOffscreen.setViewportRegion(vpr); GetCamera()->position.setValue(t.trans.x, t.trans.y, t.trans.z); GetCamera()->orientation.setValue(t.rot.y, t.rot.z, t.rot.w, t.rot.x); GetCamera()->aspectRatio = (intrinsics.fy/(float)height) / (intrinsics.fx/(float)width); GetCamera()->heightAngle = 2.0f*atanf(0.5f*height/intrinsics.fy); GetCamera()->nearDistance = intrinsics.focal_length; GetCamera()->farDistance = intrinsics.focal_length*10000; // control the precision GetCamera()->viewportMapping = SoCamera::LEAVE_ALONE; _pFigureRoot->ref(); _ivRoot->removeChild(_pFigureRoot); bool bSuccess = true; if( !_ivOffscreen.render(_pviewer->getSceneManager()->getSceneGraph()) ) { RAVELOG_WARN("offscreen renderer failed (check video driver), disabling\n"); _bCanRenderOffscreen = false; bSuccess = false; } else { if( !_ivOffscreen.isWriteSupported(extension.c_str()) ) { RAVELOG_WARN("file type %s not supported, supported filetypes are\n", extension.c_str()); stringstream ss; for(int i = 0; i < _ivOffscreen.getNumWriteFiletypes(); ++i) { SbPList extlist; SbString fullname, description; _ivOffscreen.getWriteFiletypeInfo(i, extlist, fullname, description); ss << fullname.getString() << ": " << description.getString() << " (extensions: "; for (int j=0; j < extlist.getLength(); j++) { ss << (const char*) extlist[j] << ", "; } ss << ")" << endl; } RAVELOG_INFO(ss.str().c_str()); bSuccess = false; } else { bSuccess = _ivOffscreen.writeToFile(SbString(filename.c_str()), SbString(extension.c_str())); } } _ivRoot->addChild(_pFigureRoot); _pFigureRoot->unref(); GetCamera()->position = position; GetCamera()->orientation = orientation; GetCamera()->aspectRatio = aspectRatio; GetCamera()->heightAngle = heightAngle; GetCamera()->nearDistance = nearDistance; GetCamera()->farDistance = farDistance; GetCamera()->viewportMapping = SoCamera::ADJUST_CAMERA; return bSuccess; } uint8_t* QtCoinViewer::_GetVideoFrame() { if( !_bCanRenderOffscreen ) { return NULL; } _ivOffscreen.setViewportRegion(SbViewportRegion(_nRenderWidth, _nRenderHeight)); _ivOffscreen.render(_pviewer->getSceneManager()->getSceneGraph()); if( _ivOffscreen.getBuffer() == NULL ) { RAVELOG_WARN("offset buffer null, disabling\n"); _bCanRenderOffscreen = false; return NULL; } // flip R and B for(unsigned int i = 0; i < _nRenderHeight; ++i) { for(unsigned int j = 0; j < _nRenderWidth; ++j) { unsigned char* ptr = _ivOffscreen.getBuffer() + 3 * (i * _nRenderWidth + j); swap(ptr[0], ptr[2]); } } return (uint8_t*)_ivOffscreen.getBuffer(); } void QtCoinViewer::CollisionCheckerChanged(QAction* pact) { if( pact->text() == "[None]" ) { GetEnv()->SetCollisionChecker(CollisionCheckerBasePtr()); } else { CollisionCheckerBasePtr p = RaveCreateCollisionChecker(GetEnv(),pact->text().toUtf8().constData()); if( !!p ) { GetEnv()->SetCollisionChecker(p); } else { _UpdateCollisionChecker(); } } } void QtCoinViewer::_UpdateCollisionChecker() { if( !!_pSelectedCollisionChecker ) { CollisionCheckerBasePtr p = GetEnv()->GetCollisionChecker(); if( !!p ) { for(int i = 0; i < _pSelectedCollisionChecker->actions().size(); ++i) { QAction* pact = _pSelectedCollisionChecker->actions().at(i); std::string selectedname = pact->text().toUtf8().constData(); if( selectedname == p->GetXMLId()) { pact->setChecked(true); return; } } //RAVELOG_VERBOSE(str(boost::format("cannot find collision checker menu item %s\n")%p->GetXMLId())); } // set to default _pSelectedCollisionChecker->actions().at(0)->setChecked(true); } } void QtCoinViewer::PhysicsEngineChanged(QAction* pact) { if( pact->text() == "[None]" ) { GetEnv()->SetPhysicsEngine(PhysicsEngineBasePtr()); } else { PhysicsEngineBasePtr p = RaveCreatePhysicsEngine(GetEnv(),pact->text().toUtf8().constData()); if( !!p ) { GetEnv()->SetPhysicsEngine(p); } else { _UpdatePhysicsEngine(); } } } void QtCoinViewer::_UpdatePhysicsEngine() { PhysicsEngineBasePtr p; if( 0&&!!_pSelectedPhysicsEngine ) { p = GetEnv()->GetPhysicsEngine(); if( !!p ) { for(int i = 0; i < _pSelectedPhysicsEngine->actions().size(); ++i) { QAction* pact = _pSelectedPhysicsEngine->actions().at(i); std::string selectedname = pact->text().toUtf8().constData(); if( selectedname == p->GetXMLId() ) { pact->setChecked(true); return; } } RAVELOG_VERBOSE(str(boost::format("cannot find physics engine menu item %s\n")%p->GetXMLId())); } // set to default _pSelectedPhysicsEngine->actions().at(0)->setChecked(true); } } void QtCoinViewer::UpdateInterfaces() { list<ModuleBasePtr> listProblems; vector<KinBodyPtr> vbodies; GetEnv()->GetLoadedProblems(listProblems); GetEnv()->GetBodies(vbodies); // FOREACH(it,listInterfaces) { // pact = new QAction(tr((*it)->GetXMLId().c_str()), this); // pact->setCheckable(true); // pact->setChecked(_bSelfCollision); // connect(pact, SIGNAL(triggered(bool)), this, SLOT(DynamicSelfCollision(bool))); // psubmenu->addAction(pact); // } } void QtCoinViewer::InterfaceSendCommand(QAction* pact) { } void QtCoinViewer::DynamicSelfCollision(bool on) { PhysicsEngineBasePtr p = GetEnv()->GetPhysicsEngine(); if( !!p ) { int opts = p->GetPhysicsOptions(); if( on ) { opts |= PEO_SelfCollisions; } else { opts &= ~PEO_SelfCollisions; } p->SetPhysicsOptions(opts); } } void QtCoinViewer::DynamicGravity() { GetEnv()->GetPhysicsEngine()->SetGravity(Vector(0, 0, -9.8f)); } void QtCoinViewer::About() { QMessageBox::information(this,"About OpenRAVE...", "OpenRAVE is a open-source robotics planning and simulation environment\n" "Lead Developer: Rosen Diankov\n" "License: Lesser General Public License v3.0 (LGPLv3)\n"); } QtCoinViewer::EnvMessage::EnvMessage(QtCoinViewerPtr pviewer, void** ppreturn, bool bWaitForMutex) : _pviewer(pviewer), _ppreturn(ppreturn) { // get a mutex if( bWaitForMutex ) { _plock.reset(new boost::mutex::scoped_lock(_mutex)); } } QtCoinViewer::EnvMessage::~EnvMessage() { _plock.reset(); } /// execute the command in the caller void QtCoinViewer::EnvMessage::callerexecute(bool bGuiThread) { bool bWaitForMutex = !!_plock; // QThread::currentThread is buggy and gets into an infinite loop if the Gui thread is calling QEventLoop::processEvents //bool bGuiThread = QThread::currentThread() == QCoreApplication::instance()->thread(); if( bGuiThread ) { viewerexecute(); } else { { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !!pviewer ) { boost::mutex::scoped_lock lock(pviewer->_mutexMessages); pviewer->_listMessages.push_back(shared_from_this()); } } if( bWaitForMutex ) { boost::mutex::scoped_lock lock(_mutex); } } } /// execute the command in the viewer void QtCoinViewer::EnvMessage::viewerexecute() { _plock.reset(); } bool QtCoinViewer::_SetFiguresInCamera(ostream& sout, istream& sinput) { sinput >> _bRenderFiguresInCamera; return !!sinput; } bool QtCoinViewer::_CommandResize(ostream& sout, istream& sinput) { sinput >> _nRenderWidth; sinput >> _nRenderHeight; if( !!sinput ) { return true; } return false; } bool QtCoinViewer::_SetFeedbackVisibility(ostream& sout, istream& sinput) { sinput >> _bDisplayFeedBack; if( !!sinput ) { ViewToggleFeedBack(_bDisplayFeedBack); return true; } return false; } UserDataPtr QtCoinViewer::RegisterItemSelectionCallback(const ItemSelectionCallbackFn& fncallback) { ItemSelectionCallbackDataPtr pdata(new ItemSelectionCallbackData(fncallback,shared_viewer())); pdata->_iterator = _listRegisteredItemSelectionCallbacks.insert(_listRegisteredItemSelectionCallbacks.end(),pdata); return pdata; } UserDataPtr QtCoinViewer::RegisterViewerImageCallback(const ViewerImageCallbackFn& fncallback) { ViewerImageCallbackDataPtr pdata(new ViewerImageCallbackData(fncallback,shared_viewer())); pdata->_iterator = _listRegisteredViewerImageCallbacks.insert(_listRegisteredViewerImageCallbacks.end(),pdata); return pdata; } UserDataPtr QtCoinViewer::RegisterViewerThreadCallback(const ViewerThreadCallbackFn& fncallback) { ViewerThreadCallbackDataPtr pdata(new ViewerThreadCallbackData(fncallback,shared_viewer())); pdata->_iterator = _listRegisteredViewerThreadCallbacks.insert(_listRegisteredViewerThreadCallbacks.end(),pdata); return pdata; } bool QtCoinViewer::_SaveBodyLinkToVRMLCommand(ostream& sout, istream& sinput) { string bodyname, filename; int linkindex=-1; sinput >> bodyname >> linkindex; if (!getline(sinput, filename) ) { RAVELOG_WARN("failed to get filename\n"); return false; } boost::trim(filename); KinBodyPtr pbody = GetEnv()->GetKinBody(bodyname); if( !pbody ) { RAVELOG_WARN_FORMAT("could not find body %s", bodyname); return false; } boost::mutex::scoped_lock lock(_mutexUpdateModels); boost::mutex::scoped_lock lock2(g_mutexsoqt); if( _mapbodies.find(pbody) == _mapbodies.end() ) { RAVELOG_WARN_FORMAT("couldn't find body %s in viewer list", bodyname); return false; } KinBodyItemPtr pitem = _mapbodies[pbody]; SoNode* psep; if( linkindex >= 0 && linkindex < (int)pbody->GetLinks().size() ) { psep = pitem->GetIvLink(linkindex); } else { psep = pitem->GetIvGeom(); } psep->ref(); SoToVRML2Action tovrml2; tovrml2.apply(psep); SoVRMLGroup *newroot = tovrml2.getVRML2SceneGraph(); newroot->ref(); psep->unref(); SoOutput out; out.openFile(filename.c_str()); out.setHeaderString("#VRML V2.0 utf8"); SoWriteAction wa(&out); wa.apply(newroot); out.closeFile(); newroot->unref(); RAVELOG_VERBOSE_FORMAT("saved body %s to file %s", pbody->GetName()%filename); return true; } class SetNearPlaneMessage : public QtCoinViewer::EnvMessage { public: SetNearPlaneMessage(QtCoinViewerPtr pviewer, void** ppreturn, bool fnearplane) : EnvMessage(pviewer, ppreturn, false), _fnearplane(fnearplane) { } virtual void viewerexecute() { QtCoinViewerPtr pviewer = _pviewer.lock(); if( !pviewer ) { return; } pviewer->_SetNearPlane(_fnearplane); EnvMessage::viewerexecute(); } private: dReal _fnearplane; }; bool QtCoinViewer::_SetNearPlaneCommand(ostream& sout, istream& sinput) { dReal nearplane=0.01f; sinput >> nearplane; EnvMessagePtr pmsg(new SetNearPlaneMessage(shared_viewer(), (void**)NULL, nearplane)); pmsg->callerexecute(false); return true; } void QtCoinViewer::_SetNearPlane(dReal nearplane) { _pviewer->setAutoClippingStrategy(SoQtViewer::CONSTANT_NEAR_PLANE, nearplane); } /*ScreenRendererWidget::ScreenRendererWidget() { std::list<EnvironmentBasePtr> listenvironments; RaveGetEnvironments(listenvironments); if( listenvironments.size() > 0 ) { _penv = listenvironments.front(); _openraveviewer = boost::dynamic_pointer_cast<QtCoinViewer>(_penv->GetViewer()); if( !!_openraveviewer ) { QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(Animate())); timer->start(50); // ms } } } void ScreenRendererWidget::Animate() { update(); } void ScreenRendererWidget::paintEvent(QPaintEvent *event) { if( !!_openraveviewer ) { QPainter painter(this); int width=320, height=240; SensorBase::CameraIntrinsics intr; intr.fx = 320; intr.fy = 320; intr.cx = 160; intr.cy = 120; intr.focal_length = _openraveviewer->GetCameraIntrinsics().focal_length; bool bsuccess = _openraveviewer->_GetCameraImage(_memory, width, height, _openraveviewer->GetCameraTransform(), intr); if( bsuccess ) { //emit image_ready(QImage(frame.data, frame.cols, frame.rows, frame.step, QImage::Format_RGB888)); QImage image = QImage( width, height, QImage::Format_RGB888 ); for (int i = 0; i < height; ++i) { memcpy(image.scanLine(i), &_memory[0] + i * width * 3, width * 3); } painter.drawImage(QRectF(0,0,width,height), image); } else { RAVELOG_WARN("openrave viewer failed to _GetCameraImage\n"); } } } QtCoinViewerProxy::QtCoinViewerProxy(QGraphicsItem* parent) : QGraphicsProxyWidget(parent) { setWidget(new ScreenRendererWidget()); } Q_EXPORT_PLUGIN2(qtcoinrave, QOpenRAVEWidgetsPlugin); */
35.357253
524
0.606486
[ "geometry", "render", "object", "shape", "vector", "model", "transform", "3d" ]
3f393d1b867677897959705b16d2748052feb339
354
cc
C++
abc/abc060/abc060c.cc
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
1
2019-08-21T00:49:34.000Z
2019-08-21T00:49:34.000Z
abc/abc060/abc060c.cc
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
null
null
null
abc/abc060/abc060c.cc
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll N, T; cin >> N >> T; vector<ll> t(N); rep(i, N) cin >> t[i]; ll X = 0; for (int i = 1; i < N; i++) { X += min(t[i] - t[i - 1], T); } X += T; cout << X << endl; return 0; }
16.857143
46
0.426554
[ "vector" ]
278d5a97bfff77033e28c665b3a73b07c1bdaf0d
1,770
cpp
C++
src/StatProcessor/statProcessor.cpp
antoinecordelle/Obiwan
30fe469549cdb0368608281c71add49c32eb2fd0
[ "MIT" ]
1
2020-07-18T23:49:09.000Z
2020-07-18T23:49:09.000Z
src/StatProcessor/statProcessor.cpp
antoinecordelle/Obiwan
30fe469549cdb0368608281c71add49c32eb2fd0
[ "MIT" ]
null
null
null
src/StatProcessor/statProcessor.cpp
antoinecordelle/Obiwan
30fe469549cdb0368608281c71add49c32eb2fd0
[ "MIT" ]
1
2022-02-11T01:46:13.000Z
2022-02-11T01:46:13.000Z
#include "statProcessor.hpp" #include <iostream> using namespace std; StatProcessor::StatProcessor(int timeWindow) :mTimeWindow(timeWindow) { } void StatProcessor::initialize(const HttpPacket &httpPacket) { mCurrentMetric = Metric(httpPacket.date); } bool StatProcessor::processLine(const HttpPacket &httpPacket) { if (mCurrentMetric.getStartTime() + mTimeWindow > httpPacket.date) { mCurrentMetric.updateMetric(httpPacket); return false; } else { mBufferedMetric = mCurrentMetric; // The new metric will start in the beginning of the 10sec window where the new packet belongs // Knowing that the first window begins at the time of the first line. // This gets the number of 10sec chunks between the last computed metric and the next packet. long newStartModifier((httpPacket.date - mBufferedMetric.getStartTime() - mTimeWindow) / mTimeWindow); time_t newStart(mBufferedMetric.getStartTime() + mTimeWindow * (newStartModifier + 1)); mCurrentMetric = Metric(newStart); mCurrentMetric.updateMetric(httpPacket); return true; } } std::vector<Metric> StatProcessor::getMetrics() { mBufferedMetric.computeMetric(); auto completedMetrics = vector<Metric>{mBufferedMetric}; // Number of chunks of 10sec where no data has been received long emptyMetricsCount((mCurrentMetric.getStartTime() - mBufferedMetric.getStartTime() - mTimeWindow) / mTimeWindow); for (unsigned long i = 0; i < emptyMetricsCount; i++) { completedMetrics.emplace_back(mBufferedMetric.getStartTime() + mTimeWindow * (i + 1)); } return completedMetrics; } Metric StatProcessor::getLastMetric() { mCurrentMetric.computeMetric(); return mCurrentMetric; }
36.122449
121
0.721469
[ "vector" ]
27ab58a5c5a46fa178f49ef9918023a9806de7e1
2,733
hpp
C++
include/TensorProlongation.hpp
kmorel/MGARD
a7c44d57fda76a5c3e6fa38702ca8c8c12150b83
[ "Apache-2.0" ]
19
2019-03-08T15:21:36.000Z
2022-02-11T04:02:50.000Z
include/TensorProlongation.hpp
kmorel/MGARD
a7c44d57fda76a5c3e6fa38702ca8c8c12150b83
[ "Apache-2.0" ]
100
2019-01-14T15:34:09.000Z
2022-03-29T13:39:30.000Z
include/TensorProlongation.hpp
kmorel/MGARD
a7c44d57fda76a5c3e6fa38702ca8c8c12150b83
[ "Apache-2.0" ]
22
2018-11-16T01:13:57.000Z
2022-03-14T23:53:28.000Z
#ifndef TENSORPROLONGATION_HPP #define TENSORPROLONGATION_HPP //!\file //!\brief Prolongation–addition for tensor product grids. #include "TensorLinearOperator.hpp" namespace mgard { //! Prolongation–addition (interpolate the values on the 'old' nodes to the //! 'new' nodes and add (not overwrite)) for continuous piecewise linear //! functions defined on a mesh 'spear.' template <std::size_t N, typename Real> class ConstituentProlongationAddition : public ConstituentLinearOperator<N, Real> { public: //! Constructor. //! //! This constructor is provided so that arrays of this class may be formed. A //! default-constructed instance must be assigned to before being used. ConstituentProlongationAddition() = default; //! Constructor. //! //!\param hierarchy Mesh hierarchy on which the functions are defined. //!\param l Index of the mesh on which the prolongation–addition is to be //! applied. This is the index of the fine mesh (corresponding to the range). //!\param dimension Index of the dimension in which the prolongation–addition //! is to be applied. ConstituentProlongationAddition(const TensorMeshHierarchy<N, Real> &hierarchy, const std::size_t l, const std::size_t dimension); private: using CLO = ConstituentLinearOperator<N, Real>; //! Indices of the coarse 'spear' in the chosen dimension. TensorIndexRange coarse_indices; virtual void do_operator_parentheses(const std::array<std::size_t, N> multiindex, Real *const v) const override; }; //! Prolongation–addition (interpolate the values on the 'old' nodes to the //! 'new' nodes and add (not overwrite)) for tensor products of continuous //! piecewise linear functions defined on a Cartesian product mesh hierarchy. //! //! *Important:* This operator only works as expected when the values on the //! 'new' nodes are all zero to start. template <std::size_t N, typename Real> class TensorProlongationAddition : public TensorLinearOperator<N, Real> { public: //! Constructor. //! //!\param hierarchy Mesh hierarchy on which the functions are defined. //!\param l Index of the mesh on which the prolongation–addition is to be //! applied. This is the index of the fine mesh (corresponding to the range). TensorProlongationAddition(const TensorMeshHierarchy<N, Real> &hierarchy, const std::size_t l); private: using TLO = TensorLinearOperator<N, Real>; //! Constituent prolongation–additions for each dimension. const std::array<ConstituentProlongationAddition<N, Real>, N> prolongation_additions; }; } // namespace mgard #include "TensorProlongation.tpp" #endif
36.932432
80
0.716429
[ "mesh" ]
27b928fbf7a2a7fe5a2cf5a3300ddf8585daab81
2,528
cc
C++
vpc/src/model/DeleteNqaRequest.cc
sdk-team/aliyun-openapi-cpp-sdk
d0e92f6f33126dcdc7e40f60582304faf2c229b7
[ "Apache-2.0" ]
3
2020-01-06T08:23:14.000Z
2022-01-22T04:41:35.000Z
vpc/src/model/DeleteNqaRequest.cc
sdk-team/aliyun-openapi-cpp-sdk
d0e92f6f33126dcdc7e40f60582304faf2c229b7
[ "Apache-2.0" ]
null
null
null
vpc/src/model/DeleteNqaRequest.cc
sdk-team/aliyun-openapi-cpp-sdk
d0e92f6f33126dcdc7e40f60582304faf2c229b7
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <alibabacloud/vpc/model/DeleteNqaRequest.h> using AlibabaCloud::Vpc::Model::DeleteNqaRequest; DeleteNqaRequest::DeleteNqaRequest() : RpcServiceRequest("vpc", "2016-04-28", "DeleteNqa") {} DeleteNqaRequest::~DeleteNqaRequest() {} long DeleteNqaRequest::getResourceOwnerId()const { return resourceOwnerId_; } void DeleteNqaRequest::setResourceOwnerId(long resourceOwnerId) { resourceOwnerId_ = resourceOwnerId; setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); } std::string DeleteNqaRequest::getResourceOwnerAccount()const { return resourceOwnerAccount_; } void DeleteNqaRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) { resourceOwnerAccount_ = resourceOwnerAccount; setParameter("ResourceOwnerAccount", resourceOwnerAccount); } std::string DeleteNqaRequest::getRegionId()const { return regionId_; } void DeleteNqaRequest::setRegionId(const std::string& regionId) { regionId_ = regionId; setParameter("RegionId", regionId); } std::string DeleteNqaRequest::getClientToken()const { return clientToken_; } void DeleteNqaRequest::setClientToken(const std::string& clientToken) { clientToken_ = clientToken; setParameter("ClientToken", clientToken); } std::string DeleteNqaRequest::getOwnerAccount()const { return ownerAccount_; } void DeleteNqaRequest::setOwnerAccount(const std::string& ownerAccount) { ownerAccount_ = ownerAccount; setParameter("OwnerAccount", ownerAccount); } std::string DeleteNqaRequest::getNqaId()const { return nqaId_; } void DeleteNqaRequest::setNqaId(const std::string& nqaId) { nqaId_ = nqaId; setParameter("NqaId", nqaId); } long DeleteNqaRequest::getOwnerId()const { return ownerId_; } void DeleteNqaRequest::setOwnerId(long ownerId) { ownerId_ = ownerId; setParameter("OwnerId", std::to_string(ownerId)); }
24.07619
88
0.75
[ "model" ]
27bf42034087942e85bcbb8fbc879023c564c188
94,837
cpp
C++
src/missionui/missionshipchoice.cpp
ptitSeb/freespace2
500ee249f7033aac9b389436b1737a404277259c
[ "Linux-OpenIB" ]
1
2020-07-14T07:29:18.000Z
2020-07-14T07:29:18.000Z
src/missionui/missionshipchoice.cpp
ptitSeb/freespace2
500ee249f7033aac9b389436b1737a404277259c
[ "Linux-OpenIB" ]
2
2019-01-01T22:35:56.000Z
2022-03-14T07:34:00.000Z
src/missionui/missionshipchoice.cpp
ptitSeb/freespace2
500ee249f7033aac9b389436b1737a404277259c
[ "Linux-OpenIB" ]
2
2021-03-07T11:40:42.000Z
2021-12-26T21:40:39.000Z
/* * Copyright (C) Volition, Inc. 1999. All rights reserved. * * All source code herein is the property of Volition, Inc. You may not sell * or otherwise commercially exploit the source or things you created based on * the source. */ /* * $Logfile: /Freespace2/code/MissionUI/MissionShipChoice.cpp $ * $Revision: 307 $ * $Date: 2010-02-08 09:09:13 +0100 (Mon, 08 Feb 2010) $ * $Author: taylor $ * * C module to allow player ship selection for the mission * * $Log$ * Revision 1.6 2005/03/29 02:18:47 taylor * Various 64-bit platform fixes * Fix compiler errors with MAKE_FS1 and fix gr_set_bitmap() too * Make sure that turrets can fire at asteroids for FS1 (needed for a couple missions) * Streaming audio support (big thanks to Pierre Willenbrock!!) * Removed dependance on strings.tbl for FS1 since we don't actually need it now * * Revision 1.5 2004/09/20 01:31:44 theoddone33 * GCC 3.4 fixes. * * Revision 1.4 2003/05/25 02:30:43 taylor * Freespace 1 support * * Revision 1.3 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * * Revision 1.2 2002/06/09 04:41:23 relnev * added copyright header * * Revision 1.1.1.1 2002/05/03 03:28:10 root * Initial import. * * * 26 11/02/99 3:23p Jefff * "x Meters" to "x Meter" in German * * 25 8/05/99 3:40p Jefff * hi-res text adjustments * * 24 8/04/99 11:56a Jefff * fixed gamma wing hi-res coordinate error. fixed * ss_load_individual_animation to load anis from a packfile. * * 23 7/30/99 4:22p Andsager * restored ship and weapon anim sounds for demo. Added sound for * changing ship in weapon loadout screen. * * 22 7/28/99 12:23p Jefff * updated hi-res wing icon coords * * 21 7/21/99 3:24p Andsager * Modify demo to use 2 frame ship and weapon select anis and cut sounds * associated with ani * * 20 7/16/99 2:23p Anoop * Fixed build error. * * 19 7/16/99 1:49p Dave * 8 bit aabitmaps. yay. * * 18 7/15/99 6:36p Jamesa * Moved default ship name into the ships.tbl * * 17 7/15/99 9:20a Andsager * FS2_DEMO initial checkin * * 16 6/29/99 7:39p Dave * Lots of small bug fixes. * * 15 6/04/99 11:32a Dave * Added reset text to ship select screen. Fixed minor xstr bug in ui * window * * 14 3/23/99 9:26p Neilk * fixed various multiplayer lock button problems * * 13 3/23/99 11:55a Neilk * new support for ship anis * * 14 3/15/99 6:27p Neilk * Added hires support for the ship animations * * 13 3/15/99 11:18a Neilk * Modified animation code so ship animations loop back to frame 51 * * 12 3/12/99 12:02p Davidg * Modified coordinates for low res ship animations for new artwork * * 11 3/10/99 6:21p Neilk * Added new artwork for hires * * 10 2/21/99 6:01p Dave * Fixed standalone WSS packets. * * 9 2/18/99 11:46a Neilk * hires interface coord support * * 8 2/11/99 3:08p Dave * PXO refresh button. Very preliminary squad war support. * * 7 2/01/99 5:55p Dave * Removed the idea of explicit bitmaps for buttons. Fixed text * highlighting for disabled gadgets. * * 6 1/29/99 4:17p Dave * New interface screens. * * 5 12/18/98 1:13a Dave * Rough 1024x768 support for Direct3D. Proper detection and usage through * the launcher. * * 4 11/30/98 1:07p Dave * 16 bit conversion, first run. * * 3 10/13/98 9:28a Dave * Started neatening up freespace.h. Many variables renamed and * reorganized. Added AlphaColors.[h,cpp] * * 2 10/07/98 10:53a Dave * Initial checkin. * * 1 10/07/98 10:50a Dave * * 102 9/11/98 4:14p Dave * Fixed file checksumming of < file_size. Put in more verbose kicking and * PXO stats store reporting. * * 101 6/09/98 10:31a Hoffoss * Created index numbers for all xstr() references. Any new xstr() stuff * added from here on out should be added to the end if the list. The * current list count can be found in FreeSpace.cpp (search for * XSTR_SIZE). * * 100 6/01/98 11:43a John * JAS & MK: Classified all strings for localization. * * 99 5/23/98 5:50p Lawrance * Don't reset scroll offset when rebuilding the list * * 98 5/06/98 11:50p Lawrance * Clean up help overlay code for loadout screens * * 97 4/30/98 6:03p Lawrance * Make drag and drop work better. * * 96 4/29/98 3:31p Lawrance * draw disabled frames for icons when appropriate * * 95 4/28/98 9:35a Dave * Remove bogus assert in create_wings() for ships which arrive late and * haven't been created yet. * * 94 4/27/98 6:02p Dave * Modify how missile scoring works. Fixed a team select ui bug. Speed up * multi_lag system. Put in new main hall. * * 93 4/14/98 12:57a Dave * Made weapon select screen show netplayer names above ships. Fixed pilot * info popup to show the status of pilot images more correctly. * * 92 4/13/98 3:27p Lawrance * fix coords for ship selection pool numbers * * 91 4/13/98 3:11p Andsager * Fixed bug when there is no description for a ship. * * 90 4/10/98 4:51p Hoffoss * Made several changes related to tooltips. * * 89 4/05/98 7:43p Lawrance * fix up saving/restoring of link status and auto-target/match-speed. * * 88 4/03/98 4:16p Adam * changed coord's and skip frame for new SS animations * * 87 4/02/98 11:40a Lawrance * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE * * 86 4/01/98 11:19p Dave * Put in auto-loading of xferred pilot pic files. Grey out background * behind pinfo popup. Put a chatbox message in when players are kicked. * Moved mission title down in briefing. Other ui fixes. * * 85 4/01/98 9:21p John * Made NDEBUG, optimized build with no warnings or errors. * * 84 3/31/98 11:47p Lawrance * Fix some bugs related to wingmen selection when doing a quick mission * restart. * * 83 3/31/98 1:50p Duncan * ALAN: fix bugs with selecting alternate weapons * * 82 3/30/98 12:18a Lawrance * change some DEMO_RELEASE code to not compile code rather than return * early * * 81 3/29/98 12:55a Lawrance * Get demo build working with limited set of data. * * 80 3/26/98 6:01p Dave * Put in file checksumming routine in cfile. Made pilot pic xferring more * robust. Cut header size of voice data packets in half. Put in * restricted game host query system. * * 79 3/25/98 8:43p Hoffoss * Changed anim_play() to not be so damn complex when you try and call it. * * 78 3/12/98 4:03p Lawrance * don't press buttons when icon dropped on them * * 77 3/09/98 11:13a Lawrance * Fix up drop sound effects used in loadout screens. * * 76 3/06/98 5:36p Dave * Finished up first rev of team vs team. Probably needs to be debugged * thoroughly. * * 75 3/05/98 6:48p Lawrance * reposition commit_pressed() to ensure popup gets called after clear but * before flip * * 74 3/05/98 5:03p Dave * More work on team vs. team support for multiplayer. Need to fix bugs in * weapon select. * * 73 3/05/98 12:38a Lawrance * Fix bug with flashing buttons showing over help overlay * * 72 3/02/98 5:42p John * Removed WinAVI stuff from Freespace. Made all HUD gauges wriggle from * afterburner. Made gr_set_clip work good with negative x &y. Made * model_caching be on by default. Made each cached model have it's own * bitmap id. Made asteroids not rotate when model_caching is on. * * 71 3/01/98 3:26p Dave * Fixed a few team select bugs. Put in multiplayer intertface sounds. * Corrected how ships are disabled/enabled in team select/weapon select * screens. * * 70 2/28/98 7:04p Lawrance * Don't show reset button in multiplayer * * 69 2/26/98 8:21p Allender * fix compiler warning * * 68 2/26/98 4:59p Allender * groundwork for team vs team briefings. Moved weaponry pool into the * Team_data structure. Added team field into the p_info structure. * Allow for mutliple structures in the briefing code. * * 67 2/24/98 6:21p Lawrance * Integrate new reset button into loadout screens * * 66 2/22/98 4:30p John * More string externalization classification * * 65 2/22/98 4:17p John * More string externalization classification... 190 left to go! * * 64 2/22/98 12:19p John * Externalized some strings * * 63 2/19/98 6:26p Dave * Fixed a few file xfer bugs. Tweaked mp team select screen. Put in * initial support for player data uploading. * * 62 2/18/98 3:56p Dave * Several bugs fixed for mp team select screen. Put in standalone packet * routing for team select. * * 61 2/17/98 6:07p Dave * Tore out old multiplayer team select screen, installed new one. * * 60 2/13/98 3:46p Dave * Put in dynamic chatbox sizing. Made multiplayer file lookups use cfile * functions. * * 59 2/12/98 2:38p Allender * fix multiplayer primary/secondary weapon problems when ships are * outfitted with less than max number * * 58 2/07/98 5:47p Lawrance * reset flashing if a button gets highlighted * * 57 2/05/98 11:21p Lawrance * When flashing buttons, use highlight frame * * 56 1/30/98 10:00a Allender * made large ships able to attack other ships. Made goal code recognize * when ships removed from wings during ship select * * 55 1/22/98 5:26p Dave * Modified some pregame sequencing packets. Starting to repair broken * standalone stuff. * * 54 1/17/98 2:46a Dave * Reworked multiplayer join/accept process. Ingame join still needs to be * integrated. * * 53 1/15/98 4:11p Lawrance * Add call to check if slot is player occupied. * * 52 1/13/98 4:47p Allender * change default terran ship to reflect new ship class name * * 51 1/12/98 5:17p Dave * Put in a bunch of multiplayer sequencing code. Made weapon/ship select * work through the standalone. * * 50 1/10/98 12:46a Lawrance * Store last_modified time for mission into player loadout struct. * * 49 1/09/98 6:06p Dave * Put in network sound support for multiplayer ship/weapon select * screens. Made clients exit game correctly through warp effect. Fixed * main hall menu help overlay bug. * * 48 1/08/98 11:38a Lawrance * correct typo * * 47 1/08/98 11:36a Lawrance * Get ship select and weapons loadout icon dropping sound effects working * for single and multiplayer * * 46 1/02/98 9:10p Lawrance * Big changes to how colors get set on the HUD. * * 45 12/29/97 4:21p Lawrance * Flash buttons on briefing/ship select/weapons loadout when enough time * has elapsed without activity. * * 44 12/29/97 9:42a Lawrance * Ensure that WING_SLOT_IS_PLAYER gets set correctly in multiplayer. * * 43 12/24/97 8:54p Lawrance * Integrating new popup code * * 42 12/24/97 1:19p Lawrance * fix some bugs with the multiplayer ship/weapons loadout * * 41 12/23/97 5:25p Allender * more fixes to multiplayer ship selection. Fixed strange reentrant * problem with cf_callback when loading freespace data * * 40 12/23/97 11:59a Allender * changes to ship/wespon selection for multplayer. added sounds to some * interface screens. Update and modiied end-of-briefing packets -- yet * to be tested. * * 39 12/23/97 11:04a Lawrance * fix bug in ss_swap_slot_slot() * * 38 12/23/97 10:57a Lawrance * move player_set_weapon_prefs() to when commit is pressed in briefing * (from entering gameplay) * * 37 12/23/97 10:54a Lawrance * fix some bugs in multiplayer ship selection * * 36 12/22/97 6:18p Lawrance * Get save/restore of player loadout working with new code * * 35 12/22/97 1:40a Lawrance * Re-write ship select/weapons loadout to be multiplayer friendly * * 34 12/19/97 1:23p Dave * Put in multiplayer groundwork for new weapon/ship select screens. * * $NoKeywords: $ * */ #include "missionscreencommon.h" #include "missionshipchoice.h" #include "missionparse.h" #include "missionbrief.h" #include "freespace.h" #include "gamesequence.h" #include "ship.h" #include "key.h" #include "2d.h" #include "line.h" #include "3d.h" #include "model.h" #include "timer.h" #include "math.h" #include "linklist.h" #include "mouse.h" #include "weapon.h" #include "ui.h" #include "ailocal.h" #include "player.h" #include "audiostr.h" #include "bmpman.h" #include "palman.h" #include "snazzyui.h" #include "animplay.h" #include "packunpack.h" #include "missionweaponchoice.h" #include "contexthelp.h" #include "gamesnd.h" #include "sound.h" #include "missionhotkey.h" #include "multi.h" #include "multimsgs.h" #include "missionload.h" #include "eventmusic.h" #include "chatbox.h" #include "popup.h" #include "multiui.h" #include "multiteamselect.h" #include "multiutil.h" #include "hudwingmanstatus.h" #include "alphacolors.h" #include "localize.h" ////////////////////////////////////////////////////// // Game-wide Globals ////////////////////////////////////////////////////// char default_player_ship[255] = NOX("GTF Ulysses"); int Select_default_ship = 0; int Ship_select_open = 0; // This game-wide global flag is set to 1 to indicate that the ship // select screen has been opened and memory allocated. This flag // is needed so we can know if ship_select_close() needs to called if // restoring a game from the Options screen invoked from ship select int Commit_pressed; // flag to indicate that the commit button was pressed // use a flag, so the ship_create() can be done at the end of the loop ////////////////////////////////////////////////////// // Module Globals ////////////////////////////////////////////////////// static int Ship_anim_class = -1; // ship class that is playing as an animation static int Ss_delta_x, Ss_delta_y; // used to offset the carried icon to make it smoothly leave static position ////////////////////////////////////////////////////// // UI Data structs ////////////////////////////////////////////////////// typedef struct ss_icon_info { int icon_bmaps[NUM_ICON_FRAMES]; int current_icon_bitmap; anim_t *anim; anim_instance_t *anim_instance; } ss_icon_info; typedef struct ss_slot_info { int status; // slot status (WING_SLOT_DISABLED, etc) int sa_index; // index into ship arrival list, -1 if ship is created int original_ship_class; } ss_slot_info; typedef struct ss_wing_info { int num_slots; int wingnum; int is_late; ss_slot_info ss_slots[MAX_WING_SLOTS]; } ss_wing_info; //ss_icon_info Ss_icons[MAX_SHIP_TYPES]; // holds ui info on different ship icons //ss_wing_info Ss_wings[MAX_WING_BLOCKS]; // holds ui info for wings and wing slots ss_wing_info Ss_wings_teams[MAX_TEAMS][MAX_WING_BLOCKS]; ss_wing_info *Ss_wings; ss_icon_info Ss_icons_teams[MAX_TEAMS][MAX_SHIP_TYPES]; ss_icon_info *Ss_icons; int Ss_mouse_down_on_region = -1; int Selected_ss_class; // set to ship class of selected ship, -1 if none selected int Hot_ss_icon; // index that icon is over in list (0..4) int Hot_ss_slot; // index for slot that mouse is over (0..11) //////////////////////////////////////////////////////////// // Ship Select UI //////////////////////////////////////////////////////////// UI_WINDOW Ship_select_ui_window; static int Ship_anim_coords[GR_NUM_RESOLUTIONS][2] = { { #ifdef MAKE_FS1 10, 77 #else 257, 84 // GR_640 #endif }, { 412, 135 // GR_1024 } }; #ifndef MAKE_FS1 static int Ship_info_coords[GR_NUM_RESOLUTIONS][2] = { { 28, 78 // GR_640 }, { 45, 125 // GR_1024 } }; #endif // coordinate lookup indicies #define SHIP_SELECT_X_COORD 0 #define SHIP_SELECT_Y_COORD 1 #define SHIP_SELECT_W_COORD 2 #define SHIP_SELECT_H_COORD 3 // NK: changed from 37 to 51 for new FS2 animations #if defined(FS2_DEMO) || defined(FS1_DEMO) #define SHIP_ANIM_LOOP_FRAME 0 #elif MAKE_FS1 #define SHIP_ANIM_LOOP_FRAME 36 #else #define SHIP_ANIM_LOOP_FRAME 51 #endif #define MAX_ICONS_ON_SCREEN 4 // (x,y) pairs for ship icon and ship icon number int Ship_list_coords[GR_NUM_RESOLUTIONS][MAX_ICONS_ON_SCREEN][4] = { { {23,331,4,341}, {23,361,4,371}, {23,391,4,401}, {23,421,4,431} }, { {29,530,10,540}, {29,578,10,588}, {29,626,10,636}, {29,674,10,684} } }; // Store the x locations for the icons in the wing formations int Wing_icon_coords[GR_NUM_RESOLUTIONS][MAX_WSS_SLOTS][2] = { { {124,345}, {100,376}, {148,376}, {124,407}, {222,345}, {198,376}, {246,376}, {222,407}, {320,345}, {296,376}, {344,376}, {320,407} }, { {218,584}, {194,615}, {242,615}, {218,646}, {373,584}, {349,615}, {397,615}, {373,646}, {531,584}, {507,615}, {555,615}, {531,646} } }; ////////////////////////////////////////////////////// // Linked List of icons to show on ship selection list ////////////////////////////////////////////////////// #define SS_ACTIVE_ITEM_USED (1<<0) typedef struct ss_active_item { ss_active_item *prev, *next; int ship_class; int flags; } ss_active_item; static ss_active_item SS_active_head; static ss_active_item SS_active_items[MAX_WSS_SLOTS]; static int SS_active_list_start; static int SS_active_list_size; ////////////////////////////////////////////////////// // Background bitmaps data for ship_select ////////////////////////////////////////////////////// static const char* Ship_select_background_fname[GR_NUM_RESOLUTIONS] = { #ifdef MAKE_FS1 "Brief", "Brief" #else "ShipSelect", "2_ShipSelect" #endif }; static const char* Ship_select_background_mask_fname[GR_NUM_RESOLUTIONS] = { "ShipSelect-m", "2_ShipSelect-m" }; int Ship_select_background_bitmap; ////////////////////////////////////////////////////// // Ship select specific buttons ////////////////////////////////////////////////////// #define NUM_SS_BUTTONS 4 #define SS_BUTTON_SCROLL_UP 0 #define SS_BUTTON_SCROLL_DOWN 1 #define SS_BUTTON_RESET 2 #define SS_BUTTON_DUMMY 3 // needed to capture mouse for drag/drop icons // convenient struct for handling all button controls struct ss_buttons { const char *filename; int x, y, xt, yt; int hotspot; int scrollable; UI_BUTTON button; // because we have a class inside this struct, we need the constructor below.. ss_buttons(const char *name, int x1, int y1, int xt1, int yt1, int h, int s) : filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h), scrollable(s) {} }; static ss_buttons Ship_select_buttons[GR_NUM_RESOLUTIONS][NUM_SS_BUTTONS] = { { // GR_640 #ifdef MAKE_FS1 ss_buttons("ssb_08", 0, 301, -1, -1, 8, 0), // SCROLL UP ss_buttons("ssb_09", 0, 453, -1, -1, 9, 0), // SCROLL DOWN ss_buttons("ssb_39", 566, 317, -1, -1, 39, 0), // RESET ss_buttons("ssb_39", 0, 0, -1, -1, 99, 0) // dummy for drag n' drop #else ss_buttons("ssb_08", 5, 303, -1, -1, 8, 0), // SCROLL UP ss_buttons("ssb_09", 5, 454, -1, -1, 9, 0), // SCROLL DOWN ss_buttons("ssb_39", 571, 347, -1, -1, 39,0), // RESET ss_buttons("ssb_39", 0, 0, -1, -1, 99,0) // dummy for drag n' drop #endif }, { // GR_1024 ss_buttons("2_ssb_08", 8, 485, -1, -1, 8, 0), // SCROLL UP ss_buttons("2_ssb_09", 8, 727, -1, -1, 9, 0), // SCROLL DOWN ss_buttons("2_ssb_39", 913, 556, -1, -1, 39,0), // RESET ss_buttons("2_ssb_39", 0, 0, -1, -1, 99,0) // dummy for drag n' drop } }; // ship select text #ifndef MAKE_FS1 #define SHIP_SELECT_NUM_TEXT 1 UI_XSTR Ship_select_text[GR_NUM_RESOLUTIONS][SHIP_SELECT_NUM_TEXT] = { { // GR_640 { "Reset", 1337, 580, 337, UI_XSTR_COLOR_GREEN, -1, &Ship_select_buttons[0][SS_BUTTON_RESET].button } }, { // GR_1024 { "Reset", 1337, 938, 546, UI_XSTR_COLOR_GREEN, -1, &Ship_select_buttons[1][SS_BUTTON_RESET].button } } }; #endif // Mask bitmap pointer and Mask bitmap_id static bitmap* ShipSelectMaskPtr; // bitmap pointer to the ship select mask bitmap static ubyte* ShipSelectMaskData; // pointer to actual bitmap data static int Shipselect_mask_w, Shipselect_mask_h; static int ShipSelectMaskBitmap; // bitmap id of the ship select mask bitmap static MENU_REGION Region[NUM_SHIP_SELECT_REGIONS]; static int Num_mask_regions; ////////////////////////////////////////////////////// // Drag and Drop variables ////////////////////////////////////////////////////// typedef struct ss_carry_icon_info { int from_slot; // slot index (0..11), -1 if carried from list int ship_class; // ship class of carried icon int from_x, from_y; } ss_carry_icon_info; ss_carry_icon_info Carried_ss_icon; //////////////////////////////////////////////////////////////////// // Internal function prototypes //////////////////////////////////////////////////////////////////// // render functions void draw_ship_icons(); void draw_ship_icon_with_number(int screen_offset, int ship_class); void stop_ship_animation(); void start_ship_animation(int ship_class, int play_sound=0); // pick-up int pick_from_ship_list(int screen_offset, int ship_class); void pick_from_wing(int wb_num, int ws_num); // ui related void ship_select_button_do(int i); void ship_select_common_init(); void ss_reset_selected_ship(); void ss_restore_loadout(); void maybe_change_selected_wing_ship(int wb_num, int ws_num); // init functions void ss_init_pool(team_data *pteam); int create_wings(); // loading/unloading void ss_unload_icons(); void ss_init_units(); void unload_ship_anim_instances(); void unload_ship_anims(); anim* ss_load_individual_animation(int ship_class); // Carry icon functions int ss_icon_being_carried(); void ss_reset_carried_icon(); void ss_set_carried_icon(int from_slot, int ship_class); #define SHIP_DESC_X 445 #define SHIP_DESC_Y 273 const char *ss_tooltip_handler(const char *str) { if (Selected_ss_class < 0) return NULL; if (!stricmp(str, NOX("@ship_name"))) { return Ship_info[Selected_ss_class].name; } else if (!stricmp(str, NOX("@ship_type"))) { return Ship_info[Selected_ss_class].type_str; } else if (!stricmp(str, NOX("@ship_maneuverability"))) { return Ship_info[Selected_ss_class].maneuverability_str; } else if (!stricmp(str, NOX("@ship_armor"))) { return Ship_info[Selected_ss_class].armor_str; } else if (!stricmp(str, NOX("@ship_manufacturer"))) { return Ship_info[Selected_ss_class].manufacturer_str; } else if (!stricmp(str, NOX("@ship_desc"))) { char *str; int x, y, w, h; str = Ship_info[Selected_ss_class].desc; if (!str) return NULL; gr_get_string_size(&w, &h, str); x = SHIP_DESC_X - w / 2; y = SHIP_DESC_Y - h / 2; gr_set_color_fast(&Color_black); gr_rect(x - 5, y - 5, w + 10, h + 10); gr_set_color_fast(&Color_bright_white); gr_string(x, y, str); return NULL; } return NULL; } // Is an icon being carried? int ss_icon_being_carried() { if ( Carried_ss_icon.ship_class >= 0 ) { return 1; } return 0; } // Clear out carried icon info void ss_reset_carried_icon() { Carried_ss_icon.from_slot = -1; Carried_ss_icon.ship_class = -1; } // return !0 if carried icon has moved from where it was picked up int ss_carried_icon_moved() { int mx, my; mouse_get_pos( &mx, &my ); if ( Carried_ss_icon.from_x != mx || Carried_ss_icon.from_y != my) { return 1; } return 0; } // Set carried icon data void ss_set_carried_icon(int from_slot, int ship_class) { Carried_ss_icon.from_slot = from_slot; Carried_ss_icon.ship_class = ship_class; // Set the mouse to captured Ship_select_buttons[gr_screen.res][SS_BUTTON_DUMMY].button.capture_mouse(); } // clear all active list items, and reset the flags inside the SS_active_items[] array void clear_active_list() { int i; for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { SS_active_items[i].flags = 0; SS_active_items[i].ship_class = -1; } list_init(&SS_active_head); SS_active_list_start = 0; SS_active_list_size = 0; } // get a free element from SS_active_items[] ss_active_item *get_free_active_list_node() { int i; for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { if ( SS_active_items[i].flags == 0 ) { SS_active_items[i].flags |= SS_ACTIVE_ITEM_USED; return &SS_active_items[i]; } } return NULL; } // add a ship into the active list void active_list_add(int ship_class) { ss_active_item *sai; sai = get_free_active_list_node(); Assert(sai != NULL); sai->ship_class = ship_class; list_append(&SS_active_head, sai); } // remove a ship from the active list void active_list_remove(int ship_class) { ss_active_item *sai, *temp; // next store players not assigned to wings sai = GET_FIRST(&SS_active_head); while(sai != END_OF_LIST(&SS_active_head)){ temp = GET_NEXT(sai); if ( sai->ship_class == ship_class ) { list_remove(&SS_active_head, sai); sai->flags = 0; } sai = temp; } } // Build up the ship selection active list, which is a list of all ships that the player // can choose from. void init_active_list() { int i; ss_active_item *sai; clear_active_list(); // build the active list for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { if ( Ss_pool[i] > 0 ) { sai = get_free_active_list_node(); if ( sai != NULL ) { sai->ship_class = i; list_append(&SS_active_head, sai); SS_active_list_size++; } } } } void ship_select_check_buttons() { int i; ss_buttons *b; for ( i = 0; i < NUM_SS_BUTTONS; i++ ) { b = &Ship_select_buttons[gr_screen.res][i]; if ( b->button.pressed() ) { ship_select_button_do(b->hotspot); } } } // reset the ship selection to the mission defaults void ss_reset_to_default() { if ( Game_mode & GM_MULTIPLAYER ) { Int3(); return; } stop_ship_animation(); ss_init_pool(&Team_data[Common_team]); ss_init_units(); init_active_list(); ss_reset_selected_ship(); ss_reset_carried_icon(); // reset weapons wl_reset_to_defaults(); start_ship_animation(Selected_ss_class, 1); } // ------------------------------------------------------------------- // ship_select_redraw_pressed_buttons() // // Redraw any ship select buttons that are pressed down. This function is needed // since we sometimes need to draw pressed buttons last to ensure the entire // button gets drawn (and not overlapped by other buttons) // void ship_select_redraw_pressed_buttons() { int i; ss_buttons *b; common_redraw_pressed_buttons(); for ( i = 0; i < NUM_SS_BUTTONS; i++ ) { b = &Ship_select_buttons[gr_screen.res][i]; if ( b->button.pressed() ) { b->button.draw_forced(2); } } } void ship_select_buttons_init() { ss_buttons *b; int i; for ( i = 0; i < NUM_SS_BUTTONS; i++ ) { b = &Ship_select_buttons[gr_screen.res][i]; b->button.create( &Ship_select_ui_window, "", b->x, b->y, 60, 30, b->scrollable); // set up callback for when a mouse first goes over a button b->button.set_highlight_action( common_play_highlight_sound ); b->button.set_bmaps(b->filename); b->button.link_hotspot(b->hotspot); } #ifndef MAKE_FS1 // add all xstrs for(i=0; i<SHIP_SELECT_NUM_TEXT; i++){ Ship_select_ui_window.add_XSTR(&Ship_select_text[gr_screen.res][i]); } #endif // We don't want to have the reset button appear in multiplayer if ( Game_mode & GM_MULTIPLAYER ) { Ship_select_buttons[gr_screen.res][SS_BUTTON_RESET].button.disable(); Ship_select_buttons[gr_screen.res][SS_BUTTON_RESET].button.hide(); } Ship_select_buttons[gr_screen.res][SS_BUTTON_DUMMY].button.disable(); Ship_select_buttons[gr_screen.res][SS_BUTTON_DUMMY].button.hide(); } // ------------------------------------------------------------------------------------- // ship_select_button_do() do the button action for the specified pressed button // void ship_select_button_do(int i) { if ( Background_playing ) return; switch ( i ) { case SHIP_SELECT_SHIP_SCROLL_UP: if ( Current_screen != ON_SHIP_SELECT ) break; if ( common_scroll_down_pressed(&SS_active_list_start, SS_active_list_size, MAX_ICONS_ON_SCREEN) ) { gamesnd_play_iface(SND_SCROLL); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case SHIP_SELECT_SHIP_SCROLL_DOWN: if ( Current_screen != ON_SHIP_SELECT ) break; if ( common_scroll_up_pressed(&SS_active_list_start, SS_active_list_size, MAX_ICONS_ON_SCREEN) ) { gamesnd_play_iface(SND_SCROLL); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case SHIP_SELECT_RESET: ss_reset_to_default(); break; } // end switch } // --------------------------------------------------------------------- // ship_select_init() is called once when the ship select screen begins // // void ship_select_init() { common_set_interface_palette("ShipPalette"); common_flash_button_init(); // if in multiplayer -- set my state to be ship select if ( Game_mode & GM_MULTIPLAYER ){ // also set the ship which is mine as the default maybe_change_selected_wing_ship(Net_player->p_info.ship_index/4,Net_player->p_info.ship_index % 4); } set_active_ui(&Ship_select_ui_window); Current_screen = ON_SHIP_SELECT; Ss_mouse_down_on_region = -1; help_overlay_set_state(SS_OVERLAY,0); if ( Ship_select_open ) { start_ship_animation( Selected_ss_class ); common_buttons_maybe_reload(&Ship_select_ui_window); // AL 11-21-97: this is necessary since we may returning from the hotkey // screen, which can release common button bitmaps. common_reset_buttons(); nprintf(("Alan","ship_select_init() returning without doing anything\n")); return; } nprintf(("Alan","entering ship_select_init()\n")); common_select_init(); ShipSelectMaskBitmap = bm_load(Ship_select_background_mask_fname[gr_screen.res]); if (ShipSelectMaskBitmap < 0) { if (gr_screen.res == GR_640) { Error(LOCATION,"Could not load in 'shipselect-m'!"); } else if (gr_screen.res == GR_1024) { Error(LOCATION,"Could not load in '2_shipselect-m'!"); } } Shipselect_mask_w = -1; Shipselect_mask_h = -1; // get a pointer to bitmap by using bm_lock() ShipSelectMaskPtr = bm_lock(ShipSelectMaskBitmap, 8, BMP_AABITMAP); ShipSelectMaskData = (ubyte*)ShipSelectMaskPtr->data; bm_get_info(ShipSelectMaskBitmap, &Shipselect_mask_w, &Shipselect_mask_h); help_overlay_load(SS_OVERLAY); // Set up the mask regions // initialize the different regions of the menu that will react when the mouse moves over it Num_mask_regions = 0; snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_BRIEFING_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_SS_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_WEAPON_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_COMMIT_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_HELP_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", COMMON_OPTIONS_REGION, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_SHIP_SCROLL_UP, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_SHIP_SCROLL_DOWN, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_ICON_0, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_ICON_1, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_ICON_2, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", SHIP_SELECT_ICON_3, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_0_SHIP_0, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_0_SHIP_1, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_0_SHIP_2, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_0_SHIP_3, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_1_SHIP_0, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_1_SHIP_1, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_1_SHIP_2, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_1_SHIP_3, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_2_SHIP_0, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_2_SHIP_1, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_2_SHIP_2, 0); snazzy_menu_add_region(&Region[Num_mask_regions++], "", WING_2_SHIP_3, 0); Ship_select_open = 1; // This game-wide global flag is set to 1 to indicate that the ship // select screen has been opened and memory allocated. This flag // is needed so we can know if ship_select_close() needs to called if // restoring a game from the Options screen invoked from ship select // init ship selection masks and buttons Ship_select_ui_window.create( 0, 0, gr_screen.max_w, gr_screen.max_h, 0 ); Ship_select_ui_window.set_mask_bmap(Ship_select_background_mask_fname[gr_screen.res]); Ship_select_ui_window.tooltip_handler = ss_tooltip_handler; common_buttons_init(&Ship_select_ui_window); ship_select_buttons_init(); start_ship_animation( Selected_ss_class ); // init ship selection background bitmpa Ship_select_background_bitmap = bm_load(Ship_select_background_fname[gr_screen.res]); } // Return the ship class for the icon specified by index. Need to iterate through the active // list of icons to find out what ship class for this icon // // input: index => list index (0..3) // exit: ship class, -1 if none // int ss_get_ship_class_from_list(int index) { ss_active_item *sai; int list_entry, i, count; i = 0; count = 0; list_entry = -1; for ( sai = GET_FIRST(&SS_active_head); sai != END_OF_LIST(&SS_active_head); sai = GET_NEXT(sai) ) { count++; if ( count <= SS_active_list_start ) continue; if ( i >= MAX_ICONS_ON_SCREEN ) break; if ( i == index ) { list_entry = sai->ship_class; break; } i++; } return list_entry; } // --------------------------------------------------------------------- // maybe_pick_up_list_icon() // void maybe_pick_up_list_icon(int offset) { int ship_class; ship_class = ss_get_ship_class_from_list(offset); if ( ship_class != -1 ) { pick_from_ship_list(offset, ship_class); } } // --------------------------------------------------------------------- // maybe_change_selected_ship() // void maybe_change_selected_ship(int offset) { int ship_class; ship_class = ss_get_ship_class_from_list(offset); if ( ship_class == -1 ) return; if ( Ss_mouse_down_on_region != (SHIP_SELECT_ICON_0+offset) ) { return; } if ( Selected_ss_class == -1 ) { Selected_ss_class = ship_class; start_ship_animation(Selected_ss_class, 1); } else if ( Selected_ss_class != ship_class ) { Selected_ss_class = ship_class; start_ship_animation(Selected_ss_class, 1); } else Assert( Selected_ss_class == ship_class ); } void maybe_change_selected_wing_ship(int wb_num, int ws_num) { ss_slot_info *ss_slot; Assert(wb_num >= 0 && wb_num < MAX_WING_BLOCKS); Assert(ws_num >= 0 && ws_num < MAX_WING_SLOTS); if ( Ss_wings[wb_num].wingnum < 0 ) { return; } ss_slot = &Ss_wings[wb_num].ss_slots[ws_num]; switch ( ss_slot->status & ~WING_SLOT_LOCKED ) { case WING_SLOT_FILLED: case WING_SLOT_FILLED|WING_SLOT_IS_PLAYER: if ( Selected_ss_class != -1 && Selected_ss_class != Wss_slots[wb_num*4+ws_num].ship_class ) { Selected_ss_class = Wss_slots[wb_num*4+ws_num].ship_class; start_ship_animation(Selected_ss_class, 1); } break; default: // do nothing break; } // end switch } // --------------------------------------------------------------------- // do_mouse_over_wing_slot() // // returns: 0 => icon wasn't dropped onto slot // 1 => icon was dropped onto slot int do_mouse_over_wing_slot(int block, int slot) { Hot_ss_slot = block*4 + slot; if ( !mouse_down(MOUSE_LEFT_BUTTON) ) { if ( ss_icon_being_carried() ) { if ( ss_disabled_slot(block*4+slot) ) { gamesnd_play_iface(SND_ICON_DROP); return 0; } if ( !ss_carried_icon_moved() ) { ss_reset_carried_icon(); return 0; } ss_drop(Carried_ss_icon.from_slot, Carried_ss_icon.ship_class, Hot_ss_slot, -1); ss_reset_carried_icon(); } } else { if ( Ss_mouse_down_on_region == (WING_0_SHIP_0+block*4+slot) ) { pick_from_wing(block, slot); } } return 1; } void do_mouse_over_list_slot(int index) { Hot_ss_icon = index; if ( Ss_mouse_down_on_region != (SHIP_SELECT_ICON_0+index) ){ return; } if ( mouse_down(MOUSE_LEFT_BUTTON) ) maybe_pick_up_list_icon(index); } // Icon has been dropped, but not onto a wing slot void ss_maybe_drop_icon() { if ( Drop_icon_mflag ) { if ( ss_icon_being_carried() ) { // Add back into the ship entry list if ( Carried_ss_icon.from_slot >= 0 ) { // return to list ss_drop(Carried_ss_icon.from_slot, -1, -1, Carried_ss_icon.ship_class); } else { if ( ss_carried_icon_moved() ) { gamesnd_play_iface(SND_ICON_DROP); } } ss_reset_carried_icon(); } } } void ss_anim_pause() { if ( Selected_ss_class >= 0 && Ss_icons[Selected_ss_class].anim_instance ) { anim_pause(Ss_icons[Selected_ss_class].anim_instance); } } void ss_anim_unpause() { if ( Selected_ss_class >= 0 && Ss_icons[Selected_ss_class].anim_instance ) { anim_unpause(Ss_icons[Selected_ss_class].anim_instance); } } // maybe flash a button if player hasn't done anything for a while void ss_maybe_flash_button() { if ( common_flash_bright() ) { // weapon loadout button if ( Common_buttons[Current_screen-1][gr_screen.res][2].button.button_hilighted() ) { common_flash_button_init(); } else { Common_buttons[Current_screen-1][gr_screen.res][2].button.draw_forced(1); } } } // ------------------------------------------------------------------------------------- // ship_select_render(float frametime) // void ship_select_render(float frametime) { if ( !Background_playing ) { gr_set_bitmap(Ship_select_background_bitmap, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); gr_bitmap(0, 0); } anim_render_all(0, frametime); anim_render_all(ON_SHIP_SELECT, frametime); } // blit any active ship information text void ship_select_blit_ship_info() { #ifndef MAKE_FS1 int y_start; ship_info *sip; char str[100]; color *header = &Color_white; color *text = &Color_green; // if we don't have a valid ship selected, do nothing if(Selected_ss_class == -1){ return; } // get the ship class sip = &Ship_info[Selected_ss_class]; // starting line y_start = Ship_info_coords[gr_screen.res][SHIP_SELECT_Y_COORD]; memset(str,0,100); // blit the ship class (name) gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Class",739)); y_start += 10; if(strlen(sip->name)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->name); } y_start += 10; // blit the ship type gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Type",740)); y_start += 10; if((sip->type_str != NULL) && strlen(sip->type_str)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->type_str); } y_start+=10; // blit the ship length gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Length",741)); y_start += 10; if((sip->ship_length != NULL) && strlen(sip->ship_length)){ if (Lcl_gr) { // in german, drop the s from Meters and make sure M is caps char *sp = strstr(sip->ship_length, "Meters"); if (sp) { sp[5] = ' '; // make the old s a space now } } gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start, sip->ship_length); } y_start += 10; // blit the max velocity gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Max Velocity",742)); y_start += 10; sprintf(str,XSTR("%d m/s",743),(int)sip->max_vel.xyz.z); gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,str); y_start += 10; // blit the maneuverability gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Maneuverability",744)); y_start += 10; if((sip->maneuverability_str != NULL) && strlen(sip->maneuverability_str)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->maneuverability_str); } y_start += 10; // blit the armor gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Armor",745)); y_start += 10; if((sip->armor_str != NULL) && strlen(sip->armor_str)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->armor_str); } y_start += 10; // blit the gun mounts gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Gun Mounts",746)); y_start += 10; if((sip->gun_mounts != NULL) && strlen(sip->gun_mounts)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->gun_mounts); } y_start += 10; // blit the missile banke gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Missile Banks",747)); y_start += 10; if((sip->missile_banks != NULL) && strlen(sip->missile_banks)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->missile_banks); } y_start += 10; // blit the manufacturer gr_set_color_fast(header); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start,XSTR("Manufacturer",748)); y_start += 10; if((sip->manufacturer_str != NULL) && strlen(sip->manufacturer_str)){ gr_set_color_fast(text); gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD]+4, y_start,sip->manufacturer_str); } y_start += 10; // blit the _short_ text description /* Assert(Multi_ts_ship_info_line_count < 3); gr_set_color_fast(&Color_normal); for(idx=0;idx<SHIP_SELECT_ship_info_line_count;idx++){ gr_string(Ship_info_coords[gr_screen.res][SHIP_SELECT_X_COORD], y_start, SHIP_SELECT_ship_info_lines[idx]); y_start += 10; } */ #endif } // --------------------------------------------------------------------- // ship_select_do() is called once per game frame, and is responsible for // updating the ship select screen // // frametime is in seconds void ship_select_do(float frametime) { int k, ship_select_choice, snazzy_action; ship_select_choice = snazzy_menu_do(ShipSelectMaskData, Shipselect_mask_w, Shipselect_mask_h, Num_mask_regions, Region, &snazzy_action, 0); Hot_ss_icon = -1; Hot_ss_slot = -1; k = common_select_do(frametime); if ( help_overlay_active(SS_OVERLAY) ) { ss_anim_pause(); } else { ss_anim_unpause(); } // Check common keypresses common_check_keys(k); if ( Mouse_down_last_frame ) { Ss_mouse_down_on_region = ship_select_choice; } // Check for the mouse over a region (not clicked, just over) if ( ship_select_choice > -1 ) { switch(ship_select_choice) { case SHIP_SELECT_ICON_0: do_mouse_over_list_slot(0); break; case SHIP_SELECT_ICON_1: do_mouse_over_list_slot(1); break; case SHIP_SELECT_ICON_2: do_mouse_over_list_slot(2); break; case SHIP_SELECT_ICON_3: do_mouse_over_list_slot(3); break; case WING_0_SHIP_0: if ( do_mouse_over_wing_slot(0,0) ) ship_select_choice = -1; break; case WING_0_SHIP_1: if ( do_mouse_over_wing_slot(0,1) ) ship_select_choice = -1; break; case WING_0_SHIP_2: if ( do_mouse_over_wing_slot(0,2) ) ship_select_choice = -1; break; case WING_0_SHIP_3: if ( do_mouse_over_wing_slot(0,3) ) ship_select_choice = -1; break; case WING_1_SHIP_0: if ( do_mouse_over_wing_slot(1,0) ) ship_select_choice = -1; break; case WING_1_SHIP_1: if ( do_mouse_over_wing_slot(1,1) ) ship_select_choice = -1; break; case WING_1_SHIP_2: if ( do_mouse_over_wing_slot(1,2) ) ship_select_choice = -1; break; case WING_1_SHIP_3: if ( do_mouse_over_wing_slot(1,3) ) ship_select_choice = -1; break; case WING_2_SHIP_0: if ( do_mouse_over_wing_slot(2,0) ) ship_select_choice = -1; break; case WING_2_SHIP_1: if ( do_mouse_over_wing_slot(2,1) ) ship_select_choice = -1; break; case WING_2_SHIP_2: if ( do_mouse_over_wing_slot(2,2) ) ship_select_choice = -1; break; case WING_2_SHIP_3: if ( do_mouse_over_wing_slot(2,3) ) ship_select_choice = -1; break; default: break; } // end switch } // check buttons common_check_buttons(); ship_select_check_buttons(); // Check for the mouse clicks over a region if ( ship_select_choice > -1 && snazzy_action == SNAZZY_CLICKED ) { switch (ship_select_choice) { case SHIP_SELECT_ICON_0: maybe_change_selected_ship(0); break; case SHIP_SELECT_ICON_1: maybe_change_selected_ship(1); break; case SHIP_SELECT_ICON_2: maybe_change_selected_ship(2); break; case SHIP_SELECT_ICON_3: maybe_change_selected_ship(3); break; case WING_0_SHIP_0: maybe_change_selected_wing_ship(0,0); break; case WING_0_SHIP_1: maybe_change_selected_wing_ship(0,1); break; case WING_0_SHIP_2: maybe_change_selected_wing_ship(0,2); break; case WING_0_SHIP_3: maybe_change_selected_wing_ship(0,3); break; case WING_1_SHIP_0: maybe_change_selected_wing_ship(1,0); break; case WING_1_SHIP_1: maybe_change_selected_wing_ship(1,1); break; case WING_1_SHIP_2: maybe_change_selected_wing_ship(1,2); break; case WING_1_SHIP_3: maybe_change_selected_wing_ship(1,3); break; case WING_2_SHIP_0: maybe_change_selected_wing_ship(2,0); break; case WING_2_SHIP_1: maybe_change_selected_wing_ship(2,1); break; case WING_2_SHIP_2: maybe_change_selected_wing_ship(2,2); break; case WING_2_SHIP_3: maybe_change_selected_wing_ship(2,3); break; default: break; } // end switch } ss_maybe_drop_icon(); if ( Ship_anim_class >= 0) { Assert(Selected_ss_class >= 0); if ( Ss_icons[Selected_ss_class].anim_instance->frame_num == Ss_icons[Selected_ss_class].anim_instance->stop_at ) { nprintf(("anim", "Frame number = %d, Stop at %d\n", Ss_icons[Selected_ss_class].anim_instance->frame_num, Ss_icons[Selected_ss_class].anim_instance->stop_at)); anim_play_struct aps; anim_release_render_instance(Ss_icons[Selected_ss_class].anim_instance); anim_play_init(&aps, Ss_icons[Selected_ss_class].anim, Ship_anim_coords[gr_screen.res][0], Ship_anim_coords[gr_screen.res][1]); aps.start_at = SHIP_ANIM_LOOP_FRAME; // aps.start_at = 0; aps.screen_id = ON_SHIP_SELECT; aps.framerate_independent = 1; aps.skip_frames = 0; Ss_icons[Selected_ss_class].anim_instance = anim_play(&aps); } } gr_reset_clip(); ship_select_render(frametime); if ( !Background_playing ) { Ship_select_ui_window.draw(); ship_select_redraw_pressed_buttons(); common_render_selected_screen_button(); } // The background transition plays once. Display ship icons after Background done playing if ( !Background_playing ) { draw_ship_icons(); for ( int i = 0; i < MAX_WING_BLOCKS; i++ ) { draw_wing_block(i, Hot_ss_slot, -1, Selected_ss_class); } } if ( ss_icon_being_carried() ) { int mouse_x, mouse_y; mouse_get_pos( &mouse_x, &mouse_y ); gr_set_bitmap(Ss_icons[Carried_ss_icon.ship_class].icon_bmaps[ICON_FRAME_SELECTED], GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); gr_bitmap(mouse_x + Ss_delta_x , mouse_y + Ss_delta_y); } // draw out ship information ship_select_blit_ship_info(); ss_maybe_flash_button(); // blit help overlay if active help_overlay_maybe_blit(SS_OVERLAY); // If the commit button was pressed, do the commit button actions. Done at the end of the // loop so there isn't a skip in the animation (since ship_create() can take a long time if // the ship model is not in memory if ( Commit_pressed ) { commit_pressed(); Commit_pressed = 0; } gr_flip(); if ( Game_mode & GM_MULTIPLAYER ) { if ( Selected_ss_class >= 0 ) Net_player->p_info.ship_class = Selected_ss_class; } if(!Background_playing){ // should render this as close to last as possible so it overlaps all controls // chatbox_render(); } // If the commit button was pressed, do the commit button actions. Done at the end of the // loop so there isn't a skip in the animation (since ship_create() can take a long time if // the ship model is not in memory if ( Commit_pressed ) { commit_pressed(); Commit_pressed = 0; } } // ------------------------------------------------------------------------ // ship_select_close() is called once when the ship select screen is exited // // void ship_select_close() { key_flush(); if ( !Ship_select_open ) { nprintf(("Alan","ship_select_close() returning without doing anything\n")); return; } nprintf(("Alan", "Entering ship_select_close()\n")); // done with the bitmaps, so unlock it bm_unlock(ShipSelectMaskBitmap); // unload the bitmaps bm_unload(ShipSelectMaskBitmap); help_overlay_unload(SS_OVERLAY); // release the bitmpas that were previously extracted from anim files ss_unload_icons(); // Release any active ship anim instances unload_ship_anim_instances(); // unload ship animations if they were loaded unload_ship_anims(); Ship_select_ui_window.destroy(); #ifdef MAKE_FS1 common_free_interface_palette(); #endif Ship_anim_class = -1; Ship_select_open = 0; // This game-wide global flag is set to 0 to indicate that the ship // select screen has been closed and memory freed. This flag // is needed so we can know if ship_select_close() needs to called if // restoring a game from the Options screen invoked from ship select } // ss_unload_icons() frees the bitmaps used for ship icons void ss_unload_icons() { int i,j; ss_icon_info *icon; for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { icon = &Ss_icons[i]; for ( j = 0; j < NUM_ICON_FRAMES; j++ ) { if ( icon->icon_bmaps[j] >= 0 ) { bm_release(icon->icon_bmaps[j]); icon->icon_bmaps[j] = -1; } } } } // ------------------------------------------------------------------------ // draw_ship_icons() will request which icons to draw on screen. void draw_ship_icons() { int i; int count=0; ss_active_item *sai; i = 0; for ( sai = GET_FIRST(&SS_active_head); sai != END_OF_LIST(&SS_active_head); sai = GET_NEXT(sai) ) { count++; if ( count <= SS_active_list_start ) continue; if ( i >= MAX_ICONS_ON_SCREEN ) break; draw_ship_icon_with_number(i, sai->ship_class); i++; } } // ------------------------------------------------------------------------ // draw_ship_icon_with_number() will draw a ship icon on screen with the // number of available ships to the left. // // void draw_ship_icon_with_number(int screen_offset, int ship_class) { char buf[32]; int num_x,num_y; ss_icon_info *ss_icon; Assert( screen_offset >= 0 && screen_offset <= 3 ); Assert( ship_class >= 0 ); ss_icon = &Ss_icons[ship_class]; num_x = Ship_list_coords[gr_screen.res][screen_offset][2]; num_y = Ship_list_coords[gr_screen.res][screen_offset][3]; // assume default bitmap is to be used ss_icon->current_icon_bitmap = ss_icon->icon_bmaps[ICON_FRAME_NORMAL]; // next check if ship has mouse over it if ( Hot_ss_icon > -1 ) { Assert(Hot_ss_icon <= 3); if ( Hot_ss_icon == screen_offset ) ss_icon->current_icon_bitmap = ss_icon->icon_bmaps[ICON_FRAME_HOT]; } // highest precedence is if the ship is selected if ( Selected_ss_class > -1 ) { if ( Selected_ss_class == ship_class ) ss_icon->current_icon_bitmap = ss_icon->icon_bmaps[ICON_FRAME_SELECTED]; } if ( Ss_pool[ship_class] <= 0 ) { return; } // blit the icon gr_set_bitmap(ss_icon->current_icon_bitmap, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); gr_bitmap(Ship_list_coords[gr_screen.res][screen_offset][0], Ship_list_coords[gr_screen.res][screen_offset][1]); // blit the number sprintf(buf, "%d", Ss_pool[ship_class] ); gr_set_color_fast(&Color_white); gr_string(num_x, num_y, buf); } // ------------------------------------------------------------------------ // stop_ship_animation() will halt the currently playing ship animation. The // instance will be freed, (but the compressed data is not freed). The animation // will not display after this function is called (even on this frame), since // the instance is removed from the anim_render_list. void stop_ship_animation() { ss_icon_info *ss_icon; if ( Ship_anim_class == -1 ) return; ss_icon = &Ss_icons[Ship_anim_class]; anim_release_render_instance(ss_icon->anim_instance); ss_icon->anim_instance = NULL; Ship_anim_class = -1; } // ------------------------------------------------------------------------ // this loads an individual animation file // it attempts to load a hires version (ie, it attaches a "2_" in front of the // filename. if no hires version is available, it defaults to the lowres anim* ss_load_individual_animation(int ship_class) { anim *p_anim; char animation_filename[CF_MAX_FILENAME_LENGTH+4]; // 1024x768 SUPPORT // If we are in 1024x768, we first want to append "2_" in front of the filename if (gr_screen.res == GR_1024) { Assert(strlen(Ship_info[ship_class].anim_filename) <= 30); strcpy(animation_filename, "2_"); strcat(animation_filename, Ship_info[ship_class].anim_filename); // now check if file exists // GRR must add a .ANI at the end for detection strcat(animation_filename, ".ani"); p_anim = anim_load(animation_filename, 1); if (p_anim == NULL) { // failed loading hi-res, revert to low res strcpy(animation_filename, Ship_info[ship_class].anim_filename); p_anim = anim_load(animation_filename, 1); mprintf(("Ship ANI: Can not find %s, using lowres version instead.\n", animation_filename)); } else { mprintf(("SHIP ANI: Found hires version of %s\n",animation_filename)); } /* // this is lame and doesnt work cuz cf_exist() doesnt search the packfiles if (!cf_exist(animation_filename, CF_TYPE_INTERFACE)) { // file does not exist, use original low res version strcpy(animation_filename, Ship_info[ship_class].anim_filename); mprintf(("Ship ANI: Can not find %s, using lowres version instead.\n", animation_filename)); } else { animation_filename[strlen(animation_filename) - 4] = '\0'; mprintf(("SHIP ANI: Found hires version of %s\n",animation_filename)); } */ } else { strcpy(animation_filename, Ship_info[ship_class].anim_filename); p_anim = anim_load(animation_filename, 1); } return p_anim; } // ------------------------------------------------------------------------ // start_ship_animation() will start a ship animation playing, and will // load the compressed anim from disk if required. void start_ship_animation(int ship_class, int play_sound) { ss_icon_info *ss_icon; Assert( ship_class >= 0 ); if ( Ship_anim_class == ship_class ) return; if ( Ship_anim_class >= 0 ) { stop_ship_animation(); } ss_icon = &Ss_icons[ship_class]; // see if we need to load in the animation from disk if ( ss_icon->anim == NULL ) { ss_icon->anim = ss_load_individual_animation(ship_class); } // see if we need to get an instance if ( ss_icon->anim_instance == NULL ) { anim_play_struct aps; anim_play_init(&aps, ss_icon->anim, Ship_anim_coords[gr_screen.res][0], Ship_anim_coords[gr_screen.res][1]); aps.screen_id = ON_SHIP_SELECT; aps.framerate_independent = 1; aps.skip_frames = 0; ss_icon->anim_instance = anim_play(&aps); } Ship_anim_class = ship_class; // if ( play_sound ) { gamesnd_play_iface(SND_SHIP_ICON_CHANGE); // } } // ------------------------------------------------------------------------ // unload_ship_anims() will free all compressed anims from memory that were // loaded for the ship animations. // // void unload_ship_anims() { for ( int i = 0; i < MAX_SHIP_TYPES; i++ ) { if ( Ss_icons[i].anim ) { anim_free(Ss_icons[i].anim); Ss_icons[i].anim = NULL; } } } // ------------------------------------------------------------------------ // unload_ship_anim_instances() will free any active ship animation instances. // // void unload_ship_anim_instances() { for ( int i = 0; i < MAX_SHIP_TYPES; i++ ) { if ( Ss_icons[i].anim_instance ) { anim_release_render_instance(Ss_icons[i].anim_instance); Ss_icons[i].anim_instance = NULL; } } } // ------------------------------------------------------------------------ // commit_pressed() is called when the commit button from any of the briefing/ship select/ weapon // select screens is pressed. The ship selected is created, and the interface music is stopped. void commit_pressed() { int player_ship_info_index; if ( Wss_num_wings > 0 ) { if(!(Game_mode & GM_MULTIPLAYER)){ int rc; rc = create_wings(); if (rc != 0) { gamesnd_play_iface(SND_GENERAL_FAIL); return; } } } else { if ( Selected_ss_class == -1 ) { player_ship_info_index = Team_data[Common_team].default_ship; } else { Assert(Selected_ss_class >= 0 ); player_ship_info_index = Selected_ss_class; } update_player_ship( player_ship_info_index ); if ( wl_update_ship_weapons(Ships[Player_obj->instance].objnum, &Wss_slots[0]) == -1 ) { popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "Player ship has no weapons", 461)); return; } } // Check to ensure that the hotkeys are still pointing to valid objects. It is possible // for the player to assign a ship to a hotkey, then go and delete that ship in the // ship selection, and then try to start the mission. This function will detect those objects, // and remove them from the hotkey linked lists. mission_hotkey_validate(); gamesnd_play_iface(SND_COMMIT_PRESSED); // save the player loadout if ( !(Game_mode & GM_MULTIPLAYER) ) { strcpy(Player_loadout.filename, Game_current_mission_filename); strcpy(Player_loadout.last_modified, The_mission.modified); wss_save_loadout(); } // move to the next stage // in multiplayer this is the final mission sync if(Game_mode & GM_MULTIPLAYER){ Multi_sync_mode = MULTI_SYNC_POST_BRIEFING; gameseq_post_event(GS_EVENT_MULTI_MISSION_SYNC); // otherwise tell the standalone to move everyone into this state and continue if((Net_player->flags & NETINFO_FLAG_GAME_HOST) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER)){ send_mission_sync_packet(MULTI_SYNC_POST_BRIEFING); } } // in single player we jump directly into the mission else { gameseq_post_event(GS_EVENT_ENTER_GAME); } } // ------------------------------------------------------------------------ // pick_from_ship_list() will determine if an icon from the ship selection // list can be picked up (for drag and drop). It calculates the difference // in x & y between the icon and the mouse, so we can move the icon with the // mouse in a realistic way int pick_from_ship_list(int screen_offset, int ship_class) { int rval = -1; Assert(ship_class >= 0); if ( Wss_num_wings == 0 ) return rval; // If carrying an icon, then do nothing if ( ss_icon_being_carried() ) return rval; if ( Ss_pool[ship_class] > 0 ) { int mouse_x, mouse_y; ss_set_carried_icon(-1, ship_class); mouse_get_pos( &mouse_x, &mouse_y ); Ss_delta_x = Ship_list_coords[gr_screen.res][screen_offset][0] - mouse_x; Ss_delta_y = Ship_list_coords[gr_screen.res][screen_offset][1] - mouse_y; Assert( Ss_pool[ship_class] >= 0 ); rval = 0; } common_flash_button_init(); return rval; } // ------------------------------------------------------------------------ // pick_from_wing() will determine if an icon from the wing formation (wb_num) // and slot number (ws_num) can be picked up (for drag and drop). It calculates // the difference in x & y between the icon and the mouse, so we can move the icon with the // mouse in a realistic way void pick_from_wing(int wb_num, int ws_num) { int slot_index; Assert(wb_num >= 0 && wb_num < MAX_WING_BLOCKS); Assert(ws_num >= 0 && ws_num < MAX_WING_SLOTS); ss_wing_info *wb; ss_slot_info *ws; wb = &Ss_wings[wb_num]; ws = &wb->ss_slots[ws_num]; slot_index = wb_num*4+ws_num; if ( wb->wingnum < 0 ) return; // Take care of case where the mouse button goes from up to down in one frame while // carrying an icon if ( Drop_on_wing_mflag && ss_icon_being_carried() ) { if ( !ss_disabled_slot(slot_index) ) { ss_drop(Carried_ss_icon.from_slot, Carried_ss_icon.ship_class, slot_index, -1); ss_reset_carried_icon(); gamesnd_play_iface(SND_ICON_DROP_ON_WING); } } if ( ss_icon_being_carried() ) return; if ( ss_disabled_slot(slot_index) ) { return; } switch ( ws->status ) { case WING_SLOT_DISABLED: case WING_SLOT_IGNORE: return; break; case WING_SLOT_EMPTY: case WING_SLOT_EMPTY|WING_SLOT_IS_PLAYER: // TODO: add fail sound return; break; case WING_SLOT_FILLED|WING_SLOT_IS_PLAYER: case WING_SLOT_FILLED: { int mouse_x, mouse_y; Assert(Wss_slots[slot_index].ship_class >= 0); ss_set_carried_icon(slot_index, Wss_slots[slot_index].ship_class); mouse_get_pos( &mouse_x, &mouse_y ); Ss_delta_x = Wing_icon_coords[gr_screen.res][slot_index][0] - mouse_x; Ss_delta_y = Wing_icon_coords[gr_screen.res][slot_index][1] - mouse_y; Carried_ss_icon.from_x = mouse_x; Carried_ss_icon.from_y = mouse_y; } break; default: Int3(); break; } // end switch common_flash_button_init(); } // ------------------------------------------------------------------------ // draw_wing_block() will draw the wing icons for the wing formation number // passed in as a parameter. // // input: wb_num => wing block number (numbering starts at 0) // hot_slot => index of slot that mouse is over // selected_slot => index of slot that is selected // class_select => all ships of this class are drawn selected (send -1 to not use) void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select) { ss_wing_info *wb; ss_slot_info *ws; ss_icon_info *icon; wing *wp; int i, bitmap_to_draw, w, h, sx, sy, slot_index; Assert(wb_num >= 0 && wb_num < MAX_WING_BLOCKS); wb = &Ss_wings[wb_num]; if ( wb->wingnum == -1 ) return; // print the wing name under the wing wp = &Wings[wb->wingnum]; gr_get_string_size(&w, &h, wp->name); sx = Wing_icon_coords[gr_screen.res][wb_num*4][0] + 16 - w/2; sy = Wing_icon_coords[gr_screen.res][wb_num*4 + 3][1] + 32 + h; gr_set_color_fast(&Color_normal); gr_string(sx, sy, wp->name); for ( i = 0; i < MAX_WING_SLOTS; i++ ) { bitmap_to_draw = -1; ws = &wb->ss_slots[i]; slot_index = wb_num*4 + i; if ( Wss_slots[slot_index].ship_class >= 0 ) { icon = &Ss_icons[Wss_slots[slot_index].ship_class]; } else { icon = NULL; } switch(ws->status & ~WING_SLOT_LOCKED ) { case WING_SLOT_FILLED: case WING_SLOT_FILLED|WING_SLOT_IS_PLAYER: Assert(icon); if ( class_select >= 0 ) { // only ship select if ( Carried_ss_icon.from_slot == slot_index ) { if ( ss_carried_icon_moved() ) { bitmap_to_draw = Wing_slot_empty_bitmap; } else { bitmap_to_draw = -1; } break; } } if ( ws->status & WING_SLOT_LOCKED ) { bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_DISABLED]; // in multiplayer, determine if this it the special case where the slot is disabled, and // it is also _my_ slot (ie, team capatains/host have not locked players yet) if((Game_mode & GM_MULTIPLAYER) && multi_ts_disabled_high_slot(slot_index)){ bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_DISABLED_HIGH]; } break; } bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_NORMAL]; if ( selected_slot == slot_index || class_select == Wss_slots[slot_index].ship_class) { bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_SELECTED]; } else if ( hot_slot == slot_index ) { if ( mouse_down(MOUSE_LEFT_BUTTON) ){ bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_SELECTED]; } else { bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_HOT]; } } if ( ws->status & WING_SLOT_IS_PLAYER && (selected_slot != slot_index) ) { bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_PLAYER]; } break; case WING_SLOT_EMPTY: case WING_SLOT_EMPTY|WING_SLOT_IS_PLAYER: bitmap_to_draw = Wing_slot_empty_bitmap; break; case WING_SLOT_DISABLED: case WING_SLOT_IGNORE: if ( icon ) { bitmap_to_draw = icon->icon_bmaps[ICON_FRAME_DISABLED]; } else { bitmap_to_draw = Wing_slot_disabled_bitmap; } break; default: Int3(); break; } // end switch if ( bitmap_to_draw != -1 ) { gr_set_bitmap(bitmap_to_draw, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); gr_bitmap(Wing_icon_coords[gr_screen.res][slot_index][0], Wing_icon_coords[gr_screen.res][slot_index][1]); } } } // called by multiplayer team select to set the slot based flags void ss_make_slot_empty(int slot_index) { int wing_num,slot_num; ss_wing_info *wb; ss_slot_info *ws; // calculate the wing # wing_num = slot_index / 4; slot_num = slot_index % 4; // get the wing and slot entries wb = &Ss_wings[wing_num]; ws = &wb->ss_slots[slot_num]; // set the flags ws->status &= ~(WING_SLOT_FILLED | WING_SLOT_DISABLED); ws->status |= WING_SLOT_EMPTY; } // called by multiplayer team select to set the slot based flags void ss_make_slot_full(int slot_index) { int wing_num,slot_num; ss_wing_info *wb; ss_slot_info *ws; // calculate the wing # wing_num = slot_index / 4; slot_num = slot_index % 4; // get the wing and slot entries wb = &Ss_wings[wing_num]; ws = &wb->ss_slots[slot_num]; // set the flags ws->status &= ~(WING_SLOT_EMPTY | WING_SLOT_DISABLED); ws->status |= WING_SLOT_FILLED; } void ss_blit_ship_icon(int x,int y,int ship_class,int bmap_num) { // blit the bitmap in the correct location if(ship_class == -1){ gr_set_bitmap(Wing_slot_empty_bitmap, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); } else { ss_icon_info *icon = &Ss_icons[ship_class]; Assert(icon->icon_bmaps[bmap_num] != -1); gr_set_bitmap(icon->icon_bmaps[bmap_num], GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1); } gr_bitmap(x,y); } // ------------------------------------------------------------------------ // unload_ship_icons() frees the memory that was used to hold the bitmaps // for ship icons // void unload_wing_icons() { if ( Wing_slot_empty_bitmap != -1 ) { bm_release(Wing_slot_empty_bitmap); Wing_slot_empty_bitmap = -1; } if ( Wing_slot_disabled_bitmap != -1 ) { bm_release(Wing_slot_disabled_bitmap); Wing_slot_disabled_bitmap = -1; } } // ------------------------------------------------------------------------ // create_wings() will ensure the correct ships are in the player wings // for the game. It works by calling change_ship_type() on the wing ships // so they match what the player selected. ship_create() is called for the // player ship (and current_count, ship_index[] is updated), since it is not yet // part of the wing structure. // // returns: 0 ==> success // !0 ==> failure int create_wings() { ss_wing_info *wb; ss_slot_info *ws; wing *wp; p_object *p_objp; int shipnum, objnum, slot_index; int cleanup_ship_index[MAX_WING_SLOTS]; int i,j,k; int found_pobj; for ( i = 0; i < MAX_WING_BLOCKS; i++ ) { wb = &Ss_wings[i]; if ( wb->wingnum == -1 ) continue; wp = &Wings[wb->wingnum]; for ( j = 0; j < MAX_WING_SLOTS; j++ ) { slot_index = i*4+j; ws = &wb->ss_slots[j]; switch ( ws->status ) { case WING_SLOT_FILLED: case WING_SLOT_FILLED|WING_SLOT_IS_PLAYER: case WING_SLOT_FILLED|WING_SLOT_LOCKED: case WING_SLOT_FILLED|WING_SLOT_IS_PLAYER|WING_SLOT_LOCKED: if ( wp->ship_index[j] >= 0 ) { Assert(Ships[wp->ship_index[j]].objnum >= 0); } if ( ws->status & WING_SLOT_IS_PLAYER ) { update_player_ship(Wss_slots[slot_index].ship_class); if ( wl_update_ship_weapons(Ships[Player_obj->instance].objnum, &Wss_slots[i*4+j]) == -1 ) { popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "Player ship has no weapons", 461)); return -1; } objnum = OBJ_INDEX(Player_obj); shipnum = Objects[objnum].instance; } else { if ( wb->is_late) { found_pobj = 0; for ( p_objp = GET_FIRST(&ship_arrival_list); p_objp != END_OF_LIST(&ship_arrival_list); p_objp = GET_NEXT(p_objp) ) { if ( p_objp->wingnum == WING_INDEX(wp) ) { if ( ws->sa_index == (p_objp-ship_arrivals) ) { p_objp->ship_class = Wss_slots[slot_index].ship_class; wl_update_parse_object_weapons(p_objp, &Wss_slots[i*4+j]); found_pobj = 1; break; } } } Assert(found_pobj); } else { // AL 10/04/97 // Change the ship type of the ship if different than current. // NOTE: This will reset the weapons for this ship. I think this is // the right thing to do, since the ships may have different numbers // of weapons and may not have the same allowed weapon types if ( Ships[wp->ship_index[j]].ship_info_index != Wss_slots[slot_index].ship_class ) change_ship_type(wp->ship_index[j], Wss_slots[slot_index].ship_class); wl_update_ship_weapons(Ships[wp->ship_index[j]].objnum, &Wss_slots[i*4+j]); } } break; case WING_SLOT_EMPTY: case WING_SLOT_EMPTY|WING_SLOT_IS_PLAYER: if ( ws->status & WING_SLOT_IS_PLAYER ) { popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "Player %s must select a place in player wing", 462), Player->callsign); return -1; } break; default: break; } } // end for (wing slot) } // end for (wing block) for ( i = 0; i < MAX_WING_BLOCKS; i++ ) { wb = &Ss_wings[i]; wp = &Wings[wb->wingnum]; if ( wb->wingnum == -1 ) continue; for ( k = 0; k < MAX_WING_SLOTS; k++ ) { cleanup_ship_index[k] = -1; } for ( j = 0; j < MAX_WING_SLOTS; j++ ) { ws = &wb->ss_slots[j]; switch( ws->status ) { case WING_SLOT_EMPTY: // delete ship that is not going to be used by the wing if ( wb->is_late ) { list_remove( &ship_arrival_list, &ship_arrivals[ws->sa_index]); wp->wave_count--; Assert(wp->wave_count >= 0); } else { shipnum = wp->ship_index[j]; Assert( shipnum >= 0 && shipnum < MAX_SHIPS ); cleanup_ship_index[j] = shipnum; ship_add_exited_ship( &Ships[shipnum], SEF_PLAYER_DELETED ); obj_delete(Ships[shipnum].objnum); hud_set_wingman_status_none( Ships[shipnum].wing_status_wing_index, Ships[shipnum].wing_status_wing_pos); } break; default: break; } // end switch } // end for (wing slot) for ( k = 0; k < MAX_WING_SLOTS; k++ ) { if ( cleanup_ship_index[k] != -1 ) { ship_wing_cleanup( cleanup_ship_index[k], wp ); } } } // end for (wing block) return 0; } void ship_stop_animation() { if ( Ship_anim_class >= 0 ) stop_ship_animation(); } // ---------------------------------------------------------------------------- // update_player_ship() // // Updates the ship class of the player ship // // parameters: si_index => ship info index of ship class to change to // // void update_player_ship(int si_index) { Assert( si_index >= 0 ); Assert( Player_obj != NULL); // AL 10/04/97 // Change the ship type of the player ship if different than current. // NOTE: This will reset the weapons for this ship. I think this is // the right thing to do, since the ships may have different numbers // of weapons and may not have the same allowed weapon types if ( Player_ship->ship_info_index != si_index ) change_ship_type(Player_obj->instance, si_index); Player->last_ship_flown_si_index = si_index; } // ---------------------------------------------------------------------------- // create a default player ship // // parameters: use_last_flown => select ship that was last flown on a mission // (this is a default parameter which is set to 1) // // returns: 0 => success // !0 => failure // int create_default_player_ship(int use_last_flown) { int player_ship_class=-1, i; // find the ship that matches the string stored in default_player_ship if ( use_last_flown ) { player_ship_class = Players[Player_num].last_ship_flown_si_index; } else { for (i = 0; i < Num_ship_types; i++) { if ( !stricmp(Ship_info[i].name, default_player_ship) ) { player_ship_class = i; Players[Player_num].last_ship_flown_si_index = player_ship_class; break; } } if (i == Num_ship_types) return 1; } update_player_ship(player_ship_class); // debug code to keep using descent style physics if the player starts a new game #ifndef NDEBUG if ( use_descent ) { use_descent = 0; toggle_player_object(); } #endif return 0; } // return the original ship class for the specified slot int ss_return_original_ship_class(int slot_num) { int wnum, snum; wnum = slot_num/4; snum = slot_num%4; return Ss_wings[wnum].ss_slots[snum].original_ship_class; } // return the ship arrival index for the slot (-1 means no ship arrival index) int ss_return_saindex(int slot_num) { int wnum, snum; wnum = slot_num/4; snum = slot_num%4; return Ss_wings[wnum].ss_slots[snum].sa_index; } // ---------------------------------------------------------------------------- // ss_return_ship() // // For a given wing slot, return the ship index if the ship has been created. // Otherwise, find the index into ship_arrivals[] for the ship // // input: wing_block => wing block of ship to find // wing_slot => wing slot of ship to find // ship_index => OUTPUT parameter: the Ships[] index of the ship in the wing slot // This value will be -1 if there is no ship created yet // ppobjp => OUTPUT parameter: returns a pointer to a parse object for // the ship that hasn't been created yet. Set to NULL if the // ship has already been created // // returns: the original ship class of the ship, or -1 if the ship doesn't exist // // NOTE: For the player wing, the player is not yet in the wp->ship_index[].. so // that is why there is an offset of 1 when getting ship indicies from the player // wing. The player is special cased by looking at the status of the wing slot // int ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp) { *ship_index = -1; *ppobjp = NULL; ss_slot_info *ws; if (!Wss_num_wings) { *ppobjp = NULL; *ship_index = Player_obj->instance; return Player_ship->ship_info_index; } if ( Ss_wings[wing_block].wingnum < 0 ) { return -1; } ws = &Ss_wings[wing_block].ss_slots[wing_slot]; // Check to see if ship is on the ship_arrivals[] list if ( ws->sa_index != -1 ) { *ship_index = -1; *ppobjp = &ship_arrivals[ws->sa_index]; } else { *ship_index = Wings[Ss_wings[wing_block].wingnum].ship_index[wing_slot]; Assert(*ship_index != -1); } return ws->original_ship_class; } // return the name of the ship in the specified wing position... if the ship is the // player ship, return the player callsign // // input: ensure at least NAME_LENGTH bytes allocated for name buffer void ss_return_name(int wing_block, int wing_slot, char *name) { ss_slot_info *ws; wing *wp; ws = &Ss_wings[wing_block].ss_slots[wing_slot]; wp = &Wings[Ss_wings[wing_block].wingnum]; if (!Wss_num_wings) { strcpy(name, Player->callsign); return; } // Check to see if ship is on the ship_arrivals[] list if ( ws->sa_index != -1 ) { strcpy(name, ship_arrivals[ws->sa_index].name); } else { ship *sp; sp = &Ships[wp->ship_index[wing_slot]]; // in multiplayer, return the callsigns of the players who are in the ships if(Game_mode & GM_MULTIPLAYER){ int player_index = multi_find_player_by_object(&Objects[sp->objnum]); if(player_index != -1){ strcpy(name,Net_players[player_index].player->callsign); } else { strcpy(name,sp->ship_name); } } else { strcpy(name, sp->ship_name); } } } int ss_get_selected_ship() { return Selected_ss_class; } // Set selected ship to the first occupied wing slot, or first ship in pool if no slots are occupied void ss_reset_selected_ship() { int i; Selected_ss_class = -1; if ( Wss_num_wings <= 0 ) { Selected_ss_class = Team_data[Common_team].default_ship; return; } // get first ship class found on slots for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { if ( Wss_slots[i].ship_class >= 0 ) { Selected_ss_class = Wss_slots[i].ship_class; break; } } if ( Selected_ss_class == -1 ) { Int3(); for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { if ( Ss_pool[i] > 0 ) { Selected_ss_class = i; } } } if ( Selected_ss_class == -1 ) { Int3(); return; } } // There may be ships that are in wings but not in Team_data[0]. Since we still want to show those // icons in the ship selection list, the code below checks for these cases. If a ship is found in // a wing, and is not in Team_data[0], it is appended to the end of the ship_count[] and ship_list[] arrays // that are in Team_data[0] // // exit: number of distinct ship classes available to choose from int ss_fixup_team_data(team_data *tdata) { int i, j, k, ship_in_parse_player, list_size; p_object *p_objp; team_data *p_team_data; p_team_data = tdata; ship_in_parse_player = 0; list_size = p_team_data->number_choices; for ( i = 0; i < MAX_PLAYER_WINGS; i++ ) { wing *wp; if ( Starting_wings[i] == -1 ) continue; wp = &Wings[Starting_wings[i]]; for ( j = 0; j < wp->current_count; j++ ) { ship_in_parse_player = 0; for ( k = 0; k < p_team_data->number_choices; k++ ) { Assert( p_team_data->ship_count[k] >= 0 ); if ( p_team_data->ship_list[k] == Ships[wp->ship_index[j]].ship_info_index ) { ship_in_parse_player = 1; break; } } // end for, go to next item in parse player if ( !ship_in_parse_player ) { p_team_data->ship_count[list_size] = 0; p_team_data->ship_list[list_size] = Ships[wp->ship_index[j]].ship_info_index; p_team_data->number_choices++; list_size++; } } // end for, go get next ship in wing if ( wp->current_count == 0 ) { for ( p_objp = GET_FIRST(&ship_arrival_list); p_objp != END_OF_LIST(&ship_arrival_list); p_objp = GET_NEXT(p_objp) ) { if ( p_objp->wingnum == WING_INDEX(wp) ) { ship_in_parse_player = 0; for ( k = 0; k < p_team_data->number_choices; k++ ) { Assert( p_team_data->ship_count[k] >= 0 ); if ( p_team_data->ship_list[k] == p_objp->ship_class ) { ship_in_parse_player = 1; break; } } // end for, go to next item in parse player if ( !ship_in_parse_player ) { p_team_data->ship_count[list_size] = 0; p_team_data->ship_list[list_size] = p_objp->ship_class; p_team_data->number_choices++; list_size++; } } } } } // end for, go to next wing if ( list_size == 0 ) { // ensure that the default player ship is in the ship_list too ship_in_parse_player = 0; for ( k = 0; k < p_team_data->number_choices; k++ ) { Assert( p_team_data->ship_count[k] >= 0 ); if ( p_team_data->ship_list[k] == p_team_data->default_ship ) { ship_in_parse_player = 1; break; } } if ( !ship_in_parse_player ) { p_team_data->ship_count[list_size] = 0; p_team_data->ship_list[list_size] = p_team_data->default_ship; p_team_data->number_choices++; list_size++; } } return list_size; } // set numbers of ships in pool to default values void ss_init_pool(team_data *pteam) { int i; for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { Ss_pool[i] = -1; } // set number of available ships based on counts in team_data for ( i = 0; i < pteam->number_choices; i++ ) { Ss_pool[pteam->ship_list[i]] = pteam->ship_count[i]; } } // load the icons for a specific ship class void ss_load_icons(int ship_class) { ss_icon_info *icon; int first_frame, num_frames, i; icon = &Ss_icons[ship_class]; first_frame = bm_load_animation(Ship_info[ship_class].icon_filename, &num_frames); if ( first_frame == -1 ) { Int3(); // Could not load in icon frames.. get Alan return; } for ( i = 0; i < num_frames; i++ ) { icon->icon_bmaps[i] = first_frame+i; } // set the current bitmap for the ship icon icon->current_icon_bitmap = icon->icon_bmaps[ICON_FRAME_NORMAL]; } // load all the icons for ships in the pool void ss_load_all_icons() { #ifndef DEMO // not for FS2_DEMO int i, j; for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { // clear out data Ss_icons[i].current_icon_bitmap = -1; Ss_icons[i].anim = NULL; Ss_icons[i].anim_instance = NULL; for ( j = 0; j < NUM_ICON_FRAMES; j++ ) { Ss_icons[i].icon_bmaps[j] = -1; } if ( Ss_pool[i] >= 0 ) { ss_load_icons(i); } } #endif } // Load in a specific ship animation. The data is loaded as a memory-mapped file since these animations // are awfully big. void ss_load_anim(int ship_class) { ss_icon_info *icon; icon = &Ss_icons[ship_class]; // load the compressed ship animation into memory // NOTE: if last parm of load_anim is 1, the anim file is mapped to memory Assert( icon->anim == NULL ); icon->anim = ss_load_individual_animation(ship_class); if ( icon->anim == NULL ) { Int3(); // couldn't load anim filename.. get Alan } } // Load in any ship animations. This function assumes that Ss_pool has been inited. void ss_load_all_anims() { #ifndef DEMO // not for FS2_DEMO int i; for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { if ( Ss_pool[i] > 0 ) { ss_load_anim(i); } } #endif } // determine if the slot is disabled int ss_disabled_slot(int slot_num) { if ( Wss_num_wings <= 0 ){ return 0; } // HACK HACK HACK - call the team select function in multiplayer if(Game_mode & GM_MULTIPLAYER) { return multi_ts_disabled_slot(slot_num); } return ( Ss_wings[slot_num/4].ss_slots[slot_num%4].status & WING_SLOT_IGNORE ); } // reset the slot data void ss_clear_slots() { int i,j; ss_slot_info *slot; for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { Wss_slots[i].ship_class = -1; } for ( i = 0; i < 3; i++ ) { for ( j = 0; j < 4; j++ ) { slot = &Ss_wings[i].ss_slots[j]; slot->status = WING_SLOT_DISABLED; slot->sa_index = -1; slot->original_ship_class = -1; } } } // initialize all wing struct stuff void ss_clear_wings() { int idx; for(idx=0;idx<MAX_PLAYER_WINGS;idx++){ Ss_wings[idx].wingnum = -1; Ss_wings[idx].num_slots = 0; Ss_wings[idx].is_late = 0; } } // set up Wss_num_wings and Wss_wings[] based on Starting_wings[] info void ss_init_wing_info(int wing_num,int starting_wing_num) { wing *wp; ss_wing_info *ss_wing; ss_slot_info *slot; ss_wing = &Ss_wings[wing_num]; if ( Starting_wings[starting_wing_num] < 0 ) { return; } ss_wing->wingnum = Starting_wings[starting_wing_num]; Wss_num_wings++; wp = &Wings[Ss_wings[wing_num].wingnum]; ss_wing->num_slots = wp->current_count; if ( wp->current_count == 0 || wp->ship_index[0] == -1 ) { p_object *p_objp; // Temporarily fill in the current count and initialize the ship list in the wing // This gets cleaned up before the mission is started for ( p_objp = GET_FIRST(&ship_arrival_list); p_objp != END_OF_LIST(&ship_arrival_list); p_objp = GET_NEXT(p_objp) ) { if ( p_objp->wingnum == WING_INDEX(wp) ) { slot = &ss_wing->ss_slots[ss_wing->num_slots++]; slot->sa_index = p_objp-ship_arrivals; slot->original_ship_class = p_objp->ship_class; } ss_wing->is_late = 1; } } } // Determine if a ship is actually a console player ship int ss_wing_slot_is_console_player(int index) { int wingnum, slotnum; wingnum=index/4; slotnum=index%4; if ( wingnum >= Wss_num_wings ) { return 0; } if ( Ss_wings[wingnum].ss_slots[slotnum].status & WING_SLOT_IS_PLAYER ) { return 1; } return 0; } // init the ship selection portion of the units, and set up the ui data void ss_init_units() { int i,j; wing *wp; ss_slot_info *ss_slot; ss_wing_info *ss_wing; for ( i = 0; i < Wss_num_wings; i++ ) { ss_wing = &Ss_wings[i]; if ( ss_wing->wingnum < 0 ) { Int3(); continue; } wp = &Wings[ss_wing->wingnum]; for ( j = 0; j < ss_wing->num_slots; j++ ) { ss_slot = &ss_wing->ss_slots[j]; if ( ss_slot->sa_index == -1 ) { ss_slot->original_ship_class = Ships[wp->ship_index[j]].ship_info_index; } // Set the type of slot. Check if the slot is marked as locked, if so then the player is not // going to be able to modify that ship. if ( ss_slot->sa_index == -1 ) { int objnum; if ( Ships[wp->ship_index[j]].flags & SF_LOCKED ) { ss_slot->status = WING_SLOT_DISABLED; ss_slot->status |= WING_SLOT_LOCKED; } else { ss_slot->status = WING_SLOT_FILLED; } objnum = Ships[wp->ship_index[j]].objnum; if ( Objects[objnum].flags & OF_PLAYER_SHIP ) { if ( ss_slot->status & WING_SLOT_LOCKED ) { // Int3(); // Get Alan // just unflag it ss_slot->status &= ~(WING_SLOT_LOCKED); } ss_slot->status = WING_SLOT_FILLED; if ( objnum == OBJ_INDEX(Player_obj) ) { ss_slot->status |= WING_SLOT_IS_PLAYER; } } } else { if ( ship_arrivals[ss_slot->sa_index].flags & P_SF_LOCKED ) { ss_slot->status = WING_SLOT_DISABLED; ss_slot->status |= WING_SLOT_LOCKED; } else { ss_slot->status = WING_SLOT_FILLED; } if ( ship_arrivals[ss_slot->sa_index].flags & P_OF_PLAYER_START ) { if ( ss_slot->status & WING_SLOT_LOCKED ) { // Int3(); // Get Alan // just unflag it ss_slot->status &= ~(WING_SLOT_LOCKED); } ss_slot->status = WING_SLOT_FILLED; ss_slot->status |= WING_SLOT_IS_PLAYER; } } // Assign the ship class to the unit Wss_slots[i*4+j].ship_class = ss_slot->original_ship_class; } // end for } // end for // lock/unlock any necessary slots for multiplayer if(Game_mode & GM_MULTIPLAYER){ ss_recalc_multiplayer_slots(); } } // set the necessary pointers void ss_set_team_pointers(int team) { Ss_wings = Ss_wings_teams[team]; Ss_icons = Ss_icons_teams[team]; Ss_pool = Ss_pool_teams[team]; Wl_pool = Wl_pool_teams[team]; Wss_slots = Wss_slots_teams[team]; } // initialize team specific stuff void ship_select_init_team_data(int team_num) { int idx; // set up the pointers to initialize the data structures. Ss_wings = Ss_wings_teams[team_num]; Ss_icons = Ss_icons_teams[team_num]; Ss_pool = Ss_pool_teams[team_num]; Wl_pool = Wl_pool_teams[team_num]; Wss_slots = Wss_slots_teams[team_num]; ss_fixup_team_data(&Team_data[team_num]); ss_init_pool(&Team_data[team_num]); ss_clear_slots(); // reset data for slots ss_clear_wings(); // determine how many wings we should be checking for Wss_num_wings = 0; if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM)){ // now setup wings for easy reference ss_init_wing_info(0,team_num); } else { // now setup wings for easy reference for(idx=0;idx<MAX_PLAYER_WINGS;idx++){ ss_init_wing_info(idx,idx); } } // if there are no wings, don't call the init_units() function if ( Wss_num_wings <= 0 ) { Wss_slots[0].ship_class = Team_data[team_num].default_ship; return; } ss_init_units(); } // called when the briefing is entered void ship_select_common_init() { int idx; // initialize team critical data for all teams if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM)){ // initialize for all teams in the game for(idx=0;idx<MULTI_TS_MAX_TEAMS;idx++){ ship_select_init_team_data(idx); } // finally, intialize team data for myself ship_select_init_team_data(Common_team); } else { ship_select_init_team_data(Common_team); } init_active_list(); // load the necessary icons/animations ss_load_all_icons(); ss_load_all_anims(); ss_reset_selected_ship(); ss_reset_carried_icon(); } // change any interface data based on updated Wss_slots[] and Ss_pool[] void ss_synch_interface() { int i; ss_slot_info *slot; int old_list_start = SS_active_list_start; init_active_list(); // build the list of pool ships if ( old_list_start < SS_active_list_size ) { SS_active_list_start = old_list_start; } for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { slot = &Ss_wings[i/4].ss_slots[i%4]; if ( Wss_slots[i].ship_class == -1 ) { if ( slot->status & WING_SLOT_FILLED ) { slot->status &= ~WING_SLOT_FILLED; slot->status |= WING_SLOT_EMPTY; } } else { if ( slot->status & WING_SLOT_EMPTY ) { slot->status &= ~WING_SLOT_EMPTY; slot->status |= WING_SLOT_FILLED; } } } } // exit: data changed flag int ss_swap_slot_slot(int from_slot, int to_slot, int *sound) { int i, tmp, fwnum, fsnum, twnum, tsnum; if ( from_slot == to_slot ) { *sound=SND_ICON_DROP_ON_WING; return 0; } // ensure from_slot has a ship to pick up if ( Wss_slots[from_slot].ship_class < 0 ) { *sound=SND_ICON_DROP; return 0; } fwnum = from_slot/4; fsnum = from_slot%4; twnum = to_slot/4; tsnum = to_slot%4; // swap ship class tmp = Wss_slots[from_slot].ship_class; Wss_slots[from_slot].ship_class = Wss_slots[to_slot].ship_class; Wss_slots[to_slot].ship_class = tmp; // swap weapons for ( i = 0; i < MAX_WL_WEAPONS; i++ ) { tmp = Wss_slots[from_slot].wep[i]; Wss_slots[from_slot].wep[i] = Wss_slots[to_slot].wep[i]; Wss_slots[to_slot].wep[i] = tmp; tmp = Wss_slots[from_slot].wep_count[i]; Wss_slots[from_slot].wep_count[i] = Wss_slots[to_slot].wep_count[i]; Wss_slots[to_slot].wep_count[i] = tmp; } *sound=SND_ICON_DROP_ON_WING; return 1; } // exit: data changed flag int ss_dump_to_list(int from_slot, int to_list, int *sound) { int i, fwnum, fsnum; wss_unit *slot; slot = &Wss_slots[from_slot]; // ensure from_slot has a ship to pick up if ( slot->ship_class < 0 ) { *sound=SND_ICON_DROP; return 0; } fwnum = from_slot/4; fsnum = from_slot%4; // put ship back in list Ss_pool[to_list]++; // return to list slot->ship_class = -1; // remove from slot // put weapons back in list for ( i = 0; i < MAX_WL_WEAPONS; i++ ) { if ( (slot->wep[i] >= 0) && (slot->wep_count[i] > 0) ) { Wl_pool[slot->wep[i]] += slot->wep_count[i]; slot->wep[i] = -1; slot->wep_count[i] = 0; } } *sound=SND_ICON_DROP; return 1; } // exit: data changed flag int ss_grab_from_list(int from_list, int to_slot, int *sound) { wss_unit *slot; int i, wep[MAX_WL_WEAPONS], wep_count[MAX_WL_WEAPONS]; slot = &Wss_slots[to_slot]; // ensure that pool has ship if ( Ss_pool[from_list] <= 0 ) { *sound=SND_ICON_DROP; return 0; } Assert(slot->ship_class < 0 ); // slot should be empty // take ship from list->slot Ss_pool[from_list]--; slot->ship_class = from_list; // take weapons from list->slot wl_get_default_weapons(from_list, to_slot, wep, wep_count); wl_remove_weps_from_pool(wep, wep_count, slot->ship_class); for ( i = 0; i < MAX_WL_WEAPONS; i++ ) { slot->wep[i] = wep[i]; slot->wep_count[i] = wep_count[i]; } *sound=SND_ICON_DROP_ON_WING; return 1; } // exit: data changed flag int ss_swap_list_slot(int from_list, int to_slot, int *sound) { int i, wep[MAX_WL_WEAPONS], wep_count[MAX_WL_WEAPONS]; wss_unit *slot; // ensure that pool has ship if ( Ss_pool[from_list] <= 0 ) { *sound=SND_ICON_DROP; return 0; } slot = &Wss_slots[to_slot]; Assert(slot->ship_class >= 0 ); // slot should be filled // put ship from slot->list Ss_pool[Wss_slots[to_slot].ship_class]++; // put weapons from slot->list for ( i = 0; i < MAX_WL_WEAPONS; i++ ) { if ( (slot->wep[i] >= 0) && (slot->wep_count[i] > 0) ) { Wl_pool[slot->wep[i]] += slot->wep_count[i]; slot->wep[i] = -1; slot->wep_count[i] = 0; } } // take ship from list->slot Ss_pool[from_list]--; slot->ship_class = from_list; // take weapons from list->slot wl_get_default_weapons(from_list, to_slot, wep, wep_count); wl_remove_weps_from_pool(wep, wep_count, slot->ship_class); for ( i = 0; i < MAX_WL_WEAPONS; i++ ) { slot->wep[i] = wep[i]; slot->wep_count[i] = wep_count[i]; } *sound=SND_ICON_DROP_ON_WING; return 1; } void ss_apply(int mode, int from_slot, int from_list, int to_slot, int to_list,int player_index) { int update=0; int sound=-1; switch(mode){ case WSS_SWAP_SLOT_SLOT: update = ss_swap_slot_slot(from_slot, to_slot, &sound); break; case WSS_DUMP_TO_LIST: update = ss_dump_to_list(from_slot, to_list, &sound); break; case WSS_GRAB_FROM_LIST: update = ss_grab_from_list(from_list, to_slot, &sound); break; case WSS_SWAP_LIST_SLOT: update = ss_swap_list_slot(from_list, to_slot, &sound); break; } // only play this sound if the move was done locally (by the host in other words) if ( (sound >= 0) && (player_index == -1) ) { gamesnd_play_iface(sound); } if ( update ) { // NO LONGER USED - THERE IS A MULTIPLAYER VERSION OF THIS SCREEN NOW /* if ( MULTIPLAYER_HOST ) { int size; ubyte wss_data[MAX_PACKET_SIZE-20]; size = store_wss_data(wss_data, MAX_PACKET_SIZE-20, sound); send_wss_update_packet(wss_data, size, player_index); } */ ss_synch_interface(); } } void ss_drop(int from_slot,int from_list,int to_slot,int to_list,int player_index) { int mode; common_flash_button_init(); mode = wss_get_mode(from_slot, from_list, to_slot, to_list, -1); if ( mode >= 0 ) { ss_apply(mode, from_slot, from_list, to_slot, to_list,player_index); } } // lock/unlock any necessary slots for multiplayer void ss_recalc_multiplayer_slots() { int i,j,objnum; wing *wp; ss_slot_info *ss_slot; ss_wing_info *ss_wing; // no wings if ( Wss_num_wings <= 0 ) { Wss_slots[0].ship_class = Team_data[Common_team].default_ship;; return; } for ( i = 0; i < Wss_num_wings; i++ ) { ss_wing = &Ss_wings[i]; if ( ss_wing->wingnum < 0 ) { Int3(); continue; } // NOTE : the method below will eventually have to change to account for all possible netgame options // get the wing pointer wp = &Wings[ss_wing->wingnum]; for ( j = 0; j < ss_wing->num_slots; j++ ) { // get the objnum of the ship in this slot objnum = Ships[wp->ship_index[j]].objnum; // get the slot pointer ss_slot = &ss_wing->ss_slots[j]; if (ss_slot->sa_index == -1) { // lock all slots by default ss_slot->status |= WING_SLOT_LOCKED; // if this is my slot, then unlock it if(!multi_ts_disabled_slot((i*4)+j)){ ss_slot->status &= ~WING_SLOT_LOCKED; } } } } }
27.544874
162
0.674884
[ "render", "object", "model", "3d" ]
27c6d928245a0116b438061f3ef21fdf3ffe44cf
4,945
cpp
C++
src/backend/common/BindGroupLayout.cpp
imagineagents/nxt-standalone
060f254468299dc08a5f11c34e2330f645eb25c1
[ "Apache-2.0" ]
1
2018-07-15T12:12:26.000Z
2018-07-15T12:12:26.000Z
src/backend/common/BindGroupLayout.cpp
imagineagents/nxt-standalone
060f254468299dc08a5f11c34e2330f645eb25c1
[ "Apache-2.0" ]
null
null
null
src/backend/common/BindGroupLayout.cpp
imagineagents/nxt-standalone
060f254468299dc08a5f11c34e2330f645eb25c1
[ "Apache-2.0" ]
null
null
null
// Copyright 2017 The NXT Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "BindGroupLayout.h" #include "Device.h" #include <functional> namespace backend { namespace { // Workaround for Chrome's stdlib having a broken std::hash for enums and bitsets template<typename T> typename std::enable_if<std::is_enum<T>::value, size_t>::type Hash(T value) { using Integral = typename nxt::UnderlyingType<T>::type; return std::hash<Integral>()(static_cast<Integral>(value)); } template<size_t N> size_t Hash(const std::bitset<N>& value) { static_assert(N <= sizeof(unsigned long long) * 8, ""); return std::hash<unsigned long long>()(value.to_ullong()); } // TODO(cwallez@chromium.org): see if we can use boost's hash combined or some equivalent // this currently assumes that size_t is 64 bits void CombineHashes(size_t* h1, size_t h2) { *h1 ^= (h2 << 7) + (h2 >> (64 - 7)) + 0x304975; } size_t HashBindingInfo(const BindGroupLayoutBase::LayoutBindingInfo& info) { size_t hash = Hash(info.mask); for (size_t binding = 0; binding < kMaxBindingsPerGroup; ++binding) { if (info.mask[binding]) { CombineHashes(&hash, Hash(info.visibilities[binding])); CombineHashes(&hash, Hash(info.types[binding])); } } return hash; } bool operator== (const BindGroupLayoutBase::LayoutBindingInfo& a, const BindGroupLayoutBase::LayoutBindingInfo& b) { if (a.mask != b.mask) { return false; } for (size_t binding = 0; binding < kMaxBindingsPerGroup; ++binding) { if (a.mask[binding]) { if (a.visibilities[binding] != b.visibilities[binding]) { return false; } if (a.types[binding] != b.types[binding]) { return false; } } } return true; } } // BindGroupLayoutBase BindGroupLayoutBase::BindGroupLayoutBase(BindGroupLayoutBuilder* builder, bool blueprint) : device(builder->device), bindingInfo(builder->bindingInfo), blueprint(blueprint) { } BindGroupLayoutBase::~BindGroupLayoutBase() { // Do not register the actual cached object if we are a blueprint if (!blueprint) { device->UncacheBindGroupLayout(this); } } const BindGroupLayoutBase::LayoutBindingInfo& BindGroupLayoutBase::GetBindingInfo() const { return bindingInfo; } // BindGroupLayoutBuilder BindGroupLayoutBuilder::BindGroupLayoutBuilder(DeviceBase* device) : device(device) { } bool BindGroupLayoutBuilder::WasConsumed() const { return consumed; } const BindGroupLayoutBase::LayoutBindingInfo& BindGroupLayoutBuilder::GetBindingInfo() const { return bindingInfo; } BindGroupLayoutBase* BindGroupLayoutBuilder::GetResult() { consumed = true; BindGroupLayoutBase blueprint(this, true); auto* result = device->GetOrCreateBindGroupLayout(&blueprint, this); result->Reference(); return result; } void BindGroupLayoutBuilder::SetBindingsType(nxt::ShaderStageBit visibility, nxt::BindingType bindingType, uint32_t start, uint32_t count) { if (start + count > kMaxBindingsPerGroup) { device->HandleError("Setting bindings type over maximum number of bindings"); return; } for (size_t i = start; i < start + count; i++) { if (bindingInfo.mask[i]) { device->HandleError("Setting already set binding type"); return; } bindingInfo.mask.set(i); bindingInfo.visibilities[i] = visibility; bindingInfo.types[i] = bindingType; } } // BindGroupLayoutCacheFuncs size_t BindGroupLayoutCacheFuncs::operator() (const BindGroupLayoutBase* bgl) const { return HashBindingInfo(bgl->GetBindingInfo()); } bool BindGroupLayoutCacheFuncs::operator() (const BindGroupLayoutBase* a, const BindGroupLayoutBase* b) const { return a->GetBindingInfo() == b->GetBindingInfo(); } }
34.103448
144
0.615369
[ "object" ]
27cbaa011132e73c78cc74865c2dcc235a5185fe
2,062
cpp
C++
aws-cpp-sdk-ssm/source/model/Fault.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-02-12T08:09:30.000Z
2022-02-12T08:09:30.000Z
aws-cpp-sdk-ssm/source/model/Fault.cpp
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-ssm/source/model/Fault.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T11:58:03.000Z
2021-11-09T11:58:03.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/ssm/model/Fault.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using namespace Aws::Utils; namespace Aws { namespace SSM { namespace Model { namespace FaultMapper { static const int Client_HASH = HashingUtils::HashString("Client"); static const int Server_HASH = HashingUtils::HashString("Server"); static const int Unknown_HASH = HashingUtils::HashString("Unknown"); Fault GetFaultForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == Client_HASH) { return Fault::Client; } else if (hashCode == Server_HASH) { return Fault::Server; } else if (hashCode == Unknown_HASH) { return Fault::Unknown; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<Fault>(hashCode); } return Fault::NOT_SET; } Aws::String GetNameForFault(Fault enumValue) { switch(enumValue) { case Fault::Client: return "Client"; case Fault::Server: return "Server"; case Fault::Unknown: return "Unknown"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return {}; } } } // namespace FaultMapper } // namespace Model } // namespace SSM } // namespace Aws
26.435897
92
0.57614
[ "model" ]
27cff82656bf20f85252f9dc5d175d434d099b3f
574,640
cpp
C++
ripley/src/DefaultAssembler3D.cpp
svn2github/Escript
9c616a3b164446c65d4b8564ecd04fafd7dcf0d2
[ "Apache-2.0" ]
null
null
null
ripley/src/DefaultAssembler3D.cpp
svn2github/Escript
9c616a3b164446c65d4b8564ecd04fafd7dcf0d2
[ "Apache-2.0" ]
1
2019-01-14T03:07:43.000Z
2019-01-14T03:07:43.000Z
ripley/src/DefaultAssembler3D.cpp
svn2github/Escript
9c616a3b164446c65d4b8564ecd04fafd7dcf0d2
[ "Apache-2.0" ]
null
null
null
/***************************************************************************** * * Copyright (c) 2003-2018 by The University of Queensland * http://www.uq.edu.au * * Primary Business: Queensland, Australia * Licensed under the Apache License, version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Development until 2012 by Earth Systems Science Computational Center (ESSCC) * Development 2012-2013 by School of Earth Sciences * Development from 2014 by Centre for Geoscience Computing (GeoComp) * *****************************************************************************/ #include <ripley/DefaultAssembler3D.h> #include <ripley/domainhelpers.h> #include <escript/index.h> using namespace std; using escript::AbstractSystemMatrix; using escript::Data; namespace ripley { template<class Scalar> void DefaultAssembler3D<Scalar>::collateFunctionSpaceTypes( vector<int>& fsTypes, const DataMap& coefs) const { if (isNotEmpty("A", coefs)) fsTypes.push_back(coefs.find("A")->second.getFunctionSpace().getTypeCode()); if (isNotEmpty("B", coefs)) fsTypes.push_back(coefs.find("B")->second.getFunctionSpace().getTypeCode()); if (isNotEmpty("C", coefs)) fsTypes.push_back(coefs.find("C")->second.getFunctionSpace().getTypeCode()); if (isNotEmpty("D", coefs)) fsTypes.push_back(coefs.find("D")->second.getFunctionSpace().getTypeCode()); if (isNotEmpty("X", coefs)) fsTypes.push_back(coefs.find("X")->second.getFunctionSpace().getTypeCode()); if (isNotEmpty("Y", coefs)) fsTypes.push_back(coefs.find("Y")->second.getFunctionSpace().getTypeCode()); } /****************************************************************************/ // wrappers /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESingle(AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& A = unpackData("A", coefs); const Data& B = unpackData("B", coefs); const Data& C = unpackData("C", coefs); const Data& D = unpackData("D", coefs); const Data& X = unpackData("X", coefs); const Data& Y = unpackData("Y", coefs); assemblePDESingle(mat, rhs, A, B, C, D, X, Y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySingle( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& d = unpackData("d", coefs); const Data& y = unpackData("y", coefs); assemblePDEBoundarySingle(mat, rhs, d, y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESingleReduced( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& A = unpackData("A", coefs); const Data& B = unpackData("B", coefs); const Data& C = unpackData("C", coefs); const Data& D = unpackData("D", coefs); const Data& X = unpackData("X", coefs); const Data& Y = unpackData("Y", coefs); assemblePDESingleReduced(mat, rhs, A, B, C, D, X, Y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySingleReduced( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& d = unpackData("d", coefs); const Data& y = unpackData("y", coefs); assemblePDEBoundarySingleReduced(mat, rhs, d, y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESystem(AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& A = unpackData("A", coefs); const Data& B = unpackData("B", coefs); const Data& C = unpackData("C", coefs); const Data& D = unpackData("D", coefs); const Data& X = unpackData("X", coefs); const Data& Y = unpackData("Y", coefs); assemblePDESystem(mat, rhs, A, B, C, D, X, Y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySystem( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& d = unpackData("d", coefs); const Data& y = unpackData("y", coefs); assemblePDEBoundarySystem(mat, rhs, d, y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESystemReduced( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& A = unpackData("A", coefs); const Data& B = unpackData("B", coefs); const Data& C = unpackData("C", coefs); const Data& D = unpackData("D", coefs); const Data& X = unpackData("X", coefs); const Data& Y = unpackData("Y", coefs); assemblePDESystemReduced(mat, rhs, A, B, C, D, X, Y); } template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySystemReduced( AbstractSystemMatrix* mat, Data& rhs, const DataMap& coefs) const { const Data& d = unpackData("d", coefs); const Data& y = unpackData("y", coefs); assemblePDEBoundarySystemReduced(mat, rhs, d, y); } /****************************************************************************/ // PDE SINGLE /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESingle(AbstractSystemMatrix* mat, Data& rhs, const Data& A, const Data& B, const Data& C, const Data& D, const Data& X, const Data& Y) const { const double SQRT3 = 1.73205080756887719318; const double w10 = -m_dx[0]/288; const double w6 = w10*(SQRT3 - 2); const double w12 = w10*(-SQRT3 - 2); const double w4 = w10*(-4*SQRT3 + 7); const double w18 = w10*(-4*SQRT3 - 7); const double w11 = m_dx[1]/288; const double w5 = w11*(-SQRT3 + 2); const double w15 = w11*(SQRT3 + 2); const double w2 = w11*(4*SQRT3 - 7); const double w17 = w11*(4*SQRT3 + 7); const double w8 = m_dx[2]/288; const double w1 = w8*(-SQRT3 + 2); const double w16 = w8*(SQRT3 + 2); const double w20 = w8*(4*SQRT3 - 7); const double w21 = w8*(-4*SQRT3 - 7); const double w50 = m_dx[0]*m_dx[1]/72; const double w65 = -m_dx[0]*m_dx[1]/48; const double w35 = w65*(-SQRT3 - 3)/36; const double w42 = w65*(SQRT3 - 3)/36; const double w32 = w65*(5*SQRT3 - 9)/36; const double w43 = w65*(-5*SQRT3 - 9)/36; const double w40 = w65*(-19*SQRT3 - 33)/36; const double w41 = w65*(19*SQRT3 - 33)/36; const double w63 = w65*(SQRT3 + 2); const double w67 = w65*(-SQRT3 + 2); const double w51 = -m_dx[0]*m_dx[2]/72; const double w64 = -m_dx[0]*m_dx[2]/48; const double w34 = w64*(-SQRT3 - 3)/36; const double w37 = w64*(SQRT3 - 3)/36; const double w31 = w64*(5*SQRT3 - 9)/36; const double w39 = w64*(-5*SQRT3 - 9)/36; const double w44 = w64*(19*SQRT3 + 33)/36; const double w45 = w64*(-19*SQRT3 + 33)/36; const double w62 = w64*(SQRT3 + 2); const double w68 = w64*(-SQRT3 + 2); const double w53 = -m_dx[1]*m_dx[2]/72; const double w66 = -m_dx[1]*m_dx[2]/48; const double w33 = w66*(SQRT3 - 3)/36; const double w36 = w66*(-SQRT3 - 3)/36; const double w30 = w66*(5*SQRT3 - 9)/36; const double w38 = w66*(-5*SQRT3 - 9)/36; const double w46 = w66*(19*SQRT3 - 33)/36; const double w47 = w66*(-19*SQRT3 - 33)/36; const double w61 = w66*(SQRT3 + 2); const double w69 = w66*(-SQRT3 + 2); const double w55 = m_dx[0]*m_dx[1]*m_dx[2]/1728; const double w57 = w55*(-SQRT3 + 2); const double w58 = w55*(SQRT3 + 2); const double w54 = w55*(-4*SQRT3 + 7); const double w56 = w55*(4*SQRT3 + 7); const double w59 = w55*(15*SQRT3 + 26); const double w60 = w55*(-15*SQRT3 + 26); const double w71 = w55*6*(SQRT3 + 3); const double w72 = w55*6*(-SQRT3 + 3); const double w70 = w55*6*(5*SQRT3 + 9); const double w73 = w55*6*(-5*SQRT3 + 9); const double w13 = -m_dx[0]*m_dx[1]/(288*m_dx[2]); const double w23 = w13*(SQRT3 - 2); const double w25 = w13*(-SQRT3 - 2); const double w7 = w13*(-4*SQRT3 + 7); const double w19 = w13*(4*SQRT3 + 7); const double w22 = -m_dx[0]*m_dx[2]/(288*m_dx[1]); const double w3 = w22*(SQRT3 - 2); const double w9 = w22*(-SQRT3 - 2); const double w24 = w22*(4*SQRT3 + 7); const double w26 = w22*(-4*SQRT3 + 7); const double w27 = -m_dx[1]*m_dx[2]/(288*m_dx[0]); const double w0 = w27*(SQRT3 - 2); const double w14 = w27*(-SQRT3 - 2); const double w28 = w27*(-4*SQRT3 + 7); const double w29 = w27*(4*SQRT3 + 7); const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = (!A.isEmpty() || !B.isEmpty() || !C.isEmpty() || !D.isEmpty()); const bool add_EM_F = (!X.isEmpty() || !Y.isEmpty()); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8); vector<Scalar> EM_F(8); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = k0 + NE0*k1 + NE0*NE1*k2; if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); /////////////// // process A // /////////////// if (!A.isEmpty()) { const Scalar* A_p = A.getSampleDataRO(e, zero); if (A.actsExpanded()) { const Scalar A_00_0 = A_p[INDEX3(0,0,0,3,3)]; const Scalar A_01_0 = A_p[INDEX3(0,1,0,3,3)]; const Scalar A_02_0 = A_p[INDEX3(0,2,0,3,3)]; const Scalar A_10_0 = A_p[INDEX3(1,0,0,3,3)]; const Scalar A_11_0 = A_p[INDEX3(1,1,0,3,3)]; const Scalar A_12_0 = A_p[INDEX3(1,2,0,3,3)]; const Scalar A_20_0 = A_p[INDEX3(2,0,0,3,3)]; const Scalar A_21_0 = A_p[INDEX3(2,1,0,3,3)]; const Scalar A_22_0 = A_p[INDEX3(2,2,0,3,3)]; const Scalar A_00_1 = A_p[INDEX3(0,0,1,3,3)]; const Scalar A_01_1 = A_p[INDEX3(0,1,1,3,3)]; const Scalar A_02_1 = A_p[INDEX3(0,2,1,3,3)]; const Scalar A_10_1 = A_p[INDEX3(1,0,1,3,3)]; const Scalar A_11_1 = A_p[INDEX3(1,1,1,3,3)]; const Scalar A_12_1 = A_p[INDEX3(1,2,1,3,3)]; const Scalar A_20_1 = A_p[INDEX3(2,0,1,3,3)]; const Scalar A_21_1 = A_p[INDEX3(2,1,1,3,3)]; const Scalar A_22_1 = A_p[INDEX3(2,2,1,3,3)]; const Scalar A_00_2 = A_p[INDEX3(0,0,2,3,3)]; const Scalar A_01_2 = A_p[INDEX3(0,1,2,3,3)]; const Scalar A_02_2 = A_p[INDEX3(0,2,2,3,3)]; const Scalar A_10_2 = A_p[INDEX3(1,0,2,3,3)]; const Scalar A_11_2 = A_p[INDEX3(1,1,2,3,3)]; const Scalar A_12_2 = A_p[INDEX3(1,2,2,3,3)]; const Scalar A_20_2 = A_p[INDEX3(2,0,2,3,3)]; const Scalar A_21_2 = A_p[INDEX3(2,1,2,3,3)]; const Scalar A_22_2 = A_p[INDEX3(2,2,2,3,3)]; const Scalar A_00_3 = A_p[INDEX3(0,0,3,3,3)]; const Scalar A_01_3 = A_p[INDEX3(0,1,3,3,3)]; const Scalar A_02_3 = A_p[INDEX3(0,2,3,3,3)]; const Scalar A_10_3 = A_p[INDEX3(1,0,3,3,3)]; const Scalar A_11_3 = A_p[INDEX3(1,1,3,3,3)]; const Scalar A_12_3 = A_p[INDEX3(1,2,3,3,3)]; const Scalar A_20_3 = A_p[INDEX3(2,0,3,3,3)]; const Scalar A_21_3 = A_p[INDEX3(2,1,3,3,3)]; const Scalar A_22_3 = A_p[INDEX3(2,2,3,3,3)]; const Scalar A_00_4 = A_p[INDEX3(0,0,4,3,3)]; const Scalar A_01_4 = A_p[INDEX3(0,1,4,3,3)]; const Scalar A_02_4 = A_p[INDEX3(0,2,4,3,3)]; const Scalar A_10_4 = A_p[INDEX3(1,0,4,3,3)]; const Scalar A_11_4 = A_p[INDEX3(1,1,4,3,3)]; const Scalar A_12_4 = A_p[INDEX3(1,2,4,3,3)]; const Scalar A_20_4 = A_p[INDEX3(2,0,4,3,3)]; const Scalar A_21_4 = A_p[INDEX3(2,1,4,3,3)]; const Scalar A_22_4 = A_p[INDEX3(2,2,4,3,3)]; const Scalar A_00_5 = A_p[INDEX3(0,0,5,3,3)]; const Scalar A_01_5 = A_p[INDEX3(0,1,5,3,3)]; const Scalar A_02_5 = A_p[INDEX3(0,2,5,3,3)]; const Scalar A_10_5 = A_p[INDEX3(1,0,5,3,3)]; const Scalar A_11_5 = A_p[INDEX3(1,1,5,3,3)]; const Scalar A_12_5 = A_p[INDEX3(1,2,5,3,3)]; const Scalar A_20_5 = A_p[INDEX3(2,0,5,3,3)]; const Scalar A_21_5 = A_p[INDEX3(2,1,5,3,3)]; const Scalar A_22_5 = A_p[INDEX3(2,2,5,3,3)]; const Scalar A_00_6 = A_p[INDEX3(0,0,6,3,3)]; const Scalar A_01_6 = A_p[INDEX3(0,1,6,3,3)]; const Scalar A_02_6 = A_p[INDEX3(0,2,6,3,3)]; const Scalar A_10_6 = A_p[INDEX3(1,0,6,3,3)]; const Scalar A_11_6 = A_p[INDEX3(1,1,6,3,3)]; const Scalar A_12_6 = A_p[INDEX3(1,2,6,3,3)]; const Scalar A_20_6 = A_p[INDEX3(2,0,6,3,3)]; const Scalar A_21_6 = A_p[INDEX3(2,1,6,3,3)]; const Scalar A_22_6 = A_p[INDEX3(2,2,6,3,3)]; const Scalar A_00_7 = A_p[INDEX3(0,0,7,3,3)]; const Scalar A_01_7 = A_p[INDEX3(0,1,7,3,3)]; const Scalar A_02_7 = A_p[INDEX3(0,2,7,3,3)]; const Scalar A_10_7 = A_p[INDEX3(1,0,7,3,3)]; const Scalar A_11_7 = A_p[INDEX3(1,1,7,3,3)]; const Scalar A_12_7 = A_p[INDEX3(1,2,7,3,3)]; const Scalar A_20_7 = A_p[INDEX3(2,0,7,3,3)]; const Scalar A_21_7 = A_p[INDEX3(2,1,7,3,3)]; const Scalar A_22_7 = A_p[INDEX3(2,2,7,3,3)]; const Scalar tmp0 = w18*(-A_12_7 + A_21_3); const Scalar tmp1 = w13*(A_22_1 + A_22_2 + A_22_5 + A_22_6); const Scalar tmp2 = w11*(-A_02_2 - A_02_5 + A_20_1 + A_20_6); const Scalar tmp3 = w14*(A_00_2 + A_00_3 + A_00_6 + A_00_7); const Scalar tmp4 = w7*(A_22_0 + A_22_4); const Scalar tmp5 = w10*(A_12_1 + A_12_6 - A_21_2 - A_21_5); const Scalar tmp6 = w3*(A_11_0 + A_11_2 + A_11_4 + A_11_6); const Scalar tmp7 = w1*(A_01_0 + A_01_4 + A_10_0 + A_10_4); const Scalar tmp8 = w4*(A_12_0 - A_21_4); const Scalar tmp9 = w15*(-A_02_3 - A_02_6 + A_20_2 + A_20_7); const Scalar tmp10 = w0*(A_00_0 + A_00_1 + A_00_4 + A_00_5); const Scalar tmp11 = w16*(A_01_3 + A_01_7 + A_10_3 + A_10_7); const Scalar tmp12 = w9*(A_11_1 + A_11_3 + A_11_5 + A_11_7); const Scalar tmp13 = w12*(-A_12_3 - A_12_5 + A_21_1 + A_21_7); const Scalar tmp14 = w5*(-A_02_1 - A_02_4 + A_20_0 + A_20_5); const Scalar tmp15 = w8*(A_01_1 + A_01_2 + A_01_5 + A_01_6 + A_10_1 + A_10_2 + A_10_5 + A_10_6); const Scalar tmp16 = w6*(-A_12_2 - A_12_4 + A_21_0 + A_21_6); const Scalar tmp17 = w19*(A_22_3 + A_22_7); const Scalar tmp18 = w17*(-A_02_7 + A_20_3); const Scalar tmp19 = w2*(A_02_0 - A_20_4); const Scalar tmp20 = w13*(-A_22_0 - A_22_1 - A_22_2 - A_22_3 - A_22_4 - A_22_5 - A_22_6 - A_22_7); const Scalar tmp21 = w11*(-A_02_1 - A_02_3 - A_02_4 - A_02_6 + A_20_0 + A_20_2 + A_20_5 + A_20_7); const Scalar tmp22 = w14*(-A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp23 = w20*(A_01_2 + A_10_1); const Scalar tmp24 = w10*(A_12_2 + A_12_3 + A_12_4 + A_12_5 - A_21_0 - A_21_1 - A_21_6 - A_21_7); const Scalar tmp25 = w3*(-A_11_0 - A_11_1 - A_11_2 - A_11_3); const Scalar tmp26 = w1*(-A_01_0 - A_01_3 - A_10_0 - A_10_3); const Scalar tmp27 = w15*(-A_02_5 - A_02_7 + A_20_4 + A_20_6); const Scalar tmp28 = w0*(-A_00_0 - A_00_1 - A_00_2 - A_00_3); const Scalar tmp29 = w16*(-A_01_4 - A_01_7 - A_10_4 - A_10_7); const Scalar tmp30 = w9*(-A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp31 = w21*(A_01_5 + A_10_6); const Scalar tmp32 = w12*(-A_12_6 - A_12_7 + A_21_4 + A_21_5); const Scalar tmp33 = w5*(-A_02_0 - A_02_2 + A_20_1 + A_20_3); const Scalar tmp34 = w8*(-A_01_1 - A_01_6 - A_10_2 - A_10_5); const Scalar tmp35 = w6*(-A_12_0 - A_12_1 + A_21_2 + A_21_3); const Scalar tmp36 = w20*(-A_01_6 + A_10_4); const Scalar tmp37 = w18*(A_12_3 - A_21_1); const Scalar tmp38 = w11*(-A_02_0 - A_02_2 - A_02_5 - A_02_7 - A_20_0 - A_20_2 - A_20_5 - A_20_7); const Scalar tmp39 = w14*(A_00_0 + A_00_1 + A_00_2 + A_00_3); const Scalar tmp40 = w26*(A_11_4 + A_11_6); const Scalar tmp41 = w0*(A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp42 = w10*(-A_12_2 - A_12_5 + A_21_0 + A_21_7); const Scalar tmp43 = w22*(A_11_0 + A_11_2 + A_11_5 + A_11_7); const Scalar tmp44 = w1*(A_01_4 + A_01_7 - A_10_5 - A_10_6); const Scalar tmp45 = w25*(A_22_1 + A_22_3 + A_22_5 + A_22_7); const Scalar tmp46 = w4*(-A_12_4 + A_21_6); const Scalar tmp47 = w15*(-A_02_1 - A_02_3 - A_20_1 - A_20_3); const Scalar tmp48 = w21*(-A_01_1 + A_10_3); const Scalar tmp49 = w16*(A_01_0 + A_01_3 - A_10_1 - A_10_2); const Scalar tmp50 = w5*(-A_02_4 - A_02_6 - A_20_4 - A_20_6); const Scalar tmp51 = w12*(A_12_1 + A_12_7 - A_21_3 - A_21_5); const Scalar tmp52 = w24*(A_11_1 + A_11_3); const Scalar tmp53 = w8*(A_01_2 + A_01_5 - A_10_0 - A_10_7); const Scalar tmp54 = w6*(A_12_0 + A_12_6 - A_21_2 - A_21_4); const Scalar tmp55 = w23*(A_22_0 + A_22_2 + A_22_4 + A_22_6); const Scalar tmp56 = w18*(A_12_4 - A_21_6); const Scalar tmp57 = w14*(A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp58 = w26*(A_11_1 + A_11_3); const Scalar tmp59 = w20*(-A_01_1 + A_10_3); const Scalar tmp60 = w1*(A_01_0 + A_01_3 - A_10_1 - A_10_2); const Scalar tmp61 = w25*(A_22_0 + A_22_2 + A_22_4 + A_22_6); const Scalar tmp62 = w4*(-A_12_3 + A_21_1); const Scalar tmp63 = w15*(-A_02_4 - A_02_6 - A_20_4 - A_20_6); const Scalar tmp64 = w0*(A_00_0 + A_00_1 + A_00_2 + A_00_3); const Scalar tmp65 = w16*(A_01_4 + A_01_7 - A_10_5 - A_10_6); const Scalar tmp66 = w24*(A_11_4 + A_11_6); const Scalar tmp67 = w21*(-A_01_6 + A_10_4); const Scalar tmp68 = w12*(A_12_0 + A_12_6 - A_21_2 - A_21_4); const Scalar tmp69 = w5*(-A_02_1 - A_02_3 - A_20_1 - A_20_3); const Scalar tmp70 = w6*(A_12_1 + A_12_7 - A_21_3 - A_21_5); const Scalar tmp71 = w23*(A_22_1 + A_22_3 + A_22_5 + A_22_7); const Scalar tmp72 = w20*(A_01_5 + A_10_6); const Scalar tmp73 = w14*(-A_00_0 - A_00_1 - A_00_2 - A_00_3); const Scalar tmp74 = w0*(-A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp75 = w3*(-A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp76 = w1*(-A_01_4 - A_01_7 - A_10_4 - A_10_7); const Scalar tmp77 = w15*(-A_02_0 - A_02_2 + A_20_1 + A_20_3); const Scalar tmp78 = w21*(A_01_2 + A_10_1); const Scalar tmp79 = w16*(-A_01_0 - A_01_3 - A_10_0 - A_10_3); const Scalar tmp80 = w9*(-A_11_0 - A_11_1 - A_11_2 - A_11_3); const Scalar tmp81 = w12*(-A_12_0 - A_12_1 + A_21_2 + A_21_3); const Scalar tmp82 = w5*(-A_02_5 - A_02_7 + A_20_4 + A_20_6); const Scalar tmp83 = w6*(-A_12_6 - A_12_7 + A_21_4 + A_21_5); const Scalar tmp84 = w6*(-A_12_2 - A_12_3 - A_21_2 - A_21_3); const Scalar tmp85 = w11*(A_02_1 + A_02_6 - A_20_0 - A_20_7); const Scalar tmp86 = w20*(A_01_3 - A_10_2); const Scalar tmp87 = w10*(A_12_0 + A_12_1 + A_12_6 + A_12_7 + A_21_0 + A_21_1 + A_21_6 + A_21_7); const Scalar tmp88 = w3*(A_11_0 + A_11_1 + A_11_2 + A_11_3); const Scalar tmp89 = w23*(A_22_2 + A_22_3 + A_22_6 + A_22_7); const Scalar tmp90 = w1*(-A_01_1 - A_01_2 + A_10_0 + A_10_3); const Scalar tmp91 = w25*(A_22_0 + A_22_1 + A_22_4 + A_22_5); const Scalar tmp92 = w15*(A_02_0 + A_02_5 - A_20_1 - A_20_4); const Scalar tmp93 = w21*(A_01_4 - A_10_5); const Scalar tmp94 = w16*(-A_01_5 - A_01_6 + A_10_4 + A_10_7); const Scalar tmp95 = w28*(A_00_2 + A_00_3); const Scalar tmp96 = w12*(-A_12_4 - A_12_5 - A_21_4 - A_21_5); const Scalar tmp97 = w29*(A_00_4 + A_00_5); const Scalar tmp98 = w5*(A_02_2 + A_02_7 - A_20_3 - A_20_6); const Scalar tmp99 = w8*(-A_01_0 - A_01_7 + A_10_1 + A_10_6); const Scalar tmp100 = w9*(A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp101 = w27*(A_00_0 + A_00_1 + A_00_6 + A_00_7); const Scalar tmp102 = w17*(A_02_4 - A_20_5); const Scalar tmp103 = w2*(-A_02_3 + A_20_2); const Scalar tmp104 = w13*(A_22_0 + A_22_1 + A_22_2 + A_22_3 + A_22_4 + A_22_5 + A_22_6 + A_22_7); const Scalar tmp105 = w6*(-A_12_4 - A_12_5 - A_21_2 - A_21_3); const Scalar tmp106 = w22*(A_11_0 + A_11_1 + A_11_2 + A_11_3 + A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp107 = w1*(-A_01_2 - A_01_6 - A_10_1 - A_10_5); const Scalar tmp108 = w15*(-A_02_1 - A_02_3 - A_20_4 - A_20_6); const Scalar tmp109 = w16*(-A_01_1 - A_01_5 - A_10_2 - A_10_6); const Scalar tmp110 = w12*(-A_12_2 - A_12_3 - A_21_4 - A_21_5); const Scalar tmp111 = w5*(-A_02_4 - A_02_6 - A_20_1 - A_20_3); const Scalar tmp112 = w8*(-A_01_0 - A_01_3 - A_01_4 - A_01_7 - A_10_0 - A_10_3 - A_10_4 - A_10_7); const Scalar tmp113 = w27*(A_00_0 + A_00_1 + A_00_2 + A_00_3 + A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp114 = w11*(A_02_0 + A_02_2 + A_02_5 + A_02_7 - A_20_1 - A_20_3 - A_20_4 - A_20_6); const Scalar tmp115 = w21*(-A_01_4 - A_10_7); const Scalar tmp116 = w20*(-A_01_3 - A_10_0); const Scalar tmp117 = w15*(A_02_4 + A_02_6 - A_20_5 - A_20_7); const Scalar tmp118 = w16*(A_01_5 + A_01_6 + A_10_5 + A_10_6); const Scalar tmp119 = w5*(A_02_1 + A_02_3 - A_20_0 - A_20_2); const Scalar tmp120 = w8*(A_01_0 + A_01_7 + A_10_3 + A_10_4); const Scalar tmp121 = w1*(A_01_1 + A_01_2 + A_10_1 + A_10_2); const Scalar tmp122 = w18*(A_12_2 - A_21_6); const Scalar tmp123 = w13*(A_22_0 + A_22_3 + A_22_4 + A_22_7); const Scalar tmp124 = w11*(-A_02_0 - A_02_7 + A_20_3 + A_20_4); const Scalar tmp125 = w7*(A_22_1 + A_22_5); const Scalar tmp126 = w10*(-A_12_3 - A_12_4 + A_21_0 + A_21_7); const Scalar tmp127 = w3*(A_11_1 + A_11_3 + A_11_5 + A_11_7); const Scalar tmp128 = w1*(-A_01_1 - A_01_5 - A_10_1 - A_10_5); const Scalar tmp129 = w4*(-A_12_5 + A_21_1); const Scalar tmp130 = w16*(-A_01_2 - A_01_6 - A_10_2 - A_10_6); const Scalar tmp131 = w9*(A_11_0 + A_11_2 + A_11_4 + A_11_6); const Scalar tmp132 = w19*(A_22_2 + A_22_6); const Scalar tmp133 = w17*(-A_02_2 + A_20_6); const Scalar tmp134 = w2*(A_02_5 - A_20_1); const Scalar tmp135 = w11*(A_02_1 + A_02_3 + A_02_4 + A_02_6 + A_20_1 + A_20_3 + A_20_4 + A_20_6); const Scalar tmp136 = w1*(A_01_3 + A_01_7 + A_10_0 + A_10_4); const Scalar tmp137 = w15*(A_02_0 + A_02_2 + A_20_5 + A_20_7); const Scalar tmp138 = w16*(A_01_0 + A_01_4 + A_10_3 + A_10_7); const Scalar tmp139 = w5*(A_02_5 + A_02_7 + A_20_0 + A_20_2); const Scalar tmp140 = w18*(A_12_5 - A_21_1); const Scalar tmp141 = w14*(A_00_0 + A_00_1 + A_00_4 + A_00_5); const Scalar tmp142 = w7*(A_22_2 + A_22_6); const Scalar tmp143 = w1*(-A_01_2 - A_01_6 - A_10_2 - A_10_6); const Scalar tmp144 = w4*(-A_12_2 + A_21_6); const Scalar tmp145 = w15*(-A_02_1 - A_02_4 + A_20_0 + A_20_5); const Scalar tmp146 = w0*(A_00_2 + A_00_3 + A_00_6 + A_00_7); const Scalar tmp147 = w16*(-A_01_1 - A_01_5 - A_10_1 - A_10_5); const Scalar tmp148 = w5*(-A_02_3 - A_02_6 + A_20_2 + A_20_7); const Scalar tmp149 = w19*(A_22_1 + A_22_5); const Scalar tmp150 = w17*(-A_02_5 + A_20_1); const Scalar tmp151 = w2*(A_02_2 - A_20_6); const Scalar tmp152 = w18*(A_12_3 - A_21_7); const Scalar tmp153 = w11*(A_02_1 + A_02_6 - A_20_2 - A_20_5); const Scalar tmp154 = w10*(-A_12_2 - A_12_5 + A_21_1 + A_21_6); const Scalar tmp155 = w4*(-A_12_4 + A_21_0); const Scalar tmp156 = w15*(A_02_2 + A_02_7 - A_20_3 - A_20_6); const Scalar tmp157 = w5*(A_02_0 + A_02_5 - A_20_1 - A_20_4); const Scalar tmp158 = w17*(A_02_3 - A_20_7); const Scalar tmp159 = w2*(-A_02_4 + A_20_0); const Scalar tmp160 = w6*(A_12_6 + A_12_7 + A_21_0 + A_21_1); const Scalar tmp161 = w10*(-A_12_2 - A_12_3 - A_12_4 - A_12_5 - A_21_2 - A_21_3 - A_21_4 - A_21_5); const Scalar tmp162 = w1*(A_01_0 + A_01_4 + A_10_3 + A_10_7); const Scalar tmp163 = w16*(A_01_3 + A_01_7 + A_10_0 + A_10_4); const Scalar tmp164 = w12*(A_12_0 + A_12_1 + A_21_6 + A_21_7); const Scalar tmp165 = w20*(A_01_6 + A_10_5); const Scalar tmp166 = w10*(-A_12_0 - A_12_1 - A_12_6 - A_12_7 + A_21_2 + A_21_3 + A_21_4 + A_21_5); const Scalar tmp167 = w15*(A_02_1 + A_02_3 - A_20_0 - A_20_2); const Scalar tmp168 = w21*(A_01_1 + A_10_2); const Scalar tmp169 = w12*(A_12_2 + A_12_3 - A_21_0 - A_21_1); const Scalar tmp170 = w5*(A_02_4 + A_02_6 - A_20_5 - A_20_7); const Scalar tmp171 = w8*(-A_01_2 - A_01_5 - A_10_1 - A_10_6); const Scalar tmp172 = w6*(A_12_4 + A_12_5 - A_21_6 - A_21_7); const Scalar tmp173 = w2*(A_02_1 + A_20_4); const Scalar tmp174 = w11*(-A_02_3 - A_02_4 - A_20_1 - A_20_6); const Scalar tmp175 = w14*(-A_00_2 - A_00_3 - A_00_6 - A_00_7); const Scalar tmp176 = w22*(-A_11_0 - A_11_1 - A_11_2 - A_11_3 - A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp177 = w1*(A_01_1 + A_01_5 - A_10_0 - A_10_4); const Scalar tmp178 = w25*(-A_22_2 - A_22_3 - A_22_6 - A_22_7); const Scalar tmp179 = w15*(-A_02_2 - A_02_7 - A_20_2 - A_20_7); const Scalar tmp180 = w0*(-A_00_0 - A_00_1 - A_00_4 - A_00_5); const Scalar tmp181 = w16*(A_01_2 + A_01_6 - A_10_3 - A_10_7); const Scalar tmp182 = w12*(-A_12_6 - A_12_7 + A_21_2 + A_21_3); const Scalar tmp183 = w5*(-A_02_0 - A_02_5 - A_20_0 - A_20_5); const Scalar tmp184 = w8*(A_01_0 + A_01_3 + A_01_4 + A_01_7 - A_10_1 - A_10_2 - A_10_5 - A_10_6); const Scalar tmp185 = w6*(-A_12_0 - A_12_1 + A_21_4 + A_21_5); const Scalar tmp186 = w17*(-A_02_6 - A_20_3); const Scalar tmp187 = w23*(-A_22_0 - A_22_1 - A_22_4 - A_22_5); const Scalar tmp188 = w18*(A_12_4 - A_21_0); const Scalar tmp189 = w7*(A_22_3 + A_22_7); const Scalar tmp190 = w1*(A_01_3 + A_01_7 + A_10_3 + A_10_7); const Scalar tmp191 = w4*(-A_12_3 + A_21_7); const Scalar tmp192 = w16*(A_01_0 + A_01_4 + A_10_0 + A_10_4); const Scalar tmp193 = w19*(A_22_0 + A_22_4); const Scalar tmp194 = w17*(A_02_4 - A_20_0); const Scalar tmp195 = w2*(-A_02_3 + A_20_7); const Scalar tmp196 = w20*(-A_01_7 - A_10_4); const Scalar tmp197 = w21*(-A_01_0 - A_10_3); const Scalar tmp198 = w16*(A_01_1 + A_01_2 + A_10_1 + A_10_2); const Scalar tmp199 = w8*(A_01_3 + A_01_4 + A_10_0 + A_10_7); const Scalar tmp200 = w1*(A_01_5 + A_01_6 + A_10_5 + A_10_6); const Scalar tmp201 = w27*(A_00_2 + A_00_3 + A_00_4 + A_00_5); const Scalar tmp202 = w11*(-A_02_2 - A_02_5 + A_20_3 + A_20_4); const Scalar tmp203 = w20*(A_01_0 - A_10_1); const Scalar tmp204 = w23*(A_22_0 + A_22_1 + A_22_4 + A_22_5); const Scalar tmp205 = w25*(A_22_2 + A_22_3 + A_22_6 + A_22_7); const Scalar tmp206 = w21*(A_01_7 - A_10_6); const Scalar tmp207 = w12*(A_12_6 + A_12_7 + A_21_6 + A_21_7); const Scalar tmp208 = w28*(A_00_0 + A_00_1); const Scalar tmp209 = w29*(A_00_6 + A_00_7); const Scalar tmp210 = w8*(-A_01_3 - A_01_4 + A_10_2 + A_10_5); const Scalar tmp211 = w6*(A_12_0 + A_12_1 + A_21_0 + A_21_1); const Scalar tmp212 = w17*(-A_02_7 + A_20_6); const Scalar tmp213 = w2*(A_02_0 - A_20_1); const Scalar tmp214 = w13*(-A_22_1 - A_22_2 - A_22_5 - A_22_6); const Scalar tmp215 = w22*(-A_11_0 - A_11_2 - A_11_5 - A_11_7); const Scalar tmp216 = w8*(A_01_0 + A_01_7 + A_10_0 + A_10_7); const Scalar tmp217 = w27*(-A_00_0 - A_00_1 - A_00_6 - A_00_7); const Scalar tmp218 = w17*(-A_02_3 - A_20_3); const Scalar tmp219 = w2*(A_02_4 + A_20_4); const Scalar tmp220 = w11*(-A_02_1 - A_02_6 - A_20_1 - A_20_6); const Scalar tmp221 = w26*(-A_11_4 - A_11_6); const Scalar tmp222 = w10*(A_12_2 + A_12_5 + A_21_2 + A_21_5); const Scalar tmp223 = w20*(-A_01_4 - A_10_4); const Scalar tmp224 = w21*(-A_01_3 - A_10_3); const Scalar tmp225 = w6*(-A_12_0 - A_12_6 - A_21_0 - A_21_6); const Scalar tmp226 = w7*(-A_22_0 - A_22_4); const Scalar tmp227 = w24*(-A_11_1 - A_11_3); const Scalar tmp228 = w19*(-A_22_3 - A_22_7); const Scalar tmp229 = w18*(-A_12_3 - A_21_3); const Scalar tmp230 = w4*(A_12_4 + A_21_4); const Scalar tmp231 = w28*(-A_00_4 - A_00_5); const Scalar tmp232 = w12*(-A_12_1 - A_12_7 - A_21_1 - A_21_7); const Scalar tmp233 = w29*(-A_00_2 - A_00_3); const Scalar tmp234 = w20*(-A_01_5 + A_10_7); const Scalar tmp235 = w18*(-A_12_0 + A_21_2); const Scalar tmp236 = w26*(A_11_5 + A_11_7); const Scalar tmp237 = w10*(A_12_1 + A_12_6 - A_21_3 - A_21_4); const Scalar tmp238 = w22*(A_11_1 + A_11_3 + A_11_4 + A_11_6); const Scalar tmp239 = w4*(A_12_7 - A_21_5); const Scalar tmp240 = w15*(A_02_0 + A_02_2 + A_20_0 + A_20_2); const Scalar tmp241 = w21*(-A_01_2 + A_10_0); const Scalar tmp242 = w5*(A_02_5 + A_02_7 + A_20_5 + A_20_7); const Scalar tmp243 = w12*(-A_12_2 - A_12_4 + A_21_0 + A_21_6); const Scalar tmp244 = w24*(A_11_0 + A_11_2); const Scalar tmp245 = w8*(A_01_1 + A_01_6 - A_10_3 - A_10_4); const Scalar tmp246 = w6*(-A_12_3 - A_12_5 + A_21_1 + A_21_7); const Scalar tmp247 = w11*(A_02_3 + A_02_4 - A_20_2 - A_20_5); const Scalar tmp248 = w20*(-A_01_1 + A_10_0); const Scalar tmp249 = w21*(-A_01_6 + A_10_7); const Scalar tmp250 = w8*(A_01_2 + A_01_5 - A_10_3 - A_10_4); const Scalar tmp251 = w17*(A_02_6 - A_20_7); const Scalar tmp252 = w2*(-A_02_1 + A_20_0); const Scalar tmp253 = w17*(-A_02_4 - A_20_4); const Scalar tmp254 = w2*(A_02_3 + A_20_3); const Scalar tmp255 = w26*(-A_11_1 - A_11_3); const Scalar tmp256 = w20*(-A_01_3 - A_10_3); const Scalar tmp257 = w21*(-A_01_4 - A_10_4); const Scalar tmp258 = w6*(-A_12_1 - A_12_7 - A_21_1 - A_21_7); const Scalar tmp259 = w7*(-A_22_3 - A_22_7); const Scalar tmp260 = w15*(-A_02_0 - A_02_5 - A_20_0 - A_20_5); const Scalar tmp261 = w24*(-A_11_4 - A_11_6); const Scalar tmp262 = w19*(-A_22_0 - A_22_4); const Scalar tmp263 = w18*(-A_12_4 - A_21_4); const Scalar tmp264 = w4*(A_12_3 + A_21_3); const Scalar tmp265 = w28*(-A_00_2 - A_00_3); const Scalar tmp266 = w12*(-A_12_0 - A_12_6 - A_21_0 - A_21_6); const Scalar tmp267 = w5*(-A_02_2 - A_02_7 - A_20_2 - A_20_7); const Scalar tmp268 = w29*(-A_00_4 - A_00_5); const Scalar tmp269 = w11*(A_02_2 + A_02_5 + A_20_0 + A_20_7); const Scalar tmp270 = w1*(-A_01_0 - A_01_4 + A_10_1 + A_10_5); const Scalar tmp271 = w15*(A_02_3 + A_02_6 + A_20_3 + A_20_6); const Scalar tmp272 = w16*(-A_01_3 - A_01_7 + A_10_2 + A_10_6); const Scalar tmp273 = w5*(A_02_1 + A_02_4 + A_20_1 + A_20_4); const Scalar tmp274 = w8*(-A_01_1 - A_01_2 - A_01_5 - A_01_6 + A_10_0 + A_10_3 + A_10_4 + A_10_7); const Scalar tmp275 = w17*(A_02_7 + A_20_2); const Scalar tmp276 = w2*(-A_02_0 - A_20_5); const Scalar tmp277 = w18*(-A_12_1 + A_21_5); const Scalar tmp278 = w11*(A_02_3 + A_02_4 - A_20_0 - A_20_7); const Scalar tmp279 = w10*(A_12_0 + A_12_7 - A_21_3 - A_21_4); const Scalar tmp280 = w4*(A_12_6 - A_21_2); const Scalar tmp281 = w17*(A_02_1 - A_20_5); const Scalar tmp282 = w2*(-A_02_6 + A_20_2); const Scalar tmp283 = w11*(A_02_0 + A_02_7 + A_20_2 + A_20_5); const Scalar tmp284 = w12*(A_12_2 + A_12_3 - A_21_6 - A_21_7); const Scalar tmp285 = w6*(A_12_4 + A_12_5 - A_21_0 - A_21_1); const Scalar tmp286 = w17*(A_02_2 + A_20_7); const Scalar tmp287 = w2*(-A_02_5 - A_20_0); const Scalar tmp288 = w13*(-A_22_0 - A_22_3 - A_22_4 - A_22_7); const Scalar tmp289 = w22*(-A_11_1 - A_11_3 - A_11_4 - A_11_6); const Scalar tmp290 = w8*(-A_01_1 - A_01_6 - A_10_1 - A_10_6); const Scalar tmp291 = w17*(A_02_2 + A_20_2); const Scalar tmp292 = w2*(-A_02_5 - A_20_5); const Scalar tmp293 = w11*(A_02_0 + A_02_7 + A_20_0 + A_20_7); const Scalar tmp294 = w26*(-A_11_5 - A_11_7); const Scalar tmp295 = w10*(A_12_3 + A_12_4 + A_21_3 + A_21_4); const Scalar tmp296 = w20*(A_01_5 + A_10_5); const Scalar tmp297 = w21*(A_01_2 + A_10_2); const Scalar tmp298 = w7*(-A_22_1 - A_22_5); const Scalar tmp299 = w24*(-A_11_0 - A_11_2); const Scalar tmp300 = w19*(-A_22_2 - A_22_6); const Scalar tmp301 = w18*(-A_12_2 - A_21_2); const Scalar tmp302 = w4*(A_12_5 + A_21_5); const Scalar tmp303 = w8*(A_01_3 + A_01_4 + A_10_3 + A_10_4); const Scalar tmp304 = w27*(-A_00_2 - A_00_3 - A_00_4 - A_00_5); const Scalar tmp305 = w17*(A_02_7 + A_20_7); const Scalar tmp306 = w2*(-A_02_0 - A_20_0); const Scalar tmp307 = w11*(A_02_2 + A_02_5 + A_20_2 + A_20_5); const Scalar tmp308 = w26*(-A_11_0 - A_11_2); const Scalar tmp309 = w10*(-A_12_1 - A_12_6 - A_21_1 - A_21_6); const Scalar tmp310 = w20*(-A_01_0 - A_10_0); const Scalar tmp311 = w21*(-A_01_7 - A_10_7); const Scalar tmp312 = w6*(A_12_2 + A_12_4 + A_21_2 + A_21_4); const Scalar tmp313 = w24*(-A_11_5 - A_11_7); const Scalar tmp314 = w18*(A_12_7 + A_21_7); const Scalar tmp315 = w4*(-A_12_0 - A_21_0); const Scalar tmp316 = w28*(-A_00_0 - A_00_1); const Scalar tmp317 = w12*(A_12_3 + A_12_5 + A_21_3 + A_21_5); const Scalar tmp318 = w29*(-A_00_6 - A_00_7); const Scalar tmp319 = w18*(-A_12_7 + A_21_5); const Scalar tmp320 = w26*(A_11_0 + A_11_2); const Scalar tmp321 = w21*(-A_01_5 + A_10_7); const Scalar tmp322 = w20*(-A_01_2 + A_10_0); const Scalar tmp323 = w4*(A_12_0 - A_21_2); const Scalar tmp324 = w15*(A_02_5 + A_02_7 + A_20_5 + A_20_7); const Scalar tmp325 = w24*(A_11_5 + A_11_7); const Scalar tmp326 = w5*(A_02_0 + A_02_2 + A_20_0 + A_20_2); const Scalar tmp327 = w18*(A_12_7 + A_21_1); const Scalar tmp328 = w10*(-A_12_1 - A_12_6 - A_21_0 - A_21_7); const Scalar tmp329 = w3*(-A_11_0 - A_11_2 - A_11_4 - A_11_6); const Scalar tmp330 = w1*(A_01_2 + A_01_6 - A_10_0 - A_10_4); const Scalar tmp331 = w4*(-A_12_0 - A_21_6); const Scalar tmp332 = w25*(-A_22_1 - A_22_3 - A_22_5 - A_22_7); const Scalar tmp333 = w15*(-A_02_5 - A_02_7 + A_20_1 + A_20_3); const Scalar tmp334 = w16*(A_01_1 + A_01_5 - A_10_3 - A_10_7); const Scalar tmp335 = w9*(-A_11_1 - A_11_3 - A_11_5 - A_11_7); const Scalar tmp336 = w5*(-A_02_0 - A_02_2 + A_20_4 + A_20_6); const Scalar tmp337 = w27*(-A_00_0 - A_00_1 - A_00_2 - A_00_3 - A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp338 = w23*(-A_22_0 - A_22_2 - A_22_4 - A_22_6); const Scalar tmp339 = w14*(-A_00_0 - A_00_1 - A_00_4 - A_00_5); const Scalar tmp340 = w23*(-A_22_2 - A_22_3 - A_22_6 - A_22_7); const Scalar tmp341 = w1*(A_01_2 + A_01_6 - A_10_3 - A_10_7); const Scalar tmp342 = w25*(-A_22_0 - A_22_1 - A_22_4 - A_22_5); const Scalar tmp343 = w15*(A_02_1 + A_02_4 + A_20_1 + A_20_4); const Scalar tmp344 = w0*(-A_00_2 - A_00_3 - A_00_6 - A_00_7); const Scalar tmp345 = w16*(A_01_1 + A_01_5 - A_10_0 - A_10_4); const Scalar tmp346 = w12*(A_12_4 + A_12_5 - A_21_0 - A_21_1); const Scalar tmp347 = w5*(A_02_3 + A_02_6 + A_20_3 + A_20_6); const Scalar tmp348 = w6*(A_12_2 + A_12_3 - A_21_6 - A_21_7); const Scalar tmp349 = w17*(A_02_5 + A_20_0); const Scalar tmp350 = w2*(-A_02_2 - A_20_7); const Scalar tmp351 = w8*(-A_01_2 - A_01_5 - A_10_2 - A_10_5); const Scalar tmp352 = w17*(-A_02_1 - A_20_1); const Scalar tmp353 = w2*(A_02_6 + A_20_6); const Scalar tmp354 = w11*(-A_02_3 - A_02_4 - A_20_3 - A_20_4); const Scalar tmp355 = w10*(-A_12_0 - A_12_7 - A_21_0 - A_21_7); const Scalar tmp356 = w20*(A_01_6 + A_10_6); const Scalar tmp357 = w21*(A_01_1 + A_10_1); const Scalar tmp358 = w7*(-A_22_2 - A_22_6); const Scalar tmp359 = w19*(-A_22_1 - A_22_5); const Scalar tmp360 = w18*(A_12_1 + A_21_1); const Scalar tmp361 = w4*(-A_12_6 - A_21_6); const Scalar tmp362 = w28*(-A_00_6 - A_00_7); const Scalar tmp363 = w29*(-A_00_0 - A_00_1); const Scalar tmp364 = w2*(A_02_4 + A_20_1); const Scalar tmp365 = w11*(-A_02_1 - A_02_6 - A_20_3 - A_20_4); const Scalar tmp366 = w17*(-A_02_3 - A_20_6); const Scalar tmp367 = w2*(A_02_5 - A_20_4); const Scalar tmp368 = w6*(-A_12_4 - A_12_5 - A_21_4 - A_21_5); const Scalar tmp369 = w11*(-A_02_0 - A_02_7 + A_20_1 + A_20_6); const Scalar tmp370 = w20*(-A_01_5 + A_10_4); const Scalar tmp371 = w3*(A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp372 = w12*(-A_12_2 - A_12_3 - A_21_2 - A_21_3); const Scalar tmp373 = w21*(-A_01_2 + A_10_3); const Scalar tmp374 = w9*(A_11_0 + A_11_1 + A_11_2 + A_11_3); const Scalar tmp375 = w29*(A_00_2 + A_00_3); const Scalar tmp376 = w8*(A_01_1 + A_01_6 - A_10_0 - A_10_7); const Scalar tmp377 = w28*(A_00_4 + A_00_5); const Scalar tmp378 = w17*(-A_02_2 + A_20_3); const Scalar tmp379 = w17*(A_02_0 + A_20_0); const Scalar tmp380 = w2*(-A_02_7 - A_20_7); const Scalar tmp381 = w20*(-A_01_7 - A_10_7); const Scalar tmp382 = w21*(-A_01_0 - A_10_0); const Scalar tmp383 = w6*(A_12_3 + A_12_5 + A_21_3 + A_21_5); const Scalar tmp384 = w18*(A_12_0 + A_21_0); const Scalar tmp385 = w4*(-A_12_7 - A_21_7); const Scalar tmp386 = w12*(A_12_2 + A_12_4 + A_21_2 + A_21_4); const Scalar tmp387 = w17*(-A_02_6 - A_20_6); const Scalar tmp388 = w2*(A_02_1 + A_20_1); const Scalar tmp389 = w20*(A_01_1 + A_10_1); const Scalar tmp390 = w21*(A_01_6 + A_10_6); const Scalar tmp391 = w18*(A_12_6 + A_21_6); const Scalar tmp392 = w4*(-A_12_1 - A_21_1); const Scalar tmp393 = w2*(A_02_3 + A_20_6); const Scalar tmp394 = w1*(-A_01_3 - A_01_7 + A_10_2 + A_10_6); const Scalar tmp395 = w16*(-A_01_0 - A_01_4 + A_10_1 + A_10_5); const Scalar tmp396 = w17*(-A_02_4 - A_20_1); const Scalar tmp397 = w18*(-A_12_5 - A_21_3); const Scalar tmp398 = w10*(A_12_3 + A_12_4 + A_21_2 + A_21_5); const Scalar tmp399 = w1*(-A_01_0 - A_01_4 + A_10_2 + A_10_6); const Scalar tmp400 = w4*(A_12_2 + A_21_4); const Scalar tmp401 = w16*(-A_01_3 - A_01_7 + A_10_1 + A_10_5); const Scalar tmp402 = w20*(-A_01_2 + A_10_3); const Scalar tmp403 = w21*(-A_01_5 + A_10_4); const Scalar tmp404 = w17*(-A_02_5 + A_20_4); const Scalar tmp405 = w2*(A_02_2 - A_20_3); const Scalar tmp406 = w18*(-A_12_0 + A_21_4); const Scalar tmp407 = w4*(A_12_7 - A_21_3); const Scalar tmp408 = w17*(-A_02_0 + A_20_4); const Scalar tmp409 = w2*(A_02_7 - A_20_3); const Scalar tmp410 = w17*(A_02_5 + A_20_5); const Scalar tmp411 = w2*(-A_02_2 - A_20_2); const Scalar tmp412 = w20*(A_01_2 + A_10_2); const Scalar tmp413 = w21*(A_01_5 + A_10_5); const Scalar tmp414 = w18*(-A_12_5 - A_21_5); const Scalar tmp415 = w4*(A_12_2 + A_21_2); const Scalar tmp416 = w12*(-A_12_0 - A_12_1 + A_21_4 + A_21_5); const Scalar tmp417 = w6*(-A_12_6 - A_12_7 + A_21_2 + A_21_3); const Scalar tmp418 = w17*(A_02_0 + A_20_5); const Scalar tmp419 = w2*(-A_02_7 - A_20_2); const Scalar tmp420 = w18*(-A_12_4 - A_21_2); const Scalar tmp421 = w10*(A_12_2 + A_12_5 + A_21_3 + A_21_4); const Scalar tmp422 = w3*(-A_11_1 - A_11_3 - A_11_5 - A_11_7); const Scalar tmp423 = w1*(A_01_1 + A_01_5 - A_10_3 - A_10_7); const Scalar tmp424 = w25*(-A_22_0 - A_22_2 - A_22_4 - A_22_6); const Scalar tmp425 = w4*(A_12_3 + A_21_5); const Scalar tmp426 = w15*(A_02_4 + A_02_6 - A_20_0 - A_20_2); const Scalar tmp427 = w16*(A_01_2 + A_01_6 - A_10_0 - A_10_4); const Scalar tmp428 = w9*(-A_11_0 - A_11_2 - A_11_4 - A_11_6); const Scalar tmp429 = w5*(A_02_1 + A_02_3 - A_20_5 - A_20_7); const Scalar tmp430 = w23*(-A_22_1 - A_22_3 - A_22_5 - A_22_7); const Scalar tmp431 = w18*(A_12_5 - A_21_7); const Scalar tmp432 = w10*(-A_12_3 - A_12_4 + A_21_1 + A_21_6); const Scalar tmp433 = w21*(A_01_7 - A_10_5); const Scalar tmp434 = w20*(A_01_0 - A_10_2); const Scalar tmp435 = w4*(-A_12_2 + A_21_0); const Scalar tmp436 = w8*(-A_01_3 - A_01_4 + A_10_1 + A_10_6); const Scalar tmp437 = w2*(-A_02_4 + A_20_5); const Scalar tmp438 = w20*(A_01_4 - A_10_5); const Scalar tmp439 = w21*(A_01_3 - A_10_2); const Scalar tmp440 = w16*(-A_01_1 - A_01_2 + A_10_0 + A_10_3); const Scalar tmp441 = w1*(-A_01_5 - A_01_6 + A_10_4 + A_10_7); const Scalar tmp442 = w17*(A_02_3 - A_20_2); const Scalar tmp443 = w20*(-A_01_4 - A_10_7); const Scalar tmp444 = w21*(-A_01_3 - A_10_0); const Scalar tmp445 = w18*(A_12_6 + A_21_0); const Scalar tmp446 = w10*(-A_12_0 - A_12_7 - A_21_1 - A_21_6); const Scalar tmp447 = w1*(-A_01_3 - A_01_7 + A_10_1 + A_10_5); const Scalar tmp448 = w4*(-A_12_1 - A_21_7); const Scalar tmp449 = w16*(-A_01_0 - A_01_4 + A_10_2 + A_10_6); const Scalar tmp450 = w2*(A_02_7 - A_20_6); const Scalar tmp451 = w6*(A_12_6 + A_12_7 + A_21_6 + A_21_7); const Scalar tmp452 = w20*(A_01_7 - A_10_6); const Scalar tmp453 = w21*(A_01_0 - A_10_1); const Scalar tmp454 = w12*(A_12_0 + A_12_1 + A_21_0 + A_21_1); const Scalar tmp455 = w29*(A_00_0 + A_00_1); const Scalar tmp456 = w28*(A_00_6 + A_00_7); const Scalar tmp457 = w17*(-A_02_0 + A_20_1); const Scalar tmp458 = w21*(-A_01_7 - A_10_4); const Scalar tmp459 = w20*(-A_01_0 - A_10_3); const Scalar tmp460 = w12*(A_12_4 + A_12_5 - A_21_6 - A_21_7); const Scalar tmp461 = w6*(A_12_2 + A_12_3 - A_21_0 - A_21_1); const Scalar tmp462 = w18*(A_12_1 + A_21_7); const Scalar tmp463 = w4*(-A_12_6 - A_21_0); const Scalar tmp464 = w15*(A_02_1 + A_02_3 - A_20_5 - A_20_7); const Scalar tmp465 = w5*(A_02_4 + A_02_6 - A_20_0 - A_20_2); const Scalar tmp466 = w2*(-A_02_6 + A_20_7); const Scalar tmp467 = w20*(-A_01_6 + A_10_7); const Scalar tmp468 = w21*(-A_01_1 + A_10_0); const Scalar tmp469 = w17*(A_02_1 - A_20_0); const Scalar tmp470 = w6*(-A_12_2 - A_12_3 - A_21_4 - A_21_5); const Scalar tmp471 = w1*(-A_01_1 - A_01_5 - A_10_2 - A_10_6); const Scalar tmp472 = w15*(-A_02_4 - A_02_6 - A_20_1 - A_20_3); const Scalar tmp473 = w16*(-A_01_2 - A_01_6 - A_10_1 - A_10_5); const Scalar tmp474 = w12*(-A_12_4 - A_12_5 - A_21_2 - A_21_3); const Scalar tmp475 = w5*(-A_02_1 - A_02_3 - A_20_4 - A_20_6); const Scalar tmp476 = w18*(-A_12_6 + A_21_4); const Scalar tmp477 = w20*(A_01_3 - A_10_1); const Scalar tmp478 = w10*(A_12_0 + A_12_7 - A_21_2 - A_21_5); const Scalar tmp479 = w4*(A_12_1 - A_21_3); const Scalar tmp480 = w21*(A_01_4 - A_10_6); const Scalar tmp481 = w8*(-A_01_0 - A_01_7 + A_10_2 + A_10_5); const Scalar tmp482 = w6*(A_12_0 + A_12_1 + A_21_6 + A_21_7); const Scalar tmp483 = w12*(A_12_6 + A_12_7 + A_21_0 + A_21_1); const Scalar tmp484 = w15*(A_02_5 + A_02_7 + A_20_0 + A_20_2); const Scalar tmp485 = w5*(A_02_0 + A_02_2 + A_20_5 + A_20_7); const Scalar tmp486 = w18*(-A_12_1 + A_21_3); const Scalar tmp487 = w20*(A_01_4 - A_10_6); const Scalar tmp488 = w4*(A_12_6 - A_21_4); const Scalar tmp489 = w21*(A_01_3 - A_10_1); const Scalar tmp490 = w20*(A_01_7 - A_10_5); const Scalar tmp491 = w18*(A_12_2 - A_21_0); const Scalar tmp492 = w4*(-A_12_5 + A_21_7); const Scalar tmp493 = w21*(A_01_0 - A_10_2); const Scalar tmp494 = w20*(A_01_1 + A_10_2); const Scalar tmp495 = w21*(A_01_6 + A_10_5); const Scalar tmp496 = w18*(-A_12_2 - A_21_4); const Scalar tmp497 = w4*(A_12_5 + A_21_3); const Scalar tmp498 = w15*(-A_02_0 - A_02_2 + A_20_4 + A_20_6); const Scalar tmp499 = w5*(-A_02_5 - A_02_7 + A_20_1 + A_20_3); const Scalar tmp500 = w18*(-A_12_6 + A_21_2); const Scalar tmp501 = w4*(A_12_1 - A_21_5); const Scalar tmp502 = w17*(A_02_6 - A_20_2); const Scalar tmp503 = w2*(-A_02_1 + A_20_5); const Scalar tmp504 = w18*(-A_12_3 - A_21_5); const Scalar tmp505 = w4*(A_12_4 + A_21_2); const Scalar tmp506 = w2*(A_02_6 + A_20_3); const Scalar tmp507 = w17*(-A_02_1 - A_20_4); const Scalar tmp508 = w18*(A_12_0 + A_21_6); const Scalar tmp509 = w4*(-A_12_7 - A_21_1); EM_S[INDEX2(0,0,8)]+=tmp198 + tmp200 + tmp214 + tmp259 + tmp262 + tmp289 + tmp294 + tmp299 + tmp303 + tmp304 + tmp307 + tmp309 + tmp343 + tmp347 + tmp362 + tmp363 + tmp379 + tmp380 + tmp381 + tmp382 + tmp383 + tmp384 + tmp385 + tmp386; EM_S[INDEX2(1,0,8)]+=tmp145 + tmp148 + tmp161 + tmp201 + tmp202 + tmp210 + tmp371 + tmp374 + tmp440 + tmp441 + tmp450 + tmp451 + tmp452 + tmp453 + tmp454 + tmp455 + tmp456 + tmp457 + tmp89 + tmp91; EM_S[INDEX2(2,0,8)]+=tmp135 + tmp234 + tmp235 + tmp236 + tmp237 + tmp238 + tmp239 + tmp240 + tmp241 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp39 + tmp41 + tmp44 + tmp49 + tmp61 + tmp71; EM_S[INDEX2(3,0,8)]+=tmp20 + tmp21 + tmp24 + tmp34 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79 + tmp80 + tmp81 + tmp82 + tmp83; EM_S[INDEX2(4,0,8)]+=tmp1 + tmp127 + tmp131 + tmp141 + tmp146 + tmp15 + tmp153 + tmp154 + tmp188 + tmp189 + tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp68 + tmp70 + tmp92 + tmp98; EM_S[INDEX2(5,0,8)]+=tmp166 + tmp176 + tmp260 + tmp267 + tmp274 + tmp339 + tmp340 + tmp342 + tmp344 + tmp346 + tmp348 + tmp365 + tmp393 + tmp394 + tmp395 + tmp396; EM_S[INDEX2(6,0,8)]+=tmp114 + tmp184 + tmp258 + tmp266 + tmp337 + tmp420 + tmp421 + tmp422 + tmp423 + tmp424 + tmp425 + tmp426 + tmp427 + tmp428 + tmp429 + tmp430; EM_S[INDEX2(7,0,8)]+=tmp104 + tmp106 + tmp112 + tmp113 + tmp38 + tmp470 + tmp471 + tmp472 + tmp473 + tmp474 + tmp475 + tmp87; EM_S[INDEX2(0,1,8)]+=tmp161 + tmp201 + tmp247 + tmp250 + tmp371 + tmp374 + tmp44 + tmp451 + tmp454 + tmp455 + tmp456 + tmp466 + tmp467 + tmp468 + tmp469 + tmp49 + tmp89 + tmp91 + tmp92 + tmp98; EM_S[INDEX2(1,1,8)]+=tmp215 + tmp221 + tmp227 + tmp260 + tmp267 + tmp288 + tmp304 + tmp312 + tmp317 + tmp351 + tmp352 + tmp353 + tmp354 + tmp355 + tmp356 + tmp357 + tmp358 + tmp359 + tmp360 + tmp361 + tmp362 + tmp363 + tmp76 + tmp79; EM_S[INDEX2(2,1,8)]+=tmp114 + tmp120 + tmp167 + tmp170 + tmp198 + tmp20 + tmp200 + tmp24 + tmp443 + tmp444 + tmp73 + tmp74 + tmp75 + tmp80 + tmp81 + tmp83; EM_S[INDEX2(3,1,8)]+=tmp13 + tmp16 + tmp38 + tmp39 + tmp40 + tmp41 + tmp43 + tmp440 + tmp441 + tmp45 + tmp47 + tmp478 + tmp481 + tmp486 + tmp487 + tmp488 + tmp489 + tmp50 + tmp52 + tmp55; EM_S[INDEX2(4,1,8)]+=tmp166 + tmp176 + tmp184 + tmp283 + tmp339 + tmp340 + tmp341 + tmp342 + tmp343 + tmp344 + tmp345 + tmp346 + tmp347 + tmp348 + tmp349 + tmp350; EM_S[INDEX2(5,1,8)]+=tmp112 + tmp12 + tmp123 + tmp124 + tmp126 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147 + tmp148 + tmp149 + tmp150 + tmp151 + tmp51 + tmp54 + tmp6; EM_S[INDEX2(6,1,8)]+=tmp104 + tmp106 + tmp113 + tmp135 + tmp15 + tmp162 + tmp163 + tmp470 + tmp474 + tmp484 + tmp485 + tmp87; EM_S[INDEX2(7,1,8)]+=tmp21 + tmp225 + tmp232 + tmp274 + tmp329 + tmp332 + tmp333 + tmp335 + tmp336 + tmp337 + tmp338 + tmp397 + tmp398 + tmp399 + tmp400 + tmp401; EM_S[INDEX2(0,2,8)]+=tmp135 + tmp236 + tmp238 + tmp240 + tmp242 + tmp244 + tmp39 + tmp41 + tmp432 + tmp436 + tmp440 + tmp441 + tmp490 + tmp491 + tmp492 + tmp493 + tmp61 + tmp68 + tmp70 + tmp71; EM_S[INDEX2(1,2,8)]+=tmp166 + tmp169 + tmp172 + tmp196 + tmp197 + tmp198 + tmp199 + tmp20 + tmp200 + tmp21 + tmp73 + tmp74 + tmp75 + tmp77 + tmp80 + tmp82; EM_S[INDEX2(2,2,8)]+=tmp217 + tmp231 + tmp233 + tmp258 + tmp266 + tmp271 + tmp273 + tmp288 + tmp289 + tmp290 + tmp291 + tmp292 + tmp293 + tmp294 + tmp295 + tmp296 + tmp297 + tmp298 + tmp299 + tmp300 + tmp301 + tmp302 + tmp76 + tmp79; EM_S[INDEX2(3,2,8)]+=tmp101 + tmp14 + tmp204 + tmp205 + tmp367 + tmp368 + tmp369 + tmp370 + tmp371 + tmp372 + tmp373 + tmp374 + tmp375 + tmp376 + tmp377 + tmp378 + tmp44 + tmp49 + tmp87 + tmp9; EM_S[INDEX2(4,2,8)]+=tmp114 + tmp274 + tmp337 + tmp383 + tmp386 + tmp422 + tmp424 + tmp426 + tmp428 + tmp429 + tmp430 + tmp445 + tmp446 + tmp447 + tmp448 + tmp449; EM_S[INDEX2(5,2,8)]+=tmp104 + tmp106 + tmp113 + tmp136 + tmp138 + tmp15 + tmp161 + tmp38 + tmp472 + tmp475 + tmp482 + tmp483; EM_S[INDEX2(6,2,8)]+=tmp10 + tmp112 + tmp123 + tmp125 + tmp127 + tmp128 + tmp130 + tmp131 + tmp132 + tmp156 + tmp157 + tmp243 + tmp246 + tmp278 + tmp279 + tmp3 + tmp500 + tmp501 + tmp502 + tmp503; EM_S[INDEX2(7,2,8)]+=tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179 + tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp24; EM_S[INDEX2(0,3,8)]+=tmp114 + tmp165 + tmp166 + tmp167 + tmp168 + tmp169 + tmp170 + tmp171 + tmp172 + tmp20 + tmp73 + tmp74 + tmp75 + tmp76 + tmp79 + tmp80; EM_S[INDEX2(1,3,8)]+=tmp36 + tmp37 + tmp38 + tmp39 + tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55; EM_S[INDEX2(2,3,8)]+=tmp101 + tmp156 + tmp157 + tmp204 + tmp205 + tmp368 + tmp371 + tmp372 + tmp374 + tmp375 + tmp377 + tmp437 + tmp438 + tmp439 + tmp440 + tmp441 + tmp442 + tmp85 + tmp87 + tmp99; EM_S[INDEX2(3,3,8)]+=tmp179 + tmp183 + tmp198 + tmp200 + tmp214 + tmp215 + tmp216 + tmp217 + tmp218 + tmp219 + tmp220 + tmp221 + tmp222 + tmp223 + tmp224 + tmp225 + tmp226 + tmp227 + tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233; EM_S[INDEX2(4,3,8)]+=tmp104 + tmp106 + tmp107 + tmp109 + tmp112 + tmp113 + tmp135 + tmp161 + tmp482 + tmp483 + tmp484 + tmp485; EM_S[INDEX2(5,3,8)]+=tmp184 + tmp21 + tmp312 + tmp317 + tmp327 + tmp328 + tmp329 + tmp330 + tmp331 + tmp332 + tmp333 + tmp334 + tmp335 + tmp336 + tmp337 + tmp338; EM_S[INDEX2(6,3,8)]+=tmp175 + tmp176 + tmp178 + tmp180 + tmp182 + tmp185 + tmp187 + tmp24 + tmp269 + tmp270 + tmp271 + tmp272 + tmp273 + tmp274 + tmp275 + tmp276; EM_S[INDEX2(7,3,8)]+=tmp0 + tmp1 + tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX2(0,4,8)]+=tmp1 + tmp127 + tmp131 + tmp141 + tmp145 + tmp146 + tmp148 + tmp15 + tmp189 + tmp190 + tmp192 + tmp193 + tmp2 + tmp243 + tmp246 + tmp406 + tmp407 + tmp408 + tmp409 + tmp5; EM_S[INDEX2(1,4,8)]+=tmp176 + tmp24 + tmp269 + tmp274 + tmp339 + tmp340 + tmp342 + tmp343 + tmp344 + tmp347 + tmp394 + tmp395 + tmp416 + tmp417 + tmp418 + tmp419; EM_S[INDEX2(2,4,8)]+=tmp184 + tmp21 + tmp328 + tmp337 + tmp383 + tmp386 + tmp422 + tmp423 + tmp424 + tmp427 + tmp428 + tmp430 + tmp498 + tmp499 + tmp508 + tmp509; EM_S[INDEX2(3,4,8)]+=tmp104 + tmp106 + tmp112 + tmp113 + tmp135 + tmp137 + tmp139 + tmp160 + tmp161 + tmp164 + tmp471 + tmp473; EM_S[INDEX2(4,4,8)]+=tmp118 + tmp121 + tmp214 + tmp215 + tmp216 + tmp217 + tmp220 + tmp222 + tmp253 + tmp254 + tmp255 + tmp256 + tmp257 + tmp258 + tmp259 + tmp260 + tmp261 + tmp262 + tmp263 + tmp264 + tmp265 + tmp266 + tmp267 + tmp268; EM_S[INDEX2(5,4,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91 + tmp92 + tmp93 + tmp94 + tmp95 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX2(6,4,8)]+=tmp38 + tmp42 + tmp43 + tmp53 + tmp56 + tmp57 + tmp58 + tmp59 + tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65 + tmp66 + tmp67 + tmp68 + tmp69 + tmp70 + tmp71; EM_S[INDEX2(7,4,8)]+=tmp114 + tmp117 + tmp119 + tmp166 + tmp171 + tmp20 + tmp22 + tmp25 + tmp26 + tmp28 + tmp29 + tmp30 + tmp460 + tmp461 + tmp494 + tmp495; EM_S[INDEX2(0,5,8)]+=tmp174 + tmp176 + tmp184 + tmp24 + tmp260 + tmp267 + tmp339 + tmp340 + tmp341 + tmp342 + tmp344 + tmp345 + tmp416 + tmp417 + tmp506 + tmp507; EM_S[INDEX2(1,5,8)]+=tmp112 + tmp12 + tmp123 + tmp13 + tmp141 + tmp142 + tmp143 + tmp146 + tmp147 + tmp149 + tmp16 + tmp277 + tmp278 + tmp279 + tmp280 + tmp281 + tmp282 + tmp6 + tmp92 + tmp98; EM_S[INDEX2(2,5,8)]+=tmp104 + tmp106 + tmp108 + tmp111 + tmp113 + tmp15 + tmp160 + tmp161 + tmp162 + tmp163 + tmp164 + tmp38; EM_S[INDEX2(3,5,8)]+=tmp114 + tmp274 + tmp312 + tmp317 + tmp329 + tmp332 + tmp335 + tmp337 + tmp338 + tmp399 + tmp401 + tmp446 + tmp462 + tmp463 + tmp464 + tmp465; EM_S[INDEX2(4,5,8)]+=tmp100 + tmp101 + tmp145 + tmp148 + tmp369 + tmp376 + tmp402 + tmp403 + tmp404 + tmp405 + tmp60 + tmp65 + tmp84 + tmp87 + tmp88 + tmp89 + tmp91 + tmp95 + tmp96 + tmp97; EM_S[INDEX2(5,5,8)]+=tmp217 + tmp225 + tmp232 + tmp26 + tmp265 + tmp268 + tmp288 + tmp289 + tmp29 + tmp290 + tmp293 + tmp295 + tmp308 + tmp313 + tmp343 + tmp347 + tmp358 + tmp359 + tmp410 + tmp411 + tmp412 + tmp413 + tmp414 + tmp415; EM_S[INDEX2(6,5,8)]+=tmp118 + tmp121 + tmp166 + tmp199 + tmp20 + tmp21 + tmp22 + tmp25 + tmp27 + tmp28 + tmp30 + tmp33 + tmp458 + tmp459 + tmp460 + tmp461; EM_S[INDEX2(7,5,8)]+=tmp135 + tmp238 + tmp320 + tmp324 + tmp325 + tmp326 + tmp431 + tmp432 + tmp433 + tmp434 + tmp435 + tmp436 + tmp45 + tmp51 + tmp54 + tmp55 + tmp57 + tmp64 + tmp90 + tmp94; EM_S[INDEX2(0,6,8)]+=tmp21 + tmp258 + tmp266 + tmp274 + tmp337 + tmp398 + tmp422 + tmp424 + tmp428 + tmp430 + tmp447 + tmp449 + tmp496 + tmp497 + tmp498 + tmp499; EM_S[INDEX2(1,6,8)]+=tmp104 + tmp105 + tmp106 + tmp110 + tmp113 + tmp135 + tmp136 + tmp137 + tmp138 + tmp139 + tmp15 + tmp87; EM_S[INDEX2(2,6,8)]+=tmp10 + tmp112 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131 + tmp132 + tmp133 + tmp134 + tmp14 + tmp3 + tmp68 + tmp70 + tmp9; EM_S[INDEX2(3,6,8)]+=tmp166 + tmp175 + tmp176 + tmp177 + tmp178 + tmp180 + tmp181 + tmp184 + tmp187 + tmp271 + tmp273 + tmp283 + tmp284 + tmp285 + tmp286 + tmp287; EM_S[INDEX2(4,6,8)]+=tmp243 + tmp246 + tmp38 + tmp43 + tmp476 + tmp477 + tmp478 + tmp479 + tmp480 + tmp481 + tmp57 + tmp58 + tmp61 + tmp63 + tmp64 + tmp66 + tmp69 + tmp71 + tmp90 + tmp94; EM_S[INDEX2(5,6,8)]+=tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp20 + tmp22 + tmp24 + tmp25 + tmp28 + tmp30 + tmp32 + tmp35; EM_S[INDEX2(6,6,8)]+=tmp179 + tmp183 + tmp215 + tmp255 + tmp26 + tmp261 + tmp288 + tmp29 + tmp298 + tmp300 + tmp304 + tmp316 + tmp318 + tmp351 + tmp354 + tmp355 + tmp383 + tmp386 + tmp387 + tmp388 + tmp389 + tmp390 + tmp391 + tmp392; EM_S[INDEX2(7,6,8)]+=tmp100 + tmp156 + tmp157 + tmp161 + tmp201 + tmp204 + tmp205 + tmp207 + tmp208 + tmp209 + tmp211 + tmp247 + tmp248 + tmp249 + tmp250 + tmp251 + tmp252 + tmp60 + tmp65 + tmp88; EM_S[INDEX2(0,7,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113 + tmp38 + tmp87; EM_S[INDEX2(1,7,8)]+=tmp114 + tmp184 + tmp225 + tmp232 + tmp329 + tmp330 + tmp332 + tmp334 + tmp335 + tmp337 + tmp338 + tmp421 + tmp464 + tmp465 + tmp504 + tmp505; EM_S[INDEX2(2,7,8)]+=tmp166 + tmp175 + tmp176 + tmp178 + tmp179 + tmp180 + tmp183 + tmp187 + tmp270 + tmp272 + tmp274 + tmp284 + tmp285 + tmp364 + tmp365 + tmp366; EM_S[INDEX2(3,7,8)]+=tmp1 + tmp10 + tmp11 + tmp12 + tmp15 + tmp152 + tmp153 + tmp154 + tmp155 + tmp156 + tmp157 + tmp158 + tmp159 + tmp17 + tmp3 + tmp4 + tmp51 + tmp54 + tmp6 + tmp7; EM_S[INDEX2(4,7,8)]+=tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35; EM_S[INDEX2(5,7,8)]+=tmp13 + tmp135 + tmp16 + tmp237 + tmp238 + tmp245 + tmp319 + tmp320 + tmp321 + tmp322 + tmp323 + tmp324 + tmp325 + tmp326 + tmp45 + tmp55 + tmp57 + tmp60 + tmp64 + tmp65; EM_S[INDEX2(6,7,8)]+=tmp100 + tmp14 + tmp161 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp208 + tmp209 + tmp210 + tmp211 + tmp212 + tmp213 + tmp88 + tmp9 + tmp90 + tmp94; EM_S[INDEX2(7,7,8)]+=tmp118 + tmp121 + tmp214 + tmp226 + tmp228 + tmp271 + tmp273 + tmp289 + tmp303 + tmp304 + tmp305 + tmp306 + tmp307 + tmp308 + tmp309 + tmp310 + tmp311 + tmp312 + tmp313 + tmp314 + tmp315 + tmp316 + tmp317 + tmp318; } else { // constant data const Scalar Aw00 = 8.*A_p[INDEX2(0,0,3)]*w27; const Scalar Aw01 = 12.*A_p[INDEX2(0,1,3)]*w8; const Scalar Aw02 = 12.*A_p[INDEX2(0,2,3)]*w11; const Scalar Aw10 = 12.*A_p[INDEX2(1,0,3)]*w8; const Scalar Aw11 = 8.*A_p[INDEX2(1,1,3)]*w22; const Scalar Aw12 = 12.*A_p[INDEX2(1,2,3)]*w10; const Scalar Aw20 = 12.*A_p[INDEX2(2,0,3)]*w11; const Scalar Aw21 = 12.*A_p[INDEX2(2,1,3)]*w10; const Scalar Aw22 = 8.*A_p[INDEX2(2,2,3)]*w13; const Scalar tmp0 = Aw01 + Aw10; const Scalar tmp1 = Aw01 - Aw10; const Scalar tmp2 = -Aw01 - Aw10; const Scalar tmp3 = -Aw01 + Aw10; const Scalar tmp4 = Aw02 + Aw20; const Scalar tmp5 = Aw02 - Aw20; const Scalar tmp6 = -Aw02 - Aw20; const Scalar tmp7 = -Aw02 + Aw20; const Scalar tmp8 = Aw12 + Aw21; const Scalar tmp9 = Aw12 - Aw21; const Scalar tmp10 = -Aw12 - Aw21; const Scalar tmp11 = -Aw12 + Aw21; EM_S[INDEX2(0,0,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp4 + 2.*tmp10; EM_S[INDEX2(1,0,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + 2.*tmp7 + 2.*tmp3 + tmp10; EM_S[INDEX2(2,0,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp9 + tmp4 + 2.*tmp1; EM_S[INDEX2(3,0,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp7 + tmp9 + 2.*tmp2; EM_S[INDEX2(4,0,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + tmp0 + 2.*tmp11 + 2.*tmp5; EM_S[INDEX2(5,0,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + tmp11 + 2.*tmp6 + tmp3; EM_S[INDEX2(6,0,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp5 + tmp1 + 2.*tmp8; EM_S[INDEX2(7,0,8)]+= Aw00 + Aw11 + Aw22 + tmp8 + tmp2 + tmp6; EM_S[INDEX2(0,1,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp10 + 2.*tmp1 + 2.*tmp5; EM_S[INDEX2(1,1,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp6 + 2.*tmp10 + 2.*tmp2; EM_S[INDEX2(2,1,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp5 + 2.*tmp0 + tmp9; EM_S[INDEX2(3,1,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp9 + 2.*tmp3 + tmp6; EM_S[INDEX2(4,1,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + tmp11 + tmp1 + 2.*tmp4; EM_S[INDEX2(5,1,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp7 + tmp2 + 2.*tmp11; EM_S[INDEX2(6,1,8)]+= Aw00 + Aw11 + Aw22 + tmp8 + tmp4 + tmp0; EM_S[INDEX2(7,1,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + 2.*tmp8 + tmp3 + tmp7; EM_S[INDEX2(0,2,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp3 + tmp4 + 2.*tmp11; EM_S[INDEX2(1,2,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + 2.*tmp0 + tmp11 + tmp7; EM_S[INDEX2(2,2,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp8 + 2.*tmp4 + 2.*tmp2; EM_S[INDEX2(3,2,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + 2.*tmp7 + tmp8 + 2.*tmp1; EM_S[INDEX2(4,2,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp5 + tmp3 + 2.*tmp10; EM_S[INDEX2(5,2,8)]+= Aw00 + Aw11 + Aw22 + tmp10 + tmp0 + tmp6; EM_S[INDEX2(6,2,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp9 + tmp2 + 2.*tmp5; EM_S[INDEX2(7,2,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp6 + tmp1 + tmp9; EM_S[INDEX2(0,3,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp5 + tmp11 + 2.*tmp2; EM_S[INDEX2(1,3,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + tmp6 + 2.*tmp11 + 2.*tmp1; EM_S[INDEX2(2,3,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp8 + 2.*tmp3 + 2.*tmp5; EM_S[INDEX2(3,3,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp6 + 2.*tmp8; EM_S[INDEX2(4,3,8)]+= Aw00 + Aw11 + Aw22 + tmp2 + tmp4 + tmp10; EM_S[INDEX2(5,3,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp1 + 2.*tmp10 + tmp7; EM_S[INDEX2(6,3,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp4 + tmp3 + tmp9; EM_S[INDEX2(7,3,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp7 + 2.*tmp9 + tmp0; EM_S[INDEX2(0,4,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp7 + 2.*tmp9 + tmp0; EM_S[INDEX2(1,4,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp4 + tmp3 + tmp9; EM_S[INDEX2(2,4,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp1 + 2.*tmp10 + tmp7; EM_S[INDEX2(3,4,8)]+= Aw00 + Aw11 + Aw22 + tmp2 + tmp4 + tmp10; EM_S[INDEX2(4,4,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp6 + 2.*tmp8; EM_S[INDEX2(5,4,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp8 + 2.*tmp3 + 2.*tmp5; EM_S[INDEX2(6,4,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + tmp6 + 2.*tmp11 + 2.*tmp1; EM_S[INDEX2(7,4,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp5 + tmp11 + 2.*tmp2; EM_S[INDEX2(0,5,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp6 + tmp1 + tmp9; EM_S[INDEX2(1,5,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp9 + tmp2 + 2.*tmp5; EM_S[INDEX2(2,5,8)]+= Aw00 + Aw11 + Aw22 + tmp10 + tmp0 + tmp6; EM_S[INDEX2(3,5,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp5 + tmp3 + 2.*tmp10; EM_S[INDEX2(4,5,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + 2.*tmp7 + tmp8 + 2.*tmp1; EM_S[INDEX2(5,5,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp8 + 2.*tmp4 + 2.*tmp2; EM_S[INDEX2(6,5,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + 2.*tmp0 + tmp11 + tmp7; EM_S[INDEX2(7,5,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp3 + tmp4 + 2.*tmp11; EM_S[INDEX2(0,6,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + 2.*tmp8 + tmp3 + tmp7; EM_S[INDEX2(1,6,8)]+= Aw00 + Aw11 + Aw22 + tmp8 + tmp4 + tmp0; EM_S[INDEX2(2,6,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp7 + tmp2 + 2.*tmp11; EM_S[INDEX2(3,6,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + tmp11 + tmp1 + 2.*tmp4; EM_S[INDEX2(4,6,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp9 + 2.*tmp3 + tmp6; EM_S[INDEX2(5,6,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp5 + 2.*tmp0 + tmp9; EM_S[INDEX2(6,6,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp6 + 2.*tmp10 + 2.*tmp2; EM_S[INDEX2(7,6,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp10 + 2.*tmp1 + 2.*tmp5; EM_S[INDEX2(0,7,8)]+= Aw00 + Aw11 + Aw22 + tmp8 + tmp2 + tmp6; EM_S[INDEX2(1,7,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp5 + tmp1 + 2.*tmp8; EM_S[INDEX2(2,7,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + tmp11 + 2.*tmp6 + tmp3; EM_S[INDEX2(3,7,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + tmp0 + 2.*tmp11 + 2.*tmp5; EM_S[INDEX2(4,7,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp7 + tmp9 + 2.*tmp2; EM_S[INDEX2(5,7,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp9 + tmp4 + 2.*tmp1; EM_S[INDEX2(6,7,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + 2.*tmp7 + 2.*tmp3 + tmp10; EM_S[INDEX2(7,7,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp4 + 2.*tmp10; } } /////////////// // process B // /////////////// if (!B.isEmpty()) { const Scalar* B_p = B.getSampleDataRO(e, zero); if (B.actsExpanded()) { const Scalar B_0_0 = B_p[INDEX2(0,0,3)]; const Scalar B_1_0 = B_p[INDEX2(1,0,3)]; const Scalar B_2_0 = B_p[INDEX2(2,0,3)]; const Scalar B_0_1 = B_p[INDEX2(0,1,3)]; const Scalar B_1_1 = B_p[INDEX2(1,1,3)]; const Scalar B_2_1 = B_p[INDEX2(2,1,3)]; const Scalar B_0_2 = B_p[INDEX2(0,2,3)]; const Scalar B_1_2 = B_p[INDEX2(1,2,3)]; const Scalar B_2_2 = B_p[INDEX2(2,2,3)]; const Scalar B_0_3 = B_p[INDEX2(0,3,3)]; const Scalar B_1_3 = B_p[INDEX2(1,3,3)]; const Scalar B_2_3 = B_p[INDEX2(2,3,3)]; const Scalar B_0_4 = B_p[INDEX2(0,4,3)]; const Scalar B_1_4 = B_p[INDEX2(1,4,3)]; const Scalar B_2_4 = B_p[INDEX2(2,4,3)]; const Scalar B_0_5 = B_p[INDEX2(0,5,3)]; const Scalar B_1_5 = B_p[INDEX2(1,5,3)]; const Scalar B_2_5 = B_p[INDEX2(2,5,3)]; const Scalar B_0_6 = B_p[INDEX2(0,6,3)]; const Scalar B_1_6 = B_p[INDEX2(1,6,3)]; const Scalar B_2_6 = B_p[INDEX2(2,6,3)]; const Scalar B_0_7 = B_p[INDEX2(0,7,3)]; const Scalar B_1_7 = B_p[INDEX2(1,7,3)]; const Scalar B_2_7 = B_p[INDEX2(2,7,3)]; const Scalar tmp0 = w38*(B_0_3 + B_0_7); const Scalar tmp1 = w31*(B_1_0 + B_1_4); const Scalar tmp2 = w42*(B_2_5 + B_2_6); const Scalar tmp3 = w35*(B_2_1 + B_2_2); const Scalar tmp4 = w37*(B_1_2 + B_1_6); const Scalar tmp5 = w39*(B_1_3 + B_1_7); const Scalar tmp6 = w36*(B_0_2 + B_0_6); const Scalar tmp7 = w33*(B_0_1 + B_0_5); const Scalar tmp8 = w30*(B_0_0 + B_0_4); const Scalar tmp9 = w34*(B_1_1 + B_1_5); const Scalar tmp10 = w38*(-B_0_5 - B_0_7); const Scalar tmp11 = w31*(-B_1_0 - B_1_1); const Scalar tmp12 = w42*(B_2_0 + B_2_1 + B_2_2 + B_2_3); const Scalar tmp13 = w35*(B_2_4 + B_2_5 + B_2_6 + B_2_7); const Scalar tmp14 = w37*(-B_1_2 - B_1_3); const Scalar tmp15 = w39*(-B_1_6 - B_1_7); const Scalar tmp16 = w36*(-B_0_4 - B_0_6); const Scalar tmp17 = w33*(-B_0_1 - B_0_3); const Scalar tmp18 = w30*(-B_0_0 - B_0_2); const Scalar tmp19 = w34*(-B_1_4 - B_1_5); const Scalar tmp20 = w38*(B_0_1 + B_0_3); const Scalar tmp21 = w42*(-B_2_0 - B_2_2); const Scalar tmp22 = w35*(-B_2_5 - B_2_7); const Scalar tmp23 = w37*(-B_1_0 - B_1_5); const Scalar tmp24 = w32*(-B_2_4 - B_2_6); const Scalar tmp25 = w36*(B_0_0 + B_0_2); const Scalar tmp26 = w33*(B_0_5 + B_0_7); const Scalar tmp27 = w30*(B_0_4 + B_0_6); const Scalar tmp28 = w43*(-B_2_1 - B_2_3); const Scalar tmp29 = w34*(-B_1_2 - B_1_7); const Scalar tmp30 = w38*(-B_0_4 - B_0_6); const Scalar tmp31 = w42*(B_2_5 + B_2_7); const Scalar tmp32 = w35*(B_2_0 + B_2_2); const Scalar tmp33 = w37*(B_1_2 + B_1_7); const Scalar tmp34 = w32*(B_2_1 + B_2_3); const Scalar tmp35 = w36*(-B_0_5 - B_0_7); const Scalar tmp36 = w33*(-B_0_0 - B_0_2); const Scalar tmp37 = w30*(-B_0_1 - B_0_3); const Scalar tmp38 = w43*(B_2_4 + B_2_6); const Scalar tmp39 = w34*(B_1_0 + B_1_5); const Scalar tmp40 = w38*(B_0_0 + B_0_2); const Scalar tmp41 = w31*(B_1_6 + B_1_7); const Scalar tmp42 = w42*(-B_2_4 - B_2_5 - B_2_6 - B_2_7); const Scalar tmp43 = w35*(-B_2_0 - B_2_1 - B_2_2 - B_2_3); const Scalar tmp44 = w37*(B_1_4 + B_1_5); const Scalar tmp45 = w39*(B_1_0 + B_1_1); const Scalar tmp46 = w36*(B_0_1 + B_0_3); const Scalar tmp47 = w33*(B_0_4 + B_0_6); const Scalar tmp48 = w30*(B_0_5 + B_0_7); const Scalar tmp49 = w34*(B_1_2 + B_1_3); const Scalar tmp50 = w31*(-B_1_2 - B_1_3); const Scalar tmp51 = w42*(B_2_6 + B_2_7); const Scalar tmp52 = w35*(B_2_0 + B_2_1); const Scalar tmp53 = w37*(-B_1_0 - B_1_1); const Scalar tmp54 = w32*(B_2_2 + B_2_3); const Scalar tmp55 = w39*(-B_1_4 - B_1_5); const Scalar tmp56 = w36*(B_0_0 + B_0_6); const Scalar tmp57 = w33*(B_0_1 + B_0_7); const Scalar tmp58 = w43*(B_2_4 + B_2_5); const Scalar tmp59 = w34*(-B_1_6 - B_1_7); const Scalar tmp60 = w42*(-B_2_0 - B_2_1 - B_2_2 - B_2_3); const Scalar tmp61 = w35*(-B_2_4 - B_2_5 - B_2_6 - B_2_7); const Scalar tmp62 = w37*(-B_1_0 - B_1_1 - B_1_4 - B_1_5); const Scalar tmp63 = w36*(-B_0_1 - B_0_3 - B_0_5 - B_0_7); const Scalar tmp64 = w33*(-B_0_0 - B_0_2 - B_0_4 - B_0_6); const Scalar tmp65 = w34*(-B_1_2 - B_1_3 - B_1_6 - B_1_7); const Scalar tmp66 = w38*(B_0_4 + B_0_6); const Scalar tmp67 = w36*(B_0_5 + B_0_7); const Scalar tmp68 = w33*(B_0_0 + B_0_2); const Scalar tmp69 = w30*(B_0_1 + B_0_3); const Scalar tmp70 = w38*(-B_0_2 - B_0_6); const Scalar tmp71 = w31*(B_1_1 + B_1_5); const Scalar tmp72 = w42*(-B_2_0 - B_2_3); const Scalar tmp73 = w35*(-B_2_4 - B_2_7); const Scalar tmp74 = w37*(B_1_3 + B_1_7); const Scalar tmp75 = w39*(B_1_2 + B_1_6); const Scalar tmp76 = w36*(-B_0_3 - B_0_7); const Scalar tmp77 = w33*(-B_0_0 - B_0_4); const Scalar tmp78 = w30*(-B_0_1 - B_0_5); const Scalar tmp79 = w34*(B_1_0 + B_1_4); const Scalar tmp80 = w36*(B_0_0 + B_0_2 + B_0_4 + B_0_6); const Scalar tmp81 = w33*(B_0_1 + B_0_3 + B_0_5 + B_0_7); const Scalar tmp82 = w38*(B_0_1 + B_0_5); const Scalar tmp83 = w31*(-B_1_2 - B_1_6); const Scalar tmp84 = w42*(B_2_4 + B_2_7); const Scalar tmp85 = w35*(B_2_0 + B_2_3); const Scalar tmp86 = w37*(-B_1_0 - B_1_4); const Scalar tmp87 = w39*(-B_1_1 - B_1_5); const Scalar tmp88 = w36*(B_0_0 + B_0_4); const Scalar tmp89 = w33*(B_0_3 + B_0_7); const Scalar tmp90 = w30*(B_0_2 + B_0_6); const Scalar tmp91 = w34*(-B_1_3 - B_1_7); const Scalar tmp92 = w42*(-B_2_1 - B_2_2); const Scalar tmp93 = w35*(-B_2_5 - B_2_6); const Scalar tmp94 = w37*(B_1_2 + B_1_3 + B_1_6 + B_1_7); const Scalar tmp95 = w34*(B_1_0 + B_1_1 + B_1_4 + B_1_5); const Scalar tmp96 = w38*(-B_0_1 - B_0_3); const Scalar tmp97 = w31*(-B_1_4 - B_1_5); const Scalar tmp98 = w37*(-B_1_6 - B_1_7); const Scalar tmp99 = w39*(-B_1_2 - B_1_3); const Scalar tmp100 = w36*(-B_0_0 - B_0_2); const Scalar tmp101 = w33*(-B_0_5 - B_0_7); const Scalar tmp102 = w30*(-B_0_4 - B_0_6); const Scalar tmp103 = w34*(-B_1_0 - B_1_1); const Scalar tmp104 = w38*(B_0_2 + B_0_6); const Scalar tmp105 = w42*(B_2_0 + B_2_1); const Scalar tmp106 = w35*(B_2_6 + B_2_7); const Scalar tmp107 = w37*(B_1_0 + B_1_1 + B_1_4 + B_1_5); const Scalar tmp108 = w32*(B_2_4 + B_2_5); const Scalar tmp109 = w36*(B_0_3 + B_0_7); const Scalar tmp110 = w33*(B_0_0 + B_0_4); const Scalar tmp111 = w30*(B_0_1 + B_0_5); const Scalar tmp112 = w43*(B_2_2 + B_2_3); const Scalar tmp113 = w34*(B_1_2 + B_1_3 + B_1_6 + B_1_7); const Scalar tmp114 = w38*(-B_0_0 - B_0_4); const Scalar tmp115 = w31*(-B_1_3 - B_1_7); const Scalar tmp116 = w37*(-B_1_1 - B_1_5); const Scalar tmp117 = w39*(-B_1_0 - B_1_4); const Scalar tmp118 = w36*(-B_0_1 - B_0_5); const Scalar tmp119 = w33*(-B_0_2 - B_0_6); const Scalar tmp120 = w30*(-B_0_3 - B_0_7); const Scalar tmp121 = w34*(-B_1_2 - B_1_6); const Scalar tmp122 = w31*(B_1_0 + B_1_1); const Scalar tmp123 = w42*(B_2_4 + B_2_5); const Scalar tmp124 = w35*(B_2_2 + B_2_3); const Scalar tmp125 = w37*(B_1_2 + B_1_3); const Scalar tmp126 = w32*(B_2_0 + B_2_1); const Scalar tmp127 = w39*(B_1_6 + B_1_7); const Scalar tmp128 = w36*(-B_0_3 - B_0_5); const Scalar tmp129 = w33*(-B_0_2 - B_0_4); const Scalar tmp130 = w43*(B_2_6 + B_2_7); const Scalar tmp131 = w34*(B_1_4 + B_1_5); const Scalar tmp132 = w42*(-B_2_5 - B_2_6); const Scalar tmp133 = w35*(-B_2_1 - B_2_2); const Scalar tmp134 = w37*(B_1_0 + B_1_5); const Scalar tmp135 = w36*(B_0_1 + B_0_7); const Scalar tmp136 = w33*(B_0_0 + B_0_6); const Scalar tmp137 = w34*(B_1_2 + B_1_7); const Scalar tmp138 = w38*(-B_0_0 - B_0_2); const Scalar tmp139 = w42*(-B_2_1 - B_2_3); const Scalar tmp140 = w35*(-B_2_4 - B_2_6); const Scalar tmp141 = w37*(B_1_3 + B_1_6); const Scalar tmp142 = w32*(-B_2_5 - B_2_7); const Scalar tmp143 = w36*(-B_0_1 - B_0_3); const Scalar tmp144 = w33*(-B_0_4 - B_0_6); const Scalar tmp145 = w30*(-B_0_5 - B_0_7); const Scalar tmp146 = w43*(-B_2_0 - B_2_2); const Scalar tmp147 = w34*(B_1_1 + B_1_4); const Scalar tmp148 = w36*(B_0_2 + B_0_4); const Scalar tmp149 = w33*(B_0_3 + B_0_5); const Scalar tmp150 = w42*(B_2_1 + B_2_2); const Scalar tmp151 = w35*(B_2_5 + B_2_6); const Scalar tmp152 = w37*(-B_1_2 - B_1_7); const Scalar tmp153 = w36*(-B_0_0 - B_0_6); const Scalar tmp154 = w33*(-B_0_1 - B_0_7); const Scalar tmp155 = w34*(-B_1_0 - B_1_5); const Scalar tmp156 = w38*(-B_0_3 - B_0_7); const Scalar tmp157 = w36*(-B_0_2 - B_0_6); const Scalar tmp158 = w33*(-B_0_1 - B_0_5); const Scalar tmp159 = w30*(-B_0_0 - B_0_4); const Scalar tmp160 = w42*(-B_2_4 - B_2_5); const Scalar tmp161 = w35*(-B_2_2 - B_2_3); const Scalar tmp162 = w32*(-B_2_0 - B_2_1); const Scalar tmp163 = w43*(-B_2_6 - B_2_7); const Scalar tmp164 = w42*(-B_2_4 - B_2_7); const Scalar tmp165 = w35*(-B_2_0 - B_2_3); const Scalar tmp166 = w37*(B_1_1 + B_1_4); const Scalar tmp167 = w34*(B_1_3 + B_1_6); const Scalar tmp168 = w36*(B_0_3 + B_0_5); const Scalar tmp169 = w33*(B_0_2 + B_0_4); const Scalar tmp170 = w38*(B_0_5 + B_0_7); const Scalar tmp171 = w42*(B_2_4 + B_2_6); const Scalar tmp172 = w35*(B_2_1 + B_2_3); const Scalar tmp173 = w37*(-B_1_1 - B_1_4); const Scalar tmp174 = w32*(B_2_0 + B_2_2); const Scalar tmp175 = w36*(B_0_4 + B_0_6); const Scalar tmp176 = w33*(B_0_1 + B_0_3); const Scalar tmp177 = w30*(B_0_0 + B_0_2); const Scalar tmp178 = w43*(B_2_5 + B_2_7); const Scalar tmp179 = w34*(-B_1_3 - B_1_6); const Scalar tmp180 = w31*(-B_1_0 - B_1_4); const Scalar tmp181 = w42*(B_2_0 + B_2_2); const Scalar tmp182 = w35*(B_2_5 + B_2_7); const Scalar tmp183 = w37*(-B_1_2 - B_1_6); const Scalar tmp184 = w32*(B_2_4 + B_2_6); const Scalar tmp185 = w39*(-B_1_3 - B_1_7); const Scalar tmp186 = w36*(B_0_1 + B_0_3 + B_0_5 + B_0_7); const Scalar tmp187 = w33*(B_0_0 + B_0_2 + B_0_4 + B_0_6); const Scalar tmp188 = w43*(B_2_1 + B_2_3); const Scalar tmp189 = w34*(-B_1_1 - B_1_5); const Scalar tmp190 = w38*(-B_0_1 - B_0_5); const Scalar tmp191 = w42*(B_2_2 + B_2_3); const Scalar tmp192 = w35*(B_2_4 + B_2_5); const Scalar tmp193 = w37*(-B_1_2 - B_1_3 - B_1_6 - B_1_7); const Scalar tmp194 = w32*(B_2_6 + B_2_7); const Scalar tmp195 = w36*(-B_0_0 - B_0_4); const Scalar tmp196 = w33*(-B_0_3 - B_0_7); const Scalar tmp197 = w30*(-B_0_2 - B_0_6); const Scalar tmp198 = w43*(B_2_0 + B_2_1); const Scalar tmp199 = w34*(-B_1_0 - B_1_1 - B_1_4 - B_1_5); const Scalar tmp200 = w31*(B_1_4 + B_1_5); const Scalar tmp201 = w42*(-B_2_0 - B_2_1); const Scalar tmp202 = w35*(-B_2_6 - B_2_7); const Scalar tmp203 = w37*(B_1_6 + B_1_7); const Scalar tmp204 = w32*(-B_2_4 - B_2_5); const Scalar tmp205 = w39*(B_1_2 + B_1_3); const Scalar tmp206 = w43*(-B_2_2 - B_2_3); const Scalar tmp207 = w34*(B_1_0 + B_1_1); const Scalar tmp208 = w37*(-B_1_3 - B_1_6); const Scalar tmp209 = w36*(-B_0_2 - B_0_4); const Scalar tmp210 = w33*(-B_0_3 - B_0_5); const Scalar tmp211 = w34*(-B_1_1 - B_1_4); const Scalar tmp212 = w42*(B_2_0 + B_2_3); const Scalar tmp213 = w35*(B_2_4 + B_2_7); const Scalar tmp214 = w38*(B_0_0 + B_0_4); const Scalar tmp215 = w36*(B_0_1 + B_0_5); const Scalar tmp216 = w33*(B_0_2 + B_0_6); const Scalar tmp217 = w30*(B_0_3 + B_0_7); const Scalar tmp218 = w31*(B_1_2 + B_1_6); const Scalar tmp219 = w37*(B_1_0 + B_1_4); const Scalar tmp220 = w39*(B_1_1 + B_1_5); const Scalar tmp221 = w34*(B_1_3 + B_1_7); const Scalar tmp222 = w36*(-B_0_1 - B_0_7); const Scalar tmp223 = w33*(-B_0_0 - B_0_6); const Scalar tmp224 = w42*(-B_2_6 - B_2_7); const Scalar tmp225 = w35*(-B_2_0 - B_2_1); const Scalar tmp226 = w32*(-B_2_2 - B_2_3); const Scalar tmp227 = w43*(-B_2_4 - B_2_5); const Scalar tmp228 = w31*(B_1_3 + B_1_7); const Scalar tmp229 = w42*(B_2_1 + B_2_3); const Scalar tmp230 = w35*(B_2_4 + B_2_6); const Scalar tmp231 = w37*(B_1_1 + B_1_5); const Scalar tmp232 = w32*(B_2_5 + B_2_7); const Scalar tmp233 = w39*(B_1_0 + B_1_4); const Scalar tmp234 = w36*(-B_0_0 - B_0_2 - B_0_4 - B_0_6); const Scalar tmp235 = w33*(-B_0_1 - B_0_3 - B_0_5 - B_0_7); const Scalar tmp236 = w43*(B_2_0 + B_2_2); const Scalar tmp237 = w34*(B_1_2 + B_1_6); const Scalar tmp238 = w31*(-B_1_1 - B_1_5); const Scalar tmp239 = w37*(-B_1_3 - B_1_7); const Scalar tmp240 = w39*(-B_1_2 - B_1_6); const Scalar tmp241 = w34*(-B_1_0 - B_1_4); const Scalar tmp242 = w31*(-B_1_6 - B_1_7); const Scalar tmp243 = w42*(-B_2_2 - B_2_3); const Scalar tmp244 = w35*(-B_2_4 - B_2_5); const Scalar tmp245 = w37*(-B_1_4 - B_1_5); const Scalar tmp246 = w32*(-B_2_6 - B_2_7); const Scalar tmp247 = w39*(-B_1_0 - B_1_1); const Scalar tmp248 = w43*(-B_2_0 - B_2_1); const Scalar tmp249 = w34*(-B_1_2 - B_1_3); const Scalar tmp250 = w31*(B_1_2 + B_1_3); const Scalar tmp251 = w37*(B_1_0 + B_1_1); const Scalar tmp252 = w39*(B_1_4 + B_1_5); const Scalar tmp253 = w34*(B_1_6 + B_1_7); const Scalar tmp254 = w42*(-B_2_4 - B_2_6); const Scalar tmp255 = w35*(-B_2_1 - B_2_3); const Scalar tmp256 = w32*(-B_2_0 - B_2_2); const Scalar tmp257 = w43*(-B_2_5 - B_2_7); const Scalar tmp258 = w42*(B_2_4 + B_2_5 + B_2_6 + B_2_7); const Scalar tmp259 = w35*(B_2_0 + B_2_1 + B_2_2 + B_2_3); const Scalar tmp260 = w42*(-B_2_5 - B_2_7); const Scalar tmp261 = w35*(-B_2_0 - B_2_2); const Scalar tmp262 = w32*(-B_2_1 - B_2_3); const Scalar tmp263 = w43*(-B_2_4 - B_2_6); EM_S[INDEX2(0,0,8)]+=-B_0_0*w47 - B_0_1*w38 - B_0_6*w30 - B_0_7*w46 + B_1_0*w44 - B_1_2*w39 - B_1_5*w31 + B_1_7*w45 - B_2_0*w40 - B_2_3*w32 - B_2_4*w43 - B_2_7*w41 + tmp132 + tmp133 + tmp208 + tmp209 + tmp210 + tmp211; EM_S[INDEX2(1,0,8)]+=B_0_0*w47 + B_0_1*w38 + B_0_6*w30 + B_0_7*w46 + tmp148 + tmp149 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX2(2,0,8)]+=-B_1_0*w44 + B_1_2*w39 + B_1_5*w31 - B_1_7*w45 + tmp138 + tmp139 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147; EM_S[INDEX2(3,0,8)]+=tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49; EM_S[INDEX2(4,0,8)]+=B_2_0*w40 + B_2_3*w32 + B_2_4*w43 + B_2_7*w41 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp2 + tmp3; EM_S[INDEX2(5,0,8)]+=tmp191 + tmp192 + tmp193 + tmp194 + tmp198 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217; EM_S[INDEX2(6,0,8)]+=tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233 + tmp234 + tmp235 + tmp236 + tmp237; EM_S[INDEX2(7,0,8)]+=tmp258 + tmp259 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX2(0,1,8)]+=-B_0_0*w38 - B_0_1*w47 - B_0_6*w46 - B_0_7*w30 + tmp128 + tmp129 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX2(1,1,8)]+=B_0_0*w38 + B_0_1*w47 + B_0_6*w46 + B_0_7*w30 + B_1_1*w44 - B_1_3*w39 - B_1_4*w31 + B_1_6*w45 - B_2_1*w40 - B_2_2*w32 - B_2_5*w43 - B_2_6*w41 + tmp152 + tmp155 + tmp164 + tmp165 + tmp168 + tmp169; EM_S[INDEX2(2,1,8)]+=tmp100 + tmp101 + tmp102 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp49 + tmp96; EM_S[INDEX2(3,1,8)]+=-B_1_1*w44 + B_1_3*w39 + B_1_4*w31 - B_1_6*w45 + tmp20 + tmp21 + tmp22 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp33 + tmp39; EM_S[INDEX2(4,1,8)]+=tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp196 + tmp197 + tmp198 + tmp199; EM_S[INDEX2(5,1,8)]+=B_2_1*w40 + B_2_2*w32 + B_2_5*w43 + B_2_6*w41 + tmp82 + tmp83 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX2(6,1,8)]+=tmp258 + tmp259 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX2(7,1,8)]+=tmp181 + tmp182 + tmp184 + tmp186 + tmp187 + tmp188 + tmp218 + tmp219 + tmp220 + tmp221; EM_S[INDEX2(0,2,8)]+=-B_1_0*w39 + B_1_2*w44 + B_1_5*w45 - B_1_7*w31 + tmp138 + tmp139 + tmp140 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp173 + tmp179; EM_S[INDEX2(1,2,8)]+=tmp103 + tmp40 + tmp42 + tmp43 + tmp46 + tmp47 + tmp48 + tmp97 + tmp98 + tmp99; EM_S[INDEX2(2,2,8)]+=-B_0_2*w47 - B_0_3*w38 - B_0_4*w30 - B_0_5*w46 + B_1_0*w39 - B_1_2*w44 - B_1_5*w45 + B_1_7*w31 - B_2_1*w32 - B_2_2*w40 - B_2_5*w41 - B_2_6*w43 + tmp153 + tmp154 + tmp164 + tmp165 + tmp166 + tmp167; EM_S[INDEX2(3,2,8)]+=B_0_2*w47 + B_0_3*w38 + B_0_4*w30 + B_0_5*w46 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp56 + tmp57; EM_S[INDEX2(4,2,8)]+=tmp229 + tmp230 + tmp232 + tmp234 + tmp235 + tmp236 + tmp238 + tmp239 + tmp240 + tmp241; EM_S[INDEX2(5,2,8)]+=tmp258 + tmp259 + tmp62 + tmp65 + tmp80 + tmp81; EM_S[INDEX2(6,2,8)]+=B_2_1*w32 + B_2_2*w40 + B_2_5*w41 + B_2_6*w43 + tmp70 + tmp71 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79 + tmp84 + tmp85; EM_S[INDEX2(7,2,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113; EM_S[INDEX2(0,3,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp42 + tmp43 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX2(1,3,8)]+=-B_1_1*w39 + B_1_3*w44 + B_1_4*w45 - B_1_6*w31 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29; EM_S[INDEX2(2,3,8)]+=-B_0_2*w38 - B_0_3*w47 - B_0_4*w46 - B_0_5*w30 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp222 + tmp223; EM_S[INDEX2(3,3,8)]+=B_0_2*w38 + B_0_3*w47 + B_0_4*w46 + B_0_5*w30 + B_1_1*w39 - B_1_3*w44 - B_1_4*w45 + B_1_6*w31 - B_2_0*w32 - B_2_3*w40 - B_2_4*w41 - B_2_7*w43 + tmp132 + tmp133 + tmp134 + tmp135 + tmp136 + tmp137; EM_S[INDEX2(4,3,8)]+=tmp258 + tmp259 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX2(5,3,8)]+=tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp188 + tmp189; EM_S[INDEX2(6,3,8)]+=tmp105 + tmp106 + tmp107 + tmp108 + tmp112 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159; EM_S[INDEX2(7,3,8)]+=B_2_0*w32 + B_2_3*w40 + B_2_4*w41 + B_2_7*w43 + tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX2(0,4,8)]+=-B_2_0*w43 - B_2_3*w41 - B_2_4*w40 - B_2_7*w32 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp92 + tmp93; EM_S[INDEX2(1,4,8)]+=tmp193 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX2(2,4,8)]+=tmp228 + tmp231 + tmp233 + tmp234 + tmp235 + tmp237 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX2(3,4,8)]+=tmp60 + tmp61 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX2(4,4,8)]+=-B_0_2*w30 - B_0_3*w46 - B_0_4*w47 - B_0_5*w38 - B_1_1*w31 + B_1_3*w45 + B_1_4*w44 - B_1_6*w39 + B_2_0*w43 + B_2_3*w41 + B_2_4*w40 + B_2_7*w32 + tmp150 + tmp151 + tmp152 + tmp153 + tmp154 + tmp155; EM_S[INDEX2(5,4,8)]+=B_0_2*w30 + B_0_3*w46 + B_0_4*w47 + B_0_5*w38 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59; EM_S[INDEX2(6,4,8)]+=B_1_1*w31 - B_1_3*w45 - B_1_4*w44 + B_1_6*w39 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39; EM_S[INDEX2(7,4,8)]+=tmp12 + tmp13 + tmp250 + tmp251 + tmp252 + tmp253 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX2(0,5,8)]+=tmp190 + tmp193 + tmp195 + tmp196 + tmp197 + tmp199 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX2(1,5,8)]+=-B_2_1*w43 - B_2_2*w41 - B_2_5*w40 - B_2_6*w32 + tmp72 + tmp73 + tmp82 + tmp83 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX2(2,5,8)]+=tmp60 + tmp61 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX2(3,5,8)]+=tmp186 + tmp187 + tmp218 + tmp219 + tmp220 + tmp221 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX2(4,5,8)]+=-B_0_2*w46 - B_0_3*w30 - B_0_4*w38 - B_0_5*w47 + tmp222 + tmp223 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp58 + tmp59; EM_S[INDEX2(5,5,8)]+=B_0_2*w46 + B_0_3*w30 + B_0_4*w38 + B_0_5*w47 - B_1_0*w31 + B_1_2*w45 + B_1_5*w44 - B_1_7*w39 + B_2_1*w43 + B_2_2*w41 + B_2_5*w40 + B_2_6*w32 + tmp135 + tmp136 + tmp208 + tmp211 + tmp212 + tmp213; EM_S[INDEX2(6,5,8)]+=tmp10 + tmp12 + tmp13 + tmp16 + tmp17 + tmp18 + tmp250 + tmp251 + tmp252 + tmp253; EM_S[INDEX2(7,5,8)]+=B_1_0*w31 - B_1_2*w45 - B_1_5*w44 + B_1_7*w39 + tmp141 + tmp147 + tmp170 + tmp171 + tmp172 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178; EM_S[INDEX2(0,6,8)]+=tmp234 + tmp235 + tmp238 + tmp239 + tmp240 + tmp241 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX2(1,6,8)]+=tmp60 + tmp61 + tmp62 + tmp65 + tmp80 + tmp81; EM_S[INDEX2(2,6,8)]+=-B_2_1*w41 - B_2_2*w43 - B_2_5*w32 - B_2_6*w40 + tmp70 + tmp71 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79; EM_S[INDEX2(3,6,8)]+=tmp104 + tmp107 + tmp109 + tmp110 + tmp111 + tmp113 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX2(4,6,8)]+=B_1_1*w45 - B_1_3*w31 - B_1_4*w39 + B_1_6*w44 + tmp23 + tmp29 + tmp30 + tmp31 + tmp32 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38; EM_S[INDEX2(5,6,8)]+=tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp19 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX2(6,6,8)]+=-B_0_0*w30 - B_0_1*w46 - B_0_6*w47 - B_0_7*w38 - B_1_1*w45 + B_1_3*w31 + B_1_4*w39 - B_1_6*w44 + B_2_1*w41 + B_2_2*w43 + B_2_5*w32 + B_2_6*w40 + tmp134 + tmp137 + tmp209 + tmp210 + tmp212 + tmp213; EM_S[INDEX2(7,6,8)]+=B_0_0*w30 + B_0_1*w46 + B_0_6*w47 + B_0_7*w38 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp130 + tmp131 + tmp148 + tmp149; EM_S[INDEX2(0,7,8)]+=tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX2(1,7,8)]+=tmp180 + tmp183 + tmp185 + tmp186 + tmp187 + tmp189 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX2(2,7,8)]+=tmp107 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX2(3,7,8)]+=-B_2_0*w41 - B_2_3*w43 - B_2_4*w32 - B_2_7*w40 + tmp0 + tmp1 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9 + tmp92 + tmp93; EM_S[INDEX2(4,7,8)]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19; EM_S[INDEX2(5,7,8)]+=B_1_0*w45 - B_1_2*w31 - B_1_5*w39 + B_1_7*w44 + tmp170 + tmp171 + tmp172 + tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179; EM_S[INDEX2(6,7,8)]+=-B_0_0*w46 - B_0_1*w30 - B_0_6*w38 - B_0_7*w47 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131; EM_S[INDEX2(7,7,8)]+=B_0_0*w46 + B_0_1*w30 + B_0_6*w38 + B_0_7*w47 - B_1_0*w45 + B_1_2*w31 + B_1_5*w39 - B_1_7*w44 + B_2_0*w41 + B_2_3*w43 + B_2_4*w32 + B_2_7*w40 + tmp150 + tmp151 + tmp166 + tmp167 + tmp168 + tmp169; } else { // constant data const Scalar wB0 = B_p[0]*w53; const Scalar wB1 = B_p[1]*w51; const Scalar wB2 = B_p[2]*w50; EM_S[INDEX2(0,0,8)]+= 4.*wB0 + 4.*wB1 - 4.*wB2; EM_S[INDEX2(1,0,8)]+=-4.*wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX2(2,0,8)]+= 2.*wB0 - 4.*wB1 - 2.*wB2; EM_S[INDEX2(3,0,8)]+=-2.*wB0 - 2.*wB1 - wB2; EM_S[INDEX2(4,0,8)]+= 2.*wB0 + 2.*wB1 + 4.*wB2; EM_S[INDEX2(5,0,8)]+=-2.*wB0 + wB1 + 2.*wB2; EM_S[INDEX2(6,0,8)]+= wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX2(7,0,8)]+= -wB0 - wB1 + wB2; EM_S[INDEX2(0,1,8)]+= 4.*wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX2(1,1,8)]+=-4.*wB0 + 4.*wB1 - 4.*wB2; EM_S[INDEX2(2,1,8)]+= 2.*wB0 - 2.*wB1 - wB2; EM_S[INDEX2(3,1,8)]+=-2.*wB0 - 4.*wB1 - 2.*wB2; EM_S[INDEX2(4,1,8)]+= 2.*wB0 + wB1 + 2.*wB2; EM_S[INDEX2(5,1,8)]+=-2.*wB0 + 2.*wB1 + 4.*wB2; EM_S[INDEX2(6,1,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(7,1,8)]+= -wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX2(0,2,8)]+= 2.*wB0 + 4.*wB1 - 2.*wB2; EM_S[INDEX2(1,2,8)]+=-2.*wB0 + 2.*wB1 - wB2; EM_S[INDEX2(2,2,8)]+= 4.*wB0 - 4.*wB1 - 4.*wB2; EM_S[INDEX2(3,2,8)]+=-4.*wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX2(4,2,8)]+= wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX2(5,2,8)]+= -wB0 + wB1 + wB2; EM_S[INDEX2(6,2,8)]+= 2.*wB0 - 2.*wB1 + 4.*wB2; EM_S[INDEX2(7,2,8)]+=-2.*wB0 - wB1 + 2.*wB2; EM_S[INDEX2(0,3,8)]+= 2.*wB0 + 2.*wB1 - wB2; EM_S[INDEX2(1,3,8)]+=-2.*wB0 + 4.*wB1 - 2.*wB2; EM_S[INDEX2(2,3,8)]+= 4.*wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX2(3,3,8)]+=-4.*wB0 - 4.*wB1 - 4.*wB2; EM_S[INDEX2(4,3,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(5,3,8)]+= -wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX2(6,3,8)]+= 2.*wB0 - wB1 + 2.*wB2; EM_S[INDEX2(7,3,8)]+=-2.*wB0 - 2.*wB1 + 4.*wB2; EM_S[INDEX2(0,4,8)]+= 2.*wB0 + 2.*wB1 - 4.*wB2; EM_S[INDEX2(1,4,8)]+=-2.*wB0 + wB1 - 2.*wB2; EM_S[INDEX2(2,4,8)]+= wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX2(3,4,8)]+= -wB0 - wB1 - wB2; EM_S[INDEX2(4,4,8)]+= 4.*wB0 + 4.*wB1 + 4.*wB2; EM_S[INDEX2(5,4,8)]+=-4.*wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX2(6,4,8)]+= 2.*wB0 - 4.*wB1 + 2.*wB2; EM_S[INDEX2(7,4,8)]+=-2.*wB0 - 2.*wB1 + wB2; EM_S[INDEX2(0,5,8)]+= 2.*wB0 + wB1 - 2.*wB2; EM_S[INDEX2(1,5,8)]+=-2.*wB0 + 2.*wB1 - 4.*wB2; EM_S[INDEX2(2,5,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(3,5,8)]+= -wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX2(4,5,8)]+= 4.*wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX2(5,5,8)]+=-4.*wB0 + 4.*wB1 + 4.*wB2; EM_S[INDEX2(6,5,8)]+= 2.*wB0 - 2.*wB1 + wB2; EM_S[INDEX2(7,5,8)]+=-2.*wB0 - 4.*wB1 + 2.*wB2; EM_S[INDEX2(0,6,8)]+= wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX2(1,6,8)]+= -wB0 + wB1 - wB2; EM_S[INDEX2(2,6,8)]+= 2.*wB0 - 2.*wB1 - 4.*wB2; EM_S[INDEX2(3,6,8)]+=-2.*wB0 - wB1 - 2.*wB2; EM_S[INDEX2(4,6,8)]+= 2.*wB0 + 4.*wB1 + 2.*wB2; EM_S[INDEX2(5,6,8)]+=-2.*wB0 + 2.*wB1 + wB2; EM_S[INDEX2(6,6,8)]+= 4.*wB0 - 4.*wB1 + 4.*wB2; EM_S[INDEX2(7,6,8)]+=-4.*wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX2(0,7,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(1,7,8)]+= -wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX2(2,7,8)]+= 2.*wB0 - wB1 - 2.*wB2; EM_S[INDEX2(3,7,8)]+=-2.*wB0 - 2.*wB1 - 4.*wB2; EM_S[INDEX2(4,7,8)]+= 2.*wB0 + 2.*wB1 + wB2; EM_S[INDEX2(5,7,8)]+=-2.*wB0 + 4.*wB1 + 2.*wB2; EM_S[INDEX2(6,7,8)]+= 4.*wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX2(7,7,8)]+=-4.*wB0 - 4.*wB1 + 4.*wB2; } } /////////////// // process C // /////////////// if (!C.isEmpty()) { const Scalar* C_p = C.getSampleDataRO(e, zero); if (C.actsExpanded()) { const Scalar C_0_0 = C_p[INDEX2(0,0,3)]; const Scalar C_1_0 = C_p[INDEX2(1,0,3)]; const Scalar C_2_0 = C_p[INDEX2(2,0,3)]; const Scalar C_0_1 = C_p[INDEX2(0,1,3)]; const Scalar C_1_1 = C_p[INDEX2(1,1,3)]; const Scalar C_2_1 = C_p[INDEX2(2,1,3)]; const Scalar C_0_2 = C_p[INDEX2(0,2,3)]; const Scalar C_1_2 = C_p[INDEX2(1,2,3)]; const Scalar C_2_2 = C_p[INDEX2(2,2,3)]; const Scalar C_0_3 = C_p[INDEX2(0,3,3)]; const Scalar C_1_3 = C_p[INDEX2(1,3,3)]; const Scalar C_2_3 = C_p[INDEX2(2,3,3)]; const Scalar C_0_4 = C_p[INDEX2(0,4,3)]; const Scalar C_1_4 = C_p[INDEX2(1,4,3)]; const Scalar C_2_4 = C_p[INDEX2(2,4,3)]; const Scalar C_0_5 = C_p[INDEX2(0,5,3)]; const Scalar C_1_5 = C_p[INDEX2(1,5,3)]; const Scalar C_2_5 = C_p[INDEX2(2,5,3)]; const Scalar C_0_6 = C_p[INDEX2(0,6,3)]; const Scalar C_1_6 = C_p[INDEX2(1,6,3)]; const Scalar C_2_6 = C_p[INDEX2(2,6,3)]; const Scalar C_0_7 = C_p[INDEX2(0,7,3)]; const Scalar C_1_7 = C_p[INDEX2(1,7,3)]; const Scalar C_2_7 = C_p[INDEX2(2,7,3)]; const Scalar tmp0 = w38*(C_0_3 + C_0_7); const Scalar tmp1 = w31*(C_1_0 + C_1_4); const Scalar tmp2 = w42*(-C_2_1 - C_2_2); const Scalar tmp3 = w35*(-C_2_5 - C_2_6); const Scalar tmp4 = w37*(C_1_2 + C_1_6); const Scalar tmp5 = w39*(C_1_3 + C_1_7); const Scalar tmp6 = w36*(C_0_2 + C_0_6); const Scalar tmp7 = w33*(C_0_1 + C_0_5); const Scalar tmp8 = w30*(C_0_0 + C_0_4); const Scalar tmp9 = w34*(C_1_1 + C_1_5); const Scalar tmp10 = w38*(C_0_4 + C_0_6); const Scalar tmp11 = w31*(C_1_2 + C_1_3); const Scalar tmp12 = w42*(C_2_0 + C_2_1 + C_2_2 + C_2_3); const Scalar tmp13 = w35*(C_2_4 + C_2_5 + C_2_6 + C_2_7); const Scalar tmp14 = w37*(C_1_0 + C_1_1); const Scalar tmp15 = w39*(C_1_4 + C_1_5); const Scalar tmp16 = w36*(C_0_5 + C_0_7); const Scalar tmp17 = w33*(C_0_0 + C_0_2); const Scalar tmp18 = w30*(C_0_1 + C_0_3); const Scalar tmp19 = w34*(C_1_6 + C_1_7); const Scalar tmp20 = w38*(C_0_1 + C_0_3); const Scalar tmp21 = w42*(-C_2_0 - C_2_2); const Scalar tmp22 = w35*(-C_2_5 - C_2_7); const Scalar tmp23 = w37*(C_1_2 + C_1_7); const Scalar tmp24 = w32*(-C_2_4 - C_2_6); const Scalar tmp25 = w36*(C_0_0 + C_0_2); const Scalar tmp26 = w33*(C_0_5 + C_0_7); const Scalar tmp27 = w30*(C_0_4 + C_0_6); const Scalar tmp28 = w43*(-C_2_1 - C_2_3); const Scalar tmp29 = w34*(C_1_0 + C_1_5); const Scalar tmp30 = w38*(-C_0_4 - C_0_6); const Scalar tmp31 = w42*(C_2_5 + C_2_7); const Scalar tmp32 = w35*(C_2_0 + C_2_2); const Scalar tmp33 = w37*(-C_1_0 - C_1_5); const Scalar tmp34 = w32*(C_2_1 + C_2_3); const Scalar tmp35 = w36*(-C_0_5 - C_0_7); const Scalar tmp36 = w33*(-C_0_0 - C_0_2); const Scalar tmp37 = w30*(-C_0_1 - C_0_3); const Scalar tmp38 = w43*(C_2_4 + C_2_6); const Scalar tmp39 = w34*(-C_1_2 - C_1_7); const Scalar tmp40 = w38*(-C_0_1 - C_0_3); const Scalar tmp41 = w31*(-C_1_4 - C_1_5); const Scalar tmp42 = w42*(-C_2_4 - C_2_5 - C_2_6 - C_2_7); const Scalar tmp43 = w35*(-C_2_0 - C_2_1 - C_2_2 - C_2_3); const Scalar tmp44 = w37*(-C_1_6 - C_1_7); const Scalar tmp45 = w39*(-C_1_2 - C_1_3); const Scalar tmp46 = w36*(-C_0_0 - C_0_2); const Scalar tmp47 = w33*(-C_0_5 - C_0_7); const Scalar tmp48 = w30*(-C_0_4 - C_0_6); const Scalar tmp49 = w34*(-C_1_0 - C_1_1); const Scalar tmp50 = w31*(-C_1_2 - C_1_3); const Scalar tmp51 = w42*(C_2_6 + C_2_7); const Scalar tmp52 = w35*(C_2_0 + C_2_1); const Scalar tmp53 = w37*(-C_1_0 - C_1_1); const Scalar tmp54 = w32*(C_2_2 + C_2_3); const Scalar tmp55 = w39*(-C_1_4 - C_1_5); const Scalar tmp56 = w36*(-C_0_1 - C_0_7); const Scalar tmp57 = w33*(-C_0_0 - C_0_6); const Scalar tmp58 = w43*(C_2_4 + C_2_5); const Scalar tmp59 = w34*(-C_1_6 - C_1_7); const Scalar tmp60 = w42*(C_2_4 + C_2_5 + C_2_6 + C_2_7); const Scalar tmp61 = w35*(C_2_0 + C_2_1 + C_2_2 + C_2_3); const Scalar tmp62 = w37*(C_1_2 + C_1_3 + C_1_6 + C_1_7); const Scalar tmp63 = w36*(C_0_0 + C_0_2 + C_0_4 + C_0_6); const Scalar tmp64 = w33*(C_0_1 + C_0_3 + C_0_5 + C_0_7); const Scalar tmp65 = w34*(C_1_0 + C_1_1 + C_1_4 + C_1_5); const Scalar tmp66 = w38*(-C_0_5 - C_0_7); const Scalar tmp67 = w36*(-C_0_4 - C_0_6); const Scalar tmp68 = w33*(-C_0_1 - C_0_3); const Scalar tmp69 = w30*(-C_0_0 - C_0_2); const Scalar tmp70 = w38*(-C_0_2 - C_0_6); const Scalar tmp71 = w31*(C_1_1 + C_1_5); const Scalar tmp72 = w42*(C_2_4 + C_2_7); const Scalar tmp73 = w35*(C_2_0 + C_2_3); const Scalar tmp74 = w37*(C_1_3 + C_1_7); const Scalar tmp75 = w39*(C_1_2 + C_1_6); const Scalar tmp76 = w36*(-C_0_3 - C_0_7); const Scalar tmp77 = w33*(-C_0_0 - C_0_4); const Scalar tmp78 = w30*(-C_0_1 - C_0_5); const Scalar tmp79 = w34*(C_1_0 + C_1_4); const Scalar tmp80 = w36*(-C_0_1 - C_0_3 - C_0_5 - C_0_7); const Scalar tmp81 = w33*(-C_0_0 - C_0_2 - C_0_4 - C_0_6); const Scalar tmp82 = w38*(C_0_1 + C_0_5); const Scalar tmp83 = w31*(-C_1_2 - C_1_6); const Scalar tmp84 = w42*(-C_2_0 - C_2_3); const Scalar tmp85 = w35*(-C_2_4 - C_2_7); const Scalar tmp86 = w37*(-C_1_0 - C_1_4); const Scalar tmp87 = w39*(-C_1_1 - C_1_5); const Scalar tmp88 = w36*(C_0_0 + C_0_4); const Scalar tmp89 = w33*(C_0_3 + C_0_7); const Scalar tmp90 = w30*(C_0_2 + C_0_6); const Scalar tmp91 = w34*(-C_1_3 - C_1_7); const Scalar tmp92 = w42*(C_2_5 + C_2_6); const Scalar tmp93 = w35*(C_2_1 + C_2_2); const Scalar tmp94 = w37*(-C_1_0 - C_1_1 - C_1_4 - C_1_5); const Scalar tmp95 = w34*(-C_1_2 - C_1_3 - C_1_6 - C_1_7); const Scalar tmp96 = w38*(C_0_0 + C_0_2); const Scalar tmp97 = w31*(C_1_6 + C_1_7); const Scalar tmp98 = w37*(C_1_4 + C_1_5); const Scalar tmp99 = w39*(C_1_0 + C_1_1); const Scalar tmp100 = w36*(C_0_1 + C_0_3); const Scalar tmp101 = w33*(C_0_4 + C_0_6); const Scalar tmp102 = w30*(C_0_5 + C_0_7); const Scalar tmp103 = w34*(C_1_2 + C_1_3); const Scalar tmp104 = w38*(-C_0_3 - C_0_7); const Scalar tmp105 = w42*(-C_2_4 - C_2_5); const Scalar tmp106 = w35*(-C_2_2 - C_2_3); const Scalar tmp107 = w37*(C_1_0 + C_1_1 + C_1_4 + C_1_5); const Scalar tmp108 = w32*(-C_2_0 - C_2_1); const Scalar tmp109 = w36*(-C_0_2 - C_0_6); const Scalar tmp110 = w33*(-C_0_1 - C_0_5); const Scalar tmp111 = w30*(-C_0_0 - C_0_4); const Scalar tmp112 = w43*(-C_2_6 - C_2_7); const Scalar tmp113 = w34*(C_1_2 + C_1_3 + C_1_6 + C_1_7); const Scalar tmp114 = w38*(-C_0_0 - C_0_4); const Scalar tmp115 = w31*(-C_1_3 - C_1_7); const Scalar tmp116 = w37*(-C_1_1 - C_1_5); const Scalar tmp117 = w39*(-C_1_0 - C_1_4); const Scalar tmp118 = w36*(-C_0_1 - C_0_5); const Scalar tmp119 = w33*(-C_0_2 - C_0_6); const Scalar tmp120 = w30*(-C_0_3 - C_0_7); const Scalar tmp121 = w34*(-C_1_2 - C_1_6); const Scalar tmp122 = w31*(C_1_0 + C_1_1); const Scalar tmp123 = w42*(C_2_4 + C_2_5); const Scalar tmp124 = w35*(C_2_2 + C_2_3); const Scalar tmp125 = w37*(C_1_2 + C_1_3); const Scalar tmp126 = w32*(C_2_0 + C_2_1); const Scalar tmp127 = w39*(C_1_6 + C_1_7); const Scalar tmp128 = w36*(C_0_2 + C_0_4); const Scalar tmp129 = w33*(C_0_3 + C_0_5); const Scalar tmp130 = w43*(C_2_6 + C_2_7); const Scalar tmp131 = w34*(C_1_4 + C_1_5); const Scalar tmp132 = w42*(-C_2_5 - C_2_6); const Scalar tmp133 = w35*(-C_2_1 - C_2_2); const Scalar tmp134 = w37*(C_1_0 + C_1_5); const Scalar tmp135 = w36*(C_0_1 + C_0_7); const Scalar tmp136 = w33*(C_0_0 + C_0_6); const Scalar tmp137 = w34*(C_1_2 + C_1_7); const Scalar tmp138 = w38*(-C_0_0 - C_0_2); const Scalar tmp139 = w42*(-C_2_1 - C_2_3); const Scalar tmp140 = w35*(-C_2_4 - C_2_6); const Scalar tmp141 = w37*(-C_1_1 - C_1_4); const Scalar tmp142 = w32*(-C_2_5 - C_2_7); const Scalar tmp143 = w36*(-C_0_1 - C_0_3); const Scalar tmp144 = w33*(-C_0_4 - C_0_6); const Scalar tmp145 = w30*(-C_0_5 - C_0_7); const Scalar tmp146 = w43*(-C_2_0 - C_2_2); const Scalar tmp147 = w34*(-C_1_3 - C_1_6); const Scalar tmp148 = w36*(-C_0_3 - C_0_5); const Scalar tmp149 = w33*(-C_0_2 - C_0_4); const Scalar tmp150 = w42*(C_2_1 + C_2_2); const Scalar tmp151 = w35*(C_2_5 + C_2_6); const Scalar tmp152 = w37*(-C_1_2 - C_1_7); const Scalar tmp153 = w36*(-C_0_0 - C_0_6); const Scalar tmp154 = w33*(-C_0_1 - C_0_7); const Scalar tmp155 = w34*(-C_1_0 - C_1_5); const Scalar tmp156 = w38*(C_0_2 + C_0_6); const Scalar tmp157 = w36*(C_0_3 + C_0_7); const Scalar tmp158 = w33*(C_0_0 + C_0_4); const Scalar tmp159 = w30*(C_0_1 + C_0_5); const Scalar tmp160 = w42*(C_2_0 + C_2_1); const Scalar tmp161 = w35*(C_2_6 + C_2_7); const Scalar tmp162 = w32*(C_2_4 + C_2_5); const Scalar tmp163 = w43*(C_2_2 + C_2_3); const Scalar tmp164 = w42*(-C_2_4 - C_2_7); const Scalar tmp165 = w35*(-C_2_0 - C_2_3); const Scalar tmp166 = w37*(C_1_1 + C_1_4); const Scalar tmp167 = w34*(C_1_3 + C_1_6); const Scalar tmp168 = w36*(C_0_3 + C_0_5); const Scalar tmp169 = w33*(C_0_2 + C_0_4); const Scalar tmp170 = w38*(C_0_5 + C_0_7); const Scalar tmp171 = w42*(C_2_4 + C_2_6); const Scalar tmp172 = w35*(C_2_1 + C_2_3); const Scalar tmp173 = w37*(C_1_3 + C_1_6); const Scalar tmp174 = w32*(C_2_0 + C_2_2); const Scalar tmp175 = w36*(C_0_4 + C_0_6); const Scalar tmp176 = w33*(C_0_1 + C_0_3); const Scalar tmp177 = w30*(C_0_0 + C_0_2); const Scalar tmp178 = w43*(C_2_5 + C_2_7); const Scalar tmp179 = w34*(C_1_1 + C_1_4); const Scalar tmp180 = w31*(C_1_2 + C_1_6); const Scalar tmp181 = w42*(-C_2_4 - C_2_6); const Scalar tmp182 = w35*(-C_2_1 - C_2_3); const Scalar tmp183 = w37*(C_1_0 + C_1_4); const Scalar tmp184 = w32*(-C_2_0 - C_2_2); const Scalar tmp185 = w39*(C_1_1 + C_1_5); const Scalar tmp186 = w36*(C_0_1 + C_0_3 + C_0_5 + C_0_7); const Scalar tmp187 = w33*(C_0_0 + C_0_2 + C_0_4 + C_0_6); const Scalar tmp188 = w43*(-C_2_5 - C_2_7); const Scalar tmp189 = w34*(C_1_3 + C_1_7); const Scalar tmp190 = w38*(C_0_0 + C_0_4); const Scalar tmp191 = w42*(-C_2_6 - C_2_7); const Scalar tmp192 = w35*(-C_2_0 - C_2_1); const Scalar tmp193 = w37*(-C_1_2 - C_1_3 - C_1_6 - C_1_7); const Scalar tmp194 = w32*(-C_2_2 - C_2_3); const Scalar tmp195 = w36*(C_0_1 + C_0_5); const Scalar tmp196 = w33*(C_0_2 + C_0_6); const Scalar tmp197 = w30*(C_0_3 + C_0_7); const Scalar tmp198 = w43*(-C_2_4 - C_2_5); const Scalar tmp199 = w34*(-C_1_0 - C_1_1 - C_1_4 - C_1_5); const Scalar tmp200 = w31*(C_1_4 + C_1_5); const Scalar tmp201 = w42*(-C_2_0 - C_2_1); const Scalar tmp202 = w35*(-C_2_6 - C_2_7); const Scalar tmp203 = w37*(C_1_6 + C_1_7); const Scalar tmp204 = w32*(-C_2_4 - C_2_5); const Scalar tmp205 = w39*(C_1_2 + C_1_3); const Scalar tmp206 = w43*(-C_2_2 - C_2_3); const Scalar tmp207 = w34*(C_1_0 + C_1_1); const Scalar tmp208 = w37*(-C_1_3 - C_1_6); const Scalar tmp209 = w36*(-C_0_2 - C_0_4); const Scalar tmp210 = w33*(-C_0_3 - C_0_5); const Scalar tmp211 = w34*(-C_1_1 - C_1_4); const Scalar tmp212 = w42*(C_2_0 + C_2_3); const Scalar tmp213 = w35*(C_2_4 + C_2_7); const Scalar tmp214 = w38*(-C_0_1 - C_0_5); const Scalar tmp215 = w36*(-C_0_0 - C_0_4); const Scalar tmp216 = w33*(-C_0_3 - C_0_7); const Scalar tmp217 = w30*(-C_0_2 - C_0_6); const Scalar tmp218 = w31*(-C_1_0 - C_1_4); const Scalar tmp219 = w37*(-C_1_2 - C_1_6); const Scalar tmp220 = w39*(-C_1_3 - C_1_7); const Scalar tmp221 = w34*(-C_1_1 - C_1_5); const Scalar tmp222 = w36*(C_0_0 + C_0_6); const Scalar tmp223 = w33*(C_0_1 + C_0_7); const Scalar tmp224 = w42*(C_2_2 + C_2_3); const Scalar tmp225 = w35*(C_2_4 + C_2_5); const Scalar tmp226 = w32*(C_2_6 + C_2_7); const Scalar tmp227 = w43*(C_2_0 + C_2_1); const Scalar tmp228 = w31*(-C_1_1 - C_1_5); const Scalar tmp229 = w42*(-C_2_5 - C_2_7); const Scalar tmp230 = w35*(-C_2_0 - C_2_2); const Scalar tmp231 = w37*(-C_1_3 - C_1_7); const Scalar tmp232 = w32*(-C_2_1 - C_2_3); const Scalar tmp233 = w39*(-C_1_2 - C_1_6); const Scalar tmp234 = w36*(-C_0_0 - C_0_2 - C_0_4 - C_0_6); const Scalar tmp235 = w33*(-C_0_1 - C_0_3 - C_0_5 - C_0_7); const Scalar tmp236 = w43*(-C_2_4 - C_2_6); const Scalar tmp237 = w34*(-C_1_0 - C_1_4); const Scalar tmp238 = w31*(C_1_3 + C_1_7); const Scalar tmp239 = w37*(C_1_1 + C_1_5); const Scalar tmp240 = w39*(C_1_0 + C_1_4); const Scalar tmp241 = w34*(C_1_2 + C_1_6); const Scalar tmp242 = w31*(-C_1_6 - C_1_7); const Scalar tmp243 = w42*(-C_2_2 - C_2_3); const Scalar tmp244 = w35*(-C_2_4 - C_2_5); const Scalar tmp245 = w37*(-C_1_4 - C_1_5); const Scalar tmp246 = w32*(-C_2_6 - C_2_7); const Scalar tmp247 = w39*(-C_1_0 - C_1_1); const Scalar tmp248 = w43*(-C_2_0 - C_2_1); const Scalar tmp249 = w34*(-C_1_2 - C_1_3); const Scalar tmp250 = w31*(-C_1_0 - C_1_1); const Scalar tmp251 = w37*(-C_1_2 - C_1_3); const Scalar tmp252 = w39*(-C_1_6 - C_1_7); const Scalar tmp253 = w34*(-C_1_4 - C_1_5); const Scalar tmp254 = w42*(C_2_0 + C_2_2); const Scalar tmp255 = w35*(C_2_5 + C_2_7); const Scalar tmp256 = w32*(C_2_4 + C_2_6); const Scalar tmp257 = w43*(C_2_1 + C_2_3); const Scalar tmp258 = w42*(-C_2_0 - C_2_1 - C_2_2 - C_2_3); const Scalar tmp259 = w35*(-C_2_4 - C_2_5 - C_2_6 - C_2_7); const Scalar tmp260 = w42*(C_2_1 + C_2_3); const Scalar tmp261 = w35*(C_2_4 + C_2_6); const Scalar tmp262 = w32*(C_2_5 + C_2_7); const Scalar tmp263 = w43*(C_2_0 + C_2_2); EM_S[INDEX2(0,0,8)]+=-C_0_0*w47 - C_0_1*w38 - C_0_6*w30 - C_0_7*w46 + C_1_0*w44 - C_1_2*w39 - C_1_5*w31 + C_1_7*w45 - C_2_0*w40 - C_2_3*w32 - C_2_4*w43 - C_2_7*w41 + tmp132 + tmp133 + tmp208 + tmp209 + tmp210 + tmp211; EM_S[INDEX2(1,0,8)]+=-C_0_0*w38 - C_0_1*w47 - C_0_6*w46 - C_0_7*w30 + tmp148 + tmp149 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX2(2,0,8)]+=-C_1_0*w39 + C_1_2*w44 + C_1_5*w45 - C_1_7*w31 + tmp138 + tmp139 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147; EM_S[INDEX2(3,0,8)]+=tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49; EM_S[INDEX2(4,0,8)]+=-C_2_0*w43 - C_2_3*w41 - C_2_4*w40 - C_2_7*w32 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp2 + tmp3; EM_S[INDEX2(5,0,8)]+=tmp191 + tmp192 + tmp193 + tmp194 + tmp198 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217; EM_S[INDEX2(6,0,8)]+=tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233 + tmp234 + tmp235 + tmp236 + tmp237; EM_S[INDEX2(7,0,8)]+=tmp258 + tmp259 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX2(0,1,8)]+=C_0_0*w47 + C_0_1*w38 + C_0_6*w30 + C_0_7*w46 + tmp128 + tmp129 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX2(1,1,8)]+=C_0_0*w38 + C_0_1*w47 + C_0_6*w46 + C_0_7*w30 + C_1_1*w44 - C_1_3*w39 - C_1_4*w31 + C_1_6*w45 - C_2_1*w40 - C_2_2*w32 - C_2_5*w43 - C_2_6*w41 + tmp152 + tmp155 + tmp164 + tmp165 + tmp168 + tmp169; EM_S[INDEX2(2,1,8)]+=tmp100 + tmp101 + tmp102 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp49 + tmp96; EM_S[INDEX2(3,1,8)]+=-C_1_1*w39 + C_1_3*w44 + C_1_4*w45 - C_1_6*w31 + tmp20 + tmp21 + tmp22 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp33 + tmp39; EM_S[INDEX2(4,1,8)]+=tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp196 + tmp197 + tmp198 + tmp199; EM_S[INDEX2(5,1,8)]+=-C_2_1*w43 - C_2_2*w41 - C_2_5*w40 - C_2_6*w32 + tmp82 + tmp83 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX2(6,1,8)]+=tmp258 + tmp259 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX2(7,1,8)]+=tmp181 + tmp182 + tmp184 + tmp186 + tmp187 + tmp188 + tmp218 + tmp219 + tmp220 + tmp221; EM_S[INDEX2(0,2,8)]+=-C_1_0*w44 + C_1_2*w39 + C_1_5*w31 - C_1_7*w45 + tmp138 + tmp139 + tmp140 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp173 + tmp179; EM_S[INDEX2(1,2,8)]+=tmp103 + tmp40 + tmp42 + tmp43 + tmp46 + tmp47 + tmp48 + tmp97 + tmp98 + tmp99; EM_S[INDEX2(2,2,8)]+=-C_0_2*w47 - C_0_3*w38 - C_0_4*w30 - C_0_5*w46 + C_1_0*w39 - C_1_2*w44 - C_1_5*w45 + C_1_7*w31 - C_2_1*w32 - C_2_2*w40 - C_2_5*w41 - C_2_6*w43 + tmp153 + tmp154 + tmp164 + tmp165 + tmp166 + tmp167; EM_S[INDEX2(3,2,8)]+=-C_0_2*w38 - C_0_3*w47 - C_0_4*w46 - C_0_5*w30 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp56 + tmp57; EM_S[INDEX2(4,2,8)]+=tmp229 + tmp230 + tmp232 + tmp234 + tmp235 + tmp236 + tmp238 + tmp239 + tmp240 + tmp241; EM_S[INDEX2(5,2,8)]+=tmp258 + tmp259 + tmp62 + tmp65 + tmp80 + tmp81; EM_S[INDEX2(6,2,8)]+=-C_2_1*w41 - C_2_2*w43 - C_2_5*w32 - C_2_6*w40 + tmp70 + tmp71 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79 + tmp84 + tmp85; EM_S[INDEX2(7,2,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113; EM_S[INDEX2(0,3,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp42 + tmp43 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX2(1,3,8)]+=-C_1_1*w44 + C_1_3*w39 + C_1_4*w31 - C_1_6*w45 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29; EM_S[INDEX2(2,3,8)]+=C_0_2*w47 + C_0_3*w38 + C_0_4*w30 + C_0_5*w46 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp222 + tmp223; EM_S[INDEX2(3,3,8)]+=C_0_2*w38 + C_0_3*w47 + C_0_4*w46 + C_0_5*w30 + C_1_1*w39 - C_1_3*w44 - C_1_4*w45 + C_1_6*w31 - C_2_0*w32 - C_2_3*w40 - C_2_4*w41 - C_2_7*w43 + tmp132 + tmp133 + tmp134 + tmp135 + tmp136 + tmp137; EM_S[INDEX2(4,3,8)]+=tmp258 + tmp259 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX2(5,3,8)]+=tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp188 + tmp189; EM_S[INDEX2(6,3,8)]+=tmp105 + tmp106 + tmp107 + tmp108 + tmp112 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159; EM_S[INDEX2(7,3,8)]+=-C_2_0*w41 - C_2_3*w43 - C_2_4*w32 - C_2_7*w40 + tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX2(0,4,8)]+=C_2_0*w40 + C_2_3*w32 + C_2_4*w43 + C_2_7*w41 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp92 + tmp93; EM_S[INDEX2(1,4,8)]+=tmp193 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX2(2,4,8)]+=tmp228 + tmp231 + tmp233 + tmp234 + tmp235 + tmp237 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX2(3,4,8)]+=tmp60 + tmp61 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX2(4,4,8)]+=-C_0_2*w30 - C_0_3*w46 - C_0_4*w47 - C_0_5*w38 - C_1_1*w31 + C_1_3*w45 + C_1_4*w44 - C_1_6*w39 + C_2_0*w43 + C_2_3*w41 + C_2_4*w40 + C_2_7*w32 + tmp150 + tmp151 + tmp152 + tmp153 + tmp154 + tmp155; EM_S[INDEX2(5,4,8)]+=-C_0_2*w46 - C_0_3*w30 - C_0_4*w38 - C_0_5*w47 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59; EM_S[INDEX2(6,4,8)]+=C_1_1*w45 - C_1_3*w31 - C_1_4*w39 + C_1_6*w44 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39; EM_S[INDEX2(7,4,8)]+=tmp12 + tmp13 + tmp250 + tmp251 + tmp252 + tmp253 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX2(0,5,8)]+=tmp190 + tmp193 + tmp195 + tmp196 + tmp197 + tmp199 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX2(1,5,8)]+=C_2_1*w40 + C_2_2*w32 + C_2_5*w43 + C_2_6*w41 + tmp72 + tmp73 + tmp82 + tmp83 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX2(2,5,8)]+=tmp60 + tmp61 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX2(3,5,8)]+=tmp186 + tmp187 + tmp218 + tmp219 + tmp220 + tmp221 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX2(4,5,8)]+=C_0_2*w30 + C_0_3*w46 + C_0_4*w47 + C_0_5*w38 + tmp222 + tmp223 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp58 + tmp59; EM_S[INDEX2(5,5,8)]+=C_0_2*w46 + C_0_3*w30 + C_0_4*w38 + C_0_5*w47 - C_1_0*w31 + C_1_2*w45 + C_1_5*w44 - C_1_7*w39 + C_2_1*w43 + C_2_2*w41 + C_2_5*w40 + C_2_6*w32 + tmp135 + tmp136 + tmp208 + tmp211 + tmp212 + tmp213; EM_S[INDEX2(6,5,8)]+=tmp10 + tmp12 + tmp13 + tmp16 + tmp17 + tmp18 + tmp250 + tmp251 + tmp252 + tmp253; EM_S[INDEX2(7,5,8)]+=C_1_0*w45 - C_1_2*w31 - C_1_5*w39 + C_1_7*w44 + tmp141 + tmp147 + tmp170 + tmp171 + tmp172 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178; EM_S[INDEX2(0,6,8)]+=tmp234 + tmp235 + tmp238 + tmp239 + tmp240 + tmp241 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX2(1,6,8)]+=tmp60 + tmp61 + tmp62 + tmp65 + tmp80 + tmp81; EM_S[INDEX2(2,6,8)]+=C_2_1*w32 + C_2_2*w40 + C_2_5*w41 + C_2_6*w43 + tmp70 + tmp71 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79; EM_S[INDEX2(3,6,8)]+=tmp104 + tmp107 + tmp109 + tmp110 + tmp111 + tmp113 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX2(4,6,8)]+=C_1_1*w31 - C_1_3*w45 - C_1_4*w44 + C_1_6*w39 + tmp23 + tmp29 + tmp30 + tmp31 + tmp32 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38; EM_S[INDEX2(5,6,8)]+=tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp19 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX2(6,6,8)]+=-C_0_0*w30 - C_0_1*w46 - C_0_6*w47 - C_0_7*w38 - C_1_1*w45 + C_1_3*w31 + C_1_4*w39 - C_1_6*w44 + C_2_1*w41 + C_2_2*w43 + C_2_5*w32 + C_2_6*w40 + tmp134 + tmp137 + tmp209 + tmp210 + tmp212 + tmp213; EM_S[INDEX2(7,6,8)]+=-C_0_0*w46 - C_0_1*w30 - C_0_6*w38 - C_0_7*w47 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp130 + tmp131 + tmp148 + tmp149; EM_S[INDEX2(0,7,8)]+=tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX2(1,7,8)]+=tmp180 + tmp183 + tmp185 + tmp186 + tmp187 + tmp189 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX2(2,7,8)]+=tmp107 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX2(3,7,8)]+=C_2_0*w32 + C_2_3*w40 + C_2_4*w41 + C_2_7*w43 + tmp0 + tmp1 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9 + tmp92 + tmp93; EM_S[INDEX2(4,7,8)]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19; EM_S[INDEX2(5,7,8)]+=C_1_0*w31 - C_1_2*w45 - C_1_5*w44 + C_1_7*w39 + tmp170 + tmp171 + tmp172 + tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179; EM_S[INDEX2(6,7,8)]+=C_0_0*w30 + C_0_1*w46 + C_0_6*w47 + C_0_7*w38 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131; EM_S[INDEX2(7,7,8)]+=C_0_0*w46 + C_0_1*w30 + C_0_6*w38 + C_0_7*w47 - C_1_0*w45 + C_1_2*w31 + C_1_5*w39 - C_1_7*w44 + C_2_0*w41 + C_2_3*w43 + C_2_4*w32 + C_2_7*w40 + tmp150 + tmp151 + tmp166 + tmp167 + tmp168 + tmp169; } else { // constant data const Scalar wC0 = C_p[0]*w53; const Scalar wC1 = C_p[1]*w51; const Scalar wC2 = C_p[2]*w50; EM_S[INDEX2(0,0,8)]+= 4.*wC0 + 4.*wC1 - 4.*wC2; EM_S[INDEX2(1,0,8)]+= 4.*wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX2(2,0,8)]+= 2.*wC0 + 4.*wC1 - 2.*wC2; EM_S[INDEX2(3,0,8)]+= 2.*wC0 + 2.*wC1 - wC2; EM_S[INDEX2(4,0,8)]+= 2.*wC0 + 2.*wC1 - 4.*wC2; EM_S[INDEX2(5,0,8)]+= 2.*wC0 + wC1 - 2.*wC2; EM_S[INDEX2(6,0,8)]+= wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX2(7,0,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(0,1,8)]+=-4.*wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX2(1,1,8)]+=-4.*wC0 + 4.*wC1 - 4.*wC2; EM_S[INDEX2(2,1,8)]+=-2.*wC0 + 2.*wC1 - wC2; EM_S[INDEX2(3,1,8)]+=-2.*wC0 + 4.*wC1 - 2.*wC2; EM_S[INDEX2(4,1,8)]+=-2.*wC0 + wC1 - 2.*wC2; EM_S[INDEX2(5,1,8)]+=-2.*wC0 + 2.*wC1 - 4.*wC2; EM_S[INDEX2(6,1,8)]+= -wC0 + wC1 - wC2; EM_S[INDEX2(7,1,8)]+= -wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX2(0,2,8)]+= 2.*wC0 - 4.*wC1 - 2.*wC2; EM_S[INDEX2(1,2,8)]+= 2.*wC0 - 2.*wC1 - wC2; EM_S[INDEX2(2,2,8)]+= 4.*wC0 - 4.*wC1 - 4.*wC2; EM_S[INDEX2(3,2,8)]+= 4.*wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX2(4,2,8)]+= wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX2(5,2,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(6,2,8)]+= 2.*wC0 - 2.*wC1 - 4.*wC2; EM_S[INDEX2(7,2,8)]+= 2.*wC0 - wC1 - 2.*wC2; EM_S[INDEX2(0,3,8)]+=-2.*wC0 - 2.*wC1 - wC2; EM_S[INDEX2(1,3,8)]+=-2.*wC0 - 4.*wC1 - 2.*wC2; EM_S[INDEX2(2,3,8)]+=-4.*wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX2(3,3,8)]+=-4.*wC0 - 4.*wC1 - 4.*wC2; EM_S[INDEX2(4,3,8)]+= -wC0 - wC1 - wC2; EM_S[INDEX2(5,3,8)]+= -wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX2(6,3,8)]+=-2.*wC0 - wC1 - 2.*wC2; EM_S[INDEX2(7,3,8)]+=-2.*wC0 - 2.*wC1 - 4.*wC2; EM_S[INDEX2(0,4,8)]+= 2.*wC0 + 2.*wC1 + 4.*wC2; EM_S[INDEX2(1,4,8)]+= 2.*wC0 + wC1 + 2.*wC2; EM_S[INDEX2(2,4,8)]+= wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX2(3,4,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(4,4,8)]+= 4.*wC0 + 4.*wC1 + 4.*wC2; EM_S[INDEX2(5,4,8)]+= 4.*wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX2(6,4,8)]+= 2.*wC0 + 4.*wC1 + 2.*wC2; EM_S[INDEX2(7,4,8)]+= 2.*wC0 + 2.*wC1 + wC2; EM_S[INDEX2(0,5,8)]+=-2.*wC0 + wC1 + 2.*wC2; EM_S[INDEX2(1,5,8)]+=-2.*wC0 + 2.*wC1 + 4.*wC2; EM_S[INDEX2(2,5,8)]+= -wC0 + wC1 + wC2; EM_S[INDEX2(3,5,8)]+= -wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX2(4,5,8)]+=-4.*wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX2(5,5,8)]+=-4.*wC0 + 4.*wC1 + 4.*wC2; EM_S[INDEX2(6,5,8)]+=-2.*wC0 + 2.*wC1 + wC2; EM_S[INDEX2(7,5,8)]+=-2.*wC0 + 4.*wC1 + 2.*wC2; EM_S[INDEX2(0,6,8)]+= wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX2(1,6,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(2,6,8)]+= 2.*wC0 - 2.*wC1 + 4.*wC2; EM_S[INDEX2(3,6,8)]+= 2.*wC0 - wC1 + 2.*wC2; EM_S[INDEX2(4,6,8)]+= 2.*wC0 - 4.*wC1 + 2.*wC2; EM_S[INDEX2(5,6,8)]+= 2.*wC0 - 2.*wC1 + wC2; EM_S[INDEX2(6,6,8)]+= 4.*wC0 - 4.*wC1 + 4.*wC2; EM_S[INDEX2(7,6,8)]+= 4.*wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX2(0,7,8)]+= -wC0 - wC1 + wC2; EM_S[INDEX2(1,7,8)]+= -wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX2(2,7,8)]+=-2.*wC0 - wC1 + 2.*wC2; EM_S[INDEX2(3,7,8)]+=-2.*wC0 - 2.*wC1 + 4.*wC2; EM_S[INDEX2(4,7,8)]+=-2.*wC0 - 2.*wC1 + wC2; EM_S[INDEX2(5,7,8)]+=-2.*wC0 - 4.*wC1 + 2.*wC2; EM_S[INDEX2(6,7,8)]+=-4.*wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX2(7,7,8)]+=-4.*wC0 - 4.*wC1 + 4.*wC2; } } /////////////// // process D // /////////////// if (!D.isEmpty()) { const Scalar* D_p = D.getSampleDataRO(e, zero); if (D.actsExpanded()) { const Scalar D_0 = D_p[0]; const Scalar D_1 = D_p[1]; const Scalar D_2 = D_p[2]; const Scalar D_3 = D_p[3]; const Scalar D_4 = D_p[4]; const Scalar D_5 = D_p[5]; const Scalar D_6 = D_p[6]; const Scalar D_7 = D_p[7]; const Scalar tmp0 = w54*(D_0 + D_4); const Scalar tmp1 = w55*(D_1 + D_2 + D_5 + D_6); const Scalar tmp2 = w56*(D_3 + D_7); const Scalar tmp3 = w57*(D_0 + D_1 + D_2 + D_3); const Scalar tmp4 = w58*(D_4 + D_5 + D_6 + D_7); const Scalar tmp5 = w54*(D_4 + D_6); const Scalar tmp6 = w55*(D_0 + D_2 + D_5 + D_7); const Scalar tmp7 = w56*(D_1 + D_3); const Scalar tmp8 = w54*(D_1 + D_3); const Scalar tmp9 = w56*(D_4 + D_6); const Scalar tmp10 = w57*(D_4 + D_5 + D_6 + D_7); const Scalar tmp11 = w58*(D_0 + D_1 + D_2 + D_3); const Scalar tmp12 = w54*(D_2 + D_3); const Scalar tmp13 = w55*(D_0 + D_1 + D_6 + D_7); const Scalar tmp14 = w56*(D_4 + D_5); const Scalar tmp15 = w55*(D_0 + D_1 + D_2 + D_3 + D_4 + D_5 + D_6 + D_7); const Scalar tmp16 = w54*(D_1 + D_5); const Scalar tmp17 = w55*(D_0 + D_3 + D_4 + D_7); const Scalar tmp18 = w56*(D_2 + D_6); const Scalar tmp19 = w54*(D_2 + D_6); const Scalar tmp20 = w56*(D_1 + D_5); const Scalar tmp21 = w57*(D_0 + D_1 + D_4 + D_5); const Scalar tmp22 = w58*(D_2 + D_3 + D_6 + D_7); const Scalar tmp23 = w54*(D_3 + D_7); const Scalar tmp24 = w56*(D_0 + D_4); const Scalar tmp25 = w54*(D_0 + D_1); const Scalar tmp26 = w55*(D_2 + D_3 + D_4 + D_5); const Scalar tmp27 = w56*(D_6 + D_7); const Scalar tmp28 = w57*(D_0 + D_5 + D_6); const Scalar tmp29 = w58*(D_1 + D_2 + D_7); const Scalar tmp30 = w54*(D_5 + D_7); const Scalar tmp31 = w55*(D_1 + D_3 + D_4 + D_6); const Scalar tmp32 = w56*(D_0 + D_2); const Scalar tmp33 = w57*(D_1 + D_2 + D_7); const Scalar tmp34 = w58*(D_0 + D_5 + D_6); const Scalar tmp35 = w57*(D_1 + D_4 + D_7); const Scalar tmp36 = w58*(D_0 + D_3 + D_6); const Scalar tmp37 = w57*(D_1 + D_2 + D_4); const Scalar tmp38 = w58*(D_3 + D_5 + D_6); const Scalar tmp39 = w54*(D_0 + D_2); const Scalar tmp40 = w56*(D_5 + D_7); const Scalar tmp41 = w57*(D_0 + D_2 + D_4 + D_6); const Scalar tmp42 = w58*(D_1 + D_3 + D_5 + D_7); const Scalar tmp43 = w57*(D_2 + D_3 + D_6 + D_7); const Scalar tmp44 = w58*(D_0 + D_1 + D_4 + D_5); const Scalar tmp45 = w57*(D_2 + D_4 + D_7); const Scalar tmp46 = w58*(D_0 + D_3 + D_5); const Scalar tmp47 = w54*(D_4 + D_5); const Scalar tmp48 = w56*(D_2 + D_3); const Scalar tmp49 = w57*(D_3 + D_5 + D_6); const Scalar tmp50 = w58*(D_1 + D_2 + D_4); const Scalar tmp51 = w57*(D_0 + D_3 + D_5); const Scalar tmp52 = w58*(D_2 + D_4 + D_7); const Scalar tmp53 = w57*(D_0 + D_3 + D_6); const Scalar tmp54 = w58*(D_1 + D_4 + D_7); const Scalar tmp55 = w57*(D_1 + D_3 + D_5 + D_7); const Scalar tmp56 = w58*(D_0 + D_2 + D_4 + D_6); const Scalar tmp57 = w54*(D_6 + D_7); const Scalar tmp58 = w56*(D_0 + D_1); EM_S[INDEX2(0,0,8)]+=D_0*w59 + D_7*w60 + tmp49 + tmp50; EM_S[INDEX2(1,0,8)]+=tmp26 + tmp57 + tmp58; EM_S[INDEX2(2,0,8)]+=tmp30 + tmp31 + tmp32; EM_S[INDEX2(3,0,8)]+=tmp10 + tmp11; EM_S[INDEX2(4,0,8)]+=tmp1 + tmp23 + tmp24; EM_S[INDEX2(5,0,8)]+=tmp43 + tmp44; EM_S[INDEX2(6,0,8)]+=tmp55 + tmp56; EM_S[INDEX2(7,0,8)]+=tmp15; EM_S[INDEX2(0,1,8)]+=tmp26 + tmp57 + tmp58; EM_S[INDEX2(1,1,8)]+=D_1*w59 + D_6*w60 + tmp45 + tmp46; EM_S[INDEX2(2,1,8)]+=tmp10 + tmp11; EM_S[INDEX2(3,1,8)]+=tmp5 + tmp6 + tmp7; EM_S[INDEX2(4,1,8)]+=tmp43 + tmp44; EM_S[INDEX2(5,1,8)]+=tmp17 + tmp19 + tmp20; EM_S[INDEX2(6,1,8)]+=tmp15; EM_S[INDEX2(7,1,8)]+=tmp41 + tmp42; EM_S[INDEX2(0,2,8)]+=tmp30 + tmp31 + tmp32; EM_S[INDEX2(1,2,8)]+=tmp10 + tmp11; EM_S[INDEX2(2,2,8)]+=D_2*w59 + D_5*w60 + tmp35 + tmp36; EM_S[INDEX2(3,2,8)]+=tmp13 + tmp47 + tmp48; EM_S[INDEX2(4,2,8)]+=tmp55 + tmp56; EM_S[INDEX2(5,2,8)]+=tmp15; EM_S[INDEX2(6,2,8)]+=tmp16 + tmp17 + tmp18; EM_S[INDEX2(7,2,8)]+=tmp21 + tmp22; EM_S[INDEX2(0,3,8)]+=tmp10 + tmp11; EM_S[INDEX2(1,3,8)]+=tmp5 + tmp6 + tmp7; EM_S[INDEX2(2,3,8)]+=tmp13 + tmp47 + tmp48; EM_S[INDEX2(3,3,8)]+=D_3*w59 + D_4*w60 + tmp28 + tmp29; EM_S[INDEX2(4,3,8)]+=tmp15; EM_S[INDEX2(5,3,8)]+=tmp41 + tmp42; EM_S[INDEX2(6,3,8)]+=tmp21 + tmp22; EM_S[INDEX2(7,3,8)]+=tmp0 + tmp1 + tmp2; EM_S[INDEX2(0,4,8)]+=tmp1 + tmp23 + tmp24; EM_S[INDEX2(1,4,8)]+=tmp43 + tmp44; EM_S[INDEX2(2,4,8)]+=tmp55 + tmp56; EM_S[INDEX2(3,4,8)]+=tmp15; EM_S[INDEX2(4,4,8)]+=D_3*w60 + D_4*w59 + tmp33 + tmp34; EM_S[INDEX2(5,4,8)]+=tmp12 + tmp13 + tmp14; EM_S[INDEX2(6,4,8)]+=tmp6 + tmp8 + tmp9; EM_S[INDEX2(7,4,8)]+=tmp3 + tmp4; EM_S[INDEX2(0,5,8)]+=tmp43 + tmp44; EM_S[INDEX2(1,5,8)]+=tmp17 + tmp19 + tmp20; EM_S[INDEX2(2,5,8)]+=tmp15; EM_S[INDEX2(3,5,8)]+=tmp41 + tmp42; EM_S[INDEX2(4,5,8)]+=tmp12 + tmp13 + tmp14; EM_S[INDEX2(5,5,8)]+=D_2*w60 + D_5*w59 + tmp53 + tmp54; EM_S[INDEX2(6,5,8)]+=tmp3 + tmp4; EM_S[INDEX2(7,5,8)]+=tmp31 + tmp39 + tmp40; EM_S[INDEX2(0,6,8)]+=tmp55 + tmp56; EM_S[INDEX2(1,6,8)]+=tmp15; EM_S[INDEX2(2,6,8)]+=tmp16 + tmp17 + tmp18; EM_S[INDEX2(3,6,8)]+=tmp21 + tmp22; EM_S[INDEX2(4,6,8)]+=tmp6 + tmp8 + tmp9; EM_S[INDEX2(5,6,8)]+=tmp3 + tmp4; EM_S[INDEX2(6,6,8)]+=D_1*w60 + D_6*w59 + tmp51 + tmp52; EM_S[INDEX2(7,6,8)]+=tmp25 + tmp26 + tmp27; EM_S[INDEX2(0,7,8)]+=tmp15; EM_S[INDEX2(1,7,8)]+=tmp41 + tmp42; EM_S[INDEX2(2,7,8)]+=tmp21 + tmp22; EM_S[INDEX2(3,7,8)]+=tmp0 + tmp1 + tmp2; EM_S[INDEX2(4,7,8)]+=tmp3 + tmp4; EM_S[INDEX2(5,7,8)]+=tmp31 + tmp39 + tmp40; EM_S[INDEX2(6,7,8)]+=tmp25 + tmp26 + tmp27; EM_S[INDEX2(7,7,8)]+=D_0*w60 + D_7*w59 + tmp37 + tmp38; } else { // constant data const Scalar wD0 = 8.*D_p[0]*w55; EM_S[INDEX2(0,0,8)]+=8.*wD0; EM_S[INDEX2(1,0,8)]+=4.*wD0; EM_S[INDEX2(2,0,8)]+=4.*wD0; EM_S[INDEX2(3,0,8)]+=2.*wD0; EM_S[INDEX2(4,0,8)]+=4.*wD0; EM_S[INDEX2(5,0,8)]+=2.*wD0; EM_S[INDEX2(6,0,8)]+=2.*wD0; EM_S[INDEX2(7,0,8)]+= wD0; EM_S[INDEX2(0,1,8)]+=4.*wD0; EM_S[INDEX2(1,1,8)]+=8.*wD0; EM_S[INDEX2(2,1,8)]+=2.*wD0; EM_S[INDEX2(3,1,8)]+=4.*wD0; EM_S[INDEX2(4,1,8)]+=2.*wD0; EM_S[INDEX2(5,1,8)]+=4.*wD0; EM_S[INDEX2(6,1,8)]+= wD0; EM_S[INDEX2(7,1,8)]+=2.*wD0; EM_S[INDEX2(0,2,8)]+=4.*wD0; EM_S[INDEX2(1,2,8)]+=2.*wD0; EM_S[INDEX2(2,2,8)]+=8.*wD0; EM_S[INDEX2(3,2,8)]+=4.*wD0; EM_S[INDEX2(4,2,8)]+=2.*wD0; EM_S[INDEX2(5,2,8)]+= wD0; EM_S[INDEX2(6,2,8)]+=4.*wD0; EM_S[INDEX2(7,2,8)]+=2.*wD0; EM_S[INDEX2(0,3,8)]+=2.*wD0; EM_S[INDEX2(1,3,8)]+=4.*wD0; EM_S[INDEX2(2,3,8)]+=4.*wD0; EM_S[INDEX2(3,3,8)]+=8.*wD0; EM_S[INDEX2(4,3,8)]+= wD0; EM_S[INDEX2(5,3,8)]+=2.*wD0; EM_S[INDEX2(6,3,8)]+=2.*wD0; EM_S[INDEX2(7,3,8)]+=4.*wD0; EM_S[INDEX2(0,4,8)]+=4.*wD0; EM_S[INDEX2(1,4,8)]+=2.*wD0; EM_S[INDEX2(2,4,8)]+=2.*wD0; EM_S[INDEX2(3,4,8)]+= wD0; EM_S[INDEX2(4,4,8)]+=8.*wD0; EM_S[INDEX2(5,4,8)]+=4.*wD0; EM_S[INDEX2(6,4,8)]+=4.*wD0; EM_S[INDEX2(7,4,8)]+=2.*wD0; EM_S[INDEX2(0,5,8)]+=2.*wD0; EM_S[INDEX2(1,5,8)]+=4.*wD0; EM_S[INDEX2(2,5,8)]+= wD0; EM_S[INDEX2(3,5,8)]+=2.*wD0; EM_S[INDEX2(4,5,8)]+=4.*wD0; EM_S[INDEX2(5,5,8)]+=8.*wD0; EM_S[INDEX2(6,5,8)]+=2.*wD0; EM_S[INDEX2(7,5,8)]+=4.*wD0; EM_S[INDEX2(0,6,8)]+=2.*wD0; EM_S[INDEX2(1,6,8)]+= wD0; EM_S[INDEX2(2,6,8)]+=4.*wD0; EM_S[INDEX2(3,6,8)]+=2.*wD0; EM_S[INDEX2(4,6,8)]+=4.*wD0; EM_S[INDEX2(5,6,8)]+=2.*wD0; EM_S[INDEX2(6,6,8)]+=8.*wD0; EM_S[INDEX2(7,6,8)]+=4.*wD0; EM_S[INDEX2(0,7,8)]+= wD0; EM_S[INDEX2(1,7,8)]+=2.*wD0; EM_S[INDEX2(2,7,8)]+=2.*wD0; EM_S[INDEX2(3,7,8)]+=4.*wD0; EM_S[INDEX2(4,7,8)]+=2.*wD0; EM_S[INDEX2(5,7,8)]+=4.*wD0; EM_S[INDEX2(6,7,8)]+=4.*wD0; EM_S[INDEX2(7,7,8)]+=8.*wD0; } } /////////////// // process X // /////////////// if (!X.isEmpty()) { const Scalar* X_p = X.getSampleDataRO(e, zero); if (X.actsExpanded()) { const Scalar X_0_0 = X_p[INDEX2(0,0,3)]; const Scalar X_1_0 = X_p[INDEX2(1,0,3)]; const Scalar X_2_0 = X_p[INDEX2(2,0,3)]; const Scalar X_0_1 = X_p[INDEX2(0,1,3)]; const Scalar X_1_1 = X_p[INDEX2(1,1,3)]; const Scalar X_2_1 = X_p[INDEX2(2,1,3)]; const Scalar X_0_2 = X_p[INDEX2(0,2,3)]; const Scalar X_1_2 = X_p[INDEX2(1,2,3)]; const Scalar X_2_2 = X_p[INDEX2(2,2,3)]; const Scalar X_0_3 = X_p[INDEX2(0,3,3)]; const Scalar X_1_3 = X_p[INDEX2(1,3,3)]; const Scalar X_2_3 = X_p[INDEX2(2,3,3)]; const Scalar X_0_4 = X_p[INDEX2(0,4,3)]; const Scalar X_1_4 = X_p[INDEX2(1,4,3)]; const Scalar X_2_4 = X_p[INDEX2(2,4,3)]; const Scalar X_0_5 = X_p[INDEX2(0,5,3)]; const Scalar X_1_5 = X_p[INDEX2(1,5,3)]; const Scalar X_2_5 = X_p[INDEX2(2,5,3)]; const Scalar X_0_6 = X_p[INDEX2(0,6,3)]; const Scalar X_1_6 = X_p[INDEX2(1,6,3)]; const Scalar X_2_6 = X_p[INDEX2(2,6,3)]; const Scalar X_0_7 = X_p[INDEX2(0,7,3)]; const Scalar X_1_7 = X_p[INDEX2(1,7,3)]; const Scalar X_2_7 = X_p[INDEX2(2,7,3)]; const Scalar tmp0 = w66*(X_0_2 + X_0_3 + X_0_4 + X_0_5); const Scalar tmp1 = w64*(X_1_1 + X_1_3 + X_1_4 + X_1_6); const Scalar tmp2 = w61*(X_0_0 + X_0_1); const Scalar tmp3 = w68*(X_1_5 + X_1_7); const Scalar tmp4 = w65*(X_2_1 + X_2_2 + X_2_5 + X_2_6); const Scalar tmp5 = w63*(X_2_0 + X_2_4); const Scalar tmp6 = w67*(X_2_3 + X_2_7); const Scalar tmp7 = w69*(X_0_6 + X_0_7); const Scalar tmp8 = w62*(X_1_0 + X_1_2); const Scalar tmp9 = w66*(-X_0_2 - X_0_3 - X_0_4 - X_0_5); const Scalar tmp10 = w64*(X_1_0 + X_1_2 + X_1_5 + X_1_7); const Scalar tmp11 = w61*(-X_0_0 - X_0_1); const Scalar tmp12 = w68*(X_1_4 + X_1_6); const Scalar tmp13 = w65*(X_2_0 + X_2_3 + X_2_4 + X_2_7); const Scalar tmp14 = w63*(X_2_1 + X_2_5); const Scalar tmp15 = w67*(X_2_2 + X_2_6); const Scalar tmp16 = w69*(-X_0_6 - X_0_7); const Scalar tmp17 = w62*(X_1_1 + X_1_3); const Scalar tmp18 = w66*(X_0_0 + X_0_1 + X_0_6 + X_0_7); const Scalar tmp19 = w64*(-X_1_1 - X_1_3 - X_1_4 - X_1_6); const Scalar tmp20 = w61*(X_0_2 + X_0_3); const Scalar tmp21 = w68*(-X_1_5 - X_1_7); const Scalar tmp22 = w63*(X_2_2 + X_2_6); const Scalar tmp23 = w67*(X_2_1 + X_2_5); const Scalar tmp24 = w69*(X_0_4 + X_0_5); const Scalar tmp25 = w62*(-X_1_0 - X_1_2); const Scalar tmp26 = w66*(-X_0_0 - X_0_1 - X_0_6 - X_0_7); const Scalar tmp27 = w64*(-X_1_0 - X_1_2 - X_1_5 - X_1_7); const Scalar tmp28 = w61*(-X_0_2 - X_0_3); const Scalar tmp29 = w68*(-X_1_4 - X_1_6); const Scalar tmp30 = w63*(X_2_3 + X_2_7); const Scalar tmp31 = w67*(X_2_0 + X_2_4); const Scalar tmp32 = w69*(-X_0_4 - X_0_5); const Scalar tmp33 = w62*(-X_1_1 - X_1_3); const Scalar tmp34 = w61*(X_0_4 + X_0_5); const Scalar tmp35 = w68*(X_1_1 + X_1_3); const Scalar tmp36 = w65*(-X_2_1 - X_2_2 - X_2_5 - X_2_6); const Scalar tmp37 = w63*(-X_2_0 - X_2_4); const Scalar tmp38 = w67*(-X_2_3 - X_2_7); const Scalar tmp39 = w69*(X_0_2 + X_0_3); const Scalar tmp40 = w62*(X_1_4 + X_1_6); const Scalar tmp41 = w61*(-X_0_4 - X_0_5); const Scalar tmp42 = w68*(X_1_0 + X_1_2); const Scalar tmp43 = w65*(-X_2_0 - X_2_3 - X_2_4 - X_2_7); const Scalar tmp44 = w63*(-X_2_1 - X_2_5); const Scalar tmp45 = w67*(-X_2_2 - X_2_6); const Scalar tmp46 = w69*(-X_0_2 - X_0_3); const Scalar tmp47 = w62*(X_1_5 + X_1_7); const Scalar tmp48 = w61*(X_0_6 + X_0_7); const Scalar tmp49 = w68*(-X_1_1 - X_1_3); const Scalar tmp50 = w63*(-X_2_2 - X_2_6); const Scalar tmp51 = w67*(-X_2_1 - X_2_5); const Scalar tmp52 = w69*(X_0_0 + X_0_1); const Scalar tmp53 = w62*(-X_1_4 - X_1_6); const Scalar tmp54 = w61*(-X_0_6 - X_0_7); const Scalar tmp55 = w68*(-X_1_0 - X_1_2); const Scalar tmp56 = w63*(-X_2_3 - X_2_7); const Scalar tmp57 = w67*(-X_2_0 - X_2_4); const Scalar tmp58 = w69*(-X_0_0 - X_0_1); const Scalar tmp59 = w62*(-X_1_5 - X_1_7); EM_F[0]+=tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8; EM_F[1]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp9; EM_F[2]+=tmp13 + tmp18 + tmp19 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25; EM_F[3]+=tmp26 + tmp27 + tmp28 + tmp29 + tmp30 + tmp31 + tmp32 + tmp33 + tmp4; EM_F[4]+=tmp10 + tmp18 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39 + tmp40; EM_F[5]+=tmp1 + tmp26 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47; EM_F[6]+=tmp0 + tmp27 + tmp43 + tmp48 + tmp49 + tmp50 + tmp51 + tmp52 + tmp53; EM_F[7]+=tmp19 + tmp36 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59 + tmp9; } else { // constant data const Scalar wX0 = 12.*X_p[0]*w66; const Scalar wX1 = 12.*X_p[1]*w64; const Scalar wX2 = 18.*X_p[2]*w50; EM_F[0]+= wX0 + wX1 - wX2; EM_F[1]+=-wX0 + wX1 - wX2; EM_F[2]+= wX0 - wX1 - wX2; EM_F[3]+=-wX0 - wX1 - wX2; EM_F[4]+= wX0 + wX1 + wX2; EM_F[5]+=-wX0 + wX1 + wX2; EM_F[6]+= wX0 - wX1 + wX2; EM_F[7]+=-wX0 - wX1 + wX2; } } /////////////// // process Y // /////////////// if (!Y.isEmpty()) { const Scalar* Y_p = Y.getSampleDataRO(e, zero); if (Y.actsExpanded()) { const Scalar Y_0 = Y_p[0]; const Scalar Y_1 = Y_p[1]; const Scalar Y_2 = Y_p[2]; const Scalar Y_3 = Y_p[3]; const Scalar Y_4 = Y_p[4]; const Scalar Y_5 = Y_p[5]; const Scalar Y_6 = Y_p[6]; const Scalar Y_7 = Y_p[7]; const Scalar tmp0 = w72*(Y_3 + Y_5 + Y_6); const Scalar tmp1 = w71*(Y_1 + Y_2 + Y_4); const Scalar tmp2 = w72*(Y_2 + Y_4 + Y_7); const Scalar tmp3 = w71*(Y_0 + Y_3 + Y_5); const Scalar tmp4 = w72*(Y_1 + Y_4 + Y_7); const Scalar tmp5 = w71*(Y_0 + Y_3 + Y_6); const Scalar tmp6 = w72*(Y_0 + Y_5 + Y_6); const Scalar tmp7 = w71*(Y_1 + Y_2 + Y_7); const Scalar tmp8 = w72*(Y_1 + Y_2 + Y_7); const Scalar tmp9 = w71*(Y_0 + Y_5 + Y_6); const Scalar tmp10 = w72*(Y_0 + Y_3 + Y_6); const Scalar tmp11 = w71*(Y_1 + Y_4 + Y_7); const Scalar tmp12 = w72*(Y_0 + Y_3 + Y_5); const Scalar tmp13 = w71*(Y_2 + Y_4 + Y_7); const Scalar tmp14 = w72*(Y_1 + Y_2 + Y_4); const Scalar tmp15 = w71*(Y_3 + Y_5 + Y_6); EM_F[0]+=Y_0*w70 + Y_7*w73 + tmp0 + tmp1; EM_F[1]+=Y_1*w70 + Y_6*w73 + tmp2 + tmp3; EM_F[2]+=Y_2*w70 + Y_5*w73 + tmp4 + tmp5; EM_F[3]+=Y_3*w70 + Y_4*w73 + tmp6 + tmp7; EM_F[4]+=Y_3*w73 + Y_4*w70 + tmp8 + tmp9; EM_F[5]+=Y_2*w73 + Y_5*w70 + tmp10 + tmp11; EM_F[6]+=Y_1*w73 + Y_6*w70 + tmp12 + tmp13; EM_F[7]+=Y_0*w73 + Y_7*w70 + tmp14 + tmp15; } else { // constant data EM_F[0]+=216.*Y_p[0]*w55; EM_F[1]+=216.*Y_p[0]*w55; EM_F[2]+=216.*Y_p[0]*w55; EM_F[3]+=216.*Y_p[0]*w55; EM_F[4]+=216.*Y_p[0]*w55; EM_F[5]+=216.*Y_p[0]*w55; EM_F[6]+=216.*Y_p[0]*w55; EM_F[7]+=216.*Y_p[0]*w55; } } // add to matrix (if add_EM_S) and RHS (if add_EM_F) const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // end k0 loop } // end k1 loop } // end k2 loop } // end of colouring } // end of parallel region } /****************************************************************************/ // PDE SINGLE BOUNDARY /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySingle( AbstractSystemMatrix* mat, Data& rhs, const Data& d, const Data& y) const { const double SQRT3 = 1.73205080756887719318; const double w12 = m_dx[0]*m_dx[1]/144; const double w10 = w12*(-SQRT3 + 2); const double w11 = w12*(SQRT3 + 2); const double w13 = w12*(-4*SQRT3 + 7); const double w14 = w12*(4*SQRT3 + 7); const double w7 = m_dx[0]*m_dx[2]/144; const double w5 = w7*(-SQRT3 + 2); const double w6 = w7*(SQRT3 + 2); const double w8 = w7*(-4*SQRT3 + 7); const double w9 = w7*(4*SQRT3 + 7); const double w2 = m_dx[1]*m_dx[2]/144; const double w0 = w2*(-SQRT3 + 2); const double w1 = w2*(SQRT3 + 2); const double w3 = w2*(-4*SQRT3 + 7); const double w4 = w2*(4*SQRT3 + 7); const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = !d.isEmpty(); const bool add_EM_F = !y.isEmpty(); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8); vector<Scalar> EM_F(8); if (domain->m_faceOffset[0] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[1] = zero; EM_F[3] = zero; EM_F[5] = zero; EM_F[7] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w0*(d_0 + d_1); const Scalar tmp1 = w1*(d_2 + d_3); const Scalar tmp2 = w0*(d_0 + d_2); const Scalar tmp3 = w1*(d_1 + d_3); const Scalar tmp4 = w0*(d_1 + d_3); const Scalar tmp5 = w1*(d_0 + d_2); const Scalar tmp6 = w0*(d_2 + d_3); const Scalar tmp7 = w1*(d_0 + d_1); const Scalar tmp8 = w2*(d_0 + d_3); const Scalar tmp9 = w2*(d_1 + d_2); const Scalar tmp10 = w2*(d_0 + d_1 + d_2 + d_3); EM_S[INDEX2(0,0,8)] = d_0*w4 + d_3*w3 + tmp9; EM_S[INDEX2(2,0,8)] = tmp6 + tmp7; EM_S[INDEX2(4,0,8)] = tmp4 + tmp5; EM_S[INDEX2(6,0,8)] = tmp10; EM_S[INDEX2(0,2,8)] = tmp6 + tmp7; EM_S[INDEX2(2,2,8)] = d_1*w4 + d_2*w3 + tmp8; EM_S[INDEX2(4,2,8)] = tmp10; EM_S[INDEX2(6,2,8)] = tmp2 + tmp3; EM_S[INDEX2(0,4,8)] = tmp4 + tmp5; EM_S[INDEX2(2,4,8)] = tmp10; EM_S[INDEX2(4,4,8)] = d_1*w3 + d_2*w4 + tmp8; EM_S[INDEX2(6,4,8)] = tmp0 + tmp1; EM_S[INDEX2(0,6,8)] = tmp10; EM_S[INDEX2(2,6,8)] = tmp2 + tmp3; EM_S[INDEX2(4,6,8)] = tmp0 + tmp1; EM_S[INDEX2(6,6,8)] = d_0*w3 + d_3*w4 + tmp9; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w2; EM_S[INDEX2(0,0,8)] = 4.*wd0; EM_S[INDEX2(2,0,8)] = 2.*wd0; EM_S[INDEX2(4,0,8)] = 2.*wd0; EM_S[INDEX2(6,0,8)] = wd0; EM_S[INDEX2(0,2,8)] = 2.*wd0; EM_S[INDEX2(2,2,8)] = 4.*wd0; EM_S[INDEX2(4,2,8)] = wd0; EM_S[INDEX2(6,2,8)] = 2.*wd0; EM_S[INDEX2(0,4,8)] = 2.*wd0; EM_S[INDEX2(2,4,8)] = wd0; EM_S[INDEX2(4,4,8)] = 4.*wd0; EM_S[INDEX2(6,4,8)] = 2.*wd0; EM_S[INDEX2(0,6,8)] = wd0; EM_S[INDEX2(2,6,8)] = 2.*wd0; EM_S[INDEX2(4,6,8)] = 2.*wd0; EM_S[INDEX2(6,6,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w2*(y_1 + y_2); const Scalar tmp1 = 6.*w2*(y_0 + y_3); EM_F[0] = tmp0 + 6.*w0*y_3 + 6.*w1*y_0; EM_F[2] = tmp1 + 6.*w0*y_2 + 6.*w1*y_1; EM_F[4] = tmp1 + 6.*w0*y_1 + 6.*w1*y_2; EM_F[6] = tmp0 + 6.*w0*y_0 + 6.*w1*y_3; } else { // constant data EM_F[0] = 36.*w2*y_p[0]; EM_F[2] = 36.*w2*y_p[0]; EM_F[4] = 36.*w2*y_p[0]; EM_F[6] = 36.*w2*y_p[0]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k1 loop } // k2 loop } // colouring } // face 0 if (domain->m_faceOffset[1] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[2] = zero; EM_F[4] = zero; EM_F[6] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = domain->m_faceOffset[1]+INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w0*(d_0 + d_2); const Scalar tmp1 = w1*(d_1 + d_3); const Scalar tmp2 = w0*(d_2 + d_3); const Scalar tmp3 = w1*(d_0 + d_1); const Scalar tmp4 = w0*(d_1 + d_3); const Scalar tmp5 = w1*(d_0 + d_2); const Scalar tmp6 = w2*(d_0 + d_3); const Scalar tmp7 = w2*(d_1 + d_2); const Scalar tmp8 = w0*(d_0 + d_1); const Scalar tmp9 = w1*(d_2 + d_3); const Scalar tmp10 = w2*(d_0 + d_1 + d_2 + d_3); EM_S[INDEX2(1,1,8)] = d_0*w4 + d_3*w3 + tmp7; EM_S[INDEX2(3,1,8)] = tmp2 + tmp3; EM_S[INDEX2(5,1,8)] = tmp4 + tmp5; EM_S[INDEX2(7,1,8)] = tmp10; EM_S[INDEX2(1,3,8)] = tmp2 + tmp3; EM_S[INDEX2(3,3,8)] = d_1*w4 + d_2*w3 + tmp6; EM_S[INDEX2(5,3,8)] = tmp10; EM_S[INDEX2(7,3,8)] = tmp0 + tmp1; EM_S[INDEX2(1,5,8)] = tmp4 + tmp5; EM_S[INDEX2(3,5,8)] = tmp10; EM_S[INDEX2(5,5,8)] = d_1*w3 + d_2*w4 + tmp6; EM_S[INDEX2(7,5,8)] = tmp8 + tmp9; EM_S[INDEX2(1,7,8)] = tmp10; EM_S[INDEX2(3,7,8)] = tmp0 + tmp1; EM_S[INDEX2(5,7,8)] = tmp8 + tmp9; EM_S[INDEX2(7,7,8)] = d_0*w3 + d_3*w4 + tmp7; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w2; EM_S[INDEX2(1,1,8)] = 4.*wd0; EM_S[INDEX2(3,1,8)] = 2.*wd0; EM_S[INDEX2(5,1,8)] = 2.*wd0; EM_S[INDEX2(7,1,8)] = wd0; EM_S[INDEX2(1,3,8)] = 2.*wd0; EM_S[INDEX2(3,3,8)] = 4.*wd0; EM_S[INDEX2(5,3,8)] = wd0; EM_S[INDEX2(7,3,8)] = 2.*wd0; EM_S[INDEX2(1,5,8)] = 2.*wd0; EM_S[INDEX2(3,5,8)] = wd0; EM_S[INDEX2(5,5,8)] = 4.*wd0; EM_S[INDEX2(7,5,8)] = 2.*wd0; EM_S[INDEX2(1,7,8)] = wd0; EM_S[INDEX2(3,7,8)] = 2.*wd0; EM_S[INDEX2(5,7,8)] = 2.*wd0; EM_S[INDEX2(7,7,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w2*(y_1 + y_2); const Scalar tmp1 = 6.*w2*(y_0 + y_3); EM_F[1] = tmp0 + 6.*w0*y_3 + 6.*w1*y_0; EM_F[3] = tmp1 + 6.*w0*y_2 + 6.*w1*y_1; EM_F[5] = tmp1 + 6.*w0*y_1 + 6.*w1*y_2; EM_F[7] = tmp0 + 6.*w0*y_0 + 6.*w1*y_3; } else { // constant data EM_F[1] = 36.*w2*y_p[0]; EM_F[3] = 36.*w2*y_p[0]; EM_F[5] = 36.*w2*y_p[0]; EM_F[7] = 36.*w2*y_p[0]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(k1+1)-2; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k1 loop } // k2 loop } // colouring } // face 1 if (domain->m_faceOffset[2] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[2] = zero; EM_F[3] = zero; EM_F[6] = zero; EM_F[7] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[2]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w5*(d_0 + d_1); const Scalar tmp1 = w6*(d_2 + d_3); const Scalar tmp2 = w5*(d_0 + d_2); const Scalar tmp3 = w6*(d_1 + d_3); const Scalar tmp4 = w5*(d_1 + d_3); const Scalar tmp5 = w6*(d_0 + d_2); const Scalar tmp6 = w7*(d_0 + d_3); const Scalar tmp7 = w7*(d_0 + d_1 + d_2 + d_3); const Scalar tmp8 = w7*(d_1 + d_2); const Scalar tmp9 = w5*(d_2 + d_3); const Scalar tmp10 = w6*(d_0 + d_1); EM_S[INDEX2(0,0,8)] = d_0*w9 + d_3*w8 + tmp8; EM_S[INDEX2(1,0,8)] = tmp10 + tmp9; EM_S[INDEX2(4,0,8)] = tmp4 + tmp5; EM_S[INDEX2(5,0,8)] = tmp7; EM_S[INDEX2(0,1,8)] = tmp10 + tmp9; EM_S[INDEX2(1,1,8)] = d_1*w9 + d_2*w8 + tmp6; EM_S[INDEX2(4,1,8)] = tmp7; EM_S[INDEX2(5,1,8)] = tmp2 + tmp3; EM_S[INDEX2(0,4,8)] = tmp4 + tmp5; EM_S[INDEX2(1,4,8)] = tmp7; EM_S[INDEX2(4,4,8)] = d_1*w8 + d_2*w9 + tmp6; EM_S[INDEX2(5,4,8)] = tmp0 + tmp1; EM_S[INDEX2(0,5,8)] = tmp7; EM_S[INDEX2(1,5,8)] = tmp2 + tmp3; EM_S[INDEX2(4,5,8)] = tmp0 + tmp1; EM_S[INDEX2(5,5,8)] = d_0*w8 + d_3*w9 + tmp8; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w7; EM_S[INDEX2(0,0,8)] = 4.*wd0; EM_S[INDEX2(1,0,8)] = 2.*wd0; EM_S[INDEX2(4,0,8)] = 2.*wd0; EM_S[INDEX2(5,0,8)] = wd0; EM_S[INDEX2(0,1,8)] = 2.*wd0; EM_S[INDEX2(1,1,8)] = 4.*wd0; EM_S[INDEX2(4,1,8)] = wd0; EM_S[INDEX2(5,1,8)] = 2.*wd0; EM_S[INDEX2(0,4,8)] = 2.*wd0; EM_S[INDEX2(1,4,8)] = wd0; EM_S[INDEX2(4,4,8)] = 4.*wd0; EM_S[INDEX2(5,4,8)] = 2.*wd0; EM_S[INDEX2(0,5,8)] = wd0; EM_S[INDEX2(1,5,8)] = 2.*wd0; EM_S[INDEX2(4,5,8)] = 2.*wd0; EM_S[INDEX2(5,5,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w7*(y_1 + y_2); const Scalar tmp1 = 6.*w7*(y_0 + y_3); EM_F[0] = tmp0 + 6.*w5*y_3 + 6.*w6*y_0; EM_F[1] = tmp1 + 6.*w5*y_2 + 6.*w6*y_1; EM_F[4] = tmp1 + 6.*w5*y_1 + 6.*w6*y_2; EM_F[5] = tmp0 + 6.*w5*y_0 + 6.*w6*y_3; } else { // constant data EM_F[0] = 36.*w7*y_p[0]; EM_F[1] = 36.*w7*y_p[0]; EM_F[4] = 36.*w7*y_p[0]; EM_F[5] = 36.*w7*y_p[0]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k2 loop } // colouring } // face 2 if (domain->m_faceOffset[3] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[1] = zero; EM_F[4] = zero; EM_F[5] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[3]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w5*(d_0 + d_2); const Scalar tmp1 = w6*(d_1 + d_3); const Scalar tmp2 = w5*(d_1 + d_3); const Scalar tmp3 = w6*(d_0 + d_2); const Scalar tmp4 = w7*(d_0 + d_1 + d_2 + d_3); const Scalar tmp5 = w5*(d_0 + d_1); const Scalar tmp6 = w6*(d_2 + d_3); const Scalar tmp7 = w7*(d_0 + d_3); const Scalar tmp8 = w7*(d_1 + d_2); const Scalar tmp9 = w5*(d_2 + d_3); const Scalar tmp10 = w6*(d_0 + d_1); EM_S[INDEX2(2,2,8)] = d_0*w9 + d_3*w8 + tmp8; EM_S[INDEX2(3,2,8)] = tmp10 + tmp9; EM_S[INDEX2(6,2,8)] = tmp2 + tmp3; EM_S[INDEX2(7,2,8)] = tmp4; EM_S[INDEX2(2,3,8)] = tmp10 + tmp9; EM_S[INDEX2(3,3,8)] = d_1*w9 + d_2*w8 + tmp7; EM_S[INDEX2(6,3,8)] = tmp4; EM_S[INDEX2(7,3,8)] = tmp0 + tmp1; EM_S[INDEX2(2,6,8)] = tmp2 + tmp3; EM_S[INDEX2(3,6,8)] = tmp4; EM_S[INDEX2(6,6,8)] = d_1*w8 + d_2*w9 + tmp7; EM_S[INDEX2(7,6,8)] = tmp5 + tmp6; EM_S[INDEX2(2,7,8)] = tmp4; EM_S[INDEX2(3,7,8)] = tmp0 + tmp1; EM_S[INDEX2(6,7,8)] = tmp5 + tmp6; EM_S[INDEX2(7,7,8)] = d_0*w8 + d_3*w9 + tmp8; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w7; EM_S[INDEX2(2,2,8)] = 4.*wd0; EM_S[INDEX2(3,2,8)] = 2.*wd0; EM_S[INDEX2(6,2,8)] = 2.*wd0; EM_S[INDEX2(7,2,8)] = wd0; EM_S[INDEX2(2,3,8)] = 2.*wd0; EM_S[INDEX2(3,3,8)] = 4.*wd0; EM_S[INDEX2(6,3,8)] = wd0; EM_S[INDEX2(7,3,8)] = 2.*wd0; EM_S[INDEX2(2,6,8)] = 2.*wd0; EM_S[INDEX2(3,6,8)] = wd0; EM_S[INDEX2(6,6,8)] = 4.*wd0; EM_S[INDEX2(7,6,8)] = 2.*wd0; EM_S[INDEX2(2,7,8)] = wd0; EM_S[INDEX2(3,7,8)] = 2.*wd0; EM_S[INDEX2(6,7,8)] = 2.*wd0; EM_S[INDEX2(7,7,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w7*(y_1 + y_2); const Scalar tmp1 = 6.*w7*(y_0 + y_3); EM_F[2] = tmp0 + 6.*w5*y_3 + 6.*w6*y_0; EM_F[3] = tmp1 + 6.*w5*y_2 + 6.*w6*y_1; EM_F[6] = tmp1 + 6.*w5*y_1 + 6.*w6*y_2; EM_F[7] = tmp0 + 6.*w5*y_0 + 6.*w6*y_3; } else { // constant data EM_F[2] = 36.*w7*y_p[0]; EM_F[3] = 36.*w7*y_p[0]; EM_F[6] = 36.*w7*y_p[0]; EM_F[7] = 36.*w7*y_p[0]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(m_NN[1]-2)+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k2 loop } // colouring } // face 3 if (domain->m_faceOffset[4] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[4] = zero; EM_F[5] = zero; EM_F[6] = zero; EM_F[7] = zero; } for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[4]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w10*(d_0 + d_2); const Scalar tmp1 = w11*(d_1 + d_3); const Scalar tmp2 = w12*(d_0 + d_1 + d_2 + d_3); const Scalar tmp3 = w12*(d_1 + d_2); const Scalar tmp4 = w10*(d_1 + d_3); const Scalar tmp5 = w11*(d_0 + d_2); const Scalar tmp6 = w12*(d_0 + d_3); const Scalar tmp7 = w10*(d_0 + d_1); const Scalar tmp8 = w11*(d_2 + d_3); const Scalar tmp9 = w10*(d_2 + d_3); const Scalar tmp10 = w11*(d_0 + d_1); EM_S[INDEX2(0,0,8)] = d_0*w14 + d_3*w13 + tmp3; EM_S[INDEX2(1,0,8)] = tmp10 + tmp9; EM_S[INDEX2(2,0,8)] = tmp4 + tmp5; EM_S[INDEX2(3,0,8)] = tmp2; EM_S[INDEX2(0,1,8)] = tmp10 + tmp9; EM_S[INDEX2(1,1,8)] = d_1*w14 + d_2*w13 + tmp6; EM_S[INDEX2(2,1,8)] = tmp2; EM_S[INDEX2(3,1,8)] = tmp0 + tmp1; EM_S[INDEX2(0,2,8)] = tmp4 + tmp5; EM_S[INDEX2(1,2,8)] = tmp2; EM_S[INDEX2(2,2,8)] = d_1*w13 + d_2*w14 + tmp6; EM_S[INDEX2(3,2,8)] = tmp7 + tmp8; EM_S[INDEX2(0,3,8)] = tmp2; EM_S[INDEX2(1,3,8)] = tmp0 + tmp1; EM_S[INDEX2(2,3,8)] = tmp7 + tmp8; EM_S[INDEX2(3,3,8)] = d_0*w13 + d_3*w14 + tmp3; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w12; EM_S[INDEX2(0,0,8)] = 4.*wd0; EM_S[INDEX2(1,0,8)] = 2.*wd0; EM_S[INDEX2(2,0,8)] = 2.*wd0; EM_S[INDEX2(3,0,8)] = wd0; EM_S[INDEX2(0,1,8)] = 2.*wd0; EM_S[INDEX2(1,1,8)] = 4.*wd0; EM_S[INDEX2(2,1,8)] = wd0; EM_S[INDEX2(3,1,8)] = 2.*wd0; EM_S[INDEX2(0,2,8)] = 2.*wd0; EM_S[INDEX2(1,2,8)] = wd0; EM_S[INDEX2(2,2,8)] = 4.*wd0; EM_S[INDEX2(3,2,8)] = 2.*wd0; EM_S[INDEX2(0,3,8)] = wd0; EM_S[INDEX2(1,3,8)] = 2.*wd0; EM_S[INDEX2(2,3,8)] = 2.*wd0; EM_S[INDEX2(3,3,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w12*(y_1 + y_2); const Scalar tmp1 = 6.*w12*(y_0 + y_3); EM_F[0] = tmp0 + 6.*w10*y_3 + 6.*w11*y_0; EM_F[1] = tmp1 + 6.*w10*y_2 + 6.*w11*y_1; EM_F[2] = tmp1 + 6.*w10*y_1 + 6.*w11*y_2; EM_F[3] = tmp0 + 6.*w10*y_0 + 6.*w11*y_3; } else { // constant data EM_F[0] = 36.*w12*y_p[0]; EM_F[1] = 36.*w12*y_p[0]; EM_F[2] = 36.*w12*y_p[0]; EM_F[3] = 36.*w12*y_p[0]; } } const index_t firstNode=m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k1 loop } // colouring } // face 4 if (domain->m_faceOffset[5] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[1] = zero; EM_F[2] = zero; EM_F[3] = zero; } for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[5]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { const Scalar d_0 = d_p[0]; const Scalar d_1 = d_p[1]; const Scalar d_2 = d_p[2]; const Scalar d_3 = d_p[3]; const Scalar tmp0 = w12*(d_0 + d_1 + d_2 + d_3); const Scalar tmp1 = w10*(d_1 + d_3); const Scalar tmp2 = w11*(d_0 + d_2); const Scalar tmp3 = w10*(d_2 + d_3); const Scalar tmp4 = w11*(d_0 + d_1); const Scalar tmp5 = w10*(d_0 + d_1); const Scalar tmp6 = w11*(d_2 + d_3); const Scalar tmp7 = w12*(d_1 + d_2); const Scalar tmp8 = w10*(d_0 + d_2); const Scalar tmp9 = w11*(d_1 + d_3); const Scalar tmp10 = w12*(d_0 + d_3); EM_S[INDEX2(4,4,8)] = d_0*w14 + d_3*w13 + tmp7; EM_S[INDEX2(5,4,8)] = tmp3 + tmp4; EM_S[INDEX2(6,4,8)] = tmp1 + tmp2; EM_S[INDEX2(7,4,8)] = tmp0; EM_S[INDEX2(4,5,8)] = tmp3 + tmp4; EM_S[INDEX2(5,5,8)] = d_1*w14 + d_2*w13 + tmp10; EM_S[INDEX2(6,5,8)] = tmp0; EM_S[INDEX2(7,5,8)] = tmp8 + tmp9; EM_S[INDEX2(4,6,8)] = tmp1 + tmp2; EM_S[INDEX2(5,6,8)] = tmp0; EM_S[INDEX2(6,6,8)] = d_1*w13 + d_2*w14 + tmp10; EM_S[INDEX2(7,6,8)] = tmp5 + tmp6; EM_S[INDEX2(4,7,8)] = tmp0; EM_S[INDEX2(5,7,8)] = tmp8 + tmp9; EM_S[INDEX2(6,7,8)] = tmp5 + tmp6; EM_S[INDEX2(7,7,8)] = d_0*w13 + d_3*w14 + tmp7; } else { // constant data const Scalar wd0 = 4.*d_p[0]*w12; EM_S[INDEX2(4,4,8)] = 4.*wd0; EM_S[INDEX2(5,4,8)] = 2.*wd0; EM_S[INDEX2(6,4,8)] = 2.*wd0; EM_S[INDEX2(7,4,8)] = wd0; EM_S[INDEX2(4,5,8)] = 2.*wd0; EM_S[INDEX2(5,5,8)] = 4.*wd0; EM_S[INDEX2(6,5,8)] = wd0; EM_S[INDEX2(7,5,8)] = 2.*wd0; EM_S[INDEX2(4,6,8)] = 2.*wd0; EM_S[INDEX2(5,6,8)] = wd0; EM_S[INDEX2(6,6,8)] = 4.*wd0; EM_S[INDEX2(7,6,8)] = 2.*wd0; EM_S[INDEX2(4,7,8)] = wd0; EM_S[INDEX2(5,7,8)] = 2.*wd0; EM_S[INDEX2(6,7,8)] = 2.*wd0; EM_S[INDEX2(7,7,8)] = 4.*wd0; } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { const Scalar y_0 = y_p[0]; const Scalar y_1 = y_p[1]; const Scalar y_2 = y_p[2]; const Scalar y_3 = y_p[3]; const Scalar tmp0 = 6.*w12*(y_1 + y_2); const Scalar tmp1 = 6.*w12*(y_0 + y_3); EM_F[4] = tmp0 + 6.*w10*y_3 + 6.*w11*y_0; EM_F[5] = tmp1 + 6.*w10*y_2 + 6.*w11*y_1; EM_F[6] = tmp1 + 6.*w10*y_1 + 6.*w11*y_2; EM_F[7] = tmp0 + 6.*w10*y_0 + 6.*w11*y_3; } else { // constant data EM_F[4] = 36.*w12*y_p[0]; EM_F[5] = 36.*w12*y_p[0]; EM_F[6] = 36.*w12*y_p[0]; EM_F[7] = 36.*w12*y_p[0]; } } const index_t firstNode=m_NN[0]*m_NN[1]*(m_NN[2]-2)+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k1 loop } // colouring } // face 5 } // end of parallel region } /****************************************************************************/ // PDE SINGLE REDUCED /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESingleReduced( AbstractSystemMatrix* mat, Data& rhs, const Data& A, const Data& B, const Data& C, const Data& D, const Data& X, const Data& Y) const { const double w6 = m_dx[0]/16; const double w5 = m_dx[1]/16; const double w1 = m_dx[2]/16; const double w14 = m_dx[0]*m_dx[1]/32; const double w13 = m_dx[0]*m_dx[2]/32; const double w12 = m_dx[1]*m_dx[2]/32; const double w18 = m_dx[0]*m_dx[1]*m_dx[2]/64; const double w11 = m_dx[0]*m_dx[1]/(16*m_dx[2]); const double w3 = m_dx[0]*m_dx[2]/(16*m_dx[1]); const double w0 = m_dx[1]*m_dx[2]/(16*m_dx[0]); const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = (!A.isEmpty() || !B.isEmpty() || !C.isEmpty() || !D.isEmpty()); const bool add_EM_F = (!X.isEmpty() || !Y.isEmpty()); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8, zero); vector<Scalar> EM_F(8, zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = k0 + NE0*k1 + NE0*NE1*k2; if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); /////////////// // process A // /////////////// if (!A.isEmpty()) { const Scalar* A_p = A.getSampleDataRO(e, zero); const Scalar Aw00 = A_p[INDEX2(0,0,3)]*w0; const Scalar Aw10 = A_p[INDEX2(1,0,3)]*w1; const Scalar Aw20 = A_p[INDEX2(2,0,3)]*w5; const Scalar Aw01 = A_p[INDEX2(0,1,3)]*w1; const Scalar Aw11 = A_p[INDEX2(1,1,3)]*w3; const Scalar Aw21 = A_p[INDEX2(2,1,3)]*w6; const Scalar Aw02 = A_p[INDEX2(0,2,3)]*w5; const Scalar Aw12 = A_p[INDEX2(1,2,3)]*w6; const Scalar Aw22 = A_p[INDEX2(2,2,3)]*w11; EM_S[INDEX2(0,0,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(1,0,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(2,0,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(3,0,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(4,0,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(5,0,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(6,0,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(7,0,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(0,1,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(1,1,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(2,1,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(3,1,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(4,1,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(5,1,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(6,1,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(7,1,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(0,2,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(1,2,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(2,2,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(3,2,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(4,2,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(5,2,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(6,2,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(7,2,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(0,3,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(1,3,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(2,3,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(3,3,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(4,3,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(5,3,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(6,3,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(7,3,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(0,4,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(1,4,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(2,4,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(3,4,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX2(4,4,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(5,4,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(6,4,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(7,4,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX2(0,5,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(1,5,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(2,5,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(3,5,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX2(4,5,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(5,5,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(6,5,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(7,5,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX2(0,6,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(1,6,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(2,6,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(3,6,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX2(4,6,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(5,6,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(6,6,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(7,6,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX2(0,7,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(1,7,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(2,7,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(3,7,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX2(4,7,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(5,7,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(6,7,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX2(7,7,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; } /////////////// // process B // /////////////// if (!B.isEmpty()) { const Scalar* B_p = B.getSampleDataRO(e, zero); const Scalar wB0 = B_p[0]*w12; const Scalar wB1 = B_p[1]*w13; const Scalar wB2 = B_p[2]*w14; EM_S[INDEX2(0,0,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,0,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,0,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,0,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,0,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,0,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,0,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,0,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,1,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,1,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,1,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,1,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,1,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,1,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,1,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,1,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,2,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,2,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,2,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,2,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,2,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,2,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,2,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,2,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,3,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,3,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,3,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,3,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,3,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,3,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,3,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,3,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,4,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,4,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,4,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,4,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,4,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,4,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,4,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,4,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,5,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,5,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,5,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,5,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,5,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,5,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,5,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,5,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,6,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,6,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,6,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,6,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,6,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,6,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,6,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,6,8)]+= wB0 + wB1 + wB2; EM_S[INDEX2(0,7,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX2(1,7,8)]+= wB0 - wB1 - wB2; EM_S[INDEX2(2,7,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX2(3,7,8)]+= wB0 + wB1 - wB2; EM_S[INDEX2(4,7,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX2(5,7,8)]+= wB0 - wB1 + wB2; EM_S[INDEX2(6,7,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX2(7,7,8)]+= wB0 + wB1 + wB2; } /////////////// // process C // /////////////// if (!C.isEmpty()) { const Scalar* C_p = C.getSampleDataRO(e, zero); const Scalar wC0 = C_p[0]*w12; const Scalar wC1 = C_p[1]*w13; const Scalar wC2 = C_p[2]*w14; EM_S[INDEX2(0,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(1,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(2,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(3,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(4,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(5,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(6,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(7,0,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX2(0,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(1,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(2,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(3,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(4,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(5,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(6,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(7,1,8)]+= wC0 - wC1 - wC2; EM_S[INDEX2(0,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(1,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(2,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(3,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(4,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(5,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(6,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(7,2,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX2(0,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(1,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(2,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(3,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(4,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(5,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(6,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(7,3,8)]+= wC0 + wC1 - wC2; EM_S[INDEX2(0,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(1,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(2,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(3,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(4,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(5,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(6,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(7,4,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX2(0,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(1,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(2,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(3,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(4,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(5,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(6,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(7,5,8)]+= wC0 - wC1 + wC2; EM_S[INDEX2(0,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(1,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(2,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(3,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(4,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(5,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(6,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(7,6,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX2(0,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(1,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(2,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(3,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(4,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(5,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(6,7,8)]+= wC0 + wC1 + wC2; EM_S[INDEX2(7,7,8)]+= wC0 + wC1 + wC2; } /////////////// // process D // /////////////// if (!D.isEmpty()) { const Scalar* D_p = D.getSampleDataRO(e, zero); EM_S[INDEX2(0,0,8)]+=D_p[0]*w18; EM_S[INDEX2(1,0,8)]+=D_p[0]*w18; EM_S[INDEX2(2,0,8)]+=D_p[0]*w18; EM_S[INDEX2(3,0,8)]+=D_p[0]*w18; EM_S[INDEX2(4,0,8)]+=D_p[0]*w18; EM_S[INDEX2(5,0,8)]+=D_p[0]*w18; EM_S[INDEX2(6,0,8)]+=D_p[0]*w18; EM_S[INDEX2(7,0,8)]+=D_p[0]*w18; EM_S[INDEX2(0,1,8)]+=D_p[0]*w18; EM_S[INDEX2(1,1,8)]+=D_p[0]*w18; EM_S[INDEX2(2,1,8)]+=D_p[0]*w18; EM_S[INDEX2(3,1,8)]+=D_p[0]*w18; EM_S[INDEX2(4,1,8)]+=D_p[0]*w18; EM_S[INDEX2(5,1,8)]+=D_p[0]*w18; EM_S[INDEX2(6,1,8)]+=D_p[0]*w18; EM_S[INDEX2(7,1,8)]+=D_p[0]*w18; EM_S[INDEX2(0,2,8)]+=D_p[0]*w18; EM_S[INDEX2(1,2,8)]+=D_p[0]*w18; EM_S[INDEX2(2,2,8)]+=D_p[0]*w18; EM_S[INDEX2(3,2,8)]+=D_p[0]*w18; EM_S[INDEX2(4,2,8)]+=D_p[0]*w18; EM_S[INDEX2(5,2,8)]+=D_p[0]*w18; EM_S[INDEX2(6,2,8)]+=D_p[0]*w18; EM_S[INDEX2(7,2,8)]+=D_p[0]*w18; EM_S[INDEX2(0,3,8)]+=D_p[0]*w18; EM_S[INDEX2(1,3,8)]+=D_p[0]*w18; EM_S[INDEX2(2,3,8)]+=D_p[0]*w18; EM_S[INDEX2(3,3,8)]+=D_p[0]*w18; EM_S[INDEX2(4,3,8)]+=D_p[0]*w18; EM_S[INDEX2(5,3,8)]+=D_p[0]*w18; EM_S[INDEX2(6,3,8)]+=D_p[0]*w18; EM_S[INDEX2(7,3,8)]+=D_p[0]*w18; EM_S[INDEX2(0,4,8)]+=D_p[0]*w18; EM_S[INDEX2(1,4,8)]+=D_p[0]*w18; EM_S[INDEX2(2,4,8)]+=D_p[0]*w18; EM_S[INDEX2(3,4,8)]+=D_p[0]*w18; EM_S[INDEX2(4,4,8)]+=D_p[0]*w18; EM_S[INDEX2(5,4,8)]+=D_p[0]*w18; EM_S[INDEX2(6,4,8)]+=D_p[0]*w18; EM_S[INDEX2(7,4,8)]+=D_p[0]*w18; EM_S[INDEX2(0,5,8)]+=D_p[0]*w18; EM_S[INDEX2(1,5,8)]+=D_p[0]*w18; EM_S[INDEX2(2,5,8)]+=D_p[0]*w18; EM_S[INDEX2(3,5,8)]+=D_p[0]*w18; EM_S[INDEX2(4,5,8)]+=D_p[0]*w18; EM_S[INDEX2(5,5,8)]+=D_p[0]*w18; EM_S[INDEX2(6,5,8)]+=D_p[0]*w18; EM_S[INDEX2(7,5,8)]+=D_p[0]*w18; EM_S[INDEX2(0,6,8)]+=D_p[0]*w18; EM_S[INDEX2(1,6,8)]+=D_p[0]*w18; EM_S[INDEX2(2,6,8)]+=D_p[0]*w18; EM_S[INDEX2(3,6,8)]+=D_p[0]*w18; EM_S[INDEX2(4,6,8)]+=D_p[0]*w18; EM_S[INDEX2(5,6,8)]+=D_p[0]*w18; EM_S[INDEX2(6,6,8)]+=D_p[0]*w18; EM_S[INDEX2(7,6,8)]+=D_p[0]*w18; EM_S[INDEX2(0,7,8)]+=D_p[0]*w18; EM_S[INDEX2(1,7,8)]+=D_p[0]*w18; EM_S[INDEX2(2,7,8)]+=D_p[0]*w18; EM_S[INDEX2(3,7,8)]+=D_p[0]*w18; EM_S[INDEX2(4,7,8)]+=D_p[0]*w18; EM_S[INDEX2(5,7,8)]+=D_p[0]*w18; EM_S[INDEX2(6,7,8)]+=D_p[0]*w18; EM_S[INDEX2(7,7,8)]+=D_p[0]*w18; } /////////////// // process X // /////////////// if (!X.isEmpty()) { const Scalar* X_p = X.getSampleDataRO(e, zero); const Scalar wX0 = 8.*X_p[0]*w12; const Scalar wX1 = 8.*X_p[1]*w13; const Scalar wX2 = 8.*X_p[2]*w14; EM_F[0]+=-wX0 - wX1 - wX2; EM_F[1]+= wX0 - wX1 - wX2; EM_F[2]+=-wX0 + wX1 - wX2; EM_F[3]+= wX0 + wX1 - wX2; EM_F[4]+=-wX0 - wX1 + wX2; EM_F[5]+= wX0 - wX1 + wX2; EM_F[6]+=-wX0 + wX1 + wX2; EM_F[7]+= wX0 + wX1 + wX2; } /////////////// // process Y // /////////////// if (!Y.isEmpty()) { const Scalar* Y_p = Y.getSampleDataRO(e, zero); EM_F[0]+=8.*Y_p[0]*w18; EM_F[1]+=8.*Y_p[0]*w18; EM_F[2]+=8.*Y_p[0]*w18; EM_F[3]+=8.*Y_p[0]*w18; EM_F[4]+=8.*Y_p[0]*w18; EM_F[5]+=8.*Y_p[0]*w18; EM_F[6]+=8.*Y_p[0]*w18; EM_F[7]+=8.*Y_p[0]*w18; } // add to matrix (if add_EM_S) and RHS (if add_EM_F) const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // end k0 loop } // end k1 loop } // end k2 loop } // end of colouring } // end of parallel region } /****************************************************************************/ // PDE SINGLE REDUCED BOUNDARY /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySingleReduced( AbstractSystemMatrix* mat, Data& rhs, const Data& d, const Data& y) const { const double w0 = m_dx[0]*m_dx[1]/16; const double w1 = m_dx[0]*m_dx[2]/16; const double w2 = m_dx[1]*m_dx[2]/16; const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = !d.isEmpty(); const bool add_EM_F = !y.isEmpty(); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8); vector<Scalar> EM_F(8); if (domain->m_faceOffset[0] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[1] = zero; EM_F[3] = zero; EM_F[5] = zero; EM_F[7] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(0,0,8)] = d_p[0]*w2; EM_S[INDEX2(2,0,8)] = d_p[0]*w2; EM_S[INDEX2(4,0,8)] = d_p[0]*w2; EM_S[INDEX2(6,0,8)] = d_p[0]*w2; EM_S[INDEX2(0,2,8)] = d_p[0]*w2; EM_S[INDEX2(2,2,8)] = d_p[0]*w2; EM_S[INDEX2(4,2,8)] = d_p[0]*w2; EM_S[INDEX2(6,2,8)] = d_p[0]*w2; EM_S[INDEX2(0,4,8)] = d_p[0]*w2; EM_S[INDEX2(2,4,8)] = d_p[0]*w2; EM_S[INDEX2(4,4,8)] = d_p[0]*w2; EM_S[INDEX2(6,4,8)] = d_p[0]*w2; EM_S[INDEX2(0,6,8)] = d_p[0]*w2; EM_S[INDEX2(2,6,8)] = d_p[0]*w2; EM_S[INDEX2(4,6,8)] = d_p[0]*w2; EM_S[INDEX2(6,6,8)] = d_p[0]*w2; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[0] = 4.*w2*y_p[0]; EM_F[2] = 4.*w2*y_p[0]; EM_F[4] = 4.*w2*y_p[0]; EM_F[6] = 4.*w2*y_p[0]; } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k1 loop } // k2 loop } // colouring } // face 0 if (domain->m_faceOffset[1] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[2] = zero; EM_F[4] = zero; EM_F[6] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = domain->m_faceOffset[1]+INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(1,1,8)] = d_p[0]*w2; EM_S[INDEX2(3,1,8)] = d_p[0]*w2; EM_S[INDEX2(5,1,8)] = d_p[0]*w2; EM_S[INDEX2(7,1,8)] = d_p[0]*w2; EM_S[INDEX2(1,3,8)] = d_p[0]*w2; EM_S[INDEX2(3,3,8)] = d_p[0]*w2; EM_S[INDEX2(5,3,8)] = d_p[0]*w2; EM_S[INDEX2(7,3,8)] = d_p[0]*w2; EM_S[INDEX2(1,5,8)] = d_p[0]*w2; EM_S[INDEX2(3,5,8)] = d_p[0]*w2; EM_S[INDEX2(5,5,8)] = d_p[0]*w2; EM_S[INDEX2(7,5,8)] = d_p[0]*w2; EM_S[INDEX2(1,7,8)] = d_p[0]*w2; EM_S[INDEX2(3,7,8)] = d_p[0]*w2; EM_S[INDEX2(5,7,8)] = d_p[0]*w2; EM_S[INDEX2(7,7,8)] = d_p[0]*w2; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[1] = 4.*w2*y_p[0]; EM_F[3] = 4.*w2*y_p[0]; EM_F[5] = 4.*w2*y_p[0]; EM_F[7] = 4.*w2*y_p[0]; } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(k1+1)-2; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k1 loop } // k2 loop } // colouring } // face 1 if (domain->m_faceOffset[2] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[2] = zero; EM_F[3] = zero; EM_F[6] = zero; EM_F[7] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[2]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(0,0,8)] = d_p[0]*w1; EM_S[INDEX2(1,0,8)] = d_p[0]*w1; EM_S[INDEX2(4,0,8)] = d_p[0]*w1; EM_S[INDEX2(5,0,8)] = d_p[0]*w1; EM_S[INDEX2(0,1,8)] = d_p[0]*w1; EM_S[INDEX2(1,1,8)] = d_p[0]*w1; EM_S[INDEX2(4,1,8)] = d_p[0]*w1; EM_S[INDEX2(5,1,8)] = d_p[0]*w1; EM_S[INDEX2(0,4,8)] = d_p[0]*w1; EM_S[INDEX2(1,4,8)] = d_p[0]*w1; EM_S[INDEX2(4,4,8)] = d_p[0]*w1; EM_S[INDEX2(5,4,8)] = d_p[0]*w1; EM_S[INDEX2(0,5,8)] = d_p[0]*w1; EM_S[INDEX2(1,5,8)] = d_p[0]*w1; EM_S[INDEX2(4,5,8)] = d_p[0]*w1; EM_S[INDEX2(5,5,8)] = d_p[0]*w1; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[0] = 4.*w1*y_p[0]; EM_F[1] = 4.*w1*y_p[0]; EM_F[4] = 4.*w1*y_p[0]; EM_F[5] = 4.*w1*y_p[0]; } const index_t firstNode=m_NN[0]*m_NN[1]*k2+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k2 loop } // colouring } // face 2 if (domain->m_faceOffset[3] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[1] = zero; EM_F[4] = zero; EM_F[5] = zero; } for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[3]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(2,2,8)] = d_p[0]*w1; EM_S[INDEX2(3,2,8)] = d_p[0]*w1; EM_S[INDEX2(6,2,8)] = d_p[0]*w1; EM_S[INDEX2(7,2,8)] = d_p[0]*w1; EM_S[INDEX2(2,3,8)] = d_p[0]*w1; EM_S[INDEX2(3,3,8)] = d_p[0]*w1; EM_S[INDEX2(6,3,8)] = d_p[0]*w1; EM_S[INDEX2(7,3,8)] = d_p[0]*w1; EM_S[INDEX2(2,6,8)] = d_p[0]*w1; EM_S[INDEX2(3,6,8)] = d_p[0]*w1; EM_S[INDEX2(6,6,8)] = d_p[0]*w1; EM_S[INDEX2(7,6,8)] = d_p[0]*w1; EM_S[INDEX2(2,7,8)] = d_p[0]*w1; EM_S[INDEX2(3,7,8)] = d_p[0]*w1; EM_S[INDEX2(6,7,8)] = d_p[0]*w1; EM_S[INDEX2(7,7,8)] = d_p[0]*w1; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[2] = 4.*w1*y_p[0]; EM_F[3] = 4.*w1*y_p[0]; EM_F[6] = 4.*w1*y_p[0]; EM_F[7] = 4.*w1*y_p[0]; } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(m_NN[1]-2)+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k2 loop } // colouring } // face 3 if (domain->m_faceOffset[4] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[4] = zero; EM_F[5] = zero; EM_F[6] = zero; EM_F[7] = zero; } for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[4]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(0,0,8)] = d_p[0]*w0; EM_S[INDEX2(1,0,8)] = d_p[0]*w0; EM_S[INDEX2(2,0,8)] = d_p[0]*w0; EM_S[INDEX2(3,0,8)] = d_p[0]*w0; EM_S[INDEX2(0,1,8)] = d_p[0]*w0; EM_S[INDEX2(1,1,8)] = d_p[0]*w0; EM_S[INDEX2(2,1,8)] = d_p[0]*w0; EM_S[INDEX2(3,1,8)] = d_p[0]*w0; EM_S[INDEX2(0,2,8)] = d_p[0]*w0; EM_S[INDEX2(1,2,8)] = d_p[0]*w0; EM_S[INDEX2(2,2,8)] = d_p[0]*w0; EM_S[INDEX2(3,2,8)] = d_p[0]*w0; EM_S[INDEX2(0,3,8)] = d_p[0]*w0; EM_S[INDEX2(1,3,8)] = d_p[0]*w0; EM_S[INDEX2(2,3,8)] = d_p[0]*w0; EM_S[INDEX2(3,3,8)] = d_p[0]*w0; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[0] = 4.*w0*y_p[0]; EM_F[1] = 4.*w0*y_p[0]; EM_F[2] = 4.*w0*y_p[0]; EM_F[3] = 4.*w0*y_p[0]; } const index_t firstNode=m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k1 loop } // colouring } // face 4 if (domain->m_faceOffset[5] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) { EM_F[0] = zero; EM_F[1] = zero; EM_F[2] = zero; EM_F[3] = zero; } for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[5]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); EM_S[INDEX2(4,4,8)] = d_p[0]*w0; EM_S[INDEX2(5,4,8)] = d_p[0]*w0; EM_S[INDEX2(6,4,8)] = d_p[0]*w0; EM_S[INDEX2(7,4,8)] = d_p[0]*w0; EM_S[INDEX2(4,5,8)] = d_p[0]*w0; EM_S[INDEX2(5,5,8)] = d_p[0]*w0; EM_S[INDEX2(6,5,8)] = d_p[0]*w0; EM_S[INDEX2(7,5,8)] = d_p[0]*w0; EM_S[INDEX2(4,6,8)] = d_p[0]*w0; EM_S[INDEX2(5,6,8)] = d_p[0]*w0; EM_S[INDEX2(6,6,8)] = d_p[0]*w0; EM_S[INDEX2(7,6,8)] = d_p[0]*w0; EM_S[INDEX2(4,7,8)] = d_p[0]*w0; EM_S[INDEX2(5,7,8)] = d_p[0]*w0; EM_S[INDEX2(6,7,8)] = d_p[0]*w0; EM_S[INDEX2(7,7,8)] = d_p[0]*w0; } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); EM_F[4] = 4.*w0*y_p[0]; EM_F[5] = 4.*w0*y_p[0]; EM_F[6] = 4.*w0*y_p[0]; EM_F[7] = 4.*w0*y_p[0]; } const index_t firstNode=m_NN[0]*m_NN[1]*(m_NN[2]-2)+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode); } // k0 loop } // k1 loop } // colouring } // face 5 } // end of parallel region } /****************************************************************************/ // PDE SYSTEM /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESystem(AbstractSystemMatrix* mat, Data& rhs, const Data& A, const Data& B, const Data& C, const Data& D, const Data& X, const Data& Y) const { dim_t numEq, numComp; if (!mat) numEq=numComp=(rhs.isEmpty() ? 1 : rhs.getDataPointSize()); else { numEq=mat->getRowBlockSize(); numComp=mat->getColumnBlockSize(); } const double SQRT3 = 1.73205080756887719318; const double w10 = -m_dx[0]/288; const double w12 = w10*(-SQRT3 - 2); const double w6 = w10*(SQRT3 - 2); const double w18 = w10*(-4*SQRT3 - 7); const double w4 = w10*(-4*SQRT3 + 7); const double w11 = m_dx[1]/288; const double w15 = w11*(SQRT3 + 2); const double w5 = w11*(-SQRT3 + 2); const double w2 = w11*(4*SQRT3 - 7); const double w17 = w11*(4*SQRT3 + 7); const double w8 = m_dx[2]/288; const double w16 = w8*(SQRT3 + 2); const double w1 = w8*(-SQRT3 + 2); const double w20 = w8*(4*SQRT3 - 7); const double w21 = w8*(-4*SQRT3 - 7); const double w54 = -m_dx[0]*m_dx[1]/72; const double w68 = -m_dx[0]*m_dx[1]/48; const double w38 = w68*(-SQRT3 - 3)/36; const double w45 = w68*(SQRT3 - 3)/36; const double w35 = w68*(5*SQRT3 - 9)/36; const double w46 = w68*(-5*SQRT3 - 9)/36; const double w43 = w68*(-19*SQRT3 - 33)/36; const double w44 = w68*(19*SQRT3 - 33)/36; const double w66 = w68*(SQRT3 + 2); const double w70 = w68*(-SQRT3 + 2); const double w56 = -m_dx[0]*m_dx[2]/72; const double w67 = -m_dx[0]*m_dx[2]/48; const double w37 = w67*(-SQRT3 - 3)/36; const double w40 = w67*(SQRT3 - 3)/36; const double w34 = w67*(5*SQRT3 - 9)/36; const double w42 = w67*(-5*SQRT3 - 9)/36; const double w47 = w67*(19*SQRT3 + 33)/36; const double w48 = w67*(-19*SQRT3 + 33)/36; const double w65 = w67*(SQRT3 + 2); const double w71 = w67*(-SQRT3 + 2); const double w55 = -m_dx[1]*m_dx[2]/72; const double w69 = -m_dx[1]*m_dx[2]/48; const double w36 = w69*(SQRT3 - 3)/36; const double w39 = w69*(-SQRT3 - 3)/36; const double w33 = w69*(5*SQRT3 - 9)/36; const double w41 = w69*(-5*SQRT3 - 9)/36; const double w49 = w69*(19*SQRT3 - 33)/36; const double w50 = w69*(-19*SQRT3 - 33)/36; const double w64 = w69*(SQRT3 + 2); const double w72 = w69*(-SQRT3 + 2); const double w58 = m_dx[0]*m_dx[1]*m_dx[2]/1728; const double w60 = w58*(-SQRT3 + 2); const double w61 = w58*(SQRT3 + 2); const double w57 = w58*(-4*SQRT3 + 7); const double w59 = w58*(4*SQRT3 + 7); const double w62 = w58*(15*SQRT3 + 26); const double w63 = w58*(-15*SQRT3 + 26); const double w75 = w58*6*(SQRT3 + 3); const double w76 = w58*6*(-SQRT3 + 3); const double w74 = w58*6*(5*SQRT3 + 9); const double w77 = w58*6*(-5*SQRT3 + 9); const double w13 = -m_dx[0]*m_dx[1]/(288*m_dx[2]); const double w19 = w13*(4*SQRT3 + 7); const double w7 = w13*(-4*SQRT3 + 7); const double w23 = w13*(+SQRT3 - 2); const double w25 = w13*(-SQRT3 - 2); const double w22 = -m_dx[0]*m_dx[2]/(288*m_dx[1]); const double w3 = w22*(SQRT3 - 2); const double w9 = w22*(-SQRT3 - 2); const double w24 = w22*(4*SQRT3 + 7); const double w26 = w22*(-4*SQRT3 + 7); const double w27 = -m_dx[1]*m_dx[2]/(288*m_dx[0]); const double w0 = w27*(SQRT3 - 2); const double w14 = w27*(-SQRT3 - 2); const double w28 = w27*(-4*SQRT3 + 7); const double w29 = w27*(4*SQRT3 + 7); const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = (!A.isEmpty() || !B.isEmpty() || !C.isEmpty() || !D.isEmpty()); const bool add_EM_F = (!X.isEmpty() || !Y.isEmpty()); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8*numEq*numComp, zero); vector<Scalar> EM_F(8*numEq, zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = k0 + NE0*k1 + NE0*NE1*k2; if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); /////////////// // process A // /////////////// if (!A.isEmpty()) { const Scalar* A_p = A.getSampleDataRO(e, zero); if (A.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar A_00_0 = A_p[INDEX5(k,0,m,0,0,numEq,3,numComp,3)]; const Scalar A_01_0 = A_p[INDEX5(k,0,m,1,0,numEq,3,numComp,3)]; const Scalar A_02_0 = A_p[INDEX5(k,0,m,2,0,numEq,3,numComp,3)]; const Scalar A_10_0 = A_p[INDEX5(k,1,m,0,0,numEq,3,numComp,3)]; const Scalar A_11_0 = A_p[INDEX5(k,1,m,1,0,numEq,3,numComp,3)]; const Scalar A_12_0 = A_p[INDEX5(k,1,m,2,0,numEq,3,numComp,3)]; const Scalar A_20_0 = A_p[INDEX5(k,2,m,0,0,numEq,3,numComp,3)]; const Scalar A_21_0 = A_p[INDEX5(k,2,m,1,0,numEq,3,numComp,3)]; const Scalar A_22_0 = A_p[INDEX5(k,2,m,2,0,numEq,3,numComp,3)]; const Scalar A_00_1 = A_p[INDEX5(k,0,m,0,1,numEq,3,numComp,3)]; const Scalar A_01_1 = A_p[INDEX5(k,0,m,1,1,numEq,3,numComp,3)]; const Scalar A_02_1 = A_p[INDEX5(k,0,m,2,1,numEq,3,numComp,3)]; const Scalar A_10_1 = A_p[INDEX5(k,1,m,0,1,numEq,3,numComp,3)]; const Scalar A_11_1 = A_p[INDEX5(k,1,m,1,1,numEq,3,numComp,3)]; const Scalar A_12_1 = A_p[INDEX5(k,1,m,2,1,numEq,3,numComp,3)]; const Scalar A_20_1 = A_p[INDEX5(k,2,m,0,1,numEq,3,numComp,3)]; const Scalar A_21_1 = A_p[INDEX5(k,2,m,1,1,numEq,3,numComp,3)]; const Scalar A_22_1 = A_p[INDEX5(k,2,m,2,1,numEq,3,numComp,3)]; const Scalar A_00_2 = A_p[INDEX5(k,0,m,0,2,numEq,3,numComp,3)]; const Scalar A_01_2 = A_p[INDEX5(k,0,m,1,2,numEq,3,numComp,3)]; const Scalar A_02_2 = A_p[INDEX5(k,0,m,2,2,numEq,3,numComp,3)]; const Scalar A_10_2 = A_p[INDEX5(k,1,m,0,2,numEq,3,numComp,3)]; const Scalar A_11_2 = A_p[INDEX5(k,1,m,1,2,numEq,3,numComp,3)]; const Scalar A_12_2 = A_p[INDEX5(k,1,m,2,2,numEq,3,numComp,3)]; const Scalar A_20_2 = A_p[INDEX5(k,2,m,0,2,numEq,3,numComp,3)]; const Scalar A_21_2 = A_p[INDEX5(k,2,m,1,2,numEq,3,numComp,3)]; const Scalar A_22_2 = A_p[INDEX5(k,2,m,2,2,numEq,3,numComp,3)]; const Scalar A_00_3 = A_p[INDEX5(k,0,m,0,3,numEq,3,numComp,3)]; const Scalar A_01_3 = A_p[INDEX5(k,0,m,1,3,numEq,3,numComp,3)]; const Scalar A_02_3 = A_p[INDEX5(k,0,m,2,3,numEq,3,numComp,3)]; const Scalar A_10_3 = A_p[INDEX5(k,1,m,0,3,numEq,3,numComp,3)]; const Scalar A_11_3 = A_p[INDEX5(k,1,m,1,3,numEq,3,numComp,3)]; const Scalar A_12_3 = A_p[INDEX5(k,1,m,2,3,numEq,3,numComp,3)]; const Scalar A_20_3 = A_p[INDEX5(k,2,m,0,3,numEq,3,numComp,3)]; const Scalar A_21_3 = A_p[INDEX5(k,2,m,1,3,numEq,3,numComp,3)]; const Scalar A_22_3 = A_p[INDEX5(k,2,m,2,3,numEq,3,numComp,3)]; const Scalar A_00_4 = A_p[INDEX5(k,0,m,0,4,numEq,3,numComp,3)]; const Scalar A_01_4 = A_p[INDEX5(k,0,m,1,4,numEq,3,numComp,3)]; const Scalar A_02_4 = A_p[INDEX5(k,0,m,2,4,numEq,3,numComp,3)]; const Scalar A_10_4 = A_p[INDEX5(k,1,m,0,4,numEq,3,numComp,3)]; const Scalar A_11_4 = A_p[INDEX5(k,1,m,1,4,numEq,3,numComp,3)]; const Scalar A_12_4 = A_p[INDEX5(k,1,m,2,4,numEq,3,numComp,3)]; const Scalar A_20_4 = A_p[INDEX5(k,2,m,0,4,numEq,3,numComp,3)]; const Scalar A_21_4 = A_p[INDEX5(k,2,m,1,4,numEq,3,numComp,3)]; const Scalar A_22_4 = A_p[INDEX5(k,2,m,2,4,numEq,3,numComp,3)]; const Scalar A_00_5 = A_p[INDEX5(k,0,m,0,5,numEq,3,numComp,3)]; const Scalar A_01_5 = A_p[INDEX5(k,0,m,1,5,numEq,3,numComp,3)]; const Scalar A_02_5 = A_p[INDEX5(k,0,m,2,5,numEq,3,numComp,3)]; const Scalar A_10_5 = A_p[INDEX5(k,1,m,0,5,numEq,3,numComp,3)]; const Scalar A_11_5 = A_p[INDEX5(k,1,m,1,5,numEq,3,numComp,3)]; const Scalar A_12_5 = A_p[INDEX5(k,1,m,2,5,numEq,3,numComp,3)]; const Scalar A_20_5 = A_p[INDEX5(k,2,m,0,5,numEq,3,numComp,3)]; const Scalar A_21_5 = A_p[INDEX5(k,2,m,1,5,numEq,3,numComp,3)]; const Scalar A_22_5 = A_p[INDEX5(k,2,m,2,5,numEq,3,numComp,3)]; const Scalar A_00_6 = A_p[INDEX5(k,0,m,0,6,numEq,3,numComp,3)]; const Scalar A_01_6 = A_p[INDEX5(k,0,m,1,6,numEq,3,numComp,3)]; const Scalar A_02_6 = A_p[INDEX5(k,0,m,2,6,numEq,3,numComp,3)]; const Scalar A_10_6 = A_p[INDEX5(k,1,m,0,6,numEq,3,numComp,3)]; const Scalar A_11_6 = A_p[INDEX5(k,1,m,1,6,numEq,3,numComp,3)]; const Scalar A_12_6 = A_p[INDEX5(k,1,m,2,6,numEq,3,numComp,3)]; const Scalar A_20_6 = A_p[INDEX5(k,2,m,0,6,numEq,3,numComp,3)]; const Scalar A_21_6 = A_p[INDEX5(k,2,m,1,6,numEq,3,numComp,3)]; const Scalar A_22_6 = A_p[INDEX5(k,2,m,2,6,numEq,3,numComp,3)]; const Scalar A_00_7 = A_p[INDEX5(k,0,m,0,7,numEq,3,numComp,3)]; const Scalar A_01_7 = A_p[INDEX5(k,0,m,1,7,numEq,3,numComp,3)]; const Scalar A_02_7 = A_p[INDEX5(k,0,m,2,7,numEq,3,numComp,3)]; const Scalar A_10_7 = A_p[INDEX5(k,1,m,0,7,numEq,3,numComp,3)]; const Scalar A_11_7 = A_p[INDEX5(k,1,m,1,7,numEq,3,numComp,3)]; const Scalar A_12_7 = A_p[INDEX5(k,1,m,2,7,numEq,3,numComp,3)]; const Scalar A_20_7 = A_p[INDEX5(k,2,m,0,7,numEq,3,numComp,3)]; const Scalar A_21_7 = A_p[INDEX5(k,2,m,1,7,numEq,3,numComp,3)]; const Scalar A_22_7 = A_p[INDEX5(k,2,m,2,7,numEq,3,numComp,3)]; const Scalar tmp0 = w18*(-A_12_7 + A_21_3); const Scalar tmp1 = w13*(A_22_1 + A_22_2 + A_22_5 + A_22_6); const Scalar tmp2 = w11*(-A_02_2 - A_02_5 + A_20_1 + A_20_6); const Scalar tmp3 = w14*(A_00_2 + A_00_3 + A_00_6 + A_00_7); const Scalar tmp4 = w7*(A_22_0 + A_22_4); const Scalar tmp5 = w10*(A_12_1 + A_12_6 - A_21_2 - A_21_5); const Scalar tmp6 = w3*(A_11_0 + A_11_2 + A_11_4 + A_11_6); const Scalar tmp7 = w1*(A_01_0 + A_01_4 + A_10_0 + A_10_4); const Scalar tmp8 = w4*(A_12_0 - A_21_4); const Scalar tmp9 = w15*(-A_02_3 - A_02_6 + A_20_2 + A_20_7); const Scalar tmp10 = w0*(A_00_0 + A_00_1 + A_00_4 + A_00_5); const Scalar tmp11 = w16*(A_01_3 + A_01_7 + A_10_3 + A_10_7); const Scalar tmp12 = w9*(A_11_1 + A_11_3 + A_11_5 + A_11_7); const Scalar tmp13 = w12*(-A_12_3 - A_12_5 + A_21_1 + A_21_7); const Scalar tmp14 = w5*(-A_02_1 - A_02_4 + A_20_0 + A_20_5); const Scalar tmp15 = w8*(A_01_1 + A_01_2 + A_01_5 + A_01_6 + A_10_1 + A_10_2 + A_10_5 + A_10_6); const Scalar tmp16 = w6*(-A_12_2 - A_12_4 + A_21_0 + A_21_6); const Scalar tmp17 = w19*(A_22_3 + A_22_7); const Scalar tmp18 = w17*(-A_02_7 + A_20_3); const Scalar tmp19 = w2*(A_02_0 - A_20_4); const Scalar tmp20 = w13*(-A_22_0 - A_22_1 - A_22_2 - A_22_3 - A_22_4 - A_22_5 - A_22_6 - A_22_7); const Scalar tmp21 = w11*(-A_02_1 - A_02_3 - A_02_4 - A_02_6 + A_20_0 + A_20_2 + A_20_5 + A_20_7); const Scalar tmp22 = w14*(-A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp23 = w20*(A_01_2 + A_10_1); const Scalar tmp24 = w10*(A_12_2 + A_12_3 + A_12_4 + A_12_5 - A_21_0 - A_21_1 - A_21_6 - A_21_7); const Scalar tmp25 = w3*(-A_11_0 - A_11_1 - A_11_2 - A_11_3); const Scalar tmp26 = w1*(-A_01_0 - A_01_3 - A_10_0 - A_10_3); const Scalar tmp27 = w15*(-A_02_5 - A_02_7 + A_20_4 + A_20_6); const Scalar tmp28 = w0*(-A_00_0 - A_00_1 - A_00_2 - A_00_3); const Scalar tmp29 = w16*(-A_01_4 - A_01_7 - A_10_4 - A_10_7); const Scalar tmp30 = w9*(-A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp31 = w21*(A_01_5 + A_10_6); const Scalar tmp32 = w12*(-A_12_6 - A_12_7 + A_21_4 + A_21_5); const Scalar tmp33 = w5*(-A_02_0 - A_02_2 + A_20_1 + A_20_3); const Scalar tmp34 = w8*(-A_01_1 - A_01_6 - A_10_2 - A_10_5); const Scalar tmp35 = w6*(-A_12_0 - A_12_1 + A_21_2 + A_21_3); const Scalar tmp36 = w20*(-A_01_6 + A_10_4); const Scalar tmp37 = w18*(A_12_3 - A_21_1); const Scalar tmp38 = w11*(-A_02_0 - A_02_2 - A_02_5 - A_02_7 - A_20_0 - A_20_2 - A_20_5 - A_20_7); const Scalar tmp39 = w14*(A_00_0 + A_00_1 + A_00_2 + A_00_3); const Scalar tmp40 = w26*(A_11_4 + A_11_6); const Scalar tmp41 = w0*(A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp42 = w10*(-A_12_2 - A_12_5 + A_21_0 + A_21_7); const Scalar tmp43 = w22*(A_11_0 + A_11_2 + A_11_5 + A_11_7); const Scalar tmp44 = w1*(A_01_4 + A_01_7 - A_10_5 - A_10_6); const Scalar tmp45 = w25*(A_22_1 + A_22_3 + A_22_5 + A_22_7); const Scalar tmp46 = w4*(-A_12_4 + A_21_6); const Scalar tmp47 = w15*(-A_02_1 - A_02_3 - A_20_1 - A_20_3); const Scalar tmp48 = w21*(-A_01_1 + A_10_3); const Scalar tmp49 = w16*(A_01_0 + A_01_3 - A_10_1 - A_10_2); const Scalar tmp50 = w5*(-A_02_4 - A_02_6 - A_20_4 - A_20_6); const Scalar tmp51 = w12*(A_12_1 + A_12_7 - A_21_3 - A_21_5); const Scalar tmp52 = w24*(A_11_1 + A_11_3); const Scalar tmp53 = w8*(A_01_2 + A_01_5 - A_10_0 - A_10_7); const Scalar tmp54 = w6*(A_12_0 + A_12_6 - A_21_2 - A_21_4); const Scalar tmp55 = w23*(A_22_0 + A_22_2 + A_22_4 + A_22_6); const Scalar tmp56 = w18*(A_12_4 - A_21_6); const Scalar tmp57 = w14*(A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp58 = w26*(A_11_1 + A_11_3); const Scalar tmp59 = w20*(-A_01_1 + A_10_3); const Scalar tmp60 = w1*(A_01_0 + A_01_3 - A_10_1 - A_10_2); const Scalar tmp61 = w25*(A_22_0 + A_22_2 + A_22_4 + A_22_6); const Scalar tmp62 = w4*(-A_12_3 + A_21_1); const Scalar tmp63 = w15*(-A_02_4 - A_02_6 - A_20_4 - A_20_6); const Scalar tmp64 = w0*(A_00_0 + A_00_1 + A_00_2 + A_00_3); const Scalar tmp65 = w16*(A_01_4 + A_01_7 - A_10_5 - A_10_6); const Scalar tmp66 = w24*(A_11_4 + A_11_6); const Scalar tmp67 = w21*(-A_01_6 + A_10_4); const Scalar tmp68 = w12*(A_12_0 + A_12_6 - A_21_2 - A_21_4); const Scalar tmp69 = w5*(-A_02_1 - A_02_3 - A_20_1 - A_20_3); const Scalar tmp70 = w6*(A_12_1 + A_12_7 - A_21_3 - A_21_5); const Scalar tmp71 = w23*(A_22_1 + A_22_3 + A_22_5 + A_22_7); const Scalar tmp72 = w20*(A_01_5 + A_10_6); const Scalar tmp73 = w14*(-A_00_0 - A_00_1 - A_00_2 - A_00_3); const Scalar tmp74 = w0*(-A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp75 = w3*(-A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp76 = w1*(-A_01_4 - A_01_7 - A_10_4 - A_10_7); const Scalar tmp77 = w15*(-A_02_0 - A_02_2 + A_20_1 + A_20_3); const Scalar tmp78 = w21*(A_01_2 + A_10_1); const Scalar tmp79 = w16*(-A_01_0 - A_01_3 - A_10_0 - A_10_3); const Scalar tmp80 = w9*(-A_11_0 - A_11_1 - A_11_2 - A_11_3); const Scalar tmp81 = w12*(-A_12_0 - A_12_1 + A_21_2 + A_21_3); const Scalar tmp82 = w5*(-A_02_5 - A_02_7 + A_20_4 + A_20_6); const Scalar tmp83 = w6*(-A_12_6 - A_12_7 + A_21_4 + A_21_5); const Scalar tmp84 = w6*(-A_12_2 - A_12_3 - A_21_2 - A_21_3); const Scalar tmp85 = w11*(A_02_1 + A_02_6 - A_20_0 - A_20_7); const Scalar tmp86 = w20*(A_01_3 - A_10_2); const Scalar tmp87 = w10*(A_12_0 + A_12_1 + A_12_6 + A_12_7 + A_21_0 + A_21_1 + A_21_6 + A_21_7); const Scalar tmp88 = w3*(A_11_0 + A_11_1 + A_11_2 + A_11_3); const Scalar tmp89 = w23*(A_22_2 + A_22_3 + A_22_6 + A_22_7); const Scalar tmp90 = w1*(-A_01_1 - A_01_2 + A_10_0 + A_10_3); const Scalar tmp91 = w25*(A_22_0 + A_22_1 + A_22_4 + A_22_5); const Scalar tmp92 = w15*(A_02_0 + A_02_5 - A_20_1 - A_20_4); const Scalar tmp93 = w21*(A_01_4 - A_10_5); const Scalar tmp94 = w16*(-A_01_5 - A_01_6 + A_10_4 + A_10_7); const Scalar tmp95 = w28*(A_00_2 + A_00_3); const Scalar tmp96 = w12*(-A_12_4 - A_12_5 - A_21_4 - A_21_5); const Scalar tmp97 = w29*(A_00_4 + A_00_5); const Scalar tmp98 = w5*(A_02_2 + A_02_7 - A_20_3 - A_20_6); const Scalar tmp99 = w8*(-A_01_0 - A_01_7 + A_10_1 + A_10_6); const Scalar tmp100 = w9*(A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp101 = w27*(A_00_0 + A_00_1 + A_00_6 + A_00_7); const Scalar tmp102 = w17*(A_02_4 - A_20_5); const Scalar tmp103 = w2*(-A_02_3 + A_20_2); const Scalar tmp104 = w13*(A_22_0 + A_22_1 + A_22_2 + A_22_3 + A_22_4 + A_22_5 + A_22_6 + A_22_7); const Scalar tmp105 = w6*(-A_12_4 - A_12_5 - A_21_2 - A_21_3); const Scalar tmp106 = w22*(A_11_0 + A_11_1 + A_11_2 + A_11_3 + A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp107 = w1*(-A_01_2 - A_01_6 - A_10_1 - A_10_5); const Scalar tmp108 = w15*(-A_02_1 - A_02_3 - A_20_4 - A_20_6); const Scalar tmp109 = w16*(-A_01_1 - A_01_5 - A_10_2 - A_10_6); const Scalar tmp110 = w12*(-A_12_2 - A_12_3 - A_21_4 - A_21_5); const Scalar tmp111 = w5*(-A_02_4 - A_02_6 - A_20_1 - A_20_3); const Scalar tmp112 = w8*(-A_01_0 - A_01_3 - A_01_4 - A_01_7 - A_10_0 - A_10_3 - A_10_4 - A_10_7); const Scalar tmp113 = w27*(A_00_0 + A_00_1 + A_00_2 + A_00_3 + A_00_4 + A_00_5 + A_00_6 + A_00_7); const Scalar tmp114 = w11*(A_02_0 + A_02_2 + A_02_5 + A_02_7 - A_20_1 - A_20_3 - A_20_4 - A_20_6); const Scalar tmp115 = w21*(-A_01_4 - A_10_7); const Scalar tmp116 = w20*(-A_01_3 - A_10_0); const Scalar tmp117 = w15*(A_02_4 + A_02_6 - A_20_5 - A_20_7); const Scalar tmp118 = w16*(A_01_5 + A_01_6 + A_10_5 + A_10_6); const Scalar tmp119 = w5*(A_02_1 + A_02_3 - A_20_0 - A_20_2); const Scalar tmp120 = w8*(A_01_0 + A_01_7 + A_10_3 + A_10_4); const Scalar tmp121 = w1*(A_01_1 + A_01_2 + A_10_1 + A_10_2); const Scalar tmp122 = w18*(A_12_2 - A_21_6); const Scalar tmp123 = w13*(A_22_0 + A_22_3 + A_22_4 + A_22_7); const Scalar tmp124 = w11*(-A_02_0 - A_02_7 + A_20_3 + A_20_4); const Scalar tmp125 = w7*(A_22_1 + A_22_5); const Scalar tmp126 = w10*(-A_12_3 - A_12_4 + A_21_0 + A_21_7); const Scalar tmp127 = w3*(A_11_1 + A_11_3 + A_11_5 + A_11_7); const Scalar tmp128 = w1*(-A_01_1 - A_01_5 - A_10_1 - A_10_5); const Scalar tmp129 = w4*(-A_12_5 + A_21_1); const Scalar tmp130 = w16*(-A_01_2 - A_01_6 - A_10_2 - A_10_6); const Scalar tmp131 = w9*(A_11_0 + A_11_2 + A_11_4 + A_11_6); const Scalar tmp132 = w19*(A_22_2 + A_22_6); const Scalar tmp133 = w17*(-A_02_2 + A_20_6); const Scalar tmp134 = w2*(A_02_5 - A_20_1); const Scalar tmp135 = w11*(A_02_1 + A_02_3 + A_02_4 + A_02_6 + A_20_1 + A_20_3 + A_20_4 + A_20_6); const Scalar tmp136 = w1*(A_01_3 + A_01_7 + A_10_0 + A_10_4); const Scalar tmp137 = w15*(A_02_0 + A_02_2 + A_20_5 + A_20_7); const Scalar tmp138 = w16*(A_01_0 + A_01_4 + A_10_3 + A_10_7); const Scalar tmp139 = w5*(A_02_5 + A_02_7 + A_20_0 + A_20_2); const Scalar tmp140 = w18*(A_12_5 - A_21_1); const Scalar tmp141 = w14*(A_00_0 + A_00_1 + A_00_4 + A_00_5); const Scalar tmp142 = w7*(A_22_2 + A_22_6); const Scalar tmp143 = w1*(-A_01_2 - A_01_6 - A_10_2 - A_10_6); const Scalar tmp144 = w4*(-A_12_2 + A_21_6); const Scalar tmp145 = w15*(-A_02_1 - A_02_4 + A_20_0 + A_20_5); const Scalar tmp146 = w0*(A_00_2 + A_00_3 + A_00_6 + A_00_7); const Scalar tmp147 = w16*(-A_01_1 - A_01_5 - A_10_1 - A_10_5); const Scalar tmp148 = w5*(-A_02_3 - A_02_6 + A_20_2 + A_20_7); const Scalar tmp149 = w19*(A_22_1 + A_22_5); const Scalar tmp150 = w17*(-A_02_5 + A_20_1); const Scalar tmp151 = w2*(A_02_2 - A_20_6); const Scalar tmp152 = w18*(A_12_3 - A_21_7); const Scalar tmp153 = w11*(A_02_1 + A_02_6 - A_20_2 - A_20_5); const Scalar tmp154 = w10*(-A_12_2 - A_12_5 + A_21_1 + A_21_6); const Scalar tmp155 = w4*(-A_12_4 + A_21_0); const Scalar tmp156 = w15*(A_02_2 + A_02_7 - A_20_3 - A_20_6); const Scalar tmp157 = w5*(A_02_0 + A_02_5 - A_20_1 - A_20_4); const Scalar tmp158 = w17*(A_02_3 - A_20_7); const Scalar tmp159 = w2*(-A_02_4 + A_20_0); const Scalar tmp160 = w6*(A_12_6 + A_12_7 + A_21_0 + A_21_1); const Scalar tmp161 = w10*(-A_12_2 - A_12_3 - A_12_4 - A_12_5 - A_21_2 - A_21_3 - A_21_4 - A_21_5); const Scalar tmp162 = w1*(A_01_0 + A_01_4 + A_10_3 + A_10_7); const Scalar tmp163 = w16*(A_01_3 + A_01_7 + A_10_0 + A_10_4); const Scalar tmp164 = w12*(A_12_0 + A_12_1 + A_21_6 + A_21_7); const Scalar tmp165 = w20*(A_01_6 + A_10_5); const Scalar tmp166 = w10*(-A_12_0 - A_12_1 - A_12_6 - A_12_7 + A_21_2 + A_21_3 + A_21_4 + A_21_5); const Scalar tmp167 = w15*(A_02_1 + A_02_3 - A_20_0 - A_20_2); const Scalar tmp168 = w21*(A_01_1 + A_10_2); const Scalar tmp169 = w12*(A_12_2 + A_12_3 - A_21_0 - A_21_1); const Scalar tmp170 = w5*(A_02_4 + A_02_6 - A_20_5 - A_20_7); const Scalar tmp171 = w8*(-A_01_2 - A_01_5 - A_10_1 - A_10_6); const Scalar tmp172 = w6*(A_12_4 + A_12_5 - A_21_6 - A_21_7); const Scalar tmp173 = w2*(A_02_1 + A_20_4); const Scalar tmp174 = w11*(-A_02_3 - A_02_4 - A_20_1 - A_20_6); const Scalar tmp175 = w14*(-A_00_2 - A_00_3 - A_00_6 - A_00_7); const Scalar tmp176 = w22*(-A_11_0 - A_11_1 - A_11_2 - A_11_3 - A_11_4 - A_11_5 - A_11_6 - A_11_7); const Scalar tmp177 = w1*(A_01_1 + A_01_5 - A_10_0 - A_10_4); const Scalar tmp178 = w25*(-A_22_2 - A_22_3 - A_22_6 - A_22_7); const Scalar tmp179 = w15*(-A_02_2 - A_02_7 - A_20_2 - A_20_7); const Scalar tmp180 = w0*(-A_00_0 - A_00_1 - A_00_4 - A_00_5); const Scalar tmp181 = w16*(A_01_2 + A_01_6 - A_10_3 - A_10_7); const Scalar tmp182 = w12*(-A_12_6 - A_12_7 + A_21_2 + A_21_3); const Scalar tmp183 = w5*(-A_02_0 - A_02_5 - A_20_0 - A_20_5); const Scalar tmp184 = w8*(A_01_0 + A_01_3 + A_01_4 + A_01_7 - A_10_1 - A_10_2 - A_10_5 - A_10_6); const Scalar tmp185 = w6*(-A_12_0 - A_12_1 + A_21_4 + A_21_5); const Scalar tmp186 = w17*(-A_02_6 - A_20_3); const Scalar tmp187 = w23*(-A_22_0 - A_22_1 - A_22_4 - A_22_5); const Scalar tmp188 = w18*(A_12_4 - A_21_0); const Scalar tmp189 = w7*(A_22_3 + A_22_7); const Scalar tmp190 = w1*(A_01_3 + A_01_7 + A_10_3 + A_10_7); const Scalar tmp191 = w4*(-A_12_3 + A_21_7); const Scalar tmp192 = w16*(A_01_0 + A_01_4 + A_10_0 + A_10_4); const Scalar tmp193 = w19*(A_22_0 + A_22_4); const Scalar tmp194 = w17*(A_02_4 - A_20_0); const Scalar tmp195 = w2*(-A_02_3 + A_20_7); const Scalar tmp196 = w20*(-A_01_7 - A_10_4); const Scalar tmp197 = w21*(-A_01_0 - A_10_3); const Scalar tmp198 = w16*(A_01_1 + A_01_2 + A_10_1 + A_10_2); const Scalar tmp199 = w8*(A_01_3 + A_01_4 + A_10_0 + A_10_7); const Scalar tmp200 = w1*(A_01_5 + A_01_6 + A_10_5 + A_10_6); const Scalar tmp201 = w27*(A_00_2 + A_00_3 + A_00_4 + A_00_5); const Scalar tmp202 = w11*(-A_02_2 - A_02_5 + A_20_3 + A_20_4); const Scalar tmp203 = w20*(A_01_0 - A_10_1); const Scalar tmp204 = w23*(A_22_0 + A_22_1 + A_22_4 + A_22_5); const Scalar tmp205 = w25*(A_22_2 + A_22_3 + A_22_6 + A_22_7); const Scalar tmp206 = w21*(A_01_7 - A_10_6); const Scalar tmp207 = w12*(A_12_6 + A_12_7 + A_21_6 + A_21_7); const Scalar tmp208 = w28*(A_00_0 + A_00_1); const Scalar tmp209 = w29*(A_00_6 + A_00_7); const Scalar tmp210 = w8*(-A_01_3 - A_01_4 + A_10_2 + A_10_5); const Scalar tmp211 = w6*(A_12_0 + A_12_1 + A_21_0 + A_21_1); const Scalar tmp212 = w17*(-A_02_7 + A_20_6); const Scalar tmp213 = w2*(A_02_0 - A_20_1); const Scalar tmp214 = w13*(-A_22_1 - A_22_2 - A_22_5 - A_22_6); const Scalar tmp215 = w22*(-A_11_0 - A_11_2 - A_11_5 - A_11_7); const Scalar tmp216 = w8*(A_01_0 + A_01_7 + A_10_0 + A_10_7); const Scalar tmp217 = w27*(-A_00_0 - A_00_1 - A_00_6 - A_00_7); const Scalar tmp218 = w17*(-A_02_3 - A_20_3); const Scalar tmp219 = w2*(A_02_4 + A_20_4); const Scalar tmp220 = w11*(-A_02_1 - A_02_6 - A_20_1 - A_20_6); const Scalar tmp221 = w26*(-A_11_4 - A_11_6); const Scalar tmp222 = w10*(A_12_2 + A_12_5 + A_21_2 + A_21_5); const Scalar tmp223 = w20*(-A_01_4 - A_10_4); const Scalar tmp224 = w21*(-A_01_3 - A_10_3); const Scalar tmp225 = w6*(-A_12_0 - A_12_6 - A_21_0 - A_21_6); const Scalar tmp226 = w7*(-A_22_0 - A_22_4); const Scalar tmp227 = w24*(-A_11_1 - A_11_3); const Scalar tmp228 = w19*(-A_22_3 - A_22_7); const Scalar tmp229 = w18*(-A_12_3 - A_21_3); const Scalar tmp230 = w4*(A_12_4 + A_21_4); const Scalar tmp231 = w28*(-A_00_4 - A_00_5); const Scalar tmp232 = w12*(-A_12_1 - A_12_7 - A_21_1 - A_21_7); const Scalar tmp233 = w29*(-A_00_2 - A_00_3); const Scalar tmp234 = w20*(-A_01_5 + A_10_7); const Scalar tmp235 = w18*(-A_12_0 + A_21_2); const Scalar tmp236 = w26*(A_11_5 + A_11_7); const Scalar tmp237 = w10*(A_12_1 + A_12_6 - A_21_3 - A_21_4); const Scalar tmp238 = w22*(A_11_1 + A_11_3 + A_11_4 + A_11_6); const Scalar tmp239 = w4*(A_12_7 - A_21_5); const Scalar tmp240 = w15*(A_02_0 + A_02_2 + A_20_0 + A_20_2); const Scalar tmp241 = w21*(-A_01_2 + A_10_0); const Scalar tmp242 = w5*(A_02_5 + A_02_7 + A_20_5 + A_20_7); const Scalar tmp243 = w12*(-A_12_2 - A_12_4 + A_21_0 + A_21_6); const Scalar tmp244 = w24*(A_11_0 + A_11_2); const Scalar tmp245 = w8*(A_01_1 + A_01_6 - A_10_3 - A_10_4); const Scalar tmp246 = w6*(-A_12_3 - A_12_5 + A_21_1 + A_21_7); const Scalar tmp247 = w11*(A_02_3 + A_02_4 - A_20_2 - A_20_5); const Scalar tmp248 = w20*(-A_01_1 + A_10_0); const Scalar tmp249 = w21*(-A_01_6 + A_10_7); const Scalar tmp250 = w8*(A_01_2 + A_01_5 - A_10_3 - A_10_4); const Scalar tmp251 = w17*(A_02_6 - A_20_7); const Scalar tmp252 = w2*(-A_02_1 + A_20_0); const Scalar tmp253 = w17*(-A_02_4 - A_20_4); const Scalar tmp254 = w2*(A_02_3 + A_20_3); const Scalar tmp255 = w26*(-A_11_1 - A_11_3); const Scalar tmp256 = w20*(-A_01_3 - A_10_3); const Scalar tmp257 = w21*(-A_01_4 - A_10_4); const Scalar tmp258 = w6*(-A_12_1 - A_12_7 - A_21_1 - A_21_7); const Scalar tmp259 = w7*(-A_22_3 - A_22_7); const Scalar tmp260 = w15*(-A_02_0 - A_02_5 - A_20_0 - A_20_5); const Scalar tmp261 = w24*(-A_11_4 - A_11_6); const Scalar tmp262 = w19*(-A_22_0 - A_22_4); const Scalar tmp263 = w18*(-A_12_4 - A_21_4); const Scalar tmp264 = w4*(A_12_3 + A_21_3); const Scalar tmp265 = w28*(-A_00_2 - A_00_3); const Scalar tmp266 = w12*(-A_12_0 - A_12_6 - A_21_0 - A_21_6); const Scalar tmp267 = w5*(-A_02_2 - A_02_7 - A_20_2 - A_20_7); const Scalar tmp268 = w29*(-A_00_4 - A_00_5); const Scalar tmp269 = w11*(A_02_2 + A_02_5 + A_20_0 + A_20_7); const Scalar tmp270 = w1*(-A_01_0 - A_01_4 + A_10_1 + A_10_5); const Scalar tmp271 = w15*(A_02_3 + A_02_6 + A_20_3 + A_20_6); const Scalar tmp272 = w16*(-A_01_3 - A_01_7 + A_10_2 + A_10_6); const Scalar tmp273 = w5*(A_02_1 + A_02_4 + A_20_1 + A_20_4); const Scalar tmp274 = w8*(-A_01_1 - A_01_2 - A_01_5 - A_01_6 + A_10_0 + A_10_3 + A_10_4 + A_10_7); const Scalar tmp275 = w17*(A_02_7 + A_20_2); const Scalar tmp276 = w2*(-A_02_0 - A_20_5); const Scalar tmp277 = w18*(-A_12_1 + A_21_5); const Scalar tmp278 = w11*(A_02_3 + A_02_4 - A_20_0 - A_20_7); const Scalar tmp279 = w10*(A_12_0 + A_12_7 - A_21_3 - A_21_4); const Scalar tmp280 = w4*(A_12_6 - A_21_2); const Scalar tmp281 = w17*(A_02_1 - A_20_5); const Scalar tmp282 = w2*(-A_02_6 + A_20_2); const Scalar tmp283 = w11*(A_02_0 + A_02_7 + A_20_2 + A_20_5); const Scalar tmp284 = w12*(A_12_2 + A_12_3 - A_21_6 - A_21_7); const Scalar tmp285 = w6*(A_12_4 + A_12_5 - A_21_0 - A_21_1); const Scalar tmp286 = w17*(A_02_2 + A_20_7); const Scalar tmp287 = w2*(-A_02_5 - A_20_0); const Scalar tmp288 = w13*(-A_22_0 - A_22_3 - A_22_4 - A_22_7); const Scalar tmp289 = w22*(-A_11_1 - A_11_3 - A_11_4 - A_11_6); const Scalar tmp290 = w8*(-A_01_1 - A_01_6 - A_10_1 - A_10_6); const Scalar tmp291 = w17*(A_02_2 + A_20_2); const Scalar tmp292 = w2*(-A_02_5 - A_20_5); const Scalar tmp293 = w11*(A_02_0 + A_02_7 + A_20_0 + A_20_7); const Scalar tmp294 = w26*(-A_11_5 - A_11_7); const Scalar tmp295 = w10*(A_12_3 + A_12_4 + A_21_3 + A_21_4); const Scalar tmp296 = w20*(A_01_5 + A_10_5); const Scalar tmp297 = w21*(A_01_2 + A_10_2); const Scalar tmp298 = w7*(-A_22_1 - A_22_5); const Scalar tmp299 = w24*(-A_11_0 - A_11_2); const Scalar tmp300 = w19*(-A_22_2 - A_22_6); const Scalar tmp301 = w18*(-A_12_2 - A_21_2); const Scalar tmp302 = w4*(A_12_5 + A_21_5); const Scalar tmp303 = w8*(A_01_3 + A_01_4 + A_10_3 + A_10_4); const Scalar tmp304 = w27*(-A_00_2 - A_00_3 - A_00_4 - A_00_5); const Scalar tmp305 = w17*(A_02_7 + A_20_7); const Scalar tmp306 = w2*(-A_02_0 - A_20_0); const Scalar tmp307 = w11*(A_02_2 + A_02_5 + A_20_2 + A_20_5); const Scalar tmp308 = w26*(-A_11_0 - A_11_2); const Scalar tmp309 = w10*(-A_12_1 - A_12_6 - A_21_1 - A_21_6); const Scalar tmp310 = w20*(-A_01_0 - A_10_0); const Scalar tmp311 = w21*(-A_01_7 - A_10_7); const Scalar tmp312 = w6*(A_12_2 + A_12_4 + A_21_2 + A_21_4); const Scalar tmp313 = w24*(-A_11_5 - A_11_7); const Scalar tmp314 = w18*(A_12_7 + A_21_7); const Scalar tmp315 = w4*(-A_12_0 - A_21_0); const Scalar tmp316 = w28*(-A_00_0 - A_00_1); const Scalar tmp317 = w12*(A_12_3 + A_12_5 + A_21_3 + A_21_5); const Scalar tmp318 = w29*(-A_00_6 - A_00_7); const Scalar tmp319 = w18*(-A_12_7 + A_21_5); const Scalar tmp320 = w26*(A_11_0 + A_11_2); const Scalar tmp321 = w21*(-A_01_5 + A_10_7); const Scalar tmp322 = w20*(-A_01_2 + A_10_0); const Scalar tmp323 = w4*(A_12_0 - A_21_2); const Scalar tmp324 = w15*(A_02_5 + A_02_7 + A_20_5 + A_20_7); const Scalar tmp325 = w24*(A_11_5 + A_11_7); const Scalar tmp326 = w5*(A_02_0 + A_02_2 + A_20_0 + A_20_2); const Scalar tmp327 = w18*(A_12_7 + A_21_1); const Scalar tmp328 = w10*(-A_12_1 - A_12_6 - A_21_0 - A_21_7); const Scalar tmp329 = w3*(-A_11_0 - A_11_2 - A_11_4 - A_11_6); const Scalar tmp330 = w1*(A_01_2 + A_01_6 - A_10_0 - A_10_4); const Scalar tmp331 = w4*(-A_12_0 - A_21_6); const Scalar tmp332 = w25*(-A_22_1 - A_22_3 - A_22_5 - A_22_7); const Scalar tmp333 = w15*(-A_02_5 - A_02_7 + A_20_1 + A_20_3); const Scalar tmp334 = w16*(A_01_1 + A_01_5 - A_10_3 - A_10_7); const Scalar tmp335 = w9*(-A_11_1 - A_11_3 - A_11_5 - A_11_7); const Scalar tmp336 = w5*(-A_02_0 - A_02_2 + A_20_4 + A_20_6); const Scalar tmp337 = w27*(-A_00_0 - A_00_1 - A_00_2 - A_00_3 - A_00_4 - A_00_5 - A_00_6 - A_00_7); const Scalar tmp338 = w23*(-A_22_0 - A_22_2 - A_22_4 - A_22_6); const Scalar tmp339 = w14*(-A_00_0 - A_00_1 - A_00_4 - A_00_5); const Scalar tmp340 = w23*(-A_22_2 - A_22_3 - A_22_6 - A_22_7); const Scalar tmp341 = w1*(A_01_2 + A_01_6 - A_10_3 - A_10_7); const Scalar tmp342 = w25*(-A_22_0 - A_22_1 - A_22_4 - A_22_5); const Scalar tmp343 = w15*(A_02_1 + A_02_4 + A_20_1 + A_20_4); const Scalar tmp344 = w0*(-A_00_2 - A_00_3 - A_00_6 - A_00_7); const Scalar tmp345 = w16*(A_01_1 + A_01_5 - A_10_0 - A_10_4); const Scalar tmp346 = w12*(A_12_4 + A_12_5 - A_21_0 - A_21_1); const Scalar tmp347 = w5*(A_02_3 + A_02_6 + A_20_3 + A_20_6); const Scalar tmp348 = w6*(A_12_2 + A_12_3 - A_21_6 - A_21_7); const Scalar tmp349 = w17*(A_02_5 + A_20_0); const Scalar tmp350 = w2*(-A_02_2 - A_20_7); const Scalar tmp351 = w8*(-A_01_2 - A_01_5 - A_10_2 - A_10_5); const Scalar tmp352 = w17*(-A_02_1 - A_20_1); const Scalar tmp353 = w2*(A_02_6 + A_20_6); const Scalar tmp354 = w11*(-A_02_3 - A_02_4 - A_20_3 - A_20_4); const Scalar tmp355 = w10*(-A_12_0 - A_12_7 - A_21_0 - A_21_7); const Scalar tmp356 = w20*(A_01_6 + A_10_6); const Scalar tmp357 = w21*(A_01_1 + A_10_1); const Scalar tmp358 = w7*(-A_22_2 - A_22_6); const Scalar tmp359 = w19*(-A_22_1 - A_22_5); const Scalar tmp360 = w18*(A_12_1 + A_21_1); const Scalar tmp361 = w4*(-A_12_6 - A_21_6); const Scalar tmp362 = w28*(-A_00_6 - A_00_7); const Scalar tmp363 = w29*(-A_00_0 - A_00_1); const Scalar tmp364 = w2*(A_02_4 + A_20_1); const Scalar tmp365 = w11*(-A_02_1 - A_02_6 - A_20_3 - A_20_4); const Scalar tmp366 = w17*(-A_02_3 - A_20_6); const Scalar tmp367 = w2*(A_02_5 - A_20_4); const Scalar tmp368 = w6*(-A_12_4 - A_12_5 - A_21_4 - A_21_5); const Scalar tmp369 = w11*(-A_02_0 - A_02_7 + A_20_1 + A_20_6); const Scalar tmp370 = w20*(-A_01_5 + A_10_4); const Scalar tmp371 = w3*(A_11_4 + A_11_5 + A_11_6 + A_11_7); const Scalar tmp372 = w12*(-A_12_2 - A_12_3 - A_21_2 - A_21_3); const Scalar tmp373 = w21*(-A_01_2 + A_10_3); const Scalar tmp374 = w9*(A_11_0 + A_11_1 + A_11_2 + A_11_3); const Scalar tmp375 = w29*(A_00_2 + A_00_3); const Scalar tmp376 = w8*(A_01_1 + A_01_6 - A_10_0 - A_10_7); const Scalar tmp377 = w28*(A_00_4 + A_00_5); const Scalar tmp378 = w17*(-A_02_2 + A_20_3); const Scalar tmp379 = w17*(A_02_0 + A_20_0); const Scalar tmp380 = w2*(-A_02_7 - A_20_7); const Scalar tmp381 = w20*(-A_01_7 - A_10_7); const Scalar tmp382 = w21*(-A_01_0 - A_10_0); const Scalar tmp383 = w6*(A_12_3 + A_12_5 + A_21_3 + A_21_5); const Scalar tmp384 = w18*(A_12_0 + A_21_0); const Scalar tmp385 = w4*(-A_12_7 - A_21_7); const Scalar tmp386 = w12*(A_12_2 + A_12_4 + A_21_2 + A_21_4); const Scalar tmp387 = w17*(-A_02_6 - A_20_6); const Scalar tmp388 = w2*(A_02_1 + A_20_1); const Scalar tmp389 = w20*(A_01_1 + A_10_1); const Scalar tmp390 = w21*(A_01_6 + A_10_6); const Scalar tmp391 = w18*(A_12_6 + A_21_6); const Scalar tmp392 = w4*(-A_12_1 - A_21_1); const Scalar tmp393 = w2*(A_02_3 + A_20_6); const Scalar tmp394 = w1*(-A_01_3 - A_01_7 + A_10_2 + A_10_6); const Scalar tmp395 = w16*(-A_01_0 - A_01_4 + A_10_1 + A_10_5); const Scalar tmp396 = w17*(-A_02_4 - A_20_1); const Scalar tmp397 = w18*(-A_12_5 - A_21_3); const Scalar tmp398 = w10*(A_12_3 + A_12_4 + A_21_2 + A_21_5); const Scalar tmp399 = w1*(-A_01_0 - A_01_4 + A_10_2 + A_10_6); const Scalar tmp400 = w4*(A_12_2 + A_21_4); const Scalar tmp401 = w16*(-A_01_3 - A_01_7 + A_10_1 + A_10_5); const Scalar tmp402 = w20*(-A_01_2 + A_10_3); const Scalar tmp403 = w21*(-A_01_5 + A_10_4); const Scalar tmp404 = w17*(-A_02_5 + A_20_4); const Scalar tmp405 = w2*(A_02_2 - A_20_3); const Scalar tmp406 = w18*(-A_12_0 + A_21_4); const Scalar tmp407 = w4*(A_12_7 - A_21_3); const Scalar tmp408 = w17*(-A_02_0 + A_20_4); const Scalar tmp409 = w2*(A_02_7 - A_20_3); const Scalar tmp410 = w17*(A_02_5 + A_20_5); const Scalar tmp411 = w2*(-A_02_2 - A_20_2); const Scalar tmp412 = w20*(A_01_2 + A_10_2); const Scalar tmp413 = w21*(A_01_5 + A_10_5); const Scalar tmp414 = w18*(-A_12_5 - A_21_5); const Scalar tmp415 = w4*(A_12_2 + A_21_2); const Scalar tmp416 = w12*(-A_12_0 - A_12_1 + A_21_4 + A_21_5); const Scalar tmp417 = w6*(-A_12_6 - A_12_7 + A_21_2 + A_21_3); const Scalar tmp418 = w17*(A_02_0 + A_20_5); const Scalar tmp419 = w2*(-A_02_7 - A_20_2); const Scalar tmp420 = w18*(-A_12_4 - A_21_2); const Scalar tmp421 = w10*(A_12_2 + A_12_5 + A_21_3 + A_21_4); const Scalar tmp422 = w3*(-A_11_1 - A_11_3 - A_11_5 - A_11_7); const Scalar tmp423 = w1*(A_01_1 + A_01_5 - A_10_3 - A_10_7); const Scalar tmp424 = w25*(-A_22_0 - A_22_2 - A_22_4 - A_22_6); const Scalar tmp425 = w4*(A_12_3 + A_21_5); const Scalar tmp426 = w15*(A_02_4 + A_02_6 - A_20_0 - A_20_2); const Scalar tmp427 = w16*(A_01_2 + A_01_6 - A_10_0 - A_10_4); const Scalar tmp428 = w9*(-A_11_0 - A_11_2 - A_11_4 - A_11_6); const Scalar tmp429 = w5*(A_02_1 + A_02_3 - A_20_5 - A_20_7); const Scalar tmp430 = w23*(-A_22_1 - A_22_3 - A_22_5 - A_22_7); const Scalar tmp431 = w18*(A_12_5 - A_21_7); const Scalar tmp432 = w10*(-A_12_3 - A_12_4 + A_21_1 + A_21_6); const Scalar tmp433 = w21*(A_01_7 - A_10_5); const Scalar tmp434 = w20*(A_01_0 - A_10_2); const Scalar tmp435 = w4*(-A_12_2 + A_21_0); const Scalar tmp436 = w8*(-A_01_3 - A_01_4 + A_10_1 + A_10_6); const Scalar tmp437 = w2*(-A_02_4 + A_20_5); const Scalar tmp438 = w20*(A_01_4 - A_10_5); const Scalar tmp439 = w21*(A_01_3 - A_10_2); const Scalar tmp440 = w16*(-A_01_1 - A_01_2 + A_10_0 + A_10_3); const Scalar tmp441 = w1*(-A_01_5 - A_01_6 + A_10_4 + A_10_7); const Scalar tmp442 = w17*(A_02_3 - A_20_2); const Scalar tmp443 = w20*(-A_01_4 - A_10_7); const Scalar tmp444 = w21*(-A_01_3 - A_10_0); const Scalar tmp445 = w18*(A_12_6 + A_21_0); const Scalar tmp446 = w10*(-A_12_0 - A_12_7 - A_21_1 - A_21_6); const Scalar tmp447 = w1*(-A_01_3 - A_01_7 + A_10_1 + A_10_5); const Scalar tmp448 = w4*(-A_12_1 - A_21_7); const Scalar tmp449 = w16*(-A_01_0 - A_01_4 + A_10_2 + A_10_6); const Scalar tmp450 = w2*(A_02_7 - A_20_6); const Scalar tmp451 = w6*(A_12_6 + A_12_7 + A_21_6 + A_21_7); const Scalar tmp452 = w20*(A_01_7 - A_10_6); const Scalar tmp453 = w21*(A_01_0 - A_10_1); const Scalar tmp454 = w12*(A_12_0 + A_12_1 + A_21_0 + A_21_1); const Scalar tmp455 = w29*(A_00_0 + A_00_1); const Scalar tmp456 = w28*(A_00_6 + A_00_7); const Scalar tmp457 = w17*(-A_02_0 + A_20_1); const Scalar tmp458 = w21*(-A_01_7 - A_10_4); const Scalar tmp459 = w20*(-A_01_0 - A_10_3); const Scalar tmp460 = w12*(A_12_4 + A_12_5 - A_21_6 - A_21_7); const Scalar tmp461 = w6*(A_12_2 + A_12_3 - A_21_0 - A_21_1); const Scalar tmp462 = w18*(A_12_1 + A_21_7); const Scalar tmp463 = w4*(-A_12_6 - A_21_0); const Scalar tmp464 = w15*(A_02_1 + A_02_3 - A_20_5 - A_20_7); const Scalar tmp465 = w5*(A_02_4 + A_02_6 - A_20_0 - A_20_2); const Scalar tmp466 = w2*(-A_02_6 + A_20_7); const Scalar tmp467 = w20*(-A_01_6 + A_10_7); const Scalar tmp468 = w21*(-A_01_1 + A_10_0); const Scalar tmp469 = w17*(A_02_1 - A_20_0); const Scalar tmp470 = w6*(-A_12_2 - A_12_3 - A_21_4 - A_21_5); const Scalar tmp471 = w1*(-A_01_1 - A_01_5 - A_10_2 - A_10_6); const Scalar tmp472 = w15*(-A_02_4 - A_02_6 - A_20_1 - A_20_3); const Scalar tmp473 = w16*(-A_01_2 - A_01_6 - A_10_1 - A_10_5); const Scalar tmp474 = w12*(-A_12_4 - A_12_5 - A_21_2 - A_21_3); const Scalar tmp475 = w5*(-A_02_1 - A_02_3 - A_20_4 - A_20_6); const Scalar tmp476 = w18*(-A_12_6 + A_21_4); const Scalar tmp477 = w20*(A_01_3 - A_10_1); const Scalar tmp478 = w10*(A_12_0 + A_12_7 - A_21_2 - A_21_5); const Scalar tmp479 = w4*(A_12_1 - A_21_3); const Scalar tmp480 = w21*(A_01_4 - A_10_6); const Scalar tmp481 = w8*(-A_01_0 - A_01_7 + A_10_2 + A_10_5); const Scalar tmp482 = w6*(A_12_0 + A_12_1 + A_21_6 + A_21_7); const Scalar tmp483 = w12*(A_12_6 + A_12_7 + A_21_0 + A_21_1); const Scalar tmp484 = w15*(A_02_5 + A_02_7 + A_20_0 + A_20_2); const Scalar tmp485 = w5*(A_02_0 + A_02_2 + A_20_5 + A_20_7); const Scalar tmp486 = w18*(-A_12_1 + A_21_3); const Scalar tmp487 = w20*(A_01_4 - A_10_6); const Scalar tmp488 = w4*(A_12_6 - A_21_4); const Scalar tmp489 = w21*(A_01_3 - A_10_1); const Scalar tmp490 = w20*(A_01_7 - A_10_5); const Scalar tmp491 = w18*(A_12_2 - A_21_0); const Scalar tmp492 = w4*(-A_12_5 + A_21_7); const Scalar tmp493 = w21*(A_01_0 - A_10_2); const Scalar tmp494 = w20*(A_01_1 + A_10_2); const Scalar tmp495 = w21*(A_01_6 + A_10_5); const Scalar tmp496 = w18*(-A_12_2 - A_21_4); const Scalar tmp497 = w4*(A_12_5 + A_21_3); const Scalar tmp498 = w15*(-A_02_0 - A_02_2 + A_20_4 + A_20_6); const Scalar tmp499 = w5*(-A_02_5 - A_02_7 + A_20_1 + A_20_3); const Scalar tmp500 = w18*(-A_12_6 + A_21_2); const Scalar tmp501 = w4*(A_12_1 - A_21_5); const Scalar tmp502 = w17*(A_02_6 - A_20_2); const Scalar tmp503 = w2*(-A_02_1 + A_20_5); const Scalar tmp504 = w18*(-A_12_3 - A_21_5); const Scalar tmp505 = w4*(A_12_4 + A_21_2); const Scalar tmp506 = w2*(A_02_6 + A_20_3); const Scalar tmp507 = w17*(-A_02_1 - A_20_4); const Scalar tmp508 = w18*(A_12_0 + A_21_6); const Scalar tmp509 = w4*(-A_12_7 - A_21_1); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=tmp198 + tmp200 + tmp214 + tmp259 + tmp262 + tmp289 + tmp294 + tmp299 + tmp303 + tmp304 + tmp307 + tmp309 + tmp343 + tmp347 + tmp362 + tmp363 + tmp379 + tmp380 + tmp381 + tmp382 + tmp383 + tmp384 + tmp385 + tmp386; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=tmp161 + tmp201 + tmp247 + tmp250 + tmp371 + tmp374 + tmp44 + tmp451 + tmp454 + tmp455 + tmp456 + tmp466 + tmp467 + tmp468 + tmp469 + tmp49 + tmp89 + tmp91 + tmp92 + tmp98; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=tmp135 + tmp236 + tmp238 + tmp240 + tmp242 + tmp244 + tmp39 + tmp41 + tmp432 + tmp436 + tmp440 + tmp441 + tmp490 + tmp491 + tmp492 + tmp493 + tmp61 + tmp68 + tmp70 + tmp71; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=tmp114 + tmp165 + tmp166 + tmp167 + tmp168 + tmp169 + tmp170 + tmp171 + tmp172 + tmp20 + tmp73 + tmp74 + tmp75 + tmp76 + tmp79 + tmp80; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=tmp1 + tmp127 + tmp131 + tmp141 + tmp145 + tmp146 + tmp148 + tmp15 + tmp189 + tmp190 + tmp192 + tmp193 + tmp2 + tmp243 + tmp246 + tmp406 + tmp407 + tmp408 + tmp409 + tmp5; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=tmp174 + tmp176 + tmp184 + tmp24 + tmp260 + tmp267 + tmp339 + tmp340 + tmp341 + tmp342 + tmp344 + tmp345 + tmp416 + tmp417 + tmp506 + tmp507; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=tmp21 + tmp258 + tmp266 + tmp274 + tmp337 + tmp398 + tmp422 + tmp424 + tmp428 + tmp430 + tmp447 + tmp449 + tmp496 + tmp497 + tmp498 + tmp499; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113 + tmp38 + tmp87; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=tmp145 + tmp148 + tmp161 + tmp201 + tmp202 + tmp210 + tmp371 + tmp374 + tmp440 + tmp441 + tmp450 + tmp451 + tmp452 + tmp453 + tmp454 + tmp455 + tmp456 + tmp457 + tmp89 + tmp91; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=tmp215 + tmp221 + tmp227 + tmp260 + tmp267 + tmp288 + tmp304 + tmp312 + tmp317 + tmp351 + tmp352 + tmp353 + tmp354 + tmp355 + tmp356 + tmp357 + tmp358 + tmp359 + tmp360 + tmp361 + tmp362 + tmp363 + tmp76 + tmp79; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=tmp166 + tmp169 + tmp172 + tmp196 + tmp197 + tmp198 + tmp199 + tmp20 + tmp200 + tmp21 + tmp73 + tmp74 + tmp75 + tmp77 + tmp80 + tmp82; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=tmp36 + tmp37 + tmp38 + tmp39 + tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=tmp176 + tmp24 + tmp269 + tmp274 + tmp339 + tmp340 + tmp342 + tmp343 + tmp344 + tmp347 + tmp394 + tmp395 + tmp416 + tmp417 + tmp418 + tmp419; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=tmp112 + tmp12 + tmp123 + tmp13 + tmp141 + tmp142 + tmp143 + tmp146 + tmp147 + tmp149 + tmp16 + tmp277 + tmp278 + tmp279 + tmp280 + tmp281 + tmp282 + tmp6 + tmp92 + tmp98; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=tmp104 + tmp105 + tmp106 + tmp110 + tmp113 + tmp135 + tmp136 + tmp137 + tmp138 + tmp139 + tmp15 + tmp87; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=tmp114 + tmp184 + tmp225 + tmp232 + tmp329 + tmp330 + tmp332 + tmp334 + tmp335 + tmp337 + tmp338 + tmp421 + tmp464 + tmp465 + tmp504 + tmp505; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=tmp135 + tmp234 + tmp235 + tmp236 + tmp237 + tmp238 + tmp239 + tmp240 + tmp241 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp39 + tmp41 + tmp44 + tmp49 + tmp61 + tmp71; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=tmp114 + tmp120 + tmp167 + tmp170 + tmp198 + tmp20 + tmp200 + tmp24 + tmp443 + tmp444 + tmp73 + tmp74 + tmp75 + tmp80 + tmp81 + tmp83; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=tmp217 + tmp231 + tmp233 + tmp258 + tmp266 + tmp271 + tmp273 + tmp288 + tmp289 + tmp290 + tmp291 + tmp292 + tmp293 + tmp294 + tmp295 + tmp296 + tmp297 + tmp298 + tmp299 + tmp300 + tmp301 + tmp302 + tmp76 + tmp79; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=tmp101 + tmp156 + tmp157 + tmp204 + tmp205 + tmp368 + tmp371 + tmp372 + tmp374 + tmp375 + tmp377 + tmp437 + tmp438 + tmp439 + tmp440 + tmp441 + tmp442 + tmp85 + tmp87 + tmp99; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=tmp184 + tmp21 + tmp328 + tmp337 + tmp383 + tmp386 + tmp422 + tmp423 + tmp424 + tmp427 + tmp428 + tmp430 + tmp498 + tmp499 + tmp508 + tmp509; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=tmp104 + tmp106 + tmp108 + tmp111 + tmp113 + tmp15 + tmp160 + tmp161 + tmp162 + tmp163 + tmp164 + tmp38; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=tmp10 + tmp112 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131 + tmp132 + tmp133 + tmp134 + tmp14 + tmp3 + tmp68 + tmp70 + tmp9; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=tmp166 + tmp175 + tmp176 + tmp178 + tmp179 + tmp180 + tmp183 + tmp187 + tmp270 + tmp272 + tmp274 + tmp284 + tmp285 + tmp364 + tmp365 + tmp366; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=tmp20 + tmp21 + tmp24 + tmp34 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79 + tmp80 + tmp81 + tmp82 + tmp83; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=tmp13 + tmp16 + tmp38 + tmp39 + tmp40 + tmp41 + tmp43 + tmp440 + tmp441 + tmp45 + tmp47 + tmp478 + tmp481 + tmp486 + tmp487 + tmp488 + tmp489 + tmp50 + tmp52 + tmp55; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=tmp101 + tmp14 + tmp204 + tmp205 + tmp367 + tmp368 + tmp369 + tmp370 + tmp371 + tmp372 + tmp373 + tmp374 + tmp375 + tmp376 + tmp377 + tmp378 + tmp44 + tmp49 + tmp87 + tmp9; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=tmp179 + tmp183 + tmp198 + tmp200 + tmp214 + tmp215 + tmp216 + tmp217 + tmp218 + tmp219 + tmp220 + tmp221 + tmp222 + tmp223 + tmp224 + tmp225 + tmp226 + tmp227 + tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=tmp104 + tmp106 + tmp112 + tmp113 + tmp135 + tmp137 + tmp139 + tmp160 + tmp161 + tmp164 + tmp471 + tmp473; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=tmp114 + tmp274 + tmp312 + tmp317 + tmp329 + tmp332 + tmp335 + tmp337 + tmp338 + tmp399 + tmp401 + tmp446 + tmp462 + tmp463 + tmp464 + tmp465; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=tmp166 + tmp175 + tmp176 + tmp177 + tmp178 + tmp180 + tmp181 + tmp184 + tmp187 + tmp271 + tmp273 + tmp283 + tmp284 + tmp285 + tmp286 + tmp287; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=tmp1 + tmp10 + tmp11 + tmp12 + tmp15 + tmp152 + tmp153 + tmp154 + tmp155 + tmp156 + tmp157 + tmp158 + tmp159 + tmp17 + tmp3 + tmp4 + tmp51 + tmp54 + tmp6 + tmp7; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=tmp1 + tmp127 + tmp131 + tmp141 + tmp146 + tmp15 + tmp153 + tmp154 + tmp188 + tmp189 + tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp68 + tmp70 + tmp92 + tmp98; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=tmp166 + tmp176 + tmp184 + tmp283 + tmp339 + tmp340 + tmp341 + tmp342 + tmp343 + tmp344 + tmp345 + tmp346 + tmp347 + tmp348 + tmp349 + tmp350; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=tmp114 + tmp274 + tmp337 + tmp383 + tmp386 + tmp422 + tmp424 + tmp426 + tmp428 + tmp429 + tmp430 + tmp445 + tmp446 + tmp447 + tmp448 + tmp449; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=tmp104 + tmp106 + tmp107 + tmp109 + tmp112 + tmp113 + tmp135 + tmp161 + tmp482 + tmp483 + tmp484 + tmp485; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=tmp118 + tmp121 + tmp214 + tmp215 + tmp216 + tmp217 + tmp220 + tmp222 + tmp253 + tmp254 + tmp255 + tmp256 + tmp257 + tmp258 + tmp259 + tmp260 + tmp261 + tmp262 + tmp263 + tmp264 + tmp265 + tmp266 + tmp267 + tmp268; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=tmp100 + tmp101 + tmp145 + tmp148 + tmp369 + tmp376 + tmp402 + tmp403 + tmp404 + tmp405 + tmp60 + tmp65 + tmp84 + tmp87 + tmp88 + tmp89 + tmp91 + tmp95 + tmp96 + tmp97; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=tmp243 + tmp246 + tmp38 + tmp43 + tmp476 + tmp477 + tmp478 + tmp479 + tmp480 + tmp481 + tmp57 + tmp58 + tmp61 + tmp63 + tmp64 + tmp66 + tmp69 + tmp71 + tmp90 + tmp94; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=tmp166 + tmp176 + tmp260 + tmp267 + tmp274 + tmp339 + tmp340 + tmp342 + tmp344 + tmp346 + tmp348 + tmp365 + tmp393 + tmp394 + tmp395 + tmp396; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=tmp112 + tmp12 + tmp123 + tmp124 + tmp126 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147 + tmp148 + tmp149 + tmp150 + tmp151 + tmp51 + tmp54 + tmp6; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=tmp104 + tmp106 + tmp113 + tmp136 + tmp138 + tmp15 + tmp161 + tmp38 + tmp472 + tmp475 + tmp482 + tmp483; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=tmp184 + tmp21 + tmp312 + tmp317 + tmp327 + tmp328 + tmp329 + tmp330 + tmp331 + tmp332 + tmp333 + tmp334 + tmp335 + tmp336 + tmp337 + tmp338; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91 + tmp92 + tmp93 + tmp94 + tmp95 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=tmp217 + tmp225 + tmp232 + tmp26 + tmp265 + tmp268 + tmp288 + tmp289 + tmp29 + tmp290 + tmp293 + tmp295 + tmp308 + tmp313 + tmp343 + tmp347 + tmp358 + tmp359 + tmp410 + tmp411 + tmp412 + tmp413 + tmp414 + tmp415; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp20 + tmp22 + tmp24 + tmp25 + tmp28 + tmp30 + tmp32 + tmp35; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=tmp13 + tmp135 + tmp16 + tmp237 + tmp238 + tmp245 + tmp319 + tmp320 + tmp321 + tmp322 + tmp323 + tmp324 + tmp325 + tmp326 + tmp45 + tmp55 + tmp57 + tmp60 + tmp64 + tmp65; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=tmp114 + tmp184 + tmp258 + tmp266 + tmp337 + tmp420 + tmp421 + tmp422 + tmp423 + tmp424 + tmp425 + tmp426 + tmp427 + tmp428 + tmp429 + tmp430; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=tmp104 + tmp106 + tmp113 + tmp135 + tmp15 + tmp162 + tmp163 + tmp470 + tmp474 + tmp484 + tmp485 + tmp87; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=tmp10 + tmp112 + tmp123 + tmp125 + tmp127 + tmp128 + tmp130 + tmp131 + tmp132 + tmp156 + tmp157 + tmp243 + tmp246 + tmp278 + tmp279 + tmp3 + tmp500 + tmp501 + tmp502 + tmp503; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=tmp175 + tmp176 + tmp178 + tmp180 + tmp182 + tmp185 + tmp187 + tmp24 + tmp269 + tmp270 + tmp271 + tmp272 + tmp273 + tmp274 + tmp275 + tmp276; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=tmp38 + tmp42 + tmp43 + tmp53 + tmp56 + tmp57 + tmp58 + tmp59 + tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65 + tmp66 + tmp67 + tmp68 + tmp69 + tmp70 + tmp71; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=tmp118 + tmp121 + tmp166 + tmp199 + tmp20 + tmp21 + tmp22 + tmp25 + tmp27 + tmp28 + tmp30 + tmp33 + tmp458 + tmp459 + tmp460 + tmp461; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=tmp179 + tmp183 + tmp215 + tmp255 + tmp26 + tmp261 + tmp288 + tmp29 + tmp298 + tmp300 + tmp304 + tmp316 + tmp318 + tmp351 + tmp354 + tmp355 + tmp383 + tmp386 + tmp387 + tmp388 + tmp389 + tmp390 + tmp391 + tmp392; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=tmp100 + tmp14 + tmp161 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp208 + tmp209 + tmp210 + tmp211 + tmp212 + tmp213 + tmp88 + tmp9 + tmp90 + tmp94; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=tmp104 + tmp106 + tmp112 + tmp113 + tmp38 + tmp470 + tmp471 + tmp472 + tmp473 + tmp474 + tmp475 + tmp87; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=tmp21 + tmp225 + tmp232 + tmp274 + tmp329 + tmp332 + tmp333 + tmp335 + tmp336 + tmp337 + tmp338 + tmp397 + tmp398 + tmp399 + tmp400 + tmp401; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179 + tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp24; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=tmp0 + tmp1 + tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=tmp114 + tmp117 + tmp119 + tmp166 + tmp171 + tmp20 + tmp22 + tmp25 + tmp26 + tmp28 + tmp29 + tmp30 + tmp460 + tmp461 + tmp494 + tmp495; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=tmp135 + tmp238 + tmp320 + tmp324 + tmp325 + tmp326 + tmp431 + tmp432 + tmp433 + tmp434 + tmp435 + tmp436 + tmp45 + tmp51 + tmp54 + tmp55 + tmp57 + tmp64 + tmp90 + tmp94; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=tmp100 + tmp156 + tmp157 + tmp161 + tmp201 + tmp204 + tmp205 + tmp207 + tmp208 + tmp209 + tmp211 + tmp247 + tmp248 + tmp249 + tmp250 + tmp251 + tmp252 + tmp60 + tmp65 + tmp88; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=tmp118 + tmp121 + tmp214 + tmp226 + tmp228 + tmp271 + tmp273 + tmp289 + tmp303 + tmp304 + tmp305 + tmp306 + tmp307 + tmp308 + tmp309 + tmp310 + tmp311 + tmp312 + tmp313 + tmp314 + tmp315 + tmp316 + tmp317 + tmp318; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar Aw00 = 8.*A_p[INDEX4(k,0,m,0, numEq,3, numComp)]*w27; const Scalar Aw01 = 12.*A_p[INDEX4(k,0,m,1, numEq,3, numComp)]*w8; const Scalar Aw02 = 12.*A_p[INDEX4(k,0,m,2, numEq,3, numComp)]*w11; const Scalar Aw10 = 12.*A_p[INDEX4(k,1,m,0, numEq,3, numComp)]*w8; const Scalar Aw11 = 8.*A_p[INDEX4(k,1,m,1, numEq,3, numComp)]*w22; const Scalar Aw12 = 12.*A_p[INDEX4(k,1,m,2, numEq,3, numComp)]*w10; const Scalar Aw20 = 12.*A_p[INDEX4(k,2,m,0, numEq,3, numComp)]*w11; const Scalar Aw21 = 12.*A_p[INDEX4(k,2,m,1, numEq,3, numComp)]*w10; const Scalar Aw22 = 8.*A_p[INDEX4(k,2,m,2, numEq,3, numComp)]*w13; const Scalar tmp0 = Aw01 + Aw10; const Scalar tmp1 = Aw01 - Aw10; const Scalar tmp2 = Aw02 + Aw20; const Scalar tmp3 = Aw02 - Aw20; const Scalar tmp4 = Aw12 + Aw21; const Scalar tmp5 = Aw12 - Aw21; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp2 - 2.*tmp4; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - tmp4 + 2.*tmp1 + 2.*tmp3; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 - 2.*tmp1 + tmp2 - 2.*tmp5; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 - 2.*tmp0 + tmp3 - tmp5; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 - 2.*tmp3 + 2.*tmp5 + tmp0; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - 2.*tmp2 + tmp1 + tmp5; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + 2.*tmp4 - tmp1 - tmp3; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 + tmp4 - tmp0 - tmp2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - 2.*tmp3 - 2.*tmp1 - tmp4; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 - 2.*tmp2 - 2.*tmp4 - 2.*tmp0; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + 2.*tmp0 - tmp5 - tmp3; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 - tmp2 - 2.*tmp5 + 2.*tmp1; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp2 - tmp1 + tmp5; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp5 - tmp0 + 2.*tmp3; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 + tmp4 + tmp2 + tmp0; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp3 + tmp1 + 2.*tmp4; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp5 + tmp2 + 2.*tmp1; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp3 + 2.*tmp0 + tmp5; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp4 + 2.*tmp2 - 2.*tmp0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp4 - 2.*tmp1 + 2.*tmp3; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp1 - 2.*tmp4 - tmp3; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 - tmp4 + tmp0 - tmp2; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 - 2.*tmp3 - tmp0 - 2.*tmp5; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - tmp5 - 2.*tmp2 - tmp1; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 - tmp3 + tmp5 - 2.*tmp0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp5 - 2.*tmp1 - tmp2; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - 2.*tmp3 + tmp4 + 2.*tmp1; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 - 2.*tmp2 + 2.*tmp4; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 - tmp0 + tmp2 - tmp4; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp3 - tmp1 - 2.*tmp4; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - tmp5 + tmp1 + 2.*tmp2; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + tmp0 - 2.*tmp5 + 2.*tmp3; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + tmp0 - 2.*tmp5 + 2.*tmp3; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - tmp5 + tmp1 + 2.*tmp2; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp3 - tmp1 - 2.*tmp4; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 - tmp0 + tmp2 - tmp4; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 - 2.*tmp2 + 2.*tmp4; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - 2.*tmp3 + tmp4 + 2.*tmp1; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp5 - 2.*tmp1 - tmp2; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 - tmp3 + tmp5 - 2.*tmp0; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - tmp5 - 2.*tmp2 - tmp1; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 - 2.*tmp3 - tmp0 - 2.*tmp5; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 - tmp4 + tmp0 - tmp2; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp1 - 2.*tmp4 - tmp3; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 + tmp4 - 2.*tmp1 + 2.*tmp3; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp4 + 2.*tmp2 - 2.*tmp0; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp3 + 2.*tmp0 + tmp5; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 + 2.*tmp5 + tmp2 + 2.*tmp1; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + tmp3 + tmp1 + 2.*tmp4; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 + tmp4 + tmp2 + tmp0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 + 2.*tmp5 - tmp0 + 2.*tmp3; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 + 2.*tmp2 - tmp1 + tmp5; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 - tmp2 - 2.*tmp5 + 2.*tmp1; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + 2.*tmp0 - tmp5 - tmp3; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 - 2.*tmp2 - 2.*tmp4 - 2.*tmp0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - 2.*tmp3 - 2.*tmp1 - tmp4; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+= Aw00 + Aw11 + Aw22 + tmp4 - tmp0 - tmp2; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= -Aw00 + 2.*Aw11 + 2.*Aw22 + 2.*tmp4 - tmp1 - tmp3; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+= 2.*Aw00 - Aw11 + 2.*Aw22 - 2.*tmp2 + tmp1 + tmp5; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=-2.*Aw00 - 2.*Aw11 + 4.*Aw22 - 2.*tmp3 + 2.*tmp5 + tmp0; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+= 2.*Aw00 + 2.*Aw11 - Aw22 + tmp3 - tmp5 - 2.*tmp0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=-2.*Aw00 + 4.*Aw11 - 2.*Aw22 - 2.*tmp1 + tmp2 - 2.*tmp5; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+= 4.*Aw00 - 2.*Aw11 - 2.*Aw22 - tmp4 + 2.*tmp1 + 2.*tmp3; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=-4.*Aw00 - 4.*Aw11 - 4.*Aw22 + 2.*tmp0 + 2.*tmp2 - 2.*tmp4; } } } } /////////////// // process B // /////////////// if (!B.isEmpty()) { const Scalar* B_p = B.getSampleDataRO(e, zero); if (B.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar B_0_0 = B_p[INDEX4(k,0,m,0, numEq,3,numComp)]; const Scalar B_1_0 = B_p[INDEX4(k,1,m,0, numEq,3,numComp)]; const Scalar B_2_0 = B_p[INDEX4(k,2,m,0, numEq,3,numComp)]; const Scalar B_0_1 = B_p[INDEX4(k,0,m,1, numEq,3,numComp)]; const Scalar B_1_1 = B_p[INDEX4(k,1,m,1, numEq,3,numComp)]; const Scalar B_2_1 = B_p[INDEX4(k,2,m,1, numEq,3,numComp)]; const Scalar B_0_2 = B_p[INDEX4(k,0,m,2, numEq,3,numComp)]; const Scalar B_1_2 = B_p[INDEX4(k,1,m,2, numEq,3,numComp)]; const Scalar B_2_2 = B_p[INDEX4(k,2,m,2, numEq,3,numComp)]; const Scalar B_0_3 = B_p[INDEX4(k,0,m,3, numEq,3,numComp)]; const Scalar B_1_3 = B_p[INDEX4(k,1,m,3, numEq,3,numComp)]; const Scalar B_2_3 = B_p[INDEX4(k,2,m,3, numEq,3,numComp)]; const Scalar B_0_4 = B_p[INDEX4(k,0,m,4, numEq,3,numComp)]; const Scalar B_1_4 = B_p[INDEX4(k,1,m,4, numEq,3,numComp)]; const Scalar B_2_4 = B_p[INDEX4(k,2,m,4, numEq,3,numComp)]; const Scalar B_0_5 = B_p[INDEX4(k,0,m,5, numEq,3,numComp)]; const Scalar B_1_5 = B_p[INDEX4(k,1,m,5, numEq,3,numComp)]; const Scalar B_2_5 = B_p[INDEX4(k,2,m,5, numEq,3,numComp)]; const Scalar B_0_6 = B_p[INDEX4(k,0,m,6, numEq,3,numComp)]; const Scalar B_1_6 = B_p[INDEX4(k,1,m,6, numEq,3,numComp)]; const Scalar B_2_6 = B_p[INDEX4(k,2,m,6, numEq,3,numComp)]; const Scalar B_0_7 = B_p[INDEX4(k,0,m,7, numEq,3,numComp)]; const Scalar B_1_7 = B_p[INDEX4(k,1,m,7, numEq,3,numComp)]; const Scalar B_2_7 = B_p[INDEX4(k,2,m,7, numEq,3,numComp)]; const Scalar tmp0 = w38*(B_2_1 + B_2_2); const Scalar tmp1 = w42*(B_1_3 + B_1_7); const Scalar tmp2 = w41*(B_0_3 + B_0_7); const Scalar tmp3 = w37*(B_1_1 + B_1_5); const Scalar tmp4 = w39*(B_0_2 + B_0_6); const Scalar tmp5 = w45*(B_2_5 + B_2_6); const Scalar tmp6 = w36*(B_0_1 + B_0_5); const Scalar tmp7 = w40*(B_1_2 + B_1_6); const Scalar tmp8 = w33*(B_0_0 + B_0_4); const Scalar tmp9 = w34*(B_1_0 + B_1_4); const Scalar tmp10 = w38*(B_2_4 + B_2_5 + B_2_6 + B_2_7); const Scalar tmp11 = w42*(-B_1_6 - B_1_7); const Scalar tmp12 = w41*(-B_0_5 - B_0_7); const Scalar tmp13 = w37*(-B_1_4 - B_1_5); const Scalar tmp14 = w39*(-B_0_4 - B_0_6); const Scalar tmp15 = w45*(B_2_0 + B_2_1 + B_2_2 + B_2_3); const Scalar tmp16 = w36*(-B_0_1 - B_0_3); const Scalar tmp17 = w40*(-B_1_2 - B_1_3); const Scalar tmp18 = w33*(-B_0_0 - B_0_2); const Scalar tmp19 = w34*(-B_1_0 - B_1_1); const Scalar tmp20 = w38*(-B_2_5 - B_2_7); const Scalar tmp21 = w35*(-B_2_4 - B_2_6); const Scalar tmp22 = w41*(B_0_1 + B_0_3); const Scalar tmp23 = w37*(-B_1_2 - B_1_7); const Scalar tmp24 = w39*(B_0_0 + B_0_2); const Scalar tmp25 = w45*(-B_2_0 - B_2_2); const Scalar tmp26 = w36*(B_0_5 + B_0_7); const Scalar tmp27 = w40*(-B_1_0 - B_1_5); const Scalar tmp28 = w33*(B_0_4 + B_0_6); const Scalar tmp29 = w46*(-B_2_1 - B_2_3); const Scalar tmp30 = w38*(B_2_0 + B_2_2); const Scalar tmp31 = w35*(B_2_1 + B_2_3); const Scalar tmp32 = w41*(-B_0_4 - B_0_6); const Scalar tmp33 = w37*(B_1_0 + B_1_5); const Scalar tmp34 = w39*(-B_0_5 - B_0_7); const Scalar tmp35 = w45*(B_2_5 + B_2_7); const Scalar tmp36 = w36*(-B_0_0 - B_0_2); const Scalar tmp37 = w40*(B_1_2 + B_1_7); const Scalar tmp38 = w33*(-B_0_1 - B_0_3); const Scalar tmp39 = w46*(B_2_4 + B_2_6); const Scalar tmp40 = w38*(-B_2_0 - B_2_1 - B_2_2 - B_2_3); const Scalar tmp41 = w42*(B_1_0 + B_1_1); const Scalar tmp42 = w41*(B_0_0 + B_0_2); const Scalar tmp43 = w37*(B_1_2 + B_1_3); const Scalar tmp44 = w39*(B_0_1 + B_0_3); const Scalar tmp45 = w45*(-B_2_4 - B_2_5 - B_2_6 - B_2_7); const Scalar tmp46 = w36*(B_0_4 + B_0_6); const Scalar tmp47 = w40*(B_1_4 + B_1_5); const Scalar tmp48 = w33*(B_0_5 + B_0_7); const Scalar tmp49 = w34*(B_1_6 + B_1_7); const Scalar tmp50 = w38*(B_2_0 + B_2_1); const Scalar tmp51 = w42*(-B_1_4 - B_1_5); const Scalar tmp52 = w35*(B_2_2 + B_2_3); const Scalar tmp53 = w37*(-B_1_6 - B_1_7); const Scalar tmp54 = w39*(B_0_0 + B_0_6); const Scalar tmp55 = w45*(B_2_6 + B_2_7); const Scalar tmp56 = w36*(B_0_1 + B_0_7); const Scalar tmp57 = w40*(-B_1_0 - B_1_1); const Scalar tmp58 = w46*(B_2_4 + B_2_5); const Scalar tmp59 = w34*(-B_1_2 - B_1_3); const Scalar tmp60 = w38*(-B_2_4 - B_2_5 - B_2_6 - B_2_7); const Scalar tmp61 = w37*(-B_1_2 - B_1_3 - B_1_6 - B_1_7); const Scalar tmp62 = w39*(-B_0_1 - B_0_3 - B_0_5 - B_0_7); const Scalar tmp63 = w45*(-B_2_0 - B_2_1 - B_2_2 - B_2_3); const Scalar tmp64 = w36*(-B_0_0 - B_0_2 - B_0_4 - B_0_6); const Scalar tmp65 = w40*(-B_1_0 - B_1_1 - B_1_4 - B_1_5); const Scalar tmp66 = w41*(B_0_4 + B_0_6); const Scalar tmp67 = w39*(B_0_5 + B_0_7); const Scalar tmp68 = w36*(B_0_0 + B_0_2); const Scalar tmp69 = w33*(B_0_1 + B_0_3); const Scalar tmp70 = w38*(-B_2_4 - B_2_7); const Scalar tmp71 = w42*(B_1_2 + B_1_6); const Scalar tmp72 = w41*(-B_0_2 - B_0_6); const Scalar tmp73 = w37*(B_1_0 + B_1_4); const Scalar tmp74 = w39*(-B_0_3 - B_0_7); const Scalar tmp75 = w45*(-B_2_0 - B_2_3); const Scalar tmp76 = w36*(-B_0_0 - B_0_4); const Scalar tmp77 = w40*(B_1_3 + B_1_7); const Scalar tmp78 = w33*(-B_0_1 - B_0_5); const Scalar tmp79 = w34*(B_1_1 + B_1_5); const Scalar tmp80 = w39*(B_0_0 + B_0_2 + B_0_4 + B_0_6); const Scalar tmp81 = w36*(B_0_1 + B_0_3 + B_0_5 + B_0_7); const Scalar tmp82 = w38*(B_2_0 + B_2_3); const Scalar tmp83 = w42*(-B_1_1 - B_1_5); const Scalar tmp84 = w41*(B_0_1 + B_0_5); const Scalar tmp85 = w37*(-B_1_3 - B_1_7); const Scalar tmp86 = w39*(B_0_0 + B_0_4); const Scalar tmp87 = w45*(B_2_4 + B_2_7); const Scalar tmp88 = w36*(B_0_3 + B_0_7); const Scalar tmp89 = w40*(-B_1_0 - B_1_4); const Scalar tmp90 = w33*(B_0_2 + B_0_6); const Scalar tmp91 = w34*(-B_1_2 - B_1_6); const Scalar tmp92 = w38*(-B_2_5 - B_2_6); const Scalar tmp93 = w45*(-B_2_1 - B_2_2); const Scalar tmp94 = w37*(B_1_0 + B_1_1 + B_1_4 + B_1_5); const Scalar tmp95 = w40*(B_1_2 + B_1_3 + B_1_6 + B_1_7); const Scalar tmp96 = w42*(-B_1_2 - B_1_3); const Scalar tmp97 = w41*(-B_0_1 - B_0_3); const Scalar tmp98 = w37*(-B_1_0 - B_1_1); const Scalar tmp99 = w39*(-B_0_0 - B_0_2); const Scalar tmp100 = w36*(-B_0_5 - B_0_7); const Scalar tmp101 = w40*(-B_1_6 - B_1_7); const Scalar tmp102 = w33*(-B_0_4 - B_0_6); const Scalar tmp103 = w34*(-B_1_4 - B_1_5); const Scalar tmp104 = w38*(B_2_6 + B_2_7); const Scalar tmp105 = w35*(B_2_4 + B_2_5); const Scalar tmp106 = w41*(B_0_2 + B_0_6); const Scalar tmp107 = w37*(B_1_2 + B_1_3 + B_1_6 + B_1_7); const Scalar tmp108 = w39*(B_0_3 + B_0_7); const Scalar tmp109 = w45*(B_2_0 + B_2_1); const Scalar tmp110 = w36*(B_0_0 + B_0_4); const Scalar tmp111 = w40*(B_1_0 + B_1_1 + B_1_4 + B_1_5); const Scalar tmp112 = w33*(B_0_1 + B_0_5); const Scalar tmp113 = w46*(B_2_2 + B_2_3); const Scalar tmp114 = w42*(-B_1_0 - B_1_4); const Scalar tmp115 = w41*(-B_0_0 - B_0_4); const Scalar tmp116 = w37*(-B_1_2 - B_1_6); const Scalar tmp117 = w39*(-B_0_1 - B_0_5); const Scalar tmp118 = w36*(-B_0_2 - B_0_6); const Scalar tmp119 = w40*(-B_1_1 - B_1_5); const Scalar tmp120 = w33*(-B_0_3 - B_0_7); const Scalar tmp121 = w34*(-B_1_3 - B_1_7); const Scalar tmp122 = w38*(B_2_2 + B_2_3); const Scalar tmp123 = w42*(B_1_6 + B_1_7); const Scalar tmp124 = w35*(B_2_0 + B_2_1); const Scalar tmp125 = w37*(B_1_4 + B_1_5); const Scalar tmp126 = w39*(-B_0_3 - B_0_5); const Scalar tmp127 = w45*(B_2_4 + B_2_5); const Scalar tmp128 = w36*(-B_0_2 - B_0_4); const Scalar tmp129 = w40*(B_1_2 + B_1_3); const Scalar tmp130 = w46*(B_2_6 + B_2_7); const Scalar tmp131 = w34*(B_1_0 + B_1_1); const Scalar tmp132 = w38*(-B_2_1 - B_2_2); const Scalar tmp133 = w37*(B_1_2 + B_1_7); const Scalar tmp134 = w39*(B_0_1 + B_0_7); const Scalar tmp135 = w36*(B_0_0 + B_0_6); const Scalar tmp136 = w40*(B_1_0 + B_1_5); const Scalar tmp137 = w45*(-B_2_5 - B_2_6); const Scalar tmp138 = w38*(-B_2_4 - B_2_6); const Scalar tmp139 = w35*(-B_2_5 - B_2_7); const Scalar tmp140 = w41*(-B_0_0 - B_0_2); const Scalar tmp141 = w37*(B_1_1 + B_1_4); const Scalar tmp142 = w39*(-B_0_1 - B_0_3); const Scalar tmp143 = w45*(-B_2_1 - B_2_3); const Scalar tmp144 = w36*(-B_0_4 - B_0_6); const Scalar tmp145 = w40*(B_1_3 + B_1_6); const Scalar tmp146 = w33*(-B_0_5 - B_0_7); const Scalar tmp147 = w46*(-B_2_0 - B_2_2); const Scalar tmp148 = w39*(B_0_2 + B_0_4); const Scalar tmp149 = w36*(B_0_3 + B_0_5); const Scalar tmp150 = w38*(B_2_5 + B_2_6); const Scalar tmp151 = w37*(-B_1_0 - B_1_5); const Scalar tmp152 = w39*(-B_0_0 - B_0_6); const Scalar tmp153 = w45*(B_2_1 + B_2_2); const Scalar tmp154 = w36*(-B_0_1 - B_0_7); const Scalar tmp155 = w40*(-B_1_2 - B_1_7); const Scalar tmp156 = w41*(-B_0_3 - B_0_7); const Scalar tmp157 = w39*(-B_0_2 - B_0_6); const Scalar tmp158 = w36*(-B_0_1 - B_0_5); const Scalar tmp159 = w33*(-B_0_0 - B_0_4); const Scalar tmp160 = w38*(-B_2_2 - B_2_3); const Scalar tmp161 = w35*(-B_2_0 - B_2_1); const Scalar tmp162 = w45*(-B_2_4 - B_2_5); const Scalar tmp163 = w46*(-B_2_6 - B_2_7); const Scalar tmp164 = w38*(-B_2_0 - B_2_3); const Scalar tmp165 = w37*(B_1_3 + B_1_6); const Scalar tmp166 = w40*(B_1_1 + B_1_4); const Scalar tmp167 = w45*(-B_2_4 - B_2_7); const Scalar tmp168 = w39*(B_0_3 + B_0_5); const Scalar tmp169 = w36*(B_0_2 + B_0_4); const Scalar tmp170 = w38*(B_2_1 + B_2_3); const Scalar tmp171 = w35*(B_2_0 + B_2_2); const Scalar tmp172 = w41*(B_0_5 + B_0_7); const Scalar tmp173 = w37*(-B_1_3 - B_1_6); const Scalar tmp174 = w39*(B_0_4 + B_0_6); const Scalar tmp175 = w45*(B_2_4 + B_2_6); const Scalar tmp176 = w36*(B_0_1 + B_0_3); const Scalar tmp177 = w40*(-B_1_1 - B_1_4); const Scalar tmp178 = w33*(B_0_0 + B_0_2); const Scalar tmp179 = w46*(B_2_5 + B_2_7); const Scalar tmp180 = w38*(B_2_5 + B_2_7); const Scalar tmp181 = w42*(-B_1_3 - B_1_7); const Scalar tmp182 = w35*(B_2_4 + B_2_6); const Scalar tmp183 = w37*(-B_1_1 - B_1_5); const Scalar tmp184 = w39*(B_0_1 + B_0_3 + B_0_5 + B_0_7); const Scalar tmp185 = w45*(B_2_0 + B_2_2); const Scalar tmp186 = w36*(B_0_0 + B_0_2 + B_0_4 + B_0_6); const Scalar tmp187 = w40*(-B_1_2 - B_1_6); const Scalar tmp188 = w46*(B_2_1 + B_2_3); const Scalar tmp189 = w34*(-B_1_0 - B_1_4); const Scalar tmp190 = w38*(B_2_4 + B_2_5); const Scalar tmp191 = w35*(B_2_6 + B_2_7); const Scalar tmp192 = w41*(-B_0_1 - B_0_5); const Scalar tmp193 = w37*(-B_1_0 - B_1_1 - B_1_4 - B_1_5); const Scalar tmp194 = w39*(-B_0_0 - B_0_4); const Scalar tmp195 = w45*(B_2_2 + B_2_3); const Scalar tmp196 = w36*(-B_0_3 - B_0_7); const Scalar tmp197 = w40*(-B_1_2 - B_1_3 - B_1_6 - B_1_7); const Scalar tmp198 = w33*(-B_0_2 - B_0_6); const Scalar tmp199 = w46*(B_2_0 + B_2_1); const Scalar tmp200 = w38*(-B_2_6 - B_2_7); const Scalar tmp201 = w42*(B_1_2 + B_1_3); const Scalar tmp202 = w35*(-B_2_4 - B_2_5); const Scalar tmp203 = w37*(B_1_0 + B_1_1); const Scalar tmp204 = w45*(-B_2_0 - B_2_1); const Scalar tmp205 = w40*(B_1_6 + B_1_7); const Scalar tmp206 = w46*(-B_2_2 - B_2_3); const Scalar tmp207 = w34*(B_1_4 + B_1_5); const Scalar tmp208 = w37*(-B_1_1 - B_1_4); const Scalar tmp209 = w39*(-B_0_2 - B_0_4); const Scalar tmp210 = w36*(-B_0_3 - B_0_5); const Scalar tmp211 = w40*(-B_1_3 - B_1_6); const Scalar tmp212 = w38*(B_2_4 + B_2_7); const Scalar tmp213 = w45*(B_2_0 + B_2_3); const Scalar tmp214 = w41*(B_0_0 + B_0_4); const Scalar tmp215 = w39*(B_0_1 + B_0_5); const Scalar tmp216 = w36*(B_0_2 + B_0_6); const Scalar tmp217 = w33*(B_0_3 + B_0_7); const Scalar tmp218 = w42*(B_1_1 + B_1_5); const Scalar tmp219 = w37*(B_1_3 + B_1_7); const Scalar tmp220 = w40*(B_1_0 + B_1_4); const Scalar tmp221 = w34*(B_1_2 + B_1_6); const Scalar tmp222 = w39*(-B_0_1 - B_0_7); const Scalar tmp223 = w36*(-B_0_0 - B_0_6); const Scalar tmp224 = w38*(-B_2_0 - B_2_1); const Scalar tmp225 = w35*(-B_2_2 - B_2_3); const Scalar tmp226 = w45*(-B_2_6 - B_2_7); const Scalar tmp227 = w46*(-B_2_4 - B_2_5); const Scalar tmp228 = w38*(B_2_4 + B_2_6); const Scalar tmp229 = w42*(B_1_0 + B_1_4); const Scalar tmp230 = w35*(B_2_5 + B_2_7); const Scalar tmp231 = w37*(B_1_2 + B_1_6); const Scalar tmp232 = w39*(-B_0_0 - B_0_2 - B_0_4 - B_0_6); const Scalar tmp233 = w45*(B_2_1 + B_2_3); const Scalar tmp234 = w36*(-B_0_1 - B_0_3 - B_0_5 - B_0_7); const Scalar tmp235 = w40*(B_1_1 + B_1_5); const Scalar tmp236 = w46*(B_2_0 + B_2_2); const Scalar tmp237 = w34*(B_1_3 + B_1_7); const Scalar tmp238 = w42*(-B_1_2 - B_1_6); const Scalar tmp239 = w37*(-B_1_0 - B_1_4); const Scalar tmp240 = w40*(-B_1_3 - B_1_7); const Scalar tmp241 = w34*(-B_1_1 - B_1_5); const Scalar tmp242 = w38*(-B_2_4 - B_2_5); const Scalar tmp243 = w42*(-B_1_0 - B_1_1); const Scalar tmp244 = w35*(-B_2_6 - B_2_7); const Scalar tmp245 = w37*(-B_1_2 - B_1_3); const Scalar tmp246 = w45*(-B_2_2 - B_2_3); const Scalar tmp247 = w40*(-B_1_4 - B_1_5); const Scalar tmp248 = w46*(-B_2_0 - B_2_1); const Scalar tmp249 = w34*(-B_1_6 - B_1_7); const Scalar tmp250 = w42*(B_1_4 + B_1_5); const Scalar tmp251 = w37*(B_1_6 + B_1_7); const Scalar tmp252 = w40*(B_1_0 + B_1_1); const Scalar tmp253 = w34*(B_1_2 + B_1_3); const Scalar tmp254 = w38*(-B_2_1 - B_2_3); const Scalar tmp255 = w35*(-B_2_0 - B_2_2); const Scalar tmp256 = w45*(-B_2_4 - B_2_6); const Scalar tmp257 = w46*(-B_2_5 - B_2_7); const Scalar tmp258 = w38*(B_2_0 + B_2_1 + B_2_2 + B_2_3); const Scalar tmp259 = w45*(B_2_4 + B_2_5 + B_2_6 + B_2_7); const Scalar tmp260 = w38*(-B_2_0 - B_2_2); const Scalar tmp261 = w35*(-B_2_1 - B_2_3); const Scalar tmp262 = w45*(-B_2_5 - B_2_7); const Scalar tmp263 = w46*(-B_2_4 - B_2_6); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=-B_0_0*w50 - B_0_1*w41 - B_0_6*w33 - B_0_7*w49 + B_1_0*w47 - B_1_2*w42 - B_1_5*w34 + B_1_7*w48 - B_2_0*w43 - B_2_3*w35 - B_2_4*w46 - B_2_7*w44 + tmp132 + tmp137 + tmp208 + tmp209 + tmp210 + tmp211; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=-B_0_0*w41 - B_0_1*w50 - B_0_6*w49 - B_0_7*w33 + tmp126 + tmp128 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=-B_1_0*w42 + B_1_2*w47 + B_1_5*w48 - B_1_7*w34 + tmp138 + tmp139 + tmp140 + tmp142 + tmp143 + tmp144 + tmp146 + tmp147 + tmp173 + tmp177; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp40 + tmp45 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=-B_2_0*w46 - B_2_3*w44 - B_2_4*w43 - B_2_7*w35 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp92 + tmp93; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=tmp192 + tmp193 + tmp194 + tmp196 + tmp197 + tmp198 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=tmp232 + tmp234 + tmp238 + tmp239 + tmp240 + tmp241 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=B_0_0*w50 + B_0_1*w41 + B_0_6*w33 + B_0_7*w49 + tmp148 + tmp149 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=B_0_0*w41 + B_0_1*w50 + B_0_6*w49 + B_0_7*w33 + B_1_1*w47 - B_1_3*w42 - B_1_4*w34 + B_1_6*w48 - B_2_1*w43 - B_2_2*w35 - B_2_5*w46 - B_2_6*w44 + tmp151 + tmp155 + tmp164 + tmp167 + tmp168 + tmp169; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=tmp101 + tmp103 + tmp40 + tmp42 + tmp44 + tmp45 + tmp46 + tmp48 + tmp96 + tmp98; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=-B_1_1*w42 + B_1_3*w47 + B_1_4*w48 - B_1_6*w34 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=tmp193 + tmp197 + tmp214 + tmp215 + tmp216 + tmp217 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=-B_2_1*w46 - B_2_2*w44 - B_2_5*w43 - B_2_6*w35 + tmp70 + tmp75 + tmp83 + tmp84 + tmp85 + tmp86 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=tmp60 + tmp61 + tmp63 + tmp65 + tmp80 + tmp81; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=tmp181 + tmp183 + tmp184 + tmp186 + tmp187 + tmp189 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=-B_1_0*w47 + B_1_2*w42 + B_1_5*w34 - B_1_7*w48 + tmp138 + tmp139 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=tmp100 + tmp102 + tmp40 + tmp41 + tmp43 + tmp45 + tmp47 + tmp49 + tmp97 + tmp99; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=-B_0_2*w50 - B_0_3*w41 - B_0_4*w33 - B_0_5*w49 + B_1_0*w42 - B_1_2*w47 - B_1_5*w48 + B_1_7*w34 - B_2_1*w35 - B_2_2*w43 - B_2_5*w44 - B_2_6*w46 + tmp152 + tmp154 + tmp164 + tmp165 + tmp166 + tmp167; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=-B_0_2*w41 - B_0_3*w50 - B_0_4*w49 - B_0_5*w33 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp222 + tmp223; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=tmp229 + tmp231 + tmp232 + tmp234 + tmp235 + tmp237 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=tmp60 + tmp62 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=-B_2_1*w44 - B_2_2*w46 - B_2_5*w35 - B_2_6*w43 + tmp70 + tmp71 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=tmp107 + tmp111 + tmp156 + tmp157 + tmp158 + tmp159 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=-B_1_1*w47 + B_1_3*w42 + B_1_4*w34 - B_1_6*w48 + tmp20 + tmp21 + tmp22 + tmp24 + tmp25 + tmp26 + tmp28 + tmp29 + tmp33 + tmp37; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=B_0_2*w50 + B_0_3*w41 + B_0_4*w33 + B_0_5*w49 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp54 + tmp56; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=B_0_2*w41 + B_0_3*w50 + B_0_4*w49 + B_0_5*w33 + B_1_1*w42 - B_1_3*w47 - B_1_4*w48 + B_1_6*w34 - B_2_0*w35 - B_2_3*w43 - B_2_4*w44 - B_2_7*w46 + tmp132 + tmp133 + tmp134 + tmp135 + tmp136 + tmp137; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=tmp60 + tmp63 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=tmp184 + tmp186 + tmp218 + tmp219 + tmp220 + tmp221 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=tmp106 + tmp107 + tmp108 + tmp110 + tmp111 + tmp112 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=-B_2_0*w44 - B_2_3*w46 - B_2_4*w35 - B_2_7*w43 + tmp1 + tmp2 + tmp3 + tmp4 + tmp6 + tmp7 + tmp8 + tmp9 + tmp92 + tmp93; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=B_2_0*w43 + B_2_3*w35 + B_2_4*w46 + B_2_7*w44 + tmp0 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp5; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp196 + tmp197 + tmp198 + tmp199; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=tmp228 + tmp230 + tmp232 + tmp233 + tmp234 + tmp236 + tmp238 + tmp239 + tmp240 + tmp241; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=tmp258 + tmp259 + tmp61 + tmp62 + tmp64 + tmp65; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=-B_0_2*w33 - B_0_3*w49 - B_0_4*w50 - B_0_5*w41 - B_1_1*w34 + B_1_3*w48 + B_1_4*w47 - B_1_6*w42 + B_2_0*w46 + B_2_3*w44 + B_2_4*w43 + B_2_7*w35 + tmp150 + tmp151 + tmp152 + tmp153 + tmp154 + tmp155; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=-B_0_2*w49 - B_0_3*w33 - B_0_4*w41 - B_0_5*w50 + tmp222 + tmp223 + tmp50 + tmp51 + tmp52 + tmp53 + tmp55 + tmp57 + tmp58 + tmp59; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=B_1_1*w48 - B_1_3*w34 - B_1_4*w42 + B_1_6*w47 + tmp23 + tmp27 + tmp30 + tmp31 + tmp32 + tmp34 + tmp35 + tmp36 + tmp38 + tmp39; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=tmp190 + tmp191 + tmp193 + tmp195 + tmp197 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=B_2_1*w43 + B_2_2*w35 + B_2_5*w46 + B_2_6*w44 + tmp82 + tmp83 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=tmp258 + tmp259 + tmp61 + tmp65 + tmp80 + tmp81; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp188 + tmp189; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=B_0_2*w33 + B_0_3*w49 + B_0_4*w50 + B_0_5*w41 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=B_0_2*w49 + B_0_3*w33 + B_0_4*w41 + B_0_5*w50 - B_1_0*w34 + B_1_2*w48 + B_1_5*w47 - B_1_7*w42 + B_2_1*w46 + B_2_2*w44 + B_2_5*w43 + B_2_6*w35 + tmp134 + tmp135 + tmp208 + tmp211 + tmp212 + tmp213; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=tmp10 + tmp11 + tmp13 + tmp15 + tmp17 + tmp19 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=B_1_0*w48 - B_1_2*w34 - B_1_5*w42 + B_1_7*w47 + tmp170 + tmp171 + tmp172 + tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233 + tmp234 + tmp235 + tmp236 + tmp237; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=tmp258 + tmp259 + tmp62 + tmp64 + tmp94 + tmp95; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=B_2_1*w35 + B_2_2*w43 + B_2_5*w44 + B_2_6*w46 + tmp71 + tmp72 + tmp73 + tmp74 + tmp76 + tmp77 + tmp78 + tmp79 + tmp82 + tmp87; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=tmp104 + tmp105 + tmp107 + tmp109 + tmp111 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=B_1_1*w34 - B_1_3*w48 - B_1_4*w47 + B_1_6*w42 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=tmp10 + tmp12 + tmp14 + tmp15 + tmp16 + tmp18 + tmp250 + tmp251 + tmp252 + tmp253; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=-B_0_0*w33 - B_0_1*w49 - B_0_6*w50 - B_0_7*w41 - B_1_1*w48 + B_1_3*w34 + B_1_4*w42 - B_1_6*w47 + B_2_1*w44 + B_2_2*w46 + B_2_5*w35 + B_2_6*w43 + tmp133 + tmp136 + tmp209 + tmp210 + tmp212 + tmp213; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=-B_0_0*w49 - B_0_1*w33 - B_0_6*w41 - B_0_7*w50 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=tmp258 + tmp259 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=tmp180 + tmp182 + tmp184 + tmp185 + tmp186 + tmp188 + tmp218 + tmp219 + tmp220 + tmp221; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=B_2_0*w35 + B_2_3*w43 + B_2_4*w44 + B_2_7*w46 + tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=tmp10 + tmp15 + tmp250 + tmp251 + tmp252 + tmp253 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=B_1_0*w34 - B_1_2*w48 - B_1_5*w47 + B_1_7*w42 + tmp141 + tmp145 + tmp170 + tmp171 + tmp172 + tmp174 + tmp175 + tmp176 + tmp178 + tmp179; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=B_0_0*w33 + B_0_1*w49 + B_0_6*w50 + B_0_7*w41 + tmp122 + tmp123 + tmp124 + tmp125 + tmp127 + tmp129 + tmp130 + tmp131 + tmp148 + tmp149; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=B_0_0*w49 + B_0_1*w33 + B_0_6*w41 + B_0_7*w50 - B_1_0*w48 + B_1_2*w34 + B_1_5*w42 - B_1_7*w47 + B_2_0*w44 + B_2_3*w46 + B_2_4*w35 + B_2_7*w43 + tmp150 + tmp153 + tmp165 + tmp166 + tmp168 + tmp169; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wB0 = B_p[INDEX3(k,0,m,numEq,3)]*w55; const Scalar wB1 = B_p[INDEX3(k,1,m,numEq,3)]*w56; const Scalar wB2 = B_p[INDEX3(k,2,m,numEq,3)]*w54; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+= 4.*wB0 + 4.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+= 4.*wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+= 2.*wB0 + 4.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+= 2.*wB0 + 2.*wB1 + wB2; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+= 2.*wB0 + 2.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+= 2.*wB0 + wB1 + 2.*wB2; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+= wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=-4.*wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=-4.*wB0 + 4.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=-2.*wB0 + 2.*wB1 + wB2; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=-2.*wB0 + 4.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=-2.*wB0 + wB1 + 2.*wB2; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=-2.*wB0 + 2.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+= -wB0 + wB1 + wB2; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= -wB0 + 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+= 2.*wB0 - 4.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+= 2.*wB0 - 2.*wB1 + wB2; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+= 4.*wB0 - 4.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+= 4.*wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+= wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+= 2.*wB0 - 2.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+= 2.*wB0 - wB1 + 2.*wB2; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=-2.*wB0 - 2.*wB1 + wB2; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=-2.*wB0 - 4.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=-4.*wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=-4.*wB0 - 4.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+= -wB0 - wB1 + wB2; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= -wB0 - 2.*wB1 + 2.*wB2; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=-2.*wB0 - wB1 + 2.*wB2; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=-2.*wB0 - 2.*wB1 + 4.*wB2; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+= 2.*wB0 + 2.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+= 2.*wB0 + wB1 - 2.*wB2; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+= wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+= 4.*wB0 + 4.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+= 4.*wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+= 2.*wB0 + 4.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+= 2.*wB0 + 2.*wB1 - wB2; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=-2.*wB0 + wB1 - 2.*wB2; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=-2.*wB0 + 2.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+= -wB0 + wB1 - wB2; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= -wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=-4.*wB0 + 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=-4.*wB0 + 4.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=-2.*wB0 + 2.*wB1 - wB2; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=-2.*wB0 + 4.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+= wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+= 2.*wB0 - 2.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+= 2.*wB0 - wB1 - 2.*wB2; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+= 2.*wB0 - 4.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+= 2.*wB0 - 2.*wB1 - wB2; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+= 4.*wB0 - 4.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+= 4.*wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+= -wB0 - wB1 - wB2; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= -wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=-2.*wB0 - wB1 - 2.*wB2; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=-2.*wB0 - 2.*wB1 - 4.*wB2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=-2.*wB0 - 2.*wB1 - wB2; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=-2.*wB0 - 4.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=-4.*wB0 - 2.*wB1 - 2.*wB2; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=-4.*wB0 - 4.*wB1 - 4.*wB2; } } } } /////////////// // process C // /////////////// if (!C.isEmpty()) { const Scalar* C_p = C.getSampleDataRO(e, zero); if (C.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar C_0_0 = C_p[INDEX4(k,m,0, 0, numEq,numComp,3)]; const Scalar C_1_0 = C_p[INDEX4(k,m,1, 0, numEq,numComp,3)]; const Scalar C_2_0 = C_p[INDEX4(k,m,2, 0, numEq,numComp,3)]; const Scalar C_0_1 = C_p[INDEX4(k,m,0, 1, numEq,numComp,3)]; const Scalar C_1_1 = C_p[INDEX4(k,m,1, 1, numEq,numComp,3)]; const Scalar C_2_1 = C_p[INDEX4(k,m,2, 1, numEq,numComp,3)]; const Scalar C_0_2 = C_p[INDEX4(k,m,0, 2, numEq,numComp,3)]; const Scalar C_1_2 = C_p[INDEX4(k,m,1, 2, numEq,numComp,3)]; const Scalar C_2_2 = C_p[INDEX4(k,m,2, 2, numEq,numComp,3)]; const Scalar C_0_3 = C_p[INDEX4(k,m,0, 3, numEq,numComp,3)]; const Scalar C_1_3 = C_p[INDEX4(k,m,1, 3, numEq,numComp,3)]; const Scalar C_2_3 = C_p[INDEX4(k,m,2, 3, numEq,numComp,3)]; const Scalar C_0_4 = C_p[INDEX4(k,m,0, 4, numEq,numComp,3)]; const Scalar C_1_4 = C_p[INDEX4(k,m,1, 4, numEq,numComp,3)]; const Scalar C_2_4 = C_p[INDEX4(k,m,2, 4, numEq,numComp,3)]; const Scalar C_0_5 = C_p[INDEX4(k,m,0, 5, numEq,numComp,3)]; const Scalar C_1_5 = C_p[INDEX4(k,m,1, 5, numEq,numComp,3)]; const Scalar C_2_5 = C_p[INDEX4(k,m,2, 5, numEq,numComp,3)]; const Scalar C_0_6 = C_p[INDEX4(k,m,0, 6, numEq,numComp,3)]; const Scalar C_1_6 = C_p[INDEX4(k,m,1, 6, numEq,numComp,3)]; const Scalar C_2_6 = C_p[INDEX4(k,m,2, 6, numEq,numComp,3)]; const Scalar C_0_7 = C_p[INDEX4(k,m,0, 7, numEq,numComp,3)]; const Scalar C_1_7 = C_p[INDEX4(k,m,1, 7, numEq,numComp,3)]; const Scalar C_2_7 = C_p[INDEX4(k,m,2, 7, numEq,numComp,3)]; const Scalar tmp0 = w38*(-C_2_5 - C_2_6); const Scalar tmp1 = w42*(C_1_3 + C_1_7); const Scalar tmp2 = w41*(C_0_3 + C_0_7); const Scalar tmp3 = w37*(C_1_1 + C_1_5); const Scalar tmp4 = w39*(C_0_2 + C_0_6); const Scalar tmp5 = w45*(-C_2_1 - C_2_2); const Scalar tmp6 = w36*(C_0_1 + C_0_5); const Scalar tmp7 = w40*(C_1_2 + C_1_6); const Scalar tmp8 = w33*(C_0_0 + C_0_4); const Scalar tmp9 = w34*(C_1_0 + C_1_4); const Scalar tmp10 = w38*(C_2_4 + C_2_5 + C_2_6 + C_2_7); const Scalar tmp11 = w42*(C_1_4 + C_1_5); const Scalar tmp12 = w41*(C_0_4 + C_0_6); const Scalar tmp13 = w37*(C_1_6 + C_1_7); const Scalar tmp14 = w39*(C_0_5 + C_0_7); const Scalar tmp15 = w45*(C_2_0 + C_2_1 + C_2_2 + C_2_3); const Scalar tmp16 = w36*(C_0_0 + C_0_2); const Scalar tmp17 = w40*(C_1_0 + C_1_1); const Scalar tmp18 = w33*(C_0_1 + C_0_3); const Scalar tmp19 = w34*(C_1_2 + C_1_3); const Scalar tmp20 = w38*(-C_2_5 - C_2_7); const Scalar tmp21 = w35*(-C_2_4 - C_2_6); const Scalar tmp22 = w41*(C_0_1 + C_0_3); const Scalar tmp23 = w37*(C_1_0 + C_1_5); const Scalar tmp24 = w39*(C_0_0 + C_0_2); const Scalar tmp25 = w45*(-C_2_0 - C_2_2); const Scalar tmp26 = w36*(C_0_5 + C_0_7); const Scalar tmp27 = w40*(C_1_2 + C_1_7); const Scalar tmp28 = w33*(C_0_4 + C_0_6); const Scalar tmp29 = w46*(-C_2_1 - C_2_3); const Scalar tmp30 = w38*(C_2_0 + C_2_2); const Scalar tmp31 = w35*(C_2_1 + C_2_3); const Scalar tmp32 = w41*(-C_0_4 - C_0_6); const Scalar tmp33 = w37*(-C_1_2 - C_1_7); const Scalar tmp34 = w39*(-C_0_5 - C_0_7); const Scalar tmp35 = w45*(C_2_5 + C_2_7); const Scalar tmp36 = w36*(-C_0_0 - C_0_2); const Scalar tmp37 = w40*(-C_1_0 - C_1_5); const Scalar tmp38 = w33*(-C_0_1 - C_0_3); const Scalar tmp39 = w46*(C_2_4 + C_2_6); const Scalar tmp40 = w38*(-C_2_0 - C_2_1 - C_2_2 - C_2_3); const Scalar tmp41 = w42*(-C_1_2 - C_1_3); const Scalar tmp42 = w41*(-C_0_1 - C_0_3); const Scalar tmp43 = w37*(-C_1_0 - C_1_1); const Scalar tmp44 = w39*(-C_0_0 - C_0_2); const Scalar tmp45 = w45*(-C_2_4 - C_2_5 - C_2_6 - C_2_7); const Scalar tmp46 = w36*(-C_0_5 - C_0_7); const Scalar tmp47 = w40*(-C_1_6 - C_1_7); const Scalar tmp48 = w33*(-C_0_4 - C_0_6); const Scalar tmp49 = w34*(-C_1_4 - C_1_5); const Scalar tmp50 = w38*(C_2_0 + C_2_1); const Scalar tmp51 = w42*(-C_1_4 - C_1_5); const Scalar tmp52 = w35*(C_2_2 + C_2_3); const Scalar tmp53 = w37*(-C_1_6 - C_1_7); const Scalar tmp54 = w39*(-C_0_1 - C_0_7); const Scalar tmp55 = w45*(C_2_6 + C_2_7); const Scalar tmp56 = w36*(-C_0_0 - C_0_6); const Scalar tmp57 = w40*(-C_1_0 - C_1_1); const Scalar tmp58 = w46*(C_2_4 + C_2_5); const Scalar tmp59 = w34*(-C_1_2 - C_1_3); const Scalar tmp60 = w38*(C_2_0 + C_2_1 + C_2_2 + C_2_3); const Scalar tmp61 = w37*(C_1_0 + C_1_1 + C_1_4 + C_1_5); const Scalar tmp62 = w39*(C_0_0 + C_0_2 + C_0_4 + C_0_6); const Scalar tmp63 = w45*(C_2_4 + C_2_5 + C_2_6 + C_2_7); const Scalar tmp64 = w36*(C_0_1 + C_0_3 + C_0_5 + C_0_7); const Scalar tmp65 = w40*(C_1_2 + C_1_3 + C_1_6 + C_1_7); const Scalar tmp66 = w41*(-C_0_5 - C_0_7); const Scalar tmp67 = w39*(-C_0_4 - C_0_6); const Scalar tmp68 = w36*(-C_0_1 - C_0_3); const Scalar tmp69 = w33*(-C_0_0 - C_0_2); const Scalar tmp70 = w38*(C_2_0 + C_2_3); const Scalar tmp71 = w42*(C_1_2 + C_1_6); const Scalar tmp72 = w41*(-C_0_2 - C_0_6); const Scalar tmp73 = w37*(C_1_0 + C_1_4); const Scalar tmp74 = w39*(-C_0_3 - C_0_7); const Scalar tmp75 = w45*(C_2_4 + C_2_7); const Scalar tmp76 = w36*(-C_0_0 - C_0_4); const Scalar tmp77 = w40*(C_1_3 + C_1_7); const Scalar tmp78 = w33*(-C_0_1 - C_0_5); const Scalar tmp79 = w34*(C_1_1 + C_1_5); const Scalar tmp80 = w39*(-C_0_1 - C_0_3 - C_0_5 - C_0_7); const Scalar tmp81 = w36*(-C_0_0 - C_0_2 - C_0_4 - C_0_6); const Scalar tmp82 = w38*(-C_2_4 - C_2_7); const Scalar tmp83 = w42*(-C_1_1 - C_1_5); const Scalar tmp84 = w41*(C_0_1 + C_0_5); const Scalar tmp85 = w37*(-C_1_3 - C_1_7); const Scalar tmp86 = w39*(C_0_0 + C_0_4); const Scalar tmp87 = w45*(-C_2_0 - C_2_3); const Scalar tmp88 = w36*(C_0_3 + C_0_7); const Scalar tmp89 = w40*(-C_1_0 - C_1_4); const Scalar tmp90 = w33*(C_0_2 + C_0_6); const Scalar tmp91 = w34*(-C_1_2 - C_1_6); const Scalar tmp92 = w38*(C_2_1 + C_2_2); const Scalar tmp93 = w45*(C_2_5 + C_2_6); const Scalar tmp94 = w37*(-C_1_2 - C_1_3 - C_1_6 - C_1_7); const Scalar tmp95 = w40*(-C_1_0 - C_1_1 - C_1_4 - C_1_5); const Scalar tmp96 = w42*(C_1_0 + C_1_1); const Scalar tmp97 = w41*(C_0_0 + C_0_2); const Scalar tmp98 = w37*(C_1_2 + C_1_3); const Scalar tmp99 = w39*(C_0_1 + C_0_3); const Scalar tmp100 = w36*(C_0_4 + C_0_6); const Scalar tmp101 = w40*(C_1_4 + C_1_5); const Scalar tmp102 = w33*(C_0_5 + C_0_7); const Scalar tmp103 = w34*(C_1_6 + C_1_7); const Scalar tmp104 = w38*(-C_2_2 - C_2_3); const Scalar tmp105 = w35*(-C_2_0 - C_2_1); const Scalar tmp106 = w41*(-C_0_3 - C_0_7); const Scalar tmp107 = w37*(C_1_2 + C_1_3 + C_1_6 + C_1_7); const Scalar tmp108 = w39*(-C_0_2 - C_0_6); const Scalar tmp109 = w45*(-C_2_4 - C_2_5); const Scalar tmp110 = w36*(-C_0_1 - C_0_5); const Scalar tmp111 = w40*(C_1_0 + C_1_1 + C_1_4 + C_1_5); const Scalar tmp112 = w33*(-C_0_0 - C_0_4); const Scalar tmp113 = w46*(-C_2_6 - C_2_7); const Scalar tmp114 = w42*(-C_1_0 - C_1_4); const Scalar tmp115 = w41*(-C_0_0 - C_0_4); const Scalar tmp116 = w37*(-C_1_2 - C_1_6); const Scalar tmp117 = w39*(-C_0_1 - C_0_5); const Scalar tmp118 = w36*(-C_0_2 - C_0_6); const Scalar tmp119 = w40*(-C_1_1 - C_1_5); const Scalar tmp120 = w33*(-C_0_3 - C_0_7); const Scalar tmp121 = w34*(-C_1_3 - C_1_7); const Scalar tmp122 = w38*(C_2_2 + C_2_3); const Scalar tmp123 = w42*(C_1_6 + C_1_7); const Scalar tmp124 = w35*(C_2_0 + C_2_1); const Scalar tmp125 = w37*(C_1_4 + C_1_5); const Scalar tmp126 = w39*(C_0_2 + C_0_4); const Scalar tmp127 = w45*(C_2_4 + C_2_5); const Scalar tmp128 = w36*(C_0_3 + C_0_5); const Scalar tmp129 = w40*(C_1_2 + C_1_3); const Scalar tmp130 = w46*(C_2_6 + C_2_7); const Scalar tmp131 = w34*(C_1_0 + C_1_1); const Scalar tmp132 = w38*(-C_2_1 - C_2_2); const Scalar tmp133 = w37*(C_1_2 + C_1_7); const Scalar tmp134 = w39*(C_0_1 + C_0_7); const Scalar tmp135 = w36*(C_0_0 + C_0_6); const Scalar tmp136 = w40*(C_1_0 + C_1_5); const Scalar tmp137 = w45*(-C_2_5 - C_2_6); const Scalar tmp138 = w38*(-C_2_4 - C_2_6); const Scalar tmp139 = w35*(-C_2_5 - C_2_7); const Scalar tmp140 = w41*(-C_0_0 - C_0_2); const Scalar tmp141 = w37*(-C_1_3 - C_1_6); const Scalar tmp142 = w39*(-C_0_1 - C_0_3); const Scalar tmp143 = w45*(-C_2_1 - C_2_3); const Scalar tmp144 = w36*(-C_0_4 - C_0_6); const Scalar tmp145 = w40*(-C_1_1 - C_1_4); const Scalar tmp146 = w33*(-C_0_5 - C_0_7); const Scalar tmp147 = w46*(-C_2_0 - C_2_2); const Scalar tmp148 = w39*(-C_0_3 - C_0_5); const Scalar tmp149 = w36*(-C_0_2 - C_0_4); const Scalar tmp150 = w38*(C_2_5 + C_2_6); const Scalar tmp151 = w37*(-C_1_0 - C_1_5); const Scalar tmp152 = w39*(-C_0_0 - C_0_6); const Scalar tmp153 = w45*(C_2_1 + C_2_2); const Scalar tmp154 = w36*(-C_0_1 - C_0_7); const Scalar tmp155 = w40*(-C_1_2 - C_1_7); const Scalar tmp156 = w41*(C_0_2 + C_0_6); const Scalar tmp157 = w39*(C_0_3 + C_0_7); const Scalar tmp158 = w36*(C_0_0 + C_0_4); const Scalar tmp159 = w33*(C_0_1 + C_0_5); const Scalar tmp160 = w38*(C_2_6 + C_2_7); const Scalar tmp161 = w35*(C_2_4 + C_2_5); const Scalar tmp162 = w45*(C_2_0 + C_2_1); const Scalar tmp163 = w46*(C_2_2 + C_2_3); const Scalar tmp164 = w38*(-C_2_0 - C_2_3); const Scalar tmp165 = w37*(C_1_3 + C_1_6); const Scalar tmp166 = w40*(C_1_1 + C_1_4); const Scalar tmp167 = w45*(-C_2_4 - C_2_7); const Scalar tmp168 = w39*(C_0_3 + C_0_5); const Scalar tmp169 = w36*(C_0_2 + C_0_4); const Scalar tmp170 = w38*(C_2_1 + C_2_3); const Scalar tmp171 = w35*(C_2_0 + C_2_2); const Scalar tmp172 = w41*(C_0_5 + C_0_7); const Scalar tmp173 = w37*(C_1_1 + C_1_4); const Scalar tmp174 = w39*(C_0_4 + C_0_6); const Scalar tmp175 = w45*(C_2_4 + C_2_6); const Scalar tmp176 = w36*(C_0_1 + C_0_3); const Scalar tmp177 = w40*(C_1_3 + C_1_6); const Scalar tmp178 = w33*(C_0_0 + C_0_2); const Scalar tmp179 = w46*(C_2_5 + C_2_7); const Scalar tmp180 = w38*(-C_2_1 - C_2_3); const Scalar tmp181 = w42*(C_1_1 + C_1_5); const Scalar tmp182 = w35*(-C_2_0 - C_2_2); const Scalar tmp183 = w37*(C_1_3 + C_1_7); const Scalar tmp184 = w39*(C_0_1 + C_0_3 + C_0_5 + C_0_7); const Scalar tmp185 = w45*(-C_2_4 - C_2_6); const Scalar tmp186 = w36*(C_0_0 + C_0_2 + C_0_4 + C_0_6); const Scalar tmp187 = w40*(C_1_0 + C_1_4); const Scalar tmp188 = w46*(-C_2_5 - C_2_7); const Scalar tmp189 = w34*(C_1_2 + C_1_6); const Scalar tmp190 = w38*(-C_2_0 - C_2_1); const Scalar tmp191 = w35*(-C_2_2 - C_2_3); const Scalar tmp192 = w41*(C_0_0 + C_0_4); const Scalar tmp193 = w37*(-C_1_0 - C_1_1 - C_1_4 - C_1_5); const Scalar tmp194 = w39*(C_0_1 + C_0_5); const Scalar tmp195 = w45*(-C_2_6 - C_2_7); const Scalar tmp196 = w36*(C_0_2 + C_0_6); const Scalar tmp197 = w40*(-C_1_2 - C_1_3 - C_1_6 - C_1_7); const Scalar tmp198 = w33*(C_0_3 + C_0_7); const Scalar tmp199 = w46*(-C_2_4 - C_2_5); const Scalar tmp200 = w38*(-C_2_6 - C_2_7); const Scalar tmp201 = w42*(C_1_2 + C_1_3); const Scalar tmp202 = w35*(-C_2_4 - C_2_5); const Scalar tmp203 = w37*(C_1_0 + C_1_1); const Scalar tmp204 = w45*(-C_2_0 - C_2_1); const Scalar tmp205 = w40*(C_1_6 + C_1_7); const Scalar tmp206 = w46*(-C_2_2 - C_2_3); const Scalar tmp207 = w34*(C_1_4 + C_1_5); const Scalar tmp208 = w37*(-C_1_1 - C_1_4); const Scalar tmp209 = w39*(-C_0_2 - C_0_4); const Scalar tmp210 = w36*(-C_0_3 - C_0_5); const Scalar tmp211 = w40*(-C_1_3 - C_1_6); const Scalar tmp212 = w38*(C_2_4 + C_2_7); const Scalar tmp213 = w45*(C_2_0 + C_2_3); const Scalar tmp214 = w41*(-C_0_1 - C_0_5); const Scalar tmp215 = w39*(-C_0_0 - C_0_4); const Scalar tmp216 = w36*(-C_0_3 - C_0_7); const Scalar tmp217 = w33*(-C_0_2 - C_0_6); const Scalar tmp218 = w42*(-C_1_3 - C_1_7); const Scalar tmp219 = w37*(-C_1_1 - C_1_5); const Scalar tmp220 = w40*(-C_1_2 - C_1_6); const Scalar tmp221 = w34*(-C_1_0 - C_1_4); const Scalar tmp222 = w39*(C_0_0 + C_0_6); const Scalar tmp223 = w36*(C_0_1 + C_0_7); const Scalar tmp224 = w38*(C_2_4 + C_2_5); const Scalar tmp225 = w35*(C_2_6 + C_2_7); const Scalar tmp226 = w45*(C_2_2 + C_2_3); const Scalar tmp227 = w46*(C_2_0 + C_2_1); const Scalar tmp228 = w38*(-C_2_0 - C_2_2); const Scalar tmp229 = w42*(-C_1_2 - C_1_6); const Scalar tmp230 = w35*(-C_2_1 - C_2_3); const Scalar tmp231 = w37*(-C_1_0 - C_1_4); const Scalar tmp232 = w39*(-C_0_0 - C_0_2 - C_0_4 - C_0_6); const Scalar tmp233 = w45*(-C_2_5 - C_2_7); const Scalar tmp234 = w36*(-C_0_1 - C_0_3 - C_0_5 - C_0_7); const Scalar tmp235 = w40*(-C_1_3 - C_1_7); const Scalar tmp236 = w46*(-C_2_4 - C_2_6); const Scalar tmp237 = w34*(-C_1_1 - C_1_5); const Scalar tmp238 = w42*(C_1_0 + C_1_4); const Scalar tmp239 = w37*(C_1_2 + C_1_6); const Scalar tmp240 = w40*(C_1_1 + C_1_5); const Scalar tmp241 = w34*(C_1_3 + C_1_7); const Scalar tmp242 = w38*(-C_2_4 - C_2_5); const Scalar tmp243 = w42*(-C_1_0 - C_1_1); const Scalar tmp244 = w35*(-C_2_6 - C_2_7); const Scalar tmp245 = w37*(-C_1_2 - C_1_3); const Scalar tmp246 = w45*(-C_2_2 - C_2_3); const Scalar tmp247 = w40*(-C_1_4 - C_1_5); const Scalar tmp248 = w46*(-C_2_0 - C_2_1); const Scalar tmp249 = w34*(-C_1_6 - C_1_7); const Scalar tmp250 = w42*(-C_1_6 - C_1_7); const Scalar tmp251 = w37*(-C_1_4 - C_1_5); const Scalar tmp252 = w40*(-C_1_2 - C_1_3); const Scalar tmp253 = w34*(-C_1_0 - C_1_1); const Scalar tmp254 = w38*(C_2_5 + C_2_7); const Scalar tmp255 = w35*(C_2_4 + C_2_6); const Scalar tmp256 = w45*(C_2_0 + C_2_2); const Scalar tmp257 = w46*(C_2_1 + C_2_3); const Scalar tmp258 = w38*(-C_2_4 - C_2_5 - C_2_6 - C_2_7); const Scalar tmp259 = w45*(-C_2_0 - C_2_1 - C_2_2 - C_2_3); const Scalar tmp260 = w38*(C_2_4 + C_2_6); const Scalar tmp261 = w35*(C_2_5 + C_2_7); const Scalar tmp262 = w45*(C_2_1 + C_2_3); const Scalar tmp263 = w46*(C_2_0 + C_2_2); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=-C_0_0*w50 - C_0_1*w41 - C_0_6*w33 - C_0_7*w49 + C_1_0*w47 - C_1_2*w42 - C_1_5*w34 + C_1_7*w48 - C_2_0*w43 - C_2_3*w35 - C_2_4*w46 - C_2_7*w44 + tmp132 + tmp137 + tmp208 + tmp209 + tmp210 + tmp211; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=C_0_0*w50 + C_0_1*w41 + C_0_6*w33 + C_0_7*w49 + tmp126 + tmp128 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=-C_1_0*w47 + C_1_2*w42 + C_1_5*w34 - C_1_7*w48 + tmp138 + tmp139 + tmp140 + tmp142 + tmp143 + tmp144 + tmp146 + tmp147 + tmp173 + tmp177; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=tmp100 + tmp101 + tmp102 + tmp103 + tmp40 + tmp45 + tmp96 + tmp97 + tmp98 + tmp99; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=C_2_0*w43 + C_2_3*w35 + C_2_4*w46 + C_2_7*w44 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp92 + tmp93; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=tmp192 + tmp193 + tmp194 + tmp196 + tmp197 + tmp198 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=tmp232 + tmp234 + tmp238 + tmp239 + tmp240 + tmp241 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=tmp60 + tmp61 + tmp62 + tmp63 + tmp64 + tmp65; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=-C_0_0*w41 - C_0_1*w50 - C_0_6*w49 - C_0_7*w33 + tmp148 + tmp149 + tmp242 + tmp243 + tmp244 + tmp245 + tmp246 + tmp247 + tmp248 + tmp249; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=C_0_0*w41 + C_0_1*w50 + C_0_6*w49 + C_0_7*w33 + C_1_1*w47 - C_1_3*w42 - C_1_4*w34 + C_1_6*w48 - C_2_1*w43 - C_2_2*w35 - C_2_5*w46 - C_2_6*w44 + tmp151 + tmp155 + tmp164 + tmp167 + tmp168 + tmp169; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=tmp101 + tmp103 + tmp40 + tmp42 + tmp44 + tmp45 + tmp46 + tmp48 + tmp96 + tmp98; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=-C_1_1*w47 + C_1_3*w42 + C_1_4*w34 - C_1_6*w48 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25 + tmp26 + tmp27 + tmp28 + tmp29; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=tmp193 + tmp197 + tmp214 + tmp215 + tmp216 + tmp217 + tmp224 + tmp225 + tmp226 + tmp227; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=C_2_1*w43 + C_2_2*w35 + C_2_5*w46 + C_2_6*w44 + tmp70 + tmp75 + tmp83 + tmp84 + tmp85 + tmp86 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=tmp60 + tmp61 + tmp63 + tmp65 + tmp80 + tmp81; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=tmp181 + tmp183 + tmp184 + tmp186 + tmp187 + tmp189 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=-C_1_0*w42 + C_1_2*w47 + C_1_5*w48 - C_1_7*w34 + tmp138 + tmp139 + tmp140 + tmp141 + tmp142 + tmp143 + tmp144 + tmp145 + tmp146 + tmp147; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=tmp100 + tmp102 + tmp40 + tmp41 + tmp43 + tmp45 + tmp47 + tmp49 + tmp97 + tmp99; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=-C_0_2*w50 - C_0_3*w41 - C_0_4*w33 - C_0_5*w49 + C_1_0*w42 - C_1_2*w47 - C_1_5*w48 + C_1_7*w34 - C_2_1*w35 - C_2_2*w43 - C_2_5*w44 - C_2_6*w46 + tmp152 + tmp154 + tmp164 + tmp165 + tmp166 + tmp167; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=C_0_2*w50 + C_0_3*w41 + C_0_4*w33 + C_0_5*w49 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp222 + tmp223; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=tmp229 + tmp231 + tmp232 + tmp234 + tmp235 + tmp237 + tmp260 + tmp261 + tmp262 + tmp263; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=tmp60 + tmp62 + tmp63 + tmp64 + tmp94 + tmp95; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=C_2_1*w35 + C_2_2*w43 + C_2_5*w44 + C_2_6*w46 + tmp70 + tmp71 + tmp72 + tmp73 + tmp74 + tmp75 + tmp76 + tmp77 + tmp78 + tmp79; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=tmp107 + tmp111 + tmp156 + tmp157 + tmp158 + tmp159 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=tmp40 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp48 + tmp49; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=-C_1_1*w42 + C_1_3*w47 + C_1_4*w48 - C_1_6*w34 + tmp20 + tmp21 + tmp22 + tmp24 + tmp25 + tmp26 + tmp28 + tmp29 + tmp33 + tmp37; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=-C_0_2*w41 - C_0_3*w50 - C_0_4*w49 - C_0_5*w33 + tmp200 + tmp201 + tmp202 + tmp203 + tmp204 + tmp205 + tmp206 + tmp207 + tmp54 + tmp56; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=C_0_2*w41 + C_0_3*w50 + C_0_4*w49 + C_0_5*w33 + C_1_1*w42 - C_1_3*w47 - C_1_4*w48 + C_1_6*w34 - C_2_0*w35 - C_2_3*w43 - C_2_4*w44 - C_2_7*w46 + tmp132 + tmp133 + tmp134 + tmp135 + tmp136 + tmp137; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=tmp60 + tmp63 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=tmp184 + tmp186 + tmp218 + tmp219 + tmp220 + tmp221 + tmp254 + tmp255 + tmp256 + tmp257; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=tmp106 + tmp107 + tmp108 + tmp110 + tmp111 + tmp112 + tmp160 + tmp161 + tmp162 + tmp163; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=C_2_0*w35 + C_2_3*w43 + C_2_4*w44 + C_2_7*w46 + tmp1 + tmp2 + tmp3 + tmp4 + tmp6 + tmp7 + tmp8 + tmp9 + tmp92 + tmp93; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=-C_2_0*w46 - C_2_3*w44 - C_2_4*w43 - C_2_7*w35 + tmp0 + tmp114 + tmp115 + tmp116 + tmp117 + tmp118 + tmp119 + tmp120 + tmp121 + tmp5; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=tmp190 + tmp191 + tmp192 + tmp193 + tmp194 + tmp195 + tmp196 + tmp197 + tmp198 + tmp199; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=tmp228 + tmp230 + tmp232 + tmp233 + tmp234 + tmp236 + tmp238 + tmp239 + tmp240 + tmp241; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=tmp258 + tmp259 + tmp61 + tmp62 + tmp64 + tmp65; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=-C_0_2*w33 - C_0_3*w49 - C_0_4*w50 - C_0_5*w41 - C_1_1*w34 + C_1_3*w48 + C_1_4*w47 - C_1_6*w42 + C_2_0*w46 + C_2_3*w44 + C_2_4*w43 + C_2_7*w35 + tmp150 + tmp151 + tmp152 + tmp153 + tmp154 + tmp155; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=C_0_2*w33 + C_0_3*w49 + C_0_4*w50 + C_0_5*w41 + tmp222 + tmp223 + tmp50 + tmp51 + tmp52 + tmp53 + tmp55 + tmp57 + tmp58 + tmp59; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=C_1_1*w34 - C_1_3*w48 - C_1_4*w47 + C_1_6*w42 + tmp23 + tmp27 + tmp30 + tmp31 + tmp32 + tmp34 + tmp35 + tmp36 + tmp38 + tmp39; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp18 + tmp19; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=tmp190 + tmp191 + tmp193 + tmp195 + tmp197 + tmp199 + tmp214 + tmp215 + tmp216 + tmp217; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=-C_2_1*w46 - C_2_2*w44 - C_2_5*w43 - C_2_6*w35 + tmp82 + tmp83 + tmp84 + tmp85 + tmp86 + tmp87 + tmp88 + tmp89 + tmp90 + tmp91; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=tmp258 + tmp259 + tmp61 + tmp65 + tmp80 + tmp81; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=tmp180 + tmp181 + tmp182 + tmp183 + tmp184 + tmp185 + tmp186 + tmp187 + tmp188 + tmp189; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=-C_0_2*w49 - C_0_3*w33 - C_0_4*w41 - C_0_5*w50 + tmp50 + tmp51 + tmp52 + tmp53 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=C_0_2*w49 + C_0_3*w33 + C_0_4*w41 + C_0_5*w50 - C_1_0*w34 + C_1_2*w48 + C_1_5*w47 - C_1_7*w42 + C_2_1*w46 + C_2_2*w44 + C_2_5*w43 + C_2_6*w35 + tmp134 + tmp135 + tmp208 + tmp211 + tmp212 + tmp213; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=tmp10 + tmp11 + tmp13 + tmp15 + tmp17 + tmp19 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=C_1_0*w34 - C_1_2*w48 - C_1_5*w47 + C_1_7*w42 + tmp170 + tmp171 + tmp172 + tmp173 + tmp174 + tmp175 + tmp176 + tmp177 + tmp178 + tmp179; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=tmp228 + tmp229 + tmp230 + tmp231 + tmp232 + tmp233 + tmp234 + tmp235 + tmp236 + tmp237; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=tmp258 + tmp259 + tmp62 + tmp64 + tmp94 + tmp95; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=-C_2_1*w44 - C_2_2*w46 - C_2_5*w35 - C_2_6*w43 + tmp71 + tmp72 + tmp73 + tmp74 + tmp76 + tmp77 + tmp78 + tmp79 + tmp82 + tmp87; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=tmp104 + tmp105 + tmp107 + tmp109 + tmp111 + tmp113 + tmp156 + tmp157 + tmp158 + tmp159; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=C_1_1*w48 - C_1_3*w34 - C_1_4*w42 + C_1_6*w47 + tmp30 + tmp31 + tmp32 + tmp33 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=tmp10 + tmp12 + tmp14 + tmp15 + tmp16 + tmp18 + tmp250 + tmp251 + tmp252 + tmp253; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=-C_0_0*w33 - C_0_1*w49 - C_0_6*w50 - C_0_7*w41 - C_1_1*w48 + C_1_3*w34 + C_1_4*w42 - C_1_6*w47 + C_2_1*w44 + C_2_2*w46 + C_2_5*w35 + C_2_6*w43 + tmp133 + tmp136 + tmp209 + tmp210 + tmp212 + tmp213; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=C_0_0*w33 + C_0_1*w49 + C_0_6*w50 + C_0_7*w41 + tmp122 + tmp123 + tmp124 + tmp125 + tmp126 + tmp127 + tmp128 + tmp129 + tmp130 + tmp131; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=tmp258 + tmp259 + tmp80 + tmp81 + tmp94 + tmp95; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=tmp180 + tmp182 + tmp184 + tmp185 + tmp186 + tmp188 + tmp218 + tmp219 + tmp220 + tmp221; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=tmp104 + tmp105 + tmp106 + tmp107 + tmp108 + tmp109 + tmp110 + tmp111 + tmp112 + tmp113; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=-C_2_0*w44 - C_2_3*w46 - C_2_4*w35 - C_2_7*w43 + tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8 + tmp9; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=tmp10 + tmp15 + tmp250 + tmp251 + tmp252 + tmp253 + tmp66 + tmp67 + tmp68 + tmp69; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=C_1_0*w48 - C_1_2*w34 - C_1_5*w42 + C_1_7*w47 + tmp141 + tmp145 + tmp170 + tmp171 + tmp172 + tmp174 + tmp175 + tmp176 + tmp178 + tmp179; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=-C_0_0*w49 - C_0_1*w33 - C_0_6*w41 - C_0_7*w50 + tmp122 + tmp123 + tmp124 + tmp125 + tmp127 + tmp129 + tmp130 + tmp131 + tmp148 + tmp149; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=C_0_0*w49 + C_0_1*w33 + C_0_6*w41 + C_0_7*w50 - C_1_0*w48 + C_1_2*w34 + C_1_5*w42 - C_1_7*w47 + C_2_0*w44 + C_2_3*w46 + C_2_4*w35 + C_2_7*w43 + tmp150 + tmp153 + tmp165 + tmp166 + tmp168 + tmp169; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wC0 = C_p[INDEX3(k,m,0,numEq,numComp)]*w55; const Scalar wC1 = C_p[INDEX3(k,m,1,numEq,numComp)]*w56; const Scalar wC2 = C_p[INDEX3(k,m,2,numEq,numComp)]*w54; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+= 4.*wC0 + 4.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=-4.*wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+= 2.*wC0 - 4.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=-2.*wC0 - 2.*wC1 + wC2; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+= 2.*wC0 + 2.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=-2.*wC0 + wC1 - 2.*wC2; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+= wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+= -wC0 - wC1 - wC2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+= 4.*wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=-4.*wC0 + 4.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+= 2.*wC0 - 2.*wC1 + wC2; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=-2.*wC0 - 4.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+= 2.*wC0 + wC1 - 2.*wC2; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=-2.*wC0 + 2.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= -wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+= 2.*wC0 + 4.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=-2.*wC0 + 2.*wC1 + wC2; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+= 4.*wC0 - 4.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=-4.*wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+= wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+= -wC0 + wC1 - wC2; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+= 2.*wC0 - 2.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=-2.*wC0 - wC1 - 2.*wC2; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+= 2.*wC0 + 2.*wC1 + wC2; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=-2.*wC0 + 4.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+= 4.*wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=-4.*wC0 - 4.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= -wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+= 2.*wC0 - wC1 - 2.*wC2; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=-2.*wC0 - 2.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+= 2.*wC0 + 2.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=-2.*wC0 + wC1 + 2.*wC2; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+= wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+= -wC0 - wC1 + wC2; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+= 4.*wC0 + 4.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=-4.*wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+= 2.*wC0 - 4.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=-2.*wC0 - 2.*wC1 - wC2; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+= 2.*wC0 + wC1 + 2.*wC2; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=-2.*wC0 + 2.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= -wC0 - 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+= 4.*wC0 + 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=-4.*wC0 + 4.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+= 2.*wC0 - 2.*wC1 - wC2; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=-2.*wC0 - 4.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+= wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+= -wC0 + wC1 + wC2; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+= 2.*wC0 - 2.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=-2.*wC0 - wC1 + 2.*wC2; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+= 2.*wC0 + 4.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=-2.*wC0 + 2.*wC1 - wC2; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+= 4.*wC0 - 4.*wC1 - 4.*wC2; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=-4.*wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= -wC0 + 2.*wC1 + 2.*wC2; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+= 2.*wC0 - wC1 + 2.*wC2; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=-2.*wC0 - 2.*wC1 + 4.*wC2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+= 2.*wC0 + 2.*wC1 - wC2; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=-2.*wC0 + 4.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+= 4.*wC0 - 2.*wC1 - 2.*wC2; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=-4.*wC0 - 4.*wC1 - 4.*wC2; } } } } /////////////// // process D // /////////////// if (!D.isEmpty()) { const Scalar* D_p = D.getSampleDataRO(e, zero); if (D.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar D_0 = D_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar D_1 = D_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar D_2 = D_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar D_3 = D_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar D_4 = D_p[INDEX3(k,m,4,numEq,numComp)]; const Scalar D_5 = D_p[INDEX3(k,m,5,numEq,numComp)]; const Scalar D_6 = D_p[INDEX3(k,m,6,numEq,numComp)]; const Scalar D_7 = D_p[INDEX3(k,m,7,numEq,numComp)]; const Scalar tmp0 = w59*(D_3 + D_7); const Scalar tmp1 = w57*(D_0 + D_4); const Scalar tmp2 = w58*(D_1 + D_2 + D_5 + D_6); const Scalar tmp3 = w60*(D_0 + D_1 + D_2 + D_3); const Scalar tmp4 = w61*(D_4 + D_5 + D_6 + D_7); const Scalar tmp5 = w59*(D_1 + D_3); const Scalar tmp6 = w57*(D_4 + D_6); const Scalar tmp7 = w58*(D_0 + D_2 + D_5 + D_7); const Scalar tmp8 = w59*(D_4 + D_6); const Scalar tmp9 = w57*(D_1 + D_3); const Scalar tmp10 = w60*(D_4 + D_5 + D_6 + D_7); const Scalar tmp11 = w61*(D_0 + D_1 + D_2 + D_3); const Scalar tmp12 = w59*(D_4 + D_5); const Scalar tmp13 = w57*(D_2 + D_3); const Scalar tmp14 = w58*(D_0 + D_1 + D_6 + D_7); const Scalar tmp15 = w58*(D_0 + D_1 + D_2 + D_3 + D_4 + D_5 + D_6 + D_7); const Scalar tmp16 = w59*(D_2 + D_6); const Scalar tmp17 = w57*(D_1 + D_5); const Scalar tmp18 = w58*(D_0 + D_3 + D_4 + D_7); const Scalar tmp19 = w59*(D_1 + D_5); const Scalar tmp20 = w57*(D_2 + D_6); const Scalar tmp21 = w60*(D_0 + D_1 + D_4 + D_5); const Scalar tmp22 = w61*(D_2 + D_3 + D_6 + D_7); const Scalar tmp23 = w59*(D_0 + D_4); const Scalar tmp24 = w57*(D_3 + D_7); const Scalar tmp25 = w59*(D_6 + D_7); const Scalar tmp26 = w57*(D_0 + D_1); const Scalar tmp27 = w58*(D_2 + D_3 + D_4 + D_5); const Scalar tmp28 = w60*(D_0 + D_5 + D_6); const Scalar tmp29 = w61*(D_1 + D_2 + D_7); const Scalar tmp30 = w59*(D_0 + D_2); const Scalar tmp31 = w57*(D_5 + D_7); const Scalar tmp32 = w58*(D_1 + D_3 + D_4 + D_6); const Scalar tmp33 = w60*(D_1 + D_2 + D_7); const Scalar tmp34 = w61*(D_0 + D_5 + D_6); const Scalar tmp35 = w60*(D_1 + D_4 + D_7); const Scalar tmp36 = w61*(D_0 + D_3 + D_6); const Scalar tmp37 = w60*(D_1 + D_2 + D_4); const Scalar tmp38 = w61*(D_3 + D_5 + D_6); const Scalar tmp39 = w59*(D_5 + D_7); const Scalar tmp40 = w57*(D_0 + D_2); const Scalar tmp41 = w60*(D_0 + D_2 + D_4 + D_6); const Scalar tmp42 = w61*(D_1 + D_3 + D_5 + D_7); const Scalar tmp43 = w60*(D_2 + D_3 + D_6 + D_7); const Scalar tmp44 = w61*(D_0 + D_1 + D_4 + D_5); const Scalar tmp45 = w60*(D_2 + D_4 + D_7); const Scalar tmp46 = w61*(D_0 + D_3 + D_5); const Scalar tmp47 = w59*(D_2 + D_3); const Scalar tmp48 = w57*(D_4 + D_5); const Scalar tmp49 = w60*(D_3 + D_5 + D_6); const Scalar tmp50 = w61*(D_1 + D_2 + D_4); const Scalar tmp51 = w60*(D_0 + D_3 + D_5); const Scalar tmp52 = w61*(D_2 + D_4 + D_7); const Scalar tmp53 = w60*(D_0 + D_3 + D_6); const Scalar tmp54 = w61*(D_1 + D_4 + D_7); const Scalar tmp55 = w60*(D_1 + D_3 + D_5 + D_7); const Scalar tmp56 = w61*(D_0 + D_2 + D_4 + D_6); const Scalar tmp57 = w59*(D_0 + D_1); const Scalar tmp58 = w57*(D_6 + D_7); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=D_0*w62 + D_7*w63 + tmp49 + tmp50; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=tmp27 + tmp57 + tmp58; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=tmp30 + tmp31 + tmp32; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=tmp10 + tmp11; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=tmp2 + tmp23 + tmp24; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=tmp43 + tmp44; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=tmp55 + tmp56; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=tmp27 + tmp57 + tmp58; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=D_1*w62 + D_6*w63 + tmp45 + tmp46; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=tmp10 + tmp11; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=tmp5 + tmp6 + tmp7; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=tmp43 + tmp44; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=tmp18 + tmp19 + tmp20; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=tmp41 + tmp42; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=tmp30 + tmp31 + tmp32; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=tmp10 + tmp11; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=D_2*w62 + D_5*w63 + tmp35 + tmp36; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=tmp14 + tmp47 + tmp48; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=tmp55 + tmp56; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=tmp16 + tmp17 + tmp18; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=tmp21 + tmp22; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=tmp10 + tmp11; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=tmp5 + tmp6 + tmp7; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=tmp14 + tmp47 + tmp48; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=D_3*w62 + D_4*w63 + tmp28 + tmp29; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=tmp41 + tmp42; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=tmp21 + tmp22; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=tmp0 + tmp1 + tmp2; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=tmp2 + tmp23 + tmp24; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=tmp43 + tmp44; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=tmp55 + tmp56; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=D_3*w63 + D_4*w62 + tmp33 + tmp34; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=tmp12 + tmp13 + tmp14; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=tmp7 + tmp8 + tmp9; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=tmp3 + tmp4; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=tmp43 + tmp44; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=tmp18 + tmp19 + tmp20; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=tmp41 + tmp42; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=tmp12 + tmp13 + tmp14; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=D_2*w63 + D_5*w62 + tmp53 + tmp54; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=tmp3 + tmp4; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=tmp32 + tmp39 + tmp40; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=tmp55 + tmp56; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=tmp16 + tmp17 + tmp18; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=tmp21 + tmp22; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=tmp7 + tmp8 + tmp9; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=tmp3 + tmp4; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=D_1*w63 + D_6*w62 + tmp51 + tmp52; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=tmp25 + tmp26 + tmp27; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=tmp15; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=tmp41 + tmp42; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=tmp21 + tmp22; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=tmp0 + tmp1 + tmp2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=tmp3 + tmp4; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=tmp32 + tmp39 + tmp40; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=tmp25 + tmp26 + tmp27; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=D_0*w63 + D_7*w62 + tmp37 + tmp38; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wD0 = 8.*D_p[INDEX2(k, m, numEq)]*w58; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=8.*wD0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+= wD0; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=2.*wD0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=4.*wD0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=8.*wD0; } } } } /////////////// // process X // /////////////// if (!X.isEmpty()) { const Scalar* X_p = X.getSampleDataRO(e, zero); if (X.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar X_0_0 = X_p[INDEX3(k,0,0,numEq,3)]; const Scalar X_1_0 = X_p[INDEX3(k,1,0,numEq,3)]; const Scalar X_2_0 = X_p[INDEX3(k,2,0,numEq,3)]; const Scalar X_0_1 = X_p[INDEX3(k,0,1,numEq,3)]; const Scalar X_1_1 = X_p[INDEX3(k,1,1,numEq,3)]; const Scalar X_2_1 = X_p[INDEX3(k,2,1,numEq,3)]; const Scalar X_0_2 = X_p[INDEX3(k,0,2,numEq,3)]; const Scalar X_1_2 = X_p[INDEX3(k,1,2,numEq,3)]; const Scalar X_2_2 = X_p[INDEX3(k,2,2,numEq,3)]; const Scalar X_0_3 = X_p[INDEX3(k,0,3,numEq,3)]; const Scalar X_1_3 = X_p[INDEX3(k,1,3,numEq,3)]; const Scalar X_2_3 = X_p[INDEX3(k,2,3,numEq,3)]; const Scalar X_0_4 = X_p[INDEX3(k,0,4,numEq,3)]; const Scalar X_1_4 = X_p[INDEX3(k,1,4,numEq,3)]; const Scalar X_2_4 = X_p[INDEX3(k,2,4,numEq,3)]; const Scalar X_0_5 = X_p[INDEX3(k,0,5,numEq,3)]; const Scalar X_1_5 = X_p[INDEX3(k,1,5,numEq,3)]; const Scalar X_2_5 = X_p[INDEX3(k,2,5,numEq,3)]; const Scalar X_0_6 = X_p[INDEX3(k,0,6,numEq,3)]; const Scalar X_1_6 = X_p[INDEX3(k,1,6,numEq,3)]; const Scalar X_2_6 = X_p[INDEX3(k,2,6,numEq,3)]; const Scalar X_0_7 = X_p[INDEX3(k,0,7,numEq,3)]; const Scalar X_1_7 = X_p[INDEX3(k,1,7,numEq,3)]; const Scalar X_2_7 = X_p[INDEX3(k,2,7,numEq,3)]; const Scalar tmp0 = w72*(X_0_6 + X_0_7); const Scalar tmp1 = w66*(X_2_0 + X_2_4); const Scalar tmp2 = w64*(X_0_0 + X_0_1); const Scalar tmp3 = w68*(X_2_1 + X_2_2 + X_2_5 + X_2_6); const Scalar tmp4 = w65*(X_1_0 + X_1_2); const Scalar tmp5 = w70*(X_2_3 + X_2_7); const Scalar tmp6 = w67*(X_1_1 + X_1_3 + X_1_4 + X_1_6); const Scalar tmp7 = w71*(X_1_5 + X_1_7); const Scalar tmp8 = w69*(X_0_2 + X_0_3 + X_0_4 + X_0_5); const Scalar tmp9 = w72*(-X_0_6 - X_0_7); const Scalar tmp10 = w66*(X_2_1 + X_2_5); const Scalar tmp11 = w64*(-X_0_0 - X_0_1); const Scalar tmp12 = w68*(X_2_0 + X_2_3 + X_2_4 + X_2_7); const Scalar tmp13 = w65*(X_1_1 + X_1_3); const Scalar tmp14 = w70*(X_2_2 + X_2_6); const Scalar tmp15 = w67*(X_1_0 + X_1_2 + X_1_5 + X_1_7); const Scalar tmp16 = w71*(X_1_4 + X_1_6); const Scalar tmp17 = w69*(-X_0_2 - X_0_3 - X_0_4 - X_0_5); const Scalar tmp18 = w72*(X_0_4 + X_0_5); const Scalar tmp19 = w66*(X_2_2 + X_2_6); const Scalar tmp20 = w64*(X_0_2 + X_0_3); const Scalar tmp21 = w65*(-X_1_0 - X_1_2); const Scalar tmp22 = w70*(X_2_1 + X_2_5); const Scalar tmp23 = w67*(-X_1_1 - X_1_3 - X_1_4 - X_1_6); const Scalar tmp24 = w71*(-X_1_5 - X_1_7); const Scalar tmp25 = w69*(X_0_0 + X_0_1 + X_0_6 + X_0_7); const Scalar tmp26 = w72*(-X_0_4 - X_0_5); const Scalar tmp27 = w66*(X_2_3 + X_2_7); const Scalar tmp28 = w64*(-X_0_2 - X_0_3); const Scalar tmp29 = w65*(-X_1_1 - X_1_3); const Scalar tmp30 = w70*(X_2_0 + X_2_4); const Scalar tmp31 = w67*(-X_1_0 - X_1_2 - X_1_5 - X_1_7); const Scalar tmp32 = w71*(-X_1_4 - X_1_6); const Scalar tmp33 = w69*(-X_0_0 - X_0_1 - X_0_6 - X_0_7); const Scalar tmp34 = w72*(X_0_2 + X_0_3); const Scalar tmp35 = w66*(-X_2_0 - X_2_4); const Scalar tmp36 = w64*(X_0_4 + X_0_5); const Scalar tmp37 = w68*(-X_2_1 - X_2_2 - X_2_5 - X_2_6); const Scalar tmp38 = w65*(X_1_4 + X_1_6); const Scalar tmp39 = w70*(-X_2_3 - X_2_7); const Scalar tmp40 = w71*(X_1_1 + X_1_3); const Scalar tmp41 = w72*(-X_0_2 - X_0_3); const Scalar tmp42 = w66*(-X_2_1 - X_2_5); const Scalar tmp43 = w64*(-X_0_4 - X_0_5); const Scalar tmp44 = w68*(-X_2_0 - X_2_3 - X_2_4 - X_2_7); const Scalar tmp45 = w65*(X_1_5 + X_1_7); const Scalar tmp46 = w70*(-X_2_2 - X_2_6); const Scalar tmp47 = w71*(X_1_0 + X_1_2); const Scalar tmp48 = w72*(X_0_0 + X_0_1); const Scalar tmp49 = w66*(-X_2_2 - X_2_6); const Scalar tmp50 = w64*(X_0_6 + X_0_7); const Scalar tmp51 = w65*(-X_1_4 - X_1_6); const Scalar tmp52 = w70*(-X_2_1 - X_2_5); const Scalar tmp53 = w71*(-X_1_1 - X_1_3); const Scalar tmp54 = w72*(-X_0_0 - X_0_1); const Scalar tmp55 = w66*(-X_2_3 - X_2_7); const Scalar tmp56 = w64*(-X_0_6 - X_0_7); const Scalar tmp57 = w65*(-X_1_5 - X_1_7); const Scalar tmp58 = w70*(-X_2_0 - X_2_4); const Scalar tmp59 = w71*(-X_1_0 - X_1_2); EM_F[INDEX2(k,0,numEq)]+=tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 + tmp7 + tmp8; EM_F[INDEX2(k,1,numEq)]+=tmp10 + tmp11 + tmp12 + tmp13 + tmp14 + tmp15 + tmp16 + tmp17 + tmp9; EM_F[INDEX2(k,2,numEq)]+=tmp12 + tmp18 + tmp19 + tmp20 + tmp21 + tmp22 + tmp23 + tmp24 + tmp25; EM_F[INDEX2(k,3,numEq)]+=tmp26 + tmp27 + tmp28 + tmp29 + tmp3 + tmp30 + tmp31 + tmp32 + tmp33; EM_F[INDEX2(k,4,numEq)]+=tmp15 + tmp25 + tmp34 + tmp35 + tmp36 + tmp37 + tmp38 + tmp39 + tmp40; EM_F[INDEX2(k,5,numEq)]+=tmp33 + tmp41 + tmp42 + tmp43 + tmp44 + tmp45 + tmp46 + tmp47 + tmp6; EM_F[INDEX2(k,6,numEq)]+=tmp31 + tmp44 + tmp48 + tmp49 + tmp50 + tmp51 + tmp52 + tmp53 + tmp8; EM_F[INDEX2(k,7,numEq)]+=tmp17 + tmp23 + tmp37 + tmp54 + tmp55 + tmp56 + tmp57 + tmp58 + tmp59; } } else { // constant data for (index_t k=0; k<numEq; k++) { const Scalar wX0 = 18.*X_p[INDEX2(k, 0, numEq)]*w55; const Scalar wX1 = 18.*X_p[INDEX2(k, 1, numEq)]*w56; const Scalar wX2 = 18.*X_p[INDEX2(k, 2, numEq)]*w54; EM_F[INDEX2(k,0,numEq)]+= wX0 + wX1 + wX2; EM_F[INDEX2(k,1,numEq)]+=-wX0 + wX1 + wX2; EM_F[INDEX2(k,2,numEq)]+= wX0 - wX1 + wX2; EM_F[INDEX2(k,3,numEq)]+=-wX0 - wX1 + wX2; EM_F[INDEX2(k,4,numEq)]+= wX0 + wX1 - wX2; EM_F[INDEX2(k,5,numEq)]+=-wX0 + wX1 - wX2; EM_F[INDEX2(k,6,numEq)]+= wX0 - wX1 - wX2; EM_F[INDEX2(k,7,numEq)]+=-wX0 - wX1 - wX2; } } } /////////////// // process Y // /////////////// if (!Y.isEmpty()) { const Scalar* Y_p = Y.getSampleDataRO(e, zero); if (Y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar Y_0 = Y_p[INDEX2(k, 0, numEq)]; const Scalar Y_1 = Y_p[INDEX2(k, 1, numEq)]; const Scalar Y_2 = Y_p[INDEX2(k, 2, numEq)]; const Scalar Y_3 = Y_p[INDEX2(k, 3, numEq)]; const Scalar Y_4 = Y_p[INDEX2(k, 4, numEq)]; const Scalar Y_5 = Y_p[INDEX2(k, 5, numEq)]; const Scalar Y_6 = Y_p[INDEX2(k, 6, numEq)]; const Scalar Y_7 = Y_p[INDEX2(k, 7, numEq)]; const Scalar tmp0 = w76*(Y_3 + Y_5 + Y_6); const Scalar tmp1 = w75*(Y_1 + Y_2 + Y_4); const Scalar tmp2 = w76*(Y_2 + Y_4 + Y_7); const Scalar tmp3 = w75*(Y_0 + Y_3 + Y_5); const Scalar tmp4 = w76*(Y_1 + Y_4 + Y_7); const Scalar tmp5 = w75*(Y_0 + Y_3 + Y_6); const Scalar tmp6 = w76*(Y_0 + Y_5 + Y_6); const Scalar tmp7 = w75*(Y_1 + Y_2 + Y_7); const Scalar tmp8 = w76*(Y_1 + Y_2 + Y_7); const Scalar tmp9 = w75*(Y_0 + Y_5 + Y_6); const Scalar tmp10 = w76*(Y_0 + Y_3 + Y_6); const Scalar tmp11 = w75*(Y_1 + Y_4 + Y_7); const Scalar tmp12 = w76*(Y_0 + Y_3 + Y_5); const Scalar tmp13 = w75*(Y_2 + Y_4 + Y_7); const Scalar tmp14 = w76*(Y_1 + Y_2 + Y_4); const Scalar tmp15 = w75*(Y_3 + Y_5 + Y_6); EM_F[INDEX2(k,0,numEq)]+=Y_0*w74 + Y_7*w77 + tmp0 + tmp1; EM_F[INDEX2(k,1,numEq)]+=Y_1*w74 + Y_6*w77 + tmp2 + tmp3; EM_F[INDEX2(k,2,numEq)]+=Y_2*w74 + Y_5*w77 + tmp4 + tmp5; EM_F[INDEX2(k,3,numEq)]+=Y_3*w74 + Y_4*w77 + tmp6 + tmp7; EM_F[INDEX2(k,4,numEq)]+=Y_3*w77 + Y_4*w74 + tmp8 + tmp9; EM_F[INDEX2(k,5,numEq)]+=Y_2*w77 + Y_5*w74 + tmp10 + tmp11; EM_F[INDEX2(k,6,numEq)]+=Y_1*w77 + Y_6*w74 + tmp12 + tmp13; EM_F[INDEX2(k,7,numEq)]+=Y_0*w77 + Y_7*w74 + tmp14 + tmp15; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,1,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,2,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,3,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,4,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,5,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,6,numEq)]+=216.*Y_p[k]*w58; EM_F[INDEX2(k,7,numEq)]+=216.*Y_p[k]*w58; } } } // add to matrix (if add_EM_S) and RHS (if add_EM_F) const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // end k0 loop } // end k1 loop } // end k2 loop } // end of colouring } // end of parallel region } /****************************************************************************/ // PDE SYSTEM BOUNDARY /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySystem( AbstractSystemMatrix* mat, Data& rhs, const Data& d, const Data& y) const { dim_t numEq, numComp; if (!mat) numEq=numComp=(rhs.isEmpty() ? 1 : rhs.getDataPointSize()); else { numEq=mat->getRowBlockSize(); numComp=mat->getColumnBlockSize(); } const double SQRT3 = 1.73205080756887719318; const double w12 = m_dx[0]*m_dx[1]/144; const double w10 = w12*(-SQRT3 + 2); const double w11 = w12*(SQRT3 + 2); const double w13 = w12*(-4*SQRT3 + 7); const double w14 = w12*(4*SQRT3 + 7); const double w7 = m_dx[0]*m_dx[2]/144; const double w5 = w7*(-SQRT3 + 2); const double w6 = w7*(SQRT3 + 2); const double w8 = w7*(-4*SQRT3 + 7); const double w9 = w7*(4*SQRT3 + 7); const double w2 = m_dx[1]*m_dx[2]/144; const double w0 = w2*(-SQRT3 + 2); const double w1 = w2*(SQRT3 + 2); const double w3 = w2*(-4*SQRT3 + 7); const double w4 = w2*(4*SQRT3 + 7); const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = !d.isEmpty(); const bool add_EM_F = !y.isEmpty(); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8*numEq*numComp, zero); vector<Scalar> EM_F(8*numEq, zero); if (domain->m_faceOffset[0] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w0*(d_0 + d_1); const Scalar tmp1 = w1*(d_2 + d_3); const Scalar tmp2 = w0*(d_0 + d_2); const Scalar tmp3 = w1*(d_1 + d_3); const Scalar tmp4 = w0*(d_1 + d_3); const Scalar tmp5 = w1*(d_0 + d_2); const Scalar tmp6 = w0*(d_2 + d_3); const Scalar tmp7 = w1*(d_0 + d_1); const Scalar tmp8 = w2*(d_0 + d_3); const Scalar tmp9 = w2*(d_1 + d_2); const Scalar tmp10 = w2*(d_0 + d_1 + d_2 + d_3); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = d_0*w4 + d_3*w3 + tmp9; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)] = tmp6 + tmp7; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)] = tmp6 + tmp7; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = d_1*w4 + d_2*w3 + tmp8; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = d_1*w3 + d_2*w4 + tmp8; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = d_0*w3 + d_3*w4 + tmp9; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w2; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w2*(y_1 + y_2); const Scalar tmp1 = 6.*w2*(y_0 + y_3); EM_F[INDEX2(k,0,numEq)] = tmp0 + 6.*w0*y_3 + 6.*w1*y_0; EM_F[INDEX2(k,2,numEq)] = tmp1 + 6.*w0*y_2 + 6.*w1*y_1; EM_F[INDEX2(k,4,numEq)] = tmp1 + 6.*w0*y_1 + 6.*w1*y_2; EM_F[INDEX2(k,6,numEq)] = tmp0 + 6.*w0*y_0 + 6.*w1*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,2,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,4,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 36.*w2*y_p[k]; } } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k1 loop } // k2 loop } // colouring } // face 0 if (domain->m_faceOffset[1] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = domain->m_faceOffset[1]+INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w0*(d_0 + d_2); const Scalar tmp1 = w1*(d_1 + d_3); const Scalar tmp2 = w0*(d_2 + d_3); const Scalar tmp3 = w1*(d_0 + d_1); const Scalar tmp4 = w0*(d_1 + d_3); const Scalar tmp5 = w1*(d_0 + d_2); const Scalar tmp6 = w2*(d_0 + d_3); const Scalar tmp7 = w2*(d_1 + d_2); const Scalar tmp8 = w0*(d_0 + d_1); const Scalar tmp9 = w1*(d_2 + d_3); const Scalar tmp10 = w2*(d_0 + d_1 + d_2 + d_3); EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = d_0*w4 + d_3*w3 + tmp7; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = d_1*w4 + d_2*w3 + tmp6; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = d_1*w3 + d_2*w4 + tmp6; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)] = tmp8 + tmp9; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)] = tmp10; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)] = tmp8 + tmp9; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = d_0*w3 + d_3*w4 + tmp7; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w2*(y_1 + y_2); const Scalar tmp1 = 6.*w2*(y_0 + y_3); EM_F[INDEX2(k,1,numEq)] = tmp0 + 6.*w0*y_3 + 6.*w1*y_0; EM_F[INDEX2(k,3,numEq)] = tmp1 + 6.*w0*y_2 + 6.*w1*y_1; EM_F[INDEX2(k,5,numEq)] = tmp1 + 6.*w0*y_1 + 6.*w1*y_2; EM_F[INDEX2(k,7,numEq)] = tmp0 + 6.*w0*y_0 + 6.*w1*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,1,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 36.*w2*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 36.*w2*y_p[k]; } } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(k1+1)-2; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k1 loop } // k2 loop } // colouring } // face 1 if (domain->m_faceOffset[2] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[2]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w5*(d_0 + d_1); const Scalar tmp1 = w6*(d_2 + d_3); const Scalar tmp2 = w5*(d_0 + d_2); const Scalar tmp3 = w6*(d_1 + d_3); const Scalar tmp4 = w5*(d_1 + d_3); const Scalar tmp5 = w6*(d_0 + d_2); const Scalar tmp6 = w7*(d_0 + d_3); const Scalar tmp7 = w7*(d_0 + d_1 + d_2 + d_3); const Scalar tmp8 = w7*(d_1 + d_2); const Scalar tmp9 = w5*(d_2 + d_3); const Scalar tmp10 = w6*(d_0 + d_1); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = d_0*w9 + d_3*w8 + tmp8; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)] = tmp7; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = d_1*w9 + d_2*w8 + tmp6; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)] = tmp7; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)] = tmp7; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = d_1*w8 + d_2*w9 + tmp6; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)] = tmp7; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = d_0*w8 + d_3*w9 + tmp8; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w7; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w7*(y_1 + y_2); const Scalar tmp1 = 6.*w7*(y_0 + y_3); EM_F[INDEX2(k,0,numEq)] = tmp0 + 6.*w5*y_3 + 6.*w6*y_0; EM_F[INDEX2(k,1,numEq)] = tmp1 + 6.*w5*y_2 + 6.*w6*y_1; EM_F[INDEX2(k,4,numEq)] = tmp1 + 6.*w5*y_1 + 6.*w6*y_2; EM_F[INDEX2(k,5,numEq)] = tmp0 + 6.*w5*y_0 + 6.*w6*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,1,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,4,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 36.*w7*y_p[k]; } } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k2 loop } // colouring } // face 2 if (domain->m_faceOffset[3] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[3]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w5*(d_0 + d_2); const Scalar tmp1 = w6*(d_1 + d_3); const Scalar tmp2 = w5*(d_1 + d_3); const Scalar tmp3 = w6*(d_0 + d_2); const Scalar tmp4 = w7*(d_0 + d_1 + d_2 + d_3); const Scalar tmp5 = w5*(d_0 + d_1); const Scalar tmp6 = w6*(d_2 + d_3); const Scalar tmp7 = w7*(d_0 + d_3); const Scalar tmp8 = w7*(d_1 + d_2); const Scalar tmp9 = w5*(d_2 + d_3); const Scalar tmp10 = w6*(d_0 + d_1); EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = d_0*w9 + d_3*w8 + tmp8; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)] = tmp4; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = d_1*w9 + d_2*w8 + tmp7; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)] = tmp4; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)] = tmp2 + tmp3; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)] = tmp4; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = d_1*w8 + d_2*w9 + tmp7; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)] = tmp5 + tmp6; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)] = tmp4; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)] = tmp5 + tmp6; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = d_0*w8 + d_3*w9 + tmp8; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w7; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w7*(y_1 + y_2); const Scalar tmp1 = 6.*w7*(y_0 + y_3); EM_F[INDEX2(k,2,numEq)] = tmp0 + 6.*w5*y_3 + 6.*w6*y_0; EM_F[INDEX2(k,3,numEq)] = tmp1 + 6.*w5*y_2 + 6.*w6*y_1; EM_F[INDEX2(k,6,numEq)] = tmp1 + 6.*w5*y_1 + 6.*w6*y_2; EM_F[INDEX2(k,7,numEq)] = tmp0 + 6.*w5*y_0 + 6.*w6*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,2,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 36.*w7*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 36.*w7*y_p[k]; } } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(m_NN[1]-2)+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k2 loop } // colouring } // face 3 if (domain->m_faceOffset[4] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[4]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w10*(d_0 + d_2); const Scalar tmp1 = w11*(d_1 + d_3); const Scalar tmp2 = w12*(d_0 + d_1 + d_2 + d_3); const Scalar tmp3 = w12*(d_1 + d_2); const Scalar tmp4 = w10*(d_1 + d_3); const Scalar tmp5 = w11*(d_0 + d_2); const Scalar tmp6 = w12*(d_0 + d_3); const Scalar tmp7 = w10*(d_0 + d_1); const Scalar tmp8 = w11*(d_2 + d_3); const Scalar tmp9 = w10*(d_2 + d_3); const Scalar tmp10 = w11*(d_0 + d_1); EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = d_0*w14 + d_3*w13 + tmp3; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)] = tmp2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)] = tmp10 + tmp9; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = d_1*w14 + d_2*w13 + tmp6; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)] = tmp2; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)] = tmp4 + tmp5; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)] = tmp2; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = d_1*w13 + d_2*w14 + tmp6; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)] = tmp7 + tmp8; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)] = tmp2; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)] = tmp0 + tmp1; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)] = tmp7 + tmp8; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = d_0*w13 + d_3*w14 + tmp3; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w12; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w12*(y_1 + y_2); const Scalar tmp1 = 6.*w12*(y_0 + y_3); EM_F[INDEX2(k,0,numEq)] = tmp0 + 6.*w10*y_3 + 6.*w11*y_0; EM_F[INDEX2(k,1,numEq)] = tmp1 + 6.*w10*y_2 + 6.*w11*y_1; EM_F[INDEX2(k,2,numEq)] = tmp1 + 6.*w10*y_1 + 6.*w11*y_2; EM_F[INDEX2(k,3,numEq)] = tmp0 + 6.*w10*y_0 + 6.*w11*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,1,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,2,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 36.*w12*y_p[k]; } } } const index_t firstNode=m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k1 loop } // colouring } // face 4 if (domain->m_faceOffset[5] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[5]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); if (d.actsExpanded()) { for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar d_0 = d_p[INDEX3(k,m,0,numEq,numComp)]; const Scalar d_1 = d_p[INDEX3(k,m,1,numEq,numComp)]; const Scalar d_2 = d_p[INDEX3(k,m,2,numEq,numComp)]; const Scalar d_3 = d_p[INDEX3(k,m,3,numEq,numComp)]; const Scalar tmp0 = w12*(d_0 + d_1 + d_2 + d_3); const Scalar tmp1 = w10*(d_1 + d_3); const Scalar tmp2 = w11*(d_0 + d_2); const Scalar tmp3 = w10*(d_2 + d_3); const Scalar tmp4 = w11*(d_0 + d_1); const Scalar tmp5 = w10*(d_0 + d_1); const Scalar tmp6 = w11*(d_2 + d_3); const Scalar tmp7 = w12*(d_1 + d_2); const Scalar tmp8 = w10*(d_0 + d_2); const Scalar tmp9 = w11*(d_1 + d_3); const Scalar tmp10 = w12*(d_0 + d_3); EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = d_0*w14 + d_3*w13 + tmp7; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)] = tmp3 + tmp4; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)] = tmp1 + tmp2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)] = tmp0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)] = tmp3 + tmp4; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = d_1*w14 + d_2*w13 + tmp10; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)] = tmp0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)] = tmp8 + tmp9; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)] = tmp1 + tmp2; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)] = tmp0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = d_1*w13 + d_2*w14 + tmp10; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)] = tmp5 + tmp6; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)] = tmp0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)] = tmp8 + tmp9; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)] = tmp5 + tmp6; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = d_0*w13 + d_3*w14 + tmp7; } } } else { // constant data for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wd0 = 4.*d_p[INDEX2(k, m, numEq)]*w12; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)] = 4.*wd0; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)] = wd0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)] = 2.*wd0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)] = 4.*wd0; } } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); if (y.actsExpanded()) { for (index_t k=0; k<numEq; k++) { const Scalar y_0 = y_p[INDEX2(k, 0, numEq)]; const Scalar y_1 = y_p[INDEX2(k, 1, numEq)]; const Scalar y_2 = y_p[INDEX2(k, 2, numEq)]; const Scalar y_3 = y_p[INDEX2(k, 3, numEq)]; const Scalar tmp0 = 6.*w12*(y_1 + y_2); const Scalar tmp1 = 6.*w12*(y_0 + y_3); EM_F[INDEX2(k,4,numEq)] = tmp0 + 6.*w10*y_3 + 6.*w11*y_0; EM_F[INDEX2(k,5,numEq)] = tmp1 + 6.*w10*y_2 + 6.*w11*y_1; EM_F[INDEX2(k,6,numEq)] = tmp1 + 6.*w10*y_1 + 6.*w11*y_2; EM_F[INDEX2(k,7,numEq)] = tmp0 + 6.*w10*y_0 + 6.*w11*y_3; } } else { // constant data for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,4,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 36.*w12*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 36.*w12*y_p[k]; } } } const index_t firstNode=m_NN[0]*m_NN[1]*(m_NN[2]-2)+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k1 loop } // colouring } // face 5 } // end of parallel region } /****************************************************************************/ // PDE SYSTEM REDUCED /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDESystemReduced( AbstractSystemMatrix* mat, Data& rhs, const Data& A, const Data& B, const Data& C, const Data& D, const Data& X, const Data& Y) const { dim_t numEq, numComp; if (!mat) numEq=numComp=(rhs.isEmpty() ? 1 : rhs.getDataPointSize()); else { numEq=mat->getRowBlockSize(); numComp=mat->getColumnBlockSize(); } const double w0 = m_dx[0]/16; const double w1 = m_dx[1]/16; const double w2 = m_dx[2]/16; const double w3 = m_dx[0]*m_dx[1]/32; const double w4 = m_dx[0]*m_dx[2]/32; const double w5 = m_dx[1]*m_dx[2]/32; const double w6 = m_dx[0]*m_dx[1]/(16*m_dx[2]); const double w7 = m_dx[0]*m_dx[2]/(16*m_dx[1]); const double w8 = m_dx[1]*m_dx[2]/(16*m_dx[0]); const double w9 = m_dx[0]*m_dx[1]*m_dx[2]/64; const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = (!A.isEmpty() || !B.isEmpty() || !C.isEmpty() || !D.isEmpty()); const bool add_EM_F = (!X.isEmpty() || !Y.isEmpty()); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8*numEq*numComp, zero); vector<Scalar> EM_F(8*numEq, zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = k0 + NE0*k1 + NE0*NE1*k2; if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); /////////////// // process A // /////////////// if (!A.isEmpty()) { const Scalar* A_p = A.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar Aw00 = A_p[INDEX4(k,0,m,0,numEq,3,numComp)]*w8; const Scalar Aw10 = A_p[INDEX4(k,1,m,0,numEq,3,numComp)]*w2; const Scalar Aw20 = A_p[INDEX4(k,2,m,0,numEq,3,numComp)]*w1; const Scalar Aw01 = A_p[INDEX4(k,0,m,1,numEq,3,numComp)]*w2; const Scalar Aw11 = A_p[INDEX4(k,1,m,1,numEq,3,numComp)]*w7; const Scalar Aw21 = A_p[INDEX4(k,2,m,1,numEq,3,numComp)]*w0; const Scalar Aw02 = A_p[INDEX4(k,0,m,2,numEq,3,numComp)]*w1; const Scalar Aw12 = A_p[INDEX4(k,1,m,2,numEq,3,numComp)]*w0; const Scalar Aw22 = A_p[INDEX4(k,2,m,2,numEq,3,numComp)]*w6; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 + Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 + Aw10 + Aw11 - Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+= Aw00 + Aw01 - Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=-Aw00 - Aw01 + Aw02 - Aw10 - Aw11 + Aw12 - Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 - Aw20 + Aw21 - Aw22; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 - Aw10 + Aw11 - Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=-Aw00 + Aw01 - Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+= Aw00 - Aw01 + Aw02 + Aw10 - Aw11 + Aw12 + Aw20 - Aw21 + Aw22; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 + Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 + Aw10 - Aw11 - Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+= Aw00 - Aw01 - Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=-Aw00 + Aw01 + Aw02 - Aw10 + Aw11 + Aw12 - Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 - Aw20 - Aw21 - Aw22; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 - Aw10 - Aw11 - Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=-Aw00 - Aw01 - Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+= Aw00 + Aw01 + Aw02 + Aw10 + Aw11 + Aw12 + Aw20 + Aw21 + Aw22; } } } /////////////// // process B // /////////////// if (!B.isEmpty()) { const Scalar* B_p = B.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wB0 = B_p[INDEX3(k,0,m, numEq, 3)]*w5; const Scalar wB1 = B_p[INDEX3(k,1,m, numEq, 3)]*w4; const Scalar wB2 = B_p[INDEX3(k,2,m, numEq, 3)]*w3; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=-wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= wB0 - wB1 - wB2; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=-wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+= wB0 + wB1 - wB2; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=-wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+= wB0 - wB1 + wB2; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=-wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+= wB0 + wB1 + wB2; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+= wB0 + wB1 + wB2; } } } /////////////// // process C // /////////////// if (!C.isEmpty()) { const Scalar* C_p = C.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wC0 = C_p[INDEX3(k, m, 0, numEq, numComp)]*w5; const Scalar wC1 = C_p[INDEX3(k, m, 1, numEq, numComp)]*w4; const Scalar wC2 = C_p[INDEX3(k, m, 2, numEq, numComp)]*w3; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=-wC0 - wC1 - wC2; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+= wC0 - wC1 - wC2; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=-wC0 + wC1 - wC2; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+= wC0 + wC1 - wC2; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=-wC0 - wC1 + wC2; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+= wC0 - wC1 + wC2; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=-wC0 + wC1 + wC2; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+= wC0 + wC1 + wC2; } } } /////////////// // process D // /////////////// if (!D.isEmpty()) { const Scalar* D_p = D.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar wD = D_p[INDEX2(k, m, numEq)]*w9; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,0,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,0,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]+=wD; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]+=wD; } } } /////////////// // process X // /////////////// if (!X.isEmpty()) { const Scalar* X_p = X.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { const Scalar wX0 = 8.*X_p[INDEX2(k, 0, numEq)]*w5; const Scalar wX1 = 8.*X_p[INDEX2(k, 1, numEq)]*w4; const Scalar wX2 = 8.*X_p[INDEX2(k, 2, numEq)]*w3; EM_F[INDEX2(k,0,numEq)]+=-wX0 - wX1 - wX2; EM_F[INDEX2(k,1,numEq)]+= wX0 - wX1 - wX2; EM_F[INDEX2(k,2,numEq)]+=-wX0 + wX1 - wX2; EM_F[INDEX2(k,3,numEq)]+= wX0 + wX1 - wX2; EM_F[INDEX2(k,4,numEq)]+=-wX0 - wX1 + wX2; EM_F[INDEX2(k,5,numEq)]+= wX0 - wX1 + wX2; EM_F[INDEX2(k,6,numEq)]+=-wX0 + wX1 + wX2; EM_F[INDEX2(k,7,numEq)]+= wX0 + wX1 + wX2; } } /////////////// // process Y // /////////////// if (!Y.isEmpty()) { const Scalar* Y_p = Y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,1,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,2,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,3,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,4,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,5,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,6,numEq)]+=8.*Y_p[k]*w9; EM_F[INDEX2(k,7,numEq)]+=8.*Y_p[k]*w9; } } // add to matrix (if add_EM_S) and RHS (if add_EM_F) const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // end k0 loop } // end k1 loop } // end k2 loop } // end of colouring } // end of parallel region } /****************************************************************************/ // PDE SYSTEM REDUCED BOUNDARY /****************************************************************************/ template<class Scalar> void DefaultAssembler3D<Scalar>::assemblePDEBoundarySystemReduced( AbstractSystemMatrix* mat, Data& rhs, const Data& d, const Data& y) const { dim_t numEq, numComp; if (!mat) numEq=numComp=(rhs.isEmpty() ? 1 : rhs.getDataPointSize()); else { numEq=mat->getRowBlockSize(); numComp=mat->getColumnBlockSize(); } const double w0 = m_dx[0]*m_dx[1]/16.; const double w1 = m_dx[0]*m_dx[2]/16.; const double w2 = m_dx[1]*m_dx[2]/16.; const dim_t NE0 = m_NE[0]; const dim_t NE1 = m_NE[1]; const dim_t NE2 = m_NE[2]; const bool add_EM_S = !d.isEmpty(); const bool add_EM_F = !y.isEmpty(); const Scalar zero = static_cast<Scalar>(0); rhs.requireWrite(); #pragma omp parallel { vector<Scalar> EM_S(8*8*numEq*numComp, zero); vector<Scalar> EM_F(8*numEq, zero); if (domain->m_faceOffset[0] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w2; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,2,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,4,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 4.*w2*y_p[k]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*k1; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k1 loop } // k2 loop } // colouring } // face 0 if (domain->m_faceOffset[1] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k1=0; k1<NE1; ++k1) { const index_t e = domain->m_faceOffset[1]+INDEX2(k1,k2,NE1); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w2; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,1,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 4.*w2*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 4.*w2*y_p[k]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(k1+1)-2; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k1 loop } // k2 loop } // colouring } // face 1 if (domain->m_faceOffset[2] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[2]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w1; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,1,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,4,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 4.*w1*y_p[k]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k2 loop } // colouring } // face 2 if (domain->m_faceOffset[3] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k2_0=0; k2_0<2; k2_0++) { // colouring #pragma omp for for (index_t k2=k2_0; k2<NE2; k2+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[3]+INDEX2(k0,k2,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w1; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,2,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 4.*w1*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 4.*w1*y_p[k]; } } const index_t firstNode=m_NN[0]*m_NN[1]*k2+m_NN[0]*(m_NN[1]-2)+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k2 loop } // colouring } // face 3 if (domain->m_faceOffset[4] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[4]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w0; EM_S[INDEX4(k,m,0,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,0,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,1,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,2,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,0,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,1,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,2,3,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,3,3,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,0,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,1,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,2,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,3,numEq)] = 4.*w0*y_p[k]; } } const index_t firstNode=m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k1 loop } // colouring } // face 4 if (domain->m_faceOffset[5] > -1) { if (add_EM_S) fill(EM_S.begin(), EM_S.end(), zero); if (add_EM_F) fill(EM_F.begin(), EM_F.end(), zero); for (index_t k1_0=0; k1_0<2; k1_0++) { // colouring #pragma omp for for (index_t k1=k1_0; k1<NE1; k1+=2) { for (index_t k0=0; k0<NE0; ++k0) { const index_t e = domain->m_faceOffset[5]+INDEX2(k0,k1,NE0); /////////////// // process d // /////////////// if (add_EM_S) { const Scalar* d_p = d.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { for (index_t m=0; m<numComp; m++) { const Scalar tmp0 = d_p[INDEX2(k, m, numEq)]*w0; EM_S[INDEX4(k,m,4,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,4,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,5,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,6,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,4,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,5,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,6,7,numEq,numComp,8)]=tmp0; EM_S[INDEX4(k,m,7,7,numEq,numComp,8)]=tmp0; } } } /////////////// // process y // /////////////// if (add_EM_F) { const Scalar* y_p = y.getSampleDataRO(e, zero); for (index_t k=0; k<numEq; k++) { EM_F[INDEX2(k,4,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,5,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,6,numEq)] = 4.*w0*y_p[k]; EM_F[INDEX2(k,7,numEq)] = 4.*w0*y_p[k]; } } const index_t firstNode=m_NN[0]*m_NN[1]*(m_NN[2]-2)+m_NN[0]*k1+k0; domain->addToMatrixAndRHS(mat, rhs, EM_S, EM_F, add_EM_S, add_EM_F, firstNode, numEq, numComp); } // k0 loop } // k1 loop } // colouring } // face 5 } // end of parallel region } // instantiate our two supported versions template class DefaultAssembler3D<escript::DataTypes::real_t>; template class DefaultAssembler3D<escript::DataTypes::cplx_t>; } // namespace ripley
79.151515
293
0.398058
[ "vector" ]
27d59d35928fc93c25061c6609cb7c82c1a04c82
8,895
cpp
C++
rqt-stream-manipulator-3d/src/filters/cropbox.cpp
3DVision-Stack/stream-manipulator-3D
7a17dc3eadf4a3d7618275223b3fee51967367db
[ "BSD-3-Clause" ]
4
2016-07-04T23:01:17.000Z
2017-03-16T23:04:02.000Z
rqt-stream-manipulator-3d/src/filters/cropbox.cpp
3DVision-Stack/stream-manipulator-3D
7a17dc3eadf4a3d7618275223b3fee51967367db
[ "BSD-3-Clause" ]
null
null
null
rqt-stream-manipulator-3d/src/filters/cropbox.cpp
3DVision-Stack/stream-manipulator-3D
7a17dc3eadf4a3d7618275223b3fee51967367db
[ "BSD-3-Clause" ]
3
2017-03-20T09:21:33.000Z
2018-03-14T02:13:44.000Z
// Software License Agreement (BSD License) // // Stream Manipulator 3d - https://github.com/3DVision-Stack/stream-manipulator-3D // Copyright (c) 2016, Federico Spinelli (fspinelli@gmail.com) // 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 copyright holder(s) nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <rqt_stream_manipulator_3d/filters/cropbox.h> #include <pluginlib/class_list_macros.h> #include <QColorDialog> namespace rqt_sm3d { namespace filters { void CropBox::init(const std::string &name) { name_ = name; page_= new QWidget(); ui_.setupUi(page_); config = shm.segment.find<Config>((name_+"Config").c_str()).first; while(!config) { boost::this_thread::sleep(boost::posix_time::milliseconds(50)); config = shm.segment.find<Config>((name_+"Config").c_str()).first; /* QCoreApplication::processEvents(QEventLoop::AllEvents, 100); */ } {//Lock configuration mutex to read ShmHandler::Lock lock(config->mtx); button_->setChecked(!config->disabled); if (!config->disabled) ui_.Title->setStyleSheet("background-color: green"); ui_.pub_markerB->setChecked(config->pub_marker); ui_.organizedB->setChecked(config->organized); ui_.negativeB->setChecked(config->negative); ui_.Xmin->setValue(config->lim_x1); ui_.Xmax->setValue(config->lim_x2); ui_.Ymin->setValue(config->lim_y1); ui_.Ymax->setValue(config->lim_y2); ui_.Zmin->setValue(config->lim_z1); ui_.Zmax->setValue(config->lim_z2); ui_.QW->setValue(config->qw); ui_.QX->setValue(config->qx); ui_.QY->setValue(config->qy); ui_.QZ->setValue(config->qz); ui_.TX->setValue(config->tx); ui_.TY->setValue(config->ty); ui_.TZ->setValue(config->tz); QColor mcolor; mcolor.setRgbF(config->color_r, config->color_g, config->color_b); QPixmap pixm(32,32); pixm.fill(mcolor); QIcon icon(pixm); ui_.ColorSelectB->setIcon(icon); ui_.ColorSelectB->setIconSize(QSize(32,32)); } ui_.Title->setText(ui_.Title->text().prepend(name_.c_str())); connect(button_, SIGNAL(clicked(bool)), this, SLOT(onEnableDisable(bool))); connect(ui_.Xmin, SIGNAL(valueChanged(double)), this, SLOT(onXminChanged(double))); connect(ui_.Ymin, SIGNAL(valueChanged(double)), this, SLOT(onYminChanged(double))); connect(ui_.Zmin, SIGNAL(valueChanged(double)), this, SLOT(onZminChanged(double))); connect(ui_.Xmax, SIGNAL(valueChanged(double)), this, SLOT(onXmaxChanged(double))); connect(ui_.Ymax, SIGNAL(valueChanged(double)), this, SLOT(onYmaxChanged(double))); connect(ui_.Zmax, SIGNAL(valueChanged(double)), this, SLOT(onZmaxChanged(double))); connect(ui_.QW, SIGNAL(valueChanged(double)), this, SLOT(onQWChanged(double))); connect(ui_.QX, SIGNAL(valueChanged(double)), this, SLOT(onQXChanged(double))); connect(ui_.QY, SIGNAL(valueChanged(double)), this, SLOT(onQYChanged(double))); connect(ui_.QZ, SIGNAL(valueChanged(double)), this, SLOT(onQZChanged(double))); connect(ui_.TX, SIGNAL(valueChanged(double)), this, SLOT(onTXChanged(double))); connect(ui_.TY, SIGNAL(valueChanged(double)), this, SLOT(onTYChanged(double))); connect(ui_.TZ, SIGNAL(valueChanged(double)), this, SLOT(onTZChanged(double))); connect(ui_.pub_markerB, SIGNAL(clicked(bool)), this, SLOT(onPubMarks(bool))); connect(ui_.organizedB, SIGNAL(clicked(bool)), this, SLOT(onOrganized(bool))); connect(ui_.negativeB, SIGNAL(clicked(bool)), this, SLOT(onNegative(bool))); connect(ui_.ColorSelectB, SIGNAL(clicked()), this, SLOT(onColorSelect())); } void CropBox::onEnableDisable(bool checked) { if (checked) ui_.Title->setStyleSheet("background-color: green"); else ui_.Title->setStyleSheet("background-color: red"); ShmHandler::Lock lock(config->mtx); config->disabled=!checked; } void CropBox::onNegative(bool checked) { ShmHandler::Lock lock(config->mtx); config->negative=checked; } void CropBox::onOrganized(bool checked) { ShmHandler::Lock lock(config->mtx); config->organized=checked; } void CropBox::onPubMarks(bool checked) { ShmHandler::Lock lock(config->mtx); config->pub_marker=checked; } void CropBox::onXminChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_x1 = val; config->lim_changed = true; } void CropBox::onYminChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_y1 = val; config->lim_changed = true; } void CropBox::onZminChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_z1 = val; config->lim_changed = true; } void CropBox::onXmaxChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_x2 = val; config->lim_changed = true; } void CropBox::onYmaxChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_y2 = val; config->lim_changed = true; } void CropBox::onZmaxChanged(double val) { ShmHandler::Lock lock(config->mtx); config->lim_z2 = val; config->lim_changed = true; } void CropBox::onQWChanged(double val) { ShmHandler::Lock lock(config->mtx); config->qw = val; config->trans_changed = true; } void CropBox::onQXChanged(double val) { ShmHandler::Lock lock(config->mtx); config->qx = val; config->trans_changed = true; } void CropBox::onQYChanged(double val) { ShmHandler::Lock lock(config->mtx); config->qy = val; config->trans_changed = true; } void CropBox::onQZChanged(double val) { ShmHandler::Lock lock(config->mtx); config->qz = val; config->trans_changed = true; } void CropBox::onTXChanged(double val) { ShmHandler::Lock lock(config->mtx); config->tx = val; config->trans_changed = true; } void CropBox::onTYChanged(double val) { ShmHandler::Lock lock(config->mtx); config->ty = val; config->trans_changed = true; } void CropBox::onTZChanged(double val) { ShmHandler::Lock lock(config->mtx); config->tz = val; config->trans_changed = true; } void CropBox::onColorSelect() { QColor color = QColorDialog::getColor(Qt::white, page_); if (!color.isValid()) return; QPixmap pixm(32,32); pixm.fill(color); QIcon icon(pixm); ui_.ColorSelectB->setIcon(icon); ui_.ColorSelectB->setIconSize(QSize(32,32)); ShmHandler::Lock lock(config->mtx); config->color_r = color.redF(); config->color_g = color.greenF(); config->color_b = color.blueF(); } }//ns }//ns filters PLUGINLIB_EXPORT_CLASS(rqt_sm3d::filters::CropBox, rqt_sm3d::Plugin);
36.158537
91
0.632265
[ "3d" ]
27d9c836cc22a2f1b29bc5811cd82641fa318204
869
hpp
C++
source/ppm_image.hpp
ArpanRatanghayra/Non-Linear-Anisotropic-Diffussion
1a653cd1d195a28e379da374d6cfbe9c5b64986b
[ "MIT" ]
1
2022-03-03T05:09:36.000Z
2022-03-03T05:09:36.000Z
source/ppm_image.hpp
ArpanRatanghayra/Non-Linear-Anisotropic-Diffussion
1a653cd1d195a28e379da374d6cfbe9c5b64986b
[ "MIT" ]
null
null
null
source/ppm_image.hpp
ArpanRatanghayra/Non-Linear-Anisotropic-Diffussion
1a653cd1d195a28e379da374d6cfbe9c5b64986b
[ "MIT" ]
1
2022-03-03T05:09:45.000Z
2022-03-03T05:09:45.000Z
/*! \file \brief PPM image io \author Ilya Shoshin (Galarius) \copyright (c) 2016, Research Institute of Instrument Engineering */ #ifndef __PPM_IMAGE__ #define __PPM_IMAGE__ #include <vector> #include <string> class PPMImage { public: PPMImage(); ~PPMImage(); PPMImage(int w, int h); PPMImage(std::vector<char> data, int w, int h); PPMImage(const PPMImage &other); PPMImage &operator=(const PPMImage &other); public: /*! * \throws std::invalid_argument */ static PPMImage load(const std::string &path); static void save(const PPMImage &input, std::string path); static PPMImage toRGB(const PPMImage &input); int packData(unsigned int **packed); void unpackData(unsigned int *packed, int size); void clear(); public: std::vector<char> pixel; int width, height; }; #endif // __PPM_IMAGE__
22.868421
67
0.674338
[ "vector" ]
27db24d65b5a9eac832f80f187d849012316cf74
12,651
cpp
C++
Co-Simulation/Sumo/sumo-1.7.0/src/microsim/engine/RealisticEngineModel.cpp
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
Co-Simulation/Sumo/sumo-1.7.0/src/microsim/engine/RealisticEngineModel.cpp
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
Co-Simulation/Sumo/sumo-1.7.0/src/microsim/engine/RealisticEngineModel.cpp
uruzahe/carla
940c2ab23cce1eda1ef66de35f66b42d40865fb1
[ "MIT" ]
null
null
null
/****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo // Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. // This program and the accompanying materials are made available under the // terms of the Eclipse Public License 2.0 which is available at // https://www.eclipse.org/legal/epl-2.0/ // This Source Code may also be made available under the following Secondary // Licenses when the conditions for such availability set forth in the Eclipse // Public License 2.0 are satisfied: GNU General Public License, version 2 // or later which is available at // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ /// @file RealisticEngineModel.cpp /// @author Michele Segata, Antonio Saverio Valente /// @date 4 Feb 2015 /// // A detailed engine model /****************************************************************************/ #include "RealisticEngineModel.h" #include <cmath> //define M_PI if this is not defined in <cmath> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #include <stdio.h> #include <iostream> #include <xercesc/sax2/SAX2XMLReader.hpp> #include <xercesc/sax/EntityResolver.hpp> #include <xercesc/sax/InputSource.hpp> #include <xercesc/sax2/XMLReaderFactory.hpp> #include <microsim/cfmodels/CC_Const.h> #include "utils/common/StdDefs.h" #include <algorithm> RealisticEngineModel::RealisticEngineModel() { className = "RealisticEngineModel"; dt_s = 0.01; xmlFile = "vehicles.xml"; minSpeed_mps = rpmToSpeed_mps(ep.minRpm, ep.wheelDiameter_m, ep.differentialRatio, ep.gearRatios[0]); } RealisticEngineModel::~RealisticEngineModel() {} double RealisticEngineModel::rpmToSpeed_mps(double rpm, double wheelDiameter_m = 0.94, double differentialRatio = 4.6, double gearRatio = 4.5) { return rpm * wheelDiameter_m * M_PI / (differentialRatio * gearRatio * 60); } double RealisticEngineModel::rpmToSpeed_mps(double rpm) { return ep.__rpmToSpeedCoefficient * rpm / ep.gearRatios[currentGear]; } double RealisticEngineModel::speed_mpsToRpm(double speed_mps, double wheelDiameter_m, double differentialRatio, double gearRatio) { return speed_mps * differentialRatio * gearRatio * 60 / (wheelDiameter_m * M_PI); } double RealisticEngineModel::speed_mpsToRpm(double speed_mps) { return ep.__speedToRpmCoefficient * speed_mps * ep.gearRatios[currentGear]; } double RealisticEngineModel::speed_mpsToRpm(double speed_mps, double gearRatio) { return ep.__speedToRpmCoefficient * speed_mps * gearRatio; } double RealisticEngineModel::rpmToPower_hp(double rpm, const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping) { double sum = engineMapping->x[0]; for (int i = 1; i < engineMapping->degree; i++) { sum += engineMapping->x[i] + pow(rpm, i); } return sum; } double RealisticEngineModel::rpmToPower_hp(double rpm) { if (rpm >= ep.maxRpm) { rpm = ep.maxRpm; } double sum = ep.engineMapping.x[0]; for (int i = 1; i < ep.engineMapping.degree; i++) { sum += ep.engineMapping.x[i] * pow(rpm, i); } return sum; } double RealisticEngineModel::speed_mpsToPower_hp(double speed_mps, const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping, double wheelDiameter_m, double differentialRatio, double gearRatio) { double rpm = speed_mpsToRpm(speed_mps, wheelDiameter_m, differentialRatio, gearRatio); return rpmToPower_hp(rpm, engineMapping); } double RealisticEngineModel::speed_mpsToPower_hp(double speed_mps) { return rpmToPower_hp(speed_mpsToRpm(speed_mps)); } double RealisticEngineModel::speed_mpsToThrust_N(double speed_mps, const struct EngineParameters::PolynomialEngineModelRpmToHp* engineMapping, double wheelDiameter_m, double differentialRatio, double gearRatio, double engineEfficiency) { double power_hp = speed_mpsToPower_hp(speed_mps, engineMapping, wheelDiameter_m, differentialRatio, gearRatio); return engineEfficiency * power_hp * HP_TO_W / speed_mps; } double RealisticEngineModel::speed_mpsToThrust_N(double speed_mps) { double power_hp = speed_mpsToPower_hp(speed_mps); return ep.__speedToThrustCoefficient * power_hp / speed_mps; } double RealisticEngineModel::airDrag_N(double speed_mps, double cAir, double a_m2, double rho_kgpm3) { return 0.5 * cAir * a_m2 * rho_kgpm3 * speed_mps * speed_mps; } double RealisticEngineModel::airDrag_N(double speed_mps) { return ep.__airFrictionCoefficient * speed_mps * speed_mps; } double RealisticEngineModel::rollingResistance_N(double speed_mps, double mass_kg, double cr1, double cr2) { return mass_kg * GRAVITY_MPS2 * (cr1 + cr2 * speed_mps * speed_mps); } double RealisticEngineModel::rollingResistance_N(double speed_mps) { return ep.__cr1 + ep.__cr2 * speed_mps * speed_mps; } double RealisticEngineModel::gravityForce_N(double mass_kg, double slope = 0) { return mass_kg * GRAVITY_MPS2 * sin(slope / 180 * M_PI); } double RealisticEngineModel::gravityForce_N() { return ep.__gravity; } double RealisticEngineModel::opposingForce_N(double speed_mps, double mass_kg, double slope, double cAir, double a_m2, double rho_kgpm3, double cr1, double cr2) { return airDrag_N(speed_mps, cAir, a_m2, rho_kgpm3) + rollingResistance_N(speed_mps, mass_kg, cr1, cr2) + gravityForce_N(mass_kg, slope); } double RealisticEngineModel::opposingForce_N(double speed_mps) { return airDrag_N(speed_mps) + rollingResistance_N(speed_mps) + gravityForce_N(); } double RealisticEngineModel::maxNoSlipAcceleration_mps2(double slope, double frictionCoefficient) { return frictionCoefficient * GRAVITY_MPS2 * cos(slope / 180 * M_PI); } double RealisticEngineModel::maxNoSlipAcceleration_mps2() { return ep.__maxNoSlipAcceleration; } double RealisticEngineModel::thrust_NToAcceleration_mps2(double thrust_N) { return thrust_N / ep.__maxAccelerationCoefficient; } int RealisticEngineModel::performGearShifting(double speed_mps, double acceleration_mps2) { int newGear = 0; const double delta = acceleration_mps2 >= 0 ? ep.shiftingRule.deltaRpm : -ep.shiftingRule.deltaRpm; for (newGear = 0; newGear < ep.nGears - 1; newGear++) { const double rpm = speed_mpsToRpm(speed_mps, ep.gearRatios[newGear]); if (rpm >= ep.shiftingRule.rpm + delta) { continue; } else { break; } } currentGear = newGear; return currentGear; } double RealisticEngineModel::maxEngineAcceleration_mps2(double speed_mps) { const double maxEngineAcceleration = speed_mpsToThrust_N(speed_mps) / ep.__maxAccelerationCoefficient; return std::min(maxEngineAcceleration, maxNoSlipAcceleration_mps2()); } double RealisticEngineModel::getEngineTimeConstant_s(double rpm) { if (rpm <= 0) { return TAU_MAX; } else { if (ep.fixedTauBurn) //in this case, tau_burn is fixed and is within __engineTauDe_s { return std::min(TAU_MAX, ep.__engineTau2 / rpm + ep.__engineTauDe_s); } else //in this case, tau_burn is dynamic and is within __engineTau1 { return std::min(TAU_MAX, ep.__engineTau1 / rpm + ep.tauEx_s); } } } double RealisticEngineModel::getRealAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime timeStep) { double realAccel_mps2; //perform gear shifting, if needed performGearShifting(speed_mps, accel_mps2); //since we consider no clutch (clutch always engaged), 0 speed would mean 0 rpm, and thus //0 available power. thus, the car could never start from a complete stop. so we assume //a minimum speed of 1 m/s to compute engine power double correctedSpeed = std::max(speed_mps, minSpeed_mps); if (reqAccel_mps2 >= 0) { //the system wants to accelerate //the real engine acceleration is the minimum between what the engine can deliver, and what //has been requested double engineAccel = std::min(maxEngineAcceleration_mps2(correctedSpeed), reqAccel_mps2); //now we need to computed delayed acceleration due to actuation lag double tau = getEngineTimeConstant_s(speed_mpsToRpm(correctedSpeed)); double alpha = ep.dt / (tau + ep.dt); //compute the acceleration provided by the engine, thus removing friction from current acceleration double currentAccel_mps2 = accel_mps2 + thrust_NToAcceleration_mps2(opposingForce_N(speed_mps)); //use standard first order lag with time constant depending on engine rpm //add back frictions resistance as well realAccel_mps2 = alpha * engineAccel + (1 - alpha) * currentAccel_mps2 - thrust_NToAcceleration_mps2(opposingForce_N(speed_mps)); } else { realAccel_mps2 = getRealBrakingAcceleration(speed_mps, accel_mps2, reqAccel_mps2, timeStep); } return realAccel_mps2; } void RealisticEngineModel::getEngineData(double speed_mps, int& gear, double& rpm) { gear = currentGear; rpm = speed_mpsToRpm(speed_mps); } double RealisticEngineModel::getRealBrakingAcceleration(double speed_mps, double accel_mps2, double reqAccel_mps2, SUMOTime t) { UNUSED_PARAMETER(t); //compute which part of the deceleration is currently done by frictions double frictionDeceleration = thrust_NToAcceleration_mps2(opposingForce_N(speed_mps)); //remove the part of the deceleration which is due to friction double brakesAccel_mps2 = accel_mps2 + frictionDeceleration; //compute the new brakes deceleration double newBrakesAccel_mps2 = ep.__brakesAlpha * std::max(-ep.__maxNoSlipAcceleration, reqAccel_mps2) + ep.__brakesOneMinusAlpha * brakesAccel_mps2; //our brakes limit is tires friction newBrakesAccel_mps2 = std::max(-ep.__maxNoSlipAcceleration, newBrakesAccel_mps2); //now we need to add back our friction deceleration return newBrakesAccel_mps2 - frictionDeceleration; } void RealisticEngineModel::loadParameters(const ParMap& parameters) { std::string xmlFile, vehicleType; parseParameter(parameters, ENGINE_PAR_VEHICLE, vehicleType); parseParameter(parameters, ENGINE_PAR_XMLFILE, xmlFile); loadParameters(); } void RealisticEngineModel::loadParameters() { //initialize xerces library XERCES_CPP_NAMESPACE::XMLPlatformUtils::Initialize(); //create our xml reader XERCES_CPP_NAMESPACE::SAX2XMLReader* reader = XERCES_CPP_NAMESPACE::XMLReaderFactory::createXMLReader(); if (reader == 0) { std::cout << "The XML-parser could not be build." << std::endl; } reader->setFeature(XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchema, true); reader->setFeature(XERCES_CPP_NAMESPACE::XMLUni::fgSAX2CoreValidation, true); //VehicleEngineHandler is our SAX parser VehicleEngineHandler* engineHandler = new VehicleEngineHandler(vehicleType); reader->setContentHandler(engineHandler); reader->setErrorHandler(engineHandler); try { //parse the document. if any error is present in the xml file, the simulation will be closed reader->parse(xmlFile.c_str()); //copy loaded parameters into our engine parameters ep = engineHandler->getEngineParameters(); ep.dt = dt_s; ep.computeCoefficients(); //compute "minimum speed" to be used when computing maximum acceleration at speeds close to 0 minSpeed_mps = rpmToSpeed_mps(ep.minRpm, ep.wheelDiameter_m, ep.differentialRatio, ep.gearRatios[0]); } catch (XERCES_CPP_NAMESPACE::SAXException&) { std::cerr << "Error while parsing " << xmlFile << ": Does the file exist?" << std::endl; exit(1); } //delete handler and reader delete engineHandler; delete reader; } void RealisticEngineModel::setParameter(const std::string parameter, const std::string& value) { if (parameter == ENGINE_PAR_XMLFILE) { xmlFile = value; } if (parameter == ENGINE_PAR_VEHICLE) { vehicleType = value; if (xmlFile != "") { loadParameters(); } } } void RealisticEngineModel::setParameter(const std::string parameter, double value) { if (parameter == ENGINE_PAR_DT) { dt_s = value; } } void RealisticEngineModel::setParameter(const std::string parameter, int value) { UNUSED_PARAMETER(parameter); UNUSED_PARAMETER(value); }
40.809677
151
0.717967
[ "model" ]
27e28a78821dede66d5814678f4b1bfe6b1ad58f
13,520
cpp
C++
src/AppLogic/ImageLoader.cpp
h4koo/FSP_ImageDeconvolution
724b3c9a1a0a7c45803bd783f61e0363046a2d79
[ "MIT" ]
null
null
null
src/AppLogic/ImageLoader.cpp
h4koo/FSP_ImageDeconvolution
724b3c9a1a0a7c45803bd783f61e0363046a2d79
[ "MIT" ]
null
null
null
src/AppLogic/ImageLoader.cpp
h4koo/FSP_ImageDeconvolution
724b3c9a1a0a7c45803bd783f61e0363046a2d79
[ "MIT" ]
null
null
null
#include "ImageLoader.hpp" namespace AppLogic { bool AppLogic::ImageLoader::_is_canceled = false; const string ImageLoader::FILTER_SAVE_LOCATION = string(getenv("HOME")) + "/.fsp_imgdcnv/"; using namespace cimg_library; void ImageLoader::addImageFileInfo(const string &full_path) { this->loaded_file_paths.push_back(full_path); string only_filename = fs::path(full_path).filename(); size_t last_index = only_filename.find_last_of("."); only_filename = only_filename.substr(0, last_index); this->loaded_file_names.push_back(only_filename); } void ImageLoader::cancelOperation(bool status) { _is_canceled = status; } VecImage ImageLoader::loadSingleImage(const char *filename) { string full_path = fs::canonical(filename); // VecImage returns empty picture if not able to load VecImage result(full_path); this->source_directory = fs::path(full_path).parent_path(); this->addImageFileInfo(full_path); return result; } vector<VecImage> ImageLoader::loadImagesFromFolder(const char *folder_path) { this->clearLoadedData(); vector<VecImage> result; size_t first_image_col = 0; size_t first_image_row = 0; bool first_image = true; try { fs::directory_iterator it = fs::directory_iterator(fs::canonical(folder_path)); for (const auto &entry : it) { if (_is_canceled) { _is_canceled = false; return result; } if (isSupportedImageFormat(entry.path())) { string full_path = fs::canonical(entry); VecImage ld_image(full_path); if (ld_image.numCols() != 0) { if (first_image) { first_image_col = ld_image.numCols(); first_image_row = ld_image.numRows(); first_image = false; this->source_directory = entry.path().parent_path(); } if (first_image_col == ld_image.numCols() && first_image_row == ld_image.numRows()) { this->addImageFileInfo(full_path); result.push_back(ld_image); } } } } return result; } catch (const std::exception &e) { std::cerr << e.what() << '\n'; result.clear(); return result; } } vector<FilterInfo> ImageLoader::loadFilterInfo() { this->clearLoadedData(); vector<FilterInfo> result; try { for (const auto &entry : fs::directory_iterator(fs::canonical(FILTER_SAVE_LOCATION))) { if (entry.path().extension() == FILTER_INFO_EXTENSION) { fstream fi_binary_file(entry.path(), std::ios::in | std::ios::binary | std::ios::app); FilterInfo fi; if (fi_binary_file.is_open()) { fi_binary_file >> fi; fi_binary_file.close(); result.push_back(fi); this->loaded_file_names.push_back(entry.path().filename()); this->loaded_file_paths.push_back(fs::canonical(entry)); } } } return result; } catch (const std::exception &e) { std::cerr << e.what() << '\n'; result.clear(); return result; } } vector<string> ImageLoader::getLoadedImageNames() { return this->loaded_file_names; } vector<string> ImageLoader::getLoadedImagePaths() { return this->loaded_file_paths; } vector<string> ImageLoader::getNotLoadedImagePaths() { return this->not_loaded_files; } string ImageLoader::getSourceDirectory() { return this->source_directory; } bool ImageLoader::deleteFilter(const string filter_name) { // remove filter info file string path = FILTER_SAVE_LOCATION + filter_name + FILTER_INFO_EXTENSION; string full_path = fs::canonical(path); if (remove(full_path.c_str()) != 0) return false; //remove the filter file path = FILTER_SAVE_LOCATION + filter_name + FILTER_FILE_EXTENSION; full_path = fs::canonical(path); if (remove(full_path.c_str()) != 0) return false; return true; } bool ImageLoader::existsNameFilter(string filter_name) { try { string full_filter_name = FILTER_SAVE_LOCATION + filter_name + FILTER_INFO_EXTENSION; return fs::exists(full_filter_name); } catch (const std::exception &e) { std::cerr << e.what() << '\n'; return false; } } bool ImageLoader::createFileFromZipFile(string filename, fstream &stream, zip_file *zip_file) { stream.open(filename.c_str(), std::ios::trunc | std::ios::out | std::ios::in); if (stream.bad()) return false; char file_buff[ZIP_FILE_BUFF_SIZE]; int read_bytes; try { while ((read_bytes = zip_fread(zip_file, file_buff, ZIP_FILE_BUFF_SIZE)) > 0) { if (_is_canceled) { _is_canceled = false; stream.close(); zip_fclose(zip_file); remove(filename.c_str()); return false; } stream.write(file_buff, read_bytes); } stream.close(); zip_fclose(zip_file); return true; } catch (...) { stream.close(); zip_fclose(zip_file); remove(filename.c_str()); return false; } } vector<VecImage> ImageLoader::loadImagesFromZip(string file_path) { this->clearLoadedData(); vector<VecImage> result; struct zip *z_arch; struct zip_file *z_fl; struct zip_stat z_fstat; int err; if ((z_arch = zip_open(file_path.c_str(), 0, &err)) == NULL) { // unable to open zip archive return result; } size_t first_image_col = 0; size_t first_image_row = 0; bool first_image = true; fstream temp_file; string temp_filename = FILTER_SAVE_LOCATION + string(TEMP_FILE_NAME); int num_entries = zip_get_num_entries(z_arch, 0); for (int i = 0; i < num_entries; ++i) { if (_is_canceled) { _is_canceled = false; return result; } if (zip_stat_index(z_arch, i, 0, &z_fstat) != 0) continue; if (!isSupportedImageFormat(z_fstat.name)) continue; z_fl = zip_fopen_index(z_arch, i, 0); if (!z_fl) { printf("Could not open zip file: %s", z_fstat.name); continue; } if (!createFileFromZipFile(temp_filename, temp_file, z_fl)) { printf("Couldn't load temp file"); continue; } VecImage ld_image(temp_filename); if (ld_image.numCols() == 0) continue; if (first_image) { first_image_col = ld_image.numCols(); first_image_row = ld_image.numRows(); first_image = false; this->source_directory = file_path; } if (first_image_col == ld_image.numCols() && first_image_row == ld_image.numRows()) { this->addImageFileInfo(z_fstat.name); result.push_back(ld_image); } } zip_close(z_arch); return result; } bool ImageLoader::createExportZip(string export_name, string filter_name) { if (!existsNameFilter(filter_name)) return false; int errorp; zip_t *zipper = zip_open(export_name.c_str(), ZIP_CREATE | ZIP_EXCL, &errorp); if (zipper == nullptr) { zip_error_t ziperror; zip_error_init_with_code(&ziperror, errorp); printf("Failed to open output file %s : %s", export_name.c_str(), zip_error_strerror(&ziperror)); return false; } // write file_info file string filename = FILTER_SAVE_LOCATION + filter_name + FILTER_INFO_EXTENSION; zip_source_t *source = zip_source_file(zipper, filename.c_str(), 0, 0); if (source == nullptr) { return false; } if (zip_file_add(zipper, (filter_name + FILTER_INFO_EXTENSION).c_str(), source, ZIP_FL_ENC_UTF_8) < 0) { zip_source_free(source); zip_discard(zipper); return false; } if (_is_canceled) { _is_canceled = false; zip_discard(zipper); return false; } // write filter_matrix file to archive filename = FILTER_SAVE_LOCATION + filter_name + FILTER_FILE_EXTENSION; source = zip_source_file(zipper, filename.c_str(), 0, 0); if (source == nullptr) { return false; } if (zip_file_add(zipper, (filter_name + FILTER_FILE_EXTENSION).c_str(), source, ZIP_FL_ENC_UTF_8) < 0) { zip_source_free(source); zip_discard(zipper); return false; } if (zip_close(zipper) < -1) { printf("Failed to close zipfile %s : %s", export_name.c_str(), zip_strerror(zipper)); return false; }; return true; } bool ImageLoader::importFilterFromZip(string import_filename) { struct zip *z_arch; struct zip_stat z_fstat; int zfile_finfo_index = -1; int zfile_fdata_index = -1; string finfo_filename = ""; string fdata_filename = ""; int err; if ((z_arch = zip_open(import_filename.c_str(), 0, &err)) == NULL) { // unable to open zip archive return false; } int num_entries = zip_get_num_entries(z_arch, 0); for (int i = 0; i < num_entries; ++i) { if (zip_stat_index(z_arch, i, 0, &z_fstat) != 0) continue; if (zfile_fdata_index != -1 && zfile_finfo_index != -1) break; if (endsWith(z_fstat.name, FILTER_INFO_EXTENSION) && zfile_finfo_index == -1) { zfile_finfo_index = i; finfo_filename = stripExtensionFromFilename(z_fstat.name); } if (endsWith(z_fstat.name, FILTER_FILE_EXTENSION) && zfile_fdata_index == -1) { zfile_fdata_index = i; fdata_filename = stripExtensionFromFilename(z_fstat.name); } } // filter_info file or filter_matrix file were not found if (zfile_fdata_index == -1 || zfile_finfo_index == -1) { zip_close(z_arch); return false; } // the names of the files are different if (fdata_filename.compare(finfo_filename) != 0) { zip_close(z_arch); return false; } // a filter with tha name already exists if (existsNameFilter(fdata_filename)) { zip_close(z_arch); return false; } if (_is_canceled) { _is_canceled = false; zip_close(z_arch); return false; } fstream fout; string filename_finfo = FILTER_SAVE_LOCATION + finfo_filename + FILTER_INFO_EXTENSION; if (!ImageLoader::createFileFromZipFile(filename_finfo, fout, zip_fopen_index(z_arch, zfile_finfo_index, 0))) { zip_close(z_arch); return false; } if (_is_canceled) { _is_canceled = false; zip_close(z_arch); remove(filename_finfo.c_str()); return false; } string filename_fdata = FILTER_SAVE_LOCATION + fdata_filename + FILTER_FILE_EXTENSION; if (!ImageLoader::createFileFromZipFile(filename_fdata, fout, zip_fopen_index(z_arch, zfile_fdata_index, 0))) { remove(filename_finfo.c_str()); zip_close(z_arch); return false; } zip_close(z_arch); return true; } }
31.296296
118
0.508284
[ "vector" ]
27e54019463341923c800f017261f2eddfa838f6
2,605
hpp
C++
src/weather_particle_system.hpp
sweetkristas/anura
5e8cbcfc7b761c5c01e5c5509a0fb159b8fb60cd
[ "CC0-1.0" ]
null
null
null
src/weather_particle_system.hpp
sweetkristas/anura
5e8cbcfc7b761c5c01e5c5509a0fb159b8fb60cd
[ "CC0-1.0" ]
null
null
null
src/weather_particle_system.hpp
sweetkristas/anura
5e8cbcfc7b761c5c01e5c5509a0fb159b8fb60cd
[ "CC0-1.0" ]
null
null
null
/* Copyright (C) 2003-2013 by David White <davewx7@gmail.com> 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, see <http://www.gnu.org/licenses/>. */ #ifndef WEATHER_PARTICLE_SYSTEM_HPP_INCLUDED #define WEATHER_PARTICLE_SYSTEM_HPP_INCLUDED #include "graphics.hpp" #include <deque> #include "particle_system.hpp" #include "foreach.hpp" #include "entity.hpp" #include "color_utils.hpp" #include "variant.hpp" struct weather_particle_system_info { weather_particle_system_info(variant node) : number_of_particles(node["number_of_particles"].as_int(1500)), repeat_period(node["repeat_period"].as_int(1000)), velocity_x(node["velocity_x"].as_int()), velocity_y(node["velocity_y"].as_int(5)), velocity_rand(node["velocity_rand"].as_int(3)), line_width(node["line_width"].as_int(1)), line_length(node["line_length"].as_int(8)) { irgba = graphics::color(node["color"].as_string()).value(); } int number_of_particles; int repeat_period; int velocity_x, velocity_y; int velocity_rand; int line_width, line_length; union { uint8_t rgba[4]; uint32_t irgba; }; }; class weather_particle_system_factory : public particle_system_factory { public: explicit weather_particle_system_factory(variant node); ~weather_particle_system_factory() {} particle_system_ptr create(const entity& e) const; weather_particle_system_info info; }; class weather_particle_system : public particle_system { public: weather_particle_system(const entity& e, const weather_particle_system_factory& factory); bool is_destroyed() const { return false; } void process(const entity& e); void draw(const rect& area, const entity& e) const; private: variant get_value(const std::string& key) const; void set_value(const std::string& key, const variant& value); const weather_particle_system_factory& factory_; const weather_particle_system_info& info_; int cycle_; struct particle { GLfloat pos[2]; GLfloat velocity; }; GLfloat direction[2]; GLfloat base_velocity; std::vector<particle> particles_; }; #endif
28.010753
90
0.761612
[ "vector" ]
27ecf9d1fd046d9cae6c90ba32b45e2fea7814b5
1,347
hpp
C++
include/gui/c8form.hpp
dawikur/c8
8b335158d92c283965c71e911a10bc897f293d97
[ "MIT" ]
2
2016-05-11T07:57:48.000Z
2018-01-05T04:51:18.000Z
include/gui/c8form.hpp
dawikur/c8
8b335158d92c283965c71e911a10bc897f293d97
[ "MIT" ]
15
2016-05-11T07:02:52.000Z
2016-05-20T18:14:42.000Z
include/gui/c8form.hpp
dawikur/c8
8b335158d92c283965c71e911a10bc897f293d97
[ "MIT" ]
null
null
null
// Copyright 2016 Dawid Kurek. All Rights Reserved. #ifndef INCLUDE_GUI_C8FORM_HPP_ #define INCLUDE_GUI_C8FORM_HPP_ #include <functional> #include <memory> // fix for nana #include <stdexcept> // fix for nana #include <string> #include <vector> // fix dor nana #include <nana/gui.hpp> #include <nana/gui/widgets/form.hpp> #include "callbacks.hpp" #include "gui/debugform.hpp" #include "gui/display.hpp" #include "gui/menubar.hpp" #include "type.hpp" namespace gui { class IconInit { public: IconInit(); }; class C8form : public IconInit, public nana::form { public: explicit C8form(Byte const *const display); void exec(); void fileChoosen(FileChoosen const &callback); void clockChoosen(ClockChoosen const &callback); void keyEvent(KeyEvent const &callback); UpdateDisplay updateDisplayCallback(); private: void createMenubar(); void connectToKeyboardEvents(); void connectToDragDropEvents(); void keyboardEvent(nana::arg_keyboard const &, Byte const); FileChoosen _fileChoosen; KeyEvent _keyEvent; Menubar _menubar; Display _display; Debugform _debug; }; } // namespace gui #endif // INCLUDE_GUI_C8FORM_HPP_
22.830508
94
0.641425
[ "vector" ]
27f470c047e701930fc94ba33c14a13fcae4f3a5
4,110
cc
C++
src/des/util/Scheduler_TEST.cc
nicmcd/libdes
e7fe1f4923437df3edd4fe7381ebc4c1b4ccbbfc
[ "BSD-3-Clause" ]
2
2017-12-04T17:51:12.000Z
2021-02-27T06:01:58.000Z
src/des/util/Scheduler_TEST.cc
nicmcd/libdes
e7fe1f4923437df3edd4fe7381ebc4c1b4ccbbfc
[ "BSD-3-Clause" ]
null
null
null
src/des/util/Scheduler_TEST.cc
nicmcd/libdes
e7fe1f4923437df3edd4fe7381ebc4c1b4ccbbfc
[ "BSD-3-Clause" ]
null
null
null
/* * 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 prim nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior * written permission. * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "des/util/Scheduler.h" #include <random> #include <string> #include <unordered_set> #include "des/ActiveComponent.h" #include "des/Component.h" #include "des/Logger.h" #include "des/Mapper.h" #include "des/Simulator.h" #include "des/Time.h" #include "des/util/RoundRobinMapper.h" #include "gtest/gtest.h" namespace { class Scheduled : public des::ActiveComponent { public: Scheduled(des::Simulator* _sim, const std::string& _name, std::unordered_set<des::Time>* _exeTimes) : des::ActiveComponent(_sim, _name), scheduler_(this, std::bind(&Scheduled::processRequests, this)), exeTimes_(_exeTimes) { debug = false; } void request() const { dlogf("request"); scheduler_.schedule(simulator->time().nextEpsilon()); } void processRequests() { dlogf("processing"); scheduler_.executed(); // make sure future only if (lastTime_.valid()) { assert(simulator->time() > lastTime_); } // unmark this time assert(exeTimes_->erase(simulator->time()) == 1); // save for next time lastTime_ = simulator->time(); } private: des::Scheduler scheduler_; des::Time lastTime_; std::unordered_set<des::Time>* exeTimes_; }; class Driver : public des::ActiveComponent { public: Driver(des::Simulator* _sim, const std::string& _name, Scheduled* _scheduled) : des::ActiveComponent(_sim, _name), scheduled_(_scheduled) {} void createRequest(des::Time _time) const { simulator->addEvent(new des::Event( self(), std::bind(&Driver::performRequest, const_cast<Driver*>(this)), _time, true)); } private: void performRequest() { scheduled_->request(); } Scheduled* scheduled_; }; TEST(Scheduler, basic) { std::mt19937 rnd; des::Simulator sim; des::RoundRobinMapper mapper; sim.setMapper(&mapper); des::Logger logger; sim.setLogger(&logger); std::unordered_set<des::Time> exeTimes; Scheduled sch(&sim, "Sch", &exeTimes); std::vector<Driver*> drivers; for (u32 d = 0; d < 1000; d++) { // create drivers.push_back(new Driver(&sim, "Driver_" + std::to_string(d), &sch)); // make requests u32 num = rnd() % 1000; for (u32 r = 0; r < num; r++) { des::Time time = des::Time(rnd() % 10000, 0); drivers.at(d)->createRequest(time); exeTimes.insert(time.nextEpsilon()); } } sim.simulate(); ASSERT_EQ(exeTimes.size(), 0u); for (u32 d = 0; d < 1000; d++) { delete drivers.at(d); } } } // namespace
29.568345
80
0.694161
[ "vector" ]
27f4779af27eaa52fe5fac3f094a606f43279b84
1,001
cpp
C++
474_find_max_form/find_max_form.cpp
Mengsen-W/algorithm
66216b8601e416343a2cc191bd0f2f12eb282262
[ "BSD-3-Clause" ]
null
null
null
474_find_max_form/find_max_form.cpp
Mengsen-W/algorithm
66216b8601e416343a2cc191bd0f2f12eb282262
[ "BSD-3-Clause" ]
null
null
null
474_find_max_form/find_max_form.cpp
Mengsen-W/algorithm
66216b8601e416343a2cc191bd0f2f12eb282262
[ "BSD-3-Clause" ]
null
null
null
/* * @Date: 2021-06-06 09:36:27 * @Author: Mengsen Wang * @LastEditors: Mengsen Wang * @LastEditTime: 2021-06-06 09:44:49 */ #include <cassert> #include <string> #include <vector> using namespace std; int findMaxForm(vector<string>& strs, int m, int n) { vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0)); for (string str : strs) { int zeroNum = 0, oneNum = 0; for (char c : str) { // 统计每个字符串的0和1的数量 if (c == '0') { zeroNum++; } else { oneNum++; } } for (int i = m; i >= zeroNum; i--) { // 01背包罢了, 但是重量有两个维度 for (int j = n; j >= oneNum; j--) { dp[i][j] = max(dp[i][j], dp[i - zeroNum][j - oneNum] + 1); } // 不装 or 装得下, 取最大值 } } return dp[m][n]; } int main() { { vector<string> strs{"10", "0001", "111001", "1", "0"}; int m = 5, n = 3; assert(findMaxForm(strs, m, n) == 4); } { vector<string> strs{"01", "0", "1"}; int m = 1, n = 1; assert(findMaxForm(strs, m, n) == 2); } }
22.75
66
0.505495
[ "vector" ]
27faef4541b4aa8e436e215c622d25c9d8976526
682
hpp
C++
src/IRenderer.hpp
trevorsm7/game-engine
a233201b380ba724f8b7392299505ccd3fcfe29d
[ "MIT" ]
1
2021-02-05T12:57:32.000Z
2021-02-05T12:57:32.000Z
src/IRenderer.hpp
blockspacer/game-engine
a233201b380ba724f8b7392299505ccd3fcfe29d
[ "MIT" ]
null
null
null
src/IRenderer.hpp
blockspacer/game-engine
a233201b380ba724f8b7392299505ccd3fcfe29d
[ "MIT" ]
1
2021-02-05T12:57:34.000Z
2021-02-05T12:57:34.000Z
#pragma once #include "Transform.hpp" #include <string> #include <vector> class TileMap; class IRenderer { public: virtual ~IRenderer() {} virtual void preRender() = 0; virtual void postRender() = 0; virtual void pushModelTransform(Transform& transform) = 0; virtual void pushCameraTransform(Transform& transform) = 0; virtual void setColor(float red, float green, float blue) = 0; virtual void drawSprite(const std::string& name) = 0; virtual void drawTiles(const TileMap* tilemap) = 0; virtual void drawLines(const std::vector<float>& points) = 0; virtual void popModelTransform() = 0; virtual void popCameraTransform() = 0; };
23.517241
66
0.696481
[ "vector", "transform" ]
27fcc9a752f78a9b119c9fbc42000fc54e3c4a66
11,510
hpp
C++
include/glhelper/glhelper_core.hpp
louishobson/GLHelper
2a914dd90eeb96797e3963f94d39b25625d47054
[ "Apache-2.0" ]
null
null
null
include/glhelper/glhelper_core.hpp
louishobson/GLHelper
2a914dd90eeb96797e3963f94d39b25625d47054
[ "Apache-2.0" ]
null
null
null
include/glhelper/glhelper_core.hpp
louishobson/GLHelper
2a914dd90eeb96797e3963f94d39b25625d47054
[ "Apache-2.0" ]
null
null
null
/* * Copyright (C) 2020 Louis Hobson <louis-hobson@hotmail.co.uk>. All Rights Reserved. * * Distributed under MIT licence as a part of the GLHelper C++ library. * For details, see: https://github.com/louishobson/GLHelper/blob/master/LICENSE * * include/glhelper/glhelper_core.hpp * * core header for glhelper library * sets up OpenGL headers and defines core base classes * notable constructs include: * * * * ENUM STRUCT GLH::CORE::MINOR_OBJECT_TYPE * ENUM STRUCT GLH::CORE::OBJECT_BIND_TARGET * ENUM STRUCT GLH::CORE::MAJOR_OBJECT_TYPE * * different types of object and bind points * a minor object type can be converted to a more general major type * a minor object type can be converted to its default bind point * there may also be more bind points available to that object type, however * this is up to derivations to implement access to those * * * * CLASS GLH::CORE::OBJECT * * abstract base class to derive all OpenGL object classes from * it provides the basis for storing the object id as well as defining several operator overloads * * * * CLASS GLH::CORE::OBJECT_POINTER * * acts as a pointer to an object that may at some point be destroyed * one can get an actual pointer to the object through a static method of the object class or through the operators in this class * */ /* HEADER GUARD */ #ifndef GLHELPER_CORE_HPP_INCLUDED #define GLHELPER_CORE_HPP_INCLUDED /* INCLUDES */ /* include core headers */ #include <iostream> #include <map> #include <type_traits> #include <utility> /* include GLAD followed by GLLFW * this order is necesarry, as GLAD defines macros, which GLFW requires even to be included */ #include <glad/glad.h> #include <GLFW/glfw3.h> /* include glhelper_exception.hpp */ #include <glhelper/glhelper_exception.hpp> /* MACROS */ /* glh_if_constexpr * * either "if" or "if constexpr" depending on availibility */ #ifdef __cpp_if_constexpr #define glh_if_constexpr if constexpr #else #define glh_if_constexpr if #endif /* NAMESPACE DECLARATIONS */ namespace glh { namespace core { /* class object * * abstract base class to represent any OpenGL object */ class object; /* class object_pointer * * safely references an object */ template<class T> class object_pointer; template<class T> using const_object_pointer = object_pointer<const T>; } namespace meta { /* struct is_object * * if T is an object, value is true, else is false */ template<class T> struct is_object; } namespace exception { /* class object_exception : exception * * for exceptions related to object management */ class object_exception; } } /* IS_OBJECT DEFINITION */ /* struct is_object * * if T is an object, value is true, else is false */ template<class T> struct glh::meta::is_object : std::is_base_of<glh::core::object, T> {}; /* OBJECT_EXCEPTION DEFINITION */ /* class object_exception : exception * * for exceptions related to object management */ class glh::exception::object_exception : public exception { public: /* full constructor * * __what: description of the exception */ explicit object_exception ( const std::string& __what ) : exception { __what } {} /* default zero-parameter constructor * * construct object_exception with no descrption */ object_exception () = default; /* default everything else and inherits what () function */ }; /* OBJECT DEFINITION */ /* class object * * abstract base class to represent any OpenGL object */ class glh::core::object { /* friend of object_pointer */ template<class T> friend class object_pointer; public: /* new object constructor * * _id: the id of the new object (defaults to 0) */ explicit object ( const unsigned _id = 0 ); /* deleted copy constructor */ object ( const object& other ) = delete; /* move constructor */ object ( object&& other ); /* deleted copy assignment operator */ object& operator= ( const object& other ) = delete; /* virtual destructor */ virtual ~object (); /* virtual bind/unbind * * implemented by derivations to bind the object * if the object is not bound on a call to unbind, the function will do nothing * the base class method will always throw * * returns true if a change in binding occured */ virtual bool bind () const { throw exception::object_exception { "not a bindable object" }; } virtual bool unbind () const { throw exception::object_exception { "not an unbindable object" }; } virtual bool bind ( const unsigned index ) const { throw exception::object_exception { "not an index bindable object" }; } virtual bool unbind ( const unsigned index ) const { throw exception::object_exception { "not an index unbindable object" }; } /* unbind_all * * cam be implemented by derivations to unbind the object from all bind points * the base class just calls unbind * * returns true if a change in binding occured */ bool virtual unbind_all () const { return unbind (); } /* virtual is_bound * * returns true if the object is bound * base class method always returns false */ virtual bool is_bound () const { return false; } /* virtual is_object_valid * * determines if the object is valid (id > 0) * may be overloaded when derived to add more parameters to validity * * return: boolean representing validity */ virtual bool is_object_valid () const { return ( id > 0 ); } /* not operator * * determines if the object is invalid * synonymous to !object.is_object_valid () * * return: boolean representing invalidity */ bool operator! () const { return !is_object_valid (); } /* comparison operator */ bool operator== ( const object& other ) const { return unique_id == other.unique_id; } bool operator!= ( const object& other ) const { return unique_id != other.unique_id; } /* internal_id * * returns the internal id of the object */ const unsigned& internal_id () const { return id; } /* internal_unique_id * * returns the unique id of the object */ const unsigned& internal_unique_id () const { return unique_id; } protected: /* NON-STATIC MEMBERS */ /* id * * the OpenGL id of the object */ unsigned id; /* unique_id * * the unique id of the object * will be different for EVERY object that ever exists * will not be changed for move-constructed objects, however */ const unsigned unique_id; /* STATIC MEMBERS */ /* next_unique_id * * the next unique id to be used * incremented for each new object */ static unsigned next_unique_id; /* object_pointers * * map between unique ids and pointers to their objects */ static std::map<unsigned, object *> object_pointers; }; /* OBJECT_POINTER DEFINITION */ /* class object_pointer * * safely points to an object */ template<class T> class glh::core::object_pointer { /* static assert that T is an object type */ static_assert ( meta::is_object<T>::value, "object_pointer cannot be instantiated from non-object-derived type" ); public: /* construct from an object */ object_pointer ( T& obj ) : id { obj.internal_id () } , unique_id { obj.internal_unique_id () } {} /* pointer constructor */ object_pointer ( T * obj ) : id ( obj ? obj->internal_id () : 0 ) , unique_id { obj ? obj->internal_unique_id () : 0 } {} /* zero-parameter constructor */ object_pointer () : id { 0 } , unique_id { 0 } {} /* default copy constructor */ object_pointer ( const object_pointer<T>& other ) = default; /* implicitly cast to const version */ operator const_object_pointer<T> () const { return const_object_pointer<T> { get () }; } /* assignment from object */ object_pointer& operator= ( T& obj ); object_pointer& operator= ( T * obj ); /* default copy assignment operator */ object_pointer& operator= ( const object_pointer& other ) = default; /* default destructor */ ~object_pointer () = default; /* pointer operators */ T * operator* () const { return get (); } T * operator-> () const { return get (); } /* get * * get pointer to object * returns NULL if invalid */ T * get () const; /* implicitly cast into pointer */ operator T * () const { return get (); } /* is_valid * * returns true if the pointer is valid */ bool is_pointer_valid () const { return get () != NULL; } /* operator bool * * returns true if the pointer is valid */ operator bool () const { return is_pointer_valid (); } /* operator! * * returns true if the pointer is invalid */ bool operator! () const { return !is_pointer_valid (); } /* comparison operators */ bool operator== ( const object_pointer& other ) const { return unique_id == other.unique_id; } bool operator== ( const T& obj ) const { return unique_id == obj->internal_unique_id (); } bool operator== ( const T * obj ) const { return ( obj ? unique_id == obj->internal_unique_id () : unique_id == 0 ); } bool operator!= ( const object_pointer& other ) const { return unique_id == other.unique_id; } bool operator!= ( const T& obj ) const { return unique_id != obj->internal_unique_id (); } bool operator!= ( const T * obj ) const { return ( obj ? unique_id != obj->internal_unique_id () : unique_id != 0 ); } /* internal_id * internal_unique_id * * get the id and unique id */ const unsigned& internal_id () const { return id; } const unsigned& internal_unique_id () const { return unique_id; } private: /* id and unique id */ unsigned id; unsigned unique_id; }; /* OBJECT_POINTER IMPLEMENTATION */ /* assignment from object */ template<class T> glh::core::object_pointer<T>& glh::core::object_pointer<T>::operator= ( T& obj ) { /* set id and unique id */ id = obj.internal_id (); unique_id = obj.internal_unique_id (); /* return * this */ return * this; } template<class T> glh::core::object_pointer<T>& glh::core::object_pointer<T>::operator= ( T * obj ) { /* set id and unique id */ if ( obj ) { id = obj->internal_id (); unique_id = obj->internal_unique_id (); } else { id = 0; unique_id = 0; } /* return * this */ return * this; } /* get * * get pointer to object * returns NULL if invalid */ template<class T> inline T * glh::core::object_pointer<T>::get () const { /* if unique_id == 0 return NULL */ if ( unique_id == 0 ) return NULL; /* find the pointer */ auto ptr = object::object_pointers.find ( unique_id ); /* if not found, return NULL, else cast the pointer and return it */ return dynamic_cast<T *> ( ptr == object::object_pointers.end () ? NULL : ptr->second ); } /* #ifndef GLHELPER_CORE_HPP_INCLUDED */ #endif
23.586066
129
0.63119
[ "object" ]
7e06ab79fe7e349993a7c3d72af6863aa11713b4
900
cpp
C++
codeforces/1392/1392B/main.cpp
xirc/cp-algorithm
89c67cff2f00459c5bb020ab44bff5ae419a1728
[ "Apache-2.0" ]
8
2020-12-23T07:54:53.000Z
2021-11-23T02:46:35.000Z
codeforces/1392/1392B/main.cpp
xirc/cp-algorithm
89c67cff2f00459c5bb020ab44bff5ae419a1728
[ "Apache-2.0" ]
1
2020-11-07T13:22:29.000Z
2020-12-20T12:54:00.000Z
codeforces/1392/1392B/main.cpp
xirc/cp-algorithm
89c67cff2f00459c5bb020ab44bff5ae419a1728
[ "Apache-2.0" ]
1
2021-01-16T03:40:10.000Z
2021-01-16T03:40:10.000Z
#include <bits/stdc++.h> using namespace std; using ll = long long; // O(N) void solve(int N, ll K, vector<ll>& A) { assert(N >= 1 && K >= 1); auto const& next = [&]() { ll D = *max_element(A.begin(), A.end()); for (int i = 0; i < N; ++i) { A[i] = D - A[i]; } }; --K; next(); if (K == 0) return; -- K; next(); if (K % 2) { next(); } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T, N; ll K; vector<ll> A; cin >> T; for (int tt = 0; tt < T; ++tt) { cin >> N >> K; A.assign(N, 0); for (int i = 0; i < N; ++i) { cin >> A[i]; } solve(N, K, A); for (int i = 0; i < N; ++i) { if (i > 0) cout << " "; cout << A[i]; } cout << endl; } return 0; }
16.666667
48
0.365556
[ "vector" ]
7e0e2b6dc2eadf7274bdaa92de3adc09994a9ad3
705
hpp
C++
src/application.hpp
kz04px/chip8-interpreter
51476ca70fec25c1657ae94a92a31758b49e195e
[ "MIT" ]
null
null
null
src/application.hpp
kz04px/chip8-interpreter
51476ca70fec25c1657ae94a92a31758b49e195e
[ "MIT" ]
null
null
null
src/application.hpp
kz04px/chip8-interpreter
51476ca70fec25c1657ae94a92a31758b49e195e
[ "MIT" ]
null
null
null
#ifndef APPLICATION_HPP #define APPLICATION_HPP #include <chrono> #include "chip8.hpp" #include "options.hpp" #include "window.hpp" using clockz = std::chrono::high_resolution_clock; class Application { public: [[nodiscard]] Application(const char *title, const int w, const int h); [[nodiscard]] bool run() const; bool load_rom(const char *path); void step(); void render(); void events(); void update(); private: Window window_; Chip8 chip8_; std::chrono::time_point<clockz> last_step_; std::chrono::time_point<clockz> last_timer_; std::chrono::time_point<clockz> last_render_; bool quit_ = false; bool paused_ = false; }; #endif
18.552632
75
0.675177
[ "render" ]
7e1499dce6dbf04d328f1ae492a9ab6db8f4004a
3,602
cpp
C++
source/RD/Core/Core.cpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
1
2021-12-26T12:48:18.000Z
2021-12-26T12:48:18.000Z
source/RD/Core/Core.cpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
null
null
null
source/RD/Core/Core.cpp
RobertDamerius/GroundControlStation
7f0d896bd56e5ea0ee02d5738c2b497dc2956c2f
[ "MIT" ]
1
2021-12-26T12:48:25.000Z
2021-12-26T12:48:25.000Z
/** * @file Core.cpp * @details Version 20210203. */ #include <Core.hpp> bool RD::Core::WriteFile(const std::vector<uint8_t>& in, std::string filename){ return RD::Core::WriteFile(in, filename.c_str()); } bool RD::Core::WriteFile(const std::vector<uint8_t>& in, const char* filename){ // Open file FILE *fp = fopen(filename, "wb"); if(!fp) return false; // Write bytes to file size_t bytesWritten = fwrite((const void*)&in[0], sizeof(uint8_t), in.size(), fp); fclose(fp); return (in.size() == bytesWritten); } bool RD::Core::ReadFile(std::vector<uint8_t>& out, std::string filename){ return RD::Core::ReadFile(out, filename.c_str()); } bool RD::Core::ReadFile(std::vector<uint8_t>& out, const char* filename){ // Clear reference out.clear(); // Open file FILE *fp = fopen(filename, "rb"); if(!fp) return false; // Obtain file size fseek(fp, 0, SEEK_END); long int fpsize = ftell(fp); if(fpsize < 0){ fclose(fp); return false; } // Return success if file contains no bytes fseek(fp, 0, SEEK_SET); if(!fpsize){ fclose(fp); return true; } // Read bytes from file std::vector<uint8_t> buf(fpsize); size_t bytesRead = fread((void*)&buf[0], sizeof(uint8_t), buf.size(), fp); fclose(fp); out.swap(buf); return (bytesRead == (size_t)fpsize); } bool RD::Core::ReadFile(std::string& out, std::string filename){ return RD::Core::ReadFile(out, filename.c_str()); } bool RD::Core::ReadFile(std::string& out, const char* filename){ // Clear reference out.clear(); // Read bytes from file std::vector<uint8_t> buf; if(!ReadFile(buf, filename)) return false; // Copy to reference out = std::string(buf.begin(), buf.end()); return true; } std::string RD::Core::GetTimeStringUTC(void){ time_t t; time(&t); struct tm *timeInfo = gmtime(&t); char buffer[64]; if(!timeInfo) goto error; if(!strftime(buffer, 64, "%Y-%m-%d %H:%M:%S", timeInfo)) goto error; return std::string(buffer); error: return std::string("0000-00-00 00:00:00"); } std::string RD::Core::GetTimeStringLocal(void){ time_t t; time(&t); struct tm *timeInfo = localtime(&t); char buffer[64]; if(!timeInfo) goto error; if(!strftime(buffer, 64, "%Y-%m-%d %H:%M:%S", timeInfo)) goto error; return std::string(buffer); error: return std::string("0000-00-00 00:00:00"); } void RD::Core::ReplaceText(std::string& text, std::vector<std::pair<std::string, std::string>>& replacement){ for (std::pair<std::string, std::string> fromToPair: replacement) { size_t start_pos = 0; while((start_pos = text.find(fromToPair.first, start_pos)) != std::string::npos){ text.replace(start_pos, fromToPair.first.length(), fromToPair.second); start_pos += fromToPair.second.length(); } } } void RD::Core::GetAppDirectory(std::string& path, std::string& file, int bufSize){ char* buffer = new char[bufSize]; #ifdef _WIN32 DWORD len = GetModuleFileName(NULL, (LPSTR)(&buffer[0]), (DWORD)bufSize); #else ssize_t len = readlink("/proc/self/exe", &buffer[0], bufSize); #endif std::string str(buffer, len); auto found = str.find_last_of("/\\"); path = str.substr(0, found); file = str.substr(found + 1); delete[] buffer; }
27.707692
109
0.58523
[ "vector" ]
7e1e2fc29d2b75be3fde57e8c7c7ec59116b8f5c
2,376
cpp
C++
src/cgal_kernel/colored_box_with_colored_points.cpp
dyna-mis/geoWordle
f49dd0500e2ad2c14b244b0f8e316b676a967fde
[ "MIT" ]
3
2021-11-03T18:32:27.000Z
2021-11-08T05:10:09.000Z
src/cgal_kernel/colored_box_with_colored_points.cpp
dyna-mis/geoWordle
f49dd0500e2ad2c14b244b0f8e316b676a967fde
[ "MIT" ]
null
null
null
src/cgal_kernel/colored_box_with_colored_points.cpp
dyna-mis/geoWordle
f49dd0500e2ad2c14b244b0f8e316b676a967fde
[ "MIT" ]
null
null
null
#pragma once #include "colored_box_with_colored_points.h" colored_box_with_colored_points::colored_box_with_colored_points(double xMin, double xMax, double yMin, double yMax) :colored_box(xMin, xMax, yMin, yMax, -1) { }; void colored_box_with_colored_points::set(vector<colored_point>& points_t) { size_t size = points_t.size(); assert(size > 0); points.reserve(size); c = points_t[size - 1].c; for (size_t i = 0; i < size; i++) { points.push_back(points_t[i]); if (points_t[i].c != c) { mono = false; c = -1; for (size_t j = i + 1; j < size; j++) { points.push_back(points_t[j]); } break; } } }; void colored_box_with_colored_points::insert_point(colored_point p) { #ifndef NDEBUG geo_is_cover(p); #endif if (points.size() == 0) { mono = true; this->c = p.c; } else { if (mono && (p.c != c)) { mono = false; } } points.push_back(p); }; #if GEOWORDLE_DRAW void colored_box_with_colored_points::draw(bool with_points, cairo_t* cr, double width, double height) { if (with_points) { for (auto& p : points) { p.draw(cr, width, height, ""); } colored_box::draw(cr, width, height, true, 0.4); } else { colored_box::draw(cr, width, height, false, 1); } }; #endif #ifdef GEOWORDLE_PRINT void colored_box_with_colored_points::print() { colored_box::print(); for (auto& e : points) { e.print(); } }; #endif #ifndef NDEBUG void colored_box_with_colored_points::debug() { for (auto& e : points) { e.debug(); assert(geo_is_cover(e)); } if (mono) { for (const auto& e : points) { assert(e.c== (size_t)c); } } }; #endif colored_box colored_box_with_colored_points::tight() { assert(points.size() > 0); double x_min_temp = numeric_limits<double>::max(); double x_max_temp = 0; double y_min_temp = numeric_limits<double>::max(); double y_max_temp = 0; // get all the points covered in this box for (const auto& p: points) { if (p.x() < x_min_temp) x_min_temp = p.x(); if (p.x() > x_max_temp) x_max_temp = p.x(); if (p.y() < y_min_temp) y_min_temp = p.y(); if (p.y() > y_max_temp) y_max_temp = p.y(); } colored_box other = colored_box( x_min_temp - raw_epsilon_x, x_max_temp + raw_epsilon_x, y_min_temp - raw_epsilon_y, y_max_temp + raw_epsilon_y, c); #ifndef NDEBUG other.debug(); #endif return other; };
22.205607
157
0.642677
[ "vector" ]
7e2103046e114f557e77f6142c28f436f346b136
8,843
cpp
C++
source/rastertechnique/scenerastercolortexturetechnique.cpp
AlejandroC1983/cvrtgi
9894fc79d4036a0490dbc194b9d04654574f16d4
[ "Apache-2.0" ]
2
2022-03-25T00:37:25.000Z
2022-03-26T00:13:53.000Z
source/rastertechnique/scenerastercolortexturetechnique.cpp
AlejandroC1983/cvrtgi
9894fc79d4036a0490dbc194b9d04654574f16d4
[ "Apache-2.0" ]
null
null
null
source/rastertechnique/scenerastercolortexturetechnique.cpp
AlejandroC1983/cvrtgi
9894fc79d4036a0490dbc194b9d04654574f16d4
[ "Apache-2.0" ]
1
2022-03-02T21:11:29.000Z
2022-03-02T21:11:29.000Z
/* Copyright 2022 Alejandro Cosin & Gustavo Patow 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. */ // GLOBAL INCLUDES // PROJECT INCLUDES #include "../../include/rastertechnique/scenerastercolortexturetechnique.h" #include "../../include/material/materialmanager.h" #include "../../include/core/coremanager.h" #include "../../include/shader/shader.h" #include "../../include/scene/scene.h" #include "../../include/buffer/buffer.h" #include "../../include/buffer/buffermanager.h" #include "../../include/shader/sampler.h" #include "../../include/pipeline/pipeline.h" #include "../../include/uniformbuffer/uniformbuffer.h" #include "../../include/material/materialcolortexture.h" #include "../../include/util/vulkanstructinitializer.h" #include "../../include/parameter/attributedefines.h" #include "../../include/parameter/attributedata.h" #include "../../include/renderpass/renderpass.h" #include "../../include/renderpass/renderpassmanager.h" #include "../../include/framebuffer/framebuffer.h" #include "../../include/framebuffer/framebuffermanager.h" // NAMESPACE using namespace attributedefines; // DEFINES // STATIC MEMBER INITIALIZATION ///////////////////////////////////////////////////////////////////////////////////////////// SceneRasterColorTextureTechnique::SceneRasterColorTextureTechnique(string &&name, string&& className) : RasterTechnique(move(name), move(className)) , m_elapsedTime(0.0f) , m_addingTime(true) , m_renderTargetColor(nullptr) , m_renderTargetDepth(nullptr) , m_renderPass(nullptr) , m_framebuffer(nullptr) { } ///////////////////////////////////////////////////////////////////////////////////////////// SceneRasterColorTextureTechnique::~SceneRasterColorTextureTechnique() { } ///////////////////////////////////////////////////////////////////////////////////////////// void SceneRasterColorTextureTechnique::init() { inputM->refEventSinglePressSignalSlot().addKeyDownSignal(KeyCode::KEY_CODE_L); SignalVoid* signalAdd = inputM->refEventSinglePressSignalSlot().refKeyDownSignalByKey(KeyCode::KEY_CODE_L); signalAdd->connect<SceneRasterColorTextureTechnique, &SceneRasterColorTextureTechnique::slotLKeyPressed>(this); inputM->refEventSinglePressSignalSlot().addKeyDownSignal(KeyCode::KEY_CODE_R); signalAdd = inputM->refEventSinglePressSignalSlot().refKeyDownSignalByKey(KeyCode::KEY_CODE_R); signalAdd->connect<SceneRasterColorTextureTechnique, &SceneRasterColorTextureTechnique::slotLKeyPressed>(this); inputM->refEventSinglePressSignalSlot().addKeyDownSignal(KeyCode::KEY_CODE_N); signalAdd = inputM->refEventSinglePressSignalSlot().refKeyDownSignalByKey(KeyCode::KEY_CODE_N); signalAdd->connect<SceneRasterColorTextureTechnique, &SceneRasterColorTextureTechnique::slotLKeyPressed>(this); inputM->refEventSinglePressSignalSlot().addKeyDownSignal(KeyCode::KEY_CODE_I); signalAdd = inputM->refEventSinglePressSignalSlot().refKeyDownSignalByKey(KeyCode::KEY_CODE_I); signalAdd->connect<SceneRasterColorTextureTechnique, &SceneRasterColorTextureTechnique::slotLKeyPressed>(this); m_renderTargetColor = textureM->getElement(move(string("scenelightingcolor"))); m_renderTargetDepth = textureM->getElement(move(string("scenelightingdepth"))); m_renderPass = renderPassM->getElement(move(string("scenelightingrenderpass"))); m_framebuffer = framebufferM->getElement(move(string("scenelightingrenderpassFB"))); m_material = static_cast<MaterialColorTexture*>(materialM->getElement(move(string("DefaultMaterial")))); m_material->setColor(vec3(1.0f, 1.0f, 1.0f)); m_vectorMaterialName.push_back("DefaultMaterial"); m_vectorMaterial.push_back(m_material); const vectorMaterialPtr vectorMaterialData = materialM->getElementByClassName(move(string("MaterialColorTexture"))); Material* materialTemp; const uint maxIndex = uint(vectorMaterialData.size()); forI(maxIndex) { materialTemp = vectorMaterialData[i]; addIfNoPresent(materialTemp->getName(), m_vectorMaterialName); addIfNoPresent(materialTemp, m_vectorMaterial); } } ///////////////////////////////////////////////////////////////////////////////////////////// VkCommandBuffer* SceneRasterColorTextureTechnique::record(int currentImage, uint& commandBufferID, CommandBufferType& commandBufferType) { commandBufferType = CommandBufferType::CBT_GRAPHICS_QUEUE; VkCommandBuffer* commandBuffer; commandBuffer = addRecordedCommandBuffer(commandBufferID); addCommandBufferQueueType(commandBufferID, commandBufferType); coreM->allocCommandBuffer(&coreM->getLogicalDevice(), coreM->getGraphicsCommandPool(), commandBuffer); coreM->beginCommandBuffer(*commandBuffer); #ifdef USE_TIMESTAMP vkCmdWriteTimestamp(*commandBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, coreM->getGraphicsQueueQueryPool(), m_queryIndex0); #endif VkRenderPassBeginInfo renderPassBegin = VulkanStructInitializer::renderPassBeginInfo( *m_renderPass->refRenderPass(), m_framebuffer->getFramebuffer(), VkRect2D({ 0, 0, coreM->getWidth(), coreM->getHeight() }), m_material->refVectorClearValue()); vkCmdBeginRenderPass(*commandBuffer, &renderPassBegin, VK_SUBPASS_CONTENTS_INLINE); // Start recording the render pass instance const VkDeviceSize offsets[1] = { 0 }; vkCmdBindVertexBuffers(*commandBuffer, 0, 1, &bufferM->getElement(move(string("vertexBuffer")))->getBuffer(), offsets); // Bound the command buffer with the graphics pipeline vkCmdBindIndexBuffer(*commandBuffer, bufferM->getElement(move(string("indexBuffer")))->getBuffer(), 0, VK_INDEX_TYPE_UINT32); gpuPipelineM->initViewports((float)coreM->getWidth(), (float)coreM->getHeight(), 0.0f, 0.0f, 0.0f, 1.0f, commandBuffer); gpuPipelineM->initScissors(coreM->getWidth(), coreM->getHeight(), 0, 0, commandBuffer); uint dynamicAllignment = materialM->getMaterialUBDynamicAllignment(); vectorNodePtr arrayNode = sceneM->getByMeshType(E_MT_RENDER_MODEL | E_MT_DEBUG_RENDER_MODEL | E_MT_EMITTER_MODEL | E_MT_INSTANCED_RENDER_MODEL); if (arrayNode.size() > 0) { sceneM->sortByMaterial(arrayNode); Material* previous = arrayNode[0]->refMaterial(); Material* current = previous; vkCmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, current->getPipeline()->getPipeline()); // Bound the command buffer with the graphics pipeline bool bindMaterialPipeline = false; uint maxIndex = uint(arrayNode.size()); uint32_t elementIndex; uint32_t offsetData[3]; uint32_t sceneDataBufferOffset = static_cast<uint32_t>(gpuPipelineM->getSceneUniformData()->getDynamicAllignment()); forI(maxIndex) { if (bindMaterialPipeline) { vkCmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, current->getPipeline()->getPipeline()); // Bound the command buffer with the graphics pipeline bindMaterialPipeline = false; } elementIndex = sceneM->getElementIndex(arrayNode[i]); offsetData[0] = elementIndex * sceneDataBufferOffset; offsetData[1] = 0; offsetData[2] = static_cast<uint32_t>(current->getMaterialUniformBufferIndex() * dynamicAllignment); vkCmdBindDescriptorSets(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, current->getPipelineLayout(), 0, 1, &current->refDescriptorSet(), 3, &offsetData[0]); vkCmdDrawIndexed(*commandBuffer, arrayNode[i]->getIndexSize(), 1, arrayNode[i]->getStartIndex(), 0, 0); if ((i + 1) < maxIndex) { previous = current; current = arrayNode[i + 1]->refMaterial(); if (previous != current) { bindMaterialPipeline = true; } } } } vkCmdEndRenderPass(*commandBuffer); #ifdef USE_TIMESTAMP vkCmdWriteTimestamp(*commandBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, coreM->getGraphicsQueueQueryPool(), m_queryIndex1); #endif coreM->endCommandBuffer(*commandBuffer); // NOTE: Clear command buffer if re-recorded m_vectorCommand.push_back(commandBuffer); return commandBuffer; } ///////////////////////////////////////////////////////////////////////////////////////////// void SceneRasterColorTextureTechnique::postCommandSubmit() { m_executeCommand = false; m_needsToRecord = (m_vectorCommand.size() != m_usedCommandBufferNumber); } ///////////////////////////////////////////////////////////////////////////////////////////// void SceneRasterColorTextureTechnique::slotLKeyPressed() { m_active = !m_active; } /////////////////////////////////////////////////////////////////////////////////////////////
40.56422
175
0.724302
[ "render" ]
7e26cdc3a5a0fdddf449854345d6b4fab9bebf54
697
hpp
C++
AoC_2017/day17.hpp
c-goldschmidt/AoC_2017
6455b14bca9dc67ec6ceaf1f3c16ddb4c0b599e0
[ "CC0-1.0" ]
null
null
null
AoC_2017/day17.hpp
c-goldschmidt/AoC_2017
6455b14bca9dc67ec6ceaf1f3c16ddb4c0b599e0
[ "CC0-1.0" ]
null
null
null
AoC_2017/day17.hpp
c-goldschmidt/AoC_2017
6455b14bca9dc67ec6ceaf1f3c16ddb4c0b599e0
[ "CC0-1.0" ]
null
null
null
#pragma once #include "day_factory.hpp" DAY(Day17) void splinlock(vector<int> *result, int steps, int value, int *pos) { *pos = (*pos + steps) % result->size() + 1; result->insert(result->begin() + *pos, value); } void Day17::part1() { vector<int> result = {0}; int steps = stoi(fileContent[0]); int pos = 0; for (int i = 1; i < 2018; i++) { splinlock(&result, steps, i, &pos); } printResult(result[pos + 1]); } void Day17::part2() { // actually simulating this takes way too long int result = 0; int steps = stoi(fileContent[0]); int pos = 0; for (int i = 1; i < 50000000; i++) { pos = (pos + steps) % i + 1; if (pos == 1) { result = i; } } printResult(result); }
19.361111
69
0.595409
[ "vector" ]
7e270645403fc48973ea9450a6fc4c7935673ed0
1,324
cpp
C++
test/translator_test.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
test/translator_test.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
test/translator_test.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
/* * translator_test.cpp * * Created on: 2010/10/03 * Author: shu */ #include <gtest/gtest.h> #include <string> #include <stdint.h> #include "../src/translator.h" #include "../src/alphabet_type.h" #include "../src/protein_type.h" #include "../src/dna_sequence.h" #include "../src/protein_sequence.h" using namespace std; TEST(TranslatorTest, translate) { DnaSequence seq0(string("test0"), string("GCCCGCCACCT")); ProteinType protein; Translator t; vector<ProteinSequence> proteins; t.Translate(seq0, proteins); EXPECT_EQ(string("ARH"),proteins[0].GetSequenceData()); EXPECT_EQ(string("PAT"),proteins[1].GetSequenceData()); EXPECT_EQ(string("PPP"),proteins[2].GetSequenceData()); EXPECT_EQ(string("RWR"),proteins[3].GetSequenceData()); EXPECT_EQ(string("GGG"),proteins[4].GetSequenceData()); EXPECT_EQ(string("VAG"),proteins[5].GetSequenceData()); DnaSequence seq1(string("test1"), string("GCCCGCCACC")); t.Translate(seq1, proteins); EXPECT_EQ(string("ARH"),proteins[0].GetSequenceData()); EXPECT_EQ(string("PAT"),proteins[1].GetSequenceData()); EXPECT_EQ(string("PP"),proteins[2].GetSequenceData()); EXPECT_EQ(string("GGG"),proteins[3].GetSequenceData()); EXPECT_EQ(string("VAG"),proteins[4].GetSequenceData()); EXPECT_EQ(string("WR"),proteins[5].GetSequenceData()); }
30.090909
59
0.70997
[ "vector" ]
7e2a010a96ac43980e665ae741c5edac8dc4e8c6
3,571
cc
C++
ortools/math_opt/samples/basic_example.cc
bhoeferlin/or-tools
dfdcfb58d7228fa0ae6d0182ba9b314c7122519f
[ "Apache-2.0" ]
null
null
null
ortools/math_opt/samples/basic_example.cc
bhoeferlin/or-tools
dfdcfb58d7228fa0ae6d0182ba9b314c7122519f
[ "Apache-2.0" ]
null
null
null
ortools/math_opt/samples/basic_example.cc
bhoeferlin/or-tools
dfdcfb58d7228fa0ae6d0182ba9b314c7122519f
[ "Apache-2.0" ]
null
null
null
// Copyright 2010-2021 Google LLC // 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. // Testing correctness of the code snippets in the comments of math_opt.h. #include <iostream> #include <limits> #include "absl/status/statusor.h" #include "ortools/base/init_google.h" #include "ortools/base/logging.h" #include "ortools/math_opt/cpp/math_opt.h" namespace { // Model the problem: // max 2.0 * x + y // s.t. x + y <= 1.5 // x in {0.0, 1.0} // y in [0.0, 2.5] // void SolveVersion1() { using ::operations_research::math_opt::LinearConstraint; using ::operations_research::math_opt::Model; using ::operations_research::math_opt::SolveResult; using ::operations_research::math_opt::SolverType; using ::operations_research::math_opt::TerminationReason; using ::operations_research::math_opt::Variable; Model model("my_model"); const Variable x = model.AddBinaryVariable("x"); const Variable y = model.AddContinuousVariable(0.0, 2.5, "y"); const LinearConstraint c = model.AddLinearConstraint( -std::numeric_limits<double>::infinity(), 1.5, "c"); model.set_coefficient(c, x, 1.0); model.set_coefficient(c, y, 1.0); model.set_objective_coefficient(x, 2.0); model.set_objective_coefficient(y, 1.0); model.set_maximize(); const SolveResult result = Solve(model, SolverType::kGscip).value(); CHECK_EQ(result.termination.reason, TerminationReason::kOptimal) << result.termination; // The following code will print: // objective value: 2.5 // value for variable x: 1 std::cout << "objective value: " << result.objective_value() << "\nvalue for variable x: " << result.variable_values().at(x) << std::endl; } void SolveVersion2() { using ::operations_research::math_opt::LinearExpression; using ::operations_research::math_opt::Model; using ::operations_research::math_opt::SolveResult; using ::operations_research::math_opt::SolverType; using ::operations_research::math_opt::TerminationReason; using ::operations_research::math_opt::Variable; Model model("my_model"); const Variable x = model.AddBinaryVariable("x"); const Variable y = model.AddContinuousVariable(0.0, 2.5, "y"); // We can directly use linear combinations of variables ... model.AddLinearConstraint(x + y <= 1.5, "c"); // ... or build them incrementally. LinearExpression objective_expression; objective_expression += 2 * x; objective_expression += y; model.Maximize(objective_expression); const SolveResult result = Solve(model, SolverType::kGscip).value(); CHECK_EQ(result.termination.reason, TerminationReason::kOptimal) << result.termination; // The following code will print: // objective value: 2.5 // value for variable x: 1 std::cout << "objective value: " << result.objective_value() << "\nvalue for variable x: " << result.variable_values().at(x) << std::endl; } } // namespace int main(int argc, char** argv) { InitGoogle(argv[0], &argc, &argv, true); SolveVersion1(); SolveVersion2(); return 0; }
36.438776
75
0.703444
[ "model" ]
7e2f97acae73123b0580f507c07ff61cf74ab053
2,365
cpp
C++
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/text/CLengthFilter.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
7
2017-07-13T10:34:54.000Z
2021-04-16T05:40:35.000Z
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/text/CLengthFilter.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/text/CLengthFilter.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
9
2017-07-13T12:33:20.000Z
2021-06-19T02:46:48.000Z
//========================================================================= // Copyright (C) 2012 The Elastos Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //========================================================================= #include "elastos/droid/ext/frameworkext.h" #include "elastos/droid/text/CLengthFilter.h" #include <elastos/core/Character.h> using Elastos::Core::Character; using Elastos::Core::CString; namespace Elastos { namespace Droid { namespace Text { CAR_INTERFACE_IMPL_2(CLengthFilter, Object, ILengthFilter, IInputFilter) CAR_OBJECT_IMPL(CLengthFilter) CLengthFilter::CLengthFilter() : mMax(0) {} ECode CLengthFilter::constructor( /* [in] */ Int32 max) { mMax = max; return NOERROR; } ECode CLengthFilter::Filter( /* [in] */ ICharSequence* source, /* [in] */ Int32 start, /* [in] */ Int32 end, /* [in] */ ISpanned* dest, /* [in] */ Int32 dstart, /* [in] */ Int32 dend, /* [out] */ ICharSequence** cs) { VALIDATE_NOT_NULL(cs); Int32 len; ICharSequence::Probe(dest)->GetLength(&len); Int32 keep = mMax - (len - (dend - dstart)); if (keep <= 0) { return CString::New(String(""), cs); } else if (keep >= end - start) { *cs = NULL; return NOERROR; // keep original } else { keep += start; Char32 sourceChar; if (Character::IsHighSurrogate((source->GetCharAt(keep - 1, &sourceChar), sourceChar))) { --keep; if (keep == start) { return CString::New(String(""), cs); } } return source->SubSequence(start, keep, cs); } } ECode CLengthFilter::GetMax( /* [out] */ Int32* max) { VALIDATE_NOT_NULL(max) *max = mMax; return NOERROR; } }//namespace Text }//namespace Droid }//namespace Elastos
26.875
97
0.594503
[ "object" ]
7e327ea916833eeef2c60574fc415f85fb0516ab
3,270
cc
C++
gnuradio-3.7.13.4/gr-fft/lib/fft_vfc_fftw.cc
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
1
2021-03-09T07:32:37.000Z
2021-03-09T07:32:37.000Z
gnuradio-3.7.13.4/gr-fft/lib/fft_vfc_fftw.cc
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
null
null
null
gnuradio-3.7.13.4/gr-fft/lib/fft_vfc_fftw.cc
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
null
null
null
/* -*- c++ -*- */ /* * Copyright 2004,2007,2008,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "fft_vfc_fftw.h" #include <gnuradio/io_signature.h> #include <math.h> #include <string.h> namespace gr { namespace fft { fft_vfc::sptr fft_vfc::make(int fft_size, bool forward, const std::vector<float> &window, int nthreads) { return gnuradio::get_initial_sptr(new fft_vfc_fftw (fft_size, forward, window, nthreads)); } fft_vfc_fftw::fft_vfc_fftw(int fft_size, bool forward, const std::vector<float> &window, int nthreads) : sync_block("fft_vfc_fftw", io_signature::make(1, 1, fft_size * sizeof(float)), io_signature::make(1, 1, fft_size * sizeof(gr_complex))), d_fft_size(fft_size), d_forward(forward) { d_fft = new fft_complex(d_fft_size, forward, nthreads); if(!set_window(window)) throw std::runtime_error("fft_vfc: window not the same length as fft_size\n"); } fft_vfc_fftw::~fft_vfc_fftw() { delete d_fft; } void fft_vfc_fftw::set_nthreads(int n) { d_fft->set_nthreads(n); } int fft_vfc_fftw::nthreads() const { return d_fft->nthreads(); } bool fft_vfc_fftw::set_window(const std::vector<float> &window) { if(window.size()==0 || window.size()==d_fft_size) { d_window=window; return true; } else return false; } int fft_vfc_fftw::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { const float *in = (const float *)input_items[0]; gr_complex *out = (gr_complex *)output_items[0]; unsigned int output_data_size = output_signature()->sizeof_stream_item (0); int count = 0; while(count++ < noutput_items) { // copy input into optimally aligned buffer if(d_window.size()) { gr_complex *dst = d_fft->get_inbuf(); for(unsigned int i = 0; i < d_fft_size; i++) // apply window dst[i] = in[i] * d_window[i]; } else { gr_complex *dst = d_fft->get_inbuf(); for(unsigned int i = 0; i < d_fft_size; i++) // float to complex conversion dst[i] = in[i]; } // compute the fft d_fft->execute(); // copy result to output stream memcpy(out, d_fft->get_outbuf(), output_data_size); in += d_fft_size; out += d_fft_size; } return noutput_items; } } /* namespace fft */ } /* namespace gr */
25.748031
86
0.652599
[ "vector" ]
cce21a2a96934378cf90ca63cbc77c8c035f9c2b
1,302
cpp
C++
Source/Engine/RenderGraph/RenderGraphScheduler.cpp
KaiH0717/Kaguya
6bdcac77984e3d359ea2fabe926dd44a467dde68
[ "MIT" ]
176
2020-10-31T21:28:27.000Z
2022-01-22T12:15:38.000Z
Source/Engine/RenderGraph/RenderGraphScheduler.cpp
KaiH0717/Kaguya
6bdcac77984e3d359ea2fabe926dd44a467dde68
[ "MIT" ]
null
null
null
Source/Engine/RenderGraph/RenderGraphScheduler.cpp
KaiH0717/Kaguya
6bdcac77984e3d359ea2fabe926dd44a467dde68
[ "MIT" ]
9
2020-12-25T01:12:48.000Z
2022-01-13T16:28:43.000Z
#include "RenderGraphScheduler.h" #include "RenderGraph.h" auto RenderGraphScheduler::CreateTexture(std::string_view Name, const TextureDesc& Desc) -> RenderResourceHandle { if (Desc.Resolution == ETextureResolution::Render || Desc.Resolution == ETextureResolution::Viewport) { assert(Desc.Type == ETextureType::Texture2D); } RGTexture& Texture = Textures.emplace_back(); Texture.Name = Name; Texture.Handle = TextureHandle; Texture.Desc = Desc; ++TextureHandle.Id; CurrentRenderPass->Write(Texture.Handle); return Texture.Handle; } auto RenderGraphScheduler::CreateRenderTarget(const RGRenderTargetDesc& Desc) -> RenderResourceHandle { RenderTargets.emplace_back(Desc); RenderResourceHandle Handle = RenderTargetHandle; ++RenderTargetHandle.Id; return Handle; } auto RenderGraphScheduler::Read(RenderResourceHandle Resource) -> RenderResourceHandle { assert(Resource.Type == ERGResourceType::Buffer || Resource.Type == ERGResourceType::Texture); CurrentRenderPass->Read(Resource); return Resource; } auto RenderGraphScheduler::Write(RenderResourceHandle Resource) -> RenderResourceHandle { assert(Resource.Type == ERGResourceType::Buffer || Resource.Type == ERGResourceType::Texture); CurrentRenderPass->Write(Resource); ++Resource.Version; return Resource; }
28.304348
112
0.778034
[ "render" ]
ccead2b251ade7ac1ed4372ce819f06527ee0f9f
711
cpp
C++
dev/libs/algorithm/src/sort3elements.cpp
jeffujioka/envio_challenge
db5fd5cab777b120be22a255b3fdc053a0fd2550
[ "MIT" ]
null
null
null
dev/libs/algorithm/src/sort3elements.cpp
jeffujioka/envio_challenge
db5fd5cab777b120be22a255b3fdc053a0fd2550
[ "MIT" ]
null
null
null
dev/libs/algorithm/src/sort3elements.cpp
jeffujioka/envio_challenge
db5fd5cab777b120be22a255b3fdc053a0fd2550
[ "MIT" ]
null
null
null
#include "algorithm/sort3elements.h" #include <stdexcept> #include <utility> #include <iostream> namespace envio { namespace algorithm { void Sort3Elements::Sort(std::vector<uint32_t>& vec) { uint32_t low_idx = 0u; uint32_t high_idx = vec.size() - 1u; uint32_t middle_idx = 0u; while(middle_idx <= high_idx) { switch (vec[middle_idx]) { case 0: // swap middle_idx with low_idx then increment both of them by 1 std::swap(vec[low_idx++], vec[middle_idx++]); break; case 1: ++middle_idx; break; case 2: std::swap(vec[middle_idx], vec[high_idx--]); break; default: throw std::domain_error("Invalid value"); } } } } }
18.230769
70
0.623066
[ "vector" ]
ccfd7cbe18cae798da6832326bb94cea764f6310
402
hpp
C++
internal/term_flags/term_flags.hpp
YarikRevich/SyE
3f73350f7e8fd9975e747c9c49667bbee278b594
[ "MIT" ]
null
null
null
internal/term_flags/term_flags.hpp
YarikRevich/SyE
3f73350f7e8fd9975e747c9c49667bbee278b594
[ "MIT" ]
null
null
null
internal/term_flags/term_flags.hpp
YarikRevich/SyE
3f73350f7e8fd9975e747c9c49667bbee278b594
[ "MIT" ]
null
null
null
#pragma once #include <string> #include <vector> namespace TermFlags { extern int n_argc; extern char **n_argv; extern std::vector<std::string> n_single_flags; void add_args(int argc, char **argv); bool check_single_flag(std::string flag); bool last_is_flag(); void check_exclude_syntax_highlighting_flag(); void check_executive_flag(); void check_dev_flag(); };
21.157895
51
0.706468
[ "vector" ]