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
691ef9a7f6b309733ef7c5a0da8923376142dd4e
1,419
hpp
C++
src/Features/Demo/DemoGhostPlayer.hpp
Zyntex1/SourceAutoRecord
7e1419183de2b7c9638ad6dc0cbb5701e4a392c0
[ "MIT" ]
42
2021-04-27T17:03:24.000Z
2022-03-03T18:56:13.000Z
src/Features/Demo/DemoGhostPlayer.hpp
Zyntex1/SourceAutoRecord
7e1419183de2b7c9638ad6dc0cbb5701e4a392c0
[ "MIT" ]
43
2021-04-27T21:20:06.000Z
2022-03-22T12:45:46.000Z
src/Features/Demo/DemoGhostPlayer.hpp
Zyntex1/SourceAutoRecord
7e1419183de2b7c9638ad6dc0cbb5701e4a392c0
[ "MIT" ]
29
2021-06-11T23:52:24.000Z
2022-03-30T14:33:46.000Z
#pragma once #include "Command.hpp" #include "Demo.hpp" #include "DemoGhostEntity.hpp" #include "Features/Hud/Hud.hpp" #include "Features/Speedrun/SpeedrunTimer.hpp" #include "GhostEntity.hpp" #include "Modules/Console.hpp" #include "Modules/Engine.hpp" #include "Variable.hpp" #include <algorithm> class DemoGhostPlayer { private: std::vector<DemoGhostEntity> ghostPool; bool isPlaying; int currentTick; public: bool isFullGame; int nbDemos; public: DemoGhostPlayer(); void SpawnAllGhosts(); void StartAllGhost(); void ResetAllGhosts(); void PauseAllGhosts(); void ResumeAllGhosts(); void DeleteAllGhosts(); void DeleteAllGhostModels(); void DeleteGhostsByID(const unsigned int ID); void UpdateGhostsPosition(); void UpdateGhostsSameMap(); void UpdateGhostsModel(const std::string model); void Sync(); DemoGhostEntity *GetGhostByID(int ID); bool SetupGhostFromDemo(const std::string &demo_path, const unsigned int ghost_ID, bool fullGame); void AddGhost(DemoGhostEntity &ghost); bool IsPlaying(); bool IsFullGame(); void PrintRecap(); void DrawNames(HudContext *ctx); }; extern DemoGhostPlayer demoGhostPlayer; extern Variable ghost_sync; extern Command ghost_set_demo; extern Command ghost_set_demos; extern Command ghost_delete_all; extern Command ghost_delete_by_ID; extern Command ghost_recap; extern Command ghost_start; extern Command ghost_reset; extern Command ghost_offset;
22.887097
99
0.788584
[ "vector", "model" ]
692c6fe45c117fb9d1e54adcb372fcf946b7a4fe
4,516
cpp
C++
lib/src/Core/IGame.cpp
emilhornlund/DV1537Project-AlienAdventure
b370e49d259ee722edd6f39c979824280522076a
[ "MIT" ]
null
null
null
lib/src/Core/IGame.cpp
emilhornlund/DV1537Project-AlienAdventure
b370e49d259ee722edd6f39c979824280522076a
[ "MIT" ]
null
null
null
lib/src/Core/IGame.cpp
emilhornlund/DV1537Project-AlienAdventure
b370e49d259ee722edd6f39c979824280522076a
[ "MIT" ]
null
null
null
// // Created by Emil Hörnlund on 2018-09-07. // #include <Core/Camera.hpp> #include <Core/EventHandler.hpp> #include <Core/Level.hpp> #include <Core/ObjectHandler.hpp> #include <Core/PropertyHandler.hpp> #include <Core/ResourceHandler.hpp> #include <Core/SceneHandler.hpp> #include <Core/WindowHandler.hpp> #include <Core/IGame.hpp> #include <Core/IMenuObject.hpp> #include <Core/IScene.hpp> #include <Core/ConfigParser.hpp> #include <SFML/Audio/Music.hpp> #include <SFML/Audio/SoundBuffer.hpp> #include <SFML/Graphics/Texture.hpp> CGL::IGame::IGame(const std::string &title) { //initialize resource handlers this->m_imageResourceHandler = std::make_shared<ResourceHandler<sf::Image>>(); this->m_musicResourceHandler = std::make_shared<ResourceHandler<sf::Music>>(); this->m_soundBufferResourceHandler = std::make_shared<ResourceHandler<sf::SoundBuffer>>(); this->m_textureResourceHandler = std::make_shared<ResourceHandler<sf::Texture>>(); this->m_levelResourceHandler = std::make_shared<ResourceHandler<Level>>(); //initialize and parse configs this->m_configParser = std::make_shared<ConfigParser>(); if (!this->m_configParser->loadFromFile("defaults.cfg")) { throw std::runtime_error("Error opening config file"); } //initialize other handlers this->m_propertyHandler = std::make_shared<PropertyHandler>(); this->m_windowHandler = std::make_shared<WindowHandler>(this, title); this->m_eventHandler = std::make_shared<EventHandler>(this->m_windowHandler->getRenderWindow()); this->m_sceneHandler = std::make_shared<SceneHandler>(this); //signal the include as not yet running. this->m_running = false; this->m_exitCode = 0; } CGL::IGame::~IGame() = default; int CGL::IGame::run() { this->m_exitCode = EXIT_SUCCESS; this->m_running = true; while (this->m_running && !this->m_eventHandler->getWindowStatus().closed) { if (!this->m_sceneHandler->isEmpty()) { auto& scene = this->m_sceneHandler->getActiveScene(); this->m_eventHandler->updateEvents(); scene.processEvents(); if (this->m_menu != nullptr) { this->m_menu->processEvents(); } sf::Time delta = this->m_gameClock.restart(); auto dt = delta.asSeconds(); if (!scene.isPaused()) { scene.update(dt); this->m_windowHandler->getCamera().update(dt); } if (this->m_menu != nullptr) { this->m_menu->update(dt); } this->m_windowHandler->clear(sf::Color(208, 244, 247)); scene.draw(); if (this->m_menu != nullptr) { this->m_windowHandler->draw(*this->m_menu); } this->m_windowHandler->render(); this->m_sceneHandler->cleanup(); } else { this->quit(0); } } return this->m_exitCode; } bool CGL::IGame::isRunning() const { return this->m_running; } void CGL::IGame::quit(const int exitCode) { this->m_running = false; this->m_exitCode = exitCode; } void CGL::IGame::setMenu(std::shared_ptr<IMenuObject> menu) { this->m_menu = std::move(menu); } bool CGL::IGame::hasActiveMenu() const { return (this->m_menu != nullptr); } void CGL::IGame::closeMenu() { this->m_menu = nullptr; } CGL::PropertyHandler &CGL::IGame::getPropertyHandler() const { return *this->m_propertyHandler; } CGL::ResourceHandler<sf::Image> &CGL::IGame::getImageResourceHandler() const { return *this->m_imageResourceHandler; } CGL::ResourceHandler<sf::Music> &CGL::IGame::getMusicResourceHandler() const { return *this->m_musicResourceHandler; } CGL::ResourceHandler<sf::SoundBuffer>& CGL::IGame::getSoundBufferResourceHandler() const { return *this->m_soundBufferResourceHandler; } CGL::ResourceHandler<sf::Texture> &CGL::IGame::getTextureResourceHandler() const { return *this->m_textureResourceHandler; } CGL::ResourceHandler<CGL::Level> &CGL::IGame::getLevelResourceHandler() const { return *this->m_levelResourceHandler; } CGL::WindowHandler &CGL::IGame::getWindowHandler() const { return *this->m_windowHandler; } CGL::EventHandler &CGL::IGame::getEventHandler() const { return *this->m_eventHandler; } CGL::SceneHandler &CGL::IGame::getSceneHandler() const { return *this->m_sceneHandler; } CGL::ConfigParser &CGL::IGame::getConfigParser() const { return *this->m_configParser; }
30.308725
100
0.665412
[ "render" ]
692f0bad0c733dc3d8739af230b58ddee04d9b0e
10,373
cpp
C++
HeadlessLightService/arm/debug/moc_PhysicalButtons.cpp
RodgerLeblanc/HeadlessLight
e679ab21cc9bc1636172fb68b215035ee2ea94da
[ "MIT", "Unlicense" ]
null
null
null
HeadlessLightService/arm/debug/moc_PhysicalButtons.cpp
RodgerLeblanc/HeadlessLight
e679ab21cc9bc1636172fb68b215035ee2ea94da
[ "MIT", "Unlicense" ]
null
null
null
HeadlessLightService/arm/debug/moc_PhysicalButtons.cpp
RodgerLeblanc/HeadlessLight
e679ab21cc9bc1636172fb68b215035ee2ea94da
[ "MIT", "Unlicense" ]
null
null
null
/**************************************************************************** ** Meta object code from reading C++ file 'PhysicalButtons.h' ** ** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.5) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../src/PhysicalButtons/PhysicalButtons.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'PhysicalButtons.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 63 #error "This file was generated using the moc from 4.8.5. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_PhysicalButtons[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 26, 14, // methods 4, 144, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 20, // signalCount // signals: signature, parameters, type, tag, flags 17, 16, 16, 16, 0x05, 37, 16, 16, 16, 0x05, 67, 16, 16, 16, 0x05, 101, 16, 16, 16, 0x05, 130, 16, 16, 16, 0x05, 160, 16, 16, 16, 0x05, 187, 16, 16, 16, 0x05, 212, 16, 16, 16, 0x05, 233, 16, 16, 16, 0x05, 264, 16, 16, 16, 0x05, 293, 16, 16, 16, 0x05, 318, 16, 16, 16, 0x05, 344, 16, 16, 16, 0x05, 368, 16, 16, 16, 0x05, 388, 16, 16, 16, 0x05, 415, 16, 16, 16, 0x05, 440, 16, 16, 16, 0x05, 461, 16, 16, 16, 0x05, 488, 16, 16, 16, 0x05, 521, 16, 16, 16, 0x05, // slots: signature, parameters, type, tag, flags 551, 16, 16, 16, 0x08, 568, 16, 16, 16, 0x08, 591, 16, 16, 16, 0x08, 618, 16, 16, 16, 0x08, 640, 16, 16, 16, 0x08, 663, 16, 16, 16, 0x08, // properties: name, type, flags 696, 691, 0x01495001, 712, 691, 0x01495001, 732, 691, 0x01495001, 747, 691, 0x01495001, // properties: notify_signal_id 1, 2, 3, 4, 0 // eod }; static const char qt_meta_stringdata_PhysicalButtons[] = { "PhysicalButtons\0\0logMessage(QString)\0" "minusButtonIsUpChanged(bool&)\0" "playpauseButtonIsUpChanged(bool&)\0" "plusButtonIsUpChanged(bool&)\0" "powerButtonIsUpChanged(bool&)\0" "minusButtonDoublePressed()\0" "minusButtonLongPressed()\0minusButtonPressed()\0" "playpauseButtonDoublePressed()\0" "playpauseButtonLongPressed()\0" "playpauseButtonPressed()\0" "plusButtonDoublePressed()\0" "plusButtonLongPressed()\0plusButtonPressed()\0" "powerButtonDoublePressed()\0" "powerButtonLongPressed()\0powerButtonPressed()\0" "screenshotButtonsPressed()\0" "screenshotButtonsDoublePressed()\0" "softResetButtonsLongPressed()\0" "onPpsReadyRead()\0onMinusButtonTimeout()\0" "onPlaypauseButtonTimeout()\0" "onPlusButtonTimeout()\0onPowerButtonTimeout()\0" "onSoftResetButtonsTimeout()\0bool\0" "minusButtonIsUp\0playpauseButtonIsUp\0" "plusButtonIsUp\0powerButtonIsUp\0" }; void PhysicalButtons::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); PhysicalButtons *_t = static_cast<PhysicalButtons *>(_o); switch (_id) { case 0: _t->logMessage((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 1: _t->minusButtonIsUpChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; case 2: _t->playpauseButtonIsUpChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; case 3: _t->plusButtonIsUpChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; case 4: _t->powerButtonIsUpChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; case 5: _t->minusButtonDoublePressed(); break; case 6: _t->minusButtonLongPressed(); break; case 7: _t->minusButtonPressed(); break; case 8: _t->playpauseButtonDoublePressed(); break; case 9: _t->playpauseButtonLongPressed(); break; case 10: _t->playpauseButtonPressed(); break; case 11: _t->plusButtonDoublePressed(); break; case 12: _t->plusButtonLongPressed(); break; case 13: _t->plusButtonPressed(); break; case 14: _t->powerButtonDoublePressed(); break; case 15: _t->powerButtonLongPressed(); break; case 16: _t->powerButtonPressed(); break; case 17: _t->screenshotButtonsPressed(); break; case 18: _t->screenshotButtonsDoublePressed(); break; case 19: _t->softResetButtonsLongPressed(); break; case 20: _t->onPpsReadyRead(); break; case 21: _t->onMinusButtonTimeout(); break; case 22: _t->onPlaypauseButtonTimeout(); break; case 23: _t->onPlusButtonTimeout(); break; case 24: _t->onPowerButtonTimeout(); break; case 25: _t->onSoftResetButtonsTimeout(); break; default: ; } } } const QMetaObjectExtraData PhysicalButtons::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject PhysicalButtons::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_PhysicalButtons, qt_meta_data_PhysicalButtons, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &PhysicalButtons::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *PhysicalButtons::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *PhysicalButtons::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_PhysicalButtons)) return static_cast<void*>(const_cast< PhysicalButtons*>(this)); return QObject::qt_metacast(_clname); } int PhysicalButtons::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 26) qt_static_metacall(this, _c, _id, _a); _id -= 26; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = minusButtonIsUp(); break; case 1: *reinterpret_cast< bool*>(_v) = playpauseButtonIsUp(); break; case 2: *reinterpret_cast< bool*>(_v) = plusButtonIsUp(); break; case 3: *reinterpret_cast< bool*>(_v) = powerButtonIsUp(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; } // SIGNAL 0 void PhysicalButtons::logMessage(const QString & _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); } // SIGNAL 1 void PhysicalButtons::minusButtonIsUpChanged(bool & _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 1, _a); } // SIGNAL 2 void PhysicalButtons::playpauseButtonIsUpChanged(bool & _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 2, _a); } // SIGNAL 3 void PhysicalButtons::plusButtonIsUpChanged(bool & _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 3, _a); } // SIGNAL 4 void PhysicalButtons::powerButtonIsUpChanged(bool & _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 4, _a); } // SIGNAL 5 void PhysicalButtons::minusButtonDoublePressed() { QMetaObject::activate(this, &staticMetaObject, 5, 0); } // SIGNAL 6 void PhysicalButtons::minusButtonLongPressed() { QMetaObject::activate(this, &staticMetaObject, 6, 0); } // SIGNAL 7 void PhysicalButtons::minusButtonPressed() { QMetaObject::activate(this, &staticMetaObject, 7, 0); } // SIGNAL 8 void PhysicalButtons::playpauseButtonDoublePressed() { QMetaObject::activate(this, &staticMetaObject, 8, 0); } // SIGNAL 9 void PhysicalButtons::playpauseButtonLongPressed() { QMetaObject::activate(this, &staticMetaObject, 9, 0); } // SIGNAL 10 void PhysicalButtons::playpauseButtonPressed() { QMetaObject::activate(this, &staticMetaObject, 10, 0); } // SIGNAL 11 void PhysicalButtons::plusButtonDoublePressed() { QMetaObject::activate(this, &staticMetaObject, 11, 0); } // SIGNAL 12 void PhysicalButtons::plusButtonLongPressed() { QMetaObject::activate(this, &staticMetaObject, 12, 0); } // SIGNAL 13 void PhysicalButtons::plusButtonPressed() { QMetaObject::activate(this, &staticMetaObject, 13, 0); } // SIGNAL 14 void PhysicalButtons::powerButtonDoublePressed() { QMetaObject::activate(this, &staticMetaObject, 14, 0); } // SIGNAL 15 void PhysicalButtons::powerButtonLongPressed() { QMetaObject::activate(this, &staticMetaObject, 15, 0); } // SIGNAL 16 void PhysicalButtons::powerButtonPressed() { QMetaObject::activate(this, &staticMetaObject, 16, 0); } // SIGNAL 17 void PhysicalButtons::screenshotButtonsPressed() { QMetaObject::activate(this, &staticMetaObject, 17, 0); } // SIGNAL 18 void PhysicalButtons::screenshotButtonsDoublePressed() { QMetaObject::activate(this, &staticMetaObject, 18, 0); } // SIGNAL 19 void PhysicalButtons::softResetButtonsLongPressed() { QMetaObject::activate(this, &staticMetaObject, 19, 0); } QT_END_MOC_NAMESPACE
31.433333
95
0.639931
[ "object" ]
693b54add04cbbf865f8e4f533e8ea7b5e3787bf
6,865
cc
C++
cc/dual_net.cc
abunickabhi/minigo
0e7c753636613581625fa540353ae4ee647ed7a3
[ "Apache-2.0" ]
null
null
null
cc/dual_net.cc
abunickabhi/minigo
0e7c753636613581625fa540353ae4ee647ed7a3
[ "Apache-2.0" ]
null
null
null
cc/dual_net.cc
abunickabhi/minigo
0e7c753636613581625fa540353ae4ee647ed7a3
[ "Apache-2.0" ]
null
null
null
// Copyright 2018 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. #include "cc/dual_net.h" #include "cc/check.h" #include "cc/constants.h" #include "cc/symmetries.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/lib/core/status.h" using tensorflow::DT_FLOAT; using tensorflow::Env; using tensorflow::GraphDef; using tensorflow::NewSession; using tensorflow::ReadBinaryProto; using tensorflow::Session; using tensorflow::SessionOptions; using tensorflow::Status; using tensorflow::string; using tensorflow::Tensor; using tensorflow::TensorShape; using tensorflow::error::CANCELLED; namespace minigo { constexpr int DualNet::kNumStoneFeatures; constexpr int DualNet::kNumBoardFeatures; void DualNet::InitializeFeatures(const Position& position, BoardFeatures* features) { const auto my_color = position.to_play(); const auto their_color = OtherColor(my_color); const float to_play = my_color == Color::kBlack ? 1 : 0; for (int i = 0; i < kN * kN; ++i) { int j = i * kNumStoneFeatures; auto stone_color = position.stones()[i].color(); auto my_stone = stone_color == my_color ? 1 : 0; auto their_stone = stone_color == their_color ? 1 : 0; for (int plane = 0; plane < kPlayerFeature; plane += 2) { (*features)[j++] = my_stone; (*features)[j++] = their_stone; } (*features)[j++] = to_play; } } // The update loop here is a little tricky. // // The chart below shows, for each move, how the stones from the last 8 moves // should be distributed through the input planes. // // planes // move | to play | 0 1 2 3 4 5 ... 16 // ------+---------+----------------------------------------- // 1 | B | B_1 W_1 - - - - ... 1 // 2 | W | W_2 B_2 W_1 B_1 - - ... 0 // 3 | B | B_3 W_3 B_2 W_2 B_1 W_1 ... 1 // 4 | W | W_4 B_4 W_3 B_3 W_2 B_2 ... 0 // ... | ... | ... ... ... ... ... ... ... ... // // For example: on move 3, planes 0 & 1 hold the black & white stones that are // on the board before move 3 is played, planes 2 & 3 hold the stones that were // on the board before move 2 was played, planes 4 & 5 hold the stones that // were on the board before move 1 was played, etc. // // So... to update the features, we need to do four things: // 1) Shuffle the planes for moves t .. t-6 over to the planes for moves // t-1 .. t-7. // 2) Swap the black and white planes for moves t-1 .. t-7. // 3) Write the new black and white stones into planes 0 & 1 (or planes 1 & 0 // depending on who is to play first). // 4) Write the "to play" feature into plane 16. // // Steps 3 and 4 are trivial. // // Steps 1 and 2 can be accomplished in one by the following: // 1) Copy even planes from plane N to plane N + 3. // 2) Copy odd planes from plane N to plane N + 1. // // The code below does this slightly differently, updated the planes in the // reverse order because that allows old_features and new_features to point to // the same array, but the end result is the same. void DualNet::UpdateFeatures(const BoardFeatures& old_features, const Position& position, BoardFeatures* new_features) { const auto my_color = position.to_play(); const auto their_color = OtherColor(my_color); const float to_play = my_color == Color::kBlack ? 1 : 0; for (int i = 0; i < kN * kN; ++i) { auto stone_color = position.stones()[i].color(); const auto* src = old_features.data() + i * kNumStoneFeatures; auto* dst = new_features->data() + i * kNumStoneFeatures; dst[kPlayerFeature] = to_play; for (int j = kPlayerFeature - 2; j > 0; j -= 2) { dst[j + 1] = src[j - 2]; dst[j] = src[j - 1]; } dst[1] = stone_color == their_color ? 1 : 0; dst[0] = stone_color == my_color ? 1 : 0; } } DualNet::DualNet() = default; DualNet::~DualNet() { if (session_ != nullptr) { session_->Close(); } } void DualNet::Initialize(const std::string& graph_path) { GraphDef graph_def; TF_CHECK_OK(ReadBinaryProto(Env::Default(), graph_path, &graph_def)); session_.reset(NewSession(SessionOptions())); TF_CHECK_OK(session_->Create(graph_def)); inputs_.clear(); inputs_.emplace_back( "pos_tensor", Tensor(DT_FLOAT, TensorShape({1, kN, kN, kNumStoneFeatures}))); output_names_.clear(); output_names_.push_back("policy_output"); output_names_.push_back("value_output"); } void DualNet::RunMany(absl::Span<const BoardFeatures* const> features, absl::Span<Output> outputs, Random* rnd) { MG_DCHECK(features.size() == outputs.size()); int batch_size = static_cast<int>(features.size()); auto& feature_tensor = inputs_[0].second; if (feature_tensor.dim_size(0) != batch_size) { feature_tensor = Tensor(DT_FLOAT, TensorShape({batch_size, kN, kN, kNumStoneFeatures})); } // Select symmetry operations to apply. symmetries_used_.clear(); if (rnd != nullptr) { symmetries_used_.reserve(batch_size); for (int i = 0; i < batch_size; ++i) { symmetries_used_.push_back(static_cast<symmetry::Symmetry>( rnd->UniformInt(0, symmetry::kNumSymmetries - 1))); } } else { symmetries_used_.resize(batch_size, symmetry::kIdentity); } // Copy the features into the input tensor. for (int i = 0; i < batch_size; ++i) { symmetry::ApplySymmetry<float, kN, kNumStoneFeatures>( symmetries_used_[i], features[i]->data(), feature_tensor.flat<float>().data() + i * kNumBoardFeatures); } // Run the model. TF_CHECK_OK(session_->Run(inputs_, output_names_, {}, &outputs_)); // Copy the policy and value out of the output tensors. const auto& policy_tensor = outputs_[0].flat<float>(); const auto& value_tensor = outputs_[1].flat<float>(); for (int i = 0; i < batch_size; ++i) { const auto* policy_tensor_data = policy_tensor.data() + i * kNumMoves; symmetry::ApplySymmetry<float, kN, 1>( symmetry::Inverse(symmetries_used_[i]), policy_tensor_data, outputs[i].policy.data()); outputs[i].policy[Coord::kPass] = policy_tensor_data[Coord::kPass]; outputs[i].value = value_tensor.data()[i]; } } } // namespace minigo
35.942408
79
0.642243
[ "model" ]
693e8ce8133ed5e2ffd43f8e1306192e1d84cd3e
1,937
cpp
C++
Demo_Arduino_Motion/src/main.cpp
Haoyu-R/How-to-Manage-TinyML-at-Scale
da05a79f3abdaf476b73a4b7c689468c951bb364
[ "MIT" ]
1
2022-02-22T01:32:50.000Z
2022-02-22T01:32:50.000Z
Demo_Arduino_Motion/src/main.cpp
Haoyu-R/How-to-Manage-TinyML-at-Scale
da05a79f3abdaf476b73a4b7c689468c951bb364
[ "MIT" ]
null
null
null
Demo_Arduino_Motion/src/main.cpp
Haoyu-R/How-to-Manage-TinyML-at-Scale
da05a79f3abdaf476b73a4b7c689468c951bb364
[ "MIT" ]
null
null
null
// Please use the tensorflow, which has the same version number as the tflite micro library (2.4.0) used in the project, to train and generate NN #include <Arduino.h> #include <Arduino_LSM9DS1.h> #include "TFLITE_Wrapper.h" #include <ArduinoBLE.h> #include "BLE_transfer.h" #include "myUtils.h" // #include "setting.h" TFLITE_Wrapper::TinyML::TFLite< NUMBER_OF_INPUTS, NUMBER_OF_OUTPUTS, TENSOR_ARENA_SIZE> nn; // uint8_t *model; char event[60]; void setup() { pinMode(LED_BUILTIN, OUTPUT); // put your setup code here, to run once: Serial.begin(9600); // Wait for serial monitor to connect while (!Serial); // Initialize IMU sensors if (!IMU.begin()) { Serial.println("Failed to initialize IMU!"); while (1); } // Print out the samples rates of the IMUs Serial.print("Accelerometer sample rate: "); Serial.print(IMU.accelerationSampleRate()); Serial.println(" Hz"); Serial.print("Gyroscope sample rate: "); Serial.print(IMU.gyroscopeSampleRate()); Serial.println(" Hz"); Serial.println(); setupBLEFileTransfer(); } void loop() { // BLE transmission in the loop updateBLEFileTransfer(); } void onBLEFileReceived(uint8_t* file_data, int file_length) { // Examine the model Serial.println("Model Received"); Serial.print("Model size is: "); Serial.println(file_length); Serial.println(); print_memory_info(event, 60); Serial.println(); // Load the model if (!nn.begin(file_data)) { Serial.println("Cannot inialize model"); Serial.println(nn.errorMessage()); delay(60000); } else { Serial.println("Model loaded, starting inference"); } float input[NUMBER_OF_INPUTS] = {0}; float output[NUMBER_OF_OUTPUTS] = {0}; // Run inference while(true){ if(preprocessing(input)){ nn.predict(input, output); postprocessing(output); } } }
24.518987
146
0.659783
[ "model" ]
6943f23190d77e9071477c951bf4489c8a41ff35
12,292
cpp
C++
ID@XboxSDK/TCUI/UWP/Cpp/Scenarios.cpp
jnwoko/xbox-live-samples
06a78315b72e71fef7fd347016e7c37a48c83c16
[ "MIT" ]
65
2019-05-15T00:10:08.000Z
2022-03-17T03:18:52.000Z
Samples/ID@XboxSDK/TCUI/UWP/Cpp/Scenarios.cpp
tunip3/xbox-live-samples
ee99edca8318ef4729172e66aef68c4aa6d4ecf4
[ "MIT" ]
37
2017-03-08T21:38:49.000Z
2019-04-16T00:17:45.000Z
Samples/ID@XboxSDK/TCUI/UWP/Cpp/Scenarios.cpp
tunip3/xbox-live-samples
ee99edca8318ef4729172e66aef68c4aa6d4ecf4
[ "MIT" ]
52
2017-03-03T00:47:48.000Z
2019-04-27T07:08:10.000Z
// Copyright (c) Microsoft Corporation // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include "pch.h" #include "Scenarios.h" #include "MainPage.xaml.h" #include <ppltasks.h> #include <mutex> using namespace TCUI; using namespace concurrency; using namespace Platform; using namespace Platform::Collections; using namespace Windows::Foundation; using namespace Windows::Foundation::Collections; using namespace Windows::Security::Cryptography; using namespace Windows::Security::Authentication::OnlineId; using namespace xbox::services; using namespace xbox::services::social; using namespace xbox::services::system; using namespace xbox::services::presence; std::mutex g_blockOfTextLock; #define THROW_CPP_RUNTIME_IF(x,y) if ( x ) { throw std::runtime_error(y); } string_t create_guid(_In_ bool removeBraces); void Scenarios::Scenario_GetUserProfileAsync(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling get_user_profile..."); xboxLiveContext->settings()->set_http_retry_delay(std::chrono::seconds(10)); xboxLiveContext->settings()->set_enable_service_call_routed_events(true); xboxLiveContext->profile_service().get_user_profile(xboxLiveContext->user()->xbox_user_id()) .then([ui](task<xbox::services::xbox_live_result<xbox::services::social::xbox_user_profile>> t) // use task_continuation_context::use_current() to make the continuation task running in current apartment { xbox::services::xbox_live_result<xbox::services::social::xbox_user_profile> result = t.get(); if (!result.err()) { const auto& profile = result.payload(); std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(L"get_user_profile result:"); ui->Log(StringFormat(L"app_display_name: %s", profile.app_display_name().c_str())); //ui->Log(StringFormat(L"app_display_picture_resize_uri: %s", profile.app_display_picture_resize_uri().to_string().c_str())); ui->Log(StringFormat(L"game_display_name: %s", profile.game_display_name().c_str())); //ui->Log(StringFormat(L"game_display_picture_resize_uri: %s", profile.game_display_picture_resize_uri().to_string().c_str())); ui->Log(StringFormat(L"gamerscore: %s", profile.gamerscore().c_str())); ui->Log(StringFormat(L"gamertag: %s", profile.gamertag().c_str())); ui->Log(StringFormat(L"xbox_user_id: %s", profile.xbox_user_id().c_str())); } else { ui->Log(StringFormat(L"get_user_profile failed: %S %s", result.err().message().c_str(), result.err_message().c_str())); } }, task_continuation_context::use_current()); } void Scenarios::Scenario_PeoplePickerAsyncTask(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling PeoplePickerAsyncTask..."); std::vector<string_t> xboxUserIds = { L"2814659809402826", L"2814613569642996", L"2814632956486799" }; std::vector<string_t> preselectedXboxUserIds = { L"2814613569642996" }; xbox::services::system::title_callable_ui::show_player_picker_ui( L"Pick people", xboxUserIds, preselectedXboxUserIds, 1, 20 ) .then([ui](xbox_live_result<std::vector<string_t>> xblResult) { if(!xblResult.err()) { auto selectedUsers = xblResult.payload(); std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_player_picker_ui results: [%d people picked]", selectedUsers.size())); for(auto& selectedUser : selectedUsers) { ui->Log(ref new Platform::String(selectedUser.c_str())); } } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_player_picker_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); } void Scenarios::CreateAndJoinMultiplayerSession( _In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext ) { string_t sessionId = create_guid(true); string_t sessionTemplateName = L"GameSession10PublicNoActive"; xbox::services::multiplayer::multiplayer_session_reference sessionRef = xbox::services::multiplayer::multiplayer_session_reference( xboxLiveContext->application_config()->scid(), sessionTemplateName, sessionId ); std::shared_ptr<xbox::services::multiplayer::multiplayer_session> session = std::make_shared<xbox::services::multiplayer::multiplayer_session>( xboxLiveContext->user()->xbox_user_id(), sessionRef ); session->join(); session->set_current_user_status(xbox::services::multiplayer::multiplayer_session_member_status::active); xboxLiveContext->multiplayer_service().write_session(session, xbox::services::multiplayer::multiplayer_session_write_mode::update_or_create_new) .then([ui](xbox_live_result<std::shared_ptr<xbox::services::multiplayer::multiplayer_session>> xblResult) { if (!xblResult.err()) { { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log("Multiplayer session created"); } std::shared_ptr<xbox::services::multiplayer::multiplayer_session> newSession; newSession = xblResult.payload(); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"session creation failed: %S %S", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }).wait(); m_session = session; xboxLiveContext->multiplayer_service().set_activity(m_session->session_reference()).wait(); } void Scenarios::Scenario_SendInviteAsyncTask(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling show_game_invite_ui..."); if (m_session == nullptr || m_session->session_reference().is_null()) { ui->Log(L"Error session not created."); return; } xbox::services::system::title_callable_ui::show_game_invite_ui( m_session->session_reference(), L"Please join me" ) .then([ui](xbox_live_result<void> xblResult) { if(!xblResult.err()) { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(L"show_game_invite_ui succeeded"); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_game_invite_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); } void Scenarios::Scenario_ShowProfileCardUI(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling show_profile_card_ui..."); xbox::services::system::title_callable_ui::show_profile_card_ui( L"2814613569642996" ) .then([ui](xbox_live_result<void> xblResult) { if (!xblResult.err()) { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(L"show_profile_card_ui succeeded"); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_profile_card_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); } void Scenarios::Scenario_ShowChangeFriendRelationshipUI(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling show_change_friend_relationship_ui..."); xbox::services::system::title_callable_ui::show_change_friend_relationship_ui( L"2814613569642996" ) .then([ui](xbox_live_result<void> xblResult) { if (!xblResult.err()) { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(L"show_change_friend_relationship_ui succeeded"); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_change_friend_relationship_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); } void Scenarios::Scenario_ShowTitleAchievementsUI(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling show_title_achievements_ui..."); xbox::services::system::title_callable_ui::show_title_achievements_ui( xboxLiveContext->application_config()->title_id() ) .then([ui](xbox_live_result<void> xblResult) { if (!xblResult.err()) { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(L"show_title_achievements_ui succeeded"); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"show_title_achievements_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); } string_t create_guid(_In_ bool removeBraces) { #ifdef _WIN32 GUID guid = { 0 }; THROW_CPP_RUNTIME_IF(FAILED(CoCreateGuid(&guid)), ""); WCHAR wszGuid[50]; THROW_CPP_RUNTIME_IF(FAILED(::StringFromGUID2( guid, wszGuid, ARRAYSIZE(wszGuid) )), ""); string_t strGuid = wszGuid; #else uuid_t uuid; uuid_generate_random(uuid); char s[37] = { 0 }; uuid_unparse(uuid, s); string_t strGuid = s; #endif if (removeBraces) { if (strGuid.length() > 3 && strGuid[0] == L'{') { // Remove the { } strGuid.erase(0, 1); strGuid.erase(strGuid.end() - 1, strGuid.end()); } } return strGuid; } void Scenarios::Scenario_CheckGamingPrivilegeWithUI(_In_ MainPage^ ui, _In_ std::shared_ptr<xbox_live_context> xboxLiveContext) { ui->Log(L"Calling check_gaming_privilege_with_ui with gaming_privilege::multiplayer_sessions"); ui->Log(L"If you want to see the dialog, change your privacy settings"); ui->Log(L"and block multiplayer sessions for this account using the Xbox app or console"); string_t friendlyMessage; // Fill this out if you want to provde a custom message, otherwise leave blank. xbox::services::system::title_callable_ui::check_gaming_privilege_with_ui( gaming_privilege::multiplayer_sessions, friendlyMessage ) .then([ui](xbox_live_result<bool> xblResult) { if (!xblResult.err()) { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"check_gaming_privilege_with_ui succeeded. Result: %d", xblResult.payload())); } else { std::lock_guard<std::mutex> lockGuard(g_blockOfTextLock); ui->Log(L""); ui->Log(L"----------------"); ui->Log(StringFormat(L"check_gaming_privilege_with_ui failed: %S %s", xblResult.err().message().c_str(), xblResult.err_message().c_str())); } }); }
37.705521
207
0.623251
[ "vector" ]
695365ca465956c2cb38af38d1a0ca08a742c75d
5,734
cpp
C++
testing/CatchTests/SimpsonRuleTests.cpp
CD3/libIntegrate
44067c9c579b79efa20fc4320ffaafa11224ec9f
[ "MIT" ]
11
2019-05-20T00:46:32.000Z
2022-02-10T14:29:46.000Z
testing/CatchTests/SimpsonRuleTests.cpp
CD3/libIntegrate
44067c9c579b79efa20fc4320ffaafa11224ec9f
[ "MIT" ]
2
2018-09-27T02:00:12.000Z
2022-02-16T04:28:02.000Z
testing/CatchTests/SimpsonRuleTests.cpp
CD3/libIntegrate
44067c9c579b79efa20fc4320ffaafa11224ec9f
[ "MIT" ]
2
2021-04-30T02:28:48.000Z
2021-11-03T02:43:05.000Z
#define CATCH_CONFIG_ENABLE_BENCHMARKING #include "catch.hpp" #include<iostream> #include<numeric> #include <libIntegrate/_1D/SimpsonRule.hpp> namespace SimpsonRuleTests { double linear_func(double x) { return 2 * x + 3; } double box_func(double x) { if (x < 1) return 0; if (x <= 5) return 1; return 0; } TEST_CASE("Testing Simpson rule on linear functions.") { _1D::SimpsonRule<double> integrate; double I; I = integrate(linear_func, 2., 5., 1); CHECK(I == Approx(5 * 5 + 5 * 3 - 2 * 2 - 2 * 3)); I = integrate(linear_func, 2., 5., 2); CHECK(I == Approx(5 * 5 + 5 * 3 - 2 * 2 - 2 * 3)); I = integrate([](double x) { return 2 * x + 3; }, 2., 5., 2); CHECK(I == Approx(5 * 5 + 5 * 3 - 2 * 2 - 2 * 3)); I = integrate([](double x) { return linear_func(x); }, 2., 5., 2); CHECK(I == Approx(5 * 5 + 5 * 3 - 2 * 2 - 2 * 3)); } TEST_CASE("Testing Simpson rule on quadratic functions.") { _1D::SimpsonRule<double> integrate; double I; I = integrate([](double x) { return x * x + 2 * x + 3; }, 1., 10., 1); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); I = integrate([](double x) { return x * x + 2 * x + 3; }, 1., 10., 2); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); } TEST_CASE("Simpson rule on discretized functions.") { _1D::SimpsonRule<double> integrate; double I; SECTION("Simple 3 point data set") { std::vector<double> x(3), f(3); x[0] = 1; x[1] = 3; x[2] = 10; for (std::size_t i = 0; i < x.size(); ++i) f[i] = x[i] * x[i] + 2 * x[i] + 3; I = integrate(x, f); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); } SECTION("4 point data set") { // Simpson's rule will use three points at a time. If the data sent in is // not odd, the last piece needs to be handed correctly std::vector<double> x(4), f(4); x[0] = 1; x[1] = 3; x[2] = 8; x[3] = 10; for (std::size_t i = 0; i < x.size(); ++i) f[i] = x[i] * x[i] + 2 * x[i] + 3; I = integrate(x, f); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); } SECTION("5 point data set") { std::vector<double> x(5), f(5); x[0] = 1; x[1] = 3; x[2] = 8; x[3] = 9; x[4] = 10; for (std::size_t i = 0; i < x.size(); ++i) f[i] = x[i] * x[i] + 2 * x[i] + 3; I = integrate(x, f); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); } SECTION("Single-vector dataset") { SECTION("5 point data set") { std::vector<double> f(5); for (std::size_t i = 0; i < f.size(); ++i) f[i] = i*i + 2*i + 3; double I; I = integrate(f); CHECK(I == Approx(4.*4.*4./3. + 2.*4.*4./2. + 3.*4. )); } SECTION("6 point data set") { std::vector<double> f(6); for (std::size_t i = 0; i < f.size(); ++i) f[i] = i*i + 2*i + 3; double I; I = integrate(f); CHECK(I == Approx(5.*5.*5./3. + 2.*5.*5./2. + 3.*5. )); I = integrate(f,0.1); CHECK(I == Approx(0.1*(5.*5.*5./3. + 2.*5.*5./2. + 3.*5. ))); I = integrate(f,-0.1); CHECK(I == Approx(-0.1*(5.*5.*5./3. + 2.*5.*5./2. + 3.*5. ))); } } SECTION("Lambda function transform") { std::vector<double> x(3); x[0] = 1; x[1] = 3; x[2] = 10; auto f = [&x](int i){ return x[i] * x[i] + 2 * x[i] + 3; }; I = integrate(x, f); CHECK(I == Approx(10 * 10 * 10 / 3. + 10 * 10 + 3 * 10 - 1 * 1 * 1 / 3. - 1 * 1 - 3 * 1)); } } TEST_CASE("Simpson rule benchmarks.","[.][benchmarks]") { _1D::SimpsonRule<double> integrate; SECTION("Even vs. Odd Datasets") { std::vector<double> f1(5),f2(6),f3(201),f4(202); std::iota(f1.begin(), f1.end(), 0); std::iota(f2.begin(), f2.end(), 0); std::iota(f3.begin(), f3.end(), 0); std::iota(f4.begin(), f4.end(), 0); BENCHMARK("5 Point") { return integrate(f1); }; BENCHMARK("6 Point") { return integrate(f2); }; BENCHMARK("201 Point") { return integrate(f3); }; BENCHMARK("202 Point") { return integrate(f4); }; } SECTION("Uniform vs. Non-Uniform Methods") { std::vector<double> x1(5),x2(6),x3(201),x4(202); std::vector<double> f1(5),f2(6),f3(201),f4(202); std::iota(x1.begin(), x1.end(), 0); std::iota(x2.begin(), x2.end(), 0); std::iota(x3.begin(), x3.end(), 0); std::iota(x4.begin(), x4.end(), 0); for(std::size_t i = 0; i < x1.size(); i++) f1[i] = 0.1*x1[i]; for(std::size_t i = 0; i < x2.size(); i++) f2[i] = 0.1*x2[i]; for(std::size_t i = 0; i < x3.size(); i++) f3[i] = 0.1*x3[i]; for(std::size_t i = 0; i < x4.size(); i++) f4[i] = 0.1*x4[i]; BENCHMARK("5 Point Non-Uniform") { return integrate(x1,f1); }; BENCHMARK("5 Point Uniform") { return integrate(f1); }; BENCHMARK("6 Point Non-Uniform") { return integrate(x2,f2); }; BENCHMARK("6 Point Uniform") { return integrate(f2); }; BENCHMARK("201 Point Non-Uniform") { return integrate(x3,f3); }; BENCHMARK("201 Point Uniform") { return integrate(f3); }; BENCHMARK("202 Point Non-Uniform") { return integrate(x4,f4); }; BENCHMARK("202 Point Uniform") { return integrate(x4,f4); }; } } } // namespace SimpsonRuleTests
23.891667
77
0.474015
[ "vector", "transform" ]
69571b73bac31ac990b25b0ec649a31b8d7243ed
11,680
cpp
C++
FlavoEngine/src/Systems/GraphicSystem.cpp
Thirrash/FlavoEngine
fc3e867dc726d1a37ddd81bb6a1691833014703a
[ "MIT" ]
null
null
null
FlavoEngine/src/Systems/GraphicSystem.cpp
Thirrash/FlavoEngine
fc3e867dc726d1a37ddd81bb6a1691833014703a
[ "MIT" ]
null
null
null
FlavoEngine/src/Systems/GraphicSystem.cpp
Thirrash/FlavoEngine
fc3e867dc726d1a37ddd81bb6a1691833014703a
[ "MIT" ]
null
null
null
#define GLM_ENABLE_EXPERIMENTAL #include "Systems/GraphicSystem.h" #include <glad/glad.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/euler_angles.hpp> #include "Transform.h" #include "Framework/FUtils.h" #include "MeshRenderer.h" #include "EnviroMeshRenderer.h" #include "Debug.h" #include "Color.h" #include "Framework/FDraw.h" #include "SceneManager.h" #include "Scene.h" #include "SceneObjectHandle.h" #include "SceneObject.h" #include "DirectionalLight.h" #include "PointLight.h" #include "SpotLight.h" #include "Maths.h" Engine::GraphicSystem::GraphicSystem() { glEnable(GL_DEPTH_TEST); raymarchShader_ = Framework::FUtils::CompileShader("../../Resources/Shaders/Raymarching.vert", "../../Resources/Shaders/Raymarching.frag"); } Engine::GraphicSystem::~GraphicSystem() { } void Engine::GraphicSystem::configure(EventManager& event_manager) { event_manager.subscribe<MouseInput>(*this); } void Engine::GraphicSystem::receive(const MouseInput& Input) { mousePos_ = glm::vec2(Input.X, Input.Y); } void Engine::GraphicSystem::Update(EntityManager& es, EventManager& events, TimeDelta dt) { if (glfwGetKey(glfwGetCurrentContext(), GLFW_KEY_X) == GLFW_PRESS && !xPressed_) { lensToggle_ = (lensToggle_ == 0.0f) ? 1.0f : 0.0f; int toggleLoc = glGetUniformLocation(postprocess_.shaderProgram, "lensToggle"); glUniform1f(toggleLoc, lensToggle_); xPressed_ = true; } else if (glfwGetKey(glfwGetCurrentContext(), GLFW_KEY_X) == GLFW_RELEASE) { xPressed_ = false; } //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glBindFramebuffer(GL_FRAMEBUFFER, postprocess_.framebuffer); glClearColor(0.1f, 0.1f, 0.1f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ComponentHandle<DirectionalLight> dirHandle; for (Entity entity : es.entities_with_components(dirHandle)) { break; } ComponentHandle<SpotLight> spotHandle; for (Entity entity : es.entities_with_components(spotHandle)) { break; } std::vector<PointLight*> pointLights; ComponentHandle<PointLight> pointHandle; for (Entity entity : es.entities_with_components(pointHandle)) { pointLights.push_back(pointHandle.Get()); } ComponentHandle<Transform> transformHandle; ComponentHandle<MeshRenderer> rendererHandle; for (Entity entity : es.entities_with_components(transformHandle, rendererHandle)) { if (!transformHandle.IsValid() || !rendererHandle.IsValid()) { LogW("Handle not valid for: ", entity.id().id()); continue; } MeshRenderer* renderer = rendererHandle.Get(); Transform* transform = transformHandle.Get(); glUseProgram(renderer->CurrentMat.ShaderProgram); SetTransform(transform, renderer->CurrentMat.ShaderProgram); SetDirectionalLight(renderer->CurrentMat.ShaderProgram, dirHandle.Get()); SetSpotLight(renderer->CurrentMat.ShaderProgram, spotHandle.Get()); for (int i = 0; i < pointLights.size() && i < 4; i++) { SetPointLight(renderer->CurrentMat.ShaderProgram, pointLights[i], i); } RenderMesh(renderer->VAOIndex, renderer->CurrentMat.ShaderProgram, renderer->CurrentMat.TextureIndex, renderer->CurrentMesh.NoIndices); } ComponentHandle<EnviroMeshRenderer> enviroRendererHandle; for (Entity entity : es.entities_with_components(transformHandle, enviroRendererHandle)) { if (!transformHandle.IsValid() || !enviroRendererHandle.IsValid()) { LogW("Handle not valid for: ", entity.id().id()); continue; } EnviroMeshRenderer* renderer = enviroRendererHandle.Get(); Transform* transform = transformHandle.Get(); glUseProgram(renderer->CurrentMat.ShaderProgram); SetTransform(transform, renderer->CurrentMat.ShaderProgram); RenderMesh(renderer->VAOIndex, renderer->CurrentMat.ShaderProgram, skybox_.textureId_, renderer->CurrentMesh.NoIndices); } DrawSkybox(); postprocess_.OnZkey(); int width, height; glfwGetWindowSize(glfwGetCurrentContext(), &width, &height); glUseProgram(raymarchShader_); int screenSizeLoc = glGetUniformLocation(raymarchShader_, "ScreenSize"); glUniform2f(screenSizeLoc, width, height); int eyePos = glGetUniformLocation(raymarchShader_, "EyePos"); glm::vec3 eyePosition = SceneManager::GetCurrent()->MainCamera.Get()->Get<Transform>().Get()->Position; glUniform3f(eyePos, eyePosition.x, eyePosition.y, eyePosition.z); LogB(eyePosition.x, eyePosition.y, eyePosition.z); int pitchYawLoc = glGetUniformLocation(raymarchShader_, "PitchYaw"); glm::vec3 cameraRot = glm::eulerAngles(SceneManager::GetCurrent()->MainCamera.Get()->Get<Transform>().Get()->LocalRotation); glUniform2f(pitchYawLoc, cameraRot.x, cameraRot.y); int lookDirLoc = glGetUniformLocation(raymarchShader_, "LookDir"); glm::vec3 lookDir = glm::normalize(SceneManager::GetCurrent()->MainCamera.Get()->Get<Transform>().Get()->Forward); glUniform3f(lookDirLoc, lookDir.x, lookDir.y, lookDir.z); glBindVertexArray(postprocess_.vaoIndex); glDrawArrays(GL_TRIANGLES, 0, 6); //------Postprocess glBindFramebuffer(GL_FRAMEBUFFER, 0); glClearColor(1.0f, 1.0f, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(postprocess_.shaderProgram); int windowsSizeLoc = glGetUniformLocation(postprocess_.shaderProgram, "ScreenSize"); glUniform2f(windowsSizeLoc, width, height); int mousePosLoc = glGetUniformLocation(postprocess_.shaderProgram, "MousePos"); glUniform2f(mousePosLoc, mousePos_.x, mousePos_.y); glBindVertexArray(postprocess_.vaoIndex); glDisable(GL_DEPTH_TEST); glBindTexture(GL_TEXTURE_2D, postprocess_.textureColorBuffer); glDrawArrays(GL_TRIANGLES, 0, 6); } void Engine::GraphicSystem::SetTransform(Transform* Trans, int ShaderProgram) { //View matrix Camera* camera = SceneManager::GetCurrent()->MainCamera.Get()->Get<Camera>().Get(); Transform* cameraTransform = SceneManager::GetCurrent()->MainCamera.Get()->Get<Transform>().Get(); glm::vec3 eye = cameraTransform->Position; glm::vec3 dir = glm::normalize(cameraTransform->Forward); glm::vec3 up(0.0f, 1.0f, 0.0f); glm::mat4 view = glm::lookAt(eye, eye + dir, up); camera->ViewMatrix = view; //Projection matrix int w, h; glfwGetWindowSize(glfwGetCurrentContext(), &w, &h); glm::mat4 projection = glm::perspective(45.0f, (float)w / (float)h, 0.001f, 50.0f); camera->PerspectiveMatrix = projection; //WVP matrix GLuint projLoc = glGetUniformLocation(ShaderProgram, "Projection"); glUniformMatrix4fv(projLoc, 1, GL_FALSE, &projection[0][0]); GLuint viewLoc = glGetUniformLocation(ShaderProgram, "View"); glUniformMatrix4fv(viewLoc, 1, GL_FALSE, &view[0][0]); GLuint worldLoc = glGetUniformLocation(ShaderProgram, "World"); glUniformMatrix4fv(worldLoc, 1, GL_FALSE, &Trans->World[0][0]); glm::mat3 normalMat = glm::transpose(glm::inverse(Trans->World)); GLuint normalMatLoc = glGetUniformLocation(ShaderProgram, "NormalMatrix"); glUniformMatrix3fv(normalMatLoc, 1, GL_TRUE, &normalMat[0][0]); GLuint viewPosLoc = glGetUniformLocation(ShaderProgram, "ViewPos"); glUniform3f(viewPosLoc, eye.x, eye.y, eye.z); } void Engine::GraphicSystem::RenderMesh(unsigned int VAOIndex, int ShaderProgram, unsigned int TextureIndex, unsigned int NoIndices) { glUseProgram(ShaderProgram); int loc = glGetUniformLocation(ShaderProgram, "hdrToggle"); glUniform1f(loc, postprocess_.hdrToggle); glBindVertexArray(VAOIndex); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, TextureIndex); glDrawElements(GL_TRIANGLES, NoIndices, GL_UNSIGNED_INT, 0); glBindVertexArray(0); } void Engine::GraphicSystem::SetDirectionalLight(int ShaderProgram, DirectionalLight* Light) { if (!Light->bIsDirty) return; GLuint dirLoc = glGetUniformLocation(ShaderProgram, "DirLight.Direction"); glUniform3f(dirLoc, Light->Direction.x, Light->Direction.y, Light->Direction.z); GLuint colorLoc = glGetUniformLocation(ShaderProgram, "DirLight.Color"); glUniform3f(colorLoc, Light->Color.x, Light->Color.y, Light->Color.z); GLuint intensityLoc = glGetUniformLocation(ShaderProgram, "DirLight.Intensity"); glUniform1f(intensityLoc, Light->Intensity); //Light->bIsDirty = false; } void Engine::GraphicSystem::SetPointLight(int ShaderProgram, PointLight* Light, int Index) { if (!Light->bIsDirty) return; Transform* trans = Light->AssignedTo->Get<Transform>().Get(); std::string indexed = "PointLights["; indexed += std::to_string(Index).c_str(); GLuint posLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Position").c_str()); glUniform3f(posLoc, trans->Position.x, trans->Position.y, trans->Position.z); GLuint colorLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Color").c_str()); glUniform3f(colorLoc, Light->Color.x, Light->Color.y, Light->Color.z); GLuint intensityLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Intensity").c_str()); glUniform1f(intensityLoc, Light->Intensity); GLuint constantLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Constant").c_str()); glUniform1f(constantLoc, Light->Constant); GLuint lineraLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Linear").c_str()); glUniform1f(lineraLoc, Light->Linear); GLuint quadraticLoc = glGetUniformLocation(ShaderProgram, (indexed + "].Quadratic").c_str()); glUniform1f(quadraticLoc, Light->Quadratic); //Light->bIsDirty = false; } void Engine::GraphicSystem::SetSpotLight(int ShaderProgram, SpotLight* Light) { Transform* trans = Light->AssignedTo->Get<Transform>().Get(); GLuint dirLoc = glGetUniformLocation(ShaderProgram, "Spot.Direction"); glUniform3f(dirLoc, Light->Direction.x, Light->Direction.y, Light->Direction.z); GLuint posLoc = glGetUniformLocation(ShaderProgram, "Spot.Position"); glUniform3f(posLoc, trans->Position.x, trans->Position.y, trans->Position.z); GLuint colorLoc = glGetUniformLocation(ShaderProgram, "Spot.Color"); glUniform3f(colorLoc, Light->Color.x, Light->Color.y, Light->Color.z); GLuint intensityLoc = glGetUniformLocation(ShaderProgram, "Spot.Intensity"); glUniform1f(intensityLoc, Light->Intensity); GLuint cutoffLoc = glGetUniformLocation(ShaderProgram, "Spot.Cutoff"); glUniform1f(cutoffLoc, Light->Cutoff); GLuint outerLoc = glGetUniformLocation(ShaderProgram, "Spot.OuterCutoff"); glUniform1f(outerLoc, Light->OuterCutoff); } void Engine::GraphicSystem::DrawBackground(Engine::Color BckColor) { glClearColor(BckColor.R, BckColor.G, BckColor.B, BckColor.A); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } void Engine::GraphicSystem::FinalizeRender() { glfwSwapBuffers(glfwGetCurrentContext()); } void Engine::GraphicSystem::DrawSkybox() { //glDepthMask(GL_FALSE); glDepthFunc(GL_LEQUAL); glUseProgram(skybox_.shaderIndex); //View matrix Camera* camera = SceneManager::GetCurrent()->MainCamera.Get()->Get<Camera>().Get(); Transform* cameraTransform = SceneManager::GetCurrent()->MainCamera.Get()->Get<Transform>().Get(); glm::vec3 eye = cameraTransform->Position; glm::vec3 dir = glm::normalize(cameraTransform->Forward); glm::vec3 up(0.0f, 1.0f, 0.0f); glm::mat4 view = glm::lookAt(eye, eye + dir, up); view = glm::mat4(glm::mat3(view)); //Projection matrix int w, h; glfwGetWindowSize(glfwGetCurrentContext(), &w, &h); glm::mat4 projection = glm::perspective(45.0f, (float)w / (float)h, 0.001f, 50.0f); //WVP matrix GLuint projLoc = glGetUniformLocation(skybox_.shaderIndex, "projection"); glUniformMatrix4fv(projLoc, 1, GL_FALSE, &projection[0][0]); GLuint viewLoc = glGetUniformLocation(skybox_.shaderIndex, "view"); glUniformMatrix4fv(viewLoc, 1, GL_FALSE, &view[0][0]); glBindVertexArray(skybox_.vaoIndex_); glBindTexture(GL_TEXTURE_CUBE_MAP, skybox_.textureId_); glDrawArrays(GL_TRIANGLES, 0, 36); //glDepthMask(GL_TRUE); }
40.137457
140
0.761216
[ "vector", "transform" ]
69583e0134336a14c5a67bcba2ac83888358f114
5,455
cc
C++
src/ObjectBuffer.cc
jdavidberger/vrproj
3dc069ae328ee66667ba136f37bcf6fbdbc279f3
[ "Apache-2.0" ]
1
2017-01-24T21:01:46.000Z
2017-01-24T21:01:46.000Z
src/ObjectBuffer.cc
jdavidberger/vrproj
3dc069ae328ee66667ba136f37bcf6fbdbc279f3
[ "Apache-2.0" ]
null
null
null
src/ObjectBuffer.cc
jdavidberger/vrproj
3dc069ae328ee66667ba136f37bcf6fbdbc279f3
[ "Apache-2.0" ]
null
null
null
#include "ObjectBuffer.h" #include "shared/Matrices.h" #include <assert.h> void ObjectBuffer::SetTx(const Matrix5 & tx) { m_tx = tx; } static void AddVertex(std::vector<float>& data, const VertexData& vd) { data.push_back(vd.vertex[0]); data.push_back(vd.vertex[1]); data.push_back(vd.vertex[2]); data.push_back(vd.vertex[3]); data.push_back(vd.rgb[0]); data.push_back(vd.rgb[1]); data.push_back(vd.rgb[2]); data.push_back(vd.vertex[0]); data.push_back(vd.vertex[1]); data.push_back(vd.vertex[2]); data.push_back(vd.vertex[3]); } void ObjectBuffer::SetupEdges(const std::vector< edge_t >& edges) { std::vector<float> data; for (auto& e : edges) { VertexData d = e.first; d.rgb = edgeVertexColor(e.first); AddVertex(data, d); d = e.second; d.rgb = edgeVertexColor(e.second); AddVertex(data, d); } SetBuffer(m_unEdgeVAO, this->m_glEdgeVertBuffer, this->m_edgeLength, data); } ObjectBuffer::ObjectBuffer(GLuint programId, const Polytype_<4>::Polytope& shape) : m_programId(programId) { SetupEdges(shape.edges); SetupSurfaces(shape.surfaces); } static Vector4 CalculateNormalFromBasis(const Vector4& U, const Vector4& V, const Vector4& W) { Matrix3 a(U[1], V[1], W[1], U[2], V[2], W[2], U[3], V[3], W[3]); a = a.t(); Matrix3 b(U[0], V[0], W[0], U[2], V[2], W[2], U[3], V[3], W[3]); b = b.t(); Matrix3 c(U[0], V[0], W[0], U[1], V[1], W[1], U[3], V[3], W[3]); c = c.t(); Matrix3 d(U[0], V[0], W[0], U[1], V[1], W[1], U[2], V[2], W[2]); d = d.t(); auto e = Vector4(cv::determinant(a), cv::determinant(b), cv::determinant(c), cv::determinant(d)); return cv::normalize(e); } static Vector4 CalculateNormal(const Vector4& p1, const Vector4& p2, const Vector4& p3) { auto mid = (p1 + p2 + p3) / 3; auto U = p2 - p1; auto V = p3 - p1; U = cv::normalize(U); V = cv::normalize(V); auto W = Vector4(0,0,0,1); auto e = CalculateNormalFromBasis(U, V, W); if (isnan( cv::norm(e) ) || cv::norm(e) < .5) { W = Vector4(0, 0, 1, 0); e = CalculateNormalFromBasis(U, V, W); } if (isnan(cv::norm(e)) || cv::norm(e) < .5) { W = Vector4(0, 1, 0, 0); e = CalculateNormalFromBasis(U, V, W); } if (isnan(cv::norm(e)) || cv::norm(e) < .5) { W = Vector4(1, 0, 0, 0); e = CalculateNormalFromBasis(U, V, W); } return e; } void ObjectBuffer::SetupSurfaces(const std::vector<Polytype_<4>::Surface>& surfaces) { std::vector<float> data; std::vector<Edge> edges; for (auto& e : surfaces) { if (e.triangulation.empty()) continue; auto n = CalculateNormal(e.triangulation[0], e.triangulation[1], e.triangulation[2]); //if (cv::norm(n) < 0.99) //assert(cv::norm(n) > 0.99); if (cv::norm(e.triangulation[0] + n) < cv::norm(e.triangulation[0] - n)) n = -n; for (auto tript : e.triangulation) { VertexData v = tript; v.normal = n; v.rgb = e.color; AddVertex(data, v); } } SetBuffer(m_unSceneVAO, m_glSceneVertBuffer, m_length, data); //children.emplace_back(edges); // SetBuffer(data, GL_LINE_STRIP); } /* ObjectBuffer::ObjectBuffer(const std::vector<Surface>& surfaces) { std::vector<float> data; std::vector<Edge> edges; for (auto& e : surfaces) { auto a = e[0]; auto b = e[1]; for (size_t i = 2;i < e.size();i++) { auto c = e[i]; auto n = CalculateNormal(a.vertex, b.vertex, c.vertex); if(cv::norm(n) < 0.99) assert(cv::norm(n) > 0.99); if ( cv::norm(a.vertex + n) < cv::norm(a.vertex - n)) n = -n; a.normal = b.normal = c.normal = n; edges.emplace_back((a.vertex + b.vertex + c.vertex) / 3., n + (a.vertex + b.vertex + c.vertex) / 3.); std::get<0>(edges.back()).rgb = Vector3(1, 1, 1); std::get<1>(edges.back()).rgb = Vector3(1, 1, 1); AddVertex(data, a); AddVertex(data, b); AddVertex(data, c); a = b; b = c; } } SetBuffer(data, GL_TRIANGLES); //children.emplace_back(edges); // SetBuffer(data, GL_LINE_STRIP); } */ void ObjectBuffer::SetBuffer(GLuint& vao, GLuint& buffer, size_t& length, const std::vector<float>& vertices) { length = vertices.size() / (sizeof(VertexData) / sizeof(float)); glGenVertexArrays(1, &vao); glBindVertexArray(vao); glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), &vertices[0], GL_STATIC_DRAW); GLsizei stride = sizeof(VertexData); uintptr_t offset = 0; glEnableVertexAttribArray(0); glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, stride, (const void *)offset); offset += sizeof(Vector4); glEnableVertexAttribArray(1); glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, stride, (const void *)offset); offset += sizeof(Vector3); glEnableVertexAttribArray(2); glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, stride, (const void *)offset); glBindVertexArray(0); glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); } void ObjectBuffer::Draw(bool drawSurfaces, bool drawEdges) const { if (drawSurfaces) { glBindVertexArray(m_unSceneVAO); glDrawArrays(GL_TRIANGLES, 0, m_length); } if (drawEdges) { glBindVertexArray(m_unEdgeVAO); glDrawArrays(GL_LINES, 0, m_edgeLength); } glUseProgram(0); glBindVertexArray(0); } ObjectBuffer::~ObjectBuffer() { /* glDeleteBuffers(1, &m_glSceneVertBuffer); if (m_unSceneVAO != 0) { glDeleteVertexArrays(1, &m_unSceneVAO); } */ } VertexData::VertexData() { } VertexData::VertexData(float x, float y, float z, float w, float r, float g, float b) : vertex(x,y,z,w), rgb(r,g,b) { }
25.372093
115
0.648029
[ "shape", "vector" ]
696c353fe02a6f33c239fa4d39412fc434214641
37,843
cpp
C++
tests/ablateLibrary/boundarySolver/lodi/openBoundaryTests.cpp
mtmcgurn-buffalo/ablate
35ee9a30277908775a61d78462ea9724ee631a9b
[ "BSD-3-Clause" ]
null
null
null
tests/ablateLibrary/boundarySolver/lodi/openBoundaryTests.cpp
mtmcgurn-buffalo/ablate
35ee9a30277908775a61d78462ea9724ee631a9b
[ "BSD-3-Clause" ]
8
2020-12-28T16:05:56.000Z
2021-01-12T14:36:22.000Z
tests/ablateLibrary/boundarySolver/lodi/openBoundaryTests.cpp
mtmcgurn-buffalo/ablate
35ee9a30277908775a61d78462ea9724ee631a9b
[ "BSD-3-Clause" ]
1
2021-12-14T22:39:13.000Z
2021-12-14T22:39:13.000Z
#include <functional> #include "PetscTestFixture.hpp" #include "boundarySolver/lodi/openBoundary.hpp" #include "eos/mockEOS.hpp" #include "gmock/gmock.h" #include "gtest/gtest.h" struct OpenBoundaryTestParameters { std::string name; PetscInt dim; PetscInt nEqs; PetscInt nSpecEqs = 0; PetscInt nEvEqs = 0; double reflectFactor; double referencePressure; double maxAcousticsLength; std::function<PetscErrorCode(PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx)> decodeStateFunction; std::function<PetscErrorCode(PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx)> computeTemperatureFunction; std::function<PetscErrorCode(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx)> computeCpFunction; std::function<PetscErrorCode(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx)> computeCvFunction; std::function<PetscErrorCode(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx)> computeSensibleEnthalpy; ablate::boundarySolver::BoundarySolver::BoundaryFVFaceGeom fvFaceGeom; std::vector<PetscScalar> boundaryValues; std::vector<PetscScalar> stencilValues; /* the grad is (boundary-stencil)/1.0*/ std::vector<PetscScalar> expectedResults; }; class OpenBoundaryTestFixture : public testingResources::PetscTestFixture, public ::testing::WithParamInterface<OpenBoundaryTestParameters> {}; static PetscErrorCode MockEOSDecodeStateFunction(PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { auto fun = (std::function<PetscErrorCode( PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx)>*)ctx; return (*fun)(dim, density, totalEnergy, velocity, densityYi, internalEnergy, a, p, nullptr); } static PetscErrorCode MockEOSComputeTemperatureFunction(PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { auto fun = (std::function<PetscErrorCode(PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx)>*)ctx; return (*fun)(dim, density, totalEnergy, massFlux, densityYi, T, nullptr); } static PetscErrorCode MockEOSComputeSpecificHeatFunction(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { auto fun = (std::function<PetscErrorCode(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx)>*)ctx; return (*fun)(T, density, yi, specificHeat, nullptr); } static PetscErrorCode MockEOSComputeSensibleEnthalpyFunction(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { auto fun = (std::function<PetscErrorCode(PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx)>*)ctx; return (*fun)(T, density, yi, sensibleEnthalpy, nullptr); } TEST_P(OpenBoundaryTestFixture, ShouldComputeCorrectSourceTerm) { // arrange // get the required variables const auto& params = GetParam(); // setup the eos auto mockEOS = std::make_shared<ablateTesting::eos::MockEOS>(); EXPECT_CALL(*mockEOS, GetDecodeStateFunction).Times(::testing::Exactly(1)).WillOnce(::testing::Return(MockEOSDecodeStateFunction)); EXPECT_CALL(*mockEOS, GetDecodeStateContext).Times(::testing::Exactly(1)).WillOnce(::testing::Return((void*)&params.decodeStateFunction)); EXPECT_CALL(*mockEOS, GetComputeTemperatureFunction).Times(::testing::Exactly(1)).WillOnce(::testing::Return(MockEOSComputeTemperatureFunction)); EXPECT_CALL(*mockEOS, GetComputeTemperatureContext).Times(::testing::Exactly(1)).WillOnce(::testing::Return((void*)&params.computeTemperatureFunction)); EXPECT_CALL(*mockEOS, GetComputeSpecificHeatConstantPressureFunction).Times(::testing::Exactly(1)).WillOnce(::testing::Return(MockEOSComputeSpecificHeatFunction)); EXPECT_CALL(*mockEOS, GetComputeSpecificHeatConstantPressureContext).Times(::testing::Exactly(1)).WillOnce(::testing::Return((void*)&params.computeCpFunction)); EXPECT_CALL(*mockEOS, GetComputeSpecificHeatConstantVolumeFunction).Times(::testing::Exactly(1)).WillOnce(::testing::Return(MockEOSComputeSpecificHeatFunction)); EXPECT_CALL(*mockEOS, GetComputeSpecificHeatConstantVolumeContext).Times(::testing::Exactly(1)).WillOnce(::testing::Return((void*)&params.computeCvFunction)); EXPECT_CALL(*mockEOS, GetComputeSensibleEnthalpyFunction).Times(::testing::Exactly(1)).WillOnce(::testing::Return(MockEOSComputeSensibleEnthalpyFunction)); EXPECT_CALL(*mockEOS, GetComputeSensibleEnthalpyContext).Times(::testing::Exactly(1)).WillOnce(::testing::Return((void*)&params.computeSensibleEnthalpy)); // create the boundary std::shared_ptr<ablate::boundarySolver::lodi::LODIBoundary> boundary = std::make_shared<ablate::boundarySolver::lodi::OpenBoundary>(mockEOS, GetParam().reflectFactor, GetParam().referencePressure, GetParam().maxAcousticsLength); boundary->Initialize(params.dim, params.nEqs, params.nSpecEqs, params.nEvEqs); PetscInt uOff[3] = {0, params.dim + 2, params.dim + 2 + params.nSpecEqs}; PetscInt aOff[1] = {0}; PetscInt sOff[3] = {0, params.dim + 2, params.dim + 2 + params.nSpecEqs}; const PetscScalar* stencilValues = &params.stencilValues[0]; const PetscScalar* allStencilValues[1] = {stencilValues}; const PetscInt stencil[1] = {-1}; const PetscScalar stencilWeights[3] = {1.0, 1.0, 1.0}; // NOTE: Because this is a made of stencil value, dPhi is computed as stencil-boundary // therefore: //dPhiDx = stencil-boundary ... stencil = boundary+dPhiDx // size up the sourceResults std::vector<PetscScalar> sourceResults(GetParam().expectedResults.size()); // act ablate::boundarySolver::lodi::OpenBoundary::OpenBoundaryFunction(params.dim, &params.fvFaceGeom, nullptr /*boundaryCell*/, uOff, &params.boundaryValues[0], allStencilValues, aOff, nullptr /*auxValues*/, nullptr /*stencilAuxValues*/, 1, stencil, stencilWeights, sOff, &sourceResults[0], boundary.get()); // assert for (std::size_t i = 0; i < GetParam().expectedResults.size(); i++) { ASSERT_TRUE(PetscAbs(GetParam().expectedResults[i] - sourceResults[i]) / (GetParam().expectedResults[i] + 1E-30) < 1E-6) << "The actual source term (" << sourceResults[i] << ") for index " << i << " should match expected " << GetParam().expectedResults[i]; } } static void CHECK_EXPECT(const char* name, double expected, double actual, double diff = 1E-4) { if (PetscAbs(expected - actual) > diff) { throw std::invalid_argument("The " + std::string(name) + " provided (" + std::to_string(actual) + ") is not what is expected (" + std::to_string(expected) + ")"); } } INSTANTIATE_TEST_SUITE_P( OpenBoundaryTests, OpenBoundaryTestFixture, testing::Values( (OpenBoundaryTestParameters){ .name = "1D subsonic into the domain", .dim = 1, .nEqs = 3, .reflectFactor = 0.0, .referencePressure = 101325.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692914985507404, density); CHECK_EXPECT("velocity0", 10.0001, velocity[0]); CHECK_EXPECT("totalEnergy", -226506.0927619263, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.83122426291567; *p = 251619.72076699708; } else { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 20, density); CHECK_EXPECT("velocity0", 9.9603020202, velocity[0]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251619.72076699708 + 20.000000327128298; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692914985507404, density); CHECK_EXPECT("totalEnergy", -226506.0927619263, totalEnergy, 1E-3); CHECK_EXPECT("massFlux", 86.930019, massFlux[0]); *T = 100.42; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.42, T); CHECK_EXPECT("density", 8.692914985507404, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.42, T); CHECK_EXPECT("density", 8.692914985507404, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.42, T); CHECK_EXPECT("density", 8.692914985507404, density); *sensibleEnthalpy = -197610.71454374143; return 0; }, .fvFaceGeom = {.normal = {-1, NAN, NAN}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.692914985507404, -1968998.208078879, 86.93001914657259}, .stencilValues = {20, 3000 * 20, (10.0001 - 0.03979797979809766) * 20.0}, .expectedResults = {0.2115010865888479, -42211.18508291234, -40.57249122316696}}, (OpenBoundaryTestParameters){ .name = "1D subsonic out of the domain", .dim = 1, .nEqs = 3, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("velocity0", -20.0001, velocity[0]); CHECK_EXPECT("totalEnergy", -226349.0154433181, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.84127336667171; *p = 251618.820766997; } else { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", (8.692018326008165 + 1.040246109552421), density); CHECK_EXPECT("velocity0", -19.960302, velocity[0]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251618.820766997 + 200.00000096625962; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("totalEnergy", -226349.0154433181, totalEnergy, 1E-3); CHECK_EXPECT("massFlux", -173.8412357219959, massFlux[0]); *T = 100.43; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *sensibleEnthalpy = -197600.7557934246; return 0; }, .fvFaceGeom = {.normal = {-1, NAN, NAN}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.692018326008165, -1967429.7903072261, -173.8412357219959}, .stencilValues = {(8.692018326008165 + 1.040246109552421), 3000 * (8.692018326008165 + 1.040246109552421), (-20.0001 + 0.03979797979809766) * (8.692018326008165 + 1.040246109552421)}, .expectedResults = {-888.7282612652397, 1.770387294967629E8, -165929.9623913537}}, (OpenBoundaryTestParameters){ .name = "1D supersonic out of the domain", .dim = 1, .nEqs = 3, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("velocity0", -500.0001, velocity[0]); CHECK_EXPECT("totalEnergy", -101548.96744331811, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.84127336667171; *p = 251618.820766997; } else { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", (8.692018326008165 + 1.040246109552421), density); CHECK_EXPECT("velocity0", -499.960302, velocity[0]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251618.820766997 + 200.00000096625962; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("totalEnergy", -101548.96744331811, totalEnergy, 1E-3); CHECK_EXPECT("massFlux", -4346.010032205915, massFlux[0]); *T = 100.43; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *sensibleEnthalpy = -197600.7557934246; return 0; }, .fvFaceGeom = {.normal = {-1, NAN, NAN}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.692018326008165, -882665.4860045275, -4346.010032205915}, .stencilValues = {(8.692018326008165 + 1.040246109552421), 3000 * (8.692018326008165 + 1.040246109552421), (-500.0001 + 0.03979797979809766) * (8.692018326008165 + 1.040246109552421)}, .expectedResults = {519.7772340310783, -8.949767410165516E7, -259915.7065747647}}, (OpenBoundaryTestParameters){ .name = "1D supersonic into the domain", .dim = 1, .nEqs = 3, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("velocity0", 500.0001, velocity[0]); CHECK_EXPECT("totalEnergy", -101548.96744331811, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.84127336667171; *p = 251618.820766997; } else { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", (8.692018326008165 + 1.040246109552421), density); CHECK_EXPECT("velocity0", 500.0398979798, velocity[0]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251618.820766997 + 200.00000096625962; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 8.692018326008165, density); CHECK_EXPECT("totalEnergy", -101548.96744331811, totalEnergy, 1E-3); CHECK_EXPECT("massFlux", 4346.010032205915, massFlux[0]); *T = 100.43; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.43, T); CHECK_EXPECT("density", 8.692018326008165, density); *sensibleEnthalpy = -197600.7557934246; return 0; }, .fvFaceGeom = {.normal = {-1, NAN, NAN}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.692018326008165, -882665.4860045275, 4346.010032205915}, .stencilValues = {(8.692018326008165 + 1.040246109552421), 3000 * (8.692018326008165 + 1.040246109552421), (500.0001 + 0.03979797979809766) * (8.692018326008165 + 1.040246109552421)}, .expectedResults = {0.0, 0.0, 0.0}}, (OpenBoundaryTestParameters){ .name = "3D supersonic out of the domain", .dim = 3, .nEqs = 5, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", 8.694650097350083, density); CHECK_EXPECT("velocity0", -500., velocity[0]); CHECK_EXPECT("velocity1", -600., velocity[1]); CHECK_EXPECT("velocity2", -700., velocity[2]); CHECK_EXPECT("totalEnergy", 323429.7536008524, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.8111245542304; *p = 251619.82076699712; } else { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", (8.694650097350083 - 0.12298691191290341), density); CHECK_EXPECT("velocity0", -500 + 1.9999999999981803, velocity[0]); CHECK_EXPECT("velocity1", -600 + 2.0000000000436553, velocity[1]); CHECK_EXPECT("velocity2", -700 + 0.004999999964638845, velocity[2]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251619.82076699712 + 199.99999993015075; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", 8.694650097350083, density); CHECK_EXPECT("totalEnergy", 323429.7536008524, totalEnergy, 1E-3); CHECK_EXPECT("massFlux[1]", -4347.325048675041, massFlux[0]); CHECK_EXPECT("massFlux[2]", -5216.79005841005, massFlux[1]); CHECK_EXPECT("massFlux[3]", -6086.255068145058, massFlux[2]); *T = 100.4; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *sensibleEnthalpy = -197630.63204437506; return 0; }, .fvFaceGeom = {.normal = {0.0, 0.0, -1.0}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.694650097350083, 2812108.5386315645, -4347.325048675041, -5216.79005841005, -6086.255068145058}, .stencilValues = {(8.694650097350083 - 0.12298691191290341), 3000 * (8.694650097350083 - 0.12298691191290341), (-500.0 + 1.9999999999981803) * (8.694650097350083 - 0.12298691191290341), (-600.0 + 2.0000000000436553) * (8.694650097350083 - 0.12298691191290341), (-700.0 + 0.004999999964638845) * (8.694650097350083 - 0.12298691191290341)}, .expectedResults = {-86.13431158921169, -3.467059254299343E7, 55239.66593088489, 63853.09709008283, 60124.44938764354}}, (OpenBoundaryTestParameters){ .name = "3D subsonic out of the domain", .dim = 3, .nEqs = 5, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", 8.694650097350083, density); CHECK_EXPECT("velocity0", -5., velocity[0]); CHECK_EXPECT("velocity1", -6., velocity[1]); CHECK_EXPECT("velocity2", -7., velocity[2]); CHECK_EXPECT("totalEnergy", -226515.2463991476, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 201.8111245542304; *p = 251619.82076699712; } else { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", (8.694650097350083 - 0.12298691191290341), density); CHECK_EXPECT("velocity0", -5.0 + 2.000000000000312, velocity[0]); CHECK_EXPECT("velocity1", -6.0 + 0.005000000000165981, velocity[1]); CHECK_EXPECT("velocity2", -7.0 + 2.000000000000312, velocity[2]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251619.82076699712 + 199.99999993015075; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 3, dim); CHECK_EXPECT("density", 8.694650097350083, density); CHECK_EXPECT("totalEnergy", -226515.2463991476, totalEnergy, 1E-3); CHECK_EXPECT("massFlux[1]", -43.473250486750416, massFlux[0]); CHECK_EXPECT("massFlux[2]", -52.167900584100494, massFlux[1]); CHECK_EXPECT("massFlux[3]", -60.86255068145058, massFlux[2]); *T = 100.4; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *specificHeat = 995.8750316818866; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *specificHeat = 707.6318608176182; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 100.4, T); CHECK_EXPECT("density", 8.694650097350083, density); *sensibleEnthalpy = -197630.63204437506; return 0; }, .fvFaceGeom = {.normal = {0.0, -1.0, 0.0}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {8.694650097350083, -1969470.8091556267, -43.473250486750416, -52.167900584100494, -60.86255068145058}, .stencilValues = {(8.694650097350083 - 0.12298691191290341), 3000 * (8.694650097350083 - 0.12298691191290341), (-5.0 + 2.000000000000312) * (8.694650097350083 - 0.12298691191290341), (-6.0 + 0.005000000000165981) * (8.694650097350083 - 0.12298691191290341), (-7.0 + 2.000000000000312) * (8.694650097350083 - 0.12298691191290341)}, .expectedResults = {-910.2235530052537, 1.810158811466939E8, 4655.4535661944865, -178273.9425225725, 6475.9006722049935}}, (OpenBoundaryTestParameters){ .name = "1D subsonic out of the domain with sp and ev", .dim = 1, .nEqs = 8, .nSpecEqs = 3, .nEvEqs = 2, .reflectFactor = 0.15, .referencePressure = 202650.0, .maxAcousticsLength = 0.02, .decodeStateFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* velocity, const PetscReal densityYi[], PetscReal* internalEnergy, PetscReal* a, PetscReal* p, void* ctx) { static int count = 0; if (count == 0) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 1.783192, density); CHECK_EXPECT("velocity0", -10, velocity[0]); CHECK_EXPECT("totalEnergy", -136708.9241708678, totalEnergy, 1E-3); *internalEnergy = NAN; *a = 431.6854962124021; *p = 251619.82076699706; } else { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", (1.783191515808363 + 90.16181478870485), density); CHECK_EXPECT("velocity0", (-10 - 40000.000000000015), velocity[0]); CHECK_EXPECT("totalEnergy", 3000, totalEnergy, 1E-3); *internalEnergy = NAN; *a = NAN, *p = 251619.82076699706 + 199.99999981373549; // delta p = stencil-boundary ... stencil = boundary+deltap } count++; return 0; }, .computeTemperatureFunction = [](PetscInt dim, PetscReal density, PetscReal totalEnergy, const PetscReal* massFlux, const PetscReal densityYi[], PetscReal* T, void* ctx) { CHECK_EXPECT("dim", 1, dim); CHECK_EXPECT("density", 1.783192, density); CHECK_EXPECT("totalEnergy", -136708.9241708678, totalEnergy, 1E-3); CHECK_EXPECT("massFlux", -17.831915158083632, massFlux[0]); *T = 300.4; return 0; }, .computeCpFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 300.4, T); CHECK_EXPECT("density", 1.783192, density); *specificHeat = 1934.650079471233; return 0; }, .computeCvFunction = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* specificHeat, void* ctx) { CHECK_EXPECT("T", 300.4, T); CHECK_EXPECT("density", 1.783192, density); *specificHeat = 1464.9215577478003; return 0; }, .computeSensibleEnthalpy = [](PetscReal T, PetscReal density, const PetscReal yi[], PetscReal* sensibleEnthalpy, void* ctx) { CHECK_EXPECT("T", 300.4, T); CHECK_EXPECT("density", 1.783192, density); *sensibleEnthalpy = 4347.52375485136; return 0; }, .fvFaceGeom = {.normal = {-1, NAN, NAN}, .areas = {NAN, NAN, NAN}, .centroid = {NAN, NAN, NAN}}, .boundaryValues = {1.783191515808363, -243778.19371678037, -17.831915158083632, .1 * 1.783191515808363, .5 * 1.783191515808363, .4 * 1.783191515808363, .25 * 1.783191515808363, .5 * 1.783191515808363}, .stencilValues = {(1.783191515808363 + 90.16181478870485), 3000 * (1.783191515808363 + 90.16181478870485), (-10 - 40000.000000000015) * (1.783191515808363 + 90.16181478870485), (.1 + 117.62376237623829) * (1.783191515808363 + 90.16181478870485), (.5) * (1.783191515808363 + 90.16181478870485), (.4 - 117.62376237623829) * (1.783191515808363 + 90.16181478870485), (.25 + 1.9999999999989138) * (1.783191515808363 + 90.16181478870485), (.5 + 2.000000000001112) * (1.783191515808363 + 90.16181478870485)}, .expectedResults = {36966.4328851267, -2.0206605128724575E8, -1.6305600063259933E7, 5794.10023978034, 18483.21644256335, 12689.11620278302, 9277.272051597822, 18518.880272879534}}), [](const testing::TestParamInfo<OpenBoundaryTestParameters>& info) { return testingResources::PetscTestFixture::SanitizeTestName(info.param.name); });
62.757877
199
0.543271
[ "vector", "3d" ]
69702278c857810cf90ea4d44737230a7a410b41
1,657
hpp
C++
include/hydro/engine/document/ElementIdentity.hpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
include/hydro/engine/document/ElementIdentity.hpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
include/hydro/engine/document/ElementIdentity.hpp
hydraate/hydro
42037a8278dcfdca68fb5cceaf6988da861f0eff
[ "Apache-2.0" ]
null
null
null
// // __ __ __ // / / / /__ __ ____/ /_____ ____ // / /_/ // / / // __ // ___// __ \ // / __ // /_/ // /_/ // / / /_/ / // /_/ /_/ \__, / \__,_//_/ \____/ // /____/ // // The Hydro Programming Language // #ifndef __h3o_engine_ElementIdentity__ #define __h3o_engine_ElementIdentity__ #include "ElementClass.hpp" #include "ElementID.hpp" #include "Identity.hpp" namespace hydro::engine { /** * The ElementIdentity class stores information about an element entity's identity. */ class ElementIdentity final : public Identity { public: /** * Creates an ElementIdentity object with a relationships list, element class, and ID. */ ElementIdentity(IdentityRelationshipsList *relationships, ElementClass *type, ElementID *id); /** * Destroys the ElementIdentity object. */ virtual ~ElementIdentity(); /** * Accepts a visitor allowing the visitor to visit the element identity. * @param visitor The visitor to accept. */ virtual void accept(DocumentVisitor *visitor) override { visitor->visit(this); } /** * Gets the element entity's ID. * @return Returns the IDName instance for the element entity. Returns null if the element entity is anonymous. */ ElementID *getID() const { return mID; } private: /** * A sharable identifier assigned to element entities representing a single instance. */ ElementID *mID; }; } // namespace hydro::engine #endif /* __h3o_engine_ElementIdentity__ */
28.084746
115
0.593241
[ "object" ]
697b6994c613059980d943a823e6ca1336bcc25d
8,095
cpp
C++
source/S_GameInputController.cpp
Ivan-Medvedev/CG2_template_clear
e3ec996204202dba36faf0e46118c260618b877d
[ "MIT" ]
null
null
null
source/S_GameInputController.cpp
Ivan-Medvedev/CG2_template_clear
e3ec996204202dba36faf0e46118c260618b877d
[ "MIT" ]
null
null
null
source/S_GameInputController.cpp
Ivan-Medvedev/CG2_template_clear
e3ec996204202dba36faf0e46118c260618b877d
[ "MIT" ]
null
null
null
#include "stl.h" #include "EcsSystems.h" #include "Utils.h" #include "GameStructures.h" static stl::queue<game::EventSfml> inputPool; extern stl::vector<game::Weapon> gGameWeapons; void GameInputControllerSys::OnEvent(const game::EventSfml &evt) { inputPool.push(evt); } static bool Move(CompPos *curPos, sf::Vector2i dxy) { bool canMove = true; ecs::Apply<CompPos, TagCollidable>([&](ecs::IEntity *ent) { if (curPos->v + dxy == ent->GetComp<CompPos>()->v) canMove = false; }); if (!canMove) return false; ecs::Apply<CompPosPattern, TagCollidable>([&](ecs::IEntity *ent) { if (ent->GetComp<CompPosPattern>()-> positions.IsPosExists(curPos->v.x + dxy.x, curPos->v.y + dxy.y)) canMove = false; }); if (!canMove) return false; curPos->v += dxy; ecs::Apply<CompPos, TagCollecatble>([&](ecs::IEntity *ent) { if (ent->GetComp<CompPos>()->v == curPos->v) { // TODO: Collect item. ecs::gEntityManager.DestroyEntity(ent->GetDesc()); } }); } static bool ChangeAttackField(CompPos *myPos, CompDir *dir, CompOwnedItems *ammo, CompCurrentAttackArea *area) { if (ammo->curWeaponId < 0 || ammo->curWeaponId >= int(ammo->weapons.size())) return false; sf::Vector2i normDir(0, 0); if (abs(dir->v.x) > abs(dir->v.y)) normDir.x = dir->v.x > 0 ? 1 : -1; else normDir.y = dir->v.y > 0 ? 1 : -1; ecs::IEntity *areaEnt = ecs::gEntityManager.GetEntityByDesc(area->ent); if (!areaEnt) return false; CompPosPattern *pp = areaEnt->GetComp<CompPosPattern>(); const game::Weapon *weap = ammo->weapons[ammo->curWeaponId]; int w = weap->areaSize.x; int h = weap->areaSize.y; if (normDir.y == 1) { pp->positions.Init(w, h, 0); area->shift = sf::Vector2i(- w / 2, 1 + weap->shift); for (int i = 0; i < w; ++i) for (int j = 0; j < h; ++j) pp->positions.pattern[i][j] = weap->pattern[i * h + j]; } else if (normDir.y == -1) { pp->positions.Init(w, h, 0); area->shift = sf::Vector2i(- w / 2, - h - weap->shift); for (int i = 0; i < w; ++i) for (int j = 0; j < h; ++j) pp->positions.pattern[w - 1 - i][h - 1 - j] = weap->pattern[i * h + j]; } else if (normDir.x == 1) { pp->positions.Init(h, w, 0); area->shift = sf::Vector2i(1 + weap->shift, - w / 2); for (int i = 0; i < w; ++i) for (int j = 0; j < h; ++j) pp->positions.pattern[j][w - 1 - i] = weap->pattern[i * h + j]; } else { pp->positions.Init(h, w, 0); area->shift = sf::Vector2i(- h - weap->shift, - w / 2); for (int i = 0; i < w; ++i) for (int j = 0; j < h; ++j) pp->positions.pattern[h - 1 - j][i] = weap->pattern[i * h + j]; } CompDamage *damage = areaEnt->GetComp<CompDamage>(); damage->physDamage = weap->physDamage; damage->magicDamage = weap->magicDamage; return true; } static void ShowAttackField(CompVisibility *vis) { vis->visible = true; vis->hideAfterOneTick = true; } static void Attack(CompActivity *act, CompOwnedItems *items, ecs::IEntity *player) { float stamCons = items->weapons[items->curWeaponId]->staminaConsumption; float manaCons = items->weapons[items->curWeaponId]->manaConsumption; CompStamina *s = player->GetComp<CompStamina>(); CompMana *m = player->GetComp<CompMana>(); if (s->value - stamCons >= 0.0f && m->value - manaCons >= 0.0f) { s->value -= stamCons; m->value -= manaCons; act->active = true; act->disableAfterOneTick = true; // So the damage will be only in one step. } } void GameInputControllerSys::OnUpdate() { auto players = ecs::gEntityManager.GetEntitiesByType(ecs::GetEntityTid<Player>()); if (!players) return; IEntity *player = players->at(0).get(); if (!player) return; // Yes, input is hardcoded. // You may change such realization, if you want. CompOwnedItems *items = player->GetComp<CompOwnedItems>(); bool needAttackChange = false; bool needAttack = false; bool needShowAttack = false; sf::Vector2i moveDir(0, 0); if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)) moveDir += sf::Vector2i(0, 1); if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) moveDir += sf::Vector2i(-1, 0); if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)) moveDir += sf::Vector2i(0, -1); if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)) moveDir += sf::Vector2i(1, 0); player->GetComp<CompMoveDir>()->v = moveDir; if (moveDir != sf::Vector2i(0, 0)) needAttackChange = true; if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up) || sf::Keyboard::isKeyPressed(sf::Keyboard::Down) || sf::Keyboard::isKeyPressed(sf::Keyboard::Left) || sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) { IEntity *attackArea = ecs::gEntityManager.GetEntityByDesc( player->GetComp<CompCurrentAttackArea>()->ent); if (attackArea) ShowAttackField(attackArea->GetComp<CompVisibility>()); } if (needAttackChange) { ChangeAttackField(player->GetComp<CompPos>(), player->GetComp<CompDir>(), items, player->GetComp<CompCurrentAttackArea>()); } while (inputPool.size()) { needAttackChange = false; needAttack = false; needShowAttack = false; game::EventSfml &evt = inputPool.front(); switch (evt.type) { case game::EventSfml::KeyPressed: switch (evt.key.code) { case sf::Keyboard::Up: player->GetComp<CompDir>()->v = sf::Vector2i(0, 1); needAttackChange = true; needShowAttack = true; break; case sf::Keyboard::Down: player->GetComp<CompDir>()->v = sf::Vector2i(0, -1); needAttackChange = true; needShowAttack = true; break; case sf::Keyboard::Left: player->GetComp<CompDir>()->v = sf::Vector2i(-1, 0); needAttackChange = true; needShowAttack = true; break; case sf::Keyboard::Right: player->GetComp<CompDir>()->v = sf::Vector2i(1, 0); needAttackChange = true; needShowAttack = true; break; } if (evt.key.code >= sf::Keyboard::Num1 && evt.key.code <= sf::Keyboard::Num9) { unsigned weapId = evt.key.code - sf::Keyboard::Num1; if (weapId < items->weapons.size()) { items->curWeaponId = weapId; needAttackChange = true; } } break; case game::EventSfml::KeyReleased: switch (evt.key.code) { case sf::Keyboard::Up: case sf::Keyboard::Down: case sf::Keyboard::Left: case sf::Keyboard::Right: needAttack = true; break; } break; } if (needAttackChange) { ChangeAttackField(player->GetComp<CompPos>(), player->GetComp<CompDir>(), items, player->GetComp<CompCurrentAttackArea>()); } if (needAttack || needShowAttack) { IEntity *attackArea = ecs::gEntityManager.GetEntityByDesc( player->GetComp<CompCurrentAttackArea>()->ent); if (attackArea) { if (needShowAttack) ShowAttackField(attackArea->GetComp<CompVisibility>()); if (needAttack) Attack(attackArea->GetComp<CompActivity>(), items, player); } } inputPool.pop(); } }
31.621094
89
0.537986
[ "vector" ]
697da2cf70bb7851f2a6f961bd79e63a4717f1e7
358
cpp
C++
dp/70-climbing-stairs/70-climbing-stairs-div7.cpp
ZonePG/my-leetcode-solution
9efa4c19e4c9be9f47b5f5d4e9a47fceae26e0bb
[ "MIT" ]
null
null
null
dp/70-climbing-stairs/70-climbing-stairs-div7.cpp
ZonePG/my-leetcode-solution
9efa4c19e4c9be9f47b5f5d4e9a47fceae26e0bb
[ "MIT" ]
null
null
null
dp/70-climbing-stairs/70-climbing-stairs-div7.cpp
ZonePG/my-leetcode-solution
9efa4c19e4c9be9f47b5f5d4e9a47fceae26e0bb
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> using namespace std; class Solution { public: int climbStairs(int n) { vector<int> dp(n + 1, 0); dp[1] = 1; dp[2] = 2; for (int i = 3; i < n; i++) { if (i % 7 == 0) { dp[i] = 0; break; } dp[i] = dp[i - 1] + dp[i - 2]; } return dp[n]; } }; int main() { }
13.769231
36
0.435754
[ "vector" ]
69812b8949139dbfe9b778d46d5978303888fa4e
26,029
cc
C++
chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
chrome/browser/media/webrtc/webrtc_event_log_manager_remote.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright (c) 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/media/webrtc/webrtc_event_log_manager_remote.h" #include <algorithm> #include <iterator> #include <limits> #include "base/big_endian.h" #include "base/bind.h" #include "base/command_line.h" #include "base/files/file.h" #include "base/files/file_enumerator.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/logging.h" #include "base/macros.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" #include "base/threading/sequenced_task_runner_handle.h" #include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" const size_t kMaxRemoteLogFileMetadataSizeBytes = 0xffffu; // 65535 static_assert(kMaxRemoteLogFileMetadataSizeBytes <= 0xFFFFFFu, "Only 24 bits available for encoding the metadata's length."); // TODO(crbug.com/775415): Change back to (1u << 29) after resolving the issue // where we read the entire file into memory. const size_t kMaxRemoteLogFileSizeBytes = 50000000u; namespace { const base::TimeDelta kDefaultProactivePruningDelta = base::TimeDelta::FromMinutes(5); const base::FilePath::CharType kRemoteBoundLogSubDirectory[] = FILE_PATH_LITERAL("webrtc_event_logs"); // Purge from local disk a log file which could not be properly started // (e.g. error encountered when attempting to write the log header). void DiscardLogFile(base::File* file, const base::FilePath& file_path) { file->Close(); if (!base::DeleteFile(file_path, /*recursive=*/false)) { LOG(ERROR) << "Failed to delete " << file_path << "."; } } bool AreLogParametersValid(size_t max_file_size_bytes, const std::string& metadata, std::string* error_message) { if (max_file_size_bytes == kWebRtcEventLogManagerUnlimitedFileSize) { LOG(WARNING) << "Unlimited file sizes not allowed for remote-bound logs."; *error_message = kStartRemoteLoggingFailureUnlimitedSizeDisallowed; return false; } if (max_file_size_bytes > kMaxRemoteLogFileSizeBytes) { LOG(WARNING) << "File size exceeds maximum allowed."; *error_message = kStartRemoteLoggingFailureMaxSizeTooLarge; return false; } if (metadata.length() > kMaxRemoteLogFileMetadataSizeBytes) { LOG(ERROR) << "Excessively long metadata."; *error_message = kStartRemoteLoggingFailureMetadaTooLong; return false; } if (metadata.size() + kRemoteBoundLogFileHeaderSizeBytes >= max_file_size_bytes) { LOG(ERROR) << "Max file size and metadata must leave room for event log."; *error_message = kStartRemoteLoggingFailureMaxSizeTooSmall; return false; } return true; } base::Optional<base::TimeDelta> GetProactivePruningDelta() { if (base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kWebRtcRemoteEventLogProactivePruningDelta)) { const std::string delta_seconds_str = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( ::switches::kWebRtcRemoteEventLogProactivePruningDelta); int64_t seconds; if (base::StringToInt64(delta_seconds_str, &seconds) && seconds >= 0) { // A delta of 0 seconds is used to signal the intention of disabling // proactive pruning altogether. (From the command line. Past the command // line, we use an unset optional to signal that.) return (seconds == 0) ? base::Optional<base::TimeDelta>() : base::TimeDelta::FromSeconds(seconds); } else { LOG(WARNING) << "Proactive pruning delta could not be parsed."; } } return kDefaultProactivePruningDelta; } } // namespace const size_t kMaxActiveRemoteBoundWebRtcEventLogs = 3; const size_t kMaxPendingRemoteBoundWebRtcEventLogs = 5; static_assert(kMaxActiveRemoteBoundWebRtcEventLogs <= kMaxPendingRemoteBoundWebRtcEventLogs, "This assumption affects unit test coverage."); const base::TimeDelta kRemoteBoundWebRtcEventLogsMaxRetention = base::TimeDelta::FromDays(3); const base::FilePath::CharType kRemoteBoundLogExtension[] = FILE_PATH_LITERAL("log"); const uint8_t kRemoteBoundWebRtcEventLogFileVersion = 0; const size_t kRemoteBoundLogFileHeaderSizeBytes = sizeof(uint32_t); WebRtcRemoteEventLogManager::WebRtcRemoteEventLogManager( WebRtcRemoteEventLogsObserver* observer) : upload_suppression_disabled_( base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kWebRtcRemoteEventLogUploadNoSuppression)), proactive_prune_scheduling_delta_(GetProactivePruningDelta()), proactive_prune_scheduling_started_(false), observer_(observer), uploader_factory_(new WebRtcEventLogUploaderImpl::Factory) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DETACH_FROM_SEQUENCE(io_task_sequence_checker_); // Proactive pruning would not do anything at the moment; it will be started // with the first enabled browser context. This will all have the benefit // of doing so on io_task_sequence_checker_ rather than the UI thread. } WebRtcRemoteEventLogManager::~WebRtcRemoteEventLogManager() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // TODO(crbug.com/775415): Purge from disk files which were being uploaded // while destruction took place, thereby avoiding endless attempts to upload // the same file. } void WebRtcRemoteEventLogManager::EnableForBrowserContext( BrowserContextId browser_context_id, const base::FilePath& browser_context_dir) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); DCHECK(!BrowserContextEnabled(browser_context_id)) << "Already enabled."; const base::FilePath remote_bound_logs_dir = GetLogsDirectoryPath(browser_context_dir); if (!MaybeCreateLogsDirectory(remote_bound_logs_dir)) { LOG(WARNING) << "WebRtcRemoteEventLogManager couldn't create logs directory."; return; } AddPendingLogs(browser_context_id, remote_bound_logs_dir); enabled_browser_contexts_.insert(browser_context_id); if (proactive_prune_scheduling_delta_.has_value() && !proactive_prune_scheduling_started_) { proactive_prune_scheduling_started_ = true; RecurringPendingLogsPrune(); } } // TODO(crbug.com/775415): Add unit tests. void WebRtcRemoteEventLogManager::DisableForBrowserContext( BrowserContextId browser_context_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); if (!BrowserContextEnabled(browser_context_id)) { return; // Enabling may have failed due to lacking permissions. } enabled_browser_contexts_.erase(browser_context_id); #if DCHECK_IS_ON() // All of the RPHs associated with this BrowserContext must already have // exited, which should have implicitly stopped all active logs. auto pred = [browser_context_id](decltype(active_logs_)::value_type& log) { return log.first.browser_context_id == browser_context_id; }; DCHECK(std::count_if(active_logs_.begin(), active_logs_.end(), pred) == 0u); #endif // Pending logs for this BrowserContext are no longer eligible for upload. // (Active uploads, if any, are not affected.) for (auto it = pending_logs_.begin(); it != pending_logs_.end();) { if (it->browser_context_id == browser_context_id) { it = pending_logs_.erase(it); } else { ++it; } } } bool WebRtcRemoteEventLogManager::PeerConnectionAdded( const PeerConnectionKey& key, const std::string& peer_connection_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); PrunePendingLogs(); // Infrequent event - good opportunity to prune. const auto result = active_peer_connections_.emplace(key, peer_connection_id); return result.second; } bool WebRtcRemoteEventLogManager::PeerConnectionRemoved( const PeerConnectionKey& key) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); PrunePendingLogs(); // Infrequent event - good opportunity to prune. const auto peer_connection = active_peer_connections_.find(key); if (peer_connection == active_peer_connections_.end()) { return false; } MaybeStopRemoteLogging(key); active_peer_connections_.erase(peer_connection); MaybeStartUploading(); return true; } bool WebRtcRemoteEventLogManager::StartRemoteLogging( int render_process_id, BrowserContextId browser_context_id, const std::string& peer_connection_id, const base::FilePath& browser_context_dir, size_t max_file_size_bytes, const std::string& metadata, std::string* error_message) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); DCHECK(error_message); DCHECK(error_message->empty()); if (!AreLogParametersValid(max_file_size_bytes, metadata, error_message)) { // |error_message| will have been set by AreLogParametersValid(). DCHECK(!error_message->empty()) << "AreLogParametersValid() reported an " "error without an error message."; return false; } if (!BrowserContextEnabled(browser_context_id)) { *error_message = kStartRemoteLoggingFailureGeneric; return false; } PeerConnectionKey key; if (!FindPeerConnection(render_process_id, peer_connection_id, &key)) { *error_message = kStartRemoteLoggingFailureUnknownOrInactivePeerConnection; return false; } // May not restart active remote logs. auto it = active_logs_.find(key); if (it != active_logs_.end()) { LOG(ERROR) << "Remote logging already underway for (" << key.render_process_id << ", " << key.lid << ")."; *error_message = kStartRemoteLoggingFailureAlreadyLogging; return false; } // This is a good opportunity to prune the list of pending logs, potentially // making room for this file. PrunePendingLogs(); if (!AdditionalActiveLogAllowed(key.browser_context_id)) { // Intentionally use a generic error, so as to not leak information such // as this being an incognito session (rejected elsewhere with the same // error), or there being too many other peer connections on other tabs // that might also be logging. *error_message = kStartRemoteLoggingFailureGeneric; return false; } return StartWritingLog(key, browser_context_dir, max_file_size_bytes, metadata, error_message); } bool WebRtcRemoteEventLogManager::EventLogWrite(const PeerConnectionKey& key, const std::string& message) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); auto it = active_logs_.find(key); if (it == active_logs_.end()) { return false; } return WriteToLogFile(it, message); } void WebRtcRemoteEventLogManager::ClearCacheForBrowserContext( BrowserContextId browser_context_id, const base::Time& delete_begin, const base::Time& delete_end) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); RemovePendingLogs(delete_begin, delete_end, browser_context_id); } void WebRtcRemoteEventLogManager::RenderProcessHostExitedDestroyed( int render_process_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); // Closing files will call MaybeStartUploading(). Avoid letting that upload // any recently expired files. PrunePendingLogs(); // Remove all of the peer connections associated with this render process. // It's important to do this before closing the actual files, because closing // files can trigger a new upload if no active peer connections are present. auto pc_it = active_peer_connections_.begin(); while (pc_it != active_peer_connections_.end()) { if (pc_it->first.render_process_id == render_process_id) { pc_it = active_peer_connections_.erase(pc_it); } else { ++pc_it; } } // Close all of the files that were associated with peer connections which // belonged to this render process. auto log_it = active_logs_.begin(); while (log_it != active_logs_.end()) { if (log_it->first.render_process_id == render_process_id) { log_it = CloseLogFile(log_it); } else { ++log_it; } } // Though CloseLogFile() calls this, it's important to also do this // explicitly, since it could be that no files were closed, but some // active PeerConnections that were suppressing uploading are now gone. MaybeStartUploading(); } void WebRtcRemoteEventLogManager::OnWebRtcEventLogUploadComplete( const base::FilePath& file_path, bool upload_successful) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); // Post a task to deallocate the uploader (can't do this directly, // because this function is a callback from the uploader), potentially // starting a new upload for the next file. base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce( &WebRtcRemoteEventLogManager::OnWebRtcEventLogUploadCompleteInternal, base::Unretained(this))); } void WebRtcRemoteEventLogManager::SetWebRtcEventLogUploaderFactoryForTesting( std::unique_ptr<WebRtcEventLogUploader::Factory> uploader_factory) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); uploader_factory_ = std::move(uploader_factory); // Unit tests would initially set a null uploader factory, so that files would // be kept around. Some tests would later change to a different factory // (e.g. one that always simulates upload failure); in that case, we should // get rid of the null uploader, since it never terminates. uploader_.reset(); MaybeStartUploading(); } base::FilePath WebRtcRemoteEventLogManager::GetLogsDirectoryPath( const base::FilePath& browser_context_dir) { return browser_context_dir.Append(kRemoteBoundLogSubDirectory); } bool WebRtcRemoteEventLogManager::BrowserContextEnabled( BrowserContextId browser_context_id) const { const auto it = enabled_browser_contexts_.find(browser_context_id); return it != enabled_browser_contexts_.cend(); } WebRtcRemoteEventLogManager::LogFilesMap::iterator WebRtcRemoteEventLogManager::CloseLogFile(LogFilesMap::iterator it) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); const PeerConnectionKey peer_connection = it->first; it->second.file.Flush(); it = active_logs_.erase(it); // file.Close() called by destructor. if (observer_) { observer_->OnRemoteLogStopped(peer_connection); } MaybeStartUploading(); return it; } bool WebRtcRemoteEventLogManager::MaybeCreateLogsDirectory( const base::FilePath& remote_bound_logs_dir) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); if (base::PathExists(remote_bound_logs_dir)) { if (!base::DirectoryExists(remote_bound_logs_dir)) { LOG(ERROR) << "Path for remote-bound logs is taken by a non-directory."; return false; } } else if (!base::CreateDirectory(remote_bound_logs_dir)) { LOG(ERROR) << "Failed to create the local directory for remote-bound logs."; return false; } // TODO(crbug.com/775415): Test for appropriate permissions. return true; } void WebRtcRemoteEventLogManager::AddPendingLogs( BrowserContextId browser_context_id, const base::FilePath& remote_bound_logs_dir) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); base::FilePath::StringType pattern = base::FilePath::StringType(FILE_PATH_LITERAL("*")) + base::FilePath::kExtensionSeparator + kRemoteBoundLogExtension; base::FileEnumerator enumerator(remote_bound_logs_dir, /*recursive=*/false, base::FileEnumerator::FILES, pattern); for (auto path = enumerator.Next(); !path.empty(); path = enumerator.Next()) { const auto last_modified = enumerator.GetInfo().GetLastModifiedTime(); auto it = pending_logs_.emplace(browser_context_id, path, last_modified); DCHECK(it.second); // No pre-existing entry. } MaybeStartUploading(); } bool WebRtcRemoteEventLogManager::StartWritingLog( const PeerConnectionKey& key, const base::FilePath& browser_context_dir, size_t max_file_size_bytes, const std::string& metadata, std::string* error_message) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); // WriteAtCurrentPos() only allows writing up to max-int at a time. We could // iterate to do more, but we don't expect to ever need to, so it's easier // to disallow it. if (metadata.length() > static_cast<size_t>(std::numeric_limits<int>::max())) { LOG(WARNING) << "Metadata too long to be written in one go."; *error_message = kStartRemoteLoggingFailureMetadaTooLong; return false; } // Randomize a new filename. In the highly unlikely event that this filename // is already taken, it will be treated the same way as any other failure // to start the log file. // TODO(crbug.com/775415): Add a unit test for above comment. const std::string unique_filename = "event_log_" + std::to_string(base::RandUint64()); const base::FilePath base_path = GetLogsDirectoryPath(browser_context_dir); const base::FilePath file_path = base_path.AppendASCII(unique_filename) .AddExtension(kRemoteBoundLogExtension); // Attempt to create the file. constexpr int file_flags = base::File::FLAG_CREATE | base::File::FLAG_WRITE | base::File::FLAG_EXCLUSIVE_WRITE; base::File file(file_path, file_flags); if (!file.IsValid() || !file.created()) { LOG(WARNING) << "Couldn't create and/or open remote WebRTC event log file."; // Intentionally using a generic error; look for other places where it's // set for an explanation why. *error_message = kStartRemoteLoggingFailureGeneric; return false; } const uint32_t header_host_order = static_cast<uint32_t>(metadata.length()) | (kRemoteBoundWebRtcEventLogFileVersion << 24); static_assert(kRemoteBoundLogFileHeaderSizeBytes == sizeof(uint32_t), "Restructure this otherwise."); char header[sizeof(uint32_t)]; base::WriteBigEndian<uint32_t>(header, header_host_order); int written = file.WriteAtCurrentPos(header, sizeof(header)); if (written != arraysize(header)) { LOG(WARNING) << "Failed to write header to log file."; DiscardLogFile(&file, file_path); // Intentionally using a generic error; look for other places where it's // set for an explanation why. *error_message = kStartRemoteLoggingFailureGeneric; return false; } const int metadata_length = static_cast<int>(metadata.length()); written = file.WriteAtCurrentPos(metadata.c_str(), metadata_length); if (written != metadata_length) { LOG(WARNING) << "Failed to write metadata to log file."; DiscardLogFile(&file, file_path); // Intentionally using a generic error; look for other places where it's // set for an explanation why. *error_message = kStartRemoteLoggingFailureGeneric; return false; } // Record that we're now writing this remote-bound log to this file. const size_t header_and_metadata_size_bytes = kRemoteBoundLogFileHeaderSizeBytes + metadata_length; const auto it = active_logs_.emplace( key, LogFile(file_path, std::move(file), max_file_size_bytes, header_and_metadata_size_bytes)); DCHECK(it.second); observer_->OnRemoteLogStarted(key, file_path); return true; } void WebRtcRemoteEventLogManager::MaybeStopRemoteLogging( const PeerConnectionKey& key) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); const auto it = active_logs_.find(key); if (it == active_logs_.end()) { return; } it->second.file.Flush(); it->second.file.Close(); // The current time is a good enough approximation of the file's last // modification time. const base::Time last_modified = base::Time::Now(); // The stopped log becomes a pending log. It is no longer an active log. const auto emplace_result = pending_logs_.emplace( key.browser_context_id, it->second.path, last_modified); DCHECK(emplace_result.second); // No pre-existing entry. active_logs_.erase(it); observer_->OnRemoteLogStopped(key); MaybeStartUploading(); } void WebRtcRemoteEventLogManager::PrunePendingLogs() { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); RemovePendingLogs( base::Time::Min(), base::Time::Now() - kRemoteBoundWebRtcEventLogsMaxRetention); } void WebRtcRemoteEventLogManager::RecurringPendingLogsPrune() { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); DCHECK(proactive_prune_scheduling_delta_.has_value()); DCHECK_GT(*proactive_prune_scheduling_delta_, base::TimeDelta()); DCHECK(proactive_prune_scheduling_started_); PrunePendingLogs(); base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(&WebRtcRemoteEventLogManager::RecurringPendingLogsPrune, base::Unretained(this)), *proactive_prune_scheduling_delta_); } void WebRtcRemoteEventLogManager::RemovePendingLogs( const base::Time& delete_begin, const base::Time& delete_end, base::Optional<BrowserContextId> browser_context_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); for (auto it = pending_logs_.begin(); it != pending_logs_.end();) { const bool relevant_browser_content = !browser_context_id || it->browser_context_id == browser_context_id; if (relevant_browser_content && (delete_begin.is_null() || delete_begin <= it->last_modified) && (delete_end.is_null() || it->last_modified < delete_end)) { DVLOG(1) << "Removing " << it->path << "."; if (!base::DeleteFile(it->path, /*recursive=*/false)) { LOG(ERROR) << "Failed to delete " << it->path << "."; } it = pending_logs_.erase(it); } else { DVLOG(1) << "Keeping " << it->path << " on disk."; ++it; } } } bool WebRtcRemoteEventLogManager::AdditionalActiveLogAllowed( BrowserContextId browser_context_id) const { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); // Limit over concurrently active logs (across BrowserContext-s). if (active_logs_.size() >= kMaxActiveRemoteBoundWebRtcEventLogs) { return false; } // Limit over the number of pending logs (per BrowserContext). We count active // logs too, since they become pending logs once completed. const size_t active_count = std::count_if( active_logs_.begin(), active_logs_.end(), [browser_context_id](const decltype(active_logs_)::value_type& log) { return log.first.browser_context_id == browser_context_id; }); const size_t pending_count = std::count_if( pending_logs_.begin(), pending_logs_.end(), [browser_context_id](const decltype(pending_logs_)::value_type& log) { return log.browser_context_id == browser_context_id; }); return active_count + pending_count < kMaxPendingRemoteBoundWebRtcEventLogs; } bool WebRtcRemoteEventLogManager::UploadingAllowed() const { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); return upload_suppression_disabled_ || active_peer_connections_.empty(); } void WebRtcRemoteEventLogManager::MaybeStartUploading() { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); PrunePendingLogs(); // Avoid uploading freshly expired files. if (uploader_) { return; // Upload already underway. } if (pending_logs_.empty()) { return; // Nothing to upload. } if (!UploadingAllowed()) { return; } // The uploader takes ownership of the file; it's no longer considered to be // pending. (If the upload fails, the log will be deleted.) // TODO(crbug.com/775415): Add more refined retry behavior, so that we would // not delete the log permanently if the network is just down, on the one // hand, but also would not be uploading unlimited data on endless retries on // the other hand. // TODO(crbug.com/814362): Delay the upload's start. // TODO(crbug.com/775415): Rename the file before uploading, so that we would // not retry the upload after restarting Chrome, if the upload is interrupted. uploader_ = uploader_factory_->Create(pending_logs_.begin()->path, this); pending_logs_.erase(pending_logs_.begin()); } void WebRtcRemoteEventLogManager::OnWebRtcEventLogUploadCompleteInternal() { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); uploader_.reset(); MaybeStartUploading(); } bool WebRtcRemoteEventLogManager::FindPeerConnection( int render_process_id, const std::string& peer_connection_id, PeerConnectionKey* key) const { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); const auto it = FindNextPeerConnection(active_peer_connections_.cbegin(), render_process_id, peer_connection_id); if (it == active_peer_connections_.cend()) { return false; } // Make sure that the peer connection ID is unique for the renderer process // in which it exists, though not necessarily between renderer processes. // (The helper exists just to allow this DCHECK.) DCHECK(FindNextPeerConnection(std::next(it), render_process_id, peer_connection_id) == active_peer_connections_.cend()); *key = it->first; return true; } std::map<WebRtcEventLogPeerConnectionKey, const std::string>::const_iterator WebRtcRemoteEventLogManager::FindNextPeerConnection( std::map<PeerConnectionKey, const std::string>::const_iterator begin, int render_process_id, const std::string& peer_connection_id) const { DCHECK_CALLED_ON_VALID_SEQUENCE(io_task_sequence_checker_); const auto end = active_peer_connections_.cend(); for (auto it = begin; it != end; it++) { if (it->first.render_process_id == render_process_id && it->second == peer_connection_id) { return it; } } return end; }
37.559885
80
0.734604
[ "render" ]
6982928f078fd41cefa33a3a01971f2d2ba83ad5
7,298
cpp
C++
Code/Projects/Rosa/src/Actions/wbactionrosaspawnentity.cpp
dphrygian/zeta
2b32760558cf2b20c626cf46fcf2a382924988fe
[ "Zlib", "Unlicense" ]
6
2022-01-22T02:18:07.000Z
2022-02-14T09:30:53.000Z
Code/Projects/Rosa/src/Actions/wbactionrosaspawnentity.cpp
dphrygian/zeta
2b32760558cf2b20c626cf46fcf2a382924988fe
[ "Zlib", "Unlicense" ]
null
null
null
Code/Projects/Rosa/src/Actions/wbactionrosaspawnentity.cpp
dphrygian/zeta
2b32760558cf2b20c626cf46fcf2a382924988fe
[ "Zlib", "Unlicense" ]
null
null
null
#include "core.h" #include "wbactionrosaspawnentity.h" #include "configmanager.h" #include "angles.h" #include "Components/wbcomprosatransform.h" #include "Components/wbcomprosacamera.h" #include "Components/wbcomprosaheadtracker.h" #include "Components/wbcompowner.h" #include "Components/wbcomprosacollision.h" #include "Components/wbcomprosalinkedentities.h" #include "wbactionstack.h" #include "wbeventmanager.h" #include "rosaframework.h" #include "rosaworld.h" #include "collisioninfo.h" #include "rosaworldgen.h" WBActionRosaSpawnEntity::WBActionRosaSpawnEntity() : m_EntityDef() , m_EntityDefPE() , m_LocationPE() , m_OrientationPE() , m_UseHeadTracker( false ) , m_YawOnly( false ) , m_SpawnImpulseZ( 0.0f ) , m_SpawnImpulse( 0.0f ) , m_SpawnImpulsePE() , m_SpawnOffsetZ( 0.0f ) { } WBActionRosaSpawnEntity::~WBActionRosaSpawnEntity() { } /*virtual*/ void WBActionRosaSpawnEntity::InitializeFromDefinition( const SimpleString& DefinitionName ) { WBAction::InitializeFromDefinition( DefinitionName ); MAKEHASH( DefinitionName ); STATICHASH( Entity ); m_EntityDef = ConfigManager::GetString( sEntity, "", sDefinitionName ); STATICHASH( EntityPE ); const SimpleString EntityDefPE = ConfigManager::GetString( sEntityPE, "", sDefinitionName ); m_EntityDefPE.InitializeFromDefinition( EntityDefPE ); STATICHASH( LocationPE ); const SimpleString LocationPE = ConfigManager::GetString( sLocationPE, "", sDefinitionName ); m_LocationPE.InitializeFromDefinition( LocationPE ); STATICHASH( OrientationPE ); const SimpleString OrientationPE = ConfigManager::GetString( sOrientationPE, "", sDefinitionName ); m_OrientationPE.InitializeFromDefinition( OrientationPE ); STATICHASH( UseHeadTracker ); m_UseHeadTracker = ConfigManager::GetBool( sUseHeadTracker, false, sDefinitionName ); STATICHASH( YawOnly ); m_YawOnly = ConfigManager::GetBool( sYawOnly, false, sDefinitionName ); STATICHASH( SpawnImpulseZ ); m_SpawnImpulseZ = ConfigManager::GetFloat( sSpawnImpulseZ, 0.0f, sDefinitionName ); STATICHASH( SpawnImpulse ); m_SpawnImpulse = ConfigManager::GetFloat( sSpawnImpulse, 0.0f, sDefinitionName ); STATICHASH( SpawnImpulsePE ); const SimpleString SpawnImpulsePE = ConfigManager::GetString( sSpawnImpulsePE, "", sDefinitionName ); m_SpawnImpulsePE.InitializeFromDefinition( SpawnImpulsePE ); STATICHASH( SpawnOffsetZ ); m_SpawnOffsetZ = ConfigManager::GetFloat( sSpawnOffsetZ, 0.0f, sDefinitionName ); } // Borrowed from WBCompRosaItem spawn drop code. Maybe unify? /*virtual*/ void WBActionRosaSpawnEntity::Execute() { WBAction::Execute(); WBEntity* const pEntity = GetEntity(); WBParamEvaluator::SPEContext PEContext; PEContext.m_Entity = pEntity; m_EntityDefPE.Evaluate( PEContext ); const SimpleString EntityDef = ( m_EntityDefPE.GetType() == WBParamEvaluator::EPT_String ) ? m_EntityDefPE.GetString() : m_EntityDef; WBEntity* const pSpawnedEntity = WBWorld::GetInstance()->CreateEntity( EntityDef ); // Let subclasses handle the entity too PostSpawn( pSpawnedEntity ); } /*virtual*/ void WBActionRosaSpawnEntity::PostSpawn( WBEntity* const pSpawnedEntity ) { if( NULL == pSpawnedEntity ) { return; } WBEntity* const pOwnerEntity = GetTopmostOwner(); WBCompRosaTransform* const pSpawnedTransform = pSpawnedEntity->GetTransformComponent<WBCompRosaTransform>(); ASSERT( pSpawnedTransform ); WBCompOwner* const pSpawnedOwner = pSpawnedEntity->GetOwnerComponent<WBCompOwner>(); WBCompRosaLinkedEntities* const pLinkedEntities = WB_GETCOMP( pOwnerEntity, RosaLinkedEntities ); if( pSpawnedOwner ) { pSpawnedOwner->SetOwner( pOwnerEntity ); } Vector SpawnLocation; Vector SpawnImpulse; Angles SpawnOrientation; GetSpawnTransform( pSpawnedEntity, SpawnLocation, SpawnImpulse, SpawnOrientation ); pSpawnedTransform->SetInitialTransform( SpawnLocation, SpawnOrientation ); pSpawnedTransform->ApplyImpulse( SpawnImpulse ); if( pLinkedEntities && pLinkedEntities->GetLinkedEntities().Size() ) { WB_MAKE_EVENT( SetLinkedEntities, NULL ); WB_SET_AUTO( SetLinkedEntities, Pointer, LinkedEntities, const_cast<Array<WBEntityRef>*>( &pLinkedEntities->GetLinkedEntities() ) ); WB_DISPATCH_EVENT( GetEventManager(), SetLinkedEntities, pSpawnedEntity ); } // Notify instigator that we spawned this thing WB_MAKE_EVENT( OnSpawnedEntityAction, GetEntity() ); WB_SET_AUTO( OnSpawnedEntityAction, Entity, SpawnedEntity, pSpawnedEntity ); WB_DISPATCH_EVENT( GetEventManager(), OnSpawnedEntityAction, GetEntity() ); } // Borrowed (with simplifications) from WBCompRosaItem spawn drop code. Maybe unify? void WBActionRosaSpawnEntity::GetSpawnTransform( WBEntity* const pSpawnedEntity, Vector& OutLocation, Vector& OutImpulse, Angles& OutOrientation ) { WBEntity* const pActionEntity = GetEntity(); DEVASSERT( pActionEntity ); WBEntity* const pOwnerEntity = GetTopmostOwner(); DEVASSERT( pOwnerEntity ); WBCompRosaTransform* const pTransform = pOwnerEntity->GetTransformComponent<WBCompRosaTransform>(); DEVASSERT( pTransform ); WBCompRosaCamera* const pCamera = WB_GETCOMP( pOwnerEntity, RosaCamera ); WBCompRosaHeadTracker* const pHeadTracker = WB_GETCOMP( pOwnerEntity, RosaHeadTracker ); const bool UseHeadTracker = m_UseHeadTracker && pHeadTracker; WBParamEvaluator::SPEContext PEContext; PEContext.m_Entity = pActionEntity; m_LocationPE.Evaluate( PEContext ); m_OrientationPE.Evaluate( PEContext ); // Get location { if( m_LocationPE.HasRoot() ) { OutLocation = m_LocationPE.GetVector(); } else if( UseHeadTracker ) { OutLocation = pHeadTracker->GetEyesLocation(); } else { OutLocation = pTransform->GetLocation(); if( pCamera ) { pCamera->ModifyTranslation( WBCompRosaCamera::EVM_All, OutLocation ); } } OutLocation.z += m_SpawnOffsetZ; WBCompRosaCollision* const pCollision = WB_GETCOMP( pSpawnedEntity, RosaCollision ); if( pCollision ) { CollisionInfo Info; Info.m_In_CollideWorld = true; Info.m_In_CollideEntities = true; Info.m_In_CollidingEntity = pOwnerEntity; // Using the owner, not the spawned entity (which should be at origin at the moment) Info.m_In_UserFlags = EECF_EntityCollision; RosaWorld* const pWorld = RosaFramework::GetInstance()->GetWorld(); pWorld->FindSpot( OutLocation, pCollision->GetExtents(), Info ); } } // Get orientation { if( m_OrientationPE.HasRoot() ) { OutOrientation = m_OrientationPE.GetAngles(); } else if( UseHeadTracker ) { OutOrientation = pHeadTracker->GetLookDirection().ToAngles(); } else { OutOrientation = pTransform->GetOrientation(); if( pCamera ) { pCamera->ModifyOrientation( WBCompRosaCamera::EVM_All, OutOrientation ); } } if( m_YawOnly ) { OutOrientation.Pitch = 0.0f; OutOrientation.Roll = 0.0f; } } // Get impulse { if( UseHeadTracker ) { OutImpulse = pHeadTracker->GetLookDirection(); } else { OutImpulse = OutOrientation.ToVector(); } OutImpulse.z += m_SpawnImpulseZ; OutImpulse.FastNormalize(); m_SpawnImpulsePE.Evaluate( PEContext ); const float SpawnImpulseSize = ( m_SpawnImpulsePE.GetType() == WBParamEvaluator::EPT_Float ) ? m_SpawnImpulsePE.GetFloat() : m_SpawnImpulse; OutImpulse *= SpawnImpulseSize; } }
30.535565
146
0.758427
[ "vector" ]
69860c1bb008c2b53eaae88973294a80a7234f06
18,934
cpp
C++
Super Monaco GP/Road.cpp
gerardpf2/SuperMonacoGP
dbb46ffff701e9781d7975586a82ea8c56f8dd9f
[ "MIT" ]
null
null
null
Super Monaco GP/Road.cpp
gerardpf2/SuperMonacoGP
dbb46ffff701e9781d7975586a82ea8c56f8dd9f
[ "MIT" ]
null
null
null
Super Monaco GP/Road.cpp
gerardpf2/SuperMonacoGP
dbb46ffff701e9781d7975586a82ea8c56f8dd9f
[ "MIT" ]
null
null
null
#include "Road.h" #include "Utils.h" #include "Camera.h" #include "Segment.h" #include "GameObject.h" #include "ModuleJson.h" #include "ModuleTexture.h" using namespace std; using namespace rapidjson; Road::Road() { } Road::~Road() { } void Road::load(const char* jsonPath, const ModuleJson* moduleJson, ModuleTexture* moduleTexture) { assert(jsonPath); assert(moduleJson); unload(moduleTexture); Document jsonDocument; moduleJson->read(jsonPath, jsonDocument); // Length setLength(jsonDocument["length"].GetFloat()); // Hills addHills(jsonDocument["hills"]); // Curves addCurves(jsonDocument["curves"]); // RumbleColors setRumbleColors(jsonDocument["rumbleColors"]); // GameObjectDefinitions addGameObjectDefinitions(jsonDocument["gameObjectDefinitions"]); // Background setBackgroundDefinition(jsonDocument["background"], moduleTexture); } void Road::unload(ModuleTexture* moduleTexture) { for(int i = (int)segments.size() - 1; i >= 0; --i) { delete segments[i]; segments[i] = nullptr; } segments.clear(); for(int i = (int)rumbleColors.size() - 1; i >= 0; --i) { delete rumbleColors[i]; rumbleColors[i] = nullptr; } rumbleColors.clear(); for(int i = (int)gameObjectDefinitions.size() - 1; i >= 0; --i) { delete gameObjectDefinitions[i]; gameObjectDefinitions[i] = nullptr; } gameObjectDefinitions.clear(); if(roadBackgroundDefinition) { assert(moduleTexture); moduleTexture->unload(roadBackgroundDefinition->textureGroupId); delete roadBackgroundDefinition; roadBackgroundDefinition = nullptr; } } float Road::getLength() const { return length; } Segment* Road::getSegmentAtZ(float z) const { return getSegment((int)(z / SEGMENT_LENGTH)); } uint Road::getGameObjectsCount() const { return (uint)gameObjectDefinitions.size(); } const std::vector<RoadGameObjectDefinition*>* Road::getGameObjectDefinitions() const { return &gameObjectDefinitions; } const RoadBackgroundDefinition* Road::getRoadBackgroundDefinition() const { return roadBackgroundDefinition; } void Road::findGameObjectsFront(float z, float distance, list<const GameObject*>& gameObjects) const { Segment* initialSegment = getSegmentAtZ(z); assert(initialSegment); int index = initialSegment->getIndex(); int nSegments = (int)(distance / SEGMENT_LENGTH); for(int i = 0; i < nSegments; ++i) { Segment* segment = getSegment(index + i); assert(segment); assert(segment->getGameObjects()); for(const GameObject* gameObject : *segment->getGameObjects()) gameObjects.push_back(gameObject); } } void Road::render(const Camera* camera, const ModuleRenderer* moduleRenderer) const { assert(camera); if(!camera->getForward()) renderMirror(camera, moduleRenderer); else { assert(camera->getPosition()); float zRender0 = camera->getBasePositionZ(); float zRender1 = camera->getBasePositionZ() - SEGMENT_LENGTH; float zFirst = mod0L(camera->getPosition()->z, length); float zBase0 = mod0L(zRender0, length); float zBase1 = mod0L(zRender1, length); float zLast = mod0L(zFirst + DRAW_DISTANCE, length); const Segment* first = getSegmentAtZ(zFirst); const Segment* base0 = getSegmentAtZ(zBase0); const Segment* base1 = getSegmentAtZ(zBase1); const Segment* last = getSegmentAtZ(zLast); // Render from player segment (included) to last segment (excluded) renderForward(zBase0, base0, last, zRender0, camera, moduleRenderer); // Render from player segment (excluded) to first segment (excluded) renderBackward(zBase1, base1, first, zRender1, camera, moduleRenderer); assert(first); for(int i = N_SEGMENTS_DRAW - 1; i > 0; --i) { Segment* segment = getSegment(first->getIndex() + i); assert(segment); assert(segment->getGameObjects()); for(const GameObject* gameObject : *segment->getGameObjects()) { assert(gameObject); gameObject->render(camera, moduleRenderer); } } } } void Road::renderMirror(const Camera* camera, const ModuleRenderer* moduleRenderer) const { assert(camera); assert(camera->getPosition()); float zRender0 = camera->getBasePositionZ() + SEGMENT_LENGTH; float zRender1 = camera->getBasePositionZ(); float zFirst = mod0L(camera->getPosition()->z, length); float zBase0 = mod0L(zRender0, length); float zBase1 = mod0L(zRender1, length); float zLast = mod0L(zFirst - DRAW_DISTANCE, length); const Segment* first = getSegmentAtZ(zFirst); const Segment* base0 = getSegmentAtZ(zBase0); const Segment* base1 = getSegmentAtZ(zBase1); const Segment* last = getSegmentAtZ(zLast); // Render from player segment (excluded) to last segment (excluded) renderBackwardMirror(zBase1, base1, last, zRender1, camera, moduleRenderer); // Render from player segment (included) to first segment (excluded) renderForwardMirror(zBase0, base0, first, zRender0, camera, moduleRenderer); assert(last); for(int i = 1; i < N_SEGMENTS_DRAW; ++i) { Segment* segment = getSegment(last->getIndex() + i); assert(segment); assert(segment->getGameObjects()); for(const GameObject* gameObject : *segment->getGameObjects()) { assert(gameObject); gameObject->render(camera, moduleRenderer); } } } void Road::renderForward(float z, const Segment* first, const Segment* last, float renderZ, const Camera* camera, const ModuleRenderer* moduleRenderer) const { render(z, first, last, renderZ, 1.0f, -1.0f, false, 1, true, false, camera, moduleRenderer); } void Road::renderBackward(float z, const Segment* first, const Segment* last, float renderZ, const Camera* camera, const ModuleRenderer* moduleRenderer) const { render(z, first, last, renderZ, 0.0f, 1.0f, true, -1, false, false, camera, moduleRenderer); } void Road::renderForwardMirror(float z, const Segment* first, const Segment* last, float renderZ, const Camera* camera, const ModuleRenderer* moduleRenderer) const { render(z, first, last, renderZ, 1.0f, -1.0f, true, 1, false, true, camera, moduleRenderer); } void Road::renderBackwardMirror(float z, const Segment* first, const Segment* last, float renderZ, const Camera* camera, const ModuleRenderer* moduleRenderer) const { render(z, first, last, renderZ, 0.0f, 1.0f, false, -1, true, true, camera, moduleRenderer); } void Road::render(float z, const Segment* first, const Segment* last, float renderZ, float initialCurveMultiplier, float initialCurveDXMultiplier, bool invertZNearZFar, int increment, bool clip, bool mirror, const Camera* camera, const ModuleRenderer* moduleRenderer) const { assert(first); short maxWindowY = WINDOW_HEIGHT; float accZOffset = -z + first->getZNear(); Segment* current = getSegment(first->getIndex()); assert(current); float x = 0.0f; float dX = initialCurveMultiplier * current->getCurve() + initialCurveDXMultiplier * current->getCurve() * interpolate01(z, current->getZNear(), current->getZFar()); while(current != last) { assert(current); current->setXOffsetNear(invertZNearZFar ? x + dX : x); current->setXOffsetFar(invertZNearZFar ? x : x + dX); x += dX; dX += current->getCurve(); float currentZOffset = -current->getZNear() + accZOffset; accZOffset += increment * SEGMENT_LENGTH; current->setZOffset(renderZ + currentZOffset); current->setClipY(maxWindowY); current->render(camera, moduleRenderer, maxWindowY, clip, mirror); current = getSegment(current->getIndex() + increment); } } Segment* Road::getSegment(int index) const { index = mod0L(index, (int)segments.size()); assert((int)segments.size() > index); return segments[index]; } void Road::setLength(float length) { if(length < ROAD_MIN_LENGTH) length = ROAD_MIN_LENGTH; this->length = length; uint nSegments = (uint)ceilf(this->length / SEGMENT_LENGTH); segments.reserve(nSegments); for(uint i = 0; i < nSegments; ++i) segments.push_back(new Segment(i)); } void Road::addHills(const Value& value) const { for(SizeType i = 0; i < value.Size(); ++i) { if(value[i]["defAngle"].GetBool()) { float zStart = value[i]["zStart"].GetFloat(); float length = value[i]["length"].GetFloat(); float angle = value[i]["angle"].GetFloat(); addHill(zStart, length, angle); } else { float zStart = value[i]["zStart"].GetFloat(); float enterLength = value[i]["enterLength"].GetFloat(); float holdLength = value[i]["holdLength"].GetFloat(); float leaveLength = value[i]["leaveLength"].GetFloat(); float val = value[i]["value"].GetFloat(); addHill(zStart, enterLength, holdLength, leaveLength, val); } } } void Road::addHill(float zStart, float length, float angle) const { float enterLength = length * ROAD_HILL_ENTER_PERCENT; float holdLength = length * ROAD_HILL_HOLD_PERCENT; float leaveLength = length * ROAD_HILL_LEAVE_PERCENT; float value = (enterLength + holdLength / 2.0f) * tanf(degToRad(angle)); addHill(zStart, enterLength, holdLength, leaveLength, value); } void Road::addHill(float zStart, float enterLength, float holdLength, float leaveLength, float value) const { float zEnter = zStart; float zHold = zEnter + enterLength; float zLeave = zHold + holdLength; float zExit = zLeave + leaveLength; Segment* segmentEnter = getSegmentAtZ(zEnter); Segment* segmentHold = getSegmentAtZ(zHold); Segment* segmentLeave = getSegmentAtZ(zLeave); Segment* segmentExit = getSegmentAtZ(zExit); assert(segmentEnter); assert(segmentHold); assert(segmentLeave); assert(segmentExit); uint indexEnter = segmentEnter->getIndex(); uint indexHold = segmentHold->getIndex(); uint indexLeave = segmentLeave->getIndex(); uint indexExit = segmentExit->getIndex(); addHillEnter(indexEnter, indexHold, enterLength, value); addHillHold(indexHold, indexLeave, holdLength, value); addHillLeave(indexLeave, indexExit, leaveLength, value); } void Road::addHillEnter(uint indexStart, uint indexEnd, float enterLength, float value) const { float c = 0.0f; float nSegments = enterLength / SEGMENT_LENGTH; for(uint i = indexStart; i != indexEnd; ++c) { Segment* segment = getSegment(i); assert(segment); Segment* previousSegment = getSegment((int)segment->getIndex() - 1); assert(previousSegment); segment->setYNear(previousSegment->getYFar()); segment->setYFar(ease(0.0f, value, c / nSegments)); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::addHillHold(uint indexStart, uint indexEnd, float holdLength, float value) const { float c = 0.0f; float nSegments = holdLength / SEGMENT_LENGTH; for(uint i = indexStart; i != indexEnd; ++c) { Segment* segment = getSegment(i); assert(segment); Segment* previousSegment = getSegment((int)segment->getIndex() - 1); assert(previousSegment); segment->setYNear(previousSegment->getYFar()); segment->setYFar(ease(segment->getYNear(), value, c / nSegments)); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::addHillLeave(uint indexStart, uint indexEnd, float leaveLength, float value) const { float c = 0.0f; float nSegments = leaveLength / SEGMENT_LENGTH; for(uint i = indexStart; i != indexEnd; ++c) { Segment* segment = getSegment(i); assert(segment); Segment* previousSegment = getSegment((int)segment->getIndex() - 1); assert(previousSegment); segment->setYNear(previousSegment->getYFar()); segment->setYFar(ease(value, 0.0f, c / nSegments)); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::addCurves(const Value& value) const { for(SizeType i = 0; i < value.Size(); ++i) { if(value[i]["defAngle"].GetBool()) { float zStart = value[i]["zStart"].GetFloat(); float length = value[i]["length"].GetFloat(); float angle = value[i]["angle"].GetFloat(); addCurve(zStart, length, angle); } else { float zStart = value[i]["zStart"].GetFloat(); float enterLength = value[i]["enterLength"].GetFloat(); float holdLength = value[i]["holdLength"].GetFloat(); float leaveLength = value[i]["leaveLength"].GetFloat(); float val = value[i]["value"].GetFloat(); addCurve(zStart, enterLength, holdLength, leaveLength, val); } } } void Road::addCurve(float zStart, float length, float angle) const { float enterLength = length * ROAD_CURVE_ENTER_PERCENT; float holdLength = length * ROAD_CURVE_HOLD_PERCENT; float leaveLength = length * ROAD_CURVE_LEAVE_PERCENT; float value = length * sinf(degToRad(angle)) / powf(length / SEGMENT_LENGTH, 2.0f); addCurve(zStart, enterLength, holdLength, leaveLength, value); } void Road::addCurve(float zStart, float enterLength, float holdLength, float leaveLength, float value) const { float zEnter = zStart; float zHold = zEnter + enterLength; float zLeave = zHold + holdLength; float zExit = zLeave + leaveLength; Segment* segmentEnter = getSegmentAtZ(zEnter); Segment* segmentHold = getSegmentAtZ(zHold); Segment* segmentLeave = getSegmentAtZ(zLeave); Segment* segmentExit = getSegmentAtZ(zExit); assert(segmentEnter); assert(segmentHold); assert(segmentLeave); assert(segmentExit); uint indexEnter = segmentEnter->getIndex(); uint indexHold = segmentHold->getIndex(); uint indexLeave = segmentLeave->getIndex(); uint indexExit = segmentExit->getIndex(); addCurveEnter(indexEnter, indexHold, enterLength, value); addCurveHold(indexHold, indexLeave, holdLength, value); addCurveLeave(indexLeave, indexExit, leaveLength, value); } void Road::addCurveEnter(uint indexStart, uint indexEnd, float enterLength, float value) const { float c = 0.0f; float nSegments = enterLength / SEGMENT_LENGTH; for(uint i = indexStart; i != indexEnd; ++c) { Segment* segment = getSegment(i); assert(segment); segment->setCurve(ease(0.0f, value, c / nSegments)); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::addCurveHold(uint indexStart, uint indexEnd, float holdLength, float value) const { for(uint i = indexStart; i != indexEnd;) { Segment* segment = getSegment(i); assert(segment); segment->setCurve(value); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::addCurveLeave(uint indexStart, uint indexEnd, float leaveLength, float value) const { float c = 0.0f; float nSegments = leaveLength / SEGMENT_LENGTH; for(uint i = indexStart; i != indexEnd; ++c) { Segment* segment = getSegment(i); assert(segment); segment->setCurve(ease(value, 0.0f, c / nSegments)); Segment* nextSegment = getSegment(i + 1); assert(nextSegment); i = nextSegment->getIndex(); } } void Road::setRumbleColors(const Value& value) { uint color0 = RGBAToUint(value[0]["r"].GetUint(), value[0]["g"].GetUint(), value[0]["b"].GetUint(), value[0]["a"].GetUint()); uint color1 = RGBAToUint(value[1]["r"].GetUint(), value[1]["g"].GetUint(), value[1]["b"].GetUint(), value[1]["a"].GetUint()); uint color2 = RGBAToUint(value[2]["r"].GetUint(), value[2]["g"].GetUint(), value[2]["b"].GetUint(), value[2]["a"].GetUint()); uint color3 = RGBAToUint(value[3]["r"].GetUint(), value[3]["g"].GetUint(), value[3]["b"].GetUint(), value[3]["a"].GetUint()); uint color4 = RGBAToUint(value[4]["r"].GetUint(), value[4]["g"].GetUint(), value[4]["b"].GetUint(), value[4]["a"].GetUint()); uint color5 = RGBAToUint(value[5]["r"].GetUint(), value[5]["g"].GetUint(), value[5]["b"].GetUint(), value[5]["a"].GetUint()); uint color6 = RGBAToUint(value[6]["r"].GetUint(), value[6]["g"].GetUint(), value[6]["b"].GetUint(), value[6]["a"].GetUint()); uint color7 = RGBAToUint(value[7]["r"].GetUint(), value[7]["g"].GetUint(), value[7]["b"].GetUint(), value[7]["a"].GetUint()); uint color8 = RGBAToUint(value[8]["r"].GetUint(), value[8]["g"].GetUint(), value[8]["b"].GetUint(), value[8]["a"].GetUint()); uint color9 = RGBAToUint(value[9]["r"].GetUint(), value[9]["g"].GetUint(), value[9]["b"].GetUint(), value[9]["a"].GetUint()); const int nColors = 2; uint colors0[nColors]{ color0, color1 }; uint colors1[nColors]{ color2, color3 }; uint colors2[nColors]{ color4, color5 }; uint colors3[nColors]{ color6, color7 }; uint colors4[nColors]{ color8, color9 }; uint colorsIndex = 0; uint nRumbleColors = (uint)ceilf(length / ROAD_RUMBLE_HEIGHT); rumbleColors.reserve(nRumbleColors); for(uint i = 0; i < nRumbleColors; ++i) { assert(nColors > colorsIndex); rumbleColors.push_back(new RumbleColors{ colors0[colorsIndex], colors1[colorsIndex], colors2[colorsIndex], colors3[colorsIndex], colors4[colorsIndex] }); colorsIndex = (colorsIndex + 1) % nColors; } if(!rumbleColors.empty()) { assert(!rumbleColors.empty()); RumbleColors* lastRumbleColors = rumbleColors[rumbleColors.size() - 1]; assert(lastRumbleColors); lastRumbleColors->b = lastRumbleColors->c = lastRumbleColors->d = lastRumbleColors->e = color3; } uint rumbleColorsIndex = 0; uint currentSegmentPerRumble = 0; uint segmentsPerRumble = (uint)(ROAD_RUMBLE_HEIGHT / SEGMENT_LENGTH); for(Segment* segment : segments) { assert(segment); assert(rumbleColors.size() > rumbleColorsIndex); segment->setRumbleColors(rumbleColors[rumbleColorsIndex]); if(++currentSegmentPerRumble == segmentsPerRumble) { ++rumbleColorsIndex; currentSegmentPerRumble = 0; } } } void Road::addGameObjectDefinitions(const rapidjson::Value& value) { gameObjectDefinitions.reserve(value.Size()); for(SizeType i = 0; i < value.Size(); ++i) { // id, offsetX, initialPosition, incPosition, n uint id = value[i]["id"].GetUint(); float offsetX = value[i]["offsetX"].GetFloat(); const Value& initialPositionJson = value[i]["initialPosition"]; const Value& incPositionJson = value[i]["incPosition"]; uint n = value[i]["n"].GetUint(); // initial x, y, z float x0 = initialPositionJson["x"].GetFloat(); float y0 = initialPositionJson["y"].GetFloat(); float z0 = initialPositionJson["z"].GetFloat(); // inc x, y, z float x1 = incPositionJson["x"].GetFloat(); float y1 = incPositionJson["y"].GetFloat(); float z1 = incPositionJson["z"].GetFloat(); for(uint i = 0; i < n; ++i) { gameObjectDefinitions.push_back(new RoadGameObjectDefinition{ id, offsetX, WorldPosition{ x0, y0, z0 } }); x0 += x1; y0 += y1; z0 += z1; } } } void Road::setBackgroundDefinition(const rapidjson::Value& value, ModuleTexture* moduleTexture) { assert(moduleTexture); const char* textureGroupPath = value["textureGroupPath"].GetString(); uint textureId = value["textureId"].GetUint(); uint textureSkyId = value["textureSkyId"].GetUint(); uint textureGroundId = value["textureGroundId"].GetUint(); roadBackgroundDefinition = new RoadBackgroundDefinition; roadBackgroundDefinition->textureGroupId = moduleTexture->load(textureGroupPath); roadBackgroundDefinition->textureId = textureId; roadBackgroundDefinition->textureSkyId = textureSkyId; roadBackgroundDefinition->textureGroundId = textureGroundId; }
28.175595
273
0.711736
[ "render", "vector" ]
7e39210e920bcd6a5614f99ce955232f0ce8e1d3
1,571
cpp
C++
Problems/IOI/2013/Full.Robots.cpp
metehkaya/Algo-Archive
03b5fdcf06f84a03125c57762c36a4e03ca6e756
[ "MIT" ]
2
2020-07-20T06:40:22.000Z
2021-11-20T01:23:26.000Z
Problems/IOI/2013/Full.Robots.cpp
metehkaya/Algo-Archive
03b5fdcf06f84a03125c57762c36a4e03ca6e756
[ "MIT" ]
null
null
null
Problems/IOI/2013/Full.Robots.cpp
metehkaya/Algo-Archive
03b5fdcf06f84a03125c57762c36a4e03ca6e756
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> #include "robots.h" #define maxn 1050000 #define pb push_back using namespace std; struct item { int w,s,type; item(int _w , int _s , int _type) { w = _w; s = _s; type = _type; } }; bool comp(const item& a , const item& b) { if(a.w != b.w) return a.w < b.w; return a.type > b.type; } int N,n,a,b; vector<int> y; vector<item> ar; bool check(int d) { priority_queue<int> heap; for( int i = 0 ; i < N ; i++ ) { if(ar[i].type == 0) heap.push(ar[i].s); else { int cnt = d; while(cnt > 0 && !heap.empty()) { cnt--; heap.pop(); } } } vector<int> v; while(!heap.empty()) { v.pb(heap.top()); heap.pop(); } reverse(v.begin(),v.end()); int idx = 0 , vs = v.size(); for( int i = 0 ; i < b ; i++ ) { int cnt = d; while(cnt > 0 && idx < vs && v[idx] < y[i]) { cnt--; idx++; } } return (idx == vs); } int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { a = A; b = B; n = T; N = n+a; for( int i = 0 ; i < b ; i++ ) y.pb(Y[i]); sort(y.begin(),y.end()); for( int i = 0 ; i < n ; i++ ) ar.pb(item(W[i],S[i],0)); for( int i = 0 ; i < a ; i++ ) ar.pb(item(X[i],-1,1)); sort(ar.begin(),ar.end(),comp); int l = 1 , r = n , ans = -1; while(l <= r) { int mid = (l+r)>>1; if(check(mid)) ans = mid , r = mid-1; else l = mid+1; } return ans; } int main() { int a = 3 , b = 2 , t = 10; int x[3] = {6,2,9}; int y[2] = {4,7}; int w[10] = {4,8,2,7,1,5,3,8,7,10}; int s[10] = {6,5,3,9,8,1,3,7,6,5}; printf("%d\n",putaway(a,b,t,x,y,w,s)); return 0; }
17.651685
70
0.485678
[ "vector" ]
7e3edd070fe86fa1a3ff10953eb27469a8711a5c
1,711
cpp
C++
aws-cpp-sdk-qldb/source/model/S3ExportConfiguration.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-qldb/source/model/S3ExportConfiguration.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-qldb/source/model/S3ExportConfiguration.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/qldb/model/S3ExportConfiguration.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace QLDB { namespace Model { S3ExportConfiguration::S3ExportConfiguration() : m_bucketHasBeenSet(false), m_prefixHasBeenSet(false), m_encryptionConfigurationHasBeenSet(false) { } S3ExportConfiguration::S3ExportConfiguration(JsonView jsonValue) : m_bucketHasBeenSet(false), m_prefixHasBeenSet(false), m_encryptionConfigurationHasBeenSet(false) { *this = jsonValue; } S3ExportConfiguration& S3ExportConfiguration::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Bucket")) { m_bucket = jsonValue.GetString("Bucket"); m_bucketHasBeenSet = true; } if(jsonValue.ValueExists("Prefix")) { m_prefix = jsonValue.GetString("Prefix"); m_prefixHasBeenSet = true; } if(jsonValue.ValueExists("EncryptionConfiguration")) { m_encryptionConfiguration = jsonValue.GetObject("EncryptionConfiguration"); m_encryptionConfigurationHasBeenSet = true; } return *this; } JsonValue S3ExportConfiguration::Jsonize() const { JsonValue payload; if(m_bucketHasBeenSet) { payload.WithString("Bucket", m_bucket); } if(m_prefixHasBeenSet) { payload.WithString("Prefix", m_prefix); } if(m_encryptionConfigurationHasBeenSet) { payload.WithObject("EncryptionConfiguration", m_encryptionConfiguration.Jsonize()); } return payload; } } // namespace Model } // namespace QLDB } // namespace Aws
19.011111
86
0.736411
[ "model" ]
7e45bb1b63cd1c0fbb35e906226b60cd75fc5dce
3,450
cc
C++
src/render/vertex_buffer.cc
YahorSubach/vulkan_visual_facade
cb6230b6df602ebea74b0ca311220ba0fab68aac
[ "MIT" ]
null
null
null
src/render/vertex_buffer.cc
YahorSubach/vulkan_visual_facade
cb6230b6df602ebea74b0ca311220ba0fab68aac
[ "MIT" ]
null
null
null
src/render/vertex_buffer.cc
YahorSubach/vulkan_visual_facade
cb6230b6df602ebea74b0ca311220ba0fab68aac
[ "MIT" ]
null
null
null
//#include "vertex_buffer.h" // //render::VertexBuffer::VertexBuffer(const VkDevice& device, const VkPhysicalDevice& physical_device, const std::vector<Vertex>& vertices, const std::vector<uint32_t>& queue_famaly_indeces) :RenderObjBase(device), physical_device_(physical_device) //{ // //VkBufferCreateInfo buffer_info{}; // //buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; // //buffer_info.size = sizeof(vertices[0]) * vertices.size(); // //buffer_info.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; // //buffer_info.sharingMode = VK_SHARING_MODE_CONCURRENT; // //buffer_info.queueFamilyIndexCount = queue_famaly_indeces.size(); // //buffer_info.pQueueFamilyIndices = queue_famaly_indeces.data(); // // //if (vkCreateBuffer(device, &buffer_info, nullptr, &vertex_buffer_) != VK_SUCCESS) { // // throw std::runtime_error("failed to create vertex buffer!"); // //} // // //VkMemoryRequirements memory_requirements; // //vkGetBufferMemoryRequirements(device, vertex_buffer_, &memory_requirements); // // // // ////uint32_t memory_type_index = GetMemoryTypeIndex(memory_requirements.memoryTypeBits, ); // // ////for (uint32_t i = 0; i < memory_properties.memoryTypeCount; i++) { // //// if ((memory_requirements.memoryTypeBits & (1 << i) ) && // //// (memory_properties.memoryTypes[i].propertyFlags & (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) == (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT))) { // //// memory_type_index = i; // //// } // ////} // // //VkMemoryAllocateInfo allocInfo{}; // //allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; // //allocInfo.allocationSize = memory_requirements.size; // //allocInfo.memoryTypeIndex = memory_type_index; // // //if (vkAllocateMemory(device, &allocInfo, nullptr, &vertex_buffer_memory_) != VK_SUCCESS) { // // throw std::runtime_error("failed to allocate vertex buffer memory!"); // //} // // //vkBindBufferMemory(device, vertex_buffer_, vertex_buffer_memory_, 0); // // //void* data; // //vkMapMemory(device, vertex_buffer_memory_, 0, buffer_info.size, 0, &data); // // //memcpy(data, vertices.data(), (size_t)buffer_info.size); // // //vkUnmapMemory(device, vertex_buffer_memory_); // // vertex_num_ = 0;// vertices.size(); //} // //void render::VertexBuffer::ClearCommandBuffers() //{ //} // //const VkBuffer& render::VertexBuffer::GetVertexBuffer() const //{ // return vertex_buffer_; //} // //uint32_t render::VertexBuffer::GetVertexNum() const //{ // return vertex_num_; //} // //render::VertexBuffer::~VertexBuffer() //{ // vkDestroyBuffer(device_, vertex_buffer_, nullptr); // vkFreeMemory(device_, vertex_buffer_memory_, nullptr); //} // //uint32_t render::VertexBuffer::GetMemoryTypeIndex(uint32_t acceptable_memory_types_bits, VkMemoryPropertyFlags memory_flags) const //{ // VkPhysicalDeviceMemoryProperties memory_properties; // vkGetPhysicalDeviceMemoryProperties(physical_device_, &memory_properties); // // uint32_t memory_type_index; // // for (uint32_t i = 0; i < memory_properties.memoryTypeCount; i++) { // if ((acceptable_memory_types_bits & (1 << i)) && // (memory_properties.memoryTypes[i].propertyFlags & memory_flags) == memory_flags) { // memory_type_index = i; // } // } // // return memory_type_index; //}
39.204545
247
0.696232
[ "render", "vector" ]
7e461a953ef9a5eba4b527bd3941e12ca7f71564
803
cpp
C++
Exercise_12/12.3_linear_search.cpp
YJDave/balagurusamy_solution_cpp
cc528dd99a1517706e9ee6560593e3c37251e443
[ "MIT" ]
21
2017-12-11T07:24:57.000Z
2022-03-17T08:43:24.000Z
Exercise_12/12.3_linear_search.cpp
YJDave/balagurusamy_solution_cpp
cc528dd99a1517706e9ee6560593e3c37251e443
[ "MIT" ]
4
2017-12-12T16:36:46.000Z
2020-06-21T22:54:18.000Z
Exercise_12/12.3_linear_search.cpp
YJDave/balagurusamy_solution_cpp
cc528dd99a1517706e9ee6560593e3c37251e443
[ "MIT" ]
19
2017-09-23T13:50:25.000Z
2021-11-16T08:20:19.000Z
#ifdef _WIN32 #include<iostream.h> #include<conio.h> #endif #ifdef linux #include<iostream> #include<curses.h> #endif using namespace std; const int size=5; template <class T> class vector { T v[size]; public: vector(){} vector(T *b); lsearch(vector<T> &m,int key); }; template <class T> vector<T>::vector(T *b) { for(int i=0;i<size;i++) v[i]=b[i]; } template<class T> vector<T>::lsearch(vector<T> &m,int key) { for(int k=0;k<5;k++) { if(key==m.v[k]) return k; } return -1; } int main() { int x[size]={5,7,3,9,8}; vector<int> v1; int key,flag; //clrscr(); v1=x; cout<<"Enter Key to Search"; cin>>key; flag=v1.lsearch(v1,key); if(flag==-1) cout<<"Element not Found.."<<endl; else cout<<"Element is at "<<flag+1<<"th Position"<<endl; //getch(); }
13.844828
54
0.597758
[ "vector" ]
7e4f4a16dd61bb2122b9676e197d172540ab0648
1,620
cpp
C++
graphics/cgal/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
hlzz/dotfiles
0591f71230c919c827ba569099eb3b75897e163e
[ "BSD-3-Clause" ]
4
2016-03-30T14:31:52.000Z
2019-02-02T05:01:32.000Z
graphics/cgal/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
hlzz/dotfiles
0591f71230c919c827ba569099eb3b75897e163e
[ "BSD-3-Clause" ]
null
null
null
graphics/cgal/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
hlzz/dotfiles
0591f71230c919c827ba569099eb3b75897e163e
[ "BSD-3-Clause" ]
null
null
null
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Mesh_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_criteria_3.h> #include <CGAL/Polyhedral_mesh_domain_with_features_3.h> #include <CGAL/make_mesh_3.h> // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain; // Triangulation #ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Mesh_triangulation_3< Mesh_domain, CGAL::Kernel_traits<Mesh_domain>::Kernel, // Same as sequential CGAL::Parallel_tag // Tag to activate parallelism >::type Tr; #else typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr; #endif typedef CGAL::Mesh_complex_3_in_triangulation_3< Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; // Criteria typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; // To avoid verbose function and named parameters call using namespace CGAL::parameters; int main(int argc, char*argv[]) { const char* fname = (argc>1)?argv[1]:"data/fandisk.off"; // Create domain Mesh_domain domain(fname); // Get sharp features domain.detect_features(); // Mesh criteria Mesh_criteria criteria(edge_size = 0.025, facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, cell_radius_edge_ratio = 3, cell_size = 0.05); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria); // Output std::ofstream medit_file("out.mesh"); c3t3.output_to_medit(medit_file); }
30
85
0.735185
[ "mesh" ]
7e5581b173f90081be49a540df4d8a45df10411a
828
cpp
C++
src/get_Random_points.cpp
YuYuCong/Tennis-Collection-Robot
443e2a3925bdc0ab599519795bdeb7f75eade95c
[ "CC0-1.0" ]
12
2018-08-28T02:40:49.000Z
2021-07-04T12:07:05.000Z
src/get_Random_points.cpp
sunnieeee/Tennis-Collection-Robot
0868ffa114ffcd6bdcdd0e0c85c1094f919adec3
[ "CC0-1.0" ]
null
null
null
src/get_Random_points.cpp
sunnieeee/Tennis-Collection-Robot
0868ffa114ffcd6bdcdd0e0c85c1094f919adec3
[ "CC0-1.0" ]
7
2018-08-17T04:30:33.000Z
2021-10-16T06:23:06.000Z
#include"function_declare.h" /// Function Definitions /** * @function get_Random_points * @author William Yu * @brief 由于没有足够的网球图片测试路径规划,可以使用此函数生成一批随机点,模拟网球目标 */ void get_Random_points(vector<cv::Point>& Random_points, int NUMBER) { //-- create a random object (RNG) RNG rng; rng = RNG(getTickCount()); Point point = Point(0, 0); //2017-10-30,修改随机点区域限制 //int x_min = - window_width; //int x_max = window_width; //int y_min = - window_height; //int y_max = window_height; //2017-10-30,添加偏置 int x_min = - window_width / 2; int x_max = window_width / 2; int y_min = 0; int y_max = window_height; for (int i = 0; i < NUMBER; i++) { Point center; center.x = rng.uniform(x_min, x_max); center.y = rng.uniform(y_min, y_max); Random_points.push_back(center); } }
22.378378
69
0.647343
[ "object", "vector" ]
7e5985f1a81463637273bbd822a6fa36c46c1608
655,183
cpp
C++
Flatten/GA/c3ga.cpp
mauriciocele/arap-svd
bbefe4b0f18d7cd5e834b4c54e518f0d70f49565
[ "MIT" ]
4
2021-01-05T15:14:34.000Z
2021-09-08T14:08:49.000Z
Flatten/GA/c3ga.cpp
mauriciocele/arap-svd
bbefe4b0f18d7cd5e834b4c54e518f0d70f49565
[ "MIT" ]
null
null
null
Flatten/GA/c3ga.cpp
mauriciocele/arap-svd
bbefe4b0f18d7cd5e834b4c54e518f0d70f49565
[ "MIT" ]
null
null
null
// Generated on 2007-08-08 10:16:05 by G2 0.1 from 'E:\gasandbox\ga_sandbox\libgasandbox\c3ga.gs2' // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <string.h> #include "c3ga.h" // pre_cpp_include namespace c3ga { // The dimension of the space: const int mv_spaceDim = 5; // Is the metric of the space Euclidean? const bool mv_metricEuclidean = false; // This array can be used to lookup the number of coordinates for a grade part of a general multivector const int mv_gradeSize[6] = { 1, 5, 10, 10, 5, 1 }; // This array can be used to lookup the number of coordinates based on a grade usage bitmap const int mv_size[64] = { 0, 1, 5, 6, 10, 11, 15, 16, 10, 11, 15, 16, 20, 21, 25, 26, 5, 6, 10, 11, 15, 16, 20, 21, 15, 16, 20, 21, 25, 26, 30, 31, 1, 2, 6, 7, 11, 12, 16, 17, 11, 12, 16, 17, 21, 22, 26, 27, 6, 7, 11, 12, 16, 17, 21, 22, 16, 17, 21, 22, 26, 27, 31, 32 }; // This array of ASCIIZ strings contains the names of the basis vectors const char *mv_basisVectorNames[5] = { "no", "e1", "e2", "e3", "ni" }; // This array of integers contains the order of basis elements in the general multivector const int mv_basisElements[32][6] = { {-1} , {0, -1} , {1, -1} , {2, -1} , {3, -1} , {4, -1} , {0, 1, -1} , {0, 2, -1} , {0, 3, -1} , {1, 2, -1} , {2, 3, -1} , {1, 3, -1} , {1, 4, -1} , {2, 4, -1} , {3, 4, -1} , {0, 4, -1} , {2, 3, 4, -1} , {1, 3, 4, -1} , {1, 2, 4, -1} , {0, 3, 4, -1} , {0, 1, 4, -1} , {0, 2, 4, -1} , {0, 2, 3, -1} , {0, 1, 3, -1} , {0, 1, 2, -1} , {1, 2, 3, -1} , {1, 2, 3, 4, -1} , {0, 2, 3, 4, -1} , {0, 1, 3, 4, -1} , {0, 1, 2, 4, -1} , {0, 1, 2, 3, -1} , {0, 1, 2, 3, 4, -1} }; // This array of integers contains the 'sign' (even/odd permutation of the canonical order) of basis elements in the general multivector // Use it to answer 'what is the permutation of the coordinate at index [x]'? const double mv_basisElementSignByIndex[32] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0 }; // This array of integers contains the 'sign' (even/odd permutation of canonical order) of basis elements in the general multivector // Use it to answer 'what is the permutation of the coordinate of bitmap [x]'? const double mv_basisElementSignByBitmap[32] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0 }; // This array of integers contains the order of basis elements in the general multivector // Use it to answer: 'at what index do I find basis element [x] (x = basis vector bitmap)? const int mv_basisElementIndexByBitmap[32] = { 0, 1, 2, 6, 3, 7, 9, 24, 4, 8, 11, 23, 10, 22, 25, 30, 5, 15, 12, 20, 13, 21, 18, 29, 14, 19, 17, 28, 16, 27, 26, 31 }; // This array of integers contains the indices of basis elements in the general multivector // Use it to answer: 'what basis element do I find at index [x]'? const int mv_basisElementBitmapByIndex[32] = { 0, 1, 2, 4, 8, 16, 3, 5, 9, 6, 12, 10, 18, 20, 24, 17, 28, 26, 22, 25, 19, 21, 13, 11, 7, 14, 30, 29, 27, 23, 15, 31 }; // This array of grade of each basis elements in the general multivector // Use it to answer: 'what is the grade of basis element bitmap [x]'? extern const int mv_basisElementGradeByBitmap[32] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5 }; // These strings determine how the output of string() is formatted. // You can alter them at runtime using mv_setStringFormat(). const char *mv_string_fp = "%2.2f"; const char *mv_string_start = ""; const char *mv_string_end = ""; const char *mv_string_mul = "*"; const char *mv_string_wedge = "^"; const char *mv_string_plus = " + "; const char *mv_string_minus = " - "; void mv_setStringFormat(const char *what, const char *format) { if (!strcmp(what, "fp")) mv_string_fp = (format) ? format : "%2.2f"; else if (!strcmp(what, "start")) mv_string_start = (format) ? format : ""; else if (!strcmp(what, "end")) mv_string_end = (format) ? format : ""; else if (!strcmp(what, "mul")) mv_string_mul = (format) ? format : "*"; else if (!strcmp(what, "wedge")) mv_string_wedge = (format) ? format : "^"; else if (!strcmp(what, "plus")) mv_string_plus = (format) ? format : " + "; else if (!strcmp(what, "minus")) mv_string_minus = (format) ? format : " - "; else { char msg[1024]; sprintf(msg, "invalid argument to mv_setStringFormat(): %s", what); mv_throw_exception(msg, MV_EXCEPTION_WARNING); } } namespace g2Profiling { // Just a bunch of dummy functions: // Profiling is disabled, but having these functions around // simplifies a lot. void profile(unsigned int funcIdx, unsigned short storageTypeIdx, unsigned short nbArg, unsigned short argType[]) { } void reset() { } void save(const char *filename /*= "E:\\gasandbox\\ga_sandbox\\libgasandbox\\c3ga.gp2"*/, bool append /*= false*/) { } void init(const char *filename /*= "E:\\gasandbox\\ga_sandbox\\libgasandbox\\c3ga.gp2"*/, const char *hostName /*= "localhost"*/, int port /*= 7693*/) { } } // end of namespace g2Profiling // todo: for all storage formats, generate constants // set to 0 void mv::set() { // set grade usage gu(0); } // set to copy void mv::set(const mv &arg1) { // copy grade usage gu(arg1.gu()); // copy coordinates mv_memcpy(m_c, arg1.m_c, mv_size[gu()]); } // set to scalar void mv::set(Float scalarVal) { // set grade usage gu(1); // set type (if profile) // set coordinate m_c[0] = scalarVal; } // set to coordinates void mv::set(unsigned int gradeUsage, const Float *coordinates) { // set grade usage gu(gradeUsage); // set coordinates mv_memcpy(m_c, coordinates, mv_size[gu()]); } // set to 1 coordinates void mv::set(unsigned int gradeUsage, Float c0 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 1) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; } // set to 2 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 2) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; } // set to 3 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 3) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; } // set to 4 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 4) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; } // set to 5 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 5) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; } // set to 6 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 6) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; } // set to 7 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 7) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; } // set to 8 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 8) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; } // set to 9 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 9) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; } // set to 10 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 10) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; } // set to 11 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 11) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; } // set to 12 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 12) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; } // set to 13 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 13) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; } // set to 14 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 14) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; } // set to 15 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 15) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; } // set to 16 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 16) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; } // set to 17 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 17) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; } // set to 18 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 18) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; } // set to 19 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 19) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; } // set to 20 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 20) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; } // set to 21 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 21) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; } // set to 22 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 22) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; } // set to 23 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 23) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; } // set to 24 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 24) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; } // set to 25 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 25) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; } // set to 26 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 26) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; } // set to 27 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 27) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; } // set to 28 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26, Float c27 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 28) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; m_c[27] = c27; } // set to 29 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26, Float c27, Float c28 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 29) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; m_c[27] = c27; m_c[28] = c28; } // set to 30 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26, Float c27, Float c28, Float c29 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 30) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; m_c[27] = c27; m_c[28] = c28; m_c[29] = c29; } // set to 31 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26, Float c27, Float c28, Float c29, Float c30 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 31) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; m_c[27] = c27; m_c[28] = c28; m_c[29] = c29; m_c[30] = c30; } // set to 32 coordinates void mv::set(unsigned int gradeUsage, Float c0, Float c1, Float c2, Float c3, Float c4, Float c5, Float c6, Float c7, Float c8, Float c9, Float c10, Float c11, Float c12, Float c13, Float c14, Float c15, Float c16, Float c17, Float c18, Float c19, Float c20, Float c21, Float c22, Float c23, Float c24, Float c25, Float c26, Float c27, Float c28, Float c29, Float c30, Float c31 ) { // set grade usage gu(gradeUsage); // check the number of coordinates if (mv_size[gu()] != 32) throw (-1); // todo: more sensible exception // set coordinates m_c[0] = c0; m_c[1] = c1; m_c[2] = c2; m_c[3] = c3; m_c[4] = c4; m_c[5] = c5; m_c[6] = c6; m_c[7] = c7; m_c[8] = c8; m_c[9] = c9; m_c[10] = c10; m_c[11] = c11; m_c[12] = c12; m_c[13] = c13; m_c[14] = c14; m_c[15] = c15; m_c[16] = c16; m_c[17] = c17; m_c[18] = c18; m_c[19] = c19; m_c[20] = c20; m_c[21] = c21; m_c[22] = c22; m_c[23] = c23; m_c[24] = c24; m_c[25] = c25; m_c[26] = c26; m_c[27] = c27; m_c[28] = c28; m_c[29] = c29; m_c[30] = c30; m_c[31] = c31; } // set to no_t void mv::set(const no_t & arg1) { // set grade usage gu(2); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to e1_t void mv::set(const e1_t & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to e2_t void mv::set(const e2_t & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = arg1.m_c[0] ; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to e3_t void mv::set(const e3_t & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = (Float)0; } // set to ni_t void mv::set(const ni_t & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[0] ; } // set to scalar void mv::set(const scalar & arg1) { // set grade usage gu(1); m_c[0] = arg1.m_c[0] ; } // set to noni_t void mv::set(const noni_t & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[0] ; } // set to point void mv::set(const point & arg1) { // set grade usage gu(2); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; } // set to normalizedPoint void mv::set(const normalizedPoint & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; } // set to flatPoint void mv::set(const flatPoint & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[0] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = arg1.m_c[3] ; } // set to normalizedFlatPoint void mv::set(const normalizedFlatPoint & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[0] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = (Float)1.0f; } // set to pointPair void mv::set(const pointPair & arg1) { // set grade usage gu(4); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[5] ; m_c[6] = arg1.m_c[6] ; m_c[7] = arg1.m_c[7] ; m_c[8] = arg1.m_c[8] ; m_c[9] = arg1.m_c[9] ; } // set to line void mv::set(const line & arg1) { // set grade usage gu(8); m_c[0] = arg1.m_c[2] ; m_c[1] = arg1.m_c[1] * (Float)-1.0; m_c[2] = arg1.m_c[0] ; m_c[3] = arg1.m_c[5] * (Float)-1.0; m_c[4] = arg1.m_c[3] * (Float)-1.0; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to dualLine void mv::set(const dualLine & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[3] ; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = (Float)0; } // set to plane void mv::set(const plane & arg1) { // set grade usage gu(16); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[3] ; m_c[2] = arg1.m_c[2] * (Float)-1.0; m_c[3] = arg1.m_c[1] ; m_c[4] = (Float)0; } // set to dualPlane void mv::set(const dualPlane & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; } // set to circle void mv::set(const circle & arg1) { // set grade usage gu(8); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[5] ; m_c[6] = arg1.m_c[6] ; m_c[7] = arg1.m_c[7] ; m_c[8] = arg1.m_c[8] ; m_c[9] = arg1.m_c[9] ; } // set to sphere void mv::set(const sphere & arg1) { // set grade usage gu(16); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[3] ; m_c[2] = arg1.m_c[2] * (Float)-1.0; m_c[3] = arg1.m_c[1] ; m_c[4] = arg1.m_c[4] * (Float)-1.0; } // set to dualSphere void mv::set(const dualSphere & arg1) { // set grade usage gu(2); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; } // set to normalizedSphere void mv::set(const normalizedSphere & arg1) { // set grade usage gu(16); m_c[0] = (Float)1.0f; m_c[1] = arg1.m_c[2] ; m_c[2] = arg1.m_c[1] * (Float)-1.0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[3] * (Float)-1.0; } // set to normalizedDualSphere void mv::set(const normalizedDualSphere & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; } // set to freeVector void mv::set(const freeVector & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[0] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = (Float)0; } // set to freeBivector void mv::set(const freeBivector & arg1) { // set grade usage gu(8); m_c[0] = arg1.m_c[1] ; m_c[1] = arg1.m_c[2] ; m_c[2] = arg1.m_c[0] ; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to freeTrivector void mv::set(const freeTrivector & arg1) { // set grade usage gu(16); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to tangentVector void mv::set(const tangentVector & arg1) { // set grade usage gu(4); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[5] ; m_c[6] = arg1.m_c[6] ; m_c[7] = arg1.m_c[7] ; m_c[8] = arg1.m_c[8] ; m_c[9] = arg1.m_c[9] ; } // set to tangentBivector void mv::set(const tangentBivector & arg1) { // set grade usage gu(8); m_c[0] = arg1.m_c[1] ; m_c[1] = arg1.m_c[2] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[6] ; m_c[6] = arg1.m_c[7] ; m_c[7] = arg1.m_c[8] ; m_c[8] = arg1.m_c[9] ; m_c[9] = arg1.m_c[0] ; } // set to vectorE2GA void mv::set(const vectorE2GA & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to vectorE3GA void mv::set(const vectorE3GA & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = (Float)0; } // set to bivectorE3GA void mv::set(const bivectorE3GA & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[2] ; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to TRversorLog void mv::set(const TRversorLog & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[2] ; m_c[6] = arg1.m_c[3] ; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = (Float)0; } // set to TRSversorLog void mv::set(const TRSversorLog & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[3] ; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = arg1.m_c[6] ; } // set to TRversor void mv::set(const TRversor & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = arg1.m_c[6] ; m_c[10] = (Float)0; m_c[11] = arg1.m_c[7] ; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; m_c[15] = (Float)0; } // set to TRSversor void mv::set(const TRSversor & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = arg1.m_c[6] ; m_c[10] = arg1.m_c[7] ; m_c[11] = arg1.m_c[11] ; m_c[12] = arg1.m_c[10] ; m_c[13] = arg1.m_c[9] * (Float)-1.0; m_c[14] = arg1.m_c[8] ; m_c[15] = (Float)0; } // set to evenVersor void mv::set(const evenVersor & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[5] ; m_c[6] = arg1.m_c[6] ; m_c[7] = arg1.m_c[7] ; m_c[8] = arg1.m_c[8] ; m_c[9] = arg1.m_c[9] ; m_c[10] = arg1.m_c[10] ; m_c[11] = arg1.m_c[11] ; m_c[12] = arg1.m_c[14] ; m_c[13] = arg1.m_c[13] * (Float)-1.0; m_c[14] = arg1.m_c[12] ; m_c[15] = arg1.m_c[15] * (Float)-1.0; } // set to translator void mv::set(const translator & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = arg1.m_c[3] ; m_c[10] = (Float)0; } // set to normalizedTranslator void mv::set(const normalizedTranslator & arg1) { // set grade usage gu(5); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[0] ; m_c[8] = arg1.m_c[1] ; m_c[9] = arg1.m_c[2] ; m_c[10] = (Float)0; } // set to rotor void mv::set(const rotor & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[2] ; m_c[6] = arg1.m_c[3] ; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; } // set to scalor void mv::set(const scalor & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[1] ; } // set to __no_ct__ void mv::set(const __no_ct__ & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __e1_ct__ void mv::set(const __e1_ct__ & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)1.0f; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __e2_ct__ void mv::set(const __e2_ct__ & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)1.0f; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __e3_ct__ void mv::set(const __e3_ct__ & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)1.0f; m_c[4] = (Float)0; } // set to __ni_ct__ void mv::set(const __ni_ct__ & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)1.0f; } // set to __noni_ct__ void mv::set(const __noni_ct__ & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)1.0f; } // set to __e3ni_ct__ void mv::set(const __e3ni_ct__ & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)1.0f; m_c[9] = (Float)0; } // set to __e2ni_ct__ void mv::set(const __e2ni_ct__ & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)1.0f; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __I3_ct__ void mv::set(const __I3_ct__ & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)1.0f; } // set to __e1ni_ct__ void mv::set(const __e1ni_ct__ & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)1.0f; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __I5_ct__ void mv::set(const __I5_ct__ & arg1) { // set grade usage gu(32); m_c[0] = (Float)1.0f; } // set to __I5i_ct__ void mv::set(const __I5i_ct__ & arg1) { // set grade usage gu(32); m_c[0] = (Float)-1.0f; } // set to __syn_smv___e1_e2_e3_ni_nof_1_0 void mv::set(const __syn_smv___e1_e2_e3_ni_nof_1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)-1.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; } // set to __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni void mv::set(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[3] ; m_c[5] = arg1.m_c[6] ; m_c[6] = arg1.m_c[5] * (Float)-1.0; m_c[7] = arg1.m_c[8] ; m_c[8] = arg1.m_c[9] ; m_c[9] = arg1.m_c[10] ; m_c[10] = arg1.m_c[7] ; } // set to __syn_smv___scalar_noe1_noe2_noe3_noni void mv::set(const __syn_smv___scalar_noe1_noe2_noe3_noni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[7] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[10] ; m_c[9] = arg1.m_c[8] ; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[6] ; m_c[12] = arg1.m_c[5] ; m_c[13] = arg1.m_c[3] ; m_c[14] = (Float)0; } // set to __syn_smv___scalar_noe1_e1e2_e1e3_e1ni void mv::set(const __syn_smv___scalar_noe1_e1e2_e1e3_e1ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[2] ; m_c[5] = (Float)0; m_c[6] = arg1.m_c[3] * (Float)-1.0; m_c[7] = arg1.m_c[4] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[7] ; m_c[5] = (Float)0; m_c[6] = arg1.m_c[10] * (Float)-1.0; m_c[7] = arg1.m_c[9] ; m_c[8] = (Float)0; m_c[9] = arg1.m_c[8] ; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = arg1.m_c[5] ; m_c[13] = arg1.m_c[3] ; m_c[14] = arg1.m_c[6] ; } // set to __syn_smv___scalar_noe2_e1e2_e2e3_e2ni void mv::set(const __syn_smv___scalar_noe2_e1e2_e2e3_e2ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[3] ; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[4] ; m_c[9] = (Float)0; m_c[10] = (Float)0; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[7] ; m_c[5] = arg1.m_c[10] ; m_c[6] = (Float)0; m_c[7] = arg1.m_c[9] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[8] ; m_c[11] = arg1.m_c[5] ; m_c[12] = (Float)0; m_c[13] = arg1.m_c[3] ; m_c[14] = arg1.m_c[6] ; } // set to __syn_smv___scalar_noe3_e1e3_e2e3_e3ni void mv::set(const __syn_smv___scalar_noe3_e1e3_e2e3_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[1] ; m_c[4] = (Float)0; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[4] ; m_c[10] = (Float)0; } // set to __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[7] ; m_c[5] = arg1.m_c[10] ; m_c[6] = arg1.m_c[9] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[8] ; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = arg1.m_c[5] ; m_c[12] = arg1.m_c[4] ; m_c[13] = (Float)0; m_c[14] = arg1.m_c[6] ; } // set to __syn_smv___scalar_noni_e1ni_e2ni_e3ni void mv::set(const __syn_smv___scalar_noni_e1ni_e2ni_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[2] ; m_c[8] = arg1.m_c[3] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[1] ; } // set to __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[10] ; m_c[6] = arg1.m_c[9] * (Float)-1.0; m_c[7] = arg1.m_c[7] ; m_c[8] = arg1.m_c[8] ; m_c[9] = arg1.m_c[5] ; m_c[10] = arg1.m_c[6] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___e1ni_e2ni_e3ni_nonif_1_0 void mv::set(const __syn_smv___e1ni_e2ni_e3ni_nonif_1_0 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[0] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = (Float)-1.0f; } // set to __syn_smv___scalarf_1_0 void mv::set(const __syn_smv___scalarf_1_0 & arg1) { // set grade usage gu(1); m_c[0] = (Float)-1.0f; } // set to __syn_smv___nif_1_0 void mv::set(const __syn_smv___nif_1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)-1.0f; } // set to __syn_smv___nif1_0 void mv::set(const __syn_smv___nif1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)1.0f; } // set to __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0 void mv::set(const __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0 & arg1) { // set grade usage gu(16); m_c[0] = arg1.m_c[3] ; m_c[1] = arg1.m_c[2] ; m_c[2] = arg1.m_c[1] * (Float)-1.0; m_c[3] = arg1.m_c[0] ; m_c[4] = (Float)1.0f; } // set to __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = arg1.m_c[8] ; m_c[12] = arg1.m_c[7] * (Float)-1.0; m_c[13] = arg1.m_c[6] ; m_c[14] = (Float)0; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni & arg1) { // set grade usage gu(42); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[8] ; m_c[5] = arg1.m_c[14] ; m_c[6] = arg1.m_c[13] * (Float)-1.0; m_c[7] = arg1.m_c[11] ; m_c[8] = arg1.m_c[12] ; m_c[9] = arg1.m_c[9] ; m_c[10] = arg1.m_c[10] ; m_c[11] = arg1.m_c[6] ; m_c[12] = arg1.m_c[5] ; m_c[13] = arg1.m_c[3] ; m_c[14] = arg1.m_c[7] ; m_c[15] = arg1.m_c[15] ; } // set to __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni void mv::set(const __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[3] ; m_c[9] = arg1.m_c[0] ; m_c[10] = arg1.m_c[5] ; m_c[11] = (Float)0; m_c[12] = arg1.m_c[4] * (Float)-1.0; m_c[13] = arg1.m_c[2] ; m_c[14] = (Float)0; } // set to __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[7] ; m_c[6] = arg1.m_c[6] * (Float)-1.0; m_c[7] = arg1.m_c[5] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[1] ; m_c[7] = (Float)0; m_c[8] = arg1.m_c[3] ; m_c[9] = arg1.m_c[0] ; m_c[10] = arg1.m_c[5] ; m_c[11] = arg1.m_c[4] ; m_c[12] = (Float)0; m_c[13] = arg1.m_c[2] ; m_c[14] = (Float)0; } // set to __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[1] ; m_c[7] = arg1.m_c[2] ; m_c[8] = (Float)0; m_c[9] = arg1.m_c[0] ; m_c[10] = arg1.m_c[5] ; m_c[11] = arg1.m_c[4] ; m_c[12] = arg1.m_c[3] * (Float)-1.0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[0] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[1] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___scalarf0_0 void mv::set(const __syn_smv___scalarf0_0 & arg1) { // set grade usage gu(1); m_c[0] = (Float)0.0f; } // set to __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = arg1.m_c[9] ; m_c[12] = arg1.m_c[8] * (Float)-1.0; m_c[13] = arg1.m_c[7] ; m_c[14] = arg1.m_c[6] ; } // set to __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni void mv::set(const __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[2] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[7] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[9] ; m_c[11] = (Float)0; m_c[12] = arg1.m_c[8] * (Float)-1.0; m_c[13] = arg1.m_c[6] ; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = arg1.m_c[2] * (Float)-1.0; m_c[6] = arg1.m_c[5] ; m_c[7] = (Float)0; m_c[8] = arg1.m_c[7] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[8] ; m_c[12] = (Float)0; m_c[13] = arg1.m_c[6] ; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = (Float)0; m_c[3] = arg1.m_c[2] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[5] ; m_c[7] = arg1.m_c[6] ; m_c[8] = (Float)0; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[8] ; m_c[12] = arg1.m_c[7] * (Float)-1.0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[3] ; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[6] ; m_c[9] = (Float)0; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[8] ; m_c[12] = arg1.m_c[7] * (Float)-1.0; m_c[13] = arg1.m_c[5] ; m_c[14] = (Float)0; } // set to __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = arg1.m_c[7] ; m_c[7] = arg1.m_c[8] ; m_c[8] = arg1.m_c[10] ; m_c[9] = arg1.m_c[6] ; m_c[10] = arg1.m_c[13] ; m_c[11] = arg1.m_c[12] ; m_c[12] = arg1.m_c[11] * (Float)-1.0; m_c[13] = arg1.m_c[9] ; m_c[14] = (Float)0; } // set to __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni void mv::set(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[3] ; m_c[5] = arg1.m_c[6] ; m_c[6] = arg1.m_c[5] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[8] ; m_c[11] = (Float)0; m_c[12] = arg1.m_c[11] ; m_c[13] = arg1.m_c[10] * (Float)-1.0; m_c[14] = arg1.m_c[9] ; m_c[15] = arg1.m_c[7] ; } // set to __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[1] ; m_c[7] = arg1.m_c[2] ; m_c[8] = arg1.m_c[4] ; m_c[9] = arg1.m_c[0] ; m_c[10] = arg1.m_c[7] ; m_c[11] = arg1.m_c[6] ; m_c[12] = arg1.m_c[5] * (Float)-1.0; m_c[13] = arg1.m_c[3] ; m_c[14] = (Float)0; } // set to __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = arg1.m_c[8] ; m_c[7] = arg1.m_c[9] ; m_c[8] = arg1.m_c[11] ; m_c[9] = arg1.m_c[7] ; m_c[10] = arg1.m_c[14] ; m_c[11] = arg1.m_c[13] ; m_c[12] = arg1.m_c[12] * (Float)-1.0; m_c[13] = arg1.m_c[10] ; m_c[14] = arg1.m_c[6] ; } // set to __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni void mv::set(const __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = arg1.m_c[6] ; m_c[10] = (Float)0; } // set to __syn_smv___nof_1_0 void mv::set(const __syn_smv___nof_1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)-1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __syn_smv___e1_e2_e3_e1e2e3 void mv::set(const __syn_smv___e1_e2_e3_e1e2e3 & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni void mv::set(const __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[0] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = (Float)0; m_c[10] = arg1.m_c[3] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[3] ; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = (Float)0; m_c[10] = arg1.m_c[6] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni void mv::set(const __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = arg1.m_c[2] ; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[0] ; m_c[9] = arg1.m_c[3] ; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni void mv::set(const __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = arg1.m_c[3] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[2] ; m_c[4] = (Float)0; m_c[5] = arg1.m_c[1] ; m_c[6] = arg1.m_c[0] ; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni void mv::set(const __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = (Float)0; m_c[1] = arg1.m_c[3] * (Float)-1.0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[1] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[0] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni void mv::set(const __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = arg1.m_c[3] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[2] ; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[0] ; m_c[9] = (Float)0; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni void mv::set(const __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = arg1.m_c[3] ; m_c[1] = arg1.m_c[2] * (Float)-1.0; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[0] ; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___noe1e2e3ni void mv::set(const __syn_smv___noe1e2e3ni & arg1) { // set grade usage gu(32); m_c[0] = arg1.m_c[0] ; } // set to __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(8); m_c[0] = arg1.m_c[3] ; m_c[1] = arg1.m_c[2] * (Float)-1.0; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[0] ; } // set to __syn_smv___e1e2e3 void mv::set(const __syn_smv___e1e2e3 & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[0] ; } // set to __syn_smv___e1e3_e2e3 void mv::set(const __syn_smv___e1e3_e2e3 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[0] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___scalarf1_0 void mv::set(const __syn_smv___scalarf1_0 & arg1) { // set grade usage gu(1); m_c[0] = (Float)1.0f; } // set to __syn_smv___ni_nof1_0 void mv::set(const __syn_smv___ni_nof1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[0] ; } // set to __syn_smv___e1_e2_e3_nof1_0 void mv::set(const __syn_smv___e1_e2_e3_nof1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = (Float)0; } // set to __syn_smv___e1_e2_e3_ni_nof2_0 void mv::set(const __syn_smv___e1_e2_e3_ni_nof2_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)2.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; } // set to __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0 void mv::set(const __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0 & arg1) { // set grade usage gu(10); m_c[0] = (Float)1.0f; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; m_c[5] = arg1.m_c[9] ; m_c[6] = arg1.m_c[8] * (Float)-1.0; m_c[7] = arg1.m_c[6] ; m_c[8] = arg1.m_c[7] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[5] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___scalar_e1e2 void mv::set(const __syn_smv___scalar_e1e2 & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; } // set to __syn_smv___scalar_e1e3_e2e3 void mv::set(const __syn_smv___scalar_e1e3_e2e3 & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = arg1.m_c[2] ; m_c[6] = arg1.m_c[1] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; } // set to __syn_smv___e1e2f1_0 void mv::set(const __syn_smv___e1e2f1_0 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)1.0f; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___e1e2nif1_0 void mv::set(const __syn_smv___e1e2nif1_0 & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)1.0f; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___noe1e2f1_0 void mv::set(const __syn_smv___noe1e2f1_0 & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)1.0f; m_c[9] = (Float)0; } // set to __syn_smv___noe1e2f1_0_e1e2nif1_0 void mv::set(const __syn_smv___noe1e2f1_0_e1e2nif1_0 & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)1.0f; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)1.0f; m_c[9] = (Float)0; } // set to __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[4] ; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[7] ; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = arg1.m_c[9] ; m_c[12] = arg1.m_c[8] * (Float)-1.0; m_c[13] = arg1.m_c[6] ; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[3] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[5] ; m_c[5] = arg1.m_c[4] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[8] ; m_c[12] = arg1.m_c[7] * (Float)-1.0; m_c[13] = arg1.m_c[6] ; m_c[14] = (Float)0; } // set to __syn_smv___nof1_0 void mv::set(const __syn_smv___nof1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __syn_smv___noe1 void mv::set(const __syn_smv___noe1 & arg1) { // set grade usage gu(4); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___noe2 void mv::set(const __syn_smv___noe2 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___noe3 void mv::set(const __syn_smv___noe3 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = arg1.m_c[0] ; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___nonif_1_0 void mv::set(const __syn_smv___nonif_1_0 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)-1.0f; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[8] ; m_c[5] = arg1.m_c[14] ; m_c[6] = arg1.m_c[13] * (Float)-1.0; m_c[7] = arg1.m_c[11] ; m_c[8] = arg1.m_c[12] ; m_c[9] = arg1.m_c[9] ; m_c[10] = arg1.m_c[10] ; m_c[11] = arg1.m_c[6] ; m_c[12] = arg1.m_c[5] ; m_c[13] = arg1.m_c[3] ; m_c[14] = arg1.m_c[7] ; } // set to __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni void mv::set(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[9] ; m_c[9] = arg1.m_c[7] ; m_c[10] = arg1.m_c[8] ; m_c[11] = arg1.m_c[6] ; m_c[12] = arg1.m_c[5] ; m_c[13] = arg1.m_c[3] ; m_c[14] = (Float)0; } // set to __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni void mv::set(const __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[6] ; m_c[5] = (Float)0; m_c[6] = arg1.m_c[9] * (Float)-1.0; m_c[7] = arg1.m_c[8] ; m_c[8] = (Float)0; m_c[9] = arg1.m_c[7] ; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = arg1.m_c[4] ; m_c[13] = arg1.m_c[2] ; m_c[14] = arg1.m_c[5] ; } // set to __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni void mv::set(const __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = (Float)0; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[6] ; m_c[5] = arg1.m_c[9] ; m_c[6] = (Float)0; m_c[7] = arg1.m_c[8] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[7] ; m_c[11] = arg1.m_c[4] ; m_c[12] = (Float)0; m_c[13] = arg1.m_c[2] ; m_c[14] = arg1.m_c[5] ; } // set to __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[6] ; m_c[5] = arg1.m_c[9] ; m_c[6] = arg1.m_c[8] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[7] ; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = arg1.m_c[4] ; m_c[12] = arg1.m_c[3] ; m_c[13] = (Float)0; m_c[14] = arg1.m_c[5] ; } // set to __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[3] ; m_c[5] = arg1.m_c[9] ; m_c[6] = arg1.m_c[8] * (Float)-1.0; m_c[7] = arg1.m_c[6] ; m_c[8] = arg1.m_c[7] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[5] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni void mv::set(const __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[6] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[9] ; m_c[9] = arg1.m_c[7] ; m_c[10] = arg1.m_c[8] ; m_c[11] = arg1.m_c[5] ; m_c[12] = arg1.m_c[4] ; m_c[13] = arg1.m_c[2] ; m_c[14] = (Float)0; } // set to __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = (Float)0; m_c[5] = arg1.m_c[9] ; m_c[6] = arg1.m_c[8] * (Float)-1.0; m_c[7] = arg1.m_c[6] ; m_c[8] = arg1.m_c[7] ; m_c[9] = arg1.m_c[4] ; m_c[10] = arg1.m_c[5] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni void mv::set(const __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[3] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[8] ; m_c[10] = arg1.m_c[4] ; m_c[11] = (Float)0; m_c[12] = arg1.m_c[10] ; m_c[13] = arg1.m_c[9] * (Float)-1.0; m_c[14] = arg1.m_c[7] ; m_c[15] = (Float)0; } // set to __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[2] ; m_c[5] = (Float)0; m_c[6] = arg1.m_c[3] * (Float)-1.0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[8] ; m_c[10] = arg1.m_c[4] ; m_c[11] = arg1.m_c[10] ; m_c[12] = (Float)0; m_c[13] = arg1.m_c[9] * (Float)-1.0; m_c[14] = arg1.m_c[7] ; m_c[15] = (Float)0; } // set to __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = arg1.m_c[1] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[3] ; m_c[6] = (Float)0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[8] ; m_c[10] = arg1.m_c[4] ; m_c[11] = arg1.m_c[10] ; m_c[12] = arg1.m_c[9] ; m_c[13] = (Float)0; m_c[14] = arg1.m_c[7] ; m_c[15] = (Float)0; } // set to __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[1] ; m_c[4] = (Float)0; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[7] ; m_c[10] = arg1.m_c[4] ; m_c[11] = arg1.m_c[10] ; m_c[12] = arg1.m_c[9] ; m_c[13] = arg1.m_c[8] * (Float)-1.0; m_c[14] = (Float)0; m_c[15] = (Float)0; } // set to __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = arg1.m_c[1] ; m_c[2] = arg1.m_c[2] ; m_c[3] = arg1.m_c[4] ; m_c[4] = arg1.m_c[3] ; m_c[5] = arg1.m_c[6] ; m_c[6] = arg1.m_c[5] * (Float)-1.0; m_c[7] = arg1.m_c[8] ; m_c[8] = arg1.m_c[9] ; m_c[9] = arg1.m_c[11] ; m_c[10] = arg1.m_c[7] ; m_c[11] = arg1.m_c[14] ; m_c[12] = arg1.m_c[13] ; m_c[13] = arg1.m_c[12] * (Float)-1.0; m_c[14] = arg1.m_c[10] ; m_c[15] = (Float)0; } // set to __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[4] ; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[7] ; m_c[9] = (Float)0; m_c[10] = arg1.m_c[10] ; m_c[11] = arg1.m_c[9] ; m_c[12] = arg1.m_c[8] * (Float)-1.0; m_c[13] = arg1.m_c[6] ; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___e1e2 void mv::set(const __syn_smv___e1e2 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni void mv::set(const __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = arg1.m_c[2] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[1] ; m_c[4] = (Float)0; m_c[5] = arg1.m_c[0] ; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[3] ; } // set to __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni void mv::set(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[4] ; m_c[5] = (Float)0; m_c[6] = arg1.m_c[6] * (Float)-1.0; m_c[7] = arg1.m_c[5] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni void mv::set(const __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = (Float)0; m_c[1] = arg1.m_c[2] * (Float)-1.0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[1] ; m_c[4] = arg1.m_c[0] ; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[3] ; } // set to __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni void mv::set(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[6] ; m_c[6] = (Float)0; m_c[7] = arg1.m_c[5] ; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni void mv::set(const __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni & arg1) { // set grade usage gu(40); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = arg1.m_c[2] ; m_c[3] = (Float)0; m_c[4] = arg1.m_c[0] ; m_c[5] = arg1.m_c[1] ; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = arg1.m_c[3] ; } // set to __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni void mv::set(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni & arg1) { // set grade usage gu(10); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[2] ; m_c[4] = arg1.m_c[4] ; m_c[5] = arg1.m_c[6] ; m_c[6] = arg1.m_c[5] * (Float)-1.0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; m_c[10] = (Float)0; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = arg1.m_c[3] ; } // set to __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[1] ; m_c[8] = arg1.m_c[2] ; m_c[9] = arg1.m_c[3] ; m_c[10] = (Float)0; m_c[11] = arg1.m_c[4] ; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; m_c[15] = (Float)0; } // set to __syn_smv___e1e2_e1e3_e2e3_noni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_noni & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[3] ; } // set to __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni void mv::set(const __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni & arg1) { // set grade usage gu(20); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = arg1.m_c[0] ; m_c[4] = arg1.m_c[2] ; m_c[5] = arg1.m_c[1] * (Float)-1.0; m_c[6] = arg1.m_c[4] ; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[3] ; m_c[10] = arg1.m_c[7] ; m_c[11] = (Float)0; m_c[12] = (Float)0; m_c[13] = (Float)0; m_c[14] = (Float)0; } // set to __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni void mv::set(const __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni & arg1) { // set grade usage gu(21); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[4] ; m_c[8] = arg1.m_c[5] ; m_c[9] = arg1.m_c[7] ; m_c[10] = (Float)0; m_c[11] = arg1.m_c[10] ; m_c[12] = arg1.m_c[9] ; m_c[13] = arg1.m_c[8] * (Float)-1.0; m_c[14] = arg1.m_c[6] ; m_c[15] = (Float)0; } // set to __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni void mv::set(const __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = arg1.m_c[1] ; m_c[5] = arg1.m_c[3] ; m_c[6] = arg1.m_c[2] * (Float)-1.0; m_c[7] = arg1.m_c[5] ; m_c[8] = arg1.m_c[6] ; m_c[9] = arg1.m_c[7] ; m_c[10] = arg1.m_c[4] ; } // set to __syn_smv___nof1_0_e2f1_0 void mv::set(const __syn_smv___nof1_0_e2f1_0 & arg1) { // set grade usage gu(2); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)1.0f; m_c[3] = (Float)0; m_c[4] = (Float)0; } // set to __syn_smv___nonif1_0_e2nif1_0 void mv::set(const __syn_smv___nonif1_0_e2nif1_0 & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)1.0f; m_c[8] = (Float)0; m_c[9] = (Float)1.0f; } // set to __syn_smv___noe1f1_0_e1e2f_1_0 void mv::set(const __syn_smv___noe1f1_0_e1e2f_1_0 & arg1) { // set grade usage gu(4); m_c[0] = (Float)1.0f; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)-1.0f; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___noe2e3f1_0_noe3nif_1_0 void mv::set(const __syn_smv___noe2e3f1_0_noe3nif_1_0 & arg1) { // set grade usage gu(8); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)-1.0f; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)1.0f; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___e3ni void mv::set(const __syn_smv___e3ni & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = arg1.m_c[0] ; m_c[9] = (Float)0; } // set to __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni void mv::set(const __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni & arg1) { // set grade usage gu(42); m_c[0] = (Float)0; m_c[1] = arg1.m_c[0] ; m_c[2] = arg1.m_c[1] ; m_c[3] = arg1.m_c[3] ; m_c[4] = arg1.m_c[7] ; m_c[5] = arg1.m_c[13] ; m_c[6] = arg1.m_c[12] * (Float)-1.0; m_c[7] = arg1.m_c[10] ; m_c[8] = arg1.m_c[11] ; m_c[9] = arg1.m_c[8] ; m_c[10] = arg1.m_c[9] ; m_c[11] = arg1.m_c[5] ; m_c[12] = arg1.m_c[4] ; m_c[13] = arg1.m_c[2] ; m_c[14] = arg1.m_c[6] ; m_c[15] = arg1.m_c[14] ; } // set to __syn_smv___e1e2e3ni_noe1e2e3f1_0 void mv::set(const __syn_smv___e1e2e3ni_noe1e2e3f1_0 & arg1) { // set grade usage gu(16); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)1.0f; } // set to __syn_smv___e2ni void mv::set(const __syn_smv___e2ni & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[0] ; m_c[8] = (Float)0; m_c[9] = (Float)0; } // set to __syn_smv___e2ni_e3ni void mv::set(const __syn_smv___e2ni_e3ni & arg1) { // set grade usage gu(4); m_c[0] = (Float)0; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = arg1.m_c[0] ; m_c[8] = arg1.m_c[1] ; m_c[9] = (Float)0; } // set to __syn_smv___scalar_e3ni void mv::set(const __syn_smv___scalar_e3ni & arg1) { // set grade usage gu(5); m_c[0] = arg1.m_c[0] ; m_c[1] = (Float)0; m_c[2] = (Float)0; m_c[3] = (Float)0; m_c[4] = (Float)0; m_c[5] = (Float)0; m_c[6] = (Float)0; m_c[7] = (Float)0; m_c[8] = (Float)0; m_c[9] = arg1.m_c[1] ; m_c[10] = (Float)0; } // assign copy mv& mv::operator=(const mv &arg1) { set(arg1); return *this; } // assign scalar mv& mv::operator=(Float s) { set(s); return *this; } // assign no_t mv& mv::operator=(const no_t& arg1) { set(arg1); return *this; } // assign e1_t mv& mv::operator=(const e1_t& arg1) { set(arg1); return *this; } // assign e2_t mv& mv::operator=(const e2_t& arg1) { set(arg1); return *this; } // assign e3_t mv& mv::operator=(const e3_t& arg1) { set(arg1); return *this; } // assign ni_t mv& mv::operator=(const ni_t& arg1) { set(arg1); return *this; } // assign scalar mv& mv::operator=(const scalar& arg1) { set(arg1); return *this; } // assign noni_t mv& mv::operator=(const noni_t& arg1) { set(arg1); return *this; } // assign point mv& mv::operator=(const point& arg1) { set(arg1); return *this; } // assign normalizedPoint mv& mv::operator=(const normalizedPoint& arg1) { set(arg1); return *this; } // assign flatPoint mv& mv::operator=(const flatPoint& arg1) { set(arg1); return *this; } // assign normalizedFlatPoint mv& mv::operator=(const normalizedFlatPoint& arg1) { set(arg1); return *this; } // assign pointPair mv& mv::operator=(const pointPair& arg1) { set(arg1); return *this; } // assign line mv& mv::operator=(const line& arg1) { set(arg1); return *this; } // assign dualLine mv& mv::operator=(const dualLine& arg1) { set(arg1); return *this; } // assign plane mv& mv::operator=(const plane& arg1) { set(arg1); return *this; } // assign dualPlane mv& mv::operator=(const dualPlane& arg1) { set(arg1); return *this; } // assign circle mv& mv::operator=(const circle& arg1) { set(arg1); return *this; } // assign sphere mv& mv::operator=(const sphere& arg1) { set(arg1); return *this; } // assign dualSphere mv& mv::operator=(const dualSphere& arg1) { set(arg1); return *this; } // assign normalizedSphere mv& mv::operator=(const normalizedSphere& arg1) { set(arg1); return *this; } // assign normalizedDualSphere mv& mv::operator=(const normalizedDualSphere& arg1) { set(arg1); return *this; } // assign freeVector mv& mv::operator=(const freeVector& arg1) { set(arg1); return *this; } // assign freeBivector mv& mv::operator=(const freeBivector& arg1) { set(arg1); return *this; } // assign freeTrivector mv& mv::operator=(const freeTrivector& arg1) { set(arg1); return *this; } // assign tangentVector mv& mv::operator=(const tangentVector& arg1) { set(arg1); return *this; } // assign tangentBivector mv& mv::operator=(const tangentBivector& arg1) { set(arg1); return *this; } // assign vectorE2GA mv& mv::operator=(const vectorE2GA& arg1) { set(arg1); return *this; } // assign vectorE3GA mv& mv::operator=(const vectorE3GA& arg1) { set(arg1); return *this; } // assign bivectorE3GA mv& mv::operator=(const bivectorE3GA& arg1) { set(arg1); return *this; } // assign TRversorLog mv& mv::operator=(const TRversorLog& arg1) { set(arg1); return *this; } // assign TRSversorLog mv& mv::operator=(const TRSversorLog& arg1) { set(arg1); return *this; } // assign TRversor mv& mv::operator=(const TRversor& arg1) { set(arg1); return *this; } // assign TRSversor mv& mv::operator=(const TRSversor& arg1) { set(arg1); return *this; } // assign evenVersor mv& mv::operator=(const evenVersor& arg1) { set(arg1); return *this; } // assign translator mv& mv::operator=(const translator& arg1) { set(arg1); return *this; } // assign normalizedTranslator mv& mv::operator=(const normalizedTranslator& arg1) { set(arg1); return *this; } // assign rotor mv& mv::operator=(const rotor& arg1) { set(arg1); return *this; } // assign scalor mv& mv::operator=(const scalor& arg1) { set(arg1); return *this; } // assign __no_ct__ mv& mv::operator=(const __no_ct__& arg1) { set(arg1); return *this; } // assign __e1_ct__ mv& mv::operator=(const __e1_ct__& arg1) { set(arg1); return *this; } // assign __e2_ct__ mv& mv::operator=(const __e2_ct__& arg1) { set(arg1); return *this; } // assign __e3_ct__ mv& mv::operator=(const __e3_ct__& arg1) { set(arg1); return *this; } // assign __ni_ct__ mv& mv::operator=(const __ni_ct__& arg1) { set(arg1); return *this; } // assign __noni_ct__ mv& mv::operator=(const __noni_ct__& arg1) { set(arg1); return *this; } // assign __e3ni_ct__ mv& mv::operator=(const __e3ni_ct__& arg1) { set(arg1); return *this; } // assign __e2ni_ct__ mv& mv::operator=(const __e2ni_ct__& arg1) { set(arg1); return *this; } // assign __I3_ct__ mv& mv::operator=(const __I3_ct__& arg1) { set(arg1); return *this; } // assign __e1ni_ct__ mv& mv::operator=(const __e1ni_ct__& arg1) { set(arg1); return *this; } // assign __I5_ct__ mv& mv::operator=(const __I5_ct__& arg1) { set(arg1); return *this; } // assign __I5i_ct__ mv& mv::operator=(const __I5i_ct__& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_ni_nof_1_0 mv& mv::operator=(const __syn_smv___e1_e2_e3_ni_nof_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni mv& mv::operator=(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_noe2_noe3_noni mv& mv::operator=(const __syn_smv___scalar_noe1_noe2_noe3_noni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_e1e2_e1e3_e1ni mv& mv::operator=(const __syn_smv___scalar_noe1_e1e2_e1e3_e1ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe2_e1e2_e2e3_e2ni mv& mv::operator=(const __syn_smv___scalar_noe2_e1e2_e2e3_e2ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe3_e1e3_e2e3_e3ni mv& mv::operator=(const __syn_smv___scalar_noe3_e1e3_e2e3_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noni_e1ni_e2ni_e3ni mv& mv::operator=(const __syn_smv___scalar_noni_e1ni_e2ni_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1ni_e2ni_e3ni_nonif_1_0 mv& mv::operator=(const __syn_smv___e1ni_e2ni_e3ni_nonif_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___scalarf_1_0 mv& mv::operator=(const __syn_smv___scalarf_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___nif_1_0 mv& mv::operator=(const __syn_smv___nif_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___nif1_0 mv& mv::operator=(const __syn_smv___nif1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0 mv& mv::operator=(const __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalarf0_0 mv& mv::operator=(const __syn_smv___scalarf0_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni mv& mv::operator=(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni mv& mv::operator=(const __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___nof_1_0 mv& mv::operator=(const __syn_smv___nof_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_e1e2e3 mv& mv::operator=(const __syn_smv___e1_e2_e3_e1e2e3& arg1) { set(arg1); return *this; } // assign __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2e3 mv& mv::operator=(const __syn_smv___e1e2e3& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e3_e2e3 mv& mv::operator=(const __syn_smv___e1e3_e2e3& arg1) { set(arg1); return *this; } // assign __syn_smv___scalarf1_0 mv& mv::operator=(const __syn_smv___scalarf1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___ni_nof1_0 mv& mv::operator=(const __syn_smv___ni_nof1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_nof1_0 mv& mv::operator=(const __syn_smv___e1_e2_e3_nof1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_ni_nof2_0 mv& mv::operator=(const __syn_smv___e1_e2_e3_ni_nof2_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0 mv& mv::operator=(const __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1e2 mv& mv::operator=(const __syn_smv___scalar_e1e2& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1e3_e2e3 mv& mv::operator=(const __syn_smv___scalar_e1e3_e2e3& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2f1_0 mv& mv::operator=(const __syn_smv___e1e2f1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2nif1_0 mv& mv::operator=(const __syn_smv___e1e2nif1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2f1_0 mv& mv::operator=(const __syn_smv___noe1e2f1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1e2f1_0_e1e2nif1_0 mv& mv::operator=(const __syn_smv___noe1e2f1_0_e1e2nif1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___nof1_0 mv& mv::operator=(const __syn_smv___nof1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1 mv& mv::operator=(const __syn_smv___noe1& arg1) { set(arg1); return *this; } // assign __syn_smv___noe2 mv& mv::operator=(const __syn_smv___noe2& arg1) { set(arg1); return *this; } // assign __syn_smv___noe3 mv& mv::operator=(const __syn_smv___noe3& arg1) { set(arg1); return *this; } // assign __syn_smv___nonif_1_0 mv& mv::operator=(const __syn_smv___nonif_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni mv& mv::operator=(const __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni mv& mv::operator=(const __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni mv& mv::operator=(const __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2 mv& mv::operator=(const __syn_smv___e1e2& arg1) { set(arg1); return *this; } // assign __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni mv& mv::operator=(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni mv& mv::operator=(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni mv& mv::operator=(const __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_noni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_noni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni mv& mv::operator=(const __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni mv& mv::operator=(const __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___nof1_0_e2f1_0 mv& mv::operator=(const __syn_smv___nof1_0_e2f1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___nonif1_0_e2nif1_0 mv& mv::operator=(const __syn_smv___nonif1_0_e2nif1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe1f1_0_e1e2f_1_0 mv& mv::operator=(const __syn_smv___noe1f1_0_e1e2f_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___noe2e3f1_0_noe3nif_1_0 mv& mv::operator=(const __syn_smv___noe2e3f1_0_noe3nif_1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e3ni mv& mv::operator=(const __syn_smv___e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni mv& mv::operator=(const __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e1e2e3ni_noe1e2e3f1_0 mv& mv::operator=(const __syn_smv___e1e2e3ni_noe1e2e3f1_0& arg1) { set(arg1); return *this; } // assign __syn_smv___e2ni mv& mv::operator=(const __syn_smv___e2ni& arg1) { set(arg1); return *this; } // assign __syn_smv___e2ni_e3ni mv& mv::operator=(const __syn_smv___e2ni_e3ni& arg1) { set(arg1); return *this; } // assign __syn_smv___scalar_e3ni mv& mv::operator=(const __syn_smv___scalar_e3ni& arg1) { set(arg1); return *this; } float mv::largestCoordinate() const { int nc = mv_size[gu()], i; Float maxC = -1.0, C; for (i = 0; i < nc; i++) { C = (m_c[i] < (Float)0.0) ? -m_c[i] : m_c[i]; if (C > maxC) maxC = C; } return maxC; } float mv::largestBasisBlade(unsigned int &bm) const { int nc = mv_size[gu()]; Float maxC = -1.0, C; int idx = 0; int grade = 0; int i = 0; while (i < nc) { if (gu() & (1 << grade)) { for (int j = 0; j < mv_gradeSize[grade]; j++) { C = (m_c[i] < (Float)0.0) ? -m_c[i] : m_c[i]; if (C > maxC) { maxC = C; bm = mv_basisElementBitmapByIndex[idx]; } idx++; i++; } } else idx += mv_gradeSize[grade]; grade++; } return maxC; } // set to mv void no_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; } } float no_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float no_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 1; return maxC; } // set to mv void e1_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; } else { m_c[0] = (Float)0.0; } } float e1_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float e1_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 2; return maxC; } // set to mv void e2_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 2]; } else { m_c[0] = (Float)0.0; } } float e2_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float e2_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 4; return maxC; } // set to mv void e3_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 3]; } else { m_c[0] = (Float)0.0; } } float e3_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float e3_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 8; return maxC; } // set to mv void ni_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; } } float ni_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float ni_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 16; return maxC; } // set to mv void scalar::set(const mv & arg1) { if (arg1.gu() & 1) { m_c[0] = arg1.m_c[0]; } else { m_c[0] = (Float)0.0; } } float scalar::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float scalar::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 0; return maxC; } // set to mv void noni_t::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; } } float noni_t::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float noni_t::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 17; return maxC; } // set to mv void point::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float point::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float point::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void normalizedPoint::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float normalizedPoint::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float normalizedPoint::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void flatPoint::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; m_c[3] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float flatPoint::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float flatPoint::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 18; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void normalizedFlatPoint::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float normalizedFlatPoint::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float normalizedFlatPoint::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 17; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void pointPair::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; m_c[9] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float pointPair::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float pointPair::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void line::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 2]; m_c[1] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 0]; m_c[3] = arg1.m_c[gidx + 4]* (Float)-1.0; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 3]* (Float)-1.0; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float line::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float line::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 22; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 25; } return maxC; } // set to mv void dualLine::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 6]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float dualLine::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float dualLine::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void plane::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 1]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float plane::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float plane::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 30; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void dualPlane::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float dualPlane::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float dualPlane::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void circle::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; m_c[9] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float circle::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float circle::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 28; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 14; } return maxC; } // set to mv void sphere::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 1]; m_c[4] = arg1.m_c[gidx + 4]* (Float)-1.0; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float sphere::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float sphere::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 30; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 15; } return maxC; } // set to mv void dualSphere::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float dualSphere::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float dualSphere::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void normalizedSphere::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 4]* (Float)-1.0; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float normalizedSphere::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float normalizedSphere::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 30; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } return maxC; } // set to mv void normalizedDualSphere::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float normalizedDualSphere::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float normalizedDualSphere::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void freeVector::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float freeVector::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float freeVector::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 18; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void freeBivector::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 2]; m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float freeBivector::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float freeBivector::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 22; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } return maxC; } // set to mv void freeTrivector::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; } } float freeTrivector::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float freeTrivector::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 30; return maxC; } // set to mv void tangentVector::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; m_c[9] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float tangentVector::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float tangentVector::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void tangentBivector::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[5] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 5]; m_c[7] = arg1.m_c[gidx + 6]; m_c[8] = arg1.m_c[gidx + 7]; m_c[9] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float tangentBivector::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float tangentBivector::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 14; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 7; } return maxC; } // set to mv void vectorE2GA::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; } } float vectorE2GA::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float vectorE2GA::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } return maxC; } // set to mv void vectorE3GA::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float vectorE3GA::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float vectorE3GA::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } return maxC; } // set to mv void bivectorE3GA::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 4]; m_c[2] = arg1.m_c[gidx + 5]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float bivectorE3GA::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float bivectorE3GA::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } return maxC; } // set to mv void TRversorLog::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 4]; m_c[2] = arg1.m_c[gidx + 5]; m_c[3] = arg1.m_c[gidx + 6]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float TRversorLog::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float TRversorLog::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void TRSversorLog::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 6]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 8]; m_c[6] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } } float TRSversorLog::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float TRSversorLog::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void TRversor::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 0]; } else { m_c[7] = (Float)0.0; } } float TRversor::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; return maxC; } float TRversor::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void TRSversor::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 8]; m_c[7] = arg1.m_c[gidx + 9]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[8] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[10] = arg1.m_c[gidx + 1]; m_c[11] = arg1.m_c[gidx + 0]; } else { m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; m_c[11] = (Float)0.0; } } float TRSversor::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; return maxC; } float TRSversor::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void evenVersor::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[5] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 5]; m_c[7] = arg1.m_c[gidx + 6]; m_c[8] = arg1.m_c[gidx + 7]; m_c[9] = arg1.m_c[gidx + 8]; m_c[10] = arg1.m_c[gidx + 9]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[11] = arg1.m_c[gidx + 0]; m_c[12] = arg1.m_c[gidx + 3]; m_c[13] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[14] = arg1.m_c[gidx + 1]; m_c[15] = arg1.m_c[gidx + 4]* (Float)-1.0; } else { m_c[11] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; m_c[14] = (Float)0.0; m_c[15] = (Float)0.0; } } float evenVersor::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; C = (m_c[15] < (Float)0.0) ? -m_c[15] : m_c[15]; if (C > maxC) maxC = C; return maxC; } float evenVersor::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 30; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[15] < (Float)0.0) ? -m_c[15] : m_c[15]; if (C > maxC) { maxC = C; bm = 15; } return maxC; } // set to mv void translator::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 6]; m_c[2] = arg1.m_c[gidx + 7]; m_c[3] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float translator::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float translator::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void normalizedTranslator::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float normalizedTranslator::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float normalizedTranslator::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 0; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void rotor::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 5]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float rotor::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float rotor::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 10; } return maxC; } // set to mv void scalor::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 9]; } else { m_c[1] = (Float)0.0; } } float scalor::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float scalor::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void __no_ct__::set(const mv & arg1) { } float __no_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __no_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 1; return maxC; } // set to mv void __e1_ct__::set(const mv & arg1) { } float __e1_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e1_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 2; return maxC; } // set to mv void __e2_ct__::set(const mv & arg1) { } float __e2_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e2_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 4; return maxC; } // set to mv void __e3_ct__::set(const mv & arg1) { } float __e3_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e3_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 8; return maxC; } // set to mv void __ni_ct__::set(const mv & arg1) { } float __ni_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __ni_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 16; return maxC; } // set to mv void __noni_ct__::set(const mv & arg1) { } float __noni_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __noni_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 17; return maxC; } // set to mv void __e3ni_ct__::set(const mv & arg1) { } float __e3ni_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e3ni_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 24; return maxC; } // set to mv void __e2ni_ct__::set(const mv & arg1) { } float __e2ni_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e2ni_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 20; return maxC; } // set to mv void __I3_ct__::set(const mv & arg1) { } float __I3_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __I3_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 14; return maxC; } // set to mv void __e1ni_ct__::set(const mv & arg1) { } float __e1ni_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __e1ni_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 18; return maxC; } // set to mv void __I5_ct__::set(const mv & arg1) { } float __I5_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __I5_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 31; return maxC; } // set to mv void __I5i_ct__::set(const mv & arg1) { } float __I5i_ct__::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __I5i_ct__::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 31; return maxC; } // set to mv void __syn_smv___e1_e2_e3_ni_nof_1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___e1_e2_e3_ni_nof_1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_ni_nof_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 2]; m_c[5] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[6] = arg1.m_c[gidx + 4]; m_c[7] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 6]; m_c[9] = arg1.m_c[gidx + 7]; m_c[10] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___scalar_noe1_noe2_noe3_noni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 9]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float __syn_smv___scalar_noe1_noe2_noe3_noni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_noe2_noe3_noni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 6]; m_c[8] = arg1.m_c[gidx + 4]; m_c[9] = arg1.m_c[gidx + 5]; m_c[10] = arg1.m_c[gidx + 3]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 25; } return maxC; } // set to mv void __syn_smv___scalar_noe1_e1e2_e1e3_e1ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[4] = arg1.m_c[gidx + 6]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float __syn_smv___scalar_noe1_e1e2_e1e3_e1ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_e1e2_e1e3_e1ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 4]; m_c[9] = arg1.m_c[gidx + 2]; m_c[10] = arg1.m_c[gidx + 1]* (Float)-1.0; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 26; } return maxC; } // set to mv void __syn_smv___scalar_noe2_e1e2_e2e3_e2ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 7]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float __syn_smv___scalar_noe2_e1e2_e2e3_e2ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe2_e1e2_e2e3_e2ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 5]; m_c[9] = arg1.m_c[gidx + 2]; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalar_noe3_e1e3_e2e3_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float __syn_smv___scalar_noe3_e1e3_e2e3_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe3_e1e3_e2e3_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalar_noni_e1ni_e2ni_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 9]; m_c[2] = arg1.m_c[gidx + 6]; m_c[3] = arg1.m_c[gidx + 7]; m_c[4] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } } float __syn_smv___scalar_noni_e1ni_e2ni_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noni_e1ni_e2ni_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[5] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 5]; m_c[7] = arg1.m_c[gidx + 2]; m_c[8] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___e1ni_e2ni_e3ni_nonif_1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float __syn_smv___e1ni_e2ni_e3ni_nonif_1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1ni_e2ni_e3ni_nonif_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 17; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___scalarf_1_0::set(const mv & arg1) { } float __syn_smv___scalarf_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___scalarf_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 0; return maxC; } // set to mv void __syn_smv___nif_1_0::set(const mv & arg1) { } float __syn_smv___nif_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nif_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 16; return maxC; } // set to mv void __syn_smv___nif1_0::set(const mv & arg1) { } float __syn_smv___nif1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nif1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 16; return maxC; } // set to mv void __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni_noe1e2e3f1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 15; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 4]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[8] = arg1.m_c[gidx + 1]; } else { m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 9]; m_c[9] = arg1.m_c[gidx + 4]; m_c[10] = arg1.m_c[gidx + 5]; m_c[11] = arg1.m_c[gidx + 2]; m_c[12] = arg1.m_c[gidx + 3]; m_c[13] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[14] = arg1.m_c[gidx + 0]; gidx += 10; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; m_c[11] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; m_c[14] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[15] = arg1.m_c[gidx + 0]; } else { m_c[15] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; C = (m_c[15] < (Float)0.0) ? -m_c[15] : m_c[15]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[15] < (Float)0.0) ? -m_c[15] : m_c[15]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 7]; m_c[3] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 0]; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 17; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 2]; m_c[6] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[7] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; } } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 6]; m_c[3] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 1]; m_c[5] = arg1.m_c[gidx + 0]; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 17; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 6]; m_c[2] = arg1.m_c[gidx + 7]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[4] = arg1.m_c[gidx + 1]; m_c[5] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } } float __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 17; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___ni_e1e2ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 16; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalarf0_0::set(const mv & arg1) { } float __syn_smv___scalarf0_0::largestCoordinate() const { Float maxC = (Float)0.0f; return maxC; } float __syn_smv___scalarf0_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)0.0f; bm = 0; return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 4]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 4]; m_c[7] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 1]; } else { m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noe1e2ni_noe1e3ni_noe2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe2_noe3_e2e3_noe1e2e3_noni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 5; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 1]; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe3_e1e3_noe1e2e3_noni_e1ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 4]; m_c[7] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[8] = arg1.m_c[gidx + 1]; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe1e2e3_noni_e1ni_e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 6]; m_c[4] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[5] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[8] = arg1.m_c[gidx + 1]; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 9]; m_c[7] = arg1.m_c[gidx + 6]; m_c[8] = arg1.m_c[gidx + 7]; m_c[10] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[10] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[9] = arg1.m_c[gidx + 3]; m_c[11] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[12] = arg1.m_c[gidx + 1]; m_c[13] = arg1.m_c[gidx + 0]; } else { m_c[9] = (Float)0.0; m_c[11] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 2]; m_c[5] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[6] = arg1.m_c[gidx + 4]; m_c[8] = arg1.m_c[gidx + 9]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 4]; m_c[9] = arg1.m_c[gidx + 3]; m_c[10] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[11] = arg1.m_c[gidx + 1]; } else { m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; m_c[11] = (Float)0.0; } } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_noe1e2ni_noe1e3ni_noe2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 6]; m_c[2] = arg1.m_c[gidx + 7]; m_c[4] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 3]; m_c[5] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[6] = arg1.m_c[gidx + 1]; m_c[7] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; } } float __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 17; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 4]; m_c[7] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 6]; m_c[9] = arg1.m_c[gidx + 7]; m_c[11] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[11] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 4]; m_c[10] = arg1.m_c[gidx + 3]; m_c[12] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[13] = arg1.m_c[gidx + 1]; m_c[14] = arg1.m_c[gidx + 0]; } else { m_c[6] = (Float)0.0; m_c[10] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; m_c[14] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } } float __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___nof_1_0::set(const mv & arg1) { } float __syn_smv___nof_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nof_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 1; return maxC; } // set to mv void __syn_smv___e1_e2_e3_e1e2e3::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 9]; } else { m_c[3] = (Float)0.0; } } float __syn_smv___e1_e2_e3_e1e2e3::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_e1e2e3::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } return maxC; } // set to mv void __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; } } float __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1ni_e2ni_e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 18; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 6]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 0]; } else { m_c[6] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_e1ni_e2ni_e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 8]; m_c[1] = arg1.m_c[gidx + 7]; m_c[2] = arg1.m_c[gidx + 6]; m_c[3] = arg1.m_c[gidx + 9]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1e2_noe1e3_noe2e3_e1e2e3_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 7; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 6]; m_c[1] = arg1.m_c[gidx + 5]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 0]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe2e3_noe2ni_noe3ni_e2e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 13; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 7]; m_c[1] = arg1.m_c[gidx + 4]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 1]* (Float)-1.0; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1e3_noe1ni_noe3ni_e1e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 11; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 8]; m_c[1] = arg1.m_c[gidx + 4]; m_c[2] = arg1.m_c[gidx + 5]; m_c[3] = arg1.m_c[gidx + 2]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1e2_noe1ni_noe2ni_e1e2ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 7; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 0]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 14; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[0] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 31; return maxC; } // set to mv void __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 9]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2e3_e1e2ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 14; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___e1e2e3::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___e1e2e3::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___e1e2e3::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 14; return maxC; } // set to mv void __syn_smv___e1e3_e2e3::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[1] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; } } float __syn_smv___e1e3_e2e3::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e3_e2e3::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 10; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 12; } return maxC; } // set to mv void __syn_smv___scalarf1_0::set(const mv & arg1) { } float __syn_smv___scalarf1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___scalarf1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 0; return maxC; } // set to mv void __syn_smv___ni_nof1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___ni_nof1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___ni_nof1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_nof1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float __syn_smv___e1_e2_e3_nof1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_nof1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_ni_nof2_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___e1_e2_e3_ni_nof2_0::largestCoordinate() const { Float maxC = (Float)2.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_ni_nof2_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)2.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 2]; m_c[7] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_nof1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 1; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalar_e1e2::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; } else { m_c[1] = (Float)0.0; } } float __syn_smv___scalar_e1e2::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1e2::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } return maxC; } // set to mv void __syn_smv___scalar_e1e3_e2e3::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } } float __syn_smv___scalar_e1e3_e2e3::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1e3_e2e3::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } return maxC; } // set to mv void __syn_smv___e1e2f1_0::set(const mv & arg1) { } float __syn_smv___e1e2f1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___e1e2f1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 6; return maxC; } // set to mv void __syn_smv___e1e2nif1_0::set(const mv & arg1) { } float __syn_smv___e1e2nif1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___e1e2nif1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 22; return maxC; } // set to mv void __syn_smv___noe1e2f1_0::set(const mv & arg1) { } float __syn_smv___noe1e2f1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___noe1e2f1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 7; return maxC; } // set to mv void __syn_smv___noe1e2f1_0_e1e2nif1_0::set(const mv & arg1) { } float __syn_smv___noe1e2f1_0_e1e2nif1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___noe1e2f1_0_e1e2nif1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 22; return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 1]; } else { m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[5] = arg1.m_c[gidx + 4]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[8] = arg1.m_c[gidx + 1]; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1_noe2_e1e2_noe3_e1e3_e2e3_noe1e2ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 3; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___nof1_0::set(const mv & arg1) { } float __syn_smv___nof1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nof1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 1; return maxC; } // set to mv void __syn_smv___noe1::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___noe1::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___noe1::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 3; return maxC; } // set to mv void __syn_smv___noe2::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 1]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___noe2::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___noe2::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 5; return maxC; } // set to mv void __syn_smv___noe3::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 2]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___noe3::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___noe3::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 9; return maxC; } // set to mv void __syn_smv___nonif_1_0::set(const mv & arg1) { } float __syn_smv___nonif_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nonif_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 17; return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 9]; m_c[9] = arg1.m_c[gidx + 4]; m_c[10] = arg1.m_c[gidx + 5]; m_c[11] = arg1.m_c[gidx + 2]; m_c[12] = arg1.m_c[gidx + 3]; m_c[13] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[14] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; m_c[11] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; m_c[14] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 3]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 8]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 4]; m_c[8] = arg1.m_c[gidx + 5]; m_c[9] = arg1.m_c[gidx + 3]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e2_e3_noe1e3_noe2e3_noe1ni_noe2ni_noe3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 25; } return maxC; } // set to mv void __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[6] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[2] = arg1.m_c[gidx + 8]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 9]; m_c[7] = arg1.m_c[gidx + 4]; m_c[8] = arg1.m_c[gidx + 2]; m_c[9] = arg1.m_c[gidx + 1]* (Float)-1.0; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e2_noe1e2_e3_noe1e3_e1e2e3_ni_noe1ni_e1e2ni_e1e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 26; } return maxC; } // set to mv void __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 3]; m_c[6] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[2] = arg1.m_c[gidx + 8]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 9]; m_c[7] = arg1.m_c[gidx + 5]; m_c[8] = arg1.m_c[gidx + 2]; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_noe1e2_e3_noe2e3_e1e2e3_ni_noe2ni_e1e2ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[6] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 7]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 9]; m_c[7] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_noe1e3_noe2e3_e1e2e3_ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 2]; m_c[7] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[6] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[2] = arg1.m_c[gidx + 8]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 6]; m_c[7] = arg1.m_c[gidx + 4]; m_c[8] = arg1.m_c[gidx + 5]; m_c[9] = arg1.m_c[gidx + 3]; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_ni_noe1ni_noe2ni_noe3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 25; } return maxC; } // set to mv void __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 0]; m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[4] = arg1.m_c[gidx + 4]; m_c[5] = arg1.m_c[gidx + 5]; m_c[6] = arg1.m_c[gidx + 2]; m_c[7] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; } } float __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___no_e1_e2_e3_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 1; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 2; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 2]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[10] = arg1.m_c[gidx + 1]; } else { m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_noe2_noe3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 29; } return maxC; } // set to mv void __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_e1e2_e1e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 1]; m_c[2] = arg1.m_c[gidx + 3]; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; m_c[8] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 3]; m_c[9] = arg1.m_c[gidx + 1]; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[7] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe2_e1e2_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 1]; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe3_e1e3_e2e3_noni_e1ni_e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 0]; m_c[2] = arg1.m_c[gidx + 1]; m_c[3] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 2]; m_c[5] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[6] = arg1.m_c[gidx + 4]; m_c[7] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 6]; m_c[9] = arg1.m_c[gidx + 7]; m_c[11] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[11] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[10] = arg1.m_c[gidx + 3]; m_c[12] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[13] = arg1.m_c[gidx + 1]; m_c[14] = arg1.m_c[gidx + 0]; } else { m_c[10] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; m_c[14] = (Float)0.0; } } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_noe1_noe2_e1e2_noe3_e1e3_e2e3_noni_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 3; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 5; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 9; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[3] = arg1.m_c[gidx + 4]; m_c[6] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 1]; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_noe1e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 15; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1e2::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___e1e2::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___e1e2::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 6; return maxC; } // set to mv void __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 5]; m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 0]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; } } float __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe2ni_noe3ni_e2e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 21; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 2]; m_c[6] = arg1.m_c[gidx + 1]* (Float)-1.0; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e1e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 26; } return maxC; } // set to mv void __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 4]; m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 1]* (Float)-1.0; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; } } float __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1ni_noe3ni_e1e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 19; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 2]; m_c[6] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e2ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[0] = arg1.m_c[gidx + 4]; m_c[1] = arg1.m_c[gidx + 5]; m_c[2] = arg1.m_c[gidx + 2]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[3] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; } } float __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___noe1ni_noe2ni_e1e2ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 19; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[2] = arg1.m_c[gidx + 3]; m_c[4] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[3] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[6] = arg1.m_c[gidx + 0]; } else { m_c[3] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_e3_e1e2e3_ni_e1e3ni_e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 28; } return maxC; } // set to mv void __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 6]; m_c[2] = arg1.m_c[gidx + 7]; m_c[3] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[4] = arg1.m_c[gidx + 0]; } else { m_c[4] = (Float)0.0; } } float __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1ni_e2ni_e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_noni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 9]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_noni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_noni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 17; } return maxC; } // set to mv void __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 3]; m_c[1] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[2] = arg1.m_c[gidx + 4]; m_c[3] = arg1.m_c[gidx + 9]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[6] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[7] = arg1.m_c[gidx + 0]; } else { m_c[7] = (Float)0.0; } } float __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 6; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 6]; m_c[5] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; gidx += 10; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[6] = arg1.m_c[gidx + 3]; m_c[8] = arg1.m_c[gidx + 2]* (Float)-1.0; m_c[9] = arg1.m_c[gidx + 1]; m_c[10] = arg1.m_c[gidx + 0]; } else { m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; } } float __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1e2_e1e3_e2e3_e1ni_e2ni_noe1e2ni_e3ni_noe1e3ni_noe2e3ni_e1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 23; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 27; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 29; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 3]; m_c[2] = arg1.m_c[gidx + 5]* (Float)-1.0; m_c[3] = arg1.m_c[gidx + 4]; m_c[4] = arg1.m_c[gidx + 9]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 7]; m_c[7] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; m_c[2] = (Float)0.0; m_c[3] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[7] = (Float)0.0; } } float __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e1e2_e1e3_e2e3_noni_e1ni_e2ni_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 6; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 10; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 12; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 17; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 18; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 20; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___nof1_0_e2f1_0::set(const mv & arg1) { } float __syn_smv___nof1_0_e2f1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nof1_0_e2f1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 4; return maxC; } // set to mv void __syn_smv___nonif1_0_e2nif1_0::set(const mv & arg1) { } float __syn_smv___nonif1_0_e2nif1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___nonif1_0_e2nif1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 20; return maxC; } // set to mv void __syn_smv___noe1f1_0_e1e2f_1_0::set(const mv & arg1) { } float __syn_smv___noe1f1_0_e1e2f_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___noe1f1_0_e1e2f_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 6; return maxC; } // set to mv void __syn_smv___noe2e3f1_0_noe3nif_1_0::set(const mv & arg1) { } float __syn_smv___noe2e3f1_0_noe3nif_1_0::largestCoordinate() const { Float maxC = (Float)1.0f; return maxC; } float __syn_smv___noe2e3f1_0_noe3nif_1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f; bm = 25; return maxC; } // set to mv void __syn_smv___e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 24; return maxC; } // set to mv void __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { m_c[0] = arg1.m_c[gidx + 1]; m_c[1] = arg1.m_c[gidx + 2]; m_c[3] = arg1.m_c[gidx + 3]; m_c[7] = arg1.m_c[gidx + 4]; gidx += 5; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; m_c[3] = (Float)0.0; m_c[7] = (Float)0.0; } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { m_c[2] = arg1.m_c[gidx + 8]; m_c[4] = arg1.m_c[gidx + 7]; m_c[5] = arg1.m_c[gidx + 6]; m_c[6] = arg1.m_c[gidx + 9]; m_c[8] = arg1.m_c[gidx + 4]; m_c[9] = arg1.m_c[gidx + 5]; m_c[10] = arg1.m_c[gidx + 2]; m_c[11] = arg1.m_c[gidx + 3]; m_c[12] = arg1.m_c[gidx + 1]* (Float)-1.0; m_c[13] = arg1.m_c[gidx + 0]; gidx += 10; } else { m_c[2] = (Float)0.0; m_c[4] = (Float)0.0; m_c[5] = (Float)0.0; m_c[6] = (Float)0.0; m_c[8] = (Float)0.0; m_c[9] = (Float)0.0; m_c[10] = (Float)0.0; m_c[11] = (Float)0.0; m_c[12] = (Float)0.0; m_c[13] = (Float)0.0; } if (arg1.gu() & 16) { gidx += 5; } else { } if (arg1.gu() & 32) { m_c[14] = arg1.m_c[gidx + 0]; } else { m_c[14] = (Float)0.0; } } float __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) maxC = C; C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) maxC = C; C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) maxC = C; C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) maxC = C; C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) maxC = C; C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) maxC = C; C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) maxC = C; C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) maxC = C; C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) maxC = C; C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) maxC = C; C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) maxC = C; C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) maxC = C; C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1_e2_noe1e2_e3_noe1e3_noe2e3_e1e2e3_ni_noe1ni_noe2ni_e1e2ni_noe3ni_e1e3ni_e2e3ni_noe1e2e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 2; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 4; } C = (m_c[2] < (Float)0.0) ? -m_c[2] : m_c[2]; if (C > maxC) { maxC = C; bm = 7; } C = (m_c[3] < (Float)0.0) ? -m_c[3] : m_c[3]; if (C > maxC) { maxC = C; bm = 8; } C = (m_c[4] < (Float)0.0) ? -m_c[4] : m_c[4]; if (C > maxC) { maxC = C; bm = 11; } C = (m_c[5] < (Float)0.0) ? -m_c[5] : m_c[5]; if (C > maxC) { maxC = C; bm = 13; } C = (m_c[6] < (Float)0.0) ? -m_c[6] : m_c[6]; if (C > maxC) { maxC = C; bm = 14; } C = (m_c[7] < (Float)0.0) ? -m_c[7] : m_c[7]; if (C > maxC) { maxC = C; bm = 16; } C = (m_c[8] < (Float)0.0) ? -m_c[8] : m_c[8]; if (C > maxC) { maxC = C; bm = 19; } C = (m_c[9] < (Float)0.0) ? -m_c[9] : m_c[9]; if (C > maxC) { maxC = C; bm = 21; } C = (m_c[10] < (Float)0.0) ? -m_c[10] : m_c[10]; if (C > maxC) { maxC = C; bm = 22; } C = (m_c[11] < (Float)0.0) ? -m_c[11] : m_c[11]; if (C > maxC) { maxC = C; bm = 25; } C = (m_c[12] < (Float)0.0) ? -m_c[12] : m_c[12]; if (C > maxC) { maxC = C; bm = 26; } C = (m_c[13] < (Float)0.0) ? -m_c[13] : m_c[13]; if (C > maxC) { maxC = C; bm = 28; } C = (m_c[14] < (Float)0.0) ? -m_c[14] : m_c[14]; if (C > maxC) { maxC = C; bm = 31; } return maxC; } // set to mv void __syn_smv___e1e2e3ni_noe1e2e3f1_0::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { gidx += 10; } else { } if (arg1.gu() & 8) { gidx += 10; } else { } if (arg1.gu() & 16) { m_c[0] = arg1.m_c[gidx + 0]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___e1e2e3ni_noe1e2e3f1_0::largestCoordinate() const { Float maxC = (Float)1.0f, C; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e1e2e3ni_noe1e2e3f1_0::largestBasisBlade(unsigned int &bm) const { Float maxC = (Float)1.0f, C; bm = 15; C = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; if (C > maxC) { maxC = C; bm = 30; } return maxC; } // set to mv void __syn_smv___e2ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 7]; } else { m_c[0] = (Float)0.0; } } float __syn_smv___e2ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; return maxC; } float __syn_smv___e2ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0]; bm = 20; return maxC; } // set to mv void __syn_smv___e2ni_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { gidx += 1; } else { } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[0] = arg1.m_c[gidx + 7]; m_c[1] = arg1.m_c[gidx + 8]; } else { m_c[0] = (Float)0.0; m_c[1] = (Float)0.0; } } float __syn_smv___e2ni_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___e2ni_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 20; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to mv void __syn_smv___scalar_e3ni::set(const mv & arg1) { int gidx = 0; if (arg1.gu() & 1) { m_c[0] = arg1.m_c[gidx + 0]; gidx += 1; } else { m_c[0] = (Float)0.0; } if (arg1.gu() & 2) { gidx += 5; } else { } if (arg1.gu() & 4) { m_c[1] = arg1.m_c[gidx + 8]; } else { m_c[1] = (Float)0.0; } } float __syn_smv___scalar_e3ni::largestCoordinate() const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) maxC = C; return maxC; } float __syn_smv___scalar_e3ni::largestBasisBlade(unsigned int &bm) const { Float maxC = (m_c[0] < (Float)0.0) ? -m_c[0] : m_c[0], C; bm = 0; C = (m_c[1] < (Float)0.0) ? -m_c[1] : m_c[1]; if (C > maxC) { maxC = C; bm = 24; } return maxC; } // set to identity 'I' void om::set() { // simplify forward call to set(scalar) set(1.0); } // set to copy void om::set(const om &arg1) { mv_memcpy(m_c, arg1.m_c, 251); } // set to scalar void om::set(Float scalarVal) { c3ga::__G2_GENERATED__::set(*this, point(point_no_e1_e2_e3_ni, scalarVal, (Float)0, (Float)0, (Float)0, (Float)0), point(point_no_e1_e2_e3_ni, (Float)0, scalarVal, (Float)0, (Float)0, (Float)0), point(point_no_e1_e2_e3_ni, (Float)0, (Float)0, scalarVal, (Float)0, (Float)0), point(point_no_e1_e2_e3_ni, (Float)0, (Float)0, (Float)0, scalarVal, (Float)0), point(point_no_e1_e2_e3_ni, (Float)0, (Float)0, (Float)0, (Float)0, scalarVal)); } // set to coordinates void om::set(const Float *coordinates) { mv_memcpy(m_c, coordinates, 251); } // set from basis vectors array void om::set(const point *vectors) { c3ga::__G2_GENERATED__::set(*this, vectors[0], vectors[1], vectors[2], vectors[3], vectors[4]); } // set from basis vectors void om::set(const point & image_of_no, const point & image_of_e1, const point & image_of_e2, const point & image_of_e3, const point & image_of_ni) { c3ga::__G2_GENERATED__::set(*this, image_of_no, image_of_e1, image_of_e2, image_of_e3, image_of_ni); } // set to specialization void om::set(const omFlatPoint &arg1) { c3ga::__G2_GENERATED__::set(*this, arg1); } // set by coordinates, transpose void om::set(const Float *coordinates, bool transpose) { if (transpose) { m_c[0] = coordinates[0]; m_c[5] = coordinates[1]; m_c[10] = coordinates[2]; m_c[15] = coordinates[3]; m_c[20] = coordinates[4]; m_c[1] = coordinates[5]; m_c[6] = coordinates[6]; m_c[11] = coordinates[7]; m_c[16] = coordinates[8]; m_c[21] = coordinates[9]; m_c[2] = coordinates[10]; m_c[7] = coordinates[11]; m_c[12] = coordinates[12]; m_c[17] = coordinates[13]; m_c[22] = coordinates[14]; m_c[3] = coordinates[15]; m_c[8] = coordinates[16]; m_c[13] = coordinates[17]; m_c[18] = coordinates[18]; m_c[23] = coordinates[19]; m_c[4] = coordinates[20]; m_c[9] = coordinates[21]; m_c[14] = coordinates[22]; m_c[19] = coordinates[23]; m_c[24] = coordinates[24]; m_c[25] = coordinates[25]; m_c[35] = coordinates[26]; m_c[45] = coordinates[27]; m_c[55] = coordinates[28]; m_c[65] = coordinates[29]; m_c[75] = coordinates[30]; m_c[85] = coordinates[31]; m_c[95] = coordinates[32]; m_c[105] = coordinates[33]; m_c[115] = coordinates[34]; m_c[26] = coordinates[35]; m_c[36] = coordinates[36]; m_c[46] = coordinates[37]; m_c[56] = coordinates[38]; m_c[66] = coordinates[39]; m_c[76] = coordinates[40]; m_c[86] = coordinates[41]; m_c[96] = coordinates[42]; m_c[106] = coordinates[43]; m_c[116] = coordinates[44]; m_c[27] = coordinates[45]; m_c[37] = coordinates[46]; m_c[47] = coordinates[47]; m_c[57] = coordinates[48]; m_c[67] = coordinates[49]; m_c[77] = coordinates[50]; m_c[87] = coordinates[51]; m_c[97] = coordinates[52]; m_c[107] = coordinates[53]; m_c[117] = coordinates[54]; m_c[28] = coordinates[55]; m_c[38] = coordinates[56]; m_c[48] = coordinates[57]; m_c[58] = coordinates[58]; m_c[68] = coordinates[59]; m_c[78] = coordinates[60]; m_c[88] = coordinates[61]; m_c[98] = coordinates[62]; m_c[108] = coordinates[63]; m_c[118] = coordinates[64]; m_c[29] = coordinates[65]; m_c[39] = coordinates[66]; m_c[49] = coordinates[67]; m_c[59] = coordinates[68]; m_c[69] = coordinates[69]; m_c[79] = coordinates[70]; m_c[89] = coordinates[71]; m_c[99] = coordinates[72]; m_c[109] = coordinates[73]; m_c[119] = coordinates[74]; m_c[30] = coordinates[75]; m_c[40] = coordinates[76]; m_c[50] = coordinates[77]; m_c[60] = coordinates[78]; m_c[70] = coordinates[79]; m_c[80] = coordinates[80]; m_c[90] = coordinates[81]; m_c[100] = coordinates[82]; m_c[110] = coordinates[83]; m_c[120] = coordinates[84]; m_c[31] = coordinates[85]; m_c[41] = coordinates[86]; m_c[51] = coordinates[87]; m_c[61] = coordinates[88]; m_c[71] = coordinates[89]; m_c[81] = coordinates[90]; m_c[91] = coordinates[91]; m_c[101] = coordinates[92]; m_c[111] = coordinates[93]; m_c[121] = coordinates[94]; m_c[32] = coordinates[95]; m_c[42] = coordinates[96]; m_c[52] = coordinates[97]; m_c[62] = coordinates[98]; m_c[72] = coordinates[99]; m_c[82] = coordinates[100]; m_c[92] = coordinates[101]; m_c[102] = coordinates[102]; m_c[112] = coordinates[103]; m_c[122] = coordinates[104]; m_c[33] = coordinates[105]; m_c[43] = coordinates[106]; m_c[53] = coordinates[107]; m_c[63] = coordinates[108]; m_c[73] = coordinates[109]; m_c[83] = coordinates[110]; m_c[93] = coordinates[111]; m_c[103] = coordinates[112]; m_c[113] = coordinates[113]; m_c[123] = coordinates[114]; m_c[34] = coordinates[115]; m_c[44] = coordinates[116]; m_c[54] = coordinates[117]; m_c[64] = coordinates[118]; m_c[74] = coordinates[119]; m_c[84] = coordinates[120]; m_c[94] = coordinates[121]; m_c[104] = coordinates[122]; m_c[114] = coordinates[123]; m_c[124] = coordinates[124]; m_c[125] = coordinates[125]; m_c[135] = coordinates[126]; m_c[145] = coordinates[127]; m_c[155] = coordinates[128]; m_c[165] = coordinates[129]; m_c[175] = coordinates[130]; m_c[185] = coordinates[131]; m_c[195] = coordinates[132]; m_c[205] = coordinates[133]; m_c[215] = coordinates[134]; m_c[126] = coordinates[135]; m_c[136] = coordinates[136]; m_c[146] = coordinates[137]; m_c[156] = coordinates[138]; m_c[166] = coordinates[139]; m_c[176] = coordinates[140]; m_c[186] = coordinates[141]; m_c[196] = coordinates[142]; m_c[206] = coordinates[143]; m_c[216] = coordinates[144]; m_c[127] = coordinates[145]; m_c[137] = coordinates[146]; m_c[147] = coordinates[147]; m_c[157] = coordinates[148]; m_c[167] = coordinates[149]; m_c[177] = coordinates[150]; m_c[187] = coordinates[151]; m_c[197] = coordinates[152]; m_c[207] = coordinates[153]; m_c[217] = coordinates[154]; m_c[128] = coordinates[155]; m_c[138] = coordinates[156]; m_c[148] = coordinates[157]; m_c[158] = coordinates[158]; m_c[168] = coordinates[159]; m_c[178] = coordinates[160]; m_c[188] = coordinates[161]; m_c[198] = coordinates[162]; m_c[208] = coordinates[163]; m_c[218] = coordinates[164]; m_c[129] = coordinates[165]; m_c[139] = coordinates[166]; m_c[149] = coordinates[167]; m_c[159] = coordinates[168]; m_c[169] = coordinates[169]; m_c[179] = coordinates[170]; m_c[189] = coordinates[171]; m_c[199] = coordinates[172]; m_c[209] = coordinates[173]; m_c[219] = coordinates[174]; m_c[130] = coordinates[175]; m_c[140] = coordinates[176]; m_c[150] = coordinates[177]; m_c[160] = coordinates[178]; m_c[170] = coordinates[179]; m_c[180] = coordinates[180]; m_c[190] = coordinates[181]; m_c[200] = coordinates[182]; m_c[210] = coordinates[183]; m_c[220] = coordinates[184]; m_c[131] = coordinates[185]; m_c[141] = coordinates[186]; m_c[151] = coordinates[187]; m_c[161] = coordinates[188]; m_c[171] = coordinates[189]; m_c[181] = coordinates[190]; m_c[191] = coordinates[191]; m_c[201] = coordinates[192]; m_c[211] = coordinates[193]; m_c[221] = coordinates[194]; m_c[132] = coordinates[195]; m_c[142] = coordinates[196]; m_c[152] = coordinates[197]; m_c[162] = coordinates[198]; m_c[172] = coordinates[199]; m_c[182] = coordinates[200]; m_c[192] = coordinates[201]; m_c[202] = coordinates[202]; m_c[212] = coordinates[203]; m_c[222] = coordinates[204]; m_c[133] = coordinates[205]; m_c[143] = coordinates[206]; m_c[153] = coordinates[207]; m_c[163] = coordinates[208]; m_c[173] = coordinates[209]; m_c[183] = coordinates[210]; m_c[193] = coordinates[211]; m_c[203] = coordinates[212]; m_c[213] = coordinates[213]; m_c[223] = coordinates[214]; m_c[134] = coordinates[215]; m_c[144] = coordinates[216]; m_c[154] = coordinates[217]; m_c[164] = coordinates[218]; m_c[174] = coordinates[219]; m_c[184] = coordinates[220]; m_c[194] = coordinates[221]; m_c[204] = coordinates[222]; m_c[214] = coordinates[223]; m_c[224] = coordinates[224]; m_c[225] = coordinates[225]; m_c[230] = coordinates[226]; m_c[235] = coordinates[227]; m_c[240] = coordinates[228]; m_c[245] = coordinates[229]; m_c[226] = coordinates[230]; m_c[231] = coordinates[231]; m_c[236] = coordinates[232]; m_c[241] = coordinates[233]; m_c[246] = coordinates[234]; m_c[227] = coordinates[235]; m_c[232] = coordinates[236]; m_c[237] = coordinates[237]; m_c[242] = coordinates[238]; m_c[247] = coordinates[239]; m_c[228] = coordinates[240]; m_c[233] = coordinates[241]; m_c[238] = coordinates[242]; m_c[243] = coordinates[243]; m_c[248] = coordinates[244]; m_c[229] = coordinates[245]; m_c[234] = coordinates[246]; m_c[239] = coordinates[247]; m_c[244] = coordinates[248]; m_c[249] = coordinates[249]; m_c[250] = coordinates[250]; } else set(coordinates); } // assign copy om &om::operator=(const om &arg1) { set(arg1); return *this; } // assign scalar (creates scalar * 'I' outermorphism) om &om::operator=(Float scalarVal) { set(scalarVal); return *this; } /// assign specialization: om &om::operator=(const omFlatPoint &arg1) { set(arg1); return *this; } // G2 functions: mv lcont(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_1__[32] ; mv_zero(__tmp_coord_array_1__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((y.m_gu & 1) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } } if (((y.m_gu & 2) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[1] += (__y_xpd__[1][0] * __x_xpd__[0][0]); __tmp_coord_array_1__[2] += (__y_xpd__[1][1] * __x_xpd__[0][0]); __tmp_coord_array_1__[3] += (__y_xpd__[1][2] * __x_xpd__[0][0]); __tmp_coord_array_1__[4] += (__y_xpd__[1][3] * __x_xpd__[0][0]); __tmp_coord_array_1__[5] += (__y_xpd__[1][4] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_1__[0] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0]) + (__x_xpd__[1][3] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[1][4]) + (__x_xpd__[1][2] * __y_xpd__[1][2]) + (__x_xpd__[1][1] * __y_xpd__[1][1])); } } if (((y.m_gu & 4) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[6] += (__y_xpd__[2][0] * __x_xpd__[0][0]); __tmp_coord_array_1__[7] += (__y_xpd__[2][1] * __x_xpd__[0][0]); __tmp_coord_array_1__[8] += (__y_xpd__[2][2] * __x_xpd__[0][0]); __tmp_coord_array_1__[9] += (__y_xpd__[2][3] * __x_xpd__[0][0]); __tmp_coord_array_1__[10] += (__y_xpd__[2][4] * __x_xpd__[0][0]); __tmp_coord_array_1__[11] += (__y_xpd__[2][5] * __x_xpd__[0][0]); __tmp_coord_array_1__[12] += (__y_xpd__[2][6] * __x_xpd__[0][0]); __tmp_coord_array_1__[13] += (__y_xpd__[2][7] * __x_xpd__[0][0]); __tmp_coord_array_1__[14] += (__y_xpd__[2][8] * __x_xpd__[0][0]); __tmp_coord_array_1__[15] += (__y_xpd__[2][9] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_1__[1] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[2][1]) + (__x_xpd__[1][0] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][0])); __tmp_coord_array_1__[2] += ((__x_xpd__[1][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][0]) + (__x_xpd__[1][3] * __y_xpd__[2][5])); __tmp_coord_array_1__[3] += ((__x_xpd__[1][1] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][4]) + (__x_xpd__[1][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][1])); __tmp_coord_array_1__[4] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][2]) + (__x_xpd__[1][2] * __y_xpd__[2][4]) + (__x_xpd__[1][0] * __y_xpd__[2][8])); __tmp_coord_array_1__[5] += ((__x_xpd__[1][3] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][9]) + (__x_xpd__[1][2] * __y_xpd__[2][7]) + (__x_xpd__[1][1] * __y_xpd__[2][6])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_1__[0] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][6]) + (__x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3])); } } if (((y.m_gu & 8) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[16] += (__y_xpd__[3][0] * __x_xpd__[0][0]); __tmp_coord_array_1__[17] += (__y_xpd__[3][1] * __x_xpd__[0][0]); __tmp_coord_array_1__[18] += (__y_xpd__[3][2] * __x_xpd__[0][0]); __tmp_coord_array_1__[19] += (__y_xpd__[3][3] * __x_xpd__[0][0]); __tmp_coord_array_1__[20] += (__y_xpd__[3][4] * __x_xpd__[0][0]); __tmp_coord_array_1__[21] += (__y_xpd__[3][5] * __x_xpd__[0][0]); __tmp_coord_array_1__[22] += (__y_xpd__[3][6] * __x_xpd__[0][0]); __tmp_coord_array_1__[23] += (__y_xpd__[3][7] * __x_xpd__[0][0]); __tmp_coord_array_1__[24] += (__y_xpd__[3][8] * __x_xpd__[0][0]); __tmp_coord_array_1__[25] += (__y_xpd__[3][9] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_1__[6] += ((__x_xpd__[1][3] * __y_xpd__[3][7]) + (__x_xpd__[1][2] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][4])); __tmp_coord_array_1__[7] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][5]) + (__x_xpd__[1][3] * __y_xpd__[3][6])); __tmp_coord_array_1__[8] += ((-1.0f * __x_xpd__[1][0] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][7])); __tmp_coord_array_1__[9] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][8]) + (__x_xpd__[1][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][2])); __tmp_coord_array_1__[10] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][0]) + (__x_xpd__[1][1] * __y_xpd__[3][9])); __tmp_coord_array_1__[11] += ((__x_xpd__[1][4] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][1]) + (__x_xpd__[1][2] * __y_xpd__[3][9])); __tmp_coord_array_1__[12] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][4]) + (__x_xpd__[1][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][2])); __tmp_coord_array_1__[13] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][5]) + (__x_xpd__[1][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][0])); __tmp_coord_array_1__[14] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][3]) + (__x_xpd__[1][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][1])); __tmp_coord_array_1__[15] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][4])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_1__[1] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][5]) + (__x_xpd__[2][5] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][3])); __tmp_coord_array_1__[2] += ((__x_xpd__[2][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][4]) + (__x_xpd__[2][8] * __y_xpd__[3][7]) + (__x_xpd__[2][7] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][9])); __tmp_coord_array_1__[3] += ((__x_xpd__[2][8] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][0]) + (__x_xpd__[2][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][5])); __tmp_coord_array_1__[4] += ((__x_xpd__[2][1] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][3])); __tmp_coord_array_1__[5] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][3])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_1__[0] += ((__x_xpd__[3][2] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (__x_xpd__[3][4] * __y_xpd__[3][4]) + (__x_xpd__[3][5] * __y_xpd__[3][5]) + (__x_xpd__[3][0] * __y_xpd__[3][6]) + (__x_xpd__[3][6] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][7]) + (__x_xpd__[3][8] * __y_xpd__[3][2]) + (__x_xpd__[3][3] * __y_xpd__[3][3])); } } if (((y.m_gu & 16) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[26] += (__y_xpd__[4][0] * __x_xpd__[0][0]); __tmp_coord_array_1__[27] += (__y_xpd__[4][1] * __x_xpd__[0][0]); __tmp_coord_array_1__[28] += (__y_xpd__[4][2] * __x_xpd__[0][0]); __tmp_coord_array_1__[29] += (__y_xpd__[4][3] * __x_xpd__[0][0]); __tmp_coord_array_1__[30] += (__y_xpd__[4][4] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_1__[16] += ((__x_xpd__[1][1] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][1])); __tmp_coord_array_1__[17] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][2]) + (__x_xpd__[1][2] * __y_xpd__[4][0])); __tmp_coord_array_1__[18] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][0])); __tmp_coord_array_1__[19] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[4][1]) + (__x_xpd__[1][1] * __y_xpd__[4][2])); __tmp_coord_array_1__[20] += ((__x_xpd__[1][2] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[4][2])); __tmp_coord_array_1__[21] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][1])); __tmp_coord_array_1__[22] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][1])); __tmp_coord_array_1__[23] += ((__x_xpd__[1][2] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[4][2])); __tmp_coord_array_1__[24] += ((__x_xpd__[1][0] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[4][4])); __tmp_coord_array_1__[25] += ((__x_xpd__[1][0] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][4])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_1__[6] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[4][3]) + (__x_xpd__[2][2] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][4])); __tmp_coord_array_1__[7] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[4][1]) + (__x_xpd__[2][0] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][4])); __tmp_coord_array_1__[8] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[4][2]) + (__x_xpd__[2][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][4])); __tmp_coord_array_1__[9] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[4][0]) + (__x_xpd__[2][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][4])); __tmp_coord_array_1__[10] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[4][0]) + (__x_xpd__[2][9] * __y_xpd__[4][1])); __tmp_coord_array_1__[11] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[4][0]) + (__x_xpd__[2][9] * __y_xpd__[4][2])); __tmp_coord_array_1__[12] += ((__x_xpd__[2][7] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][2])); __tmp_coord_array_1__[13] += ((__x_xpd__[2][8] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][0])); __tmp_coord_array_1__[14] += ((__x_xpd__[2][6] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][0])); __tmp_coord_array_1__[15] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][2])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_1__[1] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[4][3]) + (__x_xpd__[3][9] * __y_xpd__[4][4]) + (__x_xpd__[3][7] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][1])); __tmp_coord_array_1__[2] += ((__x_xpd__[3][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][2]) + (__x_xpd__[3][5] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][0])); __tmp_coord_array_1__[3] += ((__x_xpd__[3][7] * __y_xpd__[4][0]) + (__x_xpd__[3][1] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[4][3]) + (__x_xpd__[3][3] * __y_xpd__[4][1])); __tmp_coord_array_1__[4] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[4][0]) + (__x_xpd__[3][4] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][1]) + (__x_xpd__[3][2] * __y_xpd__[4][4])); __tmp_coord_array_1__[5] += ((__x_xpd__[3][1] * __y_xpd__[4][2]) + (__x_xpd__[3][2] * __y_xpd__[4][3]) + (__x_xpd__[3][0] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[4][0])); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_1__[0] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[4][1]) + (__x_xpd__[4][0] * __y_xpd__[4][4]) + (__x_xpd__[4][4] * __y_xpd__[4][0])); } } if (((y.m_gu & 32) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_1__[31] += (__y_xpd__[5][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_1__[26] += (-1.0f * __x_xpd__[1][4] * __y_xpd__[5][0]); __tmp_coord_array_1__[27] += (-1.0f * __x_xpd__[1][1] * __y_xpd__[5][0]); __tmp_coord_array_1__[28] += (-1.0f * __x_xpd__[1][2] * __y_xpd__[5][0]); __tmp_coord_array_1__[29] += (-1.0f * __x_xpd__[1][3] * __y_xpd__[5][0]); __tmp_coord_array_1__[30] += (-1.0f * __x_xpd__[1][0] * __y_xpd__[5][0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_1__[16] += (-1.0f * __x_xpd__[2][6] * __y_xpd__[5][0]); __tmp_coord_array_1__[17] += (-1.0f * __x_xpd__[2][7] * __y_xpd__[5][0]); __tmp_coord_array_1__[18] += (-1.0f * __x_xpd__[2][8] * __y_xpd__[5][0]); __tmp_coord_array_1__[19] += (-1.0f * __x_xpd__[2][3] * __y_xpd__[5][0]); __tmp_coord_array_1__[20] += (-1.0f * __x_xpd__[2][4] * __y_xpd__[5][0]); __tmp_coord_array_1__[21] += (-1.0f * __x_xpd__[2][5] * __y_xpd__[5][0]); __tmp_coord_array_1__[22] += (-1.0f * __x_xpd__[2][0] * __y_xpd__[5][0]); __tmp_coord_array_1__[23] += (__x_xpd__[2][1] * __y_xpd__[5][0]); __tmp_coord_array_1__[24] += (-1.0f * __x_xpd__[2][2] * __y_xpd__[5][0]); __tmp_coord_array_1__[25] += (-1.0f * __x_xpd__[2][9] * __y_xpd__[5][0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_1__[6] += (__x_xpd__[3][6] * __y_xpd__[5][0]); __tmp_coord_array_1__[7] += (-1.0f * __x_xpd__[3][7] * __y_xpd__[5][0]); __tmp_coord_array_1__[8] += (__x_xpd__[3][8] * __y_xpd__[5][0]); __tmp_coord_array_1__[9] += (__x_xpd__[3][3] * __y_xpd__[5][0]); __tmp_coord_array_1__[10] += (__x_xpd__[3][4] * __y_xpd__[5][0]); __tmp_coord_array_1__[11] += (__x_xpd__[3][5] * __y_xpd__[5][0]); __tmp_coord_array_1__[12] += (__x_xpd__[3][0] * __y_xpd__[5][0]); __tmp_coord_array_1__[13] += (__x_xpd__[3][1] * __y_xpd__[5][0]); __tmp_coord_array_1__[14] += (__x_xpd__[3][2] * __y_xpd__[5][0]); __tmp_coord_array_1__[15] += (__x_xpd__[3][9] * __y_xpd__[5][0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_1__[1] += (__x_xpd__[4][4] * __y_xpd__[5][0]); __tmp_coord_array_1__[2] += (__x_xpd__[4][1] * __y_xpd__[5][0]); __tmp_coord_array_1__[3] += (__x_xpd__[4][2] * __y_xpd__[5][0]); __tmp_coord_array_1__[4] += (__x_xpd__[4][3] * __y_xpd__[5][0]); __tmp_coord_array_1__[5] += (__x_xpd__[4][0] * __y_xpd__[5][0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_1__[0] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[5][0]); } } __temp_var_1__ = mv_compress(__tmp_coord_array_1__); return __temp_var_1__; } scalar scp(const mv& x, const mv& y) { scalar __temp_var_1__; const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((y.m_gu & 1) != 0)) { if (((x.m_gu & 1) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } } if (((y.m_gu & 2) != 0)) { if (((x.m_gu & 2) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[1][3] * __y_xpd__[1][3]) + (__x_xpd__[1][1] * __y_xpd__[1][1]) + (__x_xpd__[1][2] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[1][4])); } } if (((y.m_gu & 4) != 0)) { if (((x.m_gu & 4) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][0]) + (__x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5])); } } if (((y.m_gu & 8) != 0)) { if (((x.m_gu & 8) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (__x_xpd__[3][6] * __y_xpd__[3][0]) + (__x_xpd__[3][5] * __y_xpd__[3][5]) + (__x_xpd__[3][4] * __y_xpd__[3][4]) + (__x_xpd__[3][0] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][1]) + (__x_xpd__[3][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][7]) + (__x_xpd__[3][2] * __y_xpd__[3][8]) + (__x_xpd__[3][8] * __y_xpd__[3][2])); } } if (((y.m_gu & 16) != 0)) { if (((x.m_gu & 16) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[4][2]) + (__x_xpd__[4][4] * __y_xpd__[4][0]) + (__x_xpd__[4][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[4][1])); } } if (((y.m_gu & 32) != 0)) { if (((x.m_gu & 32) != 0)) { __temp_var_1__.m_c[0] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[5][0]); } } return __temp_var_1__; } mv gp(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_2__[32] ; mv_zero(__tmp_coord_array_2__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); if (((x.m_gu & 1) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[1] += (__x_xpd__[0][0] * __y_xpd__[1][0]); __tmp_coord_array_2__[2] += (__x_xpd__[0][0] * __y_xpd__[1][1]); __tmp_coord_array_2__[3] += (__x_xpd__[0][0] * __y_xpd__[1][2]); __tmp_coord_array_2__[4] += (__x_xpd__[0][0] * __y_xpd__[1][3]); __tmp_coord_array_2__[5] += (__x_xpd__[0][0] * __y_xpd__[1][4]); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[6] += (__x_xpd__[0][0] * __y_xpd__[2][0]); __tmp_coord_array_2__[7] += (__x_xpd__[0][0] * __y_xpd__[2][1]); __tmp_coord_array_2__[8] += (__x_xpd__[0][0] * __y_xpd__[2][2]); __tmp_coord_array_2__[9] += (__x_xpd__[0][0] * __y_xpd__[2][3]); __tmp_coord_array_2__[10] += (__x_xpd__[0][0] * __y_xpd__[2][4]); __tmp_coord_array_2__[11] += (__x_xpd__[0][0] * __y_xpd__[2][5]); __tmp_coord_array_2__[12] += (__x_xpd__[0][0] * __y_xpd__[2][6]); __tmp_coord_array_2__[13] += (__x_xpd__[0][0] * __y_xpd__[2][7]); __tmp_coord_array_2__[14] += (__x_xpd__[0][0] * __y_xpd__[2][8]); __tmp_coord_array_2__[15] += (__x_xpd__[0][0] * __y_xpd__[2][9]); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[16] += (__x_xpd__[0][0] * __y_xpd__[3][0]); __tmp_coord_array_2__[17] += (__x_xpd__[0][0] * __y_xpd__[3][1]); __tmp_coord_array_2__[18] += (__x_xpd__[0][0] * __y_xpd__[3][2]); __tmp_coord_array_2__[19] += (__x_xpd__[0][0] * __y_xpd__[3][3]); __tmp_coord_array_2__[20] += (__x_xpd__[0][0] * __y_xpd__[3][4]); __tmp_coord_array_2__[21] += (__x_xpd__[0][0] * __y_xpd__[3][5]); __tmp_coord_array_2__[22] += (__x_xpd__[0][0] * __y_xpd__[3][6]); __tmp_coord_array_2__[23] += (__x_xpd__[0][0] * __y_xpd__[3][7]); __tmp_coord_array_2__[24] += (__x_xpd__[0][0] * __y_xpd__[3][8]); __tmp_coord_array_2__[25] += (__x_xpd__[0][0] * __y_xpd__[3][9]); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[26] += (__x_xpd__[0][0] * __y_xpd__[4][0]); __tmp_coord_array_2__[27] += (__x_xpd__[0][0] * __y_xpd__[4][1]); __tmp_coord_array_2__[28] += (__x_xpd__[0][0] * __y_xpd__[4][2]); __tmp_coord_array_2__[29] += (__x_xpd__[0][0] * __y_xpd__[4][3]); __tmp_coord_array_2__[30] += (__x_xpd__[0][0] * __y_xpd__[4][4]); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[31] += (__x_xpd__[0][0] * __y_xpd__[5][0]); } } if (((x.m_gu & 2) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[1] += (__x_xpd__[1][0] * __y_xpd__[0][0]); __tmp_coord_array_2__[2] += (__x_xpd__[1][1] * __y_xpd__[0][0]); __tmp_coord_array_2__[3] += (__x_xpd__[1][2] * __y_xpd__[0][0]); __tmp_coord_array_2__[4] += (__x_xpd__[1][3] * __y_xpd__[0][0]); __tmp_coord_array_2__[5] += (__x_xpd__[1][4] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[0] += ((__x_xpd__[1][3] * __y_xpd__[1][3]) + (__x_xpd__[1][1] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0]) + (__x_xpd__[1][2] * __y_xpd__[1][2])); __tmp_coord_array_2__[6] += ((__x_xpd__[1][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[1][0])); __tmp_coord_array_2__[7] += ((__x_xpd__[1][0] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[1][0])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[1][0]) + (__x_xpd__[1][0] * __y_xpd__[1][3])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[1][1]) + (__x_xpd__[1][1] * __y_xpd__[1][2])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[1][2]) + (__x_xpd__[1][2] * __y_xpd__[1][3])); __tmp_coord_array_2__[11] += ((__x_xpd__[1][3] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[1][3])); __tmp_coord_array_2__[12] += ((__x_xpd__[1][1] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][1])); __tmp_coord_array_2__[13] += ((__x_xpd__[1][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][2])); __tmp_coord_array_2__[14] += ((__x_xpd__[1][3] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][3])); __tmp_coord_array_2__[15] += ((__x_xpd__[1][0] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[1] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][2]) + (__x_xpd__[1][0] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][0])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[2][3]) + (__x_xpd__[1][3] * __y_xpd__[2][5]) + (__x_xpd__[1][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][0])); __tmp_coord_array_2__[3] += ((__x_xpd__[1][0] * __y_xpd__[2][7]) + (__x_xpd__[1][1] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][4])); __tmp_coord_array_2__[4] += ((__x_xpd__[1][0] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][5]) + (__x_xpd__[1][2] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][2])); __tmp_coord_array_2__[5] += ((__x_xpd__[1][2] * __y_xpd__[2][7]) + (__x_xpd__[1][3] * __y_xpd__[2][8]) + (__x_xpd__[1][1] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][9])); __tmp_coord_array_2__[16] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[2][7]) + (__x_xpd__[1][4] * __y_xpd__[2][4]) + (__x_xpd__[1][2] * __y_xpd__[2][8])); __tmp_coord_array_2__[17] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][5]) + (__x_xpd__[1][3] * __y_xpd__[2][6])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[2][6]) + (__x_xpd__[1][1] * __y_xpd__[2][7]) + (__x_xpd__[1][4] * __y_xpd__[2][3])); __tmp_coord_array_2__[19] += ((__x_xpd__[1][0] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][9]) + (__x_xpd__[1][4] * __y_xpd__[2][2])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][9]) + (__x_xpd__[1][0] * __y_xpd__[2][6]) + (__x_xpd__[1][4] * __y_xpd__[2][0])); __tmp_coord_array_2__[21] += ((__x_xpd__[1][4] * __y_xpd__[2][1]) + (__x_xpd__[1][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][9])); __tmp_coord_array_2__[22] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[2][2]) + (__x_xpd__[1][0] * __y_xpd__[2][4]) + (__x_xpd__[1][3] * __y_xpd__[2][1])); __tmp_coord_array_2__[23] += ((__x_xpd__[1][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[2][5])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][1]) + (__x_xpd__[1][2] * __y_xpd__[2][0]) + (__x_xpd__[1][0] * __y_xpd__[2][3])); __tmp_coord_array_2__[25] += ((__x_xpd__[1][1] * __y_xpd__[2][4]) + (__x_xpd__[1][2] * __y_xpd__[2][5]) + (__x_xpd__[1][3] * __y_xpd__[2][3])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[6] += ((__x_xpd__[1][2] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][4]) + (__x_xpd__[1][3] * __y_xpd__[3][7])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][5]) + (__x_xpd__[1][3] * __y_xpd__[3][6])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[1][0] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][6])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[1][0] * __y_xpd__[3][2]) + (__x_xpd__[1][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][8])); __tmp_coord_array_2__[10] += ((__x_xpd__[1][1] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][0])); __tmp_coord_array_2__[11] += ((__x_xpd__[1][2] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][1]) + (__x_xpd__[1][4] * __y_xpd__[3][7])); __tmp_coord_array_2__[12] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][4]) + (__x_xpd__[1][3] * __y_xpd__[3][1])); __tmp_coord_array_2__[13] += ((__x_xpd__[1][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][0])); __tmp_coord_array_2__[14] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][1]) + (__x_xpd__[1][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][3])); __tmp_coord_array_2__[15] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][3])); __tmp_coord_array_2__[26] += ((__x_xpd__[1][3] * __y_xpd__[3][2]) + (__x_xpd__[1][1] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][9]) + (__x_xpd__[1][2] * __y_xpd__[3][1])); __tmp_coord_array_2__[27] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[3][6]) + (__x_xpd__[1][3] * __y_xpd__[3][5]) + (__x_xpd__[1][0] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][3])); __tmp_coord_array_2__[28] += ((__x_xpd__[1][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][4]) + (__x_xpd__[1][1] * __y_xpd__[3][3]) + (__x_xpd__[1][4] * __y_xpd__[3][7])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][5]) + (__x_xpd__[1][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][8]) + (__x_xpd__[1][0] * __y_xpd__[3][2])); __tmp_coord_array_2__[30] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][6]) + (__x_xpd__[1][2] * __y_xpd__[3][7]) + (__x_xpd__[1][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][8])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[16] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][1]) + (__x_xpd__[1][1] * __y_xpd__[4][0])); __tmp_coord_array_2__[17] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][2]) + (__x_xpd__[1][2] * __y_xpd__[4][0])); __tmp_coord_array_2__[18] += ((__x_xpd__[1][3] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][3])); __tmp_coord_array_2__[19] += ((__x_xpd__[1][1] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][1])); __tmp_coord_array_2__[20] += ((__x_xpd__[1][2] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[4][2])); __tmp_coord_array_2__[21] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][1])); __tmp_coord_array_2__[22] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][1])); __tmp_coord_array_2__[23] += ((__x_xpd__[1][2] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[4][2])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][3])); __tmp_coord_array_2__[25] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][0])); __tmp_coord_array_2__[31] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[4][1]) + (__x_xpd__[1][4] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][2]) + (__x_xpd__[1][0] * __y_xpd__[4][0])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[26] += (-1.0f * __x_xpd__[1][4] * __y_xpd__[5][0]); __tmp_coord_array_2__[27] += (-1.0f * __x_xpd__[1][1] * __y_xpd__[5][0]); __tmp_coord_array_2__[28] += (-1.0f * __x_xpd__[1][2] * __y_xpd__[5][0]); __tmp_coord_array_2__[29] += (-1.0f * __x_xpd__[1][3] * __y_xpd__[5][0]); __tmp_coord_array_2__[30] += (-1.0f * __x_xpd__[1][0] * __y_xpd__[5][0]); } } if (((x.m_gu & 4) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[6] += (__x_xpd__[2][0] * __y_xpd__[0][0]); __tmp_coord_array_2__[7] += (__x_xpd__[2][1] * __y_xpd__[0][0]); __tmp_coord_array_2__[8] += (__x_xpd__[2][2] * __y_xpd__[0][0]); __tmp_coord_array_2__[9] += (__x_xpd__[2][3] * __y_xpd__[0][0]); __tmp_coord_array_2__[10] += (__x_xpd__[2][4] * __y_xpd__[0][0]); __tmp_coord_array_2__[11] += (__x_xpd__[2][5] * __y_xpd__[0][0]); __tmp_coord_array_2__[12] += (__x_xpd__[2][6] * __y_xpd__[0][0]); __tmp_coord_array_2__[13] += (__x_xpd__[2][7] * __y_xpd__[0][0]); __tmp_coord_array_2__[14] += (__x_xpd__[2][8] * __y_xpd__[0][0]); __tmp_coord_array_2__[15] += (__x_xpd__[2][9] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[1] += ((__x_xpd__[2][1] * __y_xpd__[1][2]) + (__x_xpd__[2][2] * __y_xpd__[1][3]) + (__x_xpd__[2][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][0])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[1][3]) + (__x_xpd__[2][0] * __y_xpd__[1][4]) + (__x_xpd__[2][3] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[1][0])); __tmp_coord_array_2__[3] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[1][0]) + (__x_xpd__[2][4] * __y_xpd__[1][3]) + (__x_xpd__[2][1] * __y_xpd__[1][4])); __tmp_coord_array_2__[4] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[1][2]) + (__x_xpd__[2][2] * __y_xpd__[1][4]) + (__x_xpd__[2][5] * __y_xpd__[1][1])); __tmp_coord_array_2__[5] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[1][3]) + (__x_xpd__[2][9] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[1][1])); __tmp_coord_array_2__[16] += ((__x_xpd__[2][8] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[1][3]) + (__x_xpd__[2][4] * __y_xpd__[1][4])); __tmp_coord_array_2__[17] += ((__x_xpd__[2][5] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[1][1]) + (__x_xpd__[2][6] * __y_xpd__[1][3])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[1][2]) + (__x_xpd__[2][3] * __y_xpd__[1][4]) + (__x_xpd__[2][7] * __y_xpd__[1][1])); __tmp_coord_array_2__[19] += ((__x_xpd__[2][8] * __y_xpd__[1][0]) + (__x_xpd__[2][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][3])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[1][1]) + (__x_xpd__[2][0] * __y_xpd__[1][4]) + (__x_xpd__[2][6] * __y_xpd__[1][0])); __tmp_coord_array_2__[21] += ((__x_xpd__[2][7] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][2]) + (__x_xpd__[2][1] * __y_xpd__[1][4])); __tmp_coord_array_2__[22] += ((__x_xpd__[2][4] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[1][2]) + (__x_xpd__[2][1] * __y_xpd__[1][3])); __tmp_coord_array_2__[23] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[1][1]) + (__x_xpd__[2][0] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[1][0])); __tmp_coord_array_2__[24] += ((__x_xpd__[2][0] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[1][1]) + (__x_xpd__[2][3] * __y_xpd__[1][0])); __tmp_coord_array_2__[25] += ((__x_xpd__[2][4] * __y_xpd__[1][1]) + (__x_xpd__[2][3] * __y_xpd__[1][3]) + (__x_xpd__[2][5] * __y_xpd__[1][2])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[0] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][1]) + (__x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4])); __tmp_coord_array_2__[6] += ((__x_xpd__[2][3] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][3]) + (__x_xpd__[2][2] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][0]) + (__x_xpd__[2][0] * __y_xpd__[2][9])); __tmp_coord_array_2__[7] += ((__x_xpd__[2][0] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][1]) + (__x_xpd__[2][4] * __y_xpd__[2][2]) + (__x_xpd__[2][1] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][4])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[2][2]) + (__x_xpd__[2][1] * __y_xpd__[2][4]) + (__x_xpd__[2][2] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][5]) + (__x_xpd__[2][5] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][1])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[2][1]) + (__x_xpd__[2][7] * __y_xpd__[2][0]) + (__x_xpd__[2][1] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][7]) + (__x_xpd__[2][5] * __y_xpd__[2][4])); __tmp_coord_array_2__[10] += ((__x_xpd__[2][8] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][8]) + (__x_xpd__[2][3] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][2]) + (__x_xpd__[2][2] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][3])); __tmp_coord_array_2__[11] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[2][6]) + (__x_xpd__[2][0] * __y_xpd__[2][8]) + (__x_xpd__[2][4] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][0]) + (__x_xpd__[2][6] * __y_xpd__[2][2])); __tmp_coord_array_2__[12] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[2][8]) + (__x_xpd__[2][9] * __y_xpd__[2][6]) + (__x_xpd__[2][8] * __y_xpd__[2][5]) + (__x_xpd__[2][3] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][3])); __tmp_coord_array_2__[13] += ((__x_xpd__[2][6] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][4]) + (__x_xpd__[2][9] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][9]) + (__x_xpd__[2][4] * __y_xpd__[2][8])); __tmp_coord_array_2__[14] += ((__x_xpd__[2][7] * __y_xpd__[2][4]) + (__x_xpd__[2][5] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][5]) + (__x_xpd__[2][9] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][9])); __tmp_coord_array_2__[15] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][0]) + (__x_xpd__[2][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][1]) + (__x_xpd__[2][1] * __y_xpd__[2][7]) + (__x_xpd__[2][0] * __y_xpd__[2][6])); __tmp_coord_array_2__[26] += ((__x_xpd__[2][6] * __y_xpd__[2][4]) + (__x_xpd__[2][3] * __y_xpd__[2][8]) + (__x_xpd__[2][8] * __y_xpd__[2][3]) + (__x_xpd__[2][5] * __y_xpd__[2][7]) + (__x_xpd__[2][7] * __y_xpd__[2][5]) + (__x_xpd__[2][4] * __y_xpd__[2][6])); __tmp_coord_array_2__[27] += ((__x_xpd__[2][4] * __y_xpd__[2][9]) + (__x_xpd__[2][1] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][7]) + (__x_xpd__[2][8] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][2]) + (__x_xpd__[2][9] * __y_xpd__[2][4])); __tmp_coord_array_2__[28] += ((__x_xpd__[2][2] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][0]) + (__x_xpd__[2][6] * __y_xpd__[2][2]) + (__x_xpd__[2][9] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][8]) + (__x_xpd__[2][5] * __y_xpd__[2][9])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[2][1]) + (__x_xpd__[2][7] * __y_xpd__[2][0]) + (__x_xpd__[2][9] * __y_xpd__[2][3]) + (__x_xpd__[2][3] * __y_xpd__[2][9]) + (__x_xpd__[2][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][6])); __tmp_coord_array_2__[30] += ((__x_xpd__[2][2] * __y_xpd__[2][3]) + (__x_xpd__[2][5] * __y_xpd__[2][1]) + (__x_xpd__[2][1] * __y_xpd__[2][5]) + (__x_xpd__[2][0] * __y_xpd__[2][4]) + (__x_xpd__[2][4] * __y_xpd__[2][0]) + (__x_xpd__[2][3] * __y_xpd__[2][2])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[1] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][6]) + (__x_xpd__[2][5] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][4])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][4]) + (__x_xpd__[2][8] * __y_xpd__[3][7]) + (__x_xpd__[2][2] * __y_xpd__[3][1]) + (__x_xpd__[2][7] * __y_xpd__[3][8])); __tmp_coord_array_2__[3] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[3][0]) + (__x_xpd__[2][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][8]) + (__x_xpd__[2][8] * __y_xpd__[3][6])); __tmp_coord_array_2__[4] += ((__x_xpd__[2][1] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][3])); __tmp_coord_array_2__[5] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][1])); __tmp_coord_array_2__[16] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[3][9]) + (__x_xpd__[2][8] * __y_xpd__[3][5]) + (__x_xpd__[2][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][3]) + (__x_xpd__[2][9] * __y_xpd__[3][0])); __tmp_coord_array_2__[17] += ((__x_xpd__[2][9] * __y_xpd__[3][1]) + (__x_xpd__[2][6] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][9]) + (__x_xpd__[2][4] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][0])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][9]) + (__x_xpd__[2][9] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][5]) + (__x_xpd__[2][7] * __y_xpd__[3][4]) + (__x_xpd__[2][5] * __y_xpd__[3][0])); __tmp_coord_array_2__[19] += ((__x_xpd__[2][1] * __y_xpd__[3][0]) + (__x_xpd__[2][7] * __y_xpd__[3][6]) + (__x_xpd__[2][6] * __y_xpd__[3][7]) + (__x_xpd__[2][5] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][5])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][2]) + (__x_xpd__[2][3] * __y_xpd__[3][5]) + (__x_xpd__[2][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][8])); __tmp_coord_array_2__[21] += ((__x_xpd__[2][6] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][0]) + (__x_xpd__[2][4] * __y_xpd__[3][3]) + (__x_xpd__[2][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][6])); __tmp_coord_array_2__[22] += ((__x_xpd__[2][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][8]) + (__x_xpd__[2][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][7])); __tmp_coord_array_2__[23] += ((__x_xpd__[2][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][9]) + (__x_xpd__[2][3] * __y_xpd__[3][6])); __tmp_coord_array_2__[24] += ((__x_xpd__[2][2] * __y_xpd__[3][9]) + (__x_xpd__[2][1] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][5]) + (__x_xpd__[2][4] * __y_xpd__[3][7]) + (__x_xpd__[2][5] * __y_xpd__[3][6])); __tmp_coord_array_2__[25] += ((__x_xpd__[2][7] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][8]) + (__x_xpd__[2][1] * __y_xpd__[3][1]) + (__x_xpd__[2][0] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][6]) + (__x_xpd__[2][2] * __y_xpd__[3][2])); __tmp_coord_array_2__[31] += ((__x_xpd__[2][6] * __y_xpd__[3][6]) + (__x_xpd__[2][8] * __y_xpd__[3][8]) + (__x_xpd__[2][5] * __y_xpd__[3][5]) + (__x_xpd__[2][4] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][7]) + (__x_xpd__[2][1] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][9]) + (__x_xpd__[2][0] * __y_xpd__[3][0]) + (__x_xpd__[2][2] * __y_xpd__[3][2]) + (__x_xpd__[2][3] * __y_xpd__[3][3])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[6] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[4][3]) + (__x_xpd__[2][2] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][4])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[4][4]) + (__x_xpd__[2][0] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][1])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[4][2]) + (__x_xpd__[2][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][4])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[4][4]) + (__x_xpd__[2][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][0])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[4][4]) + (__x_xpd__[2][9] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[4][0])); __tmp_coord_array_2__[11] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][4]) + (__x_xpd__[2][9] * __y_xpd__[4][2])); __tmp_coord_array_2__[12] += ((__x_xpd__[2][7] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][0])); __tmp_coord_array_2__[13] += ((__x_xpd__[2][8] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][0])); __tmp_coord_array_2__[14] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[4][1]) + (__x_xpd__[2][6] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][0])); __tmp_coord_array_2__[15] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][3])); __tmp_coord_array_2__[26] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][1]) + (__x_xpd__[2][9] * __y_xpd__[4][0])); __tmp_coord_array_2__[27] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[4][4]) + (__x_xpd__[2][0] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][3]) + (__x_xpd__[2][3] * __y_xpd__[4][2])); __tmp_coord_array_2__[28] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[4][1]) + (__x_xpd__[2][4] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][4]) + (__x_xpd__[2][1] * __y_xpd__[4][0])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][4]) + (__x_xpd__[2][5] * __y_xpd__[4][1]) + (__x_xpd__[2][2] * __y_xpd__[4][0])); __tmp_coord_array_2__[30] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[4][4]) + (__x_xpd__[2][0] * __y_xpd__[4][1]) + (__x_xpd__[2][1] * __y_xpd__[4][2]) + (__x_xpd__[2][2] * __y_xpd__[4][3])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[16] += (-1.0f * __x_xpd__[2][6] * __y_xpd__[5][0]); __tmp_coord_array_2__[17] += (-1.0f * __x_xpd__[2][7] * __y_xpd__[5][0]); __tmp_coord_array_2__[18] += (-1.0f * __x_xpd__[2][8] * __y_xpd__[5][0]); __tmp_coord_array_2__[19] += (-1.0f * __x_xpd__[2][3] * __y_xpd__[5][0]); __tmp_coord_array_2__[20] += (-1.0f * __x_xpd__[2][4] * __y_xpd__[5][0]); __tmp_coord_array_2__[21] += (-1.0f * __x_xpd__[2][5] * __y_xpd__[5][0]); __tmp_coord_array_2__[22] += (-1.0f * __x_xpd__[2][0] * __y_xpd__[5][0]); __tmp_coord_array_2__[23] += (__x_xpd__[2][1] * __y_xpd__[5][0]); __tmp_coord_array_2__[24] += (-1.0f * __x_xpd__[2][2] * __y_xpd__[5][0]); __tmp_coord_array_2__[25] += (-1.0f * __x_xpd__[2][9] * __y_xpd__[5][0]); } } if (((x.m_gu & 8) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[16] += (__x_xpd__[3][0] * __y_xpd__[0][0]); __tmp_coord_array_2__[17] += (__x_xpd__[3][1] * __y_xpd__[0][0]); __tmp_coord_array_2__[18] += (__x_xpd__[3][2] * __y_xpd__[0][0]); __tmp_coord_array_2__[19] += (__x_xpd__[3][3] * __y_xpd__[0][0]); __tmp_coord_array_2__[20] += (__x_xpd__[3][4] * __y_xpd__[0][0]); __tmp_coord_array_2__[21] += (__x_xpd__[3][5] * __y_xpd__[0][0]); __tmp_coord_array_2__[22] += (__x_xpd__[3][6] * __y_xpd__[0][0]); __tmp_coord_array_2__[23] += (__x_xpd__[3][7] * __y_xpd__[0][0]); __tmp_coord_array_2__[24] += (__x_xpd__[3][8] * __y_xpd__[0][0]); __tmp_coord_array_2__[25] += (__x_xpd__[3][9] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[6] += ((__x_xpd__[3][7] * __y_xpd__[1][3]) + (__x_xpd__[3][8] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][0])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[1][1]) + (__x_xpd__[3][6] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][0])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][1])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][0]) + (__x_xpd__[3][9] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[1][4])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][0]) + (__x_xpd__[3][9] * __y_xpd__[1][1])); __tmp_coord_array_2__[11] += ((__x_xpd__[3][7] * __y_xpd__[1][4]) + (__x_xpd__[3][9] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][0])); __tmp_coord_array_2__[12] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][2]) + (__x_xpd__[3][1] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][4])); __tmp_coord_array_2__[13] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[1][3]) + (__x_xpd__[3][2] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][4])); __tmp_coord_array_2__[14] += ((__x_xpd__[3][0] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[1][4])); __tmp_coord_array_2__[15] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][2])); __tmp_coord_array_2__[26] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[1][3]) + (__x_xpd__[3][9] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][1])); __tmp_coord_array_2__[27] += ((__x_xpd__[3][6] * __y_xpd__[1][4]) + (__x_xpd__[3][3] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][0])); __tmp_coord_array_2__[28] += ((__x_xpd__[3][4] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][0])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][2]) + (__x_xpd__[3][8] * __y_xpd__[1][4]) + (__x_xpd__[3][5] * __y_xpd__[1][1])); __tmp_coord_array_2__[30] += ((__x_xpd__[3][6] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[1][0]) + (__x_xpd__[3][8] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][2])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[1] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][3]) + (__x_xpd__[3][7] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][0])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][9]) + (__x_xpd__[3][8] * __y_xpd__[2][7]) + (__x_xpd__[3][1] * __y_xpd__[2][2]) + (__x_xpd__[3][7] * __y_xpd__[2][8])); __tmp_coord_array_2__[3] += ((__x_xpd__[3][6] * __y_xpd__[2][8]) + (__x_xpd__[3][2] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][9])); __tmp_coord_array_2__[4] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][0]) + (__x_xpd__[3][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][7])); __tmp_coord_array_2__[5] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][8])); __tmp_coord_array_2__[16] += ((__x_xpd__[3][9] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][3]) + (__x_xpd__[3][3] * __y_xpd__[2][7]) + (__x_xpd__[3][2] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][8])); __tmp_coord_array_2__[17] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[2][9]) + (__x_xpd__[3][0] * __y_xpd__[2][3]) + (__x_xpd__[3][4] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][4]) + (__x_xpd__[3][9] * __y_xpd__[2][7])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[2][7]) + (__x_xpd__[3][5] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][9]) + (__x_xpd__[3][9] * __y_xpd__[2][8]) + (__x_xpd__[3][1] * __y_xpd__[2][4])); __tmp_coord_array_2__[19] += ((__x_xpd__[3][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][6]) + (__x_xpd__[3][5] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][7])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[2][2]) + (__x_xpd__[3][8] * __y_xpd__[2][7]) + (__x_xpd__[3][3] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][3]) + (__x_xpd__[3][2] * __y_xpd__[2][1]) + (__x_xpd__[3][7] * __y_xpd__[2][8])); __tmp_coord_array_2__[21] += ((__x_xpd__[3][4] * __y_xpd__[2][3]) + (__x_xpd__[3][0] * __y_xpd__[2][2]) + (__x_xpd__[3][6] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][6])); __tmp_coord_array_2__[22] += ((-1.0f * __x_xpd__[3][5] * __y_xpd__[2][2]) + (__x_xpd__[3][6] * __y_xpd__[2][9]) + (__x_xpd__[3][3] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][0]) + (__x_xpd__[3][7] * __y_xpd__[2][3]) + (__x_xpd__[3][8] * __y_xpd__[2][5])); __tmp_coord_array_2__[23] += ((__x_xpd__[3][7] * __y_xpd__[2][9]) + (__x_xpd__[3][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][2]) + (__x_xpd__[3][9] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][3]) + (__x_xpd__[3][8] * __y_xpd__[2][4])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[3][9] * __y_xpd__[2][2]) + (__x_xpd__[3][8] * __y_xpd__[2][9]) + (__x_xpd__[3][5] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][4])); __tmp_coord_array_2__[25] += ((__x_xpd__[3][8] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][7]) + (__x_xpd__[3][6] * __y_xpd__[2][6])); __tmp_coord_array_2__[31] += ((__x_xpd__[3][0] * __y_xpd__[2][0]) + (__x_xpd__[3][5] * __y_xpd__[2][5]) + (__x_xpd__[3][8] * __y_xpd__[2][8]) + (__x_xpd__[3][2] * __y_xpd__[2][2]) + (__x_xpd__[3][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][7]) + (__x_xpd__[3][1] * __y_xpd__[2][1]) + (__x_xpd__[3][3] * __y_xpd__[2][3]) + (__x_xpd__[3][6] * __y_xpd__[2][6])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[0] += ((__x_xpd__[3][4] * __y_xpd__[3][4]) + (__x_xpd__[3][6] * __y_xpd__[3][0]) + (__x_xpd__[3][2] * __y_xpd__[3][8]) + (__x_xpd__[3][0] * __y_xpd__[3][6]) + (__x_xpd__[3][8] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (__x_xpd__[3][5] * __y_xpd__[3][5]) + (__x_xpd__[3][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][1])); __tmp_coord_array_2__[6] += ((__x_xpd__[3][3] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][9]) + (__x_xpd__[3][9] * __y_xpd__[3][6]) + (__x_xpd__[3][5] * __y_xpd__[3][8])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[3][3]) + (__x_xpd__[3][7] * __y_xpd__[3][9]) + (__x_xpd__[3][8] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][7]) + (__x_xpd__[3][3] * __y_xpd__[3][6])); __tmp_coord_array_2__[8] += ((__x_xpd__[3][9] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][6]) + (__x_xpd__[3][7] * __y_xpd__[3][4]) + (__x_xpd__[3][6] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][9])); __tmp_coord_array_2__[9] += ((__x_xpd__[3][6] * __y_xpd__[3][1]) + (__x_xpd__[3][4] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][4]) + (__x_xpd__[3][7] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][6])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[3][5]) + (__x_xpd__[3][5] * __y_xpd__[3][3]) + (__x_xpd__[3][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][1]) + (__x_xpd__[3][2] * __y_xpd__[3][7])); __tmp_coord_array_2__[11] += ((__x_xpd__[3][3] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][8]) + (__x_xpd__[3][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][3]) + (__x_xpd__[3][8] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][2])); __tmp_coord_array_2__[12] += ((__x_xpd__[3][1] * __y_xpd__[3][3]) + (__x_xpd__[3][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][1]) + (__x_xpd__[3][5] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[3][5])); __tmp_coord_array_2__[13] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][2]) + (__x_xpd__[3][1] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][1]) + (__x_xpd__[3][3] * __y_xpd__[3][0]) + (__x_xpd__[3][2] * __y_xpd__[3][4])); __tmp_coord_array_2__[14] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[3][4]) + (__x_xpd__[3][2] * __y_xpd__[3][9]) + (__x_xpd__[3][4] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][0]) + (__x_xpd__[3][0] * __y_xpd__[3][5])); __tmp_coord_array_2__[15] += ((__x_xpd__[3][2] * __y_xpd__[3][8]) + (__x_xpd__[3][0] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][0]) + (__x_xpd__[3][7] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][2])); __tmp_coord_array_2__[26] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][1])); __tmp_coord_array_2__[27] += ((__x_xpd__[3][7] * __y_xpd__[3][2]) + (__x_xpd__[3][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][9]) + (__x_xpd__[3][8] * __y_xpd__[3][1]) + (__x_xpd__[3][2] * __y_xpd__[3][7])); __tmp_coord_array_2__[28] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[3][8]) + (__x_xpd__[3][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][9]) + (__x_xpd__[3][6] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][5])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][1])); __tmp_coord_array_2__[30] += ((__x_xpd__[3][7] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][8]) + (__x_xpd__[3][5] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][4])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[1] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[4][3]) + (__x_xpd__[3][7] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][1]) + (__x_xpd__[3][9] * __y_xpd__[4][4])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[4][2]) + (__x_xpd__[3][5] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][0]) + (__x_xpd__[3][0] * __y_xpd__[4][4])); __tmp_coord_array_2__[3] += ((__x_xpd__[3][7] * __y_xpd__[4][0]) + (__x_xpd__[3][3] * __y_xpd__[4][1]) + (__x_xpd__[3][1] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[4][3])); __tmp_coord_array_2__[4] += ((__x_xpd__[3][4] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][0]) + (__x_xpd__[3][2] * __y_xpd__[4][4])); __tmp_coord_array_2__[5] += ((__x_xpd__[3][2] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[4][0]) + (__x_xpd__[3][0] * __y_xpd__[4][1]) + (__x_xpd__[3][1] * __y_xpd__[4][2])); __tmp_coord_array_2__[16] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[4][2]) + (__x_xpd__[3][1] * __y_xpd__[4][3])); __tmp_coord_array_2__[17] += ((__x_xpd__[3][2] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][0])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[4][1]) + (__x_xpd__[3][0] * __y_xpd__[4][2])); __tmp_coord_array_2__[19] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[4][4]) + (__x_xpd__[3][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][0])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[4][4]) + (__x_xpd__[3][9] * __y_xpd__[4][1])); __tmp_coord_array_2__[21] += ((__x_xpd__[3][7] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[4][4]) + (__x_xpd__[3][9] * __y_xpd__[4][2])); __tmp_coord_array_2__[22] += ((__x_xpd__[3][7] * __y_xpd__[4][3]) + (__x_xpd__[3][8] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[4][4])); __tmp_coord_array_2__[23] += ((__x_xpd__[3][5] * __y_xpd__[4][4]) + (__x_xpd__[3][8] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][3])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][2])); __tmp_coord_array_2__[25] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][3])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[6] += (__x_xpd__[3][6] * __y_xpd__[5][0]); __tmp_coord_array_2__[7] += (-1.0f * __x_xpd__[3][7] * __y_xpd__[5][0]); __tmp_coord_array_2__[8] += (__x_xpd__[3][8] * __y_xpd__[5][0]); __tmp_coord_array_2__[9] += (__x_xpd__[3][3] * __y_xpd__[5][0]); __tmp_coord_array_2__[10] += (__x_xpd__[3][4] * __y_xpd__[5][0]); __tmp_coord_array_2__[11] += (__x_xpd__[3][5] * __y_xpd__[5][0]); __tmp_coord_array_2__[12] += (__x_xpd__[3][0] * __y_xpd__[5][0]); __tmp_coord_array_2__[13] += (__x_xpd__[3][1] * __y_xpd__[5][0]); __tmp_coord_array_2__[14] += (__x_xpd__[3][2] * __y_xpd__[5][0]); __tmp_coord_array_2__[15] += (__x_xpd__[3][9] * __y_xpd__[5][0]); } } if (((x.m_gu & 16) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[26] += (__x_xpd__[4][0] * __y_xpd__[0][0]); __tmp_coord_array_2__[27] += (__x_xpd__[4][1] * __y_xpd__[0][0]); __tmp_coord_array_2__[28] += (__x_xpd__[4][2] * __y_xpd__[0][0]); __tmp_coord_array_2__[29] += (__x_xpd__[4][3] * __y_xpd__[0][0]); __tmp_coord_array_2__[30] += (__x_xpd__[4][4] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[16] += ((__x_xpd__[4][1] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[1][1])); __tmp_coord_array_2__[17] += ((__x_xpd__[4][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[1][2])); __tmp_coord_array_2__[18] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[1][3]) + (__x_xpd__[4][3] * __y_xpd__[1][4])); __tmp_coord_array_2__[19] += ((__x_xpd__[4][1] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[1][1])); __tmp_coord_array_2__[20] += ((__x_xpd__[4][2] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[1][2])); __tmp_coord_array_2__[21] += ((__x_xpd__[4][3] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[1][3])); __tmp_coord_array_2__[22] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[1][0]) + (__x_xpd__[4][4] * __y_xpd__[1][1])); __tmp_coord_array_2__[23] += ((__x_xpd__[4][2] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[1][2])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[1][0]) + (__x_xpd__[4][4] * __y_xpd__[1][3])); __tmp_coord_array_2__[25] += ((__x_xpd__[4][4] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[1][0])); __tmp_coord_array_2__[31] += ((__x_xpd__[4][4] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[1][3]) + (__x_xpd__[4][0] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[1][1])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[6] += ((__x_xpd__[4][2] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][4])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[2][2]) + (__x_xpd__[4][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][5])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[2][3]) + (__x_xpd__[4][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][0])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][2]) + (__x_xpd__[4][3] * __y_xpd__[2][9])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][0]) + (__x_xpd__[4][1] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][6])); __tmp_coord_array_2__[11] += ((__x_xpd__[4][2] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][1])); __tmp_coord_array_2__[12] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][8]) + (__x_xpd__[4][3] * __y_xpd__[2][7])); __tmp_coord_array_2__[13] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][5]) + (__x_xpd__[4][1] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][6])); __tmp_coord_array_2__[14] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][3]) + (__x_xpd__[4][2] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][7])); __tmp_coord_array_2__[15] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][4])); __tmp_coord_array_2__[26] += ((__x_xpd__[4][3] * __y_xpd__[2][8]) + (__x_xpd__[4][1] * __y_xpd__[2][6]) + (__x_xpd__[4][2] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][9])); __tmp_coord_array_2__[27] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][0]) + (__x_xpd__[4][4] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][3]) + (__x_xpd__[4][3] * __y_xpd__[2][5])); __tmp_coord_array_2__[28] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][4]) + (__x_xpd__[4][4] * __y_xpd__[2][7]) + (__x_xpd__[4][1] * __y_xpd__[2][3])); __tmp_coord_array_2__[29] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][5]) + (__x_xpd__[4][2] * __y_xpd__[2][4]) + (__x_xpd__[4][4] * __y_xpd__[2][8])); __tmp_coord_array_2__[30] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[2][1]) + (__x_xpd__[4][4] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][2])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[1] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][9]) + (__x_xpd__[4][3] * __y_xpd__[3][8]) + (__x_xpd__[4][1] * __y_xpd__[3][6])); __tmp_coord_array_2__[2] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][0]) + (__x_xpd__[4][0] * __y_xpd__[3][6]) + (__x_xpd__[4][2] * __y_xpd__[3][3])); __tmp_coord_array_2__[3] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][7]) + (__x_xpd__[4][3] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][3])); __tmp_coord_array_2__[4] += ((__x_xpd__[4][1] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][4]) + (__x_xpd__[4][0] * __y_xpd__[3][8])); __tmp_coord_array_2__[5] += ((__x_xpd__[4][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[3][2])); __tmp_coord_array_2__[16] += ((__x_xpd__[4][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][2])); __tmp_coord_array_2__[17] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[3][0]) + (__x_xpd__[4][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][5])); __tmp_coord_array_2__[18] += ((__x_xpd__[4][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][3])); __tmp_coord_array_2__[19] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][8]) + (__x_xpd__[4][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][2])); __tmp_coord_array_2__[20] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][6]) + (__x_xpd__[4][1] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][0])); __tmp_coord_array_2__[21] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[3][1]) + (__x_xpd__[4][2] * __y_xpd__[3][9]) + (__x_xpd__[4][0] * __y_xpd__[3][7])); __tmp_coord_array_2__[22] += ((__x_xpd__[4][2] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][4]) + (__x_xpd__[4][3] * __y_xpd__[3][7])); __tmp_coord_array_2__[23] += ((__x_xpd__[4][4] * __y_xpd__[3][5]) + (__x_xpd__[4][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[3][6])); __tmp_coord_array_2__[24] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][6])); __tmp_coord_array_2__[25] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][5])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[0] += ((__x_xpd__[4][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[4][1]) + (__x_xpd__[4][4] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[4][3])); __tmp_coord_array_2__[6] += ((__x_xpd__[4][1] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[4][1])); __tmp_coord_array_2__[7] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[4][2]) + (__x_xpd__[4][2] * __y_xpd__[4][4])); __tmp_coord_array_2__[8] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[4][3]) + (__x_xpd__[4][3] * __y_xpd__[4][4])); __tmp_coord_array_2__[9] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[4][2]) + (__x_xpd__[4][2] * __y_xpd__[4][1])); __tmp_coord_array_2__[10] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[4][3]) + (__x_xpd__[4][3] * __y_xpd__[4][2])); __tmp_coord_array_2__[11] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[4][1]) + (__x_xpd__[4][1] * __y_xpd__[4][3])); __tmp_coord_array_2__[12] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[4][0]) + (__x_xpd__[4][0] * __y_xpd__[4][1])); __tmp_coord_array_2__[13] += ((__x_xpd__[4][0] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[4][0])); __tmp_coord_array_2__[14] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[4][0]) + (__x_xpd__[4][0] * __y_xpd__[4][3])); __tmp_coord_array_2__[15] += ((__x_xpd__[4][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[4][0])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[1] += (__x_xpd__[4][4] * __y_xpd__[5][0]); __tmp_coord_array_2__[2] += (__x_xpd__[4][1] * __y_xpd__[5][0]); __tmp_coord_array_2__[3] += (__x_xpd__[4][2] * __y_xpd__[5][0]); __tmp_coord_array_2__[4] += (__x_xpd__[4][3] * __y_xpd__[5][0]); __tmp_coord_array_2__[5] += (__x_xpd__[4][0] * __y_xpd__[5][0]); } } if (((x.m_gu & 32) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_2__[31] += (__x_xpd__[5][0] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_2__[26] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][4]); __tmp_coord_array_2__[27] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][1]); __tmp_coord_array_2__[28] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][2]); __tmp_coord_array_2__[29] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][3]); __tmp_coord_array_2__[30] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][0]); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_2__[16] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][6]); __tmp_coord_array_2__[17] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][7]); __tmp_coord_array_2__[18] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][8]); __tmp_coord_array_2__[19] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][3]); __tmp_coord_array_2__[20] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][4]); __tmp_coord_array_2__[21] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][5]); __tmp_coord_array_2__[22] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][0]); __tmp_coord_array_2__[23] += (__x_xpd__[5][0] * __y_xpd__[2][1]); __tmp_coord_array_2__[24] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][2]); __tmp_coord_array_2__[25] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][9]); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_2__[6] += (__x_xpd__[5][0] * __y_xpd__[3][6]); __tmp_coord_array_2__[7] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][7]); __tmp_coord_array_2__[8] += (__x_xpd__[5][0] * __y_xpd__[3][8]); __tmp_coord_array_2__[9] += (__x_xpd__[5][0] * __y_xpd__[3][3]); __tmp_coord_array_2__[10] += (__x_xpd__[5][0] * __y_xpd__[3][4]); __tmp_coord_array_2__[11] += (__x_xpd__[5][0] * __y_xpd__[3][5]); __tmp_coord_array_2__[12] += (__x_xpd__[5][0] * __y_xpd__[3][0]); __tmp_coord_array_2__[13] += (__x_xpd__[5][0] * __y_xpd__[3][1]); __tmp_coord_array_2__[14] += (__x_xpd__[5][0] * __y_xpd__[3][2]); __tmp_coord_array_2__[15] += (__x_xpd__[5][0] * __y_xpd__[3][9]); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_2__[1] += (__x_xpd__[5][0] * __y_xpd__[4][4]); __tmp_coord_array_2__[2] += (__x_xpd__[5][0] * __y_xpd__[4][1]); __tmp_coord_array_2__[3] += (__x_xpd__[5][0] * __y_xpd__[4][2]); __tmp_coord_array_2__[4] += (__x_xpd__[5][0] * __y_xpd__[4][3]); __tmp_coord_array_2__[5] += (__x_xpd__[5][0] * __y_xpd__[4][0]); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_2__[0] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[5][0]); } } __temp_var_1__ = mv_compress(__tmp_coord_array_2__); return __temp_var_1__; } mv gpEM(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_3__[32] ; mv_zero(__tmp_coord_array_3__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); if (((x.m_gu & 1) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[1] += (__x_xpd__[0][0] * __y_xpd__[1][0]); __tmp_coord_array_3__[2] += (__x_xpd__[0][0] * __y_xpd__[1][1]); __tmp_coord_array_3__[3] += (__x_xpd__[0][0] * __y_xpd__[1][2]); __tmp_coord_array_3__[4] += (__x_xpd__[0][0] * __y_xpd__[1][3]); __tmp_coord_array_3__[5] += (__x_xpd__[0][0] * __y_xpd__[1][4]); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[6] += (__x_xpd__[0][0] * __y_xpd__[2][0]); __tmp_coord_array_3__[7] += (__x_xpd__[0][0] * __y_xpd__[2][1]); __tmp_coord_array_3__[8] += (__x_xpd__[0][0] * __y_xpd__[2][2]); __tmp_coord_array_3__[9] += (__x_xpd__[0][0] * __y_xpd__[2][3]); __tmp_coord_array_3__[10] += (__x_xpd__[0][0] * __y_xpd__[2][4]); __tmp_coord_array_3__[11] += (__x_xpd__[0][0] * __y_xpd__[2][5]); __tmp_coord_array_3__[12] += (__x_xpd__[0][0] * __y_xpd__[2][6]); __tmp_coord_array_3__[13] += (__x_xpd__[0][0] * __y_xpd__[2][7]); __tmp_coord_array_3__[14] += (__x_xpd__[0][0] * __y_xpd__[2][8]); __tmp_coord_array_3__[15] += (__x_xpd__[0][0] * __y_xpd__[2][9]); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[16] += (__x_xpd__[0][0] * __y_xpd__[3][0]); __tmp_coord_array_3__[17] += (__x_xpd__[0][0] * __y_xpd__[3][1]); __tmp_coord_array_3__[18] += (__x_xpd__[0][0] * __y_xpd__[3][2]); __tmp_coord_array_3__[19] += (__x_xpd__[0][0] * __y_xpd__[3][3]); __tmp_coord_array_3__[20] += (__x_xpd__[0][0] * __y_xpd__[3][4]); __tmp_coord_array_3__[21] += (__x_xpd__[0][0] * __y_xpd__[3][5]); __tmp_coord_array_3__[22] += (__x_xpd__[0][0] * __y_xpd__[3][6]); __tmp_coord_array_3__[23] += (__x_xpd__[0][0] * __y_xpd__[3][7]); __tmp_coord_array_3__[24] += (__x_xpd__[0][0] * __y_xpd__[3][8]); __tmp_coord_array_3__[25] += (__x_xpd__[0][0] * __y_xpd__[3][9]); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[26] += (__x_xpd__[0][0] * __y_xpd__[4][0]); __tmp_coord_array_3__[27] += (__x_xpd__[0][0] * __y_xpd__[4][1]); __tmp_coord_array_3__[28] += (__x_xpd__[0][0] * __y_xpd__[4][2]); __tmp_coord_array_3__[29] += (__x_xpd__[0][0] * __y_xpd__[4][3]); __tmp_coord_array_3__[30] += (__x_xpd__[0][0] * __y_xpd__[4][4]); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[31] += (__x_xpd__[0][0] * __y_xpd__[5][0]); } } if (((x.m_gu & 2) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[1] += (__x_xpd__[1][0] * __y_xpd__[0][0]); __tmp_coord_array_3__[2] += (__x_xpd__[1][1] * __y_xpd__[0][0]); __tmp_coord_array_3__[3] += (__x_xpd__[1][2] * __y_xpd__[0][0]); __tmp_coord_array_3__[4] += (__x_xpd__[1][3] * __y_xpd__[0][0]); __tmp_coord_array_3__[5] += (__x_xpd__[1][4] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[0] += ((__x_xpd__[1][2] * __y_xpd__[1][2]) + (__x_xpd__[1][1] * __y_xpd__[1][1]) + (__x_xpd__[1][3] * __y_xpd__[1][3]) + (__x_xpd__[1][0] * __y_xpd__[1][0]) + (__x_xpd__[1][4] * __y_xpd__[1][4])); __tmp_coord_array_3__[6] += ((__x_xpd__[1][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[1][0])); __tmp_coord_array_3__[7] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[1][0]) + (__x_xpd__[1][0] * __y_xpd__[1][2])); __tmp_coord_array_3__[8] += ((__x_xpd__[1][0] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[1][0])); __tmp_coord_array_3__[9] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[1][1]) + (__x_xpd__[1][1] * __y_xpd__[1][2])); __tmp_coord_array_3__[10] += ((__x_xpd__[1][2] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[1][2])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[1][3]) + (__x_xpd__[1][3] * __y_xpd__[1][1])); __tmp_coord_array_3__[12] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][1]) + (__x_xpd__[1][1] * __y_xpd__[1][4])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][2]) + (__x_xpd__[1][2] * __y_xpd__[1][4])); __tmp_coord_array_3__[14] += ((__x_xpd__[1][3] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][3])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0]) + (__x_xpd__[1][0] * __y_xpd__[1][4])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[1] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][2])); __tmp_coord_array_3__[2] += ((__x_xpd__[1][0] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][3]) + (__x_xpd__[1][3] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][6])); __tmp_coord_array_3__[3] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[2][4]) + (__x_xpd__[1][1] * __y_xpd__[2][3]) + (__x_xpd__[1][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][7])); __tmp_coord_array_3__[4] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[2][8]) + (__x_xpd__[1][0] * __y_xpd__[2][2]) + (__x_xpd__[1][2] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][5])); __tmp_coord_array_3__[5] += ((__x_xpd__[1][0] * __y_xpd__[2][9]) + (__x_xpd__[1][3] * __y_xpd__[2][8]) + (__x_xpd__[1][2] * __y_xpd__[2][7]) + (__x_xpd__[1][1] * __y_xpd__[2][6])); __tmp_coord_array_3__[16] += ((__x_xpd__[1][2] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][7])); __tmp_coord_array_3__[17] += ((__x_xpd__[1][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][5])); __tmp_coord_array_3__[18] += ((__x_xpd__[1][4] * __y_xpd__[2][3]) + (__x_xpd__[1][1] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][6])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[2][9]) + (__x_xpd__[1][0] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][2])); __tmp_coord_array_3__[20] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][9]) + (__x_xpd__[1][0] * __y_xpd__[2][6]) + (__x_xpd__[1][4] * __y_xpd__[2][0])); __tmp_coord_array_3__[21] += ((__x_xpd__[1][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][9]) + (__x_xpd__[1][4] * __y_xpd__[2][1])); __tmp_coord_array_3__[22] += ((__x_xpd__[1][3] * __y_xpd__[2][1]) + (__x_xpd__[1][0] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][2])); __tmp_coord_array_3__[23] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[2][5]) + (__x_xpd__[1][3] * __y_xpd__[2][0])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][1]) + (__x_xpd__[1][2] * __y_xpd__[2][0]) + (__x_xpd__[1][0] * __y_xpd__[2][3])); __tmp_coord_array_3__[25] += ((__x_xpd__[1][1] * __y_xpd__[2][4]) + (__x_xpd__[1][3] * __y_xpd__[2][3]) + (__x_xpd__[1][2] * __y_xpd__[2][5])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[6] += ((__x_xpd__[1][4] * __y_xpd__[3][4]) + (__x_xpd__[1][3] * __y_xpd__[3][7]) + (__x_xpd__[1][2] * __y_xpd__[3][8])); __tmp_coord_array_3__[7] += ((__x_xpd__[1][3] * __y_xpd__[3][6]) + (__x_xpd__[1][4] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][8])); __tmp_coord_array_3__[8] += ((__x_xpd__[1][4] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][7])); __tmp_coord_array_3__[9] += ((__x_xpd__[1][3] * __y_xpd__[3][9]) + (__x_xpd__[1][4] * __y_xpd__[3][2]) + (__x_xpd__[1][0] * __y_xpd__[3][8])); __tmp_coord_array_3__[10] += ((__x_xpd__[1][1] * __y_xpd__[3][9]) + (__x_xpd__[1][4] * __y_xpd__[3][0]) + (__x_xpd__[1][0] * __y_xpd__[3][6])); __tmp_coord_array_3__[11] += ((__x_xpd__[1][2] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][7]) + (__x_xpd__[1][4] * __y_xpd__[3][1])); __tmp_coord_array_3__[12] += ((__x_xpd__[1][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][2]) + (__x_xpd__[1][0] * __y_xpd__[3][4])); __tmp_coord_array_3__[13] += ((__x_xpd__[1][0] * __y_xpd__[3][5]) + (__x_xpd__[1][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][0])); __tmp_coord_array_3__[14] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][1]) + (__x_xpd__[1][0] * __y_xpd__[3][3]) + (__x_xpd__[1][2] * __y_xpd__[3][0])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][4])); __tmp_coord_array_3__[26] += ((__x_xpd__[1][1] * __y_xpd__[3][0]) + (__x_xpd__[1][3] * __y_xpd__[3][2]) + (__x_xpd__[1][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][9])); __tmp_coord_array_3__[27] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[3][3]) + (__x_xpd__[1][0] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][6]) + (__x_xpd__[1][3] * __y_xpd__[3][5])); __tmp_coord_array_3__[28] += ((__x_xpd__[1][4] * __y_xpd__[3][7]) + (__x_xpd__[1][1] * __y_xpd__[3][3]) + (__x_xpd__[1][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][4])); __tmp_coord_array_3__[29] += ((__x_xpd__[1][0] * __y_xpd__[3][2]) + (__x_xpd__[1][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][5])); __tmp_coord_array_3__[30] += ((__x_xpd__[1][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][6]) + (__x_xpd__[1][2] * __y_xpd__[3][7])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[16] += ((__x_xpd__[1][1] * __y_xpd__[4][0]) + (__x_xpd__[1][0] * __y_xpd__[4][1])); __tmp_coord_array_3__[17] += ((__x_xpd__[1][0] * __y_xpd__[4][2]) + (__x_xpd__[1][2] * __y_xpd__[4][0])); __tmp_coord_array_3__[18] += ((__x_xpd__[1][0] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][0])); __tmp_coord_array_3__[19] += ((__x_xpd__[1][1] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][1])); __tmp_coord_array_3__[20] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][2]) + (__x_xpd__[1][2] * __y_xpd__[4][3])); __tmp_coord_array_3__[21] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][1])); __tmp_coord_array_3__[22] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][1])); __tmp_coord_array_3__[23] += ((__x_xpd__[1][2] * __y_xpd__[4][4]) + (__x_xpd__[1][4] * __y_xpd__[4][2])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][3])); __tmp_coord_array_3__[25] += ((__x_xpd__[1][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][0])); __tmp_coord_array_3__[31] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][3]) + (__x_xpd__[1][4] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][2])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[26] += (__x_xpd__[1][0] * __y_xpd__[5][0]); __tmp_coord_array_3__[27] += (-1.0f * __x_xpd__[1][1] * __y_xpd__[5][0]); __tmp_coord_array_3__[28] += (-1.0f * __x_xpd__[1][2] * __y_xpd__[5][0]); __tmp_coord_array_3__[29] += (-1.0f * __x_xpd__[1][3] * __y_xpd__[5][0]); __tmp_coord_array_3__[30] += (__x_xpd__[1][4] * __y_xpd__[5][0]); } } if (((x.m_gu & 4) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[6] += (__x_xpd__[2][0] * __y_xpd__[0][0]); __tmp_coord_array_3__[7] += (__x_xpd__[2][1] * __y_xpd__[0][0]); __tmp_coord_array_3__[8] += (__x_xpd__[2][2] * __y_xpd__[0][0]); __tmp_coord_array_3__[9] += (__x_xpd__[2][3] * __y_xpd__[0][0]); __tmp_coord_array_3__[10] += (__x_xpd__[2][4] * __y_xpd__[0][0]); __tmp_coord_array_3__[11] += (__x_xpd__[2][5] * __y_xpd__[0][0]); __tmp_coord_array_3__[12] += (__x_xpd__[2][6] * __y_xpd__[0][0]); __tmp_coord_array_3__[13] += (__x_xpd__[2][7] * __y_xpd__[0][0]); __tmp_coord_array_3__[14] += (__x_xpd__[2][8] * __y_xpd__[0][0]); __tmp_coord_array_3__[15] += (__x_xpd__[2][9] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[1] += ((__x_xpd__[2][2] * __y_xpd__[1][3]) + (__x_xpd__[2][9] * __y_xpd__[1][4]) + (__x_xpd__[2][0] * __y_xpd__[1][1]) + (__x_xpd__[2][1] * __y_xpd__[1][2])); __tmp_coord_array_3__[2] += ((__x_xpd__[2][6] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[1][0]) + (__x_xpd__[2][3] * __y_xpd__[1][2])); __tmp_coord_array_3__[3] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[1][1]) + (__x_xpd__[2][4] * __y_xpd__[1][3]) + (__x_xpd__[2][7] * __y_xpd__[1][4])); __tmp_coord_array_3__[4] += ((__x_xpd__[2][8] * __y_xpd__[1][4]) + (__x_xpd__[2][5] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[1][2])); __tmp_coord_array_3__[5] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[1][2])); __tmp_coord_array_3__[16] += ((__x_xpd__[2][4] * __y_xpd__[1][4]) + (__x_xpd__[2][8] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[1][3])); __tmp_coord_array_3__[17] += ((__x_xpd__[2][5] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[1][1]) + (__x_xpd__[2][6] * __y_xpd__[1][3])); __tmp_coord_array_3__[18] += ((__x_xpd__[2][3] * __y_xpd__[1][4]) + (__x_xpd__[2][7] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[1][2])); __tmp_coord_array_3__[19] += ((__x_xpd__[2][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][3]) + (__x_xpd__[2][8] * __y_xpd__[1][0])); __tmp_coord_array_3__[20] += ((__x_xpd__[2][0] * __y_xpd__[1][4]) + (__x_xpd__[2][6] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][1])); __tmp_coord_array_3__[21] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[1][2]) + (__x_xpd__[2][7] * __y_xpd__[1][0]) + (__x_xpd__[2][1] * __y_xpd__[1][4])); __tmp_coord_array_3__[22] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[1][2]) + (__x_xpd__[2][1] * __y_xpd__[1][3]) + (__x_xpd__[2][4] * __y_xpd__[1][0])); __tmp_coord_array_3__[23] += ((__x_xpd__[2][0] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[1][0])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[1][1]) + (__x_xpd__[2][0] * __y_xpd__[1][2]) + (__x_xpd__[2][3] * __y_xpd__[1][0])); __tmp_coord_array_3__[25] += ((__x_xpd__[2][5] * __y_xpd__[1][2]) + (__x_xpd__[2][3] * __y_xpd__[1][3]) + (__x_xpd__[2][4] * __y_xpd__[1][1])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[0] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][2])); __tmp_coord_array_3__[6] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][2]) + (__x_xpd__[2][3] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][3]) + (__x_xpd__[2][2] * __y_xpd__[2][5]) + (__x_xpd__[2][6] * __y_xpd__[2][9])); __tmp_coord_array_3__[7] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[2][0]) + (__x_xpd__[2][4] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][7]) + (__x_xpd__[2][7] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][4]) + (__x_xpd__[2][0] * __y_xpd__[2][3])); __tmp_coord_array_3__[8] += ((__x_xpd__[2][5] * __y_xpd__[2][0]) + (__x_xpd__[2][1] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][8]) + (__x_xpd__[2][8] * __y_xpd__[2][9])); __tmp_coord_array_3__[9] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[2][5]) + (__x_xpd__[2][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][1]) + (__x_xpd__[2][5] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][7]) + (__x_xpd__[2][7] * __y_xpd__[2][6])); __tmp_coord_array_3__[10] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][3]) + (__x_xpd__[2][8] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][8]) + (__x_xpd__[2][3] * __y_xpd__[2][5]) + (__x_xpd__[2][2] * __y_xpd__[2][1])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[2][4]) + (__x_xpd__[2][0] * __y_xpd__[2][2]) + (__x_xpd__[2][6] * __y_xpd__[2][8]) + (__x_xpd__[2][4] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][0])); __tmp_coord_array_3__[12] += ((__x_xpd__[2][3] * __y_xpd__[2][7]) + (__x_xpd__[2][8] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][9]) + (__x_xpd__[2][9] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[2][8])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[2][4]) + (__x_xpd__[2][4] * __y_xpd__[2][8]) + (__x_xpd__[2][9] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][6]) + (__x_xpd__[2][6] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][9])); __tmp_coord_array_3__[14] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][5]) + (__x_xpd__[2][9] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][9]) + (__x_xpd__[2][5] * __y_xpd__[2][6]) + (__x_xpd__[2][7] * __y_xpd__[2][4])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[2][0]) + (__x_xpd__[2][1] * __y_xpd__[2][7]) + (__x_xpd__[2][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][2]) + (__x_xpd__[2][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][1])); __tmp_coord_array_3__[26] += ((__x_xpd__[2][8] * __y_xpd__[2][3]) + (__x_xpd__[2][3] * __y_xpd__[2][8]) + (__x_xpd__[2][6] * __y_xpd__[2][4]) + (__x_xpd__[2][4] * __y_xpd__[2][6]) + (__x_xpd__[2][7] * __y_xpd__[2][5]) + (__x_xpd__[2][5] * __y_xpd__[2][7])); __tmp_coord_array_3__[27] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[2][7]) + (__x_xpd__[2][1] * __y_xpd__[2][8]) + (__x_xpd__[2][8] * __y_xpd__[2][1]) + (__x_xpd__[2][4] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][2]) + (__x_xpd__[2][9] * __y_xpd__[2][4])); __tmp_coord_array_3__[28] += ((__x_xpd__[2][5] * __y_xpd__[2][9]) + (__x_xpd__[2][2] * __y_xpd__[2][6]) + (__x_xpd__[2][6] * __y_xpd__[2][2]) + (__x_xpd__[2][9] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][8])); __tmp_coord_array_3__[29] += ((__x_xpd__[2][7] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][1]) + (__x_xpd__[2][3] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][6]) + (__x_xpd__[2][9] * __y_xpd__[2][3]) + (__x_xpd__[2][0] * __y_xpd__[2][7])); __tmp_coord_array_3__[30] += ((__x_xpd__[2][3] * __y_xpd__[2][2]) + (__x_xpd__[2][1] * __y_xpd__[2][5]) + (__x_xpd__[2][2] * __y_xpd__[2][3]) + (__x_xpd__[2][4] * __y_xpd__[2][0]) + (__x_xpd__[2][5] * __y_xpd__[2][1]) + (__x_xpd__[2][0] * __y_xpd__[2][4])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[1] += ((__x_xpd__[2][5] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][3])); __tmp_coord_array_3__[2] += ((__x_xpd__[2][9] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][2]) + (__x_xpd__[2][2] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][9]) + (__x_xpd__[2][1] * __y_xpd__[3][8]) + (__x_xpd__[2][8] * __y_xpd__[3][1])); __tmp_coord_array_3__[3] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][9]) + (__x_xpd__[2][9] * __y_xpd__[3][5]) + (__x_xpd__[2][6] * __y_xpd__[3][2]) + (__x_xpd__[2][2] * __y_xpd__[3][6])); __tmp_coord_array_3__[4] += ((__x_xpd__[2][7] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][1]) + (__x_xpd__[2][9] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][7])); __tmp_coord_array_3__[5] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][0])); __tmp_coord_array_3__[16] += ((__x_xpd__[2][2] * __y_xpd__[3][5]) + (__x_xpd__[2][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][9])); __tmp_coord_array_3__[17] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][9]) + (__x_xpd__[2][4] * __y_xpd__[3][2]) + (__x_xpd__[2][9] * __y_xpd__[3][7]) + (__x_xpd__[2][0] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][0])); __tmp_coord_array_3__[18] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][8]) + (__x_xpd__[2][5] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][1]) + (__x_xpd__[2][1] * __y_xpd__[3][4])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[3][1]) + (__x_xpd__[2][5] * __y_xpd__[3][4]) + (__x_xpd__[2][1] * __y_xpd__[3][0]) + (__x_xpd__[2][6] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][5]) + (__x_xpd__[2][7] * __y_xpd__[3][6])); __tmp_coord_array_3__[20] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[3][7]) + (__x_xpd__[2][3] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][3]) + (__x_xpd__[2][2] * __y_xpd__[3][1])); __tmp_coord_array_3__[21] += ((__x_xpd__[2][4] * __y_xpd__[3][3]) + (__x_xpd__[2][6] * __y_xpd__[3][8]) + (__x_xpd__[2][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][6])); __tmp_coord_array_3__[22] += ((__x_xpd__[2][0] * __y_xpd__[3][9]) + (__x_xpd__[2][8] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][7]) + (__x_xpd__[2][9] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][8])); __tmp_coord_array_3__[23] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][3]) + (__x_xpd__[2][8] * __y_xpd__[3][4]) + (__x_xpd__[2][3] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][1])); __tmp_coord_array_3__[24] += ((__x_xpd__[2][4] * __y_xpd__[3][7]) + (__x_xpd__[2][9] * __y_xpd__[3][2]) + (__x_xpd__[2][2] * __y_xpd__[3][9]) + (__x_xpd__[2][5] * __y_xpd__[3][6]) + (__x_xpd__[2][7] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][5])); __tmp_coord_array_3__[25] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[3][8]) + (__x_xpd__[2][8] * __y_xpd__[3][2]) + (__x_xpd__[2][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][6]) + (__x_xpd__[2][7] * __y_xpd__[3][1]) + (__x_xpd__[2][6] * __y_xpd__[3][0])); __tmp_coord_array_3__[31] += ((__x_xpd__[2][5] * __y_xpd__[3][5]) + (__x_xpd__[2][0] * __y_xpd__[3][0]) + (__x_xpd__[2][3] * __y_xpd__[3][3]) + (__x_xpd__[2][6] * __y_xpd__[3][6]) + (__x_xpd__[2][1] * __y_xpd__[3][1]) + (__x_xpd__[2][4] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][7]) + (__x_xpd__[2][2] * __y_xpd__[3][2]) + (__x_xpd__[2][8] * __y_xpd__[3][8])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[6] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[4][4]) + (__x_xpd__[2][8] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][3])); __tmp_coord_array_3__[7] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][4]) + (__x_xpd__[2][6] * __y_xpd__[4][3])); __tmp_coord_array_3__[8] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][4]) + (__x_xpd__[2][7] * __y_xpd__[4][1])); __tmp_coord_array_3__[9] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][4])); __tmp_coord_array_3__[10] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][0])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[4][2])); __tmp_coord_array_3__[12] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[4][0]) + (__x_xpd__[2][1] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][2])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[4][3]) + (__x_xpd__[2][2] * __y_xpd__[4][1])); __tmp_coord_array_3__[14] += ((-1.0f * __x_xpd__[2][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][0]) + (__x_xpd__[2][0] * __y_xpd__[4][2])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][3])); __tmp_coord_array_3__[26] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[4][2]) + (__x_xpd__[2][9] * __y_xpd__[4][4])); __tmp_coord_array_3__[27] += ((__x_xpd__[2][3] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][4]) + (__x_xpd__[2][0] * __y_xpd__[4][0])); __tmp_coord_array_3__[28] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[4][4]) + (__x_xpd__[2][1] * __y_xpd__[4][0]) + (__x_xpd__[2][4] * __y_xpd__[4][3])); __tmp_coord_array_3__[29] += ((-1.0f * __x_xpd__[2][4] * __y_xpd__[4][2]) + (__x_xpd__[2][2] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][4]) + (__x_xpd__[2][5] * __y_xpd__[4][1])); __tmp_coord_array_3__[30] += ((-1.0f * __x_xpd__[2][9] * __y_xpd__[4][0]) + (__x_xpd__[2][7] * __y_xpd__[4][2]) + (__x_xpd__[2][6] * __y_xpd__[4][1]) + (__x_xpd__[2][8] * __y_xpd__[4][3])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[16] += (-1.0f * __x_xpd__[2][0] * __y_xpd__[5][0]); __tmp_coord_array_3__[17] += (-1.0f * __x_xpd__[2][1] * __y_xpd__[5][0]); __tmp_coord_array_3__[18] += (-1.0f * __x_xpd__[2][2] * __y_xpd__[5][0]); __tmp_coord_array_3__[19] += (-1.0f * __x_xpd__[2][3] * __y_xpd__[5][0]); __tmp_coord_array_3__[20] += (-1.0f * __x_xpd__[2][4] * __y_xpd__[5][0]); __tmp_coord_array_3__[21] += (-1.0f * __x_xpd__[2][5] * __y_xpd__[5][0]); __tmp_coord_array_3__[22] += (-1.0f * __x_xpd__[2][6] * __y_xpd__[5][0]); __tmp_coord_array_3__[23] += (__x_xpd__[2][7] * __y_xpd__[5][0]); __tmp_coord_array_3__[24] += (-1.0f * __x_xpd__[2][8] * __y_xpd__[5][0]); __tmp_coord_array_3__[25] += (__x_xpd__[2][9] * __y_xpd__[5][0]); } } if (((x.m_gu & 8) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[16] += (__x_xpd__[3][0] * __y_xpd__[0][0]); __tmp_coord_array_3__[17] += (__x_xpd__[3][1] * __y_xpd__[0][0]); __tmp_coord_array_3__[18] += (__x_xpd__[3][2] * __y_xpd__[0][0]); __tmp_coord_array_3__[19] += (__x_xpd__[3][3] * __y_xpd__[0][0]); __tmp_coord_array_3__[20] += (__x_xpd__[3][4] * __y_xpd__[0][0]); __tmp_coord_array_3__[21] += (__x_xpd__[3][5] * __y_xpd__[0][0]); __tmp_coord_array_3__[22] += (__x_xpd__[3][6] * __y_xpd__[0][0]); __tmp_coord_array_3__[23] += (__x_xpd__[3][7] * __y_xpd__[0][0]); __tmp_coord_array_3__[24] += (__x_xpd__[3][8] * __y_xpd__[0][0]); __tmp_coord_array_3__[25] += (__x_xpd__[3][9] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[6] += ((__x_xpd__[3][4] * __y_xpd__[1][4]) + (__x_xpd__[3][7] * __y_xpd__[1][3]) + (__x_xpd__[3][8] * __y_xpd__[1][2])); __tmp_coord_array_3__[7] += ((__x_xpd__[3][6] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[1][1]) + (__x_xpd__[3][5] * __y_xpd__[1][4])); __tmp_coord_array_3__[8] += ((__x_xpd__[3][3] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][1])); __tmp_coord_array_3__[9] += ((__x_xpd__[3][8] * __y_xpd__[1][0]) + (__x_xpd__[3][9] * __y_xpd__[1][3]) + (__x_xpd__[3][2] * __y_xpd__[1][4])); __tmp_coord_array_3__[10] += ((__x_xpd__[3][9] * __y_xpd__[1][1]) + (__x_xpd__[3][0] * __y_xpd__[1][4]) + (__x_xpd__[3][6] * __y_xpd__[1][0])); __tmp_coord_array_3__[11] += ((__x_xpd__[3][9] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][0]) + (__x_xpd__[3][1] * __y_xpd__[1][4])); __tmp_coord_array_3__[12] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][2]) + (__x_xpd__[3][4] * __y_xpd__[1][0]) + (__x_xpd__[3][1] * __y_xpd__[1][3])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[1][3]) + (__x_xpd__[3][2] * __y_xpd__[1][1]) + (__x_xpd__[3][5] * __y_xpd__[1][0])); __tmp_coord_array_3__[14] += ((__x_xpd__[3][3] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][1]) + (__x_xpd__[3][0] * __y_xpd__[1][2])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][1])); __tmp_coord_array_3__[26] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][2]) + (__x_xpd__[3][9] * __y_xpd__[1][4])); __tmp_coord_array_3__[27] += ((__x_xpd__[3][6] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][0]) + (__x_xpd__[3][3] * __y_xpd__[1][2])); __tmp_coord_array_3__[28] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[1][1]) + (__x_xpd__[3][4] * __y_xpd__[1][3])); __tmp_coord_array_3__[29] += ((__x_xpd__[3][5] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[1][0]) + (__x_xpd__[3][8] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][2])); __tmp_coord_array_3__[30] += ((__x_xpd__[3][8] * __y_xpd__[1][3]) + (__x_xpd__[3][6] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[1][0])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[1] += ((-1.0f * __x_xpd__[3][5] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][8]) + (__x_xpd__[3][7] * __y_xpd__[2][5])); __tmp_coord_array_3__[2] += ((__x_xpd__[3][8] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][7]) + (__x_xpd__[3][1] * __y_xpd__[2][8]) + (__x_xpd__[3][7] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][4]) + (__x_xpd__[3][4] * __y_xpd__[2][9])); __tmp_coord_array_3__[3] += ((__x_xpd__[3][5] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][5]) + (__x_xpd__[3][2] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][8]) + (__x_xpd__[3][6] * __y_xpd__[2][2])); __tmp_coord_array_3__[4] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[2][0]) + (__x_xpd__[3][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][1]) + (__x_xpd__[3][3] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][6])); __tmp_coord_array_3__[5] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][5])); __tmp_coord_array_3__[16] += ((__x_xpd__[3][6] * __y_xpd__[2][9]) + (__x_xpd__[3][2] * __y_xpd__[2][5]) + (__x_xpd__[3][9] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][2]) + (__x_xpd__[3][3] * __y_xpd__[2][1])); __tmp_coord_array_3__[17] += ((__x_xpd__[3][4] * __y_xpd__[2][2]) + (__x_xpd__[3][0] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][9]) + (__x_xpd__[3][9] * __y_xpd__[2][7])); __tmp_coord_array_3__[18] += ((__x_xpd__[3][8] * __y_xpd__[2][9]) + (__x_xpd__[3][5] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][1]) + (__x_xpd__[3][1] * __y_xpd__[2][4]) + (__x_xpd__[3][9] * __y_xpd__[2][8])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[2][7]) + (__x_xpd__[3][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][1]) + (__x_xpd__[3][5] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][6])); __tmp_coord_array_3__[20] += ((__x_xpd__[3][7] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][2]) + (__x_xpd__[3][8] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][3]) + (__x_xpd__[3][3] * __y_xpd__[2][5]) + (__x_xpd__[3][2] * __y_xpd__[2][1])); __tmp_coord_array_3__[21] += ((__x_xpd__[3][6] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][0]) + (__x_xpd__[3][0] * __y_xpd__[2][2]) + (__x_xpd__[3][4] * __y_xpd__[2][3])); __tmp_coord_array_3__[22] += ((__x_xpd__[3][8] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][0]) + (__x_xpd__[3][7] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[2][9]) + (__x_xpd__[3][3] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[2][8])); __tmp_coord_array_3__[23] += ((__x_xpd__[3][8] * __y_xpd__[2][4]) + (__x_xpd__[3][9] * __y_xpd__[2][1]) + (__x_xpd__[3][1] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][3]) + (__x_xpd__[3][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][8])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[3][9] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][9]) + (__x_xpd__[3][5] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[2][7])); __tmp_coord_array_3__[25] += ((-1.0f * __x_xpd__[3][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[2][7]) + (__x_xpd__[3][8] * __y_xpd__[2][2]) + (__x_xpd__[3][6] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][1])); __tmp_coord_array_3__[31] += ((__x_xpd__[3][2] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][7]) + (__x_xpd__[3][4] * __y_xpd__[2][4]) + (__x_xpd__[3][0] * __y_xpd__[2][0]) + (__x_xpd__[3][3] * __y_xpd__[2][3]) + (__x_xpd__[3][5] * __y_xpd__[2][5]) + (__x_xpd__[3][6] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][9]) + (__x_xpd__[3][8] * __y_xpd__[2][8]) + (__x_xpd__[3][1] * __y_xpd__[2][1])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[0] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][6])); __tmp_coord_array_3__[6] += ((__x_xpd__[3][3] * __y_xpd__[3][1]) + (__x_xpd__[3][9] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][2]) + (__x_xpd__[3][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][3])); __tmp_coord_array_3__[7] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][0]) + (__x_xpd__[3][0] * __y_xpd__[3][3]) + (__x_xpd__[3][7] * __y_xpd__[3][9]) + (__x_xpd__[3][4] * __y_xpd__[3][2])); __tmp_coord_array_3__[8] += ((__x_xpd__[3][5] * __y_xpd__[3][0]) + (__x_xpd__[3][1] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][1]) + (__x_xpd__[3][9] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][9])); __tmp_coord_array_3__[9] += ((__x_xpd__[3][5] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][5]) + (__x_xpd__[3][6] * __y_xpd__[3][7]) + (__x_xpd__[3][1] * __y_xpd__[3][0])); __tmp_coord_array_3__[10] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[3][2]) + (__x_xpd__[3][7] * __y_xpd__[3][8]) + (__x_xpd__[3][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][3]) + (__x_xpd__[3][3] * __y_xpd__[3][5])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[3][3] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[3][0]) + (__x_xpd__[3][0] * __y_xpd__[3][2]) + (__x_xpd__[3][4] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][6]) + (__x_xpd__[3][6] * __y_xpd__[3][8])); __tmp_coord_array_3__[12] += ((-1.0f * __x_xpd__[3][9] * __y_xpd__[3][0]) + (__x_xpd__[3][7] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][7]) + (__x_xpd__[3][0] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][8]) + (__x_xpd__[3][8] * __y_xpd__[3][5])); __tmp_coord_array_3__[13] += ((__x_xpd__[3][6] * __y_xpd__[3][3]) + (__x_xpd__[3][1] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][1]) + (__x_xpd__[3][4] * __y_xpd__[3][8])); __tmp_coord_array_3__[14] += ((__x_xpd__[3][2] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][4]) + (__x_xpd__[3][4] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][2]) + (__x_xpd__[3][5] * __y_xpd__[3][6])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[3][2]) + (__x_xpd__[3][0] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][7]) + (__x_xpd__[3][7] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][0]) + (__x_xpd__[3][2] * __y_xpd__[3][8])); __tmp_coord_array_3__[26] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[3][5]) + (__x_xpd__[3][3] * __y_xpd__[3][8]) + (__x_xpd__[3][4] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][7]) + (__x_xpd__[3][6] * __y_xpd__[3][4]) + (__x_xpd__[3][8] * __y_xpd__[3][3])); __tmp_coord_array_3__[27] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[3][9]) + (__x_xpd__[3][7] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][4]) + (__x_xpd__[3][1] * __y_xpd__[3][8]) + (__x_xpd__[3][8] * __y_xpd__[3][1]) + (__x_xpd__[3][2] * __y_xpd__[3][7])); __tmp_coord_array_3__[28] += ((__x_xpd__[3][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][0]) + (__x_xpd__[3][6] * __y_xpd__[3][2])); __tmp_coord_array_3__[29] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][6])); __tmp_coord_array_3__[30] += ((__x_xpd__[3][0] * __y_xpd__[3][4]) + (__x_xpd__[3][3] * __y_xpd__[3][2]) + (__x_xpd__[3][4] * __y_xpd__[3][0]) + (__x_xpd__[3][1] * __y_xpd__[3][5]) + (__x_xpd__[3][5] * __y_xpd__[3][1]) + (__x_xpd__[3][2] * __y_xpd__[3][3])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[1] += ((__x_xpd__[3][9] * __y_xpd__[4][4]) + (__x_xpd__[3][0] * __y_xpd__[4][1]) + (__x_xpd__[3][1] * __y_xpd__[4][2]) + (__x_xpd__[3][2] * __y_xpd__[4][3])); __tmp_coord_array_3__[2] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][3]) + (__x_xpd__[3][0] * __y_xpd__[4][0]) + (__x_xpd__[3][3] * __y_xpd__[4][2])); __tmp_coord_array_3__[3] += ((__x_xpd__[3][4] * __y_xpd__[4][3]) + (__x_xpd__[3][7] * __y_xpd__[4][4]) + (__x_xpd__[3][1] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][1])); __tmp_coord_array_3__[4] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[4][2]) + (__x_xpd__[3][2] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][4]) + (__x_xpd__[3][5] * __y_xpd__[4][1])); __tmp_coord_array_3__[5] += ((__x_xpd__[3][7] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[4][0])); __tmp_coord_array_3__[16] += ((__x_xpd__[3][7] * __y_xpd__[4][3]) + (__x_xpd__[3][8] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[4][4])); __tmp_coord_array_3__[17] += ((__x_xpd__[3][6] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][4])); __tmp_coord_array_3__[18] += ((-1.0f * __x_xpd__[3][7] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][4])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[4][4]) + (__x_xpd__[3][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][0])); __tmp_coord_array_3__[20] += ((__x_xpd__[3][9] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][0])); __tmp_coord_array_3__[21] += ((__x_xpd__[3][7] * __y_xpd__[4][0]) + (__x_xpd__[3][9] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[4][4])); __tmp_coord_array_3__[22] += ((__x_xpd__[3][1] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[4][2])); __tmp_coord_array_3__[23] += ((__x_xpd__[3][0] * __y_xpd__[4][3]) + (__x_xpd__[3][5] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[4][1])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][0]) + (__x_xpd__[3][0] * __y_xpd__[4][2])); __tmp_coord_array_3__[25] += ((__x_xpd__[3][5] * __y_xpd__[4][2]) + (__x_xpd__[3][4] * __y_xpd__[4][1]) + (__x_xpd__[3][3] * __y_xpd__[4][3])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[6] += (-1.0f * __x_xpd__[3][0] * __y_xpd__[5][0]); __tmp_coord_array_3__[7] += (-1.0f * __x_xpd__[3][1] * __y_xpd__[5][0]); __tmp_coord_array_3__[8] += (-1.0f * __x_xpd__[3][2] * __y_xpd__[5][0]); __tmp_coord_array_3__[9] += (-1.0f * __x_xpd__[3][3] * __y_xpd__[5][0]); __tmp_coord_array_3__[10] += (-1.0f * __x_xpd__[3][4] * __y_xpd__[5][0]); __tmp_coord_array_3__[11] += (-1.0f * __x_xpd__[3][5] * __y_xpd__[5][0]); __tmp_coord_array_3__[12] += (-1.0f * __x_xpd__[3][6] * __y_xpd__[5][0]); __tmp_coord_array_3__[13] += (__x_xpd__[3][7] * __y_xpd__[5][0]); __tmp_coord_array_3__[14] += (-1.0f * __x_xpd__[3][8] * __y_xpd__[5][0]); __tmp_coord_array_3__[15] += (__x_xpd__[3][9] * __y_xpd__[5][0]); } } if (((x.m_gu & 16) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[26] += (__x_xpd__[4][0] * __y_xpd__[0][0]); __tmp_coord_array_3__[27] += (__x_xpd__[4][1] * __y_xpd__[0][0]); __tmp_coord_array_3__[28] += (__x_xpd__[4][2] * __y_xpd__[0][0]); __tmp_coord_array_3__[29] += (__x_xpd__[4][3] * __y_xpd__[0][0]); __tmp_coord_array_3__[30] += (__x_xpd__[4][4] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[16] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[1][0])); __tmp_coord_array_3__[17] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[1][0])); __tmp_coord_array_3__[18] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[1][3])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[1][1]) + (__x_xpd__[4][1] * __y_xpd__[1][2])); __tmp_coord_array_3__[20] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[1][2]) + (__x_xpd__[4][2] * __y_xpd__[1][3])); __tmp_coord_array_3__[21] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[1][3]) + (__x_xpd__[4][3] * __y_xpd__[1][1])); __tmp_coord_array_3__[22] += ((__x_xpd__[4][1] * __y_xpd__[1][4]) + (__x_xpd__[4][4] * __y_xpd__[1][1])); __tmp_coord_array_3__[23] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[1][4])); __tmp_coord_array_3__[24] += ((__x_xpd__[4][3] * __y_xpd__[1][4]) + (__x_xpd__[4][4] * __y_xpd__[1][3])); __tmp_coord_array_3__[25] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[1][0]) + (__x_xpd__[4][0] * __y_xpd__[1][4])); __tmp_coord_array_3__[31] += ((__x_xpd__[4][0] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[1][2]) + (__x_xpd__[4][4] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[1][1])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[6] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][4]) + (__x_xpd__[4][2] * __y_xpd__[2][8])); __tmp_coord_array_3__[7] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[2][8]) + (__x_xpd__[4][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][5])); __tmp_coord_array_3__[8] += ((__x_xpd__[4][1] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][6])); __tmp_coord_array_3__[9] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][2])); __tmp_coord_array_3__[10] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][0])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][1])); __tmp_coord_array_3__[12] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][2]) + (__x_xpd__[4][3] * __y_xpd__[2][1])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[2][0]) + (__x_xpd__[4][1] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][5])); __tmp_coord_array_3__[14] += ((__x_xpd__[4][2] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][3])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][3])); __tmp_coord_array_3__[26] += ((__x_xpd__[4][1] * __y_xpd__[2][0]) + (__x_xpd__[4][2] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[2][9]) + (__x_xpd__[4][3] * __y_xpd__[2][2])); __tmp_coord_array_3__[27] += ((__x_xpd__[4][4] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][0]) + (__x_xpd__[4][3] * __y_xpd__[2][5])); __tmp_coord_array_3__[28] += ((__x_xpd__[4][1] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][4]) + (__x_xpd__[4][4] * __y_xpd__[2][7])); __tmp_coord_array_3__[29] += ((__x_xpd__[4][4] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[2][5]) + (__x_xpd__[4][2] * __y_xpd__[2][4])); __tmp_coord_array_3__[30] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[2][7]) + (__x_xpd__[4][0] * __y_xpd__[2][9])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[1] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][0])); __tmp_coord_array_3__[2] += ((__x_xpd__[4][3] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][0]) + (__x_xpd__[4][4] * __y_xpd__[3][6])); __tmp_coord_array_3__[3] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[3][4]) + (__x_xpd__[4][1] * __y_xpd__[3][3])); __tmp_coord_array_3__[4] += ((__x_xpd__[4][4] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][5]) + (__x_xpd__[4][2] * __y_xpd__[3][4])); __tmp_coord_array_3__[5] += ((__x_xpd__[4][3] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][7]) + (__x_xpd__[4][1] * __y_xpd__[3][6]) + (__x_xpd__[4][0] * __y_xpd__[3][9])); __tmp_coord_array_3__[16] += ((__x_xpd__[4][2] * __y_xpd__[3][8]) + (__x_xpd__[4][3] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][4])); __tmp_coord_array_3__[17] += ((__x_xpd__[4][3] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][5])); __tmp_coord_array_3__[18] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][3])); __tmp_coord_array_3__[19] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][2]) + (__x_xpd__[4][3] * __y_xpd__[3][9])); __tmp_coord_array_3__[20] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][0]) + (__x_xpd__[4][1] * __y_xpd__[3][9])); __tmp_coord_array_3__[21] += ((__x_xpd__[4][2] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[4][4] * __y_xpd__[3][1]) + (__x_xpd__[4][0] * __y_xpd__[3][7])); __tmp_coord_array_3__[22] += ((__x_xpd__[4][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[4][2] * __y_xpd__[3][2])); __tmp_coord_array_3__[23] += ((__x_xpd__[4][0] * __y_xpd__[3][5]) + (__x_xpd__[4][3] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][2])); __tmp_coord_array_3__[24] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[3][3]) + (__x_xpd__[4][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[3][1])); __tmp_coord_array_3__[25] += ((__x_xpd__[4][3] * __y_xpd__[3][3]) + (__x_xpd__[4][2] * __y_xpd__[3][5]) + (__x_xpd__[4][1] * __y_xpd__[3][4])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[0] += ((__x_xpd__[4][4] * __y_xpd__[4][4]) + (__x_xpd__[4][1] * __y_xpd__[4][1]) + (__x_xpd__[4][0] * __y_xpd__[4][0]) + (__x_xpd__[4][3] * __y_xpd__[4][3]) + (__x_xpd__[4][2] * __y_xpd__[4][2])); __tmp_coord_array_3__[6] += ((-1.0f * __x_xpd__[4][0] * __y_xpd__[4][1]) + (__x_xpd__[4][1] * __y_xpd__[4][0])); __tmp_coord_array_3__[7] += ((__x_xpd__[4][2] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[4][2])); __tmp_coord_array_3__[8] += ((__x_xpd__[4][3] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[4][0] * __y_xpd__[4][3])); __tmp_coord_array_3__[9] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[4][1]) + (__x_xpd__[4][1] * __y_xpd__[4][2])); __tmp_coord_array_3__[10] += ((-1.0f * __x_xpd__[4][3] * __y_xpd__[4][2]) + (__x_xpd__[4][2] * __y_xpd__[4][3])); __tmp_coord_array_3__[11] += ((-1.0f * __x_xpd__[4][1] * __y_xpd__[4][3]) + (__x_xpd__[4][3] * __y_xpd__[4][1])); __tmp_coord_array_3__[12] += ((__x_xpd__[4][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[4][4])); __tmp_coord_array_3__[13] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[4][4]) + (__x_xpd__[4][4] * __y_xpd__[4][2])); __tmp_coord_array_3__[14] += ((__x_xpd__[4][4] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[4][4])); __tmp_coord_array_3__[15] += ((-1.0f * __x_xpd__[4][4] * __y_xpd__[4][0]) + (__x_xpd__[4][0] * __y_xpd__[4][4])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[1] += (__x_xpd__[4][0] * __y_xpd__[5][0]); __tmp_coord_array_3__[2] += (-1.0f * __x_xpd__[4][1] * __y_xpd__[5][0]); __tmp_coord_array_3__[3] += (-1.0f * __x_xpd__[4][2] * __y_xpd__[5][0]); __tmp_coord_array_3__[4] += (-1.0f * __x_xpd__[4][3] * __y_xpd__[5][0]); __tmp_coord_array_3__[5] += (__x_xpd__[4][4] * __y_xpd__[5][0]); } } if (((x.m_gu & 32) != 0)) { if (((y.m_gu & 1) != 0)) { __tmp_coord_array_3__[31] += (__x_xpd__[5][0] * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_3__[26] += (__x_xpd__[5][0] * __y_xpd__[1][0]); __tmp_coord_array_3__[27] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][1]); __tmp_coord_array_3__[28] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][2]); __tmp_coord_array_3__[29] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[1][3]); __tmp_coord_array_3__[30] += (__x_xpd__[5][0] * __y_xpd__[1][4]); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_3__[16] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][0]); __tmp_coord_array_3__[17] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][1]); __tmp_coord_array_3__[18] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][2]); __tmp_coord_array_3__[19] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][3]); __tmp_coord_array_3__[20] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][4]); __tmp_coord_array_3__[21] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][5]); __tmp_coord_array_3__[22] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][6]); __tmp_coord_array_3__[23] += (__x_xpd__[5][0] * __y_xpd__[2][7]); __tmp_coord_array_3__[24] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[2][8]); __tmp_coord_array_3__[25] += (__x_xpd__[5][0] * __y_xpd__[2][9]); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_3__[6] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][0]); __tmp_coord_array_3__[7] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][1]); __tmp_coord_array_3__[8] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][2]); __tmp_coord_array_3__[9] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][3]); __tmp_coord_array_3__[10] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][4]); __tmp_coord_array_3__[11] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][5]); __tmp_coord_array_3__[12] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][6]); __tmp_coord_array_3__[13] += (__x_xpd__[5][0] * __y_xpd__[3][7]); __tmp_coord_array_3__[14] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[3][8]); __tmp_coord_array_3__[15] += (__x_xpd__[5][0] * __y_xpd__[3][9]); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_3__[1] += (__x_xpd__[5][0] * __y_xpd__[4][0]); __tmp_coord_array_3__[2] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[4][1]); __tmp_coord_array_3__[3] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[4][2]); __tmp_coord_array_3__[4] += (-1.0f * __x_xpd__[5][0] * __y_xpd__[4][3]); __tmp_coord_array_3__[5] += (__x_xpd__[5][0] * __y_xpd__[4][4]); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_3__[0] += (__x_xpd__[5][0] * __y_xpd__[5][0]); } } __temp_var_1__ = mv_compress(__tmp_coord_array_3__); return __temp_var_1__; } scalar scpEM(const mv& x, const mv& y) { scalar __temp_var_1__; const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((y.m_gu & 1) != 0)) { if (((x.m_gu & 1) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } } if (((y.m_gu & 2) != 0)) { if (((x.m_gu & 2) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[1][2] * __y_xpd__[1][2]) + (__x_xpd__[1][1] * __y_xpd__[1][1]) + (__x_xpd__[1][0] * __y_xpd__[1][0]) + (__x_xpd__[1][4] * __y_xpd__[1][4]) + (__x_xpd__[1][3] * __y_xpd__[1][3])); } } if (((y.m_gu & 4) != 0)) { if (((x.m_gu & 4) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][1])); } } if (((y.m_gu & 8) != 0)) { if (((x.m_gu & 8) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[3][5] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][0])); } } if (((y.m_gu & 16) != 0)) { if (((x.m_gu & 16) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[4][4] * __y_xpd__[4][4]) + (__x_xpd__[4][3] * __y_xpd__[4][3]) + (__x_xpd__[4][2] * __y_xpd__[4][2]) + (__x_xpd__[4][1] * __y_xpd__[4][1]) + (__x_xpd__[4][0] * __y_xpd__[4][0])); } } if (((y.m_gu & 32) != 0)) { if (((x.m_gu & 32) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[5][0] * __y_xpd__[5][0]); } } return __temp_var_1__; } mv lcontEM(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_4__[32] ; mv_zero(__tmp_coord_array_4__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((y.m_gu & 1) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } } if (((y.m_gu & 2) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[1] += (__y_xpd__[1][0] * __x_xpd__[0][0]); __tmp_coord_array_4__[2] += (__y_xpd__[1][1] * __x_xpd__[0][0]); __tmp_coord_array_4__[3] += (__y_xpd__[1][2] * __x_xpd__[0][0]); __tmp_coord_array_4__[4] += (__y_xpd__[1][3] * __x_xpd__[0][0]); __tmp_coord_array_4__[5] += (__y_xpd__[1][4] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_4__[0] += ((__x_xpd__[1][2] * __y_xpd__[1][2]) + (__x_xpd__[1][1] * __y_xpd__[1][1]) + (__x_xpd__[1][4] * __y_xpd__[1][4]) + (__x_xpd__[1][3] * __y_xpd__[1][3]) + (__x_xpd__[1][0] * __y_xpd__[1][0])); } } if (((y.m_gu & 4) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[6] += (__y_xpd__[2][0] * __x_xpd__[0][0]); __tmp_coord_array_4__[7] += (__y_xpd__[2][1] * __x_xpd__[0][0]); __tmp_coord_array_4__[8] += (__y_xpd__[2][2] * __x_xpd__[0][0]); __tmp_coord_array_4__[9] += (__y_xpd__[2][3] * __x_xpd__[0][0]); __tmp_coord_array_4__[10] += (__y_xpd__[2][4] * __x_xpd__[0][0]); __tmp_coord_array_4__[11] += (__y_xpd__[2][5] * __x_xpd__[0][0]); __tmp_coord_array_4__[12] += (__y_xpd__[2][6] * __x_xpd__[0][0]); __tmp_coord_array_4__[13] += (__y_xpd__[2][7] * __x_xpd__[0][0]); __tmp_coord_array_4__[14] += (__y_xpd__[2][8] * __x_xpd__[0][0]); __tmp_coord_array_4__[15] += (__y_xpd__[2][9] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_4__[1] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][9])); __tmp_coord_array_4__[2] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[2][6]) + (__x_xpd__[1][3] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][3]) + (__x_xpd__[1][0] * __y_xpd__[2][0])); __tmp_coord_array_4__[3] += ((__x_xpd__[1][0] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][7]) + (__x_xpd__[1][1] * __y_xpd__[2][3])); __tmp_coord_array_4__[4] += ((__x_xpd__[1][0] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[2][8]) + (__x_xpd__[1][2] * __y_xpd__[2][4]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][5])); __tmp_coord_array_4__[5] += ((__x_xpd__[1][0] * __y_xpd__[2][9]) + (__x_xpd__[1][2] * __y_xpd__[2][7]) + (__x_xpd__[1][3] * __y_xpd__[2][8]) + (__x_xpd__[1][1] * __y_xpd__[2][6])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_4__[0] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[2][5]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[2][4])); } } if (((y.m_gu & 8) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[16] += (__y_xpd__[3][0] * __x_xpd__[0][0]); __tmp_coord_array_4__[17] += (__y_xpd__[3][1] * __x_xpd__[0][0]); __tmp_coord_array_4__[18] += (__y_xpd__[3][2] * __x_xpd__[0][0]); __tmp_coord_array_4__[19] += (__y_xpd__[3][3] * __x_xpd__[0][0]); __tmp_coord_array_4__[20] += (__y_xpd__[3][4] * __x_xpd__[0][0]); __tmp_coord_array_4__[21] += (__y_xpd__[3][5] * __x_xpd__[0][0]); __tmp_coord_array_4__[22] += (__y_xpd__[3][6] * __x_xpd__[0][0]); __tmp_coord_array_4__[23] += (__y_xpd__[3][7] * __x_xpd__[0][0]); __tmp_coord_array_4__[24] += (__y_xpd__[3][8] * __x_xpd__[0][0]); __tmp_coord_array_4__[25] += (__y_xpd__[3][9] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_4__[6] += ((__x_xpd__[1][3] * __y_xpd__[3][7]) + (__x_xpd__[1][4] * __y_xpd__[3][4]) + (__x_xpd__[1][2] * __y_xpd__[3][8])); __tmp_coord_array_4__[7] += ((__x_xpd__[1][4] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][8]) + (__x_xpd__[1][3] * __y_xpd__[3][6])); __tmp_coord_array_4__[8] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][6]) + (__x_xpd__[1][4] * __y_xpd__[3][3])); __tmp_coord_array_4__[9] += ((__x_xpd__[1][3] * __y_xpd__[3][9]) + (__x_xpd__[1][4] * __y_xpd__[3][2]) + (__x_xpd__[1][0] * __y_xpd__[3][8])); __tmp_coord_array_4__[10] += ((__x_xpd__[1][1] * __y_xpd__[3][9]) + (__x_xpd__[1][0] * __y_xpd__[3][6]) + (__x_xpd__[1][4] * __y_xpd__[3][0])); __tmp_coord_array_4__[11] += ((__x_xpd__[1][2] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[3][7]) + (__x_xpd__[1][4] * __y_xpd__[3][1])); __tmp_coord_array_4__[12] += ((__x_xpd__[1][0] * __y_xpd__[3][4]) + (__x_xpd__[1][3] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][2])); __tmp_coord_array_4__[13] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[3][0]) + (__x_xpd__[1][1] * __y_xpd__[3][2]) + (__x_xpd__[1][0] * __y_xpd__[3][5])); __tmp_coord_array_4__[14] += ((__x_xpd__[1][0] * __y_xpd__[3][3]) + (__x_xpd__[1][2] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][1])); __tmp_coord_array_4__[15] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][3])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_4__[1] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][8]) + (__x_xpd__[2][5] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][6])); __tmp_coord_array_4__[2] += ((__x_xpd__[2][1] * __y_xpd__[3][8]) + (__x_xpd__[2][8] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][9]) + (__x_xpd__[2][2] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][7] * __y_xpd__[3][2]) + (__x_xpd__[2][9] * __y_xpd__[3][4])); __tmp_coord_array_4__[3] += ((__x_xpd__[2][9] * __y_xpd__[3][5]) + (__x_xpd__[2][6] * __y_xpd__[3][2]) + (__x_xpd__[2][2] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][9])); __tmp_coord_array_4__[4] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[3][1]) + (__x_xpd__[2][9] * __y_xpd__[3][3]) + (__x_xpd__[2][7] * __y_xpd__[3][0])); __tmp_coord_array_4__[5] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[3][4])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_4__[0] += ((-1.0f * __x_xpd__[3][5] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[3][9]) + (-1.0f * __x_xpd__[3][2] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[3][0]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[3][8]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[3][4])); } } if (((y.m_gu & 16) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[26] += (__y_xpd__[4][0] * __x_xpd__[0][0]); __tmp_coord_array_4__[27] += (__y_xpd__[4][1] * __x_xpd__[0][0]); __tmp_coord_array_4__[28] += (__y_xpd__[4][2] * __x_xpd__[0][0]); __tmp_coord_array_4__[29] += (__y_xpd__[4][3] * __x_xpd__[0][0]); __tmp_coord_array_4__[30] += (__y_xpd__[4][4] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_4__[16] += ((__x_xpd__[1][0] * __y_xpd__[4][1]) + (__x_xpd__[1][1] * __y_xpd__[4][0])); __tmp_coord_array_4__[17] += ((__x_xpd__[1][2] * __y_xpd__[4][0]) + (__x_xpd__[1][0] * __y_xpd__[4][2])); __tmp_coord_array_4__[18] += ((__x_xpd__[1][0] * __y_xpd__[4][3]) + (__x_xpd__[1][3] * __y_xpd__[4][0])); __tmp_coord_array_4__[19] += ((__x_xpd__[1][1] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][1])); __tmp_coord_array_4__[20] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[4][2]) + (__x_xpd__[1][2] * __y_xpd__[4][3])); __tmp_coord_array_4__[21] += ((__x_xpd__[1][3] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[4][3])); __tmp_coord_array_4__[22] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[4][4])); __tmp_coord_array_4__[23] += ((__x_xpd__[1][2] * __y_xpd__[4][4]) + (__x_xpd__[1][4] * __y_xpd__[4][2])); __tmp_coord_array_4__[24] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[4][4])); __tmp_coord_array_4__[25] += ((__x_xpd__[1][0] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[4][0])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_4__[6] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][4]) + (__x_xpd__[2][8] * __y_xpd__[4][2])); __tmp_coord_array_4__[7] += ((__x_xpd__[2][6] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[4][1])); __tmp_coord_array_4__[8] += ((-1.0f * __x_xpd__[2][3] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[4][2]) + (__x_xpd__[2][7] * __y_xpd__[4][1])); __tmp_coord_array_4__[9] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][4])); __tmp_coord_array_4__[10] += ((-1.0f * __x_xpd__[2][6] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[4][4])); __tmp_coord_array_4__[11] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[4][4])); __tmp_coord_array_4__[12] += ((__x_xpd__[2][1] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[4][2])); __tmp_coord_array_4__[13] += ((-1.0f * __x_xpd__[2][0] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[4][0]) + (__x_xpd__[2][2] * __y_xpd__[4][1])); __tmp_coord_array_4__[14] += ((__x_xpd__[2][0] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[4][1])); __tmp_coord_array_4__[15] += ((-1.0f * __x_xpd__[2][5] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[2][4] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[2][3] * __y_xpd__[4][3])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_4__[1] += ((__x_xpd__[3][1] * __y_xpd__[4][2]) + (__x_xpd__[3][2] * __y_xpd__[4][3]) + (__x_xpd__[3][0] * __y_xpd__[4][1]) + (__x_xpd__[3][9] * __y_xpd__[4][4])); __tmp_coord_array_4__[2] += ((-1.0f * __x_xpd__[3][6] * __y_xpd__[4][4]) + (__x_xpd__[3][3] * __y_xpd__[4][2]) + (__x_xpd__[3][0] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[4][3])); __tmp_coord_array_4__[3] += ((__x_xpd__[3][1] * __y_xpd__[4][0]) + (__x_xpd__[3][4] * __y_xpd__[4][3]) + (__x_xpd__[3][7] * __y_xpd__[4][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[4][1])); __tmp_coord_array_4__[4] += ((-1.0f * __x_xpd__[3][4] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[3][8] * __y_xpd__[4][4]) + (__x_xpd__[3][5] * __y_xpd__[4][1]) + (__x_xpd__[3][2] * __y_xpd__[4][0])); __tmp_coord_array_4__[5] += ((-1.0f * __x_xpd__[3][8] * __y_xpd__[4][3]) + (-1.0f * __x_xpd__[3][6] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[4][0]) + (__x_xpd__[3][7] * __y_xpd__[4][2])); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_4__[0] += ((__x_xpd__[4][3] * __y_xpd__[4][3]) + (__x_xpd__[4][2] * __y_xpd__[4][2]) + (__x_xpd__[4][0] * __y_xpd__[4][0]) + (__x_xpd__[4][1] * __y_xpd__[4][1]) + (__x_xpd__[4][4] * __y_xpd__[4][4])); } } if (((y.m_gu & 32) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_4__[31] += (__y_xpd__[5][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_4__[26] += (__x_xpd__[1][0] * __y_xpd__[5][0]); __tmp_coord_array_4__[27] += (-1.0f * __x_xpd__[1][1] * __y_xpd__[5][0]); __tmp_coord_array_4__[28] += (-1.0f * __x_xpd__[1][2] * __y_xpd__[5][0]); __tmp_coord_array_4__[29] += (-1.0f * __x_xpd__[1][3] * __y_xpd__[5][0]); __tmp_coord_array_4__[30] += (__x_xpd__[1][4] * __y_xpd__[5][0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_4__[16] += (-1.0f * __x_xpd__[2][0] * __y_xpd__[5][0]); __tmp_coord_array_4__[17] += (-1.0f * __x_xpd__[2][1] * __y_xpd__[5][0]); __tmp_coord_array_4__[18] += (-1.0f * __x_xpd__[2][2] * __y_xpd__[5][0]); __tmp_coord_array_4__[19] += (-1.0f * __x_xpd__[2][3] * __y_xpd__[5][0]); __tmp_coord_array_4__[20] += (-1.0f * __x_xpd__[2][4] * __y_xpd__[5][0]); __tmp_coord_array_4__[21] += (-1.0f * __x_xpd__[2][5] * __y_xpd__[5][0]); __tmp_coord_array_4__[22] += (-1.0f * __x_xpd__[2][6] * __y_xpd__[5][0]); __tmp_coord_array_4__[23] += (__x_xpd__[2][7] * __y_xpd__[5][0]); __tmp_coord_array_4__[24] += (-1.0f * __x_xpd__[2][8] * __y_xpd__[5][0]); __tmp_coord_array_4__[25] += (__x_xpd__[2][9] * __y_xpd__[5][0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_4__[6] += (-1.0f * __x_xpd__[3][0] * __y_xpd__[5][0]); __tmp_coord_array_4__[7] += (-1.0f * __x_xpd__[3][1] * __y_xpd__[5][0]); __tmp_coord_array_4__[8] += (-1.0f * __x_xpd__[3][2] * __y_xpd__[5][0]); __tmp_coord_array_4__[9] += (-1.0f * __x_xpd__[3][3] * __y_xpd__[5][0]); __tmp_coord_array_4__[10] += (-1.0f * __x_xpd__[3][4] * __y_xpd__[5][0]); __tmp_coord_array_4__[11] += (-1.0f * __x_xpd__[3][5] * __y_xpd__[5][0]); __tmp_coord_array_4__[12] += (-1.0f * __x_xpd__[3][6] * __y_xpd__[5][0]); __tmp_coord_array_4__[13] += (__x_xpd__[3][7] * __y_xpd__[5][0]); __tmp_coord_array_4__[14] += (-1.0f * __x_xpd__[3][8] * __y_xpd__[5][0]); __tmp_coord_array_4__[15] += (__x_xpd__[3][9] * __y_xpd__[5][0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_4__[1] += (__x_xpd__[4][0] * __y_xpd__[5][0]); __tmp_coord_array_4__[2] += (-1.0f * __x_xpd__[4][1] * __y_xpd__[5][0]); __tmp_coord_array_4__[3] += (-1.0f * __x_xpd__[4][2] * __y_xpd__[5][0]); __tmp_coord_array_4__[4] += (-1.0f * __x_xpd__[4][3] * __y_xpd__[5][0]); __tmp_coord_array_4__[5] += (__x_xpd__[4][4] * __y_xpd__[5][0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_4__[0] += (__x_xpd__[5][0] * __y_xpd__[5][0]); } } __temp_var_1__ = mv_compress(__tmp_coord_array_4__); return __temp_var_1__; } mv op(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_5__[32] ; mv_zero(__tmp_coord_array_5__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((y.m_gu & 1) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[0] += (__x_xpd__[0][0] * __y_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_5__[1] += (__x_xpd__[1][0] * __y_xpd__[0][0]); __tmp_coord_array_5__[2] += (__x_xpd__[1][1] * __y_xpd__[0][0]); __tmp_coord_array_5__[3] += (__x_xpd__[1][2] * __y_xpd__[0][0]); __tmp_coord_array_5__[4] += (__x_xpd__[1][3] * __y_xpd__[0][0]); __tmp_coord_array_5__[5] += (__x_xpd__[1][4] * __y_xpd__[0][0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_5__[6] += (__x_xpd__[2][0] * __y_xpd__[0][0]); __tmp_coord_array_5__[7] += (__x_xpd__[2][1] * __y_xpd__[0][0]); __tmp_coord_array_5__[8] += (__x_xpd__[2][2] * __y_xpd__[0][0]); __tmp_coord_array_5__[9] += (__x_xpd__[2][3] * __y_xpd__[0][0]); __tmp_coord_array_5__[10] += (__x_xpd__[2][4] * __y_xpd__[0][0]); __tmp_coord_array_5__[11] += (__x_xpd__[2][5] * __y_xpd__[0][0]); __tmp_coord_array_5__[12] += (__x_xpd__[2][6] * __y_xpd__[0][0]); __tmp_coord_array_5__[13] += (__x_xpd__[2][7] * __y_xpd__[0][0]); __tmp_coord_array_5__[14] += (__x_xpd__[2][8] * __y_xpd__[0][0]); __tmp_coord_array_5__[15] += (__x_xpd__[2][9] * __y_xpd__[0][0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_5__[16] += (__x_xpd__[3][0] * __y_xpd__[0][0]); __tmp_coord_array_5__[17] += (__x_xpd__[3][1] * __y_xpd__[0][0]); __tmp_coord_array_5__[18] += (__x_xpd__[3][2] * __y_xpd__[0][0]); __tmp_coord_array_5__[19] += (__x_xpd__[3][3] * __y_xpd__[0][0]); __tmp_coord_array_5__[20] += (__x_xpd__[3][4] * __y_xpd__[0][0]); __tmp_coord_array_5__[21] += (__x_xpd__[3][5] * __y_xpd__[0][0]); __tmp_coord_array_5__[22] += (__x_xpd__[3][6] * __y_xpd__[0][0]); __tmp_coord_array_5__[23] += (__x_xpd__[3][7] * __y_xpd__[0][0]); __tmp_coord_array_5__[24] += (__x_xpd__[3][8] * __y_xpd__[0][0]); __tmp_coord_array_5__[25] += (__x_xpd__[3][9] * __y_xpd__[0][0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_5__[26] += (__x_xpd__[4][0] * __y_xpd__[0][0]); __tmp_coord_array_5__[27] += (__x_xpd__[4][1] * __y_xpd__[0][0]); __tmp_coord_array_5__[28] += (__x_xpd__[4][2] * __y_xpd__[0][0]); __tmp_coord_array_5__[29] += (__x_xpd__[4][3] * __y_xpd__[0][0]); __tmp_coord_array_5__[30] += (__x_xpd__[4][4] * __y_xpd__[0][0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_5__[31] += (__x_xpd__[5][0] * __y_xpd__[0][0]); } } if (((y.m_gu & 2) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[1] += (__x_xpd__[0][0] * __y_xpd__[1][0]); __tmp_coord_array_5__[2] += (__x_xpd__[0][0] * __y_xpd__[1][1]); __tmp_coord_array_5__[3] += (__x_xpd__[0][0] * __y_xpd__[1][2]); __tmp_coord_array_5__[4] += (__x_xpd__[0][0] * __y_xpd__[1][3]); __tmp_coord_array_5__[5] += (__x_xpd__[0][0] * __y_xpd__[1][4]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_5__[6] += ((__x_xpd__[1][0] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[1][0])); __tmp_coord_array_5__[7] += ((-1.0f * __x_xpd__[1][2] * __y_xpd__[1][0]) + (__x_xpd__[1][0] * __y_xpd__[1][2])); __tmp_coord_array_5__[8] += ((__x_xpd__[1][0] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[1][0])); __tmp_coord_array_5__[9] += ((__x_xpd__[1][1] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[1][1])); __tmp_coord_array_5__[10] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[1][2]) + (__x_xpd__[1][2] * __y_xpd__[1][3])); __tmp_coord_array_5__[11] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[1][3]) + (__x_xpd__[1][3] * __y_xpd__[1][1])); __tmp_coord_array_5__[12] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][1]) + (__x_xpd__[1][1] * __y_xpd__[1][4])); __tmp_coord_array_5__[13] += ((__x_xpd__[1][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][2])); __tmp_coord_array_5__[14] += ((__x_xpd__[1][3] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[1][3])); __tmp_coord_array_5__[15] += ((-1.0f * __x_xpd__[1][4] * __y_xpd__[1][0]) + (__x_xpd__[1][0] * __y_xpd__[1][4])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_5__[16] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[1][3]) + (__x_xpd__[2][8] * __y_xpd__[1][2]) + (__x_xpd__[2][4] * __y_xpd__[1][4])); __tmp_coord_array_5__[17] += ((-1.0f * __x_xpd__[2][8] * __y_xpd__[1][1]) + (__x_xpd__[2][6] * __y_xpd__[1][3]) + (__x_xpd__[2][5] * __y_xpd__[1][4])); __tmp_coord_array_5__[18] += ((__x_xpd__[2][7] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[1][2]) + (__x_xpd__[2][3] * __y_xpd__[1][4])); __tmp_coord_array_5__[19] += ((__x_xpd__[2][8] * __y_xpd__[1][0]) + (__x_xpd__[2][2] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][3])); __tmp_coord_array_5__[20] += ((__x_xpd__[2][6] * __y_xpd__[1][0]) + (__x_xpd__[2][0] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][1])); __tmp_coord_array_5__[21] += ((__x_xpd__[2][7] * __y_xpd__[1][0]) + (__x_xpd__[2][1] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[1][2])); __tmp_coord_array_5__[22] += ((__x_xpd__[2][4] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[1][2]) + (__x_xpd__[2][1] * __y_xpd__[1][3])); __tmp_coord_array_5__[23] += ((-1.0f * __x_xpd__[2][2] * __y_xpd__[1][1]) + (__x_xpd__[2][0] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[2][5] * __y_xpd__[1][0])); __tmp_coord_array_5__[24] += ((__x_xpd__[2][3] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[1][1]) + (__x_xpd__[2][0] * __y_xpd__[1][2])); __tmp_coord_array_5__[25] += ((__x_xpd__[2][5] * __y_xpd__[1][2]) + (__x_xpd__[2][3] * __y_xpd__[1][3]) + (__x_xpd__[2][4] * __y_xpd__[1][1])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_5__[26] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][3]) + (__x_xpd__[3][9] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][1] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][1])); __tmp_coord_array_5__[27] += ((__x_xpd__[3][3] * __y_xpd__[1][2]) + (-1.0f * __x_xpd__[3][0] * __y_xpd__[1][0]) + (__x_xpd__[3][6] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][5] * __y_xpd__[1][3])); __tmp_coord_array_5__[28] += ((-1.0f * __x_xpd__[3][1] * __y_xpd__[1][0]) + (__x_xpd__[3][4] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[3][3] * __y_xpd__[1][1])); __tmp_coord_array_5__[29] += ((-1.0f * __x_xpd__[3][2] * __y_xpd__[1][0]) + (-1.0f * __x_xpd__[3][4] * __y_xpd__[1][2]) + (__x_xpd__[3][5] * __y_xpd__[1][1]) + (__x_xpd__[3][8] * __y_xpd__[1][4])); __tmp_coord_array_5__[30] += ((__x_xpd__[3][8] * __y_xpd__[1][3]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[1][0]) + (__x_xpd__[3][6] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[1][2])); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_5__[31] += ((-1.0f * __x_xpd__[4][2] * __y_xpd__[1][2]) + (__x_xpd__[4][4] * __y_xpd__[1][4]) + (-1.0f * __x_xpd__[4][1] * __y_xpd__[1][1]) + (-1.0f * __x_xpd__[4][3] * __y_xpd__[1][3]) + (__x_xpd__[4][0] * __y_xpd__[1][0])); } } if (((y.m_gu & 4) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[6] += (__x_xpd__[0][0] * __y_xpd__[2][0]); __tmp_coord_array_5__[7] += (__x_xpd__[0][0] * __y_xpd__[2][1]); __tmp_coord_array_5__[8] += (__x_xpd__[0][0] * __y_xpd__[2][2]); __tmp_coord_array_5__[9] += (__x_xpd__[0][0] * __y_xpd__[2][3]); __tmp_coord_array_5__[10] += (__x_xpd__[0][0] * __y_xpd__[2][4]); __tmp_coord_array_5__[11] += (__x_xpd__[0][0] * __y_xpd__[2][5]); __tmp_coord_array_5__[12] += (__x_xpd__[0][0] * __y_xpd__[2][6]); __tmp_coord_array_5__[13] += (__x_xpd__[0][0] * __y_xpd__[2][7]); __tmp_coord_array_5__[14] += (__x_xpd__[0][0] * __y_xpd__[2][8]); __tmp_coord_array_5__[15] += (__x_xpd__[0][0] * __y_xpd__[2][9]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_5__[16] += ((__x_xpd__[1][2] * __y_xpd__[2][8]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[2][7]) + (__x_xpd__[1][4] * __y_xpd__[2][4])); __tmp_coord_array_5__[17] += ((__x_xpd__[1][3] * __y_xpd__[2][6]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][5])); __tmp_coord_array_5__[18] += ((__x_xpd__[1][1] * __y_xpd__[2][7]) + (__x_xpd__[1][4] * __y_xpd__[2][3]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][6])); __tmp_coord_array_5__[19] += ((-1.0f * __x_xpd__[1][3] * __y_xpd__[2][9]) + (__x_xpd__[1][0] * __y_xpd__[2][8]) + (__x_xpd__[1][4] * __y_xpd__[2][2])); __tmp_coord_array_5__[20] += ((__x_xpd__[1][0] * __y_xpd__[2][6]) + (__x_xpd__[1][4] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[2][9])); __tmp_coord_array_5__[21] += ((__x_xpd__[1][0] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][9]) + (__x_xpd__[1][4] * __y_xpd__[2][1])); __tmp_coord_array_5__[22] += ((__x_xpd__[1][0] * __y_xpd__[2][4]) + (__x_xpd__[1][3] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[2][2])); __tmp_coord_array_5__[23] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][2]) + (__x_xpd__[1][3] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[1][0] * __y_xpd__[2][5])); __tmp_coord_array_5__[24] += ((-1.0f * __x_xpd__[1][1] * __y_xpd__[2][1]) + (__x_xpd__[1][0] * __y_xpd__[2][3]) + (__x_xpd__[1][2] * __y_xpd__[2][0])); __tmp_coord_array_5__[25] += ((__x_xpd__[1][2] * __y_xpd__[2][5]) + (__x_xpd__[1][3] * __y_xpd__[2][3]) + (__x_xpd__[1][1] * __y_xpd__[2][4])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_5__[26] += ((__x_xpd__[2][8] * __y_xpd__[2][3]) + (__x_xpd__[2][7] * __y_xpd__[2][5]) + (__x_xpd__[2][6] * __y_xpd__[2][4]) + (__x_xpd__[2][4] * __y_xpd__[2][6]) + (__x_xpd__[2][3] * __y_xpd__[2][8]) + (__x_xpd__[2][5] * __y_xpd__[2][7])); __tmp_coord_array_5__[27] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[2][2]) + (__x_xpd__[2][4] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][2] * __y_xpd__[2][7]) + (__x_xpd__[2][1] * __y_xpd__[2][8]) + (__x_xpd__[2][9] * __y_xpd__[2][4]) + (__x_xpd__[2][8] * __y_xpd__[2][1])); __tmp_coord_array_5__[28] += ((__x_xpd__[2][5] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][0] * __y_xpd__[2][8]) + (__x_xpd__[2][2] * __y_xpd__[2][6]) + (__x_xpd__[2][6] * __y_xpd__[2][2]) + (-1.0f * __x_xpd__[2][8] * __y_xpd__[2][0]) + (__x_xpd__[2][9] * __y_xpd__[2][5])); __tmp_coord_array_5__[29] += ((__x_xpd__[2][3] * __y_xpd__[2][9]) + (-1.0f * __x_xpd__[2][6] * __y_xpd__[2][1]) + (__x_xpd__[2][9] * __y_xpd__[2][3]) + (__x_xpd__[2][7] * __y_xpd__[2][0]) + (-1.0f * __x_xpd__[2][1] * __y_xpd__[2][6]) + (__x_xpd__[2][0] * __y_xpd__[2][7])); __tmp_coord_array_5__[30] += ((__x_xpd__[2][1] * __y_xpd__[2][5]) + (__x_xpd__[2][3] * __y_xpd__[2][2]) + (__x_xpd__[2][0] * __y_xpd__[2][4]) + (__x_xpd__[2][5] * __y_xpd__[2][1]) + (__x_xpd__[2][4] * __y_xpd__[2][0]) + (__x_xpd__[2][2] * __y_xpd__[2][3])); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_5__[31] += ((__x_xpd__[3][6] * __y_xpd__[2][6]) + (__x_xpd__[3][5] * __y_xpd__[2][5]) + (__x_xpd__[3][1] * __y_xpd__[2][1]) + (-1.0f * __x_xpd__[3][7] * __y_xpd__[2][7]) + (-1.0f * __x_xpd__[3][9] * __y_xpd__[2][9]) + (__x_xpd__[3][3] * __y_xpd__[2][3]) + (__x_xpd__[3][0] * __y_xpd__[2][0]) + (__x_xpd__[3][8] * __y_xpd__[2][8]) + (__x_xpd__[3][2] * __y_xpd__[2][2]) + (__x_xpd__[3][4] * __y_xpd__[2][4])); } } if (((y.m_gu & 8) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[16] += (__x_xpd__[0][0] * __y_xpd__[3][0]); __tmp_coord_array_5__[17] += (__x_xpd__[0][0] * __y_xpd__[3][1]); __tmp_coord_array_5__[18] += (__x_xpd__[0][0] * __y_xpd__[3][2]); __tmp_coord_array_5__[19] += (__x_xpd__[0][0] * __y_xpd__[3][3]); __tmp_coord_array_5__[20] += (__x_xpd__[0][0] * __y_xpd__[3][4]); __tmp_coord_array_5__[21] += (__x_xpd__[0][0] * __y_xpd__[3][5]); __tmp_coord_array_5__[22] += (__x_xpd__[0][0] * __y_xpd__[3][6]); __tmp_coord_array_5__[23] += (__x_xpd__[0][0] * __y_xpd__[3][7]); __tmp_coord_array_5__[24] += (__x_xpd__[0][0] * __y_xpd__[3][8]); __tmp_coord_array_5__[25] += (__x_xpd__[0][0] * __y_xpd__[3][9]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_5__[26] += ((__x_xpd__[1][1] * __y_xpd__[3][0]) + (__x_xpd__[1][2] * __y_xpd__[3][1]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][9]) + (__x_xpd__[1][3] * __y_xpd__[3][2])); __tmp_coord_array_5__[27] += ((__x_xpd__[1][0] * __y_xpd__[3][0]) + (__x_xpd__[1][3] * __y_xpd__[3][5]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][6])); __tmp_coord_array_5__[28] += ((__x_xpd__[1][0] * __y_xpd__[3][1]) + (__x_xpd__[1][4] * __y_xpd__[3][7]) + (__x_xpd__[1][1] * __y_xpd__[3][3]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][4])); __tmp_coord_array_5__[29] += ((__x_xpd__[1][2] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[1][4] * __y_xpd__[3][8]) + (__x_xpd__[1][0] * __y_xpd__[3][2]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][5])); __tmp_coord_array_5__[30] += ((__x_xpd__[1][2] * __y_xpd__[3][7]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[3][6]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[3][8]) + (__x_xpd__[1][0] * __y_xpd__[3][9])); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_5__[31] += ((-1.0f * __x_xpd__[2][7] * __y_xpd__[3][7]) + (__x_xpd__[2][4] * __y_xpd__[3][4]) + (-1.0f * __x_xpd__[2][9] * __y_xpd__[3][9]) + (__x_xpd__[2][0] * __y_xpd__[3][0]) + (__x_xpd__[2][5] * __y_xpd__[3][5]) + (__x_xpd__[2][3] * __y_xpd__[3][3]) + (__x_xpd__[2][1] * __y_xpd__[3][1]) + (__x_xpd__[2][2] * __y_xpd__[3][2]) + (__x_xpd__[2][8] * __y_xpd__[3][8]) + (__x_xpd__[2][6] * __y_xpd__[3][6])); } } if (((y.m_gu & 16) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[26] += (__x_xpd__[0][0] * __y_xpd__[4][0]); __tmp_coord_array_5__[27] += (__x_xpd__[0][0] * __y_xpd__[4][1]); __tmp_coord_array_5__[28] += (__x_xpd__[0][0] * __y_xpd__[4][2]); __tmp_coord_array_5__[29] += (__x_xpd__[0][0] * __y_xpd__[4][3]); __tmp_coord_array_5__[30] += (__x_xpd__[0][0] * __y_xpd__[4][4]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_5__[31] += ((__x_xpd__[1][4] * __y_xpd__[4][4]) + (__x_xpd__[1][0] * __y_xpd__[4][0]) + (-1.0f * __x_xpd__[1][1] * __y_xpd__[4][1]) + (-1.0f * __x_xpd__[1][2] * __y_xpd__[4][2]) + (-1.0f * __x_xpd__[1][3] * __y_xpd__[4][3])); } } if (((y.m_gu & 32) != 0)) { if (((x.m_gu & 1) != 0)) { __tmp_coord_array_5__[31] += (__x_xpd__[0][0] * __y_xpd__[5][0]); } } __temp_var_1__ = mv_compress(__tmp_coord_array_5__); return __temp_var_1__; } mv add(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_6__[32] ; mv_zero(__tmp_coord_array_6__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_6__[0] += __x_xpd__[0][0]; } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_6__[1] += __x_xpd__[1][0]; __tmp_coord_array_6__[2] += __x_xpd__[1][1]; __tmp_coord_array_6__[3] += __x_xpd__[1][2]; __tmp_coord_array_6__[4] += __x_xpd__[1][3]; __tmp_coord_array_6__[5] += __x_xpd__[1][4]; } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_6__[6] += __x_xpd__[2][0]; __tmp_coord_array_6__[7] += __x_xpd__[2][1]; __tmp_coord_array_6__[8] += __x_xpd__[2][2]; __tmp_coord_array_6__[9] += __x_xpd__[2][3]; __tmp_coord_array_6__[10] += __x_xpd__[2][4]; __tmp_coord_array_6__[11] += __x_xpd__[2][5]; __tmp_coord_array_6__[12] += __x_xpd__[2][6]; __tmp_coord_array_6__[13] += __x_xpd__[2][7]; __tmp_coord_array_6__[14] += __x_xpd__[2][8]; __tmp_coord_array_6__[15] += __x_xpd__[2][9]; } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_6__[16] += __x_xpd__[3][0]; __tmp_coord_array_6__[17] += __x_xpd__[3][1]; __tmp_coord_array_6__[18] += __x_xpd__[3][2]; __tmp_coord_array_6__[19] += __x_xpd__[3][3]; __tmp_coord_array_6__[20] += __x_xpd__[3][4]; __tmp_coord_array_6__[21] += __x_xpd__[3][5]; __tmp_coord_array_6__[22] += __x_xpd__[3][6]; __tmp_coord_array_6__[23] += __x_xpd__[3][7]; __tmp_coord_array_6__[24] += __x_xpd__[3][8]; __tmp_coord_array_6__[25] += __x_xpd__[3][9]; } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_6__[26] += __x_xpd__[4][0]; __tmp_coord_array_6__[27] += __x_xpd__[4][1]; __tmp_coord_array_6__[28] += __x_xpd__[4][2]; __tmp_coord_array_6__[29] += __x_xpd__[4][3]; __tmp_coord_array_6__[30] += __x_xpd__[4][4]; } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_6__[31] += __x_xpd__[5][0]; } if (((y.m_gu & 1) != 0)) { __tmp_coord_array_6__[0] += __y_xpd__[0][0]; } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_6__[1] += __y_xpd__[1][0]; __tmp_coord_array_6__[2] += __y_xpd__[1][1]; __tmp_coord_array_6__[3] += __y_xpd__[1][2]; __tmp_coord_array_6__[4] += __y_xpd__[1][3]; __tmp_coord_array_6__[5] += __y_xpd__[1][4]; } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_6__[6] += __y_xpd__[2][0]; __tmp_coord_array_6__[7] += __y_xpd__[2][1]; __tmp_coord_array_6__[8] += __y_xpd__[2][2]; __tmp_coord_array_6__[9] += __y_xpd__[2][3]; __tmp_coord_array_6__[10] += __y_xpd__[2][4]; __tmp_coord_array_6__[11] += __y_xpd__[2][5]; __tmp_coord_array_6__[12] += __y_xpd__[2][6]; __tmp_coord_array_6__[13] += __y_xpd__[2][7]; __tmp_coord_array_6__[14] += __y_xpd__[2][8]; __tmp_coord_array_6__[15] += __y_xpd__[2][9]; } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_6__[16] += __y_xpd__[3][0]; __tmp_coord_array_6__[17] += __y_xpd__[3][1]; __tmp_coord_array_6__[18] += __y_xpd__[3][2]; __tmp_coord_array_6__[19] += __y_xpd__[3][3]; __tmp_coord_array_6__[20] += __y_xpd__[3][4]; __tmp_coord_array_6__[21] += __y_xpd__[3][5]; __tmp_coord_array_6__[22] += __y_xpd__[3][6]; __tmp_coord_array_6__[23] += __y_xpd__[3][7]; __tmp_coord_array_6__[24] += __y_xpd__[3][8]; __tmp_coord_array_6__[25] += __y_xpd__[3][9]; } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_6__[26] += __y_xpd__[4][0]; __tmp_coord_array_6__[27] += __y_xpd__[4][1]; __tmp_coord_array_6__[28] += __y_xpd__[4][2]; __tmp_coord_array_6__[29] += __y_xpd__[4][3]; __tmp_coord_array_6__[30] += __y_xpd__[4][4]; } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_6__[31] += __y_xpd__[5][0]; } __temp_var_1__ = mv_compress(__tmp_coord_array_6__); return __temp_var_1__; } mv subtract(const mv& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_7__[32] ; mv_zero(__tmp_coord_array_7__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_7__[0] += __x_xpd__[0][0]; } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_7__[1] += __x_xpd__[1][0]; __tmp_coord_array_7__[2] += __x_xpd__[1][1]; __tmp_coord_array_7__[3] += __x_xpd__[1][2]; __tmp_coord_array_7__[4] += __x_xpd__[1][3]; __tmp_coord_array_7__[5] += __x_xpd__[1][4]; } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_7__[6] += __x_xpd__[2][0]; __tmp_coord_array_7__[7] += __x_xpd__[2][1]; __tmp_coord_array_7__[8] += __x_xpd__[2][2]; __tmp_coord_array_7__[9] += __x_xpd__[2][3]; __tmp_coord_array_7__[10] += __x_xpd__[2][4]; __tmp_coord_array_7__[11] += __x_xpd__[2][5]; __tmp_coord_array_7__[12] += __x_xpd__[2][6]; __tmp_coord_array_7__[13] += __x_xpd__[2][7]; __tmp_coord_array_7__[14] += __x_xpd__[2][8]; __tmp_coord_array_7__[15] += __x_xpd__[2][9]; } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_7__[16] += __x_xpd__[3][0]; __tmp_coord_array_7__[17] += __x_xpd__[3][1]; __tmp_coord_array_7__[18] += __x_xpd__[3][2]; __tmp_coord_array_7__[19] += __x_xpd__[3][3]; __tmp_coord_array_7__[20] += __x_xpd__[3][4]; __tmp_coord_array_7__[21] += __x_xpd__[3][5]; __tmp_coord_array_7__[22] += __x_xpd__[3][6]; __tmp_coord_array_7__[23] += __x_xpd__[3][7]; __tmp_coord_array_7__[24] += __x_xpd__[3][8]; __tmp_coord_array_7__[25] += __x_xpd__[3][9]; } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_7__[26] += __x_xpd__[4][0]; __tmp_coord_array_7__[27] += __x_xpd__[4][1]; __tmp_coord_array_7__[28] += __x_xpd__[4][2]; __tmp_coord_array_7__[29] += __x_xpd__[4][3]; __tmp_coord_array_7__[30] += __x_xpd__[4][4]; } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_7__[31] += __x_xpd__[5][0]; } if (((y.m_gu & 1) != 0)) { __tmp_coord_array_7__[0] += (-1.0f * __y_xpd__[0][0]); } if (((y.m_gu & 2) != 0)) { __tmp_coord_array_7__[1] += (-1.0f * __y_xpd__[1][0]); __tmp_coord_array_7__[2] += (-1.0f * __y_xpd__[1][1]); __tmp_coord_array_7__[3] += (-1.0f * __y_xpd__[1][2]); __tmp_coord_array_7__[4] += (-1.0f * __y_xpd__[1][3]); __tmp_coord_array_7__[5] += (-1.0f * __y_xpd__[1][4]); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_7__[6] += (-1.0f * __y_xpd__[2][0]); __tmp_coord_array_7__[7] += (-1.0f * __y_xpd__[2][1]); __tmp_coord_array_7__[8] += (-1.0f * __y_xpd__[2][2]); __tmp_coord_array_7__[9] += (-1.0f * __y_xpd__[2][3]); __tmp_coord_array_7__[10] += (-1.0f * __y_xpd__[2][4]); __tmp_coord_array_7__[11] += (-1.0f * __y_xpd__[2][5]); __tmp_coord_array_7__[12] += (-1.0f * __y_xpd__[2][6]); __tmp_coord_array_7__[13] += (-1.0f * __y_xpd__[2][7]); __tmp_coord_array_7__[14] += (-1.0f * __y_xpd__[2][8]); __tmp_coord_array_7__[15] += (-1.0f * __y_xpd__[2][9]); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_7__[16] += (-1.0f * __y_xpd__[3][0]); __tmp_coord_array_7__[17] += (-1.0f * __y_xpd__[3][1]); __tmp_coord_array_7__[18] += (-1.0f * __y_xpd__[3][2]); __tmp_coord_array_7__[19] += (-1.0f * __y_xpd__[3][3]); __tmp_coord_array_7__[20] += (-1.0f * __y_xpd__[3][4]); __tmp_coord_array_7__[21] += (-1.0f * __y_xpd__[3][5]); __tmp_coord_array_7__[22] += (-1.0f * __y_xpd__[3][6]); __tmp_coord_array_7__[23] += (-1.0f * __y_xpd__[3][7]); __tmp_coord_array_7__[24] += (-1.0f * __y_xpd__[3][8]); __tmp_coord_array_7__[25] += (-1.0f * __y_xpd__[3][9]); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_7__[26] += (-1.0f * __y_xpd__[4][0]); __tmp_coord_array_7__[27] += (-1.0f * __y_xpd__[4][1]); __tmp_coord_array_7__[28] += (-1.0f * __y_xpd__[4][2]); __tmp_coord_array_7__[29] += (-1.0f * __y_xpd__[4][3]); __tmp_coord_array_7__[30] += (-1.0f * __y_xpd__[4][4]); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_7__[31] += (-1.0f * __y_xpd__[5][0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_7__); return __temp_var_1__; } scalar norm_e2(const mv& x) { scalar __temp_var_1__; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (__x_xpd__[1][0] * __x_xpd__[1][0]) + (__x_xpd__[1][1] * __x_xpd__[1][1]) + (__x_xpd__[1][4] * __x_xpd__[1][4])); } if (((x.m_gu & 4) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[2][1] * __x_xpd__[2][1]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][0] * __x_xpd__[2][0]) + (__x_xpd__[2][7] * __x_xpd__[2][7]) + (__x_xpd__[2][6] * __x_xpd__[2][6]) + (__x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][8] * __x_xpd__[2][8]) + (__x_xpd__[2][2] * __x_xpd__[2][2]) + (__x_xpd__[2][4] * __x_xpd__[2][4])); } if (((x.m_gu & 8) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[3][2] * __x_xpd__[3][2]) + (__x_xpd__[3][7] * __x_xpd__[3][7]) + (__x_xpd__[3][6] * __x_xpd__[3][6]) + (__x_xpd__[3][3] * __x_xpd__[3][3]) + (__x_xpd__[3][1] * __x_xpd__[3][1]) + (__x_xpd__[3][0] * __x_xpd__[3][0]) + (__x_xpd__[3][8] * __x_xpd__[3][8]) + (__x_xpd__[3][4] * __x_xpd__[3][4]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (__x_xpd__[3][5] * __x_xpd__[3][5])); } if (((x.m_gu & 16) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[4][4] * __x_xpd__[4][4]) + (__x_xpd__[4][3] * __x_xpd__[4][3]) + (__x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][2] * __x_xpd__[4][2]) + (__x_xpd__[4][0] * __x_xpd__[4][0])); } if (((x.m_gu & 32) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[5][0] * __x_xpd__[5][0]); } return __temp_var_1__; } scalar norm_e(const mv& x) { scalar e2; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { e2.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { e2.m_c[0] += ((__x_xpd__[1][1] * __x_xpd__[1][1]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (__x_xpd__[1][4] * __x_xpd__[1][4]) + (__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][0] * __x_xpd__[1][0])); } if (((x.m_gu & 4) != 0)) { e2.m_c[0] += ((__x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][0] * __x_xpd__[2][0]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][8] * __x_xpd__[2][8]) + (__x_xpd__[2][2] * __x_xpd__[2][2]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][6] * __x_xpd__[2][6]) + (__x_xpd__[2][1] * __x_xpd__[2][1]) + (__x_xpd__[2][7] * __x_xpd__[2][7])); } if (((x.m_gu & 8) != 0)) { e2.m_c[0] += ((__x_xpd__[3][5] * __x_xpd__[3][5]) + (__x_xpd__[3][7] * __x_xpd__[3][7]) + (__x_xpd__[3][0] * __x_xpd__[3][0]) + (__x_xpd__[3][3] * __x_xpd__[3][3]) + (__x_xpd__[3][8] * __x_xpd__[3][8]) + (__x_xpd__[3][4] * __x_xpd__[3][4]) + (__x_xpd__[3][1] * __x_xpd__[3][1]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (__x_xpd__[3][2] * __x_xpd__[3][2]) + (__x_xpd__[3][6] * __x_xpd__[3][6])); } if (((x.m_gu & 16) != 0)) { e2.m_c[0] += ((__x_xpd__[4][0] * __x_xpd__[4][0]) + (__x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][3] * __x_xpd__[4][3]) + (__x_xpd__[4][4] * __x_xpd__[4][4]) + (__x_xpd__[4][2] * __x_xpd__[4][2])); } if (((x.m_gu & 32) != 0)) { e2.m_c[0] += (__x_xpd__[5][0] * __x_xpd__[5][0]); } return scalar(scalar_scalar, sqrt(e2.m_c[0])); } mv unit_e(const mv& x) { scalar e2; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { e2.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { e2.m_c[0] += ((__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][4] * __x_xpd__[1][4]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (__x_xpd__[1][0] * __x_xpd__[1][0]) + (__x_xpd__[1][1] * __x_xpd__[1][1])); } if (((x.m_gu & 4) != 0)) { e2.m_c[0] += ((__x_xpd__[2][1] * __x_xpd__[2][1]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][7] * __x_xpd__[2][7]) + (__x_xpd__[2][2] * __x_xpd__[2][2]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][8] * __x_xpd__[2][8]) + (__x_xpd__[2][6] * __x_xpd__[2][6]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][0] * __x_xpd__[2][0]) + (__x_xpd__[2][9] * __x_xpd__[2][9])); } if (((x.m_gu & 8) != 0)) { e2.m_c[0] += ((__x_xpd__[3][3] * __x_xpd__[3][3]) + (__x_xpd__[3][4] * __x_xpd__[3][4]) + (__x_xpd__[3][5] * __x_xpd__[3][5]) + (__x_xpd__[3][0] * __x_xpd__[3][0]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (__x_xpd__[3][2] * __x_xpd__[3][2]) + (__x_xpd__[3][8] * __x_xpd__[3][8]) + (__x_xpd__[3][7] * __x_xpd__[3][7]) + (__x_xpd__[3][6] * __x_xpd__[3][6]) + (__x_xpd__[3][1] * __x_xpd__[3][1])); } if (((x.m_gu & 16) != 0)) { e2.m_c[0] += ((__x_xpd__[4][4] * __x_xpd__[4][4]) + (__x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][0] * __x_xpd__[4][0]) + (__x_xpd__[4][3] * __x_xpd__[4][3]) + (__x_xpd__[4][2] * __x_xpd__[4][2])); } if (((x.m_gu & 32) != 0)) { e2.m_c[0] += (__x_xpd__[5][0] * __x_xpd__[5][0]); } scalar ie; ie.m_c[0] = ((char)1 / sqrt(e2.m_c[0])); mv __temp_var_1__; float __tmp_coord_array_8__[32] ; mv_zero(__tmp_coord_array_8__, 32); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_8__[0] += (__x_xpd__[0][0] * ie.m_c[0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_8__[1] += (__x_xpd__[1][0] * ie.m_c[0]); __tmp_coord_array_8__[2] += (__x_xpd__[1][1] * ie.m_c[0]); __tmp_coord_array_8__[3] += (__x_xpd__[1][2] * ie.m_c[0]); __tmp_coord_array_8__[4] += (__x_xpd__[1][3] * ie.m_c[0]); __tmp_coord_array_8__[5] += (__x_xpd__[1][4] * ie.m_c[0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_8__[6] += (__x_xpd__[2][0] * ie.m_c[0]); __tmp_coord_array_8__[7] += (__x_xpd__[2][1] * ie.m_c[0]); __tmp_coord_array_8__[8] += (__x_xpd__[2][2] * ie.m_c[0]); __tmp_coord_array_8__[9] += (__x_xpd__[2][3] * ie.m_c[0]); __tmp_coord_array_8__[10] += (__x_xpd__[2][4] * ie.m_c[0]); __tmp_coord_array_8__[11] += (__x_xpd__[2][5] * ie.m_c[0]); __tmp_coord_array_8__[12] += (__x_xpd__[2][6] * ie.m_c[0]); __tmp_coord_array_8__[13] += (__x_xpd__[2][7] * ie.m_c[0]); __tmp_coord_array_8__[14] += (__x_xpd__[2][8] * ie.m_c[0]); __tmp_coord_array_8__[15] += (__x_xpd__[2][9] * ie.m_c[0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_8__[16] += (__x_xpd__[3][0] * ie.m_c[0]); __tmp_coord_array_8__[17] += (__x_xpd__[3][1] * ie.m_c[0]); __tmp_coord_array_8__[18] += (__x_xpd__[3][2] * ie.m_c[0]); __tmp_coord_array_8__[19] += (__x_xpd__[3][3] * ie.m_c[0]); __tmp_coord_array_8__[20] += (__x_xpd__[3][4] * ie.m_c[0]); __tmp_coord_array_8__[21] += (__x_xpd__[3][5] * ie.m_c[0]); __tmp_coord_array_8__[22] += (__x_xpd__[3][6] * ie.m_c[0]); __tmp_coord_array_8__[23] += (__x_xpd__[3][7] * ie.m_c[0]); __tmp_coord_array_8__[24] += (__x_xpd__[3][8] * ie.m_c[0]); __tmp_coord_array_8__[25] += (__x_xpd__[3][9] * ie.m_c[0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_8__[26] += (__x_xpd__[4][0] * ie.m_c[0]); __tmp_coord_array_8__[27] += (__x_xpd__[4][1] * ie.m_c[0]); __tmp_coord_array_8__[28] += (__x_xpd__[4][2] * ie.m_c[0]); __tmp_coord_array_8__[29] += (__x_xpd__[4][3] * ie.m_c[0]); __tmp_coord_array_8__[30] += (__x_xpd__[4][4] * ie.m_c[0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_8__[31] += (__x_xpd__[5][0] * ie.m_c[0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_8__); return __temp_var_1__; } scalar norm_r2(const mv& x) { scalar __temp_var_1__; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __temp_var_1__.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[1][4] * __x_xpd__[1][0]) + (__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][1] * __x_xpd__[1][1]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (-1.0f * __x_xpd__[1][0] * __x_xpd__[1][4])); } if (((x.m_gu & 4) != 0)) { __temp_var_1__.m_c[0] += ((__x_xpd__[2][7] * __x_xpd__[2][1]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][1] * __x_xpd__[2][7]) + (__x_xpd__[2][6] * __x_xpd__[2][0]) + (__x_xpd__[2][0] * __x_xpd__[2][6]) + (__x_xpd__[2][8] * __x_xpd__[2][2]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][2] * __x_xpd__[2][8]) + (-1.0f * __x_xpd__[2][9] * __x_xpd__[2][9])); } if (((x.m_gu & 8) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[3][5] * __x_xpd__[3][5]) + (-1.0f * __x_xpd__[3][8] * __x_xpd__[3][2]) + (-1.0f * __x_xpd__[3][0] * __x_xpd__[3][6]) + (__x_xpd__[3][1] * __x_xpd__[3][7]) + (-1.0f * __x_xpd__[3][2] * __x_xpd__[3][8]) + (-1.0f * __x_xpd__[3][6] * __x_xpd__[3][0]) + (-1.0f * __x_xpd__[3][4] * __x_xpd__[3][4]) + (__x_xpd__[3][7] * __x_xpd__[3][1]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (-1.0f * __x_xpd__[3][3] * __x_xpd__[3][3])); } if (((x.m_gu & 16) != 0)) { __temp_var_1__.m_c[0] += ((-1.0f * __x_xpd__[4][2] * __x_xpd__[4][2]) + (__x_xpd__[4][4] * __x_xpd__[4][0]) + (-1.0f * __x_xpd__[4][3] * __x_xpd__[4][3]) + (-1.0f * __x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][0] * __x_xpd__[4][4])); } if (((x.m_gu & 32) != 0)) { __temp_var_1__.m_c[0] += (-1.0f * __x_xpd__[5][0] * __x_xpd__[5][0]); } return __temp_var_1__; } scalar norm_r(const mv& x) { scalar r2; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { r2.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { r2.m_c[0] += ((__x_xpd__[1][3] * __x_xpd__[1][3]) + (-1.0f * __x_xpd__[1][4] * __x_xpd__[1][0]) + (-1.0f * __x_xpd__[1][0] * __x_xpd__[1][4]) + (__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][1] * __x_xpd__[1][1])); } if (((x.m_gu & 4) != 0)) { r2.m_c[0] += ((-1.0f * __x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][2] * __x_xpd__[2][8]) + (__x_xpd__[2][8] * __x_xpd__[2][2]) + (__x_xpd__[2][0] * __x_xpd__[2][6]) + (__x_xpd__[2][6] * __x_xpd__[2][0]) + (__x_xpd__[2][1] * __x_xpd__[2][7]) + (__x_xpd__[2][7] * __x_xpd__[2][1]) + (__x_xpd__[2][5] * __x_xpd__[2][5])); } if (((x.m_gu & 8) != 0)) { r2.m_c[0] += ((-1.0f * __x_xpd__[3][5] * __x_xpd__[3][5]) + (-1.0f * __x_xpd__[3][8] * __x_xpd__[3][2]) + (-1.0f * __x_xpd__[3][0] * __x_xpd__[3][6]) + (__x_xpd__[3][7] * __x_xpd__[3][1]) + (__x_xpd__[3][1] * __x_xpd__[3][7]) + (-1.0f * __x_xpd__[3][6] * __x_xpd__[3][0]) + (-1.0f * __x_xpd__[3][2] * __x_xpd__[3][8]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (-1.0f * __x_xpd__[3][4] * __x_xpd__[3][4]) + (-1.0f * __x_xpd__[3][3] * __x_xpd__[3][3])); } if (((x.m_gu & 16) != 0)) { r2.m_c[0] += ((__x_xpd__[4][0] * __x_xpd__[4][4]) + (-1.0f * __x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][4] * __x_xpd__[4][0]) + (-1.0f * __x_xpd__[4][3] * __x_xpd__[4][3]) + (-1.0f * __x_xpd__[4][2] * __x_xpd__[4][2])); } if (((x.m_gu & 32) != 0)) { r2.m_c[0] += (-1.0f * __x_xpd__[5][0] * __x_xpd__[5][0]); } return scalar(scalar_scalar, ((((r2.m_c[0] < (char)0)) ? (char)-1 : ((((r2.m_c[0] > (char)0)) ? (char)1 : (char)0))) * sqrt((((r2.m_c[0] < (char)0)) ? ((-r2.m_c[0])) : (r2.m_c[0]))))); } mv unit_r(const mv& x) { scalar r2; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { r2.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { r2.m_c[0] += ((__x_xpd__[1][1] * __x_xpd__[1][1]) + (-1.0f * __x_xpd__[1][4] * __x_xpd__[1][0]) + (__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (-1.0f * __x_xpd__[1][0] * __x_xpd__[1][4])); } if (((x.m_gu & 4) != 0)) { r2.m_c[0] += ((__x_xpd__[2][7] * __x_xpd__[2][1]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][2] * __x_xpd__[2][8]) + (__x_xpd__[2][1] * __x_xpd__[2][7]) + (__x_xpd__[2][0] * __x_xpd__[2][6]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][6] * __x_xpd__[2][0]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (-1.0f * __x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][8] * __x_xpd__[2][2])); } if (((x.m_gu & 8) != 0)) { r2.m_c[0] += ((-1.0f * __x_xpd__[3][2] * __x_xpd__[3][8]) + (-1.0f * __x_xpd__[3][4] * __x_xpd__[3][4]) + (-1.0f * __x_xpd__[3][5] * __x_xpd__[3][5]) + (__x_xpd__[3][1] * __x_xpd__[3][7]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (__x_xpd__[3][7] * __x_xpd__[3][1]) + (-1.0f * __x_xpd__[3][8] * __x_xpd__[3][2]) + (-1.0f * __x_xpd__[3][0] * __x_xpd__[3][6]) + (-1.0f * __x_xpd__[3][3] * __x_xpd__[3][3]) + (-1.0f * __x_xpd__[3][6] * __x_xpd__[3][0])); } if (((x.m_gu & 16) != 0)) { r2.m_c[0] += ((-1.0f * __x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][0] * __x_xpd__[4][4]) + (__x_xpd__[4][4] * __x_xpd__[4][0]) + (-1.0f * __x_xpd__[4][3] * __x_xpd__[4][3]) + (-1.0f * __x_xpd__[4][2] * __x_xpd__[4][2])); } if (((x.m_gu & 32) != 0)) { r2.m_c[0] += (-1.0f * __x_xpd__[5][0] * __x_xpd__[5][0]); } scalar ir; ir.m_c[0] = ((char)1 / sqrt((((r2.m_c[0] < (char)0)) ? ((-r2.m_c[0])) : (r2.m_c[0])))); mv __temp_var_1__; float __tmp_coord_array_9__[32] ; mv_zero(__tmp_coord_array_9__, 32); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_9__[0] += (__x_xpd__[0][0] * ir.m_c[0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_9__[1] += (__x_xpd__[1][0] * ir.m_c[0]); __tmp_coord_array_9__[2] += (__x_xpd__[1][1] * ir.m_c[0]); __tmp_coord_array_9__[3] += (__x_xpd__[1][2] * ir.m_c[0]); __tmp_coord_array_9__[4] += (__x_xpd__[1][3] * ir.m_c[0]); __tmp_coord_array_9__[5] += (__x_xpd__[1][4] * ir.m_c[0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_9__[6] += (__x_xpd__[2][0] * ir.m_c[0]); __tmp_coord_array_9__[7] += (__x_xpd__[2][1] * ir.m_c[0]); __tmp_coord_array_9__[8] += (__x_xpd__[2][2] * ir.m_c[0]); __tmp_coord_array_9__[9] += (__x_xpd__[2][3] * ir.m_c[0]); __tmp_coord_array_9__[10] += (__x_xpd__[2][4] * ir.m_c[0]); __tmp_coord_array_9__[11] += (__x_xpd__[2][5] * ir.m_c[0]); __tmp_coord_array_9__[12] += (__x_xpd__[2][6] * ir.m_c[0]); __tmp_coord_array_9__[13] += (__x_xpd__[2][7] * ir.m_c[0]); __tmp_coord_array_9__[14] += (__x_xpd__[2][8] * ir.m_c[0]); __tmp_coord_array_9__[15] += (__x_xpd__[2][9] * ir.m_c[0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_9__[16] += (__x_xpd__[3][0] * ir.m_c[0]); __tmp_coord_array_9__[17] += (__x_xpd__[3][1] * ir.m_c[0]); __tmp_coord_array_9__[18] += (__x_xpd__[3][2] * ir.m_c[0]); __tmp_coord_array_9__[19] += (__x_xpd__[3][3] * ir.m_c[0]); __tmp_coord_array_9__[20] += (__x_xpd__[3][4] * ir.m_c[0]); __tmp_coord_array_9__[21] += (__x_xpd__[3][5] * ir.m_c[0]); __tmp_coord_array_9__[22] += (__x_xpd__[3][6] * ir.m_c[0]); __tmp_coord_array_9__[23] += (__x_xpd__[3][7] * ir.m_c[0]); __tmp_coord_array_9__[24] += (__x_xpd__[3][8] * ir.m_c[0]); __tmp_coord_array_9__[25] += (__x_xpd__[3][9] * ir.m_c[0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_9__[26] += (__x_xpd__[4][0] * ir.m_c[0]); __tmp_coord_array_9__[27] += (__x_xpd__[4][1] * ir.m_c[0]); __tmp_coord_array_9__[28] += (__x_xpd__[4][2] * ir.m_c[0]); __tmp_coord_array_9__[29] += (__x_xpd__[4][3] * ir.m_c[0]); __tmp_coord_array_9__[30] += (__x_xpd__[4][4] * ir.m_c[0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_9__[31] += (__x_xpd__[5][0] * ir.m_c[0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_9__); return __temp_var_1__; } mv reverse(const mv& x) { mv __temp_var_1__; float __tmp_coord_array_10__[32] ; mv_zero(__tmp_coord_array_10__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_10__[0] += __x_xpd__[0][0]; } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_10__[1] += __x_xpd__[1][0]; __tmp_coord_array_10__[2] += __x_xpd__[1][1]; __tmp_coord_array_10__[3] += __x_xpd__[1][2]; __tmp_coord_array_10__[4] += __x_xpd__[1][3]; __tmp_coord_array_10__[5] += __x_xpd__[1][4]; } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_10__[6] += (-1.0f * __x_xpd__[2][0]); __tmp_coord_array_10__[7] += (-1.0f * __x_xpd__[2][1]); __tmp_coord_array_10__[8] += (-1.0f * __x_xpd__[2][2]); __tmp_coord_array_10__[9] += (-1.0f * __x_xpd__[2][3]); __tmp_coord_array_10__[10] += (-1.0f * __x_xpd__[2][4]); __tmp_coord_array_10__[11] += (-1.0f * __x_xpd__[2][5]); __tmp_coord_array_10__[12] += (-1.0f * __x_xpd__[2][6]); __tmp_coord_array_10__[13] += (-1.0f * __x_xpd__[2][7]); __tmp_coord_array_10__[14] += (-1.0f * __x_xpd__[2][8]); __tmp_coord_array_10__[15] += (-1.0f * __x_xpd__[2][9]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_10__[16] += (-1.0f * __x_xpd__[3][0]); __tmp_coord_array_10__[17] += (-1.0f * __x_xpd__[3][1]); __tmp_coord_array_10__[18] += (-1.0f * __x_xpd__[3][2]); __tmp_coord_array_10__[19] += (-1.0f * __x_xpd__[3][3]); __tmp_coord_array_10__[20] += (-1.0f * __x_xpd__[3][4]); __tmp_coord_array_10__[21] += (-1.0f * __x_xpd__[3][5]); __tmp_coord_array_10__[22] += (-1.0f * __x_xpd__[3][6]); __tmp_coord_array_10__[23] += (-1.0f * __x_xpd__[3][7]); __tmp_coord_array_10__[24] += (-1.0f * __x_xpd__[3][8]); __tmp_coord_array_10__[25] += (-1.0f * __x_xpd__[3][9]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_10__[26] += __x_xpd__[4][0]; __tmp_coord_array_10__[27] += __x_xpd__[4][1]; __tmp_coord_array_10__[28] += __x_xpd__[4][2]; __tmp_coord_array_10__[29] += __x_xpd__[4][3]; __tmp_coord_array_10__[30] += __x_xpd__[4][4]; } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_10__[31] += __x_xpd__[5][0]; } __temp_var_1__ = mv_compress(__tmp_coord_array_10__); return __temp_var_1__; } mv negate(const mv& x) { mv __temp_var_1__; float __tmp_coord_array_11__[32] ; mv_zero(__tmp_coord_array_11__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_11__[0] += (-1.0f * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_11__[1] += (-1.0f * __x_xpd__[1][0]); __tmp_coord_array_11__[2] += (-1.0f * __x_xpd__[1][1]); __tmp_coord_array_11__[3] += (-1.0f * __x_xpd__[1][2]); __tmp_coord_array_11__[4] += (-1.0f * __x_xpd__[1][3]); __tmp_coord_array_11__[5] += (-1.0f * __x_xpd__[1][4]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_11__[6] += (-1.0f * __x_xpd__[2][0]); __tmp_coord_array_11__[7] += (-1.0f * __x_xpd__[2][1]); __tmp_coord_array_11__[8] += (-1.0f * __x_xpd__[2][2]); __tmp_coord_array_11__[9] += (-1.0f * __x_xpd__[2][3]); __tmp_coord_array_11__[10] += (-1.0f * __x_xpd__[2][4]); __tmp_coord_array_11__[11] += (-1.0f * __x_xpd__[2][5]); __tmp_coord_array_11__[12] += (-1.0f * __x_xpd__[2][6]); __tmp_coord_array_11__[13] += (-1.0f * __x_xpd__[2][7]); __tmp_coord_array_11__[14] += (-1.0f * __x_xpd__[2][8]); __tmp_coord_array_11__[15] += (-1.0f * __x_xpd__[2][9]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_11__[16] += (-1.0f * __x_xpd__[3][0]); __tmp_coord_array_11__[17] += (-1.0f * __x_xpd__[3][1]); __tmp_coord_array_11__[18] += (-1.0f * __x_xpd__[3][2]); __tmp_coord_array_11__[19] += (-1.0f * __x_xpd__[3][3]); __tmp_coord_array_11__[20] += (-1.0f * __x_xpd__[3][4]); __tmp_coord_array_11__[21] += (-1.0f * __x_xpd__[3][5]); __tmp_coord_array_11__[22] += (-1.0f * __x_xpd__[3][6]); __tmp_coord_array_11__[23] += (-1.0f * __x_xpd__[3][7]); __tmp_coord_array_11__[24] += (-1.0f * __x_xpd__[3][8]); __tmp_coord_array_11__[25] += (-1.0f * __x_xpd__[3][9]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_11__[26] += (-1.0f * __x_xpd__[4][0]); __tmp_coord_array_11__[27] += (-1.0f * __x_xpd__[4][1]); __tmp_coord_array_11__[28] += (-1.0f * __x_xpd__[4][2]); __tmp_coord_array_11__[29] += (-1.0f * __x_xpd__[4][3]); __tmp_coord_array_11__[30] += (-1.0f * __x_xpd__[4][4]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_11__[31] += (-1.0f * __x_xpd__[5][0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_11__); return __temp_var_1__; } mv dual(const mv& x) { mv __temp_var_1__; float __tmp_coord_array_12__[32] ; mv_zero(__tmp_coord_array_12__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_12__[31] += (-1.0f * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_12__[26] += __x_xpd__[1][4]; __tmp_coord_array_12__[27] += __x_xpd__[1][1]; __tmp_coord_array_12__[28] += __x_xpd__[1][2]; __tmp_coord_array_12__[29] += __x_xpd__[1][3]; __tmp_coord_array_12__[30] += __x_xpd__[1][0]; } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_12__[16] += __x_xpd__[2][6]; __tmp_coord_array_12__[17] += __x_xpd__[2][7]; __tmp_coord_array_12__[18] += __x_xpd__[2][8]; __tmp_coord_array_12__[19] += __x_xpd__[2][3]; __tmp_coord_array_12__[20] += __x_xpd__[2][4]; __tmp_coord_array_12__[21] += __x_xpd__[2][5]; __tmp_coord_array_12__[22] += __x_xpd__[2][0]; __tmp_coord_array_12__[23] += (-1.0f * __x_xpd__[2][1]); __tmp_coord_array_12__[24] += __x_xpd__[2][2]; __tmp_coord_array_12__[25] += __x_xpd__[2][9]; } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_12__[6] += (-1.0f * __x_xpd__[3][6]); __tmp_coord_array_12__[7] += __x_xpd__[3][7]; __tmp_coord_array_12__[8] += (-1.0f * __x_xpd__[3][8]); __tmp_coord_array_12__[9] += (-1.0f * __x_xpd__[3][3]); __tmp_coord_array_12__[10] += (-1.0f * __x_xpd__[3][4]); __tmp_coord_array_12__[11] += (-1.0f * __x_xpd__[3][5]); __tmp_coord_array_12__[12] += (-1.0f * __x_xpd__[3][0]); __tmp_coord_array_12__[13] += (-1.0f * __x_xpd__[3][1]); __tmp_coord_array_12__[14] += (-1.0f * __x_xpd__[3][2]); __tmp_coord_array_12__[15] += (-1.0f * __x_xpd__[3][9]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_12__[1] += (-1.0f * __x_xpd__[4][4]); __tmp_coord_array_12__[2] += (-1.0f * __x_xpd__[4][1]); __tmp_coord_array_12__[3] += (-1.0f * __x_xpd__[4][2]); __tmp_coord_array_12__[4] += (-1.0f * __x_xpd__[4][3]); __tmp_coord_array_12__[5] += (-1.0f * __x_xpd__[4][0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_12__[0] += __x_xpd__[5][0]; } __temp_var_1__ = mv_compress(__tmp_coord_array_12__); return __temp_var_1__; } mv undual(const mv& x) { mv __temp_var_1__; float __tmp_coord_array_13__[32] ; mv_zero(__tmp_coord_array_13__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_13__[31] += __x_xpd__[0][0]; } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_13__[26] += (-1.0f * __x_xpd__[1][4]); __tmp_coord_array_13__[27] += (-1.0f * __x_xpd__[1][1]); __tmp_coord_array_13__[28] += (-1.0f * __x_xpd__[1][2]); __tmp_coord_array_13__[29] += (-1.0f * __x_xpd__[1][3]); __tmp_coord_array_13__[30] += (-1.0f * __x_xpd__[1][0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_13__[16] += (-1.0f * __x_xpd__[2][6]); __tmp_coord_array_13__[17] += (-1.0f * __x_xpd__[2][7]); __tmp_coord_array_13__[18] += (-1.0f * __x_xpd__[2][8]); __tmp_coord_array_13__[19] += (-1.0f * __x_xpd__[2][3]); __tmp_coord_array_13__[20] += (-1.0f * __x_xpd__[2][4]); __tmp_coord_array_13__[21] += (-1.0f * __x_xpd__[2][5]); __tmp_coord_array_13__[22] += (-1.0f * __x_xpd__[2][0]); __tmp_coord_array_13__[23] += __x_xpd__[2][1]; __tmp_coord_array_13__[24] += (-1.0f * __x_xpd__[2][2]); __tmp_coord_array_13__[25] += (-1.0f * __x_xpd__[2][9]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_13__[6] += __x_xpd__[3][6]; __tmp_coord_array_13__[7] += (-1.0f * __x_xpd__[3][7]); __tmp_coord_array_13__[8] += __x_xpd__[3][8]; __tmp_coord_array_13__[9] += __x_xpd__[3][3]; __tmp_coord_array_13__[10] += __x_xpd__[3][4]; __tmp_coord_array_13__[11] += __x_xpd__[3][5]; __tmp_coord_array_13__[12] += __x_xpd__[3][0]; __tmp_coord_array_13__[13] += __x_xpd__[3][1]; __tmp_coord_array_13__[14] += __x_xpd__[3][2]; __tmp_coord_array_13__[15] += __x_xpd__[3][9]; } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_13__[1] += __x_xpd__[4][4]; __tmp_coord_array_13__[2] += __x_xpd__[4][1]; __tmp_coord_array_13__[3] += __x_xpd__[4][2]; __tmp_coord_array_13__[4] += __x_xpd__[4][3]; __tmp_coord_array_13__[5] += __x_xpd__[4][0]; } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_13__[0] += (-1.0f * __x_xpd__[5][0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_13__); return __temp_var_1__; } mv inverse(const mv& x) { scalar n; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { n.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { n.m_c[0] += ((-1.0f * __x_xpd__[1][4] * __x_xpd__[1][0]) + (__x_xpd__[1][3] * __x_xpd__[1][3]) + (__x_xpd__[1][1] * __x_xpd__[1][1]) + (-1.0f * __x_xpd__[1][0] * __x_xpd__[1][4]) + (__x_xpd__[1][2] * __x_xpd__[1][2])); } if (((x.m_gu & 4) != 0)) { n.m_c[0] += ((__x_xpd__[2][0] * __x_xpd__[2][6]) + (-1.0f * __x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][1] * __x_xpd__[2][7]) + (__x_xpd__[2][6] * __x_xpd__[2][0]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][7] * __x_xpd__[2][1]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][2] * __x_xpd__[2][8]) + (__x_xpd__[2][8] * __x_xpd__[2][2])); } if (((x.m_gu & 8) != 0)) { n.m_c[0] += ((-1.0f * __x_xpd__[3][8] * __x_xpd__[3][2]) + (-1.0f * __x_xpd__[3][5] * __x_xpd__[3][5]) + (-1.0f * __x_xpd__[3][3] * __x_xpd__[3][3]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (-1.0f * __x_xpd__[3][2] * __x_xpd__[3][8]) + (__x_xpd__[3][7] * __x_xpd__[3][1]) + (-1.0f * __x_xpd__[3][6] * __x_xpd__[3][0]) + (__x_xpd__[3][1] * __x_xpd__[3][7]) + (-1.0f * __x_xpd__[3][0] * __x_xpd__[3][6]) + (-1.0f * __x_xpd__[3][4] * __x_xpd__[3][4])); } if (((x.m_gu & 16) != 0)) { n.m_c[0] += ((__x_xpd__[4][0] * __x_xpd__[4][4]) + (-1.0f * __x_xpd__[4][1] * __x_xpd__[4][1]) + (-1.0f * __x_xpd__[4][2] * __x_xpd__[4][2]) + (-1.0f * __x_xpd__[4][3] * __x_xpd__[4][3]) + (__x_xpd__[4][4] * __x_xpd__[4][0])); } if (((x.m_gu & 32) != 0)) { n.m_c[0] += (-1.0f * __x_xpd__[5][0] * __x_xpd__[5][0]); } scalar in; in.m_c[0] = ((char)1 / n.m_c[0]); mv __temp_var_1__; float __tmp_coord_array_14__[32] ; mv_zero(__tmp_coord_array_14__, 32); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_14__[0] += (__x_xpd__[0][0] * in.m_c[0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_14__[1] += (__x_xpd__[1][0] * in.m_c[0]); __tmp_coord_array_14__[2] += (__x_xpd__[1][1] * in.m_c[0]); __tmp_coord_array_14__[3] += (__x_xpd__[1][2] * in.m_c[0]); __tmp_coord_array_14__[4] += (__x_xpd__[1][3] * in.m_c[0]); __tmp_coord_array_14__[5] += (__x_xpd__[1][4] * in.m_c[0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_14__[6] += (-1.0f * __x_xpd__[2][0] * in.m_c[0]); __tmp_coord_array_14__[7] += (-1.0f * __x_xpd__[2][1] * in.m_c[0]); __tmp_coord_array_14__[8] += (-1.0f * __x_xpd__[2][2] * in.m_c[0]); __tmp_coord_array_14__[9] += (-1.0f * __x_xpd__[2][3] * in.m_c[0]); __tmp_coord_array_14__[10] += (-1.0f * __x_xpd__[2][4] * in.m_c[0]); __tmp_coord_array_14__[11] += (-1.0f * __x_xpd__[2][5] * in.m_c[0]); __tmp_coord_array_14__[12] += (-1.0f * __x_xpd__[2][6] * in.m_c[0]); __tmp_coord_array_14__[13] += (-1.0f * __x_xpd__[2][7] * in.m_c[0]); __tmp_coord_array_14__[14] += (-1.0f * __x_xpd__[2][8] * in.m_c[0]); __tmp_coord_array_14__[15] += (-1.0f * __x_xpd__[2][9] * in.m_c[0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_14__[16] += (-1.0f * __x_xpd__[3][0] * in.m_c[0]); __tmp_coord_array_14__[17] += (-1.0f * __x_xpd__[3][1] * in.m_c[0]); __tmp_coord_array_14__[18] += (-1.0f * __x_xpd__[3][2] * in.m_c[0]); __tmp_coord_array_14__[19] += (-1.0f * __x_xpd__[3][3] * in.m_c[0]); __tmp_coord_array_14__[20] += (-1.0f * __x_xpd__[3][4] * in.m_c[0]); __tmp_coord_array_14__[21] += (-1.0f * __x_xpd__[3][5] * in.m_c[0]); __tmp_coord_array_14__[22] += (-1.0f * __x_xpd__[3][6] * in.m_c[0]); __tmp_coord_array_14__[23] += (-1.0f * __x_xpd__[3][7] * in.m_c[0]); __tmp_coord_array_14__[24] += (-1.0f * __x_xpd__[3][8] * in.m_c[0]); __tmp_coord_array_14__[25] += (-1.0f * __x_xpd__[3][9] * in.m_c[0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_14__[26] += (__x_xpd__[4][0] * in.m_c[0]); __tmp_coord_array_14__[27] += (__x_xpd__[4][1] * in.m_c[0]); __tmp_coord_array_14__[28] += (__x_xpd__[4][2] * in.m_c[0]); __tmp_coord_array_14__[29] += (__x_xpd__[4][3] * in.m_c[0]); __tmp_coord_array_14__[30] += (__x_xpd__[4][4] * in.m_c[0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_14__[31] += (__x_xpd__[5][0] * in.m_c[0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_14__); return __temp_var_1__; } mv inverseEM(const mv& x) { scalar n; const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { n.m_c[0] += (__x_xpd__[0][0] * __x_xpd__[0][0]); } if (((x.m_gu & 2) != 0)) { n.m_c[0] += ((__x_xpd__[1][3] * __x_xpd__[1][3]) + (__x_xpd__[1][4] * __x_xpd__[1][4]) + (__x_xpd__[1][2] * __x_xpd__[1][2]) + (__x_xpd__[1][0] * __x_xpd__[1][0]) + (__x_xpd__[1][1] * __x_xpd__[1][1])); } if (((x.m_gu & 4) != 0)) { n.m_c[0] += ((__x_xpd__[2][9] * __x_xpd__[2][9]) + (__x_xpd__[2][2] * __x_xpd__[2][2]) + (__x_xpd__[2][5] * __x_xpd__[2][5]) + (__x_xpd__[2][7] * __x_xpd__[2][7]) + (__x_xpd__[2][3] * __x_xpd__[2][3]) + (__x_xpd__[2][6] * __x_xpd__[2][6]) + (__x_xpd__[2][4] * __x_xpd__[2][4]) + (__x_xpd__[2][0] * __x_xpd__[2][0]) + (__x_xpd__[2][8] * __x_xpd__[2][8]) + (__x_xpd__[2][1] * __x_xpd__[2][1])); } if (((x.m_gu & 8) != 0)) { n.m_c[0] += ((__x_xpd__[3][2] * __x_xpd__[3][2]) + (__x_xpd__[3][6] * __x_xpd__[3][6]) + (__x_xpd__[3][5] * __x_xpd__[3][5]) + (__x_xpd__[3][9] * __x_xpd__[3][9]) + (__x_xpd__[3][7] * __x_xpd__[3][7]) + (__x_xpd__[3][3] * __x_xpd__[3][3]) + (__x_xpd__[3][8] * __x_xpd__[3][8]) + (__x_xpd__[3][4] * __x_xpd__[3][4]) + (__x_xpd__[3][1] * __x_xpd__[3][1]) + (__x_xpd__[3][0] * __x_xpd__[3][0])); } if (((x.m_gu & 16) != 0)) { n.m_c[0] += ((__x_xpd__[4][1] * __x_xpd__[4][1]) + (__x_xpd__[4][3] * __x_xpd__[4][3]) + (__x_xpd__[4][4] * __x_xpd__[4][4]) + (__x_xpd__[4][0] * __x_xpd__[4][0]) + (__x_xpd__[4][2] * __x_xpd__[4][2])); } if (((x.m_gu & 32) != 0)) { n.m_c[0] += (__x_xpd__[5][0] * __x_xpd__[5][0]); } scalar in; in.m_c[0] = ((char)1 / n.m_c[0]); mv __temp_var_1__; float __tmp_coord_array_15__[32] ; mv_zero(__tmp_coord_array_15__, 32); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_15__[0] += (__x_xpd__[0][0] * in.m_c[0]); } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_15__[1] += (__x_xpd__[1][0] * in.m_c[0]); __tmp_coord_array_15__[2] += (__x_xpd__[1][1] * in.m_c[0]); __tmp_coord_array_15__[3] += (__x_xpd__[1][2] * in.m_c[0]); __tmp_coord_array_15__[4] += (__x_xpd__[1][3] * in.m_c[0]); __tmp_coord_array_15__[5] += (__x_xpd__[1][4] * in.m_c[0]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_15__[6] += (-1.0f * __x_xpd__[2][0] * in.m_c[0]); __tmp_coord_array_15__[7] += (-1.0f * __x_xpd__[2][1] * in.m_c[0]); __tmp_coord_array_15__[8] += (-1.0f * __x_xpd__[2][2] * in.m_c[0]); __tmp_coord_array_15__[9] += (-1.0f * __x_xpd__[2][3] * in.m_c[0]); __tmp_coord_array_15__[10] += (-1.0f * __x_xpd__[2][4] * in.m_c[0]); __tmp_coord_array_15__[11] += (-1.0f * __x_xpd__[2][5] * in.m_c[0]); __tmp_coord_array_15__[12] += (-1.0f * __x_xpd__[2][6] * in.m_c[0]); __tmp_coord_array_15__[13] += (-1.0f * __x_xpd__[2][7] * in.m_c[0]); __tmp_coord_array_15__[14] += (-1.0f * __x_xpd__[2][8] * in.m_c[0]); __tmp_coord_array_15__[15] += (-1.0f * __x_xpd__[2][9] * in.m_c[0]); } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_15__[16] += (-1.0f * __x_xpd__[3][0] * in.m_c[0]); __tmp_coord_array_15__[17] += (-1.0f * __x_xpd__[3][1] * in.m_c[0]); __tmp_coord_array_15__[18] += (-1.0f * __x_xpd__[3][2] * in.m_c[0]); __tmp_coord_array_15__[19] += (-1.0f * __x_xpd__[3][3] * in.m_c[0]); __tmp_coord_array_15__[20] += (-1.0f * __x_xpd__[3][4] * in.m_c[0]); __tmp_coord_array_15__[21] += (-1.0f * __x_xpd__[3][5] * in.m_c[0]); __tmp_coord_array_15__[22] += (-1.0f * __x_xpd__[3][6] * in.m_c[0]); __tmp_coord_array_15__[23] += (-1.0f * __x_xpd__[3][7] * in.m_c[0]); __tmp_coord_array_15__[24] += (-1.0f * __x_xpd__[3][8] * in.m_c[0]); __tmp_coord_array_15__[25] += (-1.0f * __x_xpd__[3][9] * in.m_c[0]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_15__[26] += (__x_xpd__[4][0] * in.m_c[0]); __tmp_coord_array_15__[27] += (__x_xpd__[4][1] * in.m_c[0]); __tmp_coord_array_15__[28] += (__x_xpd__[4][2] * in.m_c[0]); __tmp_coord_array_15__[29] += (__x_xpd__[4][3] * in.m_c[0]); __tmp_coord_array_15__[30] += (__x_xpd__[4][4] * in.m_c[0]); } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_15__[31] += (__x_xpd__[5][0] * in.m_c[0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_15__); return __temp_var_1__; } mv gradeInvolution(const mv& x) { mv __temp_var_1__; float __tmp_coord_array_16__[32] ; mv_zero(__tmp_coord_array_16__, 32); const float* __x_xpd__[6] ; x.expand(__x_xpd__, true); if (((x.m_gu & 1) != 0)) { __tmp_coord_array_16__[0] += __x_xpd__[0][0]; } if (((x.m_gu & 2) != 0)) { __tmp_coord_array_16__[1] += (-1.0f * __x_xpd__[1][0]); __tmp_coord_array_16__[2] += (-1.0f * __x_xpd__[1][1]); __tmp_coord_array_16__[3] += (-1.0f * __x_xpd__[1][2]); __tmp_coord_array_16__[4] += (-1.0f * __x_xpd__[1][3]); __tmp_coord_array_16__[5] += (-1.0f * __x_xpd__[1][4]); } if (((x.m_gu & 4) != 0)) { __tmp_coord_array_16__[6] += __x_xpd__[2][0]; __tmp_coord_array_16__[7] += __x_xpd__[2][1]; __tmp_coord_array_16__[8] += __x_xpd__[2][2]; __tmp_coord_array_16__[9] += __x_xpd__[2][3]; __tmp_coord_array_16__[10] += __x_xpd__[2][4]; __tmp_coord_array_16__[11] += __x_xpd__[2][5]; __tmp_coord_array_16__[12] += __x_xpd__[2][6]; __tmp_coord_array_16__[13] += __x_xpd__[2][7]; __tmp_coord_array_16__[14] += __x_xpd__[2][8]; __tmp_coord_array_16__[15] += __x_xpd__[2][9]; } if (((x.m_gu & 8) != 0)) { __tmp_coord_array_16__[16] += (-1.0f * __x_xpd__[3][0]); __tmp_coord_array_16__[17] += (-1.0f * __x_xpd__[3][1]); __tmp_coord_array_16__[18] += (-1.0f * __x_xpd__[3][2]); __tmp_coord_array_16__[19] += (-1.0f * __x_xpd__[3][3]); __tmp_coord_array_16__[20] += (-1.0f * __x_xpd__[3][4]); __tmp_coord_array_16__[21] += (-1.0f * __x_xpd__[3][5]); __tmp_coord_array_16__[22] += (-1.0f * __x_xpd__[3][6]); __tmp_coord_array_16__[23] += (-1.0f * __x_xpd__[3][7]); __tmp_coord_array_16__[24] += (-1.0f * __x_xpd__[3][8]); __tmp_coord_array_16__[25] += (-1.0f * __x_xpd__[3][9]); } if (((x.m_gu & 16) != 0)) { __tmp_coord_array_16__[26] += __x_xpd__[4][0]; __tmp_coord_array_16__[27] += __x_xpd__[4][1]; __tmp_coord_array_16__[28] += __x_xpd__[4][2]; __tmp_coord_array_16__[29] += __x_xpd__[4][3]; __tmp_coord_array_16__[30] += __x_xpd__[4][4]; } if (((x.m_gu & 32) != 0)) { __tmp_coord_array_16__[31] += (-1.0f * __x_xpd__[5][0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_16__); return __temp_var_1__; } // G2 functions: mv apply_om(const om& x, const mv& y) { mv __temp_var_1__; float __tmp_coord_array_17__[32] ; mv_zero(__tmp_coord_array_17__, 32); const float* __y_xpd__[6] ; y.expand(__y_xpd__, true); if (((y.m_gu & 2) != 0)) { __tmp_coord_array_17__[1] += ((x.m_c[1] * __y_xpd__[1][1]) + (x.m_c[0] * __y_xpd__[1][0]) + (x.m_c[2] * __y_xpd__[1][2]) + (x.m_c[3] * __y_xpd__[1][3]) + (x.m_c[4] * __y_xpd__[1][4])); __tmp_coord_array_17__[2] += ((x.m_c[7] * __y_xpd__[1][2]) + (x.m_c[8] * __y_xpd__[1][3]) + (x.m_c[9] * __y_xpd__[1][4]) + (x.m_c[5] * __y_xpd__[1][0]) + (x.m_c[6] * __y_xpd__[1][1])); __tmp_coord_array_17__[3] += ((x.m_c[14] * __y_xpd__[1][4]) + (x.m_c[13] * __y_xpd__[1][3]) + (x.m_c[10] * __y_xpd__[1][0]) + (x.m_c[12] * __y_xpd__[1][2]) + (x.m_c[11] * __y_xpd__[1][1])); __tmp_coord_array_17__[4] += ((x.m_c[17] * __y_xpd__[1][2]) + (x.m_c[15] * __y_xpd__[1][0]) + (x.m_c[16] * __y_xpd__[1][1]) + (x.m_c[19] * __y_xpd__[1][4]) + (x.m_c[18] * __y_xpd__[1][3])); __tmp_coord_array_17__[5] += ((x.m_c[23] * __y_xpd__[1][3]) + (x.m_c[24] * __y_xpd__[1][4]) + (x.m_c[20] * __y_xpd__[1][0]) + (x.m_c[21] * __y_xpd__[1][1]) + (x.m_c[22] * __y_xpd__[1][2])); } if (((y.m_gu & 4) != 0)) { __tmp_coord_array_17__[6] += ((x.m_c[29] * __y_xpd__[2][4]) + (x.m_c[33] * __y_xpd__[2][8]) + (x.m_c[30] * __y_xpd__[2][5]) + (x.m_c[25] * __y_xpd__[2][0]) + (x.m_c[27] * __y_xpd__[2][2]) + (x.m_c[32] * __y_xpd__[2][7]) + (x.m_c[26] * __y_xpd__[2][1]) + (x.m_c[34] * __y_xpd__[2][9]) + (x.m_c[31] * __y_xpd__[2][6]) + (x.m_c[28] * __y_xpd__[2][3])); __tmp_coord_array_17__[7] += ((x.m_c[43] * __y_xpd__[2][8]) + (x.m_c[41] * __y_xpd__[2][6]) + (x.m_c[36] * __y_xpd__[2][1]) + (x.m_c[38] * __y_xpd__[2][3]) + (x.m_c[39] * __y_xpd__[2][4]) + (x.m_c[42] * __y_xpd__[2][7]) + (x.m_c[35] * __y_xpd__[2][0]) + (x.m_c[37] * __y_xpd__[2][2]) + (x.m_c[40] * __y_xpd__[2][5]) + (x.m_c[44] * __y_xpd__[2][9])); __tmp_coord_array_17__[8] += ((x.m_c[49] * __y_xpd__[2][4]) + (x.m_c[45] * __y_xpd__[2][0]) + (x.m_c[50] * __y_xpd__[2][5]) + (x.m_c[47] * __y_xpd__[2][2]) + (x.m_c[46] * __y_xpd__[2][1]) + (x.m_c[51] * __y_xpd__[2][6]) + (x.m_c[52] * __y_xpd__[2][7]) + (x.m_c[48] * __y_xpd__[2][3]) + (x.m_c[53] * __y_xpd__[2][8]) + (x.m_c[54] * __y_xpd__[2][9])); __tmp_coord_array_17__[9] += ((x.m_c[64] * __y_xpd__[2][9]) + (x.m_c[59] * __y_xpd__[2][4]) + (x.m_c[62] * __y_xpd__[2][7]) + (x.m_c[55] * __y_xpd__[2][0]) + (x.m_c[56] * __y_xpd__[2][1]) + (x.m_c[60] * __y_xpd__[2][5]) + (x.m_c[63] * __y_xpd__[2][8]) + (x.m_c[57] * __y_xpd__[2][2]) + (x.m_c[58] * __y_xpd__[2][3]) + (x.m_c[61] * __y_xpd__[2][6])); __tmp_coord_array_17__[10] += ((x.m_c[67] * __y_xpd__[2][2]) + (x.m_c[71] * __y_xpd__[2][6]) + (x.m_c[65] * __y_xpd__[2][0]) + (x.m_c[69] * __y_xpd__[2][4]) + (x.m_c[74] * __y_xpd__[2][9]) + (x.m_c[68] * __y_xpd__[2][3]) + (x.m_c[72] * __y_xpd__[2][7]) + (x.m_c[73] * __y_xpd__[2][8]) + (x.m_c[66] * __y_xpd__[2][1]) + (x.m_c[70] * __y_xpd__[2][5])); __tmp_coord_array_17__[11] += ((x.m_c[82] * __y_xpd__[2][7]) + (x.m_c[81] * __y_xpd__[2][6]) + (x.m_c[79] * __y_xpd__[2][4]) + (x.m_c[84] * __y_xpd__[2][9]) + (x.m_c[83] * __y_xpd__[2][8]) + (x.m_c[75] * __y_xpd__[2][0]) + (x.m_c[77] * __y_xpd__[2][2]) + (x.m_c[76] * __y_xpd__[2][1]) + (x.m_c[80] * __y_xpd__[2][5]) + (x.m_c[78] * __y_xpd__[2][3])); __tmp_coord_array_17__[12] += ((x.m_c[90] * __y_xpd__[2][5]) + (x.m_c[88] * __y_xpd__[2][3]) + (x.m_c[94] * __y_xpd__[2][9]) + (x.m_c[86] * __y_xpd__[2][1]) + (x.m_c[89] * __y_xpd__[2][4]) + (x.m_c[87] * __y_xpd__[2][2]) + (x.m_c[93] * __y_xpd__[2][8]) + (x.m_c[91] * __y_xpd__[2][6]) + (x.m_c[85] * __y_xpd__[2][0]) + (x.m_c[92] * __y_xpd__[2][7])); __tmp_coord_array_17__[13] += ((x.m_c[102] * __y_xpd__[2][7]) + (x.m_c[97] * __y_xpd__[2][2]) + (x.m_c[101] * __y_xpd__[2][6]) + (x.m_c[98] * __y_xpd__[2][3]) + (x.m_c[100] * __y_xpd__[2][5]) + (x.m_c[95] * __y_xpd__[2][0]) + (x.m_c[96] * __y_xpd__[2][1]) + (x.m_c[99] * __y_xpd__[2][4]) + (x.m_c[103] * __y_xpd__[2][8]) + (x.m_c[104] * __y_xpd__[2][9])); __tmp_coord_array_17__[14] += ((x.m_c[110] * __y_xpd__[2][5]) + (x.m_c[114] * __y_xpd__[2][9]) + (x.m_c[111] * __y_xpd__[2][6]) + (x.m_c[108] * __y_xpd__[2][3]) + (x.m_c[112] * __y_xpd__[2][7]) + (x.m_c[107] * __y_xpd__[2][2]) + (x.m_c[105] * __y_xpd__[2][0]) + (x.m_c[109] * __y_xpd__[2][4]) + (x.m_c[106] * __y_xpd__[2][1]) + (x.m_c[113] * __y_xpd__[2][8])); __tmp_coord_array_17__[15] += ((x.m_c[124] * __y_xpd__[2][9]) + (x.m_c[118] * __y_xpd__[2][3]) + (x.m_c[122] * __y_xpd__[2][7]) + (x.m_c[123] * __y_xpd__[2][8]) + (x.m_c[121] * __y_xpd__[2][6]) + (x.m_c[117] * __y_xpd__[2][2]) + (x.m_c[120] * __y_xpd__[2][5]) + (x.m_c[116] * __y_xpd__[2][1]) + (x.m_c[115] * __y_xpd__[2][0]) + (x.m_c[119] * __y_xpd__[2][4])); } if (((y.m_gu & 8) != 0)) { __tmp_coord_array_17__[16] += ((x.m_c[128] * __y_xpd__[3][3]) + (x.m_c[131] * __y_xpd__[3][6]) + (x.m_c[132] * __y_xpd__[3][7]) + (x.m_c[129] * __y_xpd__[3][4]) + (x.m_c[134] * __y_xpd__[3][9]) + (x.m_c[127] * __y_xpd__[3][2]) + (x.m_c[125] * __y_xpd__[3][0]) + (x.m_c[130] * __y_xpd__[3][5]) + (x.m_c[126] * __y_xpd__[3][1]) + (x.m_c[133] * __y_xpd__[3][8])); __tmp_coord_array_17__[17] += ((x.m_c[141] * __y_xpd__[3][6]) + (x.m_c[144] * __y_xpd__[3][9]) + (x.m_c[142] * __y_xpd__[3][7]) + (x.m_c[137] * __y_xpd__[3][2]) + (x.m_c[135] * __y_xpd__[3][0]) + (x.m_c[140] * __y_xpd__[3][5]) + (x.m_c[138] * __y_xpd__[3][3]) + (x.m_c[136] * __y_xpd__[3][1]) + (x.m_c[139] * __y_xpd__[3][4]) + (x.m_c[143] * __y_xpd__[3][8])); __tmp_coord_array_17__[18] += ((x.m_c[148] * __y_xpd__[3][3]) + (x.m_c[149] * __y_xpd__[3][4]) + (x.m_c[154] * __y_xpd__[3][9]) + (x.m_c[152] * __y_xpd__[3][7]) + (x.m_c[146] * __y_xpd__[3][1]) + (x.m_c[151] * __y_xpd__[3][6]) + (x.m_c[145] * __y_xpd__[3][0]) + (x.m_c[147] * __y_xpd__[3][2]) + (x.m_c[153] * __y_xpd__[3][8]) + (x.m_c[150] * __y_xpd__[3][5])); __tmp_coord_array_17__[19] += ((x.m_c[156] * __y_xpd__[3][1]) + (x.m_c[157] * __y_xpd__[3][2]) + (x.m_c[158] * __y_xpd__[3][3]) + (x.m_c[155] * __y_xpd__[3][0]) + (x.m_c[159] * __y_xpd__[3][4]) + (x.m_c[161] * __y_xpd__[3][6]) + (x.m_c[163] * __y_xpd__[3][8]) + (x.m_c[160] * __y_xpd__[3][5]) + (x.m_c[164] * __y_xpd__[3][9]) + (x.m_c[162] * __y_xpd__[3][7])); __tmp_coord_array_17__[20] += ((x.m_c[171] * __y_xpd__[3][6]) + (x.m_c[165] * __y_xpd__[3][0]) + (x.m_c[170] * __y_xpd__[3][5]) + (x.m_c[174] * __y_xpd__[3][9]) + (x.m_c[173] * __y_xpd__[3][8]) + (x.m_c[168] * __y_xpd__[3][3]) + (x.m_c[172] * __y_xpd__[3][7]) + (x.m_c[166] * __y_xpd__[3][1]) + (x.m_c[167] * __y_xpd__[3][2]) + (x.m_c[169] * __y_xpd__[3][4])); __tmp_coord_array_17__[21] += ((x.m_c[175] * __y_xpd__[3][0]) + (x.m_c[179] * __y_xpd__[3][4]) + (x.m_c[181] * __y_xpd__[3][6]) + (x.m_c[177] * __y_xpd__[3][2]) + (x.m_c[180] * __y_xpd__[3][5]) + (x.m_c[184] * __y_xpd__[3][9]) + (x.m_c[182] * __y_xpd__[3][7]) + (x.m_c[178] * __y_xpd__[3][3]) + (x.m_c[176] * __y_xpd__[3][1]) + (x.m_c[183] * __y_xpd__[3][8])); __tmp_coord_array_17__[22] += ((x.m_c[190] * __y_xpd__[3][5]) + (x.m_c[186] * __y_xpd__[3][1]) + (x.m_c[192] * __y_xpd__[3][7]) + (x.m_c[189] * __y_xpd__[3][4]) + (x.m_c[185] * __y_xpd__[3][0]) + (x.m_c[191] * __y_xpd__[3][6]) + (x.m_c[193] * __y_xpd__[3][8]) + (x.m_c[194] * __y_xpd__[3][9]) + (x.m_c[187] * __y_xpd__[3][2]) + (x.m_c[188] * __y_xpd__[3][3])); __tmp_coord_array_17__[23] += ((x.m_c[199] * __y_xpd__[3][4]) + (x.m_c[195] * __y_xpd__[3][0]) + (x.m_c[204] * __y_xpd__[3][9]) + (x.m_c[198] * __y_xpd__[3][3]) + (x.m_c[202] * __y_xpd__[3][7]) + (x.m_c[200] * __y_xpd__[3][5]) + (x.m_c[203] * __y_xpd__[3][8]) + (x.m_c[197] * __y_xpd__[3][2]) + (x.m_c[201] * __y_xpd__[3][6]) + (x.m_c[196] * __y_xpd__[3][1])); __tmp_coord_array_17__[24] += ((x.m_c[208] * __y_xpd__[3][3]) + (x.m_c[210] * __y_xpd__[3][5]) + (x.m_c[213] * __y_xpd__[3][8]) + (x.m_c[206] * __y_xpd__[3][1]) + (x.m_c[205] * __y_xpd__[3][0]) + (x.m_c[211] * __y_xpd__[3][6]) + (x.m_c[207] * __y_xpd__[3][2]) + (x.m_c[214] * __y_xpd__[3][9]) + (x.m_c[209] * __y_xpd__[3][4]) + (x.m_c[212] * __y_xpd__[3][7])); __tmp_coord_array_17__[25] += ((x.m_c[222] * __y_xpd__[3][7]) + (x.m_c[221] * __y_xpd__[3][6]) + (x.m_c[217] * __y_xpd__[3][2]) + (x.m_c[216] * __y_xpd__[3][1]) + (x.m_c[220] * __y_xpd__[3][5]) + (x.m_c[218] * __y_xpd__[3][3]) + (x.m_c[224] * __y_xpd__[3][9]) + (x.m_c[219] * __y_xpd__[3][4]) + (x.m_c[223] * __y_xpd__[3][8]) + (x.m_c[215] * __y_xpd__[3][0])); } if (((y.m_gu & 16) != 0)) { __tmp_coord_array_17__[26] += ((-1.0f * x.m_c[227] * __y_xpd__[4][2]) + (x.m_c[226] * __y_xpd__[4][1]) + (x.m_c[225] * __y_xpd__[4][0]) + (x.m_c[228] * __y_xpd__[4][3]) + (x.m_c[229] * __y_xpd__[4][4])); __tmp_coord_array_17__[27] += ((x.m_c[234] * __y_xpd__[4][4]) + (-1.0f * x.m_c[232] * __y_xpd__[4][2]) + (x.m_c[231] * __y_xpd__[4][1]) + (x.m_c[230] * __y_xpd__[4][0]) + (x.m_c[233] * __y_xpd__[4][3])); __tmp_coord_array_17__[28] += ((x.m_c[237] * __y_xpd__[4][2]) + (-1.0f * x.m_c[238] * __y_xpd__[4][3]) + (-1.0f * x.m_c[235] * __y_xpd__[4][0]) + (-1.0f * x.m_c[236] * __y_xpd__[4][1]) + (-1.0f * x.m_c[239] * __y_xpd__[4][4])); __tmp_coord_array_17__[29] += ((x.m_c[241] * __y_xpd__[4][1]) + (x.m_c[240] * __y_xpd__[4][0]) + (x.m_c[243] * __y_xpd__[4][3]) + (x.m_c[244] * __y_xpd__[4][4]) + (-1.0f * x.m_c[242] * __y_xpd__[4][2])); __tmp_coord_array_17__[30] += ((-1.0f * x.m_c[247] * __y_xpd__[4][2]) + (x.m_c[246] * __y_xpd__[4][1]) + (x.m_c[245] * __y_xpd__[4][0]) + (x.m_c[249] * __y_xpd__[4][4]) + (x.m_c[248] * __y_xpd__[4][3])); } if (((y.m_gu & 32) != 0)) { __tmp_coord_array_17__[31] += (x.m_c[250] * __y_xpd__[5][0]); } __temp_var_1__ = mv_compress(__tmp_coord_array_17__); return __temp_var_1__; } namespace __G2_GENERATED__ { void set(om& __x__, const point& __image_of_no__, const point& __image_of_e1__, const point& __image_of_e2__, const point& __image_of_e3__, const point& __image_of_ni__) { __x__.m_c[0] = __image_of_no__.m_c[0]; __x__.m_c[5] = __image_of_no__.m_c[1]; __x__.m_c[10] = __image_of_no__.m_c[2]; __x__.m_c[15] = __image_of_no__.m_c[3]; __x__.m_c[20] = __image_of_no__.m_c[4]; __x__.m_c[1] = __image_of_e1__.m_c[0]; __x__.m_c[6] = __image_of_e1__.m_c[1]; __x__.m_c[11] = __image_of_e1__.m_c[2]; __x__.m_c[16] = __image_of_e1__.m_c[3]; __x__.m_c[21] = __image_of_e1__.m_c[4]; __x__.m_c[2] = __image_of_e2__.m_c[0]; __x__.m_c[7] = __image_of_e2__.m_c[1]; __x__.m_c[12] = __image_of_e2__.m_c[2]; __x__.m_c[17] = __image_of_e2__.m_c[3]; __x__.m_c[22] = __image_of_e2__.m_c[4]; __x__.m_c[3] = __image_of_e3__.m_c[0]; __x__.m_c[8] = __image_of_e3__.m_c[1]; __x__.m_c[13] = __image_of_e3__.m_c[2]; __x__.m_c[18] = __image_of_e3__.m_c[3]; __x__.m_c[23] = __image_of_e3__.m_c[4]; __x__.m_c[4] = __image_of_ni__.m_c[0]; __x__.m_c[9] = __image_of_ni__.m_c[1]; __x__.m_c[14] = __image_of_ni__.m_c[2]; __x__.m_c[19] = __image_of_ni__.m_c[3]; __x__.m_c[24] = __image_of_ni__.m_c[4]; __x__.m_c[25] = ((-1.0f * __x__.m_c[1] * __x__.m_c[5]) + (__x__.m_c[6] * __x__.m_c[0])); __x__.m_c[35] = ((__x__.m_c[11] * __x__.m_c[0]) + (-1.0f * __x__.m_c[1] * __x__.m_c[10])); __x__.m_c[45] = ((__x__.m_c[16] * __x__.m_c[0]) + (-1.0f * __x__.m_c[1] * __x__.m_c[15])); __x__.m_c[55] = ((-1.0f * __x__.m_c[6] * __x__.m_c[10]) + (__x__.m_c[11] * __x__.m_c[5])); __x__.m_c[65] = ((__x__.m_c[16] * __x__.m_c[10]) + (-1.0f * __x__.m_c[11] * __x__.m_c[15])); __x__.m_c[75] = ((-1.0f * __x__.m_c[16] * __x__.m_c[5]) + (__x__.m_c[6] * __x__.m_c[15])); __x__.m_c[85] = ((-1.0f * __x__.m_c[6] * __x__.m_c[20]) + (__x__.m_c[21] * __x__.m_c[5])); __x__.m_c[95] = ((__x__.m_c[21] * __x__.m_c[10]) + (-1.0f * __x__.m_c[11] * __x__.m_c[20])); __x__.m_c[105] = ((__x__.m_c[21] * __x__.m_c[15]) + (-1.0f * __x__.m_c[16] * __x__.m_c[20])); __x__.m_c[115] = ((-1.0f * __x__.m_c[1] * __x__.m_c[20]) + (__x__.m_c[21] * __x__.m_c[0])); __x__.m_c[26] = ((-1.0f * __x__.m_c[2] * __x__.m_c[5]) + (__x__.m_c[7] * __x__.m_c[0])); __x__.m_c[36] = ((-1.0f * __x__.m_c[2] * __x__.m_c[10]) + (__x__.m_c[12] * __x__.m_c[0])); __x__.m_c[46] = ((__x__.m_c[17] * __x__.m_c[0]) + (-1.0f * __x__.m_c[2] * __x__.m_c[15])); __x__.m_c[56] = ((-1.0f * __x__.m_c[7] * __x__.m_c[10]) + (__x__.m_c[12] * __x__.m_c[5])); __x__.m_c[66] = ((__x__.m_c[17] * __x__.m_c[10]) + (-1.0f * __x__.m_c[12] * __x__.m_c[15])); __x__.m_c[76] = ((__x__.m_c[7] * __x__.m_c[15]) + (-1.0f * __x__.m_c[17] * __x__.m_c[5])); __x__.m_c[86] = ((__x__.m_c[22] * __x__.m_c[5]) + (-1.0f * __x__.m_c[7] * __x__.m_c[20])); __x__.m_c[96] = ((__x__.m_c[22] * __x__.m_c[10]) + (-1.0f * __x__.m_c[12] * __x__.m_c[20])); __x__.m_c[106] = ((-1.0f * __x__.m_c[17] * __x__.m_c[20]) + (__x__.m_c[22] * __x__.m_c[15])); __x__.m_c[116] = ((-1.0f * __x__.m_c[2] * __x__.m_c[20]) + (__x__.m_c[22] * __x__.m_c[0])); __x__.m_c[27] = ((-1.0f * __x__.m_c[3] * __x__.m_c[5]) + (__x__.m_c[8] * __x__.m_c[0])); __x__.m_c[37] = ((__x__.m_c[13] * __x__.m_c[0]) + (-1.0f * __x__.m_c[3] * __x__.m_c[10])); __x__.m_c[47] = ((__x__.m_c[18] * __x__.m_c[0]) + (-1.0f * __x__.m_c[3] * __x__.m_c[15])); __x__.m_c[57] = ((-1.0f * __x__.m_c[8] * __x__.m_c[10]) + (__x__.m_c[13] * __x__.m_c[5])); __x__.m_c[67] = ((__x__.m_c[18] * __x__.m_c[10]) + (-1.0f * __x__.m_c[13] * __x__.m_c[15])); __x__.m_c[77] = ((__x__.m_c[8] * __x__.m_c[15]) + (-1.0f * __x__.m_c[18] * __x__.m_c[5])); __x__.m_c[87] = ((__x__.m_c[23] * __x__.m_c[5]) + (-1.0f * __x__.m_c[8] * __x__.m_c[20])); __x__.m_c[97] = ((__x__.m_c[23] * __x__.m_c[10]) + (-1.0f * __x__.m_c[13] * __x__.m_c[20])); __x__.m_c[107] = ((__x__.m_c[23] * __x__.m_c[15]) + (-1.0f * __x__.m_c[18] * __x__.m_c[20])); __x__.m_c[117] = ((__x__.m_c[23] * __x__.m_c[0]) + (-1.0f * __x__.m_c[3] * __x__.m_c[20])); __x__.m_c[28] = ((__x__.m_c[7] * __x__.m_c[1]) + (-1.0f * __x__.m_c[2] * __x__.m_c[6])); __x__.m_c[38] = ((-1.0f * __x__.m_c[2] * __x__.m_c[11]) + (__x__.m_c[12] * __x__.m_c[1])); __x__.m_c[48] = ((-1.0f * __x__.m_c[2] * __x__.m_c[16]) + (__x__.m_c[17] * __x__.m_c[1])); __x__.m_c[58] = ((__x__.m_c[12] * __x__.m_c[6]) + (-1.0f * __x__.m_c[7] * __x__.m_c[11])); __x__.m_c[68] = ((-1.0f * __x__.m_c[12] * __x__.m_c[16]) + (__x__.m_c[17] * __x__.m_c[11])); __x__.m_c[78] = ((-1.0f * __x__.m_c[17] * __x__.m_c[6]) + (__x__.m_c[7] * __x__.m_c[16])); __x__.m_c[88] = ((-1.0f * __x__.m_c[7] * __x__.m_c[21]) + (__x__.m_c[22] * __x__.m_c[6])); __x__.m_c[98] = ((-1.0f * __x__.m_c[12] * __x__.m_c[21]) + (__x__.m_c[22] * __x__.m_c[11])); __x__.m_c[108] = ((__x__.m_c[22] * __x__.m_c[16]) + (-1.0f * __x__.m_c[17] * __x__.m_c[21])); __x__.m_c[118] = ((__x__.m_c[22] * __x__.m_c[1]) + (-1.0f * __x__.m_c[2] * __x__.m_c[21])); __x__.m_c[29] = ((__x__.m_c[8] * __x__.m_c[2]) + (-1.0f * __x__.m_c[3] * __x__.m_c[7])); __x__.m_c[39] = ((__x__.m_c[13] * __x__.m_c[2]) + (-1.0f * __x__.m_c[3] * __x__.m_c[12])); __x__.m_c[49] = ((__x__.m_c[18] * __x__.m_c[2]) + (-1.0f * __x__.m_c[3] * __x__.m_c[17])); __x__.m_c[59] = ((__x__.m_c[13] * __x__.m_c[7]) + (-1.0f * __x__.m_c[8] * __x__.m_c[12])); __x__.m_c[69] = ((-1.0f * __x__.m_c[13] * __x__.m_c[17]) + (__x__.m_c[18] * __x__.m_c[12])); __x__.m_c[79] = ((-1.0f * __x__.m_c[18] * __x__.m_c[7]) + (__x__.m_c[8] * __x__.m_c[17])); __x__.m_c[89] = ((__x__.m_c[23] * __x__.m_c[7]) + (-1.0f * __x__.m_c[8] * __x__.m_c[22])); __x__.m_c[99] = ((-1.0f * __x__.m_c[13] * __x__.m_c[22]) + (__x__.m_c[23] * __x__.m_c[12])); __x__.m_c[109] = ((__x__.m_c[23] * __x__.m_c[17]) + (-1.0f * __x__.m_c[18] * __x__.m_c[22])); __x__.m_c[119] = ((__x__.m_c[23] * __x__.m_c[2]) + (-1.0f * __x__.m_c[3] * __x__.m_c[22])); __x__.m_c[30] = ((__x__.m_c[3] * __x__.m_c[6]) + (-1.0f * __x__.m_c[8] * __x__.m_c[1])); __x__.m_c[40] = ((__x__.m_c[3] * __x__.m_c[11]) + (-1.0f * __x__.m_c[13] * __x__.m_c[1])); __x__.m_c[50] = ((__x__.m_c[3] * __x__.m_c[16]) + (-1.0f * __x__.m_c[18] * __x__.m_c[1])); __x__.m_c[60] = ((__x__.m_c[8] * __x__.m_c[11]) + (-1.0f * __x__.m_c[13] * __x__.m_c[6])); __x__.m_c[70] = ((-1.0f * __x__.m_c[18] * __x__.m_c[11]) + (__x__.m_c[13] * __x__.m_c[16])); __x__.m_c[80] = ((__x__.m_c[18] * __x__.m_c[6]) + (-1.0f * __x__.m_c[8] * __x__.m_c[16])); __x__.m_c[90] = ((__x__.m_c[8] * __x__.m_c[21]) + (-1.0f * __x__.m_c[23] * __x__.m_c[6])); __x__.m_c[100] = ((-1.0f * __x__.m_c[23] * __x__.m_c[11]) + (__x__.m_c[13] * __x__.m_c[21])); __x__.m_c[110] = ((__x__.m_c[18] * __x__.m_c[21]) + (-1.0f * __x__.m_c[23] * __x__.m_c[16])); __x__.m_c[120] = ((__x__.m_c[3] * __x__.m_c[21]) + (-1.0f * __x__.m_c[23] * __x__.m_c[1])); __x__.m_c[31] = ((__x__.m_c[9] * __x__.m_c[1]) + (-1.0f * __x__.m_c[4] * __x__.m_c[6])); __x__.m_c[41] = ((-1.0f * __x__.m_c[4] * __x__.m_c[11]) + (__x__.m_c[14] * __x__.m_c[1])); __x__.m_c[51] = ((-1.0f * __x__.m_c[4] * __x__.m_c[16]) + (__x__.m_c[19] * __x__.m_c[1])); __x__.m_c[61] = ((__x__.m_c[14] * __x__.m_c[6]) + (-1.0f * __x__.m_c[9] * __x__.m_c[11])); __x__.m_c[71] = ((-1.0f * __x__.m_c[14] * __x__.m_c[16]) + (__x__.m_c[19] * __x__.m_c[11])); __x__.m_c[81] = ((__x__.m_c[9] * __x__.m_c[16]) + (-1.0f * __x__.m_c[19] * __x__.m_c[6])); __x__.m_c[91] = ((-1.0f * __x__.m_c[9] * __x__.m_c[21]) + (__x__.m_c[24] * __x__.m_c[6])); __x__.m_c[101] = ((-1.0f * __x__.m_c[14] * __x__.m_c[21]) + (__x__.m_c[24] * __x__.m_c[11])); __x__.m_c[111] = ((-1.0f * __x__.m_c[19] * __x__.m_c[21]) + (__x__.m_c[24] * __x__.m_c[16])); __x__.m_c[121] = ((__x__.m_c[24] * __x__.m_c[1]) + (-1.0f * __x__.m_c[4] * __x__.m_c[21])); __x__.m_c[32] = ((-1.0f * __x__.m_c[4] * __x__.m_c[7]) + (__x__.m_c[9] * __x__.m_c[2])); __x__.m_c[42] = ((__x__.m_c[14] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[12])); __x__.m_c[52] = ((__x__.m_c[19] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[17])); __x__.m_c[62] = ((__x__.m_c[14] * __x__.m_c[7]) + (-1.0f * __x__.m_c[9] * __x__.m_c[12])); __x__.m_c[72] = ((-1.0f * __x__.m_c[14] * __x__.m_c[17]) + (__x__.m_c[19] * __x__.m_c[12])); __x__.m_c[82] = ((__x__.m_c[9] * __x__.m_c[17]) + (-1.0f * __x__.m_c[19] * __x__.m_c[7])); __x__.m_c[92] = ((-1.0f * __x__.m_c[9] * __x__.m_c[22]) + (__x__.m_c[24] * __x__.m_c[7])); __x__.m_c[102] = ((__x__.m_c[24] * __x__.m_c[12]) + (-1.0f * __x__.m_c[14] * __x__.m_c[22])); __x__.m_c[112] = ((__x__.m_c[24] * __x__.m_c[17]) + (-1.0f * __x__.m_c[19] * __x__.m_c[22])); __x__.m_c[122] = ((__x__.m_c[24] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[22])); __x__.m_c[33] = ((-1.0f * __x__.m_c[4] * __x__.m_c[8]) + (__x__.m_c[9] * __x__.m_c[3])); __x__.m_c[43] = ((-1.0f * __x__.m_c[4] * __x__.m_c[13]) + (__x__.m_c[14] * __x__.m_c[3])); __x__.m_c[53] = ((-1.0f * __x__.m_c[4] * __x__.m_c[18]) + (__x__.m_c[19] * __x__.m_c[3])); __x__.m_c[63] = ((__x__.m_c[14] * __x__.m_c[8]) + (-1.0f * __x__.m_c[9] * __x__.m_c[13])); __x__.m_c[73] = ((-1.0f * __x__.m_c[14] * __x__.m_c[18]) + (__x__.m_c[19] * __x__.m_c[13])); __x__.m_c[83] = ((__x__.m_c[9] * __x__.m_c[18]) + (-1.0f * __x__.m_c[19] * __x__.m_c[8])); __x__.m_c[93] = ((__x__.m_c[24] * __x__.m_c[8]) + (-1.0f * __x__.m_c[9] * __x__.m_c[23])); __x__.m_c[103] = ((-1.0f * __x__.m_c[14] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[13])); __x__.m_c[113] = ((-1.0f * __x__.m_c[19] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[18])); __x__.m_c[123] = ((__x__.m_c[24] * __x__.m_c[3]) + (-1.0f * __x__.m_c[4] * __x__.m_c[23])); __x__.m_c[34] = ((-1.0f * __x__.m_c[4] * __x__.m_c[5]) + (__x__.m_c[9] * __x__.m_c[0])); __x__.m_c[44] = ((-1.0f * __x__.m_c[4] * __x__.m_c[10]) + (__x__.m_c[14] * __x__.m_c[0])); __x__.m_c[54] = ((-1.0f * __x__.m_c[4] * __x__.m_c[15]) + (__x__.m_c[19] * __x__.m_c[0])); __x__.m_c[64] = ((-1.0f * __x__.m_c[9] * __x__.m_c[10]) + (__x__.m_c[14] * __x__.m_c[5])); __x__.m_c[74] = ((-1.0f * __x__.m_c[14] * __x__.m_c[15]) + (__x__.m_c[19] * __x__.m_c[10])); __x__.m_c[84] = ((-1.0f * __x__.m_c[19] * __x__.m_c[5]) + (__x__.m_c[9] * __x__.m_c[15])); __x__.m_c[94] = ((-1.0f * __x__.m_c[9] * __x__.m_c[20]) + (__x__.m_c[24] * __x__.m_c[5])); __x__.m_c[104] = ((__x__.m_c[24] * __x__.m_c[10]) + (-1.0f * __x__.m_c[14] * __x__.m_c[20])); __x__.m_c[114] = ((-1.0f * __x__.m_c[19] * __x__.m_c[20]) + (__x__.m_c[24] * __x__.m_c[15])); __x__.m_c[124] = ((-1.0f * __x__.m_c[4] * __x__.m_c[20]) + (__x__.m_c[24] * __x__.m_c[0])); __x__.m_c[125] = ((-1.0f * __x__.m_c[103] * __x__.m_c[17]) + (__x__.m_c[73] * __x__.m_c[22]) + (__x__.m_c[113] * __x__.m_c[12])); __x__.m_c[135] = ((__x__.m_c[93] * __x__.m_c[17]) + (__x__.m_c[83] * __x__.m_c[22]) + (-1.0f * __x__.m_c[113] * __x__.m_c[7])); __x__.m_c[145] = ((__x__.m_c[63] * __x__.m_c[22]) + (-1.0f * __x__.m_c[93] * __x__.m_c[12]) + (__x__.m_c[103] * __x__.m_c[7])); __x__.m_c[155] = ((__x__.m_c[53] * __x__.m_c[22]) + (__x__.m_c[113] * __x__.m_c[2]) + (-1.0f * __x__.m_c[123] * __x__.m_c[17])); __x__.m_c[165] = ((-1.0f * __x__.m_c[123] * __x__.m_c[7]) + (__x__.m_c[33] * __x__.m_c[22]) + (__x__.m_c[93] * __x__.m_c[2])); __x__.m_c[175] = ((-1.0f * __x__.m_c[123] * __x__.m_c[12]) + (__x__.m_c[103] * __x__.m_c[2]) + (__x__.m_c[43] * __x__.m_c[22])); __x__.m_c[185] = ((-1.0f * __x__.m_c[53] * __x__.m_c[12]) + (__x__.m_c[43] * __x__.m_c[17]) + (__x__.m_c[73] * __x__.m_c[2])); __x__.m_c[195] = ((-1.0f * __x__.m_c[83] * __x__.m_c[2]) + (-1.0f * __x__.m_c[53] * __x__.m_c[7]) + (__x__.m_c[33] * __x__.m_c[17])); __x__.m_c[205] = ((__x__.m_c[33] * __x__.m_c[12]) + (__x__.m_c[63] * __x__.m_c[2]) + (-1.0f * __x__.m_c[43] * __x__.m_c[7])); __x__.m_c[215] = ((__x__.m_c[83] * __x__.m_c[12]) + (__x__.m_c[73] * __x__.m_c[7]) + (__x__.m_c[63] * __x__.m_c[17])); __x__.m_c[126] = ((-1.0f * __x__.m_c[73] * __x__.m_c[21]) + (__x__.m_c[103] * __x__.m_c[16]) + (-1.0f * __x__.m_c[113] * __x__.m_c[11])); __x__.m_c[136] = ((-1.0f * __x__.m_c[93] * __x__.m_c[16]) + (__x__.m_c[113] * __x__.m_c[6]) + (-1.0f * __x__.m_c[83] * __x__.m_c[21])); __x__.m_c[146] = ((__x__.m_c[93] * __x__.m_c[11]) + (-1.0f * __x__.m_c[63] * __x__.m_c[21]) + (-1.0f * __x__.m_c[103] * __x__.m_c[6])); __x__.m_c[156] = ((__x__.m_c[123] * __x__.m_c[16]) + (-1.0f * __x__.m_c[53] * __x__.m_c[21]) + (-1.0f * __x__.m_c[113] * __x__.m_c[1])); __x__.m_c[166] = ((__x__.m_c[123] * __x__.m_c[6]) + (-1.0f * __x__.m_c[33] * __x__.m_c[21]) + (-1.0f * __x__.m_c[93] * __x__.m_c[1])); __x__.m_c[176] = ((-1.0f * __x__.m_c[103] * __x__.m_c[1]) + (-1.0f * __x__.m_c[43] * __x__.m_c[21]) + (__x__.m_c[123] * __x__.m_c[11])); __x__.m_c[186] = ((-1.0f * __x__.m_c[73] * __x__.m_c[1]) + (__x__.m_c[53] * __x__.m_c[11]) + (-1.0f * __x__.m_c[43] * __x__.m_c[16])); __x__.m_c[196] = ((-1.0f * __x__.m_c[33] * __x__.m_c[16]) + (__x__.m_c[83] * __x__.m_c[1]) + (__x__.m_c[53] * __x__.m_c[6])); __x__.m_c[206] = ((__x__.m_c[43] * __x__.m_c[6]) + (-1.0f * __x__.m_c[63] * __x__.m_c[1]) + (-1.0f * __x__.m_c[33] * __x__.m_c[11])); __x__.m_c[216] = ((-1.0f * __x__.m_c[83] * __x__.m_c[11]) + (-1.0f * __x__.m_c[63] * __x__.m_c[16]) + (-1.0f * __x__.m_c[73] * __x__.m_c[6])); __x__.m_c[127] = ((-1.0f * __x__.m_c[102] * __x__.m_c[16]) + (__x__.m_c[112] * __x__.m_c[11]) + (__x__.m_c[72] * __x__.m_c[21])); __x__.m_c[137] = ((-1.0f * __x__.m_c[112] * __x__.m_c[6]) + (__x__.m_c[92] * __x__.m_c[16]) + (__x__.m_c[82] * __x__.m_c[21])); __x__.m_c[147] = ((__x__.m_c[102] * __x__.m_c[6]) + (__x__.m_c[62] * __x__.m_c[21]) + (-1.0f * __x__.m_c[92] * __x__.m_c[11])); __x__.m_c[157] = ((-1.0f * __x__.m_c[122] * __x__.m_c[16]) + (__x__.m_c[52] * __x__.m_c[21]) + (__x__.m_c[112] * __x__.m_c[1])); __x__.m_c[167] = ((-1.0f * __x__.m_c[122] * __x__.m_c[6]) + (__x__.m_c[92] * __x__.m_c[1]) + (__x__.m_c[32] * __x__.m_c[21])); __x__.m_c[177] = ((-1.0f * __x__.m_c[122] * __x__.m_c[11]) + (__x__.m_c[102] * __x__.m_c[1]) + (__x__.m_c[42] * __x__.m_c[21])); __x__.m_c[187] = ((__x__.m_c[42] * __x__.m_c[16]) + (__x__.m_c[72] * __x__.m_c[1]) + (-1.0f * __x__.m_c[52] * __x__.m_c[11])); __x__.m_c[197] = ((-1.0f * __x__.m_c[52] * __x__.m_c[6]) + (__x__.m_c[32] * __x__.m_c[16]) + (-1.0f * __x__.m_c[82] * __x__.m_c[1])); __x__.m_c[207] = ((-1.0f * __x__.m_c[42] * __x__.m_c[6]) + (__x__.m_c[32] * __x__.m_c[11]) + (__x__.m_c[62] * __x__.m_c[1])); __x__.m_c[217] = ((__x__.m_c[62] * __x__.m_c[16]) + (__x__.m_c[82] * __x__.m_c[11]) + (__x__.m_c[72] * __x__.m_c[6])); __x__.m_c[128] = ((-1.0f * __x__.m_c[114] * __x__.m_c[13]) + (__x__.m_c[104] * __x__.m_c[18]) + (-1.0f * __x__.m_c[74] * __x__.m_c[23])); __x__.m_c[138] = ((__x__.m_c[114] * __x__.m_c[8]) + (-1.0f * __x__.m_c[94] * __x__.m_c[18]) + (-1.0f * __x__.m_c[84] * __x__.m_c[23])); __x__.m_c[148] = ((-1.0f * __x__.m_c[64] * __x__.m_c[23]) + (-1.0f * __x__.m_c[104] * __x__.m_c[8]) + (__x__.m_c[94] * __x__.m_c[13])); __x__.m_c[158] = ((-1.0f * __x__.m_c[54] * __x__.m_c[23]) + (__x__.m_c[124] * __x__.m_c[18]) + (-1.0f * __x__.m_c[114] * __x__.m_c[3])); __x__.m_c[168] = ((__x__.m_c[124] * __x__.m_c[8]) + (-1.0f * __x__.m_c[34] * __x__.m_c[23]) + (-1.0f * __x__.m_c[94] * __x__.m_c[3])); __x__.m_c[178] = ((-1.0f * __x__.m_c[44] * __x__.m_c[23]) + (__x__.m_c[124] * __x__.m_c[13]) + (-1.0f * __x__.m_c[104] * __x__.m_c[3])); __x__.m_c[188] = ((__x__.m_c[54] * __x__.m_c[13]) + (-1.0f * __x__.m_c[44] * __x__.m_c[18]) + (-1.0f * __x__.m_c[74] * __x__.m_c[3])); __x__.m_c[198] = ((-1.0f * __x__.m_c[34] * __x__.m_c[18]) + (__x__.m_c[84] * __x__.m_c[3]) + (__x__.m_c[54] * __x__.m_c[8])); __x__.m_c[208] = ((-1.0f * __x__.m_c[34] * __x__.m_c[13]) + (__x__.m_c[44] * __x__.m_c[8]) + (-1.0f * __x__.m_c[64] * __x__.m_c[3])); __x__.m_c[218] = ((-1.0f * __x__.m_c[64] * __x__.m_c[18]) + (-1.0f * __x__.m_c[84] * __x__.m_c[13]) + (-1.0f * __x__.m_c[74] * __x__.m_c[8])); __x__.m_c[129] = ((-1.0f * __x__.m_c[114] * __x__.m_c[11]) + (__x__.m_c[104] * __x__.m_c[16]) + (-1.0f * __x__.m_c[74] * __x__.m_c[21])); __x__.m_c[139] = ((__x__.m_c[114] * __x__.m_c[6]) + (-1.0f * __x__.m_c[84] * __x__.m_c[21]) + (-1.0f * __x__.m_c[94] * __x__.m_c[16])); __x__.m_c[149] = ((-1.0f * __x__.m_c[64] * __x__.m_c[21]) + (__x__.m_c[94] * __x__.m_c[11]) + (-1.0f * __x__.m_c[104] * __x__.m_c[6])); __x__.m_c[159] = ((-1.0f * __x__.m_c[114] * __x__.m_c[1]) + (-1.0f * __x__.m_c[54] * __x__.m_c[21]) + (__x__.m_c[124] * __x__.m_c[16])); __x__.m_c[169] = ((-1.0f * __x__.m_c[94] * __x__.m_c[1]) + (-1.0f * __x__.m_c[34] * __x__.m_c[21]) + (__x__.m_c[124] * __x__.m_c[6])); __x__.m_c[179] = ((-1.0f * __x__.m_c[104] * __x__.m_c[1]) + (__x__.m_c[124] * __x__.m_c[11]) + (-1.0f * __x__.m_c[44] * __x__.m_c[21])); __x__.m_c[189] = ((__x__.m_c[54] * __x__.m_c[11]) + (-1.0f * __x__.m_c[44] * __x__.m_c[16]) + (-1.0f * __x__.m_c[74] * __x__.m_c[1])); __x__.m_c[199] = ((__x__.m_c[84] * __x__.m_c[1]) + (__x__.m_c[54] * __x__.m_c[6]) + (-1.0f * __x__.m_c[34] * __x__.m_c[16])); __x__.m_c[209] = ((__x__.m_c[44] * __x__.m_c[6]) + (-1.0f * __x__.m_c[64] * __x__.m_c[1]) + (-1.0f * __x__.m_c[34] * __x__.m_c[11])); __x__.m_c[219] = ((-1.0f * __x__.m_c[64] * __x__.m_c[16]) + (-1.0f * __x__.m_c[84] * __x__.m_c[11]) + (-1.0f * __x__.m_c[74] * __x__.m_c[6])); __x__.m_c[130] = ((__x__.m_c[104] * __x__.m_c[17]) + (-1.0f * __x__.m_c[114] * __x__.m_c[12]) + (-1.0f * __x__.m_c[74] * __x__.m_c[22])); __x__.m_c[140] = ((__x__.m_c[114] * __x__.m_c[7]) + (-1.0f * __x__.m_c[94] * __x__.m_c[17]) + (-1.0f * __x__.m_c[84] * __x__.m_c[22])); __x__.m_c[150] = ((-1.0f * __x__.m_c[104] * __x__.m_c[7]) + (-1.0f * __x__.m_c[64] * __x__.m_c[22]) + (__x__.m_c[94] * __x__.m_c[12])); __x__.m_c[160] = ((-1.0f * __x__.m_c[114] * __x__.m_c[2]) + (-1.0f * __x__.m_c[54] * __x__.m_c[22]) + (__x__.m_c[124] * __x__.m_c[17])); __x__.m_c[170] = ((-1.0f * __x__.m_c[94] * __x__.m_c[2]) + (-1.0f * __x__.m_c[34] * __x__.m_c[22]) + (__x__.m_c[124] * __x__.m_c[7])); __x__.m_c[180] = ((-1.0f * __x__.m_c[44] * __x__.m_c[22]) + (-1.0f * __x__.m_c[104] * __x__.m_c[2]) + (__x__.m_c[124] * __x__.m_c[12])); __x__.m_c[190] = ((-1.0f * __x__.m_c[74] * __x__.m_c[2]) + (-1.0f * __x__.m_c[44] * __x__.m_c[17]) + (__x__.m_c[54] * __x__.m_c[12])); __x__.m_c[200] = ((-1.0f * __x__.m_c[34] * __x__.m_c[17]) + (__x__.m_c[54] * __x__.m_c[7]) + (__x__.m_c[84] * __x__.m_c[2])); __x__.m_c[210] = ((__x__.m_c[44] * __x__.m_c[7]) + (-1.0f * __x__.m_c[64] * __x__.m_c[2]) + (-1.0f * __x__.m_c[34] * __x__.m_c[12])); __x__.m_c[220] = ((-1.0f * __x__.m_c[84] * __x__.m_c[12]) + (-1.0f * __x__.m_c[64] * __x__.m_c[17]) + (-1.0f * __x__.m_c[74] * __x__.m_c[7])); __x__.m_c[131] = ((__x__.m_c[69] * __x__.m_c[20]) + (__x__.m_c[109] * __x__.m_c[10]) + (-1.0f * __x__.m_c[99] * __x__.m_c[15])); __x__.m_c[141] = ((__x__.m_c[79] * __x__.m_c[20]) + (-1.0f * __x__.m_c[109] * __x__.m_c[5]) + (__x__.m_c[89] * __x__.m_c[15])); __x__.m_c[151] = ((__x__.m_c[59] * __x__.m_c[20]) + (__x__.m_c[99] * __x__.m_c[5]) + (-1.0f * __x__.m_c[89] * __x__.m_c[10])); __x__.m_c[161] = ((-1.0f * __x__.m_c[119] * __x__.m_c[15]) + (__x__.m_c[109] * __x__.m_c[0]) + (__x__.m_c[49] * __x__.m_c[20])); __x__.m_c[171] = ((__x__.m_c[89] * __x__.m_c[0]) + (__x__.m_c[29] * __x__.m_c[20]) + (-1.0f * __x__.m_c[119] * __x__.m_c[5])); __x__.m_c[181] = ((-1.0f * __x__.m_c[119] * __x__.m_c[10]) + (__x__.m_c[99] * __x__.m_c[0]) + (__x__.m_c[39] * __x__.m_c[20])); __x__.m_c[191] = ((-1.0f * __x__.m_c[49] * __x__.m_c[10]) + (__x__.m_c[39] * __x__.m_c[15]) + (__x__.m_c[69] * __x__.m_c[0])); __x__.m_c[201] = ((-1.0f * __x__.m_c[49] * __x__.m_c[5]) + (__x__.m_c[29] * __x__.m_c[15]) + (-1.0f * __x__.m_c[79] * __x__.m_c[0])); __x__.m_c[211] = ((__x__.m_c[59] * __x__.m_c[0]) + (__x__.m_c[29] * __x__.m_c[10]) + (-1.0f * __x__.m_c[39] * __x__.m_c[5])); __x__.m_c[221] = ((__x__.m_c[69] * __x__.m_c[5]) + (__x__.m_c[59] * __x__.m_c[15]) + (__x__.m_c[79] * __x__.m_c[10])); __x__.m_c[132] = ((-1.0f * __x__.m_c[70] * __x__.m_c[20]) + (-1.0f * __x__.m_c[110] * __x__.m_c[10]) + (__x__.m_c[100] * __x__.m_c[15])); __x__.m_c[142] = ((-1.0f * __x__.m_c[90] * __x__.m_c[15]) + (__x__.m_c[110] * __x__.m_c[5]) + (-1.0f * __x__.m_c[80] * __x__.m_c[20])); __x__.m_c[152] = ((__x__.m_c[90] * __x__.m_c[10]) + (-1.0f * __x__.m_c[100] * __x__.m_c[5]) + (-1.0f * __x__.m_c[60] * __x__.m_c[20])); __x__.m_c[162] = ((-1.0f * __x__.m_c[50] * __x__.m_c[20]) + (__x__.m_c[120] * __x__.m_c[15]) + (-1.0f * __x__.m_c[110] * __x__.m_c[0])); __x__.m_c[172] = ((-1.0f * __x__.m_c[90] * __x__.m_c[0]) + (-1.0f * __x__.m_c[30] * __x__.m_c[20]) + (__x__.m_c[120] * __x__.m_c[5])); __x__.m_c[182] = ((__x__.m_c[120] * __x__.m_c[10]) + (-1.0f * __x__.m_c[40] * __x__.m_c[20]) + (-1.0f * __x__.m_c[100] * __x__.m_c[0])); __x__.m_c[192] = ((__x__.m_c[50] * __x__.m_c[10]) + (-1.0f * __x__.m_c[70] * __x__.m_c[0]) + (-1.0f * __x__.m_c[40] * __x__.m_c[15])); __x__.m_c[202] = ((__x__.m_c[50] * __x__.m_c[5]) + (__x__.m_c[80] * __x__.m_c[0]) + (-1.0f * __x__.m_c[30] * __x__.m_c[15])); __x__.m_c[212] = ((__x__.m_c[40] * __x__.m_c[5]) + (-1.0f * __x__.m_c[60] * __x__.m_c[0]) + (-1.0f * __x__.m_c[30] * __x__.m_c[10])); __x__.m_c[222] = ((-1.0f * __x__.m_c[60] * __x__.m_c[15]) + (-1.0f * __x__.m_c[70] * __x__.m_c[5]) + (-1.0f * __x__.m_c[80] * __x__.m_c[10])); __x__.m_c[133] = ((-1.0f * __x__.m_c[98] * __x__.m_c[15]) + (__x__.m_c[108] * __x__.m_c[10]) + (__x__.m_c[68] * __x__.m_c[20])); __x__.m_c[143] = ((-1.0f * __x__.m_c[108] * __x__.m_c[5]) + (__x__.m_c[88] * __x__.m_c[15]) + (__x__.m_c[78] * __x__.m_c[20])); __x__.m_c[153] = ((-1.0f * __x__.m_c[88] * __x__.m_c[10]) + (__x__.m_c[58] * __x__.m_c[20]) + (__x__.m_c[98] * __x__.m_c[5])); __x__.m_c[163] = ((-1.0f * __x__.m_c[118] * __x__.m_c[15]) + (__x__.m_c[108] * __x__.m_c[0]) + (__x__.m_c[48] * __x__.m_c[20])); __x__.m_c[173] = ((-1.0f * __x__.m_c[118] * __x__.m_c[5]) + (__x__.m_c[88] * __x__.m_c[0]) + (__x__.m_c[28] * __x__.m_c[20])); __x__.m_c[183] = ((__x__.m_c[98] * __x__.m_c[0]) + (__x__.m_c[38] * __x__.m_c[20]) + (-1.0f * __x__.m_c[118] * __x__.m_c[10])); __x__.m_c[193] = ((__x__.m_c[38] * __x__.m_c[15]) + (__x__.m_c[68] * __x__.m_c[0]) + (-1.0f * __x__.m_c[48] * __x__.m_c[10])); __x__.m_c[203] = ((-1.0f * __x__.m_c[48] * __x__.m_c[5]) + (__x__.m_c[28] * __x__.m_c[15]) + (-1.0f * __x__.m_c[78] * __x__.m_c[0])); __x__.m_c[213] = ((-1.0f * __x__.m_c[38] * __x__.m_c[5]) + (__x__.m_c[58] * __x__.m_c[0]) + (__x__.m_c[28] * __x__.m_c[10])); __x__.m_c[223] = ((__x__.m_c[78] * __x__.m_c[10]) + (__x__.m_c[58] * __x__.m_c[15]) + (__x__.m_c[68] * __x__.m_c[5])); __x__.m_c[134] = ((__x__.m_c[70] * __x__.m_c[22]) + (-1.0f * __x__.m_c[100] * __x__.m_c[17]) + (__x__.m_c[110] * __x__.m_c[12])); __x__.m_c[144] = ((-1.0f * __x__.m_c[110] * __x__.m_c[7]) + (__x__.m_c[80] * __x__.m_c[22]) + (__x__.m_c[90] * __x__.m_c[17])); __x__.m_c[154] = ((__x__.m_c[60] * __x__.m_c[22]) + (-1.0f * __x__.m_c[90] * __x__.m_c[12]) + (__x__.m_c[100] * __x__.m_c[7])); __x__.m_c[164] = ((__x__.m_c[110] * __x__.m_c[2]) + (__x__.m_c[50] * __x__.m_c[22]) + (-1.0f * __x__.m_c[120] * __x__.m_c[17])); __x__.m_c[174] = ((__x__.m_c[30] * __x__.m_c[22]) + (-1.0f * __x__.m_c[120] * __x__.m_c[7]) + (__x__.m_c[90] * __x__.m_c[2])); __x__.m_c[184] = ((__x__.m_c[40] * __x__.m_c[22]) + (-1.0f * __x__.m_c[120] * __x__.m_c[12]) + (__x__.m_c[100] * __x__.m_c[2])); __x__.m_c[194] = ((__x__.m_c[70] * __x__.m_c[2]) + (__x__.m_c[40] * __x__.m_c[17]) + (-1.0f * __x__.m_c[50] * __x__.m_c[12])); __x__.m_c[204] = ((-1.0f * __x__.m_c[80] * __x__.m_c[2]) + (__x__.m_c[30] * __x__.m_c[17]) + (-1.0f * __x__.m_c[50] * __x__.m_c[7])); __x__.m_c[214] = ((__x__.m_c[60] * __x__.m_c[2]) + (__x__.m_c[30] * __x__.m_c[12]) + (-1.0f * __x__.m_c[40] * __x__.m_c[7])); __x__.m_c[224] = ((__x__.m_c[80] * __x__.m_c[12]) + (__x__.m_c[70] * __x__.m_c[7]) + (__x__.m_c[60] * __x__.m_c[17])); __x__.m_c[225] = ((-1.0f * __x__.m_c[144] * __x__.m_c[14]) + (__x__.m_c[224] * __x__.m_c[24]) + (-1.0f * __x__.m_c[134] * __x__.m_c[9]) + (-1.0f * __x__.m_c[154] * __x__.m_c[19])); __x__.m_c[230] = ((__x__.m_c[164] * __x__.m_c[14]) + (-1.0f * __x__.m_c[134] * __x__.m_c[4]) + (__x__.m_c[194] * __x__.m_c[24]) + (-1.0f * __x__.m_c[184] * __x__.m_c[19])); __x__.m_c[235] = ((__x__.m_c[204] * __x__.m_c[24]) + (__x__.m_c[144] * __x__.m_c[4]) + (-1.0f * __x__.m_c[174] * __x__.m_c[19]) + (__x__.m_c[164] * __x__.m_c[9])); __x__.m_c[240] = ((-1.0f * __x__.m_c[154] * __x__.m_c[4]) + (__x__.m_c[214] * __x__.m_c[24]) + (__x__.m_c[184] * __x__.m_c[9]) + (-1.0f * __x__.m_c[174] * __x__.m_c[14])); __x__.m_c[245] = ((-1.0f * __x__.m_c[224] * __x__.m_c[4]) + (-1.0f * __x__.m_c[204] * __x__.m_c[14]) + (__x__.m_c[214] * __x__.m_c[19]) + (__x__.m_c[194] * __x__.m_c[9])); __x__.m_c[226] = ((__x__.m_c[221] * __x__.m_c[24]) + (-1.0f * __x__.m_c[141] * __x__.m_c[14]) + (-1.0f * __x__.m_c[131] * __x__.m_c[9]) + (-1.0f * __x__.m_c[151] * __x__.m_c[19])); __x__.m_c[231] = ((__x__.m_c[161] * __x__.m_c[14]) + (-1.0f * __x__.m_c[131] * __x__.m_c[4]) + (-1.0f * __x__.m_c[181] * __x__.m_c[19]) + (__x__.m_c[191] * __x__.m_c[24])); __x__.m_c[236] = ((__x__.m_c[141] * __x__.m_c[4]) + (__x__.m_c[161] * __x__.m_c[9]) + (-1.0f * __x__.m_c[171] * __x__.m_c[19]) + (__x__.m_c[201] * __x__.m_c[24])); __x__.m_c[241] = ((-1.0f * __x__.m_c[151] * __x__.m_c[4]) + (__x__.m_c[181] * __x__.m_c[9]) + (-1.0f * __x__.m_c[171] * __x__.m_c[14]) + (__x__.m_c[211] * __x__.m_c[24])); __x__.m_c[246] = ((-1.0f * __x__.m_c[221] * __x__.m_c[4]) + (__x__.m_c[191] * __x__.m_c[9]) + (-1.0f * __x__.m_c[201] * __x__.m_c[14]) + (__x__.m_c[211] * __x__.m_c[19])); __x__.m_c[227] = ((__x__.m_c[222] * __x__.m_c[24]) + (-1.0f * __x__.m_c[132] * __x__.m_c[9]) + (-1.0f * __x__.m_c[152] * __x__.m_c[19]) + (-1.0f * __x__.m_c[142] * __x__.m_c[14])); __x__.m_c[232] = ((-1.0f * __x__.m_c[132] * __x__.m_c[4]) + (__x__.m_c[162] * __x__.m_c[14]) + (-1.0f * __x__.m_c[182] * __x__.m_c[19]) + (__x__.m_c[192] * __x__.m_c[24])); __x__.m_c[237] = ((__x__.m_c[162] * __x__.m_c[9]) + (-1.0f * __x__.m_c[172] * __x__.m_c[19]) + (__x__.m_c[202] * __x__.m_c[24]) + (__x__.m_c[142] * __x__.m_c[4])); __x__.m_c[242] = ((-1.0f * __x__.m_c[152] * __x__.m_c[4]) + (__x__.m_c[182] * __x__.m_c[9]) + (-1.0f * __x__.m_c[172] * __x__.m_c[14]) + (__x__.m_c[212] * __x__.m_c[24])); __x__.m_c[247] = ((__x__.m_c[212] * __x__.m_c[19]) + (-1.0f * __x__.m_c[202] * __x__.m_c[14]) + (-1.0f * __x__.m_c[222] * __x__.m_c[4]) + (__x__.m_c[192] * __x__.m_c[9])); __x__.m_c[228] = ((__x__.m_c[223] * __x__.m_c[24]) + (-1.0f * __x__.m_c[143] * __x__.m_c[14]) + (-1.0f * __x__.m_c[153] * __x__.m_c[19]) + (-1.0f * __x__.m_c[133] * __x__.m_c[9])); __x__.m_c[233] = ((-1.0f * __x__.m_c[183] * __x__.m_c[19]) + (-1.0f * __x__.m_c[133] * __x__.m_c[4]) + (__x__.m_c[193] * __x__.m_c[24]) + (__x__.m_c[163] * __x__.m_c[14])); __x__.m_c[238] = ((__x__.m_c[143] * __x__.m_c[4]) + (-1.0f * __x__.m_c[173] * __x__.m_c[19]) + (__x__.m_c[203] * __x__.m_c[24]) + (__x__.m_c[163] * __x__.m_c[9])); __x__.m_c[243] = ((-1.0f * __x__.m_c[153] * __x__.m_c[4]) + (__x__.m_c[213] * __x__.m_c[24]) + (__x__.m_c[183] * __x__.m_c[9]) + (-1.0f * __x__.m_c[173] * __x__.m_c[14])); __x__.m_c[248] = ((__x__.m_c[193] * __x__.m_c[9]) + (-1.0f * __x__.m_c[203] * __x__.m_c[14]) + (__x__.m_c[213] * __x__.m_c[19]) + (-1.0f * __x__.m_c[223] * __x__.m_c[4])); __x__.m_c[229] = ((__x__.m_c[134] * __x__.m_c[5]) + (__x__.m_c[154] * __x__.m_c[15]) + (__x__.m_c[144] * __x__.m_c[10]) + (-1.0f * __x__.m_c[224] * __x__.m_c[20])); __x__.m_c[234] = ((__x__.m_c[184] * __x__.m_c[15]) + (__x__.m_c[134] * __x__.m_c[0]) + (-1.0f * __x__.m_c[164] * __x__.m_c[10]) + (-1.0f * __x__.m_c[194] * __x__.m_c[20])); __x__.m_c[239] = ((__x__.m_c[174] * __x__.m_c[15]) + (-1.0f * __x__.m_c[204] * __x__.m_c[20]) + (-1.0f * __x__.m_c[144] * __x__.m_c[0]) + (-1.0f * __x__.m_c[164] * __x__.m_c[5])); __x__.m_c[244] = ((__x__.m_c[174] * __x__.m_c[10]) + (-1.0f * __x__.m_c[184] * __x__.m_c[5]) + (__x__.m_c[154] * __x__.m_c[0]) + (-1.0f * __x__.m_c[214] * __x__.m_c[20])); __x__.m_c[249] = ((__x__.m_c[204] * __x__.m_c[10]) + (-1.0f * __x__.m_c[194] * __x__.m_c[5]) + (-1.0f * __x__.m_c[214] * __x__.m_c[15]) + (__x__.m_c[224] * __x__.m_c[0])); __x__.m_c[250] = ((__x__.m_c[239] * __x__.m_c[14]) + (__x__.m_c[229] * __x__.m_c[4]) + (-1.0f * __x__.m_c[244] * __x__.m_c[19]) + (__x__.m_c[249] * __x__.m_c[24]) + (-1.0f * __x__.m_c[234] * __x__.m_c[9])); } void set(om& __x__, const omFlatPoint& __y__) { __x__.m_c[0] = (char)0; __x__.m_c[5] = (char)0; __x__.m_c[10] = (char)0; __x__.m_c[15] = (char)0; __x__.m_c[20] = (char)0; __x__.m_c[1] = (char)0; __x__.m_c[6] = (char)0; __x__.m_c[11] = (char)0; __x__.m_c[16] = (char)0; __x__.m_c[21] = (char)0; __x__.m_c[2] = (char)0; __x__.m_c[7] = (char)0; __x__.m_c[12] = (char)0; __x__.m_c[17] = (char)0; __x__.m_c[22] = (char)0; __x__.m_c[3] = (char)0; __x__.m_c[8] = (char)0; __x__.m_c[13] = (char)0; __x__.m_c[18] = (char)0; __x__.m_c[23] = (char)0; __x__.m_c[4] = (char)0; __x__.m_c[9] = (char)0; __x__.m_c[14] = (char)0; __x__.m_c[19] = (char)0; __x__.m_c[24] = (char)0; __x__.m_c[25] = ((__x__.m_c[6] * __x__.m_c[0]) + (-1.0f * __x__.m_c[1] * __x__.m_c[5])); __x__.m_c[35] = ((__x__.m_c[11] * __x__.m_c[0]) + (-1.0f * __x__.m_c[1] * __x__.m_c[10])); __x__.m_c[45] = ((-1.0f * __x__.m_c[1] * __x__.m_c[15]) + (__x__.m_c[16] * __x__.m_c[0])); __x__.m_c[55] = ((-1.0f * __x__.m_c[6] * __x__.m_c[10]) + (__x__.m_c[11] * __x__.m_c[5])); __x__.m_c[65] = ((__x__.m_c[16] * __x__.m_c[10]) + (-1.0f * __x__.m_c[11] * __x__.m_c[15])); __x__.m_c[75] = ((__x__.m_c[6] * __x__.m_c[15]) + (-1.0f * __x__.m_c[16] * __x__.m_c[5])); __x__.m_c[85] = ((__x__.m_c[21] * __x__.m_c[5]) + (-1.0f * __x__.m_c[6] * __x__.m_c[20])); __x__.m_c[95] = ((-1.0f * __x__.m_c[11] * __x__.m_c[20]) + (__x__.m_c[21] * __x__.m_c[10])); __x__.m_c[105] = ((__x__.m_c[21] * __x__.m_c[15]) + (-1.0f * __x__.m_c[16] * __x__.m_c[20])); __x__.m_c[115] = ((-1.0f * __x__.m_c[1] * __x__.m_c[20]) + (__x__.m_c[21] * __x__.m_c[0])); __x__.m_c[26] = ((__x__.m_c[7] * __x__.m_c[0]) + (-1.0f * __x__.m_c[2] * __x__.m_c[5])); __x__.m_c[36] = ((-1.0f * __x__.m_c[2] * __x__.m_c[10]) + (__x__.m_c[12] * __x__.m_c[0])); __x__.m_c[46] = ((-1.0f * __x__.m_c[2] * __x__.m_c[15]) + (__x__.m_c[17] * __x__.m_c[0])); __x__.m_c[56] = ((__x__.m_c[12] * __x__.m_c[5]) + (-1.0f * __x__.m_c[7] * __x__.m_c[10])); __x__.m_c[66] = ((-1.0f * __x__.m_c[12] * __x__.m_c[15]) + (__x__.m_c[17] * __x__.m_c[10])); __x__.m_c[76] = ((__x__.m_c[7] * __x__.m_c[15]) + (-1.0f * __x__.m_c[17] * __x__.m_c[5])); __x__.m_c[86] = ((-1.0f * __x__.m_c[7] * __x__.m_c[20]) + (__x__.m_c[22] * __x__.m_c[5])); __x__.m_c[96] = ((__x__.m_c[22] * __x__.m_c[10]) + (-1.0f * __x__.m_c[12] * __x__.m_c[20])); __x__.m_c[106] = ((-1.0f * __x__.m_c[17] * __x__.m_c[20]) + (__x__.m_c[22] * __x__.m_c[15])); __x__.m_c[116] = ((__x__.m_c[22] * __x__.m_c[0]) + (-1.0f * __x__.m_c[2] * __x__.m_c[20])); __x__.m_c[27] = ((-1.0f * __x__.m_c[3] * __x__.m_c[5]) + (__x__.m_c[8] * __x__.m_c[0])); __x__.m_c[37] = ((__x__.m_c[13] * __x__.m_c[0]) + (-1.0f * __x__.m_c[3] * __x__.m_c[10])); __x__.m_c[47] = ((-1.0f * __x__.m_c[3] * __x__.m_c[15]) + (__x__.m_c[18] * __x__.m_c[0])); __x__.m_c[57] = ((__x__.m_c[13] * __x__.m_c[5]) + (-1.0f * __x__.m_c[8] * __x__.m_c[10])); __x__.m_c[67] = ((-1.0f * __x__.m_c[13] * __x__.m_c[15]) + (__x__.m_c[18] * __x__.m_c[10])); __x__.m_c[77] = ((__x__.m_c[8] * __x__.m_c[15]) + (-1.0f * __x__.m_c[18] * __x__.m_c[5])); __x__.m_c[87] = ((-1.0f * __x__.m_c[8] * __x__.m_c[20]) + (__x__.m_c[23] * __x__.m_c[5])); __x__.m_c[97] = ((__x__.m_c[23] * __x__.m_c[10]) + (-1.0f * __x__.m_c[13] * __x__.m_c[20])); __x__.m_c[107] = ((-1.0f * __x__.m_c[18] * __x__.m_c[20]) + (__x__.m_c[23] * __x__.m_c[15])); __x__.m_c[117] = ((-1.0f * __x__.m_c[3] * __x__.m_c[20]) + (__x__.m_c[23] * __x__.m_c[0])); __x__.m_c[28] = ((__x__.m_c[7] * __x__.m_c[1]) + (-1.0f * __x__.m_c[2] * __x__.m_c[6])); __x__.m_c[38] = ((-1.0f * __x__.m_c[2] * __x__.m_c[11]) + (__x__.m_c[12] * __x__.m_c[1])); __x__.m_c[48] = ((-1.0f * __x__.m_c[2] * __x__.m_c[16]) + (__x__.m_c[17] * __x__.m_c[1])); __x__.m_c[58] = ((-1.0f * __x__.m_c[7] * __x__.m_c[11]) + (__x__.m_c[12] * __x__.m_c[6])); __x__.m_c[68] = ((-1.0f * __x__.m_c[12] * __x__.m_c[16]) + (__x__.m_c[17] * __x__.m_c[11])); __x__.m_c[78] = ((__x__.m_c[7] * __x__.m_c[16]) + (-1.0f * __x__.m_c[17] * __x__.m_c[6])); __x__.m_c[88] = ((__x__.m_c[22] * __x__.m_c[6]) + (-1.0f * __x__.m_c[7] * __x__.m_c[21])); __x__.m_c[98] = ((__x__.m_c[22] * __x__.m_c[11]) + (-1.0f * __x__.m_c[12] * __x__.m_c[21])); __x__.m_c[108] = ((-1.0f * __x__.m_c[17] * __x__.m_c[21]) + (__x__.m_c[22] * __x__.m_c[16])); __x__.m_c[118] = ((__x__.m_c[22] * __x__.m_c[1]) + (-1.0f * __x__.m_c[2] * __x__.m_c[21])); __x__.m_c[29] = ((__x__.m_c[8] * __x__.m_c[2]) + (-1.0f * __x__.m_c[3] * __x__.m_c[7])); __x__.m_c[39] = ((-1.0f * __x__.m_c[3] * __x__.m_c[12]) + (__x__.m_c[13] * __x__.m_c[2])); __x__.m_c[49] = ((-1.0f * __x__.m_c[3] * __x__.m_c[17]) + (__x__.m_c[18] * __x__.m_c[2])); __x__.m_c[59] = ((__x__.m_c[13] * __x__.m_c[7]) + (-1.0f * __x__.m_c[8] * __x__.m_c[12])); __x__.m_c[69] = ((__x__.m_c[18] * __x__.m_c[12]) + (-1.0f * __x__.m_c[13] * __x__.m_c[17])); __x__.m_c[79] = ((__x__.m_c[8] * __x__.m_c[17]) + (-1.0f * __x__.m_c[18] * __x__.m_c[7])); __x__.m_c[89] = ((-1.0f * __x__.m_c[8] * __x__.m_c[22]) + (__x__.m_c[23] * __x__.m_c[7])); __x__.m_c[99] = ((__x__.m_c[23] * __x__.m_c[12]) + (-1.0f * __x__.m_c[13] * __x__.m_c[22])); __x__.m_c[109] = ((-1.0f * __x__.m_c[18] * __x__.m_c[22]) + (__x__.m_c[23] * __x__.m_c[17])); __x__.m_c[119] = ((-1.0f * __x__.m_c[3] * __x__.m_c[22]) + (__x__.m_c[23] * __x__.m_c[2])); __x__.m_c[30] = ((-1.0f * __x__.m_c[8] * __x__.m_c[1]) + (__x__.m_c[3] * __x__.m_c[6])); __x__.m_c[40] = ((-1.0f * __x__.m_c[13] * __x__.m_c[1]) + (__x__.m_c[3] * __x__.m_c[11])); __x__.m_c[50] = ((__x__.m_c[3] * __x__.m_c[16]) + (-1.0f * __x__.m_c[18] * __x__.m_c[1])); __x__.m_c[60] = ((__x__.m_c[8] * __x__.m_c[11]) + (-1.0f * __x__.m_c[13] * __x__.m_c[6])); __x__.m_c[70] = ((__x__.m_c[13] * __x__.m_c[16]) + (-1.0f * __x__.m_c[18] * __x__.m_c[11])); __x__.m_c[80] = ((-1.0f * __x__.m_c[8] * __x__.m_c[16]) + (__x__.m_c[18] * __x__.m_c[6])); __x__.m_c[90] = ((-1.0f * __x__.m_c[23] * __x__.m_c[6]) + (__x__.m_c[8] * __x__.m_c[21])); __x__.m_c[100] = ((-1.0f * __x__.m_c[23] * __x__.m_c[11]) + (__x__.m_c[13] * __x__.m_c[21])); __x__.m_c[110] = ((__x__.m_c[18] * __x__.m_c[21]) + (-1.0f * __x__.m_c[23] * __x__.m_c[16])); __x__.m_c[120] = ((__x__.m_c[3] * __x__.m_c[21]) + (-1.0f * __x__.m_c[23] * __x__.m_c[1])); __x__.m_c[31] = ((__x__.m_c[9] * __x__.m_c[1]) + (-1.0f * __x__.m_c[4] * __x__.m_c[6])); __x__.m_c[41] = ((-1.0f * __x__.m_c[4] * __x__.m_c[11]) + (__x__.m_c[14] * __x__.m_c[1])); __x__.m_c[51] = ((-1.0f * __x__.m_c[4] * __x__.m_c[16]) + (__x__.m_c[19] * __x__.m_c[1])); __x__.m_c[61] = ((__x__.m_c[14] * __x__.m_c[6]) + (-1.0f * __x__.m_c[9] * __x__.m_c[11])); __x__.m_c[71] = ((__x__.m_c[19] * __x__.m_c[11]) + (-1.0f * __x__.m_c[14] * __x__.m_c[16])); __x__.m_c[81] = ((__x__.m_c[9] * __x__.m_c[16]) + (-1.0f * __x__.m_c[19] * __x__.m_c[6])); __x__.m_c[91] = ((__x__.m_c[24] * __x__.m_c[6]) + (-1.0f * __x__.m_c[9] * __x__.m_c[21])); __x__.m_c[101] = ((__x__.m_c[24] * __x__.m_c[11]) + (-1.0f * __x__.m_c[14] * __x__.m_c[21])); __x__.m_c[111] = ((__x__.m_c[24] * __x__.m_c[16]) + (-1.0f * __x__.m_c[19] * __x__.m_c[21])); __x__.m_c[121] = ((-1.0f * __x__.m_c[4] * __x__.m_c[21]) + (__x__.m_c[24] * __x__.m_c[1])); __x__.m_c[32] = ((__x__.m_c[9] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[7])); __x__.m_c[42] = ((__x__.m_c[14] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[12])); __x__.m_c[52] = ((-1.0f * __x__.m_c[4] * __x__.m_c[17]) + (__x__.m_c[19] * __x__.m_c[2])); __x__.m_c[62] = ((-1.0f * __x__.m_c[9] * __x__.m_c[12]) + (__x__.m_c[14] * __x__.m_c[7])); __x__.m_c[72] = ((-1.0f * __x__.m_c[14] * __x__.m_c[17]) + (__x__.m_c[19] * __x__.m_c[12])); __x__.m_c[82] = ((__x__.m_c[9] * __x__.m_c[17]) + (-1.0f * __x__.m_c[19] * __x__.m_c[7])); __x__.m_c[92] = ((-1.0f * __x__.m_c[9] * __x__.m_c[22]) + (__x__.m_c[24] * __x__.m_c[7])); __x__.m_c[102] = ((-1.0f * __x__.m_c[14] * __x__.m_c[22]) + (__x__.m_c[24] * __x__.m_c[12])); __x__.m_c[112] = ((-1.0f * __x__.m_c[19] * __x__.m_c[22]) + (__x__.m_c[24] * __x__.m_c[17])); __x__.m_c[122] = ((__x__.m_c[24] * __x__.m_c[2]) + (-1.0f * __x__.m_c[4] * __x__.m_c[22])); __x__.m_c[33] = ((__x__.m_c[9] * __x__.m_c[3]) + (-1.0f * __x__.m_c[4] * __x__.m_c[8])); __x__.m_c[43] = ((__x__.m_c[14] * __x__.m_c[3]) + (-1.0f * __x__.m_c[4] * __x__.m_c[13])); __x__.m_c[53] = ((__x__.m_c[19] * __x__.m_c[3]) + (-1.0f * __x__.m_c[4] * __x__.m_c[18])); __x__.m_c[63] = ((-1.0f * __x__.m_c[9] * __x__.m_c[13]) + (__x__.m_c[14] * __x__.m_c[8])); __x__.m_c[73] = ((__x__.m_c[19] * __x__.m_c[13]) + (-1.0f * __x__.m_c[14] * __x__.m_c[18])); __x__.m_c[83] = ((-1.0f * __x__.m_c[19] * __x__.m_c[8]) + (__x__.m_c[9] * __x__.m_c[18])); __x__.m_c[93] = ((-1.0f * __x__.m_c[9] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[8])); __x__.m_c[103] = ((-1.0f * __x__.m_c[14] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[13])); __x__.m_c[113] = ((-1.0f * __x__.m_c[19] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[18])); __x__.m_c[123] = ((-1.0f * __x__.m_c[4] * __x__.m_c[23]) + (__x__.m_c[24] * __x__.m_c[3])); __x__.m_c[34] = ((__x__.m_c[9] * __x__.m_c[0]) + (-1.0f * __x__.m_c[4] * __x__.m_c[5])); __x__.m_c[44] = ((__x__.m_c[14] * __x__.m_c[0]) + (-1.0f * __x__.m_c[4] * __x__.m_c[10])); __x__.m_c[54] = ((-1.0f * __x__.m_c[4] * __x__.m_c[15]) + (__x__.m_c[19] * __x__.m_c[0])); __x__.m_c[64] = ((-1.0f * __x__.m_c[9] * __x__.m_c[10]) + (__x__.m_c[14] * __x__.m_c[5])); __x__.m_c[74] = ((-1.0f * __x__.m_c[14] * __x__.m_c[15]) + (__x__.m_c[19] * __x__.m_c[10])); __x__.m_c[84] = ((__x__.m_c[9] * __x__.m_c[15]) + (-1.0f * __x__.m_c[19] * __x__.m_c[5])); __x__.m_c[94] = ((__x__.m_c[24] * __x__.m_c[5]) + (-1.0f * __x__.m_c[9] * __x__.m_c[20])); __x__.m_c[104] = ((-1.0f * __x__.m_c[14] * __x__.m_c[20]) + (__x__.m_c[24] * __x__.m_c[10])); __x__.m_c[114] = ((__x__.m_c[24] * __x__.m_c[15]) + (-1.0f * __x__.m_c[19] * __x__.m_c[20])); __x__.m_c[124] = ((__x__.m_c[24] * __x__.m_c[0]) + (-1.0f * __x__.m_c[4] * __x__.m_c[20])); __x__.m_c[125] = ((__x__.m_c[73] * __x__.m_c[22]) + (-1.0f * __x__.m_c[103] * __x__.m_c[17]) + (__x__.m_c[113] * __x__.m_c[12])); __x__.m_c[135] = ((-1.0f * __x__.m_c[113] * __x__.m_c[7]) + (__x__.m_c[93] * __x__.m_c[17]) + (__x__.m_c[83] * __x__.m_c[22])); __x__.m_c[145] = ((__x__.m_c[63] * __x__.m_c[22]) + (-1.0f * __x__.m_c[93] * __x__.m_c[12]) + (__x__.m_c[103] * __x__.m_c[7])); __x__.m_c[155] = ((__x__.m_c[113] * __x__.m_c[2]) + (-1.0f * __x__.m_c[123] * __x__.m_c[17]) + (__x__.m_c[53] * __x__.m_c[22])); __x__.m_c[165] = ((-1.0f * __x__.m_c[123] * __x__.m_c[7]) + (__x__.m_c[33] * __x__.m_c[22]) + (__x__.m_c[93] * __x__.m_c[2])); __x__.m_c[175] = ((__x__.m_c[103] * __x__.m_c[2]) + (-1.0f * __x__.m_c[123] * __x__.m_c[12]) + (__x__.m_c[43] * __x__.m_c[22])); __x__.m_c[185] = ((-1.0f * __x__.m_c[53] * __x__.m_c[12]) + (__x__.m_c[43] * __x__.m_c[17]) + (__x__.m_c[73] * __x__.m_c[2])); __x__.m_c[195] = ((-1.0f * __x__.m_c[83] * __x__.m_c[2]) + (-1.0f * __x__.m_c[53] * __x__.m_c[7]) + (__x__.m_c[33] * __x__.m_c[17])); __x__.m_c[205] = ((-1.0f * __x__.m_c[43] * __x__.m_c[7]) + (__x__.m_c[33] * __x__.m_c[12]) + (__x__.m_c[63] * __x__.m_c[2])); __x__.m_c[215] = ((__x__.m_c[83] * __x__.m_c[12]) + (__x__.m_c[73] * __x__.m_c[7]) + (__x__.m_c[63] * __x__.m_c[17])); __x__.m_c[126] = ((-1.0f * __x__.m_c[73] * __x__.m_c[21]) + (__x__.m_c[103] * __x__.m_c[16]) + (-1.0f * __x__.m_c[113] * __x__.m_c[11])); __x__.m_c[136] = ((-1.0f * __x__.m_c[83] * __x__.m_c[21]) + (-1.0f * __x__.m_c[93] * __x__.m_c[16]) + (__x__.m_c[113] * __x__.m_c[6])); __x__.m_c[146] = ((-1.0f * __x__.m_c[103] * __x__.m_c[6]) + (-1.0f * __x__.m_c[63] * __x__.m_c[21]) + (__x__.m_c[93] * __x__.m_c[11])); __x__.m_c[156] = ((-1.0f * __x__.m_c[53] * __x__.m_c[21]) + (-1.0f * __x__.m_c[113] * __x__.m_c[1]) + (__x__.m_c[123] * __x__.m_c[16])); __x__.m_c[166] = ((__x__.m_c[123] * __x__.m_c[6]) + (-1.0f * __x__.m_c[93] * __x__.m_c[1]) + (-1.0f * __x__.m_c[33] * __x__.m_c[21])); __x__.m_c[176] = ((-1.0f * __x__.m_c[103] * __x__.m_c[1]) + (__x__.m_c[123] * __x__.m_c[11]) + (-1.0f * __x__.m_c[43] * __x__.m_c[21])); __x__.m_c[186] = ((__x__.m_c[53] * __x__.m_c[11]) + (-1.0f * __x__.m_c[73] * __x__.m_c[1]) + (-1.0f * __x__.m_c[43] * __x__.m_c[16])); __x__.m_c[196] = ((__x__.m_c[53] * __x__.m_c[6]) + (__x__.m_c[83] * __x__.m_c[1]) + (-1.0f * __x__.m_c[33] * __x__.m_c[16])); __x__.m_c[206] = ((-1.0f * __x__.m_c[63] * __x__.m_c[1]) + (-1.0f * __x__.m_c[33] * __x__.m_c[11]) + (__x__.m_c[43] * __x__.m_c[6])); __x__.m_c[216] = ((-1.0f * __x__.m_c[63] * __x__.m_c[16]) + (-1.0f * __x__.m_c[73] * __x__.m_c[6]) + (-1.0f * __x__.m_c[83] * __x__.m_c[11])); __x__.m_c[127] = ((-1.0f * __x__.m_c[102] * __x__.m_c[16]) + (__x__.m_c[72] * __x__.m_c[21]) + (__x__.m_c[112] * __x__.m_c[11])); __x__.m_c[137] = ((-1.0f * __x__.m_c[112] * __x__.m_c[6]) + (__x__.m_c[92] * __x__.m_c[16]) + (__x__.m_c[82] * __x__.m_c[21])); __x__.m_c[147] = ((__x__.m_c[62] * __x__.m_c[21]) + (__x__.m_c[102] * __x__.m_c[6]) + (-1.0f * __x__.m_c[92] * __x__.m_c[11])); __x__.m_c[157] = ((-1.0f * __x__.m_c[122] * __x__.m_c[16]) + (__x__.m_c[52] * __x__.m_c[21]) + (__x__.m_c[112] * __x__.m_c[1])); __x__.m_c[167] = ((-1.0f * __x__.m_c[122] * __x__.m_c[6]) + (__x__.m_c[92] * __x__.m_c[1]) + (__x__.m_c[32] * __x__.m_c[21])); __x__.m_c[177] = ((-1.0f * __x__.m_c[122] * __x__.m_c[11]) + (__x__.m_c[102] * __x__.m_c[1]) + (__x__.m_c[42] * __x__.m_c[21])); __x__.m_c[187] = ((-1.0f * __x__.m_c[52] * __x__.m_c[11]) + (__x__.m_c[72] * __x__.m_c[1]) + (__x__.m_c[42] * __x__.m_c[16])); __x__.m_c[197] = ((__x__.m_c[32] * __x__.m_c[16]) + (-1.0f * __x__.m_c[82] * __x__.m_c[1]) + (-1.0f * __x__.m_c[52] * __x__.m_c[6])); __x__.m_c[207] = ((__x__.m_c[32] * __x__.m_c[11]) + (-1.0f * __x__.m_c[42] * __x__.m_c[6]) + (__x__.m_c[62] * __x__.m_c[1])); __x__.m_c[217] = ((__x__.m_c[72] * __x__.m_c[6]) + (__x__.m_c[62] * __x__.m_c[16]) + (__x__.m_c[82] * __x__.m_c[11])); __x__.m_c[128] = ((-1.0f * __x__.m_c[74] * __x__.m_c[23]) + (__x__.m_c[104] * __x__.m_c[18]) + (-1.0f * __x__.m_c[114] * __x__.m_c[13])); __x__.m_c[138] = ((-1.0f * __x__.m_c[94] * __x__.m_c[18]) + (-1.0f * __x__.m_c[84] * __x__.m_c[23]) + (__x__.m_c[114] * __x__.m_c[8])); __x__.m_c[148] = ((-1.0f * __x__.m_c[64] * __x__.m_c[23]) + (__x__.m_c[94] * __x__.m_c[13]) + (-1.0f * __x__.m_c[104] * __x__.m_c[8])); __x__.m_c[158] = ((__x__.m_c[124] * __x__.m_c[18]) + (-1.0f * __x__.m_c[54] * __x__.m_c[23]) + (-1.0f * __x__.m_c[114] * __x__.m_c[3])); __x__.m_c[168] = ((__x__.m_c[124] * __x__.m_c[8]) + (-1.0f * __x__.m_c[94] * __x__.m_c[3]) + (-1.0f * __x__.m_c[34] * __x__.m_c[23])); __x__.m_c[178] = ((__x__.m_c[124] * __x__.m_c[13]) + (-1.0f * __x__.m_c[44] * __x__.m_c[23]) + (-1.0f * __x__.m_c[104] * __x__.m_c[3])); __x__.m_c[188] = ((-1.0f * __x__.m_c[74] * __x__.m_c[3]) + (-1.0f * __x__.m_c[44] * __x__.m_c[18]) + (__x__.m_c[54] * __x__.m_c[13])); __x__.m_c[198] = ((-1.0f * __x__.m_c[34] * __x__.m_c[18]) + (__x__.m_c[84] * __x__.m_c[3]) + (__x__.m_c[54] * __x__.m_c[8])); __x__.m_c[208] = ((-1.0f * __x__.m_c[64] * __x__.m_c[3]) + (__x__.m_c[44] * __x__.m_c[8]) + (-1.0f * __x__.m_c[34] * __x__.m_c[13])); __x__.m_c[218] = ((-1.0f * __x__.m_c[84] * __x__.m_c[13]) + (-1.0f * __x__.m_c[74] * __x__.m_c[8]) + (-1.0f * __x__.m_c[64] * __x__.m_c[18])); __x__.m_c[129] = ((__x__.m_c[104] * __x__.m_c[16]) + (-1.0f * __x__.m_c[74] * __x__.m_c[21]) + (-1.0f * __x__.m_c[114] * __x__.m_c[11])); __x__.m_c[139] = ((-1.0f * __x__.m_c[94] * __x__.m_c[16]) + (__x__.m_c[114] * __x__.m_c[6]) + (-1.0f * __x__.m_c[84] * __x__.m_c[21])); __x__.m_c[149] = ((__x__.m_c[94] * __x__.m_c[11]) + (-1.0f * __x__.m_c[104] * __x__.m_c[6]) + (-1.0f * __x__.m_c[64] * __x__.m_c[21])); __x__.m_c[159] = ((-1.0f * __x__.m_c[54] * __x__.m_c[21]) + (__x__.m_c[124] * __x__.m_c[16]) + (-1.0f * __x__.m_c[114] * __x__.m_c[1])); __x__.m_c[169] = ((__x__.m_c[124] * __x__.m_c[6]) + (-1.0f * __x__.m_c[94] * __x__.m_c[1]) + (-1.0f * __x__.m_c[34] * __x__.m_c[21])); __x__.m_c[179] = ((-1.0f * __x__.m_c[104] * __x__.m_c[1]) + (__x__.m_c[124] * __x__.m_c[11]) + (-1.0f * __x__.m_c[44] * __x__.m_c[21])); __x__.m_c[189] = ((-1.0f * __x__.m_c[44] * __x__.m_c[16]) + (-1.0f * __x__.m_c[74] * __x__.m_c[1]) + (__x__.m_c[54] * __x__.m_c[11])); __x__.m_c[199] = ((__x__.m_c[54] * __x__.m_c[6]) + (-1.0f * __x__.m_c[34] * __x__.m_c[16]) + (__x__.m_c[84] * __x__.m_c[1])); __x__.m_c[209] = ((-1.0f * __x__.m_c[34] * __x__.m_c[11]) + (-1.0f * __x__.m_c[64] * __x__.m_c[1]) + (__x__.m_c[44] * __x__.m_c[6])); __x__.m_c[219] = ((-1.0f * __x__.m_c[84] * __x__.m_c[11]) + (-1.0f * __x__.m_c[74] * __x__.m_c[6]) + (-1.0f * __x__.m_c[64] * __x__.m_c[16])); __x__.m_c[130] = ((-1.0f * __x__.m_c[114] * __x__.m_c[12]) + (__x__.m_c[104] * __x__.m_c[17]) + (-1.0f * __x__.m_c[74] * __x__.m_c[22])); __x__.m_c[140] = ((-1.0f * __x__.m_c[94] * __x__.m_c[17]) + (__x__.m_c[114] * __x__.m_c[7]) + (-1.0f * __x__.m_c[84] * __x__.m_c[22])); __x__.m_c[150] = ((-1.0f * __x__.m_c[64] * __x__.m_c[22]) + (__x__.m_c[94] * __x__.m_c[12]) + (-1.0f * __x__.m_c[104] * __x__.m_c[7])); __x__.m_c[160] = ((-1.0f * __x__.m_c[114] * __x__.m_c[2]) + (-1.0f * __x__.m_c[54] * __x__.m_c[22]) + (__x__.m_c[124] * __x__.m_c[17])); __x__.m_c[170] = ((__x__.m_c[124] * __x__.m_c[7]) + (-1.0f * __x__.m_c[34] * __x__.m_c[22]) + (-1.0f * __x__.m_c[94] * __x__.m_c[2])); __x__.m_c[180] = ((__x__.m_c[124] * __x__.m_c[12]) + (-1.0f * __x__.m_c[104] * __x__.m_c[2]) + (-1.0f * __x__.m_c[44] * __x__.m_c[22])); __x__.m_c[190] = ((-1.0f * __x__.m_c[74] * __x__.m_c[2]) + (-1.0f * __x__.m_c[44] * __x__.m_c[17]) + (__x__.m_c[54] * __x__.m_c[12])); __x__.m_c[200] = ((__x__.m_c[84] * __x__.m_c[2]) + (__x__.m_c[54] * __x__.m_c[7]) + (-1.0f * __x__.m_c[34] * __x__.m_c[17])); __x__.m_c[210] = ((-1.0f * __x__.m_c[64] * __x__.m_c[2]) + (__x__.m_c[44] * __x__.m_c[7]) + (-1.0f * __x__.m_c[34] * __x__.m_c[12])); __x__.m_c[220] = ((-1.0f * __x__.m_c[64] * __x__.m_c[17]) + (-1.0f * __x__.m_c[74] * __x__.m_c[7]) + (-1.0f * __x__.m_c[84] * __x__.m_c[12])); __x__.m_c[131] = ((__x__.m_c[109] * __x__.m_c[10]) + (__x__.m_c[69] * __x__.m_c[20]) + (-1.0f * __x__.m_c[99] * __x__.m_c[15])); __x__.m_c[141] = ((-1.0f * __x__.m_c[109] * __x__.m_c[5]) + (__x__.m_c[89] * __x__.m_c[15]) + (__x__.m_c[79] * __x__.m_c[20])); __x__.m_c[151] = ((__x__.m_c[99] * __x__.m_c[5]) + (-1.0f * __x__.m_c[89] * __x__.m_c[10]) + (__x__.m_c[59] * __x__.m_c[20])); __x__.m_c[161] = ((__x__.m_c[49] * __x__.m_c[20]) + (__x__.m_c[109] * __x__.m_c[0]) + (-1.0f * __x__.m_c[119] * __x__.m_c[15])); __x__.m_c[171] = ((-1.0f * __x__.m_c[119] * __x__.m_c[5]) + (__x__.m_c[29] * __x__.m_c[20]) + (__x__.m_c[89] * __x__.m_c[0])); __x__.m_c[181] = ((-1.0f * __x__.m_c[119] * __x__.m_c[10]) + (__x__.m_c[99] * __x__.m_c[0]) + (__x__.m_c[39] * __x__.m_c[20])); __x__.m_c[191] = ((__x__.m_c[39] * __x__.m_c[15]) + (__x__.m_c[69] * __x__.m_c[0]) + (-1.0f * __x__.m_c[49] * __x__.m_c[10])); __x__.m_c[201] = ((-1.0f * __x__.m_c[49] * __x__.m_c[5]) + (-1.0f * __x__.m_c[79] * __x__.m_c[0]) + (__x__.m_c[29] * __x__.m_c[15])); __x__.m_c[211] = ((__x__.m_c[29] * __x__.m_c[10]) + (__x__.m_c[59] * __x__.m_c[0]) + (-1.0f * __x__.m_c[39] * __x__.m_c[5])); __x__.m_c[221] = ((__x__.m_c[59] * __x__.m_c[15]) + (__x__.m_c[69] * __x__.m_c[5]) + (__x__.m_c[79] * __x__.m_c[10])); __x__.m_c[132] = ((-1.0f * __x__.m_c[110] * __x__.m_c[10]) + (-1.0f * __x__.m_c[70] * __x__.m_c[20]) + (__x__.m_c[100] * __x__.m_c[15])); __x__.m_c[142] = ((-1.0f * __x__.m_c[80] * __x__.m_c[20]) + (__x__.m_c[110] * __x__.m_c[5]) + (-1.0f * __x__.m_c[90] * __x__.m_c[15])); __x__.m_c[152] = ((__x__.m_c[90] * __x__.m_c[10]) + (-1.0f * __x__.m_c[60] * __x__.m_c[20]) + (-1.0f * __x__.m_c[100] * __x__.m_c[5])); __x__.m_c[162] = ((-1.0f * __x__.m_c[110] * __x__.m_c[0]) + (__x__.m_c[120] * __x__.m_c[15]) + (-1.0f * __x__.m_c[50] * __x__.m_c[20])); __x__.m_c[172] = ((-1.0f * __x__.m_c[90] * __x__.m_c[0]) + (__x__.m_c[120] * __x__.m_c[5]) + (-1.0f * __x__.m_c[30] * __x__.m_c[20])); __x__.m_c[182] = ((-1.0f * __x__.m_c[40] * __x__.m_c[20]) + (__x__.m_c[120] * __x__.m_c[10]) + (-1.0f * __x__.m_c[100] * __x__.m_c[0])); __x__.m_c[192] = ((-1.0f * __x__.m_c[70] * __x__.m_c[0]) + (__x__.m_c[50] * __x__.m_c[10]) + (-1.0f * __x__.m_c[40] * __x__.m_c[15])); __x__.m_c[202] = ((-1.0f * __x__.m_c[30] * __x__.m_c[15]) + (__x__.m_c[80] * __x__.m_c[0]) + (__x__.m_c[50] * __x__.m_c[5])); __x__.m_c[212] = ((__x__.m_c[40] * __x__.m_c[5]) + (-1.0f * __x__.m_c[30] * __x__.m_c[10]) + (-1.0f * __x__.m_c[60] * __x__.m_c[0])); __x__.m_c[222] = ((-1.0f * __x__.m_c[70] * __x__.m_c[5]) + (-1.0f * __x__.m_c[60] * __x__.m_c[15]) + (-1.0f * __x__.m_c[80] * __x__.m_c[10])); __x__.m_c[133] = ((__x__.m_c[108] * __x__.m_c[10]) + (-1.0f * __x__.m_c[98] * __x__.m_c[15]) + (__x__.m_c[68] * __x__.m_c[20])); __x__.m_c[143] = ((__x__.m_c[88] * __x__.m_c[15]) + (-1.0f * __x__.m_c[108] * __x__.m_c[5]) + (__x__.m_c[78] * __x__.m_c[20])); __x__.m_c[153] = ((__x__.m_c[98] * __x__.m_c[5]) + (__x__.m_c[58] * __x__.m_c[20]) + (-1.0f * __x__.m_c[88] * __x__.m_c[10])); __x__.m_c[163] = ((__x__.m_c[48] * __x__.m_c[20]) + (-1.0f * __x__.m_c[118] * __x__.m_c[15]) + (__x__.m_c[108] * __x__.m_c[0])); __x__.m_c[173] = ((__x__.m_c[28] * __x__.m_c[20]) + (__x__.m_c[88] * __x__.m_c[0]) + (-1.0f * __x__.m_c[118] * __x__.m_c[5])); __x__.m_c[183] = ((__x__.m_c[98] * __x__.m_c[0]) + (__x__.m_c[38] * __x__.m_c[20]) + (-1.0f * __x__.m_c[118] * __x__.m_c[10])); __x__.m_c[193] = ((__x__.m_c[38] * __x__.m_c[15]) + (-1.0f * __x__.m_c[48] * __x__.m_c[10]) + (__x__.m_c[68] * __x__.m_c[0])); __x__.m_c[203] = ((-1.0f * __x__.m_c[78] * __x__.m_c[0]) + (-1.0f * __x__.m_c[48] * __x__.m_c[5]) + (__x__.m_c[28] * __x__.m_c[15])); __x__.m_c[213] = ((-1.0f * __x__.m_c[38] * __x__.m_c[5]) + (__x__.m_c[28] * __x__.m_c[10]) + (__x__.m_c[58] * __x__.m_c[0])); __x__.m_c[223] = ((__x__.m_c[58] * __x__.m_c[15]) + (__x__.m_c[78] * __x__.m_c[10]) + (__x__.m_c[68] * __x__.m_c[5])); __x__.m_c[134] = ((__x__.m_c[70] * __x__.m_c[22]) + (__x__.m_c[110] * __x__.m_c[12]) + (-1.0f * __x__.m_c[100] * __x__.m_c[17])); __x__.m_c[144] = ((-1.0f * __x__.m_c[110] * __x__.m_c[7]) + (__x__.m_c[80] * __x__.m_c[22]) + (__x__.m_c[90] * __x__.m_c[17])); __x__.m_c[154] = ((__x__.m_c[100] * __x__.m_c[7]) + (__x__.m_c[60] * __x__.m_c[22]) + (-1.0f * __x__.m_c[90] * __x__.m_c[12])); __x__.m_c[164] = ((__x__.m_c[50] * __x__.m_c[22]) + (-1.0f * __x__.m_c[120] * __x__.m_c[17]) + (__x__.m_c[110] * __x__.m_c[2])); __x__.m_c[174] = ((-1.0f * __x__.m_c[120] * __x__.m_c[7]) + (__x__.m_c[30] * __x__.m_c[22]) + (__x__.m_c[90] * __x__.m_c[2])); __x__.m_c[184] = ((__x__.m_c[40] * __x__.m_c[22]) + (-1.0f * __x__.m_c[120] * __x__.m_c[12]) + (__x__.m_c[100] * __x__.m_c[2])); __x__.m_c[194] = ((__x__.m_c[70] * __x__.m_c[2]) + (-1.0f * __x__.m_c[50] * __x__.m_c[12]) + (__x__.m_c[40] * __x__.m_c[17])); __x__.m_c[204] = ((-1.0f * __x__.m_c[80] * __x__.m_c[2]) + (-1.0f * __x__.m_c[50] * __x__.m_c[7]) + (__x__.m_c[30] * __x__.m_c[17])); __x__.m_c[214] = ((__x__.m_c[60] * __x__.m_c[2]) + (-1.0f * __x__.m_c[40] * __x__.m_c[7]) + (__x__.m_c[30] * __x__.m_c[12])); __x__.m_c[224] = ((__x__.m_c[60] * __x__.m_c[17]) + (__x__.m_c[70] * __x__.m_c[7]) + (__x__.m_c[80] * __x__.m_c[12])); __x__.m_c[225] = ((-1.0f * __x__.m_c[144] * __x__.m_c[14]) + (__x__.m_c[224] * __x__.m_c[24]) + (-1.0f * __x__.m_c[134] * __x__.m_c[9]) + (-1.0f * __x__.m_c[154] * __x__.m_c[19])); __x__.m_c[230] = ((-1.0f * __x__.m_c[134] * __x__.m_c[4]) + (-1.0f * __x__.m_c[184] * __x__.m_c[19]) + (__x__.m_c[164] * __x__.m_c[14]) + (__x__.m_c[194] * __x__.m_c[24])); __x__.m_c[235] = ((__x__.m_c[164] * __x__.m_c[9]) + (__x__.m_c[204] * __x__.m_c[24]) + (__x__.m_c[144] * __x__.m_c[4]) + (-1.0f * __x__.m_c[174] * __x__.m_c[19])); __x__.m_c[240] = ((-1.0f * __x__.m_c[154] * __x__.m_c[4]) + (__x__.m_c[214] * __x__.m_c[24]) + (-1.0f * __x__.m_c[174] * __x__.m_c[14]) + (__x__.m_c[184] * __x__.m_c[9])); __x__.m_c[245] = ((-1.0f * __x__.m_c[224] * __x__.m_c[4]) + (__x__.m_c[214] * __x__.m_c[19]) + (__x__.m_c[194] * __x__.m_c[9]) + (-1.0f * __x__.m_c[204] * __x__.m_c[14])); __x__.m_c[226] = ((__x__.m_c[221] * __x__.m_c[24]) + (-1.0f * __x__.m_c[151] * __x__.m_c[19]) + (-1.0f * __x__.m_c[131] * __x__.m_c[9]) + (-1.0f * __x__.m_c[141] * __x__.m_c[14])); __x__.m_c[231] = ((__x__.m_c[191] * __x__.m_c[24]) + (__x__.m_c[161] * __x__.m_c[14]) + (-1.0f * __x__.m_c[181] * __x__.m_c[19]) + (-1.0f * __x__.m_c[131] * __x__.m_c[4])); __x__.m_c[236] = ((__x__.m_c[141] * __x__.m_c[4]) + (__x__.m_c[201] * __x__.m_c[24]) + (-1.0f * __x__.m_c[171] * __x__.m_c[19]) + (__x__.m_c[161] * __x__.m_c[9])); __x__.m_c[241] = ((-1.0f * __x__.m_c[171] * __x__.m_c[14]) + (__x__.m_c[211] * __x__.m_c[24]) + (__x__.m_c[181] * __x__.m_c[9]) + (-1.0f * __x__.m_c[151] * __x__.m_c[4])); __x__.m_c[246] = ((__x__.m_c[211] * __x__.m_c[19]) + (__x__.m_c[191] * __x__.m_c[9]) + (-1.0f * __x__.m_c[221] * __x__.m_c[4]) + (-1.0f * __x__.m_c[201] * __x__.m_c[14])); __x__.m_c[227] = ((-1.0f * __x__.m_c[142] * __x__.m_c[14]) + (-1.0f * __x__.m_c[132] * __x__.m_c[9]) + (__x__.m_c[222] * __x__.m_c[24]) + (-1.0f * __x__.m_c[152] * __x__.m_c[19])); __x__.m_c[232] = ((-1.0f * __x__.m_c[132] * __x__.m_c[4]) + (-1.0f * __x__.m_c[182] * __x__.m_c[19]) + (__x__.m_c[162] * __x__.m_c[14]) + (__x__.m_c[192] * __x__.m_c[24])); __x__.m_c[237] = ((__x__.m_c[142] * __x__.m_c[4]) + (__x__.m_c[202] * __x__.m_c[24]) + (-1.0f * __x__.m_c[172] * __x__.m_c[19]) + (__x__.m_c[162] * __x__.m_c[9])); __x__.m_c[242] = ((__x__.m_c[212] * __x__.m_c[24]) + (-1.0f * __x__.m_c[172] * __x__.m_c[14]) + (__x__.m_c[182] * __x__.m_c[9]) + (-1.0f * __x__.m_c[152] * __x__.m_c[4])); __x__.m_c[247] = ((__x__.m_c[192] * __x__.m_c[9]) + (-1.0f * __x__.m_c[202] * __x__.m_c[14]) + (-1.0f * __x__.m_c[222] * __x__.m_c[4]) + (__x__.m_c[212] * __x__.m_c[19])); __x__.m_c[228] = ((__x__.m_c[223] * __x__.m_c[24]) + (-1.0f * __x__.m_c[133] * __x__.m_c[9]) + (-1.0f * __x__.m_c[143] * __x__.m_c[14]) + (-1.0f * __x__.m_c[153] * __x__.m_c[19])); __x__.m_c[233] = ((__x__.m_c[193] * __x__.m_c[24]) + (-1.0f * __x__.m_c[133] * __x__.m_c[4]) + (-1.0f * __x__.m_c[183] * __x__.m_c[19]) + (__x__.m_c[163] * __x__.m_c[14])); __x__.m_c[238] = ((__x__.m_c[163] * __x__.m_c[9]) + (-1.0f * __x__.m_c[173] * __x__.m_c[19]) + (__x__.m_c[203] * __x__.m_c[24]) + (__x__.m_c[143] * __x__.m_c[4])); __x__.m_c[243] = ((-1.0f * __x__.m_c[153] * __x__.m_c[4]) + (__x__.m_c[213] * __x__.m_c[24]) + (__x__.m_c[183] * __x__.m_c[9]) + (-1.0f * __x__.m_c[173] * __x__.m_c[14])); __x__.m_c[248] = ((__x__.m_c[193] * __x__.m_c[9]) + (-1.0f * __x__.m_c[223] * __x__.m_c[4]) + (__x__.m_c[213] * __x__.m_c[19]) + (-1.0f * __x__.m_c[203] * __x__.m_c[14])); __x__.m_c[229] = ((__x__.m_c[154] * __x__.m_c[15]) + (__x__.m_c[134] * __x__.m_c[5]) + (__x__.m_c[144] * __x__.m_c[10]) + (-1.0f * __x__.m_c[224] * __x__.m_c[20])); __x__.m_c[234] = ((-1.0f * __x__.m_c[194] * __x__.m_c[20]) + (__x__.m_c[134] * __x__.m_c[0]) + (-1.0f * __x__.m_c[164] * __x__.m_c[10]) + (__x__.m_c[184] * __x__.m_c[15])); __x__.m_c[239] = ((-1.0f * __x__.m_c[164] * __x__.m_c[5]) + (__x__.m_c[174] * __x__.m_c[15]) + (-1.0f * __x__.m_c[204] * __x__.m_c[20]) + (-1.0f * __x__.m_c[144] * __x__.m_c[0])); __x__.m_c[244] = ((-1.0f * __x__.m_c[184] * __x__.m_c[5]) + (__x__.m_c[154] * __x__.m_c[0]) + (__x__.m_c[174] * __x__.m_c[10]) + (-1.0f * __x__.m_c[214] * __x__.m_c[20])); __x__.m_c[249] = ((__x__.m_c[204] * __x__.m_c[10]) + (-1.0f * __x__.m_c[214] * __x__.m_c[15]) + (-1.0f * __x__.m_c[194] * __x__.m_c[5]) + (__x__.m_c[224] * __x__.m_c[0])); __x__.m_c[250] = ((__x__.m_c[229] * __x__.m_c[4]) + (-1.0f * __x__.m_c[244] * __x__.m_c[19]) + (-1.0f * __x__.m_c[234] * __x__.m_c[9]) + (__x__.m_c[249] * __x__.m_c[24]) + (__x__.m_c[239] * __x__.m_c[14])); } void set(omFlatPoint& __x__, const om& __y__) { __x__.m_c[0] = ((-1.0f * __y__.m_c[9] * __y__.m_c[21]) + (__y__.m_c[24] * __y__.m_c[6])); __x__.m_c[1] = ((-1.0f * __y__.m_c[14] * __y__.m_c[21]) + (__y__.m_c[24] * __y__.m_c[11])); __x__.m_c[2] = ((-1.0f * __y__.m_c[19] * __y__.m_c[21]) + (__y__.m_c[24] * __y__.m_c[16])); __x__.m_c[3] = ((__y__.m_c[24] * __y__.m_c[1]) + (-1.0f * __y__.m_c[4] * __y__.m_c[21])); __x__.m_c[4] = ((-1.0f * __y__.m_c[9] * __y__.m_c[22]) + (__y__.m_c[24] * __y__.m_c[7])); __x__.m_c[5] = ((__y__.m_c[24] * __y__.m_c[12]) + (-1.0f * __y__.m_c[14] * __y__.m_c[22])); __x__.m_c[6] = ((__y__.m_c[24] * __y__.m_c[17]) + (-1.0f * __y__.m_c[19] * __y__.m_c[22])); __x__.m_c[7] = ((-1.0f * __y__.m_c[4] * __y__.m_c[22]) + (__y__.m_c[24] * __y__.m_c[2])); __x__.m_c[8] = ((__y__.m_c[24] * __y__.m_c[8]) + (-1.0f * __y__.m_c[9] * __y__.m_c[23])); __x__.m_c[9] = ((__y__.m_c[24] * __y__.m_c[13]) + (-1.0f * __y__.m_c[14] * __y__.m_c[23])); __x__.m_c[10] = ((__y__.m_c[24] * __y__.m_c[18]) + (-1.0f * __y__.m_c[19] * __y__.m_c[23])); __x__.m_c[11] = ((__y__.m_c[24] * __y__.m_c[3]) + (-1.0f * __y__.m_c[4] * __y__.m_c[23])); __x__.m_c[12] = ((__y__.m_c[24] * __y__.m_c[5]) + (-1.0f * __y__.m_c[9] * __y__.m_c[20])); __x__.m_c[13] = ((__y__.m_c[24] * __y__.m_c[10]) + (-1.0f * __y__.m_c[14] * __y__.m_c[20])); __x__.m_c[14] = ((-1.0f * __y__.m_c[19] * __y__.m_c[20]) + (__y__.m_c[24] * __y__.m_c[15])); __x__.m_c[15] = ((-1.0f * __y__.m_c[4] * __y__.m_c[20]) + (__y__.m_c[24] * __y__.m_c[0])); } } /* end of namespace __G2_GENERATED__ */ // algebra / user constants: __e3ni_ct__ e3ni; __e2ni_ct__ e2ni; __e1_ct__ e1; __I5i_ct__ I5i; __I3_ct__ I3; __ni_ct__ ni; __e3_ct__ e3; __e2_ct__ e2; __e1ni_ct__ e1ni; __no_ct__ no; __noni_ct__ noni; __I5_ct__ I5; char *string(const mv & obj, char *str, int maxLength, const char *fp /* = NULL */) { int stdIdx = 0, l; char tmpBuf[256], tmpFloatBuf[256]; int i, j, k = 0, bei, ia = 0, s = mv_size[obj.gu()], p = 0, cnt = 0; // set up the floating point precision if (fp == NULL) fp = mv_string_fp; // start the string l = sprintf(tmpBuf, "%s", mv_string_start); if (stdIdx + l <= maxLength) { strcpy(str + stdIdx, tmpBuf); stdIdx += l; } else mv_throw_exception("Buffer supplied to string() is too small", MV_EXCEPTION_ERROR); // print all coordinates for (i = 0; i <= 5; i++) { if (obj.gu() & (1 << i)) { for (j = 0; j < mv_gradeSize[i]; j++) { float coord = (float)mv_basisElementSignByIndex[ia] * obj.m_c[k]; /* goal: print [+|-]obj.m_c[k][* basisVector1 ^ ... ^ basisVectorN] */ sprintf(tmpFloatBuf, fp, fabs(coord)); if (atof(tmpFloatBuf) != 0.0) { l = 0; // print [+|-] l += sprintf(tmpBuf + l, "%s", (coord >= 0.0) ? (cnt ? mv_string_plus : "") : mv_string_minus); // print obj.m_c[k] l += sprintf(tmpBuf + l, tmpFloatBuf); if (i) { // if not grade 0, print [* basisVector1 ^ ... ^ basisVectorN] l += sprintf(tmpBuf + l, "%s", mv_string_mul); // print all basis vectors bei = 0; while (mv_basisElements[ia][bei] >= 0) { l += sprintf(tmpBuf + l, "%s%s", (bei) ? mv_string_wedge : "", mv_basisVectorNames[mv_basisElements[ia][bei]]); bei++; } } //copy all to 'str' if (stdIdx + l <= maxLength) { strcpy(str + stdIdx, tmpBuf); stdIdx += l; } else mv_throw_exception("Buffer supplied to string() is too small", MV_EXCEPTION_ERROR); cnt++; } k++; ia++; } } else ia += mv_gradeSize[i]; } // if no coordinates printed: 0 l = 0; if (cnt == 0) { l += sprintf(tmpBuf + l, "0"); } // end the string l += sprintf(tmpBuf + l, "%s", mv_string_end); if (stdIdx + l <= maxLength) { strcpy(str + stdIdx, tmpBuf); stdIdx += l; } else mv_throw_exception("Buffer supplied to string() is too small", MV_EXCEPTION_ERROR); return str; } // this function should be deprecated (conflicts with C++ stdlib) char *string(const mv & obj, const char *fp /* = NULL */) { // not multithreading safe, but not fatal either. static char str[2048]; return string(obj, str, 2047, fp); } char *c_str(const mv & obj, const char *fp /* = NULL */) { return string(obj, fp); } std::string toString(const mv & obj, const char *fp /* = NULL */) { std::string str; const int SIZE = 2048; str.resize(SIZE); string(obj, &(str[0]), SIZE-1, fp); str.resize(strlen(&(str[0]))); return str; } /** This function is not for external use. It compressed arrays of floats for storage in multivectors. */ void compress(const float *c, float *cc, int &cgu, float epsilon /*= 0.0*/, int gu /*= ...*/) { int i, j, ia = 0, ib = 0, f, s; cgu = 0; // for all grade parts... for (i = 0; i <= 5; i++) { // check if grade part has memory use: if (!(gu & (1 << i))) continue; // check if abs coordinates of grade part are all < epsilon s = mv_gradeSize[i]; j = ia + s; f = 0; for (; ia < j; ia++) if (mv_absLessThan(c[ia], epsilon)) {f = 1; break;} ia = j; if (f) { mv_memcpy(cc + ib, c + ia - s, s); ib += s; cgu |= (1 << i); } } } mv mv_compress(const float *c, float epsilon/*= 0.0*/, int gu /*= ...*/) { float cc[32]; int cgu; compress(c, cc, cgu, epsilon, gu); return mv(cgu, cc); } mv compress(const mv & arg1, float epsilon /*= 0.0*/) { return mv_compress(arg1.m_c, epsilon, arg1.m_gu); } void mv::compress(float epsilon /*= 0.0*/) { float cc[32]; int cgu; c3ga::compress(m_c, cc, cgu, epsilon, m_gu); set(cgu, cc); } mv mv_compress(int nbBlades, const unsigned int *bitmaps, const mv::Float *coords) { // convert basis blade compression to regular coordinate array: mv::Float A[32]; mv_zero(A, 32); // int gu = 0; for (int i = 0; i < nbBlades; i++) { A[mv_basisElementIndexByBitmap[bitmaps[i]]] = coords[i] * (mv::Float)mv_basisElementSignByBitmap[bitmaps[i]]; // gu |= (1 << mv_basisElementGradeByBitmap[bitmaps[i]]); } return mv_compress(A); //, (mv::Float)0.0, gu); } /** This function is not for external use. It decompresses the coordinates stored in this */ void mv::expand(const Float *ptrs[], bool nulls /* = true */) const { const Float *c(m_c); const Float *null = (nulls) ? NULL : nullFloats(); if (m_gu & 1) { ptrs[0] = c; c += 1; } else ptrs[0] = null; if (m_gu & 2) { ptrs[1] = c; c += 5; } else ptrs[1] = null; if (m_gu & 4) { ptrs[2] = c; c += 10; } else ptrs[2] = null; if (m_gu & 8) { ptrs[3] = c; c += 10; } else ptrs[3] = null; if (m_gu & 16) { ptrs[4] = c; c += 5; } else ptrs[4] = null; if (m_gu & 32) { ptrs[5] = c; c += 1; } else ptrs[5] = null; } void mvType::init(const mv &X, mv::Float epsilon) { m_type = MULTIVECTOR; // first of all determine grade usage & parity mv cX = X; cX.compress(epsilon); m_gradeUsage = (int)cX.gu(); int cnt[2] = {0,0}; // nb even, odd grade parts in use { // count grade part usage: int cntIdx = 0; int gu = m_gradeUsage; while (gu != 0) { if ((gu & 1) != 0) cnt[cntIdx & 1]++; gu >>= 1; m_grade = cntIdx; cntIdx++; } // if no grade part in use: zero blade if ((cnt[0] == 0) && (cnt[1] == 0)) { // multivector = zero blade, case closed m_zero = true; m_type = BLADE; m_parity = 0; m_grade = 0; // forced to grade 0, but actually, does not really have a grade return; } else { m_zero = false; // if both even and odd grade parts in use: multivector if ((cnt[0] != 0) && (cnt[1] != 0)) { // X = multivector, case closed m_parity = -1; return; } else // more work to do, but parity is known: // either a blade, or a versor, TBD below m_parity = (cnt[1] != 0) ? 1 : 0; } } // first test for versor: bool useAlgebraMetric = true; init(X, epsilon, useAlgebraMetric, cnt[0] + cnt[1]); // Only if metric is not Euclidean: // If it was not a versor, or blade using the algebra metric, then try again, // at least, if only one grade part is in use: if ((m_type == MULTIVECTOR) && ((cnt[0] + cnt[1]) == 1)) { useAlgebraMetric = false; init(X, epsilon, useAlgebraMetric, cnt[0] + cnt[1]); } } void mvType::init(const mv &X, mv::Float epsilon, bool useAlgebraMetric, int guCnt) { mv rX = reverse(X); // test if null: mv Sq = (useAlgebraMetric) ? scp(X, rX) : scpEM(X, rX); Sq.compress(epsilon); if (_Float(Sq) == 0) { // X = multivector, case closed m_type = MULTIVECTOR; return; } // versor inverse must be true inverse: mv Xvi = (useAlgebraMetric) ? inverse(X) : inverseEM(X); mv Xgi = gradeInvolution(X); // check if (Xgi Xvi) is a scalar: mv XgiXvi = (useAlgebraMetric) ? gp(Xgi, Xvi) : gpEM(Xgi, Xvi); { mv tmp = XgiXvi; tmp.compress(epsilon); if (tmp.gu() != GRADE_0) { // if not scalar: // X = multivector, case closed m_type = MULTIVECTOR; return; } } // check if Xgi Xvi == Xvi Xgi mv XviXgi = (useAlgebraMetric) ? gp(Xvi, Xgi) : gpEM(Xvi, Xgi); { mv tmp = XviXgi - XgiXvi; tmp.compress(epsilon); // this should result in 0 if (tmp.gu()) { // if not: // X = multivector, case closed m_type = MULTIVECTOR; return; } } // check if grade preserving for all basis vectors: { { // test no mv tmp = (useAlgebraMetric) ? gp(gp(Xvi, no), Xgi) : gpEM(gpEM(Xvi, no), Xgi); tmp.compress(epsilon); if (tmp.gu() != GRADE_1) { // X = multivector, case closed m_type = MULTIVECTOR; return; } } { // test e1 mv tmp = (useAlgebraMetric) ? gp(gp(Xvi, e1), Xgi) : gpEM(gpEM(Xvi, e1), Xgi); tmp.compress(epsilon); if (tmp.gu() != GRADE_1) { // X = multivector, case closed m_type = MULTIVECTOR; return; } } { // test e2 mv tmp = (useAlgebraMetric) ? gp(gp(Xvi, e2), Xgi) : gpEM(gpEM(Xvi, e2), Xgi); tmp.compress(epsilon); if (tmp.gu() != GRADE_1) { // X = multivector, case closed m_type = MULTIVECTOR; return; } } { // test e3 mv tmp = (useAlgebraMetric) ? gp(gp(Xvi, e3), Xgi) : gpEM(gpEM(Xvi, e3), Xgi); tmp.compress(epsilon); if (tmp.gu() != GRADE_1) { // X = multivector, case closed m_type = MULTIVECTOR; return; } } { // test ni mv tmp = (useAlgebraMetric) ? gp(gp(Xvi, ni), Xgi) : gpEM(gpEM(Xvi, ni), Xgi); tmp.compress(epsilon); if (tmp.gu() != GRADE_1) { // X = multivector, case closed m_type = MULTIVECTOR; return; } } } // if homogeneous: blade if (guCnt == 1) m_type = BLADE; else m_type = VERSOR; } std::string mvType::toString() const { char buf[1024]; sprintf(buf, "%s, grade: %d, gradeUsage: %X, parity: %s", (m_type == MULTIVECTOR) ? "multivector" : ((m_type == BLADE) ? "blade" : "versor"), m_grade, m_gradeUsage, (m_parity < 0) ? "none" : ((m_parity == 0) ? "even" : "odd")); return buf; } } // end of namespace c3ga // post_cpp_include
29.690624
492
0.546218
[ "vector" ]
7e6ffd72bfeff0b370ffc9dbe27ddabc807217d2
7,980
cc
C++
DQMOffline/MuonDPG/src/BaseTnPEfficiencyTask.cc
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
1
2021-11-30T16:24:46.000Z
2021-11-30T16:24:46.000Z
DQMOffline/MuonDPG/src/BaseTnPEfficiencyTask.cc
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
4
2021-11-29T13:57:56.000Z
2022-03-29T06:28:36.000Z
DQMOffline/MuonDPG/src/BaseTnPEfficiencyTask.cc
PKUfudawei/cmssw
8fbb5ce74398269c8a32956d7c7943766770c093
[ "Apache-2.0" ]
1
2022-02-27T06:12:26.000Z
2022-02-27T06:12:26.000Z
/* * \file BaseTnPEfficiencyTask.cc * * \author L. Lunerti - INFN Bologna * */ #include "DQMOffline/MuonDPG/interface/BaseTnPEfficiencyTask.h" // Framework #include "FWCore/Framework/interface/EventSetup.h" // Geometry #include "DataFormats/GeometryVector/interface/Pi.h" //Math #include "DataFormats/Math/interface/deltaR.h" //Root #include "TRegexp.h" #include <tuple> BaseTnPEfficiencyTask::BaseTnPEfficiencyTask(const edm::ParameterSet& config) : m_nEvents(0), m_muToken(consumes<reco::MuonCollection>(config.getUntrackedParameter<edm::InputTag>("inputTagMuons"))), m_borderCut(config.getUntrackedParameter<double>("borderCut")), m_dxCut(config.getUntrackedParameter<double>("dx_cut")), m_detailedAnalysis(config.getUntrackedParameter<bool>("detailedAnalysis")), m_primaryVerticesToken( consumes<std::vector<reco::Vertex>>(config.getUntrackedParameter<edm::InputTag>("inputTagPrimaryVertices"))), m_triggerResultsToken( consumes<edm::TriggerResults>(config.getUntrackedParameter<edm::InputTag>("trigResultsTag"))), m_triggerEventToken(consumes<trigger::TriggerEvent>(config.getUntrackedParameter<edm::InputTag>("trigEventTag"))), m_trigName(config.getUntrackedParameter<std::string>("trigName")), m_probeSelector(config.getUntrackedParameter<std::string>("probeCut")), m_dxyCut(config.getUntrackedParameter<double>("probeDxyCut")), m_dzCut(config.getUntrackedParameter<double>("probeDzCut")), m_tagSelector(config.getUntrackedParameter<std::string>("tagCut")), m_lowPairMassCut(config.getUntrackedParameter<double>("lowPairMassCut")), m_highPairMassCut(config.getUntrackedParameter<double>("highPairMassCut")) { LogTrace("DQMOffline|MuonDPG|BaseTnPEfficiencyTask") << "[BaseTnPEfficiencyTask]: Constructor" << std::endl; } BaseTnPEfficiencyTask::~BaseTnPEfficiencyTask() { LogTrace("DQMOffline|MuonDPG|BaseTnPEfficiencyTask") << "[BaseTnPEfficiencyTask]: analyzed " << m_nEvents << " events" << std::endl; } void BaseTnPEfficiencyTask::dqmBeginRun(const edm::Run& run, const edm::EventSetup& context) { bool changed = true; m_hltConfig.init(run, context, "HLT", changed); bool enableWildCard = true; TString tName = TString(m_trigName); TRegexp tNamePattern = TRegexp(tName, enableWildCard); for (unsigned iPath = 0; iPath < m_hltConfig.size(); ++iPath) { TString pathName = TString(m_hltConfig.triggerName(iPath)); if (pathName.Contains(tNamePattern)) { m_trigIndices.push_back(static_cast<int>(iPath)); } } } void BaseTnPEfficiencyTask::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& context) { LogTrace("DQMOffline|MuonDPG|BaseTnPEfficiencyTask") << "[BaseTnPEfficiencyTask]: bookHistograms" << std::endl; if (m_detailedAnalysis) { std::string baseDir = topFolder() + "/detailed/"; iBooker.setCurrentFolder(baseDir); LogTrace("DQMOffline|MuonDPG|BaseTnPEfficiencyTask") << "[BaseTnPEfficiencyTask]: booking histos in " << baseDir << std::endl; m_histos["probePt"] = iBooker.book1D("probePt", "probePt;probe p_{T} [GeV];Events", 125, 0., 250.); m_histos["probeEta"] = iBooker.book1D("probeEta", "probeEta;probe #eta;Events", 24, -2.4, 2.4); m_histos["probePhi"] = iBooker.book1D("probePhi", "probePhi;probe #phi; Events", 36, -TMath::Pi(), TMath::Pi()); m_histos["probeNumberOfMatchedStations"] = iBooker.book1D( "probeNumberOfMatchedStations", "probeNumberOfMatchedStations;Number of matched stations;Events", 5, 0., 5); m_histos["pairMass"] = iBooker.book1D("pairMass", "pairMass", 25, 70., 120.); } } void BaseTnPEfficiencyTask::analyze(const edm::Event& event, const edm::EventSetup& context) { ++m_nEvents; edm::Handle<reco::MuonCollection> muons; if (!event.getByToken(m_muToken, muons)) return; edm::Handle<std::vector<reco::Vertex>> vtxs; if (!event.getByToken(m_primaryVerticesToken, vtxs)) return; const reco::Vertex& vertex = vtxs->at(0); edm::Handle<edm::TriggerResults> triggerResults; if (!event.getByToken(m_triggerResultsToken, triggerResults)) return; edm::Handle<trigger::TriggerEvent> triggerEvent; if (!event.getByToken(m_triggerEventToken, triggerEvent)) return; //common tnp variables std::vector<unsigned> preSel_tag_indices; std::vector<unsigned> tag_indices; std::vector<unsigned> preSel_probe_indices; std::vector<unsigned> probe_indices; if (muons.isValid() && vtxs.isValid()) { //Is there a better way to initialize two different type variables? for (auto [muon, muonColl_index] = std::tuple{std::vector<reco::Muon>::const_iterator{(*muons).begin()}, 0}; muon != (*muons).end(); ++muon, ++muonColl_index) { bool trigMatch = false; //Getting trigger infos for tag selection if (triggerResults.isValid() && triggerEvent.isValid()) { const trigger::TriggerObjectCollection trigObjColl = triggerEvent->getObjects(); trigMatch = hasTrigger(m_trigIndices, trigObjColl, triggerEvent, *muon); } //Probe selection if (m_probeSelector(*muon) && (std::abs(muon->muonBestTrack()->dxy(vertex.position())) < m_dxyCut) && (std::abs(muon->muonBestTrack()->dz(vertex.position())) < m_dzCut)) { preSel_probe_indices.push_back(muonColl_index); } //Tag selection if (m_tagSelector(*muon) && trigMatch) { preSel_tag_indices.push_back(muonColl_index); } } //loop over muons } //Probe selection for (const auto i_tag : preSel_tag_indices) { reco::Muon tag = (*muons).at(i_tag); float pt_max = 0.; int max_pt_idx; bool pair_found = false; for (const auto i_probe : preSel_probe_indices) { //Prevent tag and probe to be the same object if (i_probe == i_tag) continue; reco::Muon preSel_probe = (*muons).at(i_probe); int pair_charge_product = tag.charge() * preSel_probe.charge(); //check if tag+probe pair is compatible with Z decay if (pair_charge_product > 0) continue; float pair_mass = (tag.polarP4() + preSel_probe.polarP4()).M(); m_histos.find("pairMass")->second->Fill(pair_mass); if (pair_mass < m_lowPairMassCut || pair_mass > m_highPairMassCut) continue; float pair_pt = (tag.polarP4() + preSel_probe.polarP4()).Pt(); if (pair_pt > pt_max) { pair_found = true; pt_max = pair_pt; max_pt_idx = i_probe; } } if (pair_found) { probe_indices.push_back(max_pt_idx); tag_indices.push_back(i_tag); } } m_probeIndices.push_back(probe_indices); m_tagIndices.push_back(tag_indices); } bool BaseTnPEfficiencyTask::hasTrigger(std::vector<int>& trigIndices, const trigger::TriggerObjectCollection& trigObjs, edm::Handle<trigger::TriggerEvent>& trigEvent, const reco::Muon& muon) { float dR2match = 999.; for (int trigIdx : trigIndices) { const std::vector<std::string> trigModuleLabels = m_hltConfig.moduleLabels(trigIdx); const unsigned trigModuleIndex = trigModuleLabels.size() - 2; const unsigned hltFilterIndex = trigEvent->filterIndex(edm::InputTag(trigModuleLabels[trigModuleIndex], "", "HLT")); if (hltFilterIndex < trigEvent->sizeFilters()) { const trigger::Keys keys = trigEvent->filterKeys(hltFilterIndex); const trigger::Vids vids = trigEvent->filterIds(hltFilterIndex); const unsigned nTriggers = vids.size(); for (unsigned iTrig = 0; iTrig < nTriggers; ++iTrig) { trigger::TriggerObject trigObj = trigObjs[keys[iTrig]]; float dR2 = deltaR2(muon, trigObj); if (dR2 < dR2match) dR2match = dR2; } } } return dR2match < 0.01; }
38.550725
120
0.680075
[ "geometry", "object", "vector" ]
7e713e1f3260e960c7fe13b575fe0281af221ab7
1,186
hpp
C++
includes/elements/End.hpp
tnicolas42/bomberman
493d7243fabb1e5b6d5adfdcb5eb5973869b83a2
[ "MIT" ]
6
2020-03-13T16:45:13.000Z
2022-03-30T18:20:48.000Z
includes/elements/End.hpp
tnicolas42/bomberman
493d7243fabb1e5b6d5adfdcb5eb5973869b83a2
[ "MIT" ]
191
2020-03-02T14:47:19.000Z
2020-06-03T08:13:00.000Z
includes/elements/End.hpp
tnicolas42/bomberman
493d7243fabb1e5b6d5adfdcb5eb5973869b83a2
[ "MIT" ]
null
null
null
#ifndef END_HPP_ #define END_HPP_ #include <iostream> #include <unordered_set> #include <stdexcept> #include "AObject.hpp" #define END_STR "end" #define OPEN_PORTAL_TEXTURE "bomberman-assets/3dModels/exit/textures/open_portal_shield.png" #define CLOSE_PORTAL_TEXTURE "bomberman-assets/3dModels/exit/textures/close_portal_shield.png" /** * @brief This is the end object */ class End : public AObject { private: End(); // Members Block::Enum _texture; /**< Object texture */ bool _open; /**< Is open ? (when all flags are destroyed) */ Model *_model2; /**< second model, used for the transparent tube */ // Methods std::unordered_set<AEntity *> _getCollision(); public: // Constructors explicit End(SceneGame &game); ~End(); End(End const &src); // Operators End &operator=(End const &rhs); // Methods bool init(); bool update(); bool draw(Gui &gui); // Exceptions /** * @brief End Exception */ class EndException : public std::runtime_error { public: EndException(); /** * @brief Construct a new Spawner Exception object * * @param whatArg Error message */ explicit EndException(const char* whatArg); }; }; #endif // END_HPP_
20.448276
94
0.693929
[ "object", "model" ]
7e750f80c0f9b7f19e68a1679a76cf32937bdae0
3,914
cc
C++
query/DodeArrayMetadata.cc
celeritas-project/orange-port
9aa2d36984a24a02ed6d14688a889d4266f7b1af
[ "Apache-2.0", "MIT" ]
null
null
null
query/DodeArrayMetadata.cc
celeritas-project/orange-port
9aa2d36984a24a02ed6d14688a889d4266f7b1af
[ "Apache-2.0", "MIT" ]
null
null
null
query/DodeArrayMetadata.cc
celeritas-project/orange-port
9aa2d36984a24a02ed6d14688a889d4266f7b1af
[ "Apache-2.0", "MIT" ]
null
null
null
//---------------------------------*-C++-*-----------------------------------// /*! * \file query/DodeArrayMetadata.cc * \brief DodeArrayMetadata class definitions * \note Copyright (c) 2020 Oak Ridge National Laboratory, UT-Battelle, LLC. */ //---------------------------------------------------------------------------// #include "DodeArrayMetadata.hh" #include "base/Casts.hh" #include "base/Face.hh" #include "base/Join.hh" #include "base/Range.hh" #include "base/StringFunctions.hh" #include "orange/track/DodeArrayTracker.hh" namespace celeritas { //---------------------------------------------------------------------------// /*! * Construct from cell/surface metadata */ DodeArrayMetadata::DodeArrayMetadata(Params params) : md_(std::move(params.unit)) , cell_indexer_(params.dims) , bbox_(params.bbox) { } //---------------------------------------------------------------------------// //! Virtual destructor DodeArrayMetadata::~DodeArrayMetadata() = default; //---------------------------------------------------------------------------// /*! * Get metadata about this universe */ const ObjectMetadata& DodeArrayMetadata::metadata() const { return md_; } //---------------------------------------------------------------------------// /*! * \brief Local bounding box (extents) of this universe */ auto DodeArrayMetadata::bbox() const -> BoundingBox { return bbox_; } //---------------------------------------------------------------------------// /*! * \brief Number of local surfaces */ auto DodeArrayMetadata::num_surfaces() const -> surface_int { return 12; } //---------------------------------------------------------------------------// /*! * \brief Number of local cells */ auto DodeArrayMetadata::num_volumes() const -> volume_int { return cell_indexer_.size(); } //---------------------------------------------------------------------------// /*! * Convert a local surface ID into a user-facing surface label * * \todo Add better mapping to mesh surface indexer */ std::string DodeArrayMetadata::id_to_label(SurfaceId id) const { return to_string(RhombicDodecahedronFace<int>(id.get())); } //---------------------------------------------------------------------------// /*! * Convert a local cell ID into a user-facing cell label * * Note that unlike rect array which is indexed as KJI, dode array is indexed * naturally as IJK. */ std::string DodeArrayMetadata::id_to_label(VolumeId id) const { CELER_EXPECT(id < cell_indexer_.size()); auto ijk = cell_indexer_.index(id.get()); std::ostringstream os; os << '{' << ijk[0] << ',' << ijk[1] << ',' << ijk[2] << '}'; return os.str(); } //---------------------------------------------------------------------------// /*! * Get the volume of a cell */ real_type DodeArrayMetadata::volume(VolumeId id) const { CELER_EXPECT(id < cell_indexer_.size()); return 0.0; } //---------------------------------------------------------------------------// /*! * Set the volume of a cell */ void DodeArrayMetadata::set_volume(VolumeId id, real_type vol) { CELER_EXPECT(id < cell_indexer_.size()); CELER_EXPECT(vol >= 0); NotImplemented("Setting dodecahedral array cell volumes"); } //---------------------------------------------------------------------------// /*! * Describe using data from the corresponding tracker */ void DodeArrayMetadata::describe(std::ostream& os, const Tracker& base_tracker) const { const auto& tracker = smart_cast<const DodeArrayTracker&>(base_tracker); const auto& dims = tracker.dims(); os << ":Type: dodecahedral array\n" << ":Apothem: " << tracker.apothem() << '\n' << ":Dimensions: [" << join(dims.begin(), dims.end(), ", ") << "]\n\n"; } //---------------------------------------------------------------------------// } // namespace celeritas
28.158273
79
0.480072
[ "mesh" ]
7e7b0c2294d6962796c490aa04d2a25f153f7e44
41,239
cpp
C++
ext/cgt/shadermanager.cpp
hmsgit/campvis
d97de6a86323866d6a8f81d2a641e3e0443a6b39
[ "ECL-2.0", "Apache-2.0" ]
5
2018-06-19T06:20:01.000Z
2021-07-31T05:54:25.000Z
ext/cgt/shadermanager.cpp
hmsgit/campvis
d97de6a86323866d6a8f81d2a641e3e0443a6b39
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
ext/cgt/shadermanager.cpp
hmsgit/campvis
d97de6a86323866d6a8f81d2a641e3e0443a6b39
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
/********************************************************************** * * * cgt - CAMP Graphics Toolbox, Copyright (C) 2012-2015 * * Chair for Computer Aided Medical Procedures * * Technische Universitaet Muenchen, Germany. * * <http://campar.in.tum.de/> * * * * forked from tgt - Tiny Graphics Toolbox, Copyright (C) 2006-2011 * * Visualization and Computer Graphics Group, Department of * * Computer Science, University of Muenster, Germany. * * <http://viscg.uni-muenster.de> * * * * This file is part of the cgt library. This library is free * * software; you can redistribute it and/or modify it under the terms * * of the GNU Lesser General Public License version 2.1 as published * * by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License in the file "LICENSE.txt" along with this library. * * If not, see <http://www.gnu.org/licenses/>. * * * **********************************************************************/ #include "cgt/shadermanager.h" #include "cgt/gpucapabilities.h" #include <iostream> #include <fstream> using std::string; namespace cgt { //------------------------------------------------------------------------------ namespace { /** * Resolve the line number to take into account the include directives. * Returns a string containing file name and line number in that file. */ std::string resolveLineNumber(int number, const std::vector<ShaderObject::LineInfo>& lineTracker) { int found = static_cast<int>(lineTracker.size()) - 1; for (int i = static_cast<int>(lineTracker.size()) - 1; i >= 0 ; i--) { if (lineTracker[i].lineNumber_ <= number) { found = i; break; } } std::ostringstream result; //if (found >= 0) { //found is unsigned... result << FileSystem::fileName(lineTracker[found].filename_) << ":" << (number - lineTracker[found].lineNumber_ + lineTracker[found].sourceLineNumber_); //} return result.str(); } } // namespace const std::string ShaderPreprocessor::loggerCat_("cgt.Shader.ShaderPreprocessor"); ShaderPreprocessor::ShaderPreprocessor(ShaderObject* obj, Mode /*mode*/) : shd_(obj), lineTracker_(obj->lineTracker_), inputType_(0), outputType_(0), verticesOut_(0) { parse(); } void ShaderPreprocessor::parsePart(const std::string& input, const std::string& name) { std::istringstream source(input); int locallinenumber = 0; lineTracker_.push_back(ShaderObject::LineInfo(activeLine_, name, 1)); string line; while (std::getline(source, line)) { locallinenumber++; string::size_type pos = line.find("#include"); // At least partly support for comments. // "/*"-style comments starting on previous lines are not detected. string::size_type comment1 = line.find("//"); string::size_type comment2 = line.find("/*"); bool inComment = (comment1 != string::npos && comment1 < pos) || (comment2 != string::npos && comment2 < pos); if (pos != string::npos && !inComment) { pos = line.find("\"", pos + 1); string::size_type end = line.find("\"", pos + 1); string filename(line, pos + 1, end - pos - 1); filename = ShdrMgr.completePath(filename); if (includedFilenames_.find(filename) == includedFilenames_.end()) { File* file = FileSys.open(filename); string content; if ((!file) || (!file->isOpen())) { LERROR("Cannot open shader include '" << filename << "' in " << resolveLineNumber(activeLine_, lineTracker_)); } else { size_t len = file->size(); // check if file is empty if (len == 0) content = ""; else content = file->getAsString(); file->close(); outputComment("BEGIN INCLUDE " + filename, "BEGIN"); if (!content.empty() && content[content.size() - 1] != '\n') content += "\n"; parsePart(content, filename); outputComment("END INCLUDE " + filename, "END"); lineTracker_.push_back(ShaderObject::LineInfo(activeLine_, name, locallinenumber + 1)); } delete file; includedFilenames_.insert(filename); } } else { result_ << line << "\n"; activeLine_++; } } } void ShaderPreprocessor::parse() { activeLine_ = 1; lineTracker_.clear(); result_.clear(); includedFilenames_.clear(); if (! shd_->customGlslVersion_.empty()) { parsePart("#version " + shd_->customGlslVersion_ + "\n", "Custom per-shader version"); } else { if (! ShdrMgr.getDefaultGlslVersion().empty()) { parsePart("#version " + ShdrMgr.getDefaultGlslVersion() + "\n", "Global version"); } } if (! ShdrMgr.getGlobalHeader().empty()) { outputComment("BEGIN GLOBAL HEADER"); parsePart(ShdrMgr.getGlobalHeader(), "GLOBAL HEADER"); outputComment("END GLOBAL HEADER"); } if (!shd_->header_.empty()) { outputComment("BEGIN HEADER"); parsePart(shd_->header_, "HEADER"); outputComment("END HEADER"); } parsePart(shd_->unparsedSource_, shd_->filename_); } void ShaderPreprocessor::outputComment(const std::string& comment, const std::string& type) { result_ << "// " << comment << "\n"; lineTracker_.push_back(ShaderObject::LineInfo(activeLine_, type, 0)); activeLine_++; } bool ShaderPreprocessor::scanGeomShaderDirectives() { LDEBUG("Scanning for geometry shader compile directives..."); std::string input = getGeomShaderDirective("GL_GEOMETRY_INPUT_TYPE_EXT"); if (input == "GL_POINTS") inputType_ = GL_POINTS; else if (input == "GL_LINES") inputType_ = GL_LINES; else if (input == "GL_LINES_ADJACENCY_EXT") inputType_ = GL_LINES_ADJACENCY_EXT; else if (input == "GL_TRIANGLES") inputType_ = GL_TRIANGLES; else if (input == "GL_TRIANGLES_ADJACENCY_EXT") inputType_ = GL_TRIANGLES_ADJACENCY_EXT; else { LERROR("Unknown input type: " << input); return false; }; std::string output = getGeomShaderDirective("GL_GEOMETRY_OUTPUT_TYPE_EXT"); if (output == "GL_POINTS") outputType_ = GL_POINTS; else if (output == "GL_LINE_STRIP") outputType_ = GL_LINE_STRIP; else if (output == "GL_TRIANGLE_STRIP") outputType_ = GL_TRIANGLE_STRIP; else { LERROR("Unknown output type: " << output); return false; }; std::string verticesOut = getGeomShaderDirective("GL_GEOMETRY_VERTICES_OUT_EXT"); std::istringstream myStream(verticesOut); if (myStream >> verticesOut_) { LDEBUG("VERTICES_OUT: " << verticesOut_); } else { LERROR("Failed to parse argument(" << verticesOut << ") as integer for directive GL_GEOMETRY_VERTICES_OUT_EXT."); return false; } return true; } std::string ShaderPreprocessor::getGeomShaderDirective(const std::string& d) { string sourceStr(shd_->source_); string::size_type curPos = sourceStr.find(d + "(", 0); string::size_type length = d.length() + 1; if (curPos != string::npos) { string::size_type endPos = sourceStr.find(")", curPos); if (endPos != string::npos) { std::string ret = sourceStr.substr(curPos + length, endPos - curPos - length); // test for space, newline: if ((ret.find(" ", 0) == string::npos) && (ret.find("\n", 0) == string::npos) ) { LINFO("Directive " << d << ": " << ret); return ret; } else { LERROR("No spaces/newlines allowed inbetween directive brackets! Directive: " << d); return ""; } } LERROR("Missing ending bracket for directive " << d); return ""; } else { LWARNING("Could not locate directive " << d << "!"); return ""; } } std::string ShaderPreprocessor::getResult() const { return result_.str(); } GLint ShaderPreprocessor::getGeomShaderOutputType() const { return outputType_; } GLint ShaderPreprocessor::getGeomShaderInputType() const { return inputType_; } GLint ShaderPreprocessor::getGeomShaderVerticesOut() const { return verticesOut_; } //------------------------------------------------------------------------------ const string ShaderObject::loggerCat_("cgt.Shader.ShaderObject"); ShaderObject::ShaderObject(const string& filename, ShaderType type) : filename_(filename) , shaderType_(type) , isCompiled_(false) , inputType_(GL_TRIANGLES) , outputType_(GL_TRIANGLE_STRIP) , verticesOut_(16) { id_ = glCreateShader(shaderType_); if (id_ == 0) LERROR("ShaderObject(" + filename + ")::glCreateShader() returned 0"); } ShaderObject::~ShaderObject() { glDeleteShader(id_); } void ShaderObject::loadSourceFromFile(const string& filename) throw (Exception) { //LDEBUG("Loading " << filename); File* file = FileSys.open(filename); // check if file is open if (!file || !file->isOpen()) { LDEBUG("File not found: " << filename); delete file; throw FileNotFoundException("", filename); } filename_ = filename; unparsedSource_ = file->getAsString(); source_ = unparsedSource_; file->close(); delete file; } void ShaderObject::uploadSource() { const GLchar* s = source_.c_str(); glShaderSource(id_, 1, &s, 0); } bool ShaderObject::compileShader() { isCompiled_ = false; ShaderPreprocessor p(this); source_ = p.getResult(); if (shaderType_ == GEOMETRY_SHADER) { if (p.getGeomShaderInputType()) inputType_ = p.getGeomShaderInputType(); if (p.getGeomShaderOutputType()) outputType_ = p.getGeomShaderOutputType(); if (p.getGeomShaderVerticesOut()) verticesOut_ = p.getGeomShaderVerticesOut(); } uploadSource(); glCompileShader(id_); GLint check = 0; glGetShaderiv(id_, GL_COMPILE_STATUS, &check); isCompiled_ = (check == GL_TRUE); return isCompiled_; } namespace { int parseLogLineNumberNVIDIA(const std::string& message) { // Errors look like this: // 0(1397) : error C0000: syntax error, unexpected '=' at token "=" std::istringstream ls(message); int id; // first number (probably used when multiple sources are bound), ignored if (ls >> id) { char c = 0; // should be an opening parenthesis if (ls >> c &&c == '(') { int num; // line number if (ls >> num) return num; } } return 0; } int parseLogLineNumberATI(const std::string& message) { // Errors look like this: // ERROR: 0:2785: 'frontPos' : undeclared identifier std::istringstream ls(message); std::string s; if (ls >> s && s == "ERROR:") { int id; // first number (probably used when multiple sources are bound), ignored if (ls >> id) { char c = 0; // should be a colon if (ls >> c && c == ':') { int num; // line number if (ls >> num) return num; } } } return 0; } /** * Tries to extract the line number for a given compile messages. * Returns 0 if no line number was found. */ int parseLogLineNumber(const std::string& message) { int n = 0; n = parseLogLineNumberNVIDIA(message); if (n > 0) return n; n = parseLogLineNumberATI(message); if (n > 0) return n; return 0; } } // namespace string ShaderObject::getCompilerLog() const { GLint len; glGetShaderiv(id_, GL_INFO_LOG_LENGTH , &len); if (len > 1) { GLchar* log = new GLchar[len]; if (log == 0) return "Memory allocation for log failed!"; GLsizei l; // length returned glGetShaderInfoLog(id_, len, &l, log); std::istringstream str(log); delete[] log; std::ostringstream result; string line; while (getline(str, line)) { result << line; int num = parseLogLineNumber(line); if (num > 0) result << " [" << resolveLineNumber(num, lineTracker_) << "]"; result << '\n'; } return result.str(); } else { return ""; } } void ShaderObject::setHeader(const string& h) { header_ = h; } bool ShaderObject::rebuildFromFile() { try { loadSourceFromFile(filename_); } catch (const Exception& e) { LWARNING("Failed to load shader " << filename_ << ": " << e.what()); return false; } uploadSource(); if (!compileShader()) { LERROR("Failed to compile shader object " << filename_); LERROR("Compiler Log: \n" << getCompilerLog()); return false; } return true; } //------------------------------------------------------------------------------ const string Shader::loggerCat_("cgt.Shader.Shader"); Shader::Shader() : id_(0) , isLinked_(false) , ignoreError_(false) { id_ = glCreateProgram(); if (id_ == 0) LERROR("Shader(): glCreateProgram() returned 0"); } Shader::~Shader() { for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) { glDetachShader(id_, (*iter)->id_); delete (*iter); } glDeleteProgram(id_); } void Shader::attachObject(ShaderObject* obj) { glAttachShader(id_, obj->id_); objects_.push_back(obj); } void Shader::detachObject(ShaderObject* obj) { glDetachShader(id_, obj->id_); objects_.remove(obj); isLinked_ = false; } void Shader::activate() { if (isLinked_) activate(id_); } void Shader::activate(GLint id) { #ifdef CGT_DEBUG if (cgt::getGlInt(GL_CURRENT_PROGRAM) != 0) LWARNING("Binding a new Shader while another Shader is active. Do you really want to do this?"); #endif glUseProgram(id); } void Shader::deactivate() { glUseProgram(0); } GLint Shader::getCurrentProgram() { GLint id; glGetIntegerv(GL_CURRENT_PROGRAM, &id); return id; } bool Shader::isActivated() { GLint shader_nr; glGetIntegerv(GL_CURRENT_PROGRAM, &shader_nr); return (id_ == static_cast<GLuint>(shader_nr)); } void Shader::detachObjectsByType(ShaderObject::ShaderType type) { for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) { if ((*iter)->getType() == type) detachObject(*iter); delete (*iter); } isLinked_ = false; } bool Shader::linkProgram() { isLinked_ = false; glLinkProgram(id_); GLint check = 0; glGetProgramiv(id_, GL_LINK_STATUS, &check); if (check) isLinked_ = true; return isLinked_; } string Shader::getLinkerLog() const { GLint len; glGetProgramiv(id_, GL_INFO_LOG_LENGTH , &len); if (len > 1) { GLchar* log = new GLchar[len]; if (log == 0) return "Memory allocation for log failed!"; GLsizei l; // length returned glGetProgramInfoLog(id_, len, &l, log); string retStr(log); delete[] log; return retStr; } return ""; } bool Shader::rebuild() { if (isLinked_) { // program is already linked: detach and re-attach everything for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) { glDetachShader(id_, (*iter)->id_); (*iter)->uploadSource(); if (!(*iter)->compileShader()) { LERROR("Failed to compile shader object."); LERROR("Compiler Log: \n" << (*iter)->getCompilerLog()); return false; } glAttachShader(id_, (*iter)->id_); } } isLinked_ = false; glLinkProgram(id_); GLint check = 0; glGetProgramiv(id_, GL_LINK_STATUS, &check); if (check) { isLinked_ = true; return true; } else { LERROR("Shader::rebuild(): Failed to link shader." ); LERROR("Linker Log: \n" << getLinkerLog()); return false; } } bool Shader::rebuildFromFile() { bool result = true; for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) result &= (*iter)->rebuildFromFile(); result &= rebuild(); return result; } void Shader::setHeaders(const string& customHeader) { for (ShaderObjects::iterator iter = objects_.begin(); iter != objects_.end(); ++iter) { (*iter)->setHeader(customHeader); } } void Shader::bindFragDataLocation(GLuint colorNumber, std::string name) { if (GpuCaps.getShaderVersion() >= GpuCapabilities::GlVersion::SHADER_VERSION_130) { glBindFragDataLocation(id_, colorNumber, name.c_str()); } } void Shader::load(const string& filename, const string& customHeader) throw (Exception) { return loadSeparate(filename + ".vert", "", filename + ".frag", customHeader); } void Shader::loadSeparate(const string& vert_filename, const string& geom_filename, const string& frag_filename, const string& customHeader, const std::string& customGlslVersion) throw (Exception) { ShaderObject* frag = 0; ShaderObject* vert = 0; ShaderObject* geom = 0; if (!vert_filename.empty()) { vert = new ShaderObject(vert_filename, ShaderObject::VERTEX_SHADER); if (!customHeader.empty()) { vert->setHeader(customHeader); } if (!customGlslVersion.empty()) { vert->setCustomGlslVersion(customGlslVersion); } try { vert->loadSourceFromFile(vert_filename); } catch (const Exception& e) { LDEBUG("Failed to load vertex shader " << vert_filename << ": " << e.what()); delete vert; throw Exception("Failed to load vertex shader " + vert_filename + ": " + e.what()); } vert->uploadSource(); if (!vert->compileShader()) { LERROR("Failed to compile vertex shader " << vert_filename); LERROR("Compiler Log: \n" << vert->getCompilerLog()); delete vert; throw Exception("Failed to compile vertex shader: " + vert_filename); } } if (!geom_filename.empty()) { geom = new ShaderObject(geom_filename, ShaderObject::GEOMETRY_SHADER); if (!customHeader.empty()) { geom->setHeader(customHeader); } if (!customGlslVersion.empty()) { geom->setCustomGlslVersion(customGlslVersion); } try { geom->loadSourceFromFile(geom_filename); } catch (const Exception& e) { LDEBUG("Failed to load geometry shader " << geom_filename << ": " << e.what()); delete vert; delete geom; throw Exception("Failed to load geometry shader " + geom_filename + ": " + e.what()); } geom->uploadSource(); if (!geom->compileShader()) { LERROR("Failed to compile geometry shader " << geom_filename); LERROR("Compiler Log: \n" << geom->getCompilerLog()); delete vert; delete geom; throw Exception("Failed to compile geometry shader: " + geom_filename); } } if (!frag_filename.empty()) { frag = new ShaderObject(frag_filename, ShaderObject::FRAGMENT_SHADER); if (!customHeader.empty()) { frag->setHeader(customHeader); } if (!customGlslVersion.empty()) { frag->setCustomGlslVersion(customGlslVersion); } try { frag->loadSourceFromFile(frag_filename); } catch (const Exception& e) { LDEBUG("Failed to load fragment shader " << frag_filename); delete frag; delete geom; delete vert; throw Exception("Failed to load fragment shader " + frag_filename + ": " + e.what()); } if (GpuCaps.getShaderVersion() >= GpuCapabilities::GlVersion::SHADER_VERSION_130) bindFragDataLocation(0, "FragData0"); frag->uploadSource(); if (!frag->compileShader()) { LERROR("Failed to compile fragment shader " << frag_filename); LERROR("Compiler Log: \n" << frag->getCompilerLog()); delete vert; delete geom; delete frag; throw Exception("Failed to compile fragment shader: " + frag_filename); } } // Attach ShaderObjects, dtor will take care of freeing them if (frag) attachObject(frag); if (vert) attachObject(vert); if (geom) attachObject(geom); if (!linkProgram()) { LERROR("Failed to link shader (" << vert_filename << "," << frag_filename << "," << geom_filename << ")"); if (vert) { LERROR(vert->filename_ << " Vertex shader compiler log: \n" << vert->getCompilerLog()); detachObject(vert); delete vert; } if (geom) { LERROR(geom->filename_ << " Geometry shader compiler log: \n" << geom->getCompilerLog()); detachObject(geom); delete geom; } if (frag) { LERROR(frag->filename_ << " Fragment shader compiler log: \n" << frag->getCompilerLog()); detachObject(frag); delete frag; } LERROR("Linker Log: \n" << getLinkerLog()); throw Exception("Failed to link shader (" + vert_filename + "," + frag_filename + "," + geom_filename + ")"); } if (vert && vert->getCompilerLog().size() > 1) { LDEBUG("Vertex shader compiler log for file '" << vert_filename << "': \n" << vert->getCompilerLog()); } if (geom && geom->getCompilerLog().size() > 1) { LDEBUG("Geometry shader compiler log for file '" << geom_filename << "': \n" << geom->getCompilerLog()); } if (frag && frag->getCompilerLog().size() > 1) { LDEBUG("Fragment shader compiler log for file '" << frag_filename << "': \n" << frag->getCompilerLog()); } if (getLinkerLog().size() > 1) { LDEBUG("Linker log for '" << vert_filename << "' and '" << frag_filename << "' and '" << geom_filename << "': \n" << getLinkerLog()); } } GLint Shader::getUniformLocation(const string& name) { GLint l; l = glGetUniformLocation(id_, name.c_str()); if (l == -1 && !ignoreError_) LWARNING("Failed to locate uniform Location: " << name); return l; } void Shader::setIgnoreUniformLocationError(bool ignoreError) { ignoreError_ = ignoreError; } bool Shader::getIgnoreUniformLocationError() { return ignoreError_; } // Floats bool Shader::setUniform(const string& name, GLfloat value) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1f(l, value); return true; } bool Shader::setUniform(const string& name, GLfloat v1, GLfloat v2) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform2f(l, v1, v2); return true; } bool Shader::setUniform(const string& name, GLfloat v1, GLfloat v2, GLfloat v3) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform3f(l, v1, v2, v3); return true; } bool Shader::setUniform(const string& name, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform4f(l, v1, v2, v3, v4); return true; } bool Shader::setUniform(const string& name, GLfloat* v, int count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1fv(l, count, v); return true; } // Integers bool Shader::setUniform(const string& name, GLint value) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1i(l, value); return true; } bool Shader::setUniform(const string& name, GLint v1, GLint v2) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform2i(l, v1, v2); return true; } bool Shader::setUniform(const string& name, GLint v1, GLint v2, GLint v3) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform3i(l, v1, v2, v3); return true; } bool Shader::setUniform(const string& name, GLint v1, GLint v2, GLint v3, GLint v4) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform4i(l, v1, v2, v3, v4); return true; } bool Shader::setUniform(const string& name, GLint* v, int count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1iv(l, count, v); return true; } // Unsigned Integers bool Shader::setUniform(const string& name, GLuint value) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1ui(l, value); return true; } bool Shader::setUniform(const string& name, GLuint v1, GLuint v2) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform2ui(l, v1, v2); return true; } bool Shader::setUniform(const string& name, GLuint v1, GLuint v2, GLuint v3) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform3ui(l, v1, v2, v3); return true; } bool Shader::setUniform(const string& name, GLuint v1, GLuint v2, GLuint v3, GLuint v4) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform4ui(l, v1, v2, v3, v4); return true; } bool Shader::setUniform(const string& name, GLuint* v, int count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform1uiv(l, count, v); return true; } bool Shader::setUniform(const string& name, bool value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, static_cast<GLint>(value)); return true; } bool Shader::setUniform(const string& name, bool v1, bool v2) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, static_cast<GLint>(v1), static_cast<GLint>(v2)); return true; } bool Shader::setUniform(const string& name, bool v1, bool v2, bool v3) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, static_cast<GLint>(v1), static_cast<GLint>(v2), static_cast<GLint>(v3)); return true; } bool Shader::setUniform(const string& name, bool v1, bool v2, bool v3, bool v4) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, static_cast<GLint>(v1), static_cast<GLint>(v2), static_cast<GLint>(v3), static_cast<GLint>(v4)); return true; } bool Shader::setUniform(const string& name, GLboolean* v, int count) { GLint l = getUniformLocation(name); if (l == -1) return false; GLint* vector = new GLint[count]; for (int i=0; i < count; i++) vector[i] = static_cast<GLint>( v[i] ); glUniform1iv(l, count, vector); delete[] vector; return true; } // Vectors bool Shader::setUniform(const string& name, const Vector2f& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, Vector2f* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform2fv(l, count, vectors[0].elem); return true; } bool Shader::setUniform(const string& name, const Vector3f& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, Vector3f* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform3fv(l, count, vectors[0].elem); return true; } bool Shader::setUniform(const string& name, const Vector4f& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, Vector4f* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform4fv(l, count, vectors[0].elem); return true; } bool Shader::setUniform(const string& name, const ivec2& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, ivec2* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform2iv(l, count, vectors[0].elem); return true; } bool Shader::setUniform(const string& name, const ivec3& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, ivec3* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform3iv(l, count, vectors[0].elem); return true; } bool Shader::setUniform(const string& name, const ivec4& value) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value); return true; } bool Shader::setUniform(const string& name, ivec4* vectors, GLsizei count) { GLint l = getUniformLocation(name); if (l == -1) return false; glUniform4iv(l, count, vectors[0].elem); return true; } // Note: Matrix is transposed by OpenGL bool Shader::setUniform(const string& name, const Matrix2f& value, bool transpose) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value, transpose); return true; } bool Shader::setUniform(const string& name, const Matrix3f& value, bool transpose) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value, transpose); return true; } bool Shader::setUniform(const string& name, const Matrix4f& value, bool transpose) { GLint l = getUniformLocation(name); if (l == -1) return false; setUniform(l, value, transpose); return true; } // No location lookup // // Floats void Shader::setUniform(GLint l, GLfloat value) { glUniform1f(l, value); } void Shader::setUniform(GLint l, GLfloat v1, GLfloat v2) { glUniform2f(l, v1, v2); } void Shader::setUniform(GLint l, GLfloat v1, GLfloat v2, GLfloat v3) { glUniform3f(l, v1, v2, v3); } void Shader::setUniform(GLint l, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) { glUniform4f(l, v1, v2, v3, v4); } // Integers void Shader::setUniform(GLint l, GLint value) { glUniform1i(l, value); } void Shader::setUniform(GLint l, GLint v1, GLint v2) { glUniform2i(l, v1, v2); } void Shader::setUniform(GLint l, GLint v1, GLint v2, GLint v3) { glUniform3i(l, v1, v2, v3); } void Shader::setUniform(GLint l, GLint v1, GLint v2, GLint v3, GLint v4) { glUniform4i(l, v1, v2, v3, v4); } // Vectors void Shader::setUniform(GLint l, const Vector2f& value) { glUniform2fv(l, 1, value.elem); } void Shader::setUniform(GLint l, const Vector3f& value) { glUniform3fv(l, 1, value.elem); } void Shader::setUniform(GLint l, const Vector4f& value) { glUniform4fv(l, 1, value.elem); } void Shader::setUniform(GLint l, const ivec2& value) { glUniform2i(l, static_cast<GLint>(value.x), static_cast<GLint>(value.y)); } void Shader::setUniform(GLint l, const ivec3& value) { glUniform3i(l, static_cast<GLint>(value.x), static_cast<GLint>(value.y), static_cast<GLint>(value.z)); } void Shader::setUniform(GLint l, const ivec4& value) { glUniform4i(l, static_cast<GLint>(value.x), static_cast<GLint>(value.y), static_cast<GLint>(value.z), static_cast<GLint>(value.w)); } void Shader::setUniform(GLint l, const Matrix2f& value, bool transpose) { glUniformMatrix2fv(l, 1, !transpose, value.elem); } void Shader::setUniform(GLint l, const Matrix3f& value, bool transpose) { glUniformMatrix3fv(l, 1, !transpose, value.elem); } void Shader::setUniform(GLint l, const Matrix4f& value, bool transpose) { glUniformMatrix4fv(l, 1, !transpose, value.elem); } // Attributes // // 1 component void Shader::setAttribute(GLint index, GLfloat v1) { glVertexAttrib1f(index, v1); } void Shader::setAttribute(GLint index, GLshort v1) { glVertexAttrib1s(index, v1); } void Shader::setAttribute(GLint index, GLdouble v1) { glVertexAttrib1d(index, v1); } // 2 components void Shader::setAttribute(GLint index, GLfloat v1, GLfloat v2) { glVertexAttrib2f(index, v1, v2); } void Shader::setAttribute(GLint index, GLshort v1, GLshort v2) { glVertexAttrib2s(index, v1, v2); } void Shader::setAttribute(GLint index, GLdouble v1, GLdouble v2) { glVertexAttrib2d(index, v1, v2); } // 3 components void Shader::setAttribute(GLint index, GLfloat v1, GLfloat v2, GLfloat v3) { glVertexAttrib3f(index, v1, v2, v3); } void Shader::setAttribute(GLint index, GLshort v1, GLshort v2, GLshort v3) { glVertexAttrib3s(index, v1, v2, v3); } void Shader::setAttribute(GLint index, GLdouble v1, GLdouble v2, GLdouble v3) { glVertexAttrib3d(index, v1, v2, v3); } // 4 components void Shader::setAttribute(GLint index, GLfloat v1, GLfloat v2, GLfloat v3, GLfloat v4) { glVertexAttrib4f(index, v1, v2, v3, v4); } void Shader::setAttribute(GLint index, GLshort v1, GLshort v2, GLshort v3, GLshort v4) { glVertexAttrib4s(index, v1, v2, v3, v4); } void Shader::setAttribute(GLint index, GLdouble v1, GLdouble v2, GLdouble v3, GLdouble v4) { glVertexAttrib4d(index, v1, v2, v3, v4); } // For vectors void Shader::setAttribute(GLint index, const Vector2f& v) { glVertexAttrib2fv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector3f& v) { glVertexAttrib3fv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4f& v) { glVertexAttrib4fv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector2d& v) { glVertexAttrib2dv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector3d& v) { glVertexAttrib3dv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4d& v) { glVertexAttrib4dv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector2<GLshort>& v) { glVertexAttrib2sv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector3<GLshort>& v) { glVertexAttrib3sv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLshort>& v) { glVertexAttrib4sv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLint>& v) { glVertexAttrib4iv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLbyte>& v) { glVertexAttrib4bv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLubyte>& v) { glVertexAttrib4ubv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLushort>& v) { glVertexAttrib4usv(index, v.elem); } void Shader::setAttribute(GLint index, const Vector4<GLuint>& v) { glVertexAttrib4uiv(index, v.elem); } // ATTENTION: This method was deliberately deactivated, since it was not working as expected // with AMD GPUs. // Attribute locations //void Shader::setAttributeLocation(GLuint index, const std::string& name) { // glBindAttribLocation(id_, index, name.c_str()); //} GLint Shader::getAttributeLocation(const string& name) { GLint l; l = glGetAttribLocation(id_, name.c_str()); if (l == -1) LERROR("Failed to locate attribute Location: " << name); return l; } // Normalized attributes void Shader::setNormalizedAttribute(GLint index, GLubyte v1, GLubyte v2, GLubyte v3, GLubyte v4) { glVertexAttrib4Nub(index, v1, v2, v3, v4); } void Shader::setNormalizedAttribute(GLint index, const Vector4<GLbyte>& v) { glVertexAttrib4Nbv(index, v.elem); } void Shader::setNormalizedAttribute(GLint index, const Vector4<GLshort>& v) { glVertexAttrib4Nsv(index, v.elem); } void Shader::setNormalizedAttribute(GLint index, const Vector4<GLint>& v) { glVertexAttrib4Niv(index, v.elem); } // Unsigned version void Shader::setNormalizedAttribute(GLint index, const Vector4<GLubyte>& v) { glVertexAttrib4Nubv(index, v.elem); } void Shader::setNormalizedAttribute(GLint index, const Vector4<GLushort>& v) { glVertexAttrib4Nusv(index, v.elem); } void Shader::setNormalizedAttribute(GLint index, const Vector4<GLuint>& v) { glVertexAttrib4Nuiv(index, v.elem); } bool Shader::selectSubroutine(ShaderObject::ShaderType type, const std::string& subroutineName) { GLuint index = glGetSubroutineIndex(id_, type, subroutineName.c_str()); if (index == GL_INVALID_INDEX) { LWARNING("Failed to locate subroutine Location: " << subroutineName); return false; } glUniformSubroutinesuiv(type, 1, &index); return true; } //------------------------------------------------------------------------------ const string ShaderManager::loggerCat_("cgt.Shader.Manager"); ShaderManager::ShaderManager() : ResourceManager<Shader>(false) {} Shader* ShaderManager::load(const std::string& vertFilename, const std::string& fragFilename, const std::string& customHeader) throw (Exception) { return loadWithCustomGlslVersion(vertFilename, "", fragFilename, customHeader, ""); } Shader* ShaderManager::load(const std::string& vertFilename, const std::string& geomFilename, const std::string& fragFilename, const std::string& customHeader) throw(Exception) { return loadWithCustomGlslVersion(vertFilename, geomFilename, fragFilename, customHeader, ""); } Shader* ShaderManager::loadWithCustomGlslVersion(const std::string& vertFilename, const std::string& geomFilename, const std::string& fragFilename, const std::string& customHeader, const std::string& customGlslVersion) throw(Exception) { //LDEBUG("Loading files " << vertFilename << " and " << fragFilename); if (!GpuCaps.areShadersSupported()) { LERROR("Shaders are not supported."); throw Exception("Shaders are not supported."); } // create a somewhat unique identifier for this shader triple string identifier = vertFilename + "#" + fragFilename + "#" + geomFilename; if (isLoaded(identifier)) { LDEBUG("Shader already loaded. Increase usage count."); increaseUsage(identifier); return get(identifier); } Shader* shdr = new Shader(); // searching in all paths for every shader string vert_completeFilename; if (!vertFilename.empty()) vert_completeFilename = completePath(vertFilename); string geom_completeFilename; if (!geomFilename.empty()) geom_completeFilename = completePath(geomFilename); string frag_completeFilename; if (!fragFilename.empty()) frag_completeFilename = completePath(fragFilename); // loading and linking found shaders try { shdr->loadSeparate(vert_completeFilename, geom_completeFilename, frag_completeFilename, customHeader, customGlslVersion); // register even when caching is disabled, needed for rebuildFromFile() reg(shdr, identifier); return shdr; } catch (const Exception& /*e*/) { delete shdr; throw; } } bool ShaderManager::rebuildAllShadersFromFile() { bool result = true; for (std::map<Shader*, ResourceManager<Shader>::Resource*>::iterator iter = resourcesByPtr_.begin(); iter != resourcesByPtr_.end(); ++iter) { result &= iter->first->rebuildFromFile(); } return result; } } // namespace
29.883333
237
0.606804
[ "geometry", "object", "vector" ]
7e7e8a03fbb76562fc230e4a3214af9d012ae75f
8,999
cpp
C++
lkRay/Scene/Scene.cpp
lookeypl/lkRay
c12d87add95f5958d77a8a8a683fc954837b6c60
[ "WTFPL" ]
null
null
null
lkRay/Scene/Scene.cpp
lookeypl/lkRay
c12d87add95f5958d77a8a8a683fc954837b6c60
[ "WTFPL" ]
null
null
null
lkRay/Scene/Scene.cpp
lookeypl/lkRay
c12d87add95f5958d77a8a8a683fc954837b6c60
[ "WTFPL" ]
null
null
null
#include "PCH.hpp" #include "Scene.hpp" #include "Constants.hpp" #include "Material/Material.hpp" #include "Material/Matte.hpp" #include "Material/Mirror.hpp" #include "Material/Emissive.hpp" #include "Geometry/Sphere.hpp" #include "Geometry/Plane.hpp" #include "Geometry/Mesh.hpp" #include <limits> #include <fstream> #include <string> #include <streambuf> #include <tiny_obj_loader.h> namespace { template <typename Base, typename Derived> LKCOMMON_INLINE std::shared_ptr<Base> CreatePtr(const std::string& name) { return std::dynamic_pointer_cast<Base>(std::make_shared<Derived>(name)); } } // namespace namespace lkRay { namespace Scene { Scene::Scene() { } Scene::~Scene() { } bool Scene::LoadMaterials(const rapidjson::Value& node) { if (!node.IsObject()) { LOGE("Invalid object node"); return false; } for (auto& o: node.GetObject()) { LOGD(" -> Material " << o.name.GetString()); // read material's type Types::Material type = Types::Material::UNKNOWN; for (auto& a: o.value.GetObject()) { if (Constants::MATERIAL_ATTRIBUTE_TYPE_NODE_NAME.compare(a.name.GetString()) == 0) { LOGD(" -> Material type " << a.value.GetString()); if (Constants::MATERIAL_MATTE_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Material::MATTE; } else if (Constants::MATERIAL_MIRROR_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Material::MIRROR; } else if (Constants::MATERIAL_EMISSIVE_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Material::EMISSIVE; } else { LOGE("Unknown material type read from scene JSON: " << a.value.GetString()); } } } // create material Containers::Ptr<Material::Material> pMat = CreateMaterial(o.name.GetString(), type); if (!pMat) { LOGE("Failed to create material"); return false; } // ask material to read its own parameters if (!pMat->ReadParametersFromNode(o.value)) { LOGE("Material failed to read its parameters"); return false; } } return true; } bool Scene::LoadObjects(const rapidjson::Value& node) { if (!node.IsObject()) { LOGE("Invalid object node"); return false; } for (auto& o: node.GetObject()) { LOGD(" -> Object " << o.name.GetString()); // read object's type Types::Primitive type = Types::Primitive::UNKNOWN; for (auto& a: o.value.GetObject()) { if (Constants::OBJECT_ATTRIBUTE_TYPE_NODE_NAME.compare(a.name.GetString()) == 0) { LOGD(" -> Object type " << a.value.GetString()); if (Constants::OBJECT_SPHERE_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Primitive::SPHERE; } else if (Constants::OBJECT_PLANE_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Primitive::PLANE; } else if (Constants::OBJECT_MESH_NODE_NAME.compare(a.value.GetString()) == 0) { type = Types::Primitive::MESH; } else { LOGE("Unknown object type read from scene JSON: " << a.value.GetString()); } } } // create object Containers::Ptr<Geometry::Primitive> pPrim = CreatePrimitive(o.name.GetString(), type); if (!pPrim) { LOGE("Failed to create object"); return false; } // ask object to read its own parameters if (!pPrim->ReadParametersFromNode(o.value, mMaterials)) { LOGE("Object failed to read its parameters"); return false; } pPrim->CalculateBBox(); LOGD(" -> Object BBox: " << pPrim->GetBBox()[Geometry::AABBPoint::MIN] << " " << pPrim->GetBBox()[Geometry::AABBPoint::MAX]); } return true; } bool Scene::Load(const std::string& path) { // create default material in case objects have missing materials CreateMaterial(Constants::LKRAY_DEFAULT_MATERIAL_NAME, Types::Material::MATTE); // load scene from JSON std::fstream sceneFile(path, std::fstream::in); if (!sceneFile) { LOGE("Failed to open scene file " << path); return false; } std::string sceneFileString((std::istreambuf_iterator<char>(sceneFile)), std::istreambuf_iterator<char>()); sceneFile.close(); rapidjson::Document sceneDesc; sceneDesc.Parse(sceneFileString.c_str()); if (!sceneDesc.IsObject()) { LOGE("File is not a proper JSON object"); return false; } // parse scene's name and ambient color for (auto& o: sceneDesc.GetObject()) { if (Constants::NAME_NODE_NAME.compare(o.name.GetString()) == 0) { mName = o.value.GetString(); break; } } mAmbient = lkCommon::Utils::PixelFloat4(0.0f); for (auto& o: sceneDesc.GetObject()) { if (Constants::AMBIENT_NODE_NAME.compare(o.name.GetString()) == 0) { if (!o.value.IsArray() || (o.value.GetArray().Size() != 3)) { LOGE("Invalid normal parameter for camera. Should be an array of 3 floats."); return false; } uint32_t colIndex = 0; for (auto& c: o.value.GetArray()) { mAmbient[colIndex] = c.GetFloat(); colIndex++; } mAmbient[3] = 1.0f; LOGD(" -> Scene's ambient " << mAmbient); break; } } if (mName.empty()) { mName = "UNNAMED"; } LOGI("Loading scene \"" << mName << "\" from path " << path); // go through scene description and load materials for (auto& o: sceneDesc.GetObject()) { if (Constants::MATERIALS_NODE_NAME.compare(o.name.GetString()) == 0) { LOGD("Loading materials"); if (!LoadMaterials(o.value)) { return false; } break; } } // go again, this time load objects for (auto& o: sceneDesc.GetObject()) { if (Constants::OBJECTS_NODE_NAME.compare(o.name.GetString()) == 0) { LOGD("Loading objects"); if (!LoadObjects(o.value)) { return false; } break; } } LOGI("Scene " << mName << " loaded successfully"); return true; } void Scene::BuildBVH() { mBVH.Build(); mBVH.Print(); } void Scene::Destroy() { mBVH.Clean(); mName.clear(); mMaterials.clear(); } // -1 if no object hit, otherwise index of hit primitive Renderer::RayCollision Scene::TestCollision(const Geometry::Ray& ray) const { return mBVH.Traverse(ray); } Containers::Ptr<Geometry::Primitive> Scene::CreatePrimitive(const std::string& name, const Types::Primitive& type) { Containers::Ptr<Geometry::Primitive> pPrim; switch (type) { case Types::Primitive::SPHERE: { pPrim = CreatePtr<Geometry::Primitive, Geometry::Sphere>(name); break; } case Types::Primitive::PLANE: { pPrim = CreatePtr<Geometry::Primitive, Geometry::Plane>(name); break; } case Types::Primitive::MESH: { pPrim = CreatePtr<Geometry::Primitive, Geometry::Mesh>(name); break; } default: { LOGE("Unknown object type"); return nullptr; } } mBVH.PushObject(pPrim); return pPrim; } Containers::Ptr<Material::Material> Scene::CreateMaterial(const std::string& name, const Types::Material& type) { Containers::Ptr<Material::Material> pMat; auto matIt = mMaterials.find(name); if (matIt != mMaterials.end()) { return matIt->second; } switch (type) { case Types::Material::MATTE: { pMat = CreatePtr<Material::Material, Material::Matte>(name); break; } case Types::Material::MIRROR: { pMat = CreatePtr<Material::Material, Material::Mirror>(name); break; } case Types::Material::EMISSIVE: { pMat = CreatePtr<Material::Material, Material::Emissive>(name); break; } default: { LOGE("Unknown material type"); return nullptr; } } mMaterials.emplace(name, pMat); return pMat; } } // namespace Scene } // namespace lkRay
24.927978
114
0.541949
[ "mesh", "geometry", "object" ]
7e812ed8c9e056d7ed7ee81dd2b5ee9e8d251757
1,243
hpp
C++
include/boost/simd/function/minnum.hpp
yaeldarmon/boost.simd
561316cc54bdc6353ca78f3b6d7e9120acd11144
[ "BSL-1.0" ]
null
null
null
include/boost/simd/function/minnum.hpp
yaeldarmon/boost.simd
561316cc54bdc6353ca78f3b6d7e9120acd11144
[ "BSL-1.0" ]
null
null
null
include/boost/simd/function/minnum.hpp
yaeldarmon/boost.simd
561316cc54bdc6353ca78f3b6d7e9120acd11144
[ "BSL-1.0" ]
null
null
null
//================================================================================================== /*! @file @copyright 2016 NumScale SAS @copyright 2016 J.T. Lapreste 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_MINNUM_HPP_INCLUDED #define BOOST_SIMD_FUNCTION_MINNUM_HPP_INCLUDED #if defined(DOXYGEN_ONLY) namespace boost { namespace simd { /*! @ingroup group-ieee Function object implementing minnum capabilities Returns the minimum value, ignoring nans. @par Semantic: @code T r = minnum(x,y); @endcode is similar to: @code T r = T r = (is_nan(x) ? y : (isnan(y) ? x : min(x, y));; @endcode @par Alias: @c fmin With the std_ decorator std_(minnum)(x, y) calls the stdlibc++ function std::fmin. @par Decorators std_ for floating entries **/ const boost::dispatch::functor<tag::minnum_> minnum = {}; } } #endif #include <boost/simd/function/scalar/minnum.hpp> #include <boost/simd/function/simd/minnum.hpp> #endif
22.196429
100
0.56959
[ "object" ]
7e81da1d91636f838838c91dde1474ec9d409e31
2,999
cpp
C++
components/render/scene_render/server/sources/renderer/render_server_screen_manager.cpp
untgames/funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
7
2016-03-30T17:00:39.000Z
2017-03-27T16:04:04.000Z
components/render/scene_render/server/sources/renderer/render_server_screen_manager.cpp
untgames/Funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
4
2017-11-21T11:25:49.000Z
2018-09-20T17:59:27.000Z
components/render/scene_render/server/sources/renderer/render_server_screen_manager.cpp
untgames/Funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
4
2016-11-29T15:18:40.000Z
2017-03-27T16:04:08.000Z
#include "shared.h" using namespace render::scene::server; /* Описание реализации менеджера экранов */ typedef stl::hash_map<object_id_t, Screen> ScreenMap; struct ScreenManager::Impl { WindowManager& window_manager; //менеджер окон ViewportManager viewport_manager; //менеджер областей вывода RenderManager render_manager; //менеджер рендеринга ScreenMap screens; //карта экранов /// Конструктор Impl (WindowManager& in_window_manager, const RenderManager& in_render_manager, const ViewportManager& in_viewport_manager) : window_manager (in_window_manager) , viewport_manager (in_viewport_manager) , render_manager (in_render_manager) { } }; /* Конструктор / деструктор */ ScreenManager::ScreenManager (WindowManager& window_manager, const RenderManager& render_manager, const ViewportManager& viewport_manager) { try { impl = new Impl (window_manager, render_manager, viewport_manager); } catch (xtl::exception&e) { e.touch ("render::scene::server::ScreenManager::ScreenManager"); throw; } } ScreenManager::~ScreenManager () { } /* Получение экрана / области вывода */ Screen& ScreenManager::GetScreen (object_id_t id) { ScreenMap::iterator iter = impl->screens.find (id); if (iter == impl->screens.end ()) throw xtl::format_operation_exception ("render::scene::server::ScreenManager::GetScreen", "Screen with id %llu has not been found", id); return iter->second; } Viewport& ScreenManager::GetViewport (object_id_t id) { try { return impl->viewport_manager.GetViewport (id); } catch (xtl::exception& e) { e.touch ("render::scene::server::ScreenManager::GetViewport"); throw; } } /* Создание экрана */ Screen ScreenManager::CreateScreen (object_id_t id, const char* name, const char* init_string) { try { ScreenMap::iterator iter = impl->screens.find (id); if (iter != impl->screens.end ()) throw xtl::format_operation_exception ("render::scene::server::ScreenManager::CreateScreen", "Screen with id %llu has been already registered", id); Screen screen (name, init_string, impl->window_manager, impl->render_manager, impl->viewport_manager); impl->screens.insert_pair (id, screen); return screen; } catch (xtl::exception& e) { e.touch ("render::scene::server::ScreenManager::CreateScreen"); throw; } } void ScreenManager::RemoveScreen (object_id_t id) { impl->screens.erase (id); } /* Максимальный уровень вложенности рендеринга */ void ScreenManager::SetMaxDrawDepth (size_t level) { try { impl->viewport_manager.SetMaxDrawDepth (level); } catch (xtl::exception& e) { e.touch ("render::scene::server::ScreenManager::SetMaxDrawDepth"); throw; } } size_t ScreenManager::MaxDrawDepth () const { return impl->viewport_manager.MaxDrawDepth (); }
23.614173
155
0.676559
[ "render" ]
7e869157793ed896c5b0a62aa1dfa5f13b434b85
818
cpp
C++
cpp/example/tst/PathSum/PathSum-test.cpp
zcemycl/algoTest
9518fb2b60fd83c85aeb2ab809ff647aaf643f0a
[ "MIT" ]
1
2022-01-26T16:33:45.000Z
2022-01-26T16:33:45.000Z
cpp/example/tst/PathSum/PathSum-test.cpp
zcemycl/algoTest
9518fb2b60fd83c85aeb2ab809ff647aaf643f0a
[ "MIT" ]
null
null
null
cpp/example/tst/PathSum/PathSum-test.cpp
zcemycl/algoTest
9518fb2b60fd83c85aeb2ab809ff647aaf643f0a
[ "MIT" ]
1
2022-01-26T16:35:44.000Z
2022-01-26T16:35:44.000Z
#include "PathSum/pathSum.h" #include "gtest/gtest.h" using namespace std; class pathSum_MultipleParamsTests : public ::testing::TestWithParam<tuple<vector<string>,int,bool>>{ }; TEST_P(pathSum_MultipleParamsTests, CheckAns){ vector<string> nums = get<0>(GetParam()); int targetSum = get<1>(GetParam()); bool expected = get<2>(GetParam()); TreeNode* root = TreeNode::treeNode_fromList2(nums); ASSERT_EQ(expected,pathSum::naive(root,targetSum)); }; INSTANTIATE_TEST_CASE_P( PathSumTests, pathSum_MultipleParamsTests, ::testing::Values( make_tuple(vector<string>{"5","4","8","11","None", "13","4","7","2","None","None","None","1"},22,true), make_tuple(vector<string>{"1","2","3"},5,false), make_tuple(vector<string>{"1","2"},0,false) ) );
29.214286
68
0.649144
[ "vector" ]
7e8c1610fad504638a2f555c39922b3212945391
3,084
cpp
C++
Model/BTriangleInteraction.cpp
danielfrascarelli/esys-particle
e56638000fd9c4af77e21c75aa35a4f8922fd9f0
[ "Apache-2.0" ]
null
null
null
Model/BTriangleInteraction.cpp
danielfrascarelli/esys-particle
e56638000fd9c4af77e21c75aa35a4f8922fd9f0
[ "Apache-2.0" ]
null
null
null
Model/BTriangleInteraction.cpp
danielfrascarelli/esys-particle
e56638000fd9c4af77e21c75aa35a4f8922fd9f0
[ "Apache-2.0" ]
null
null
null
///////////////////////////////////////////////////////////// // // // Copyright (c) 2003-2017 by The University of Queensland // // Centre for Geoscience Computing // // http://earth.uq.edu.au/centre-geoscience-computing // // // // Primary Business: Brisbane, Queensland, Australia // // Licensed under the Open Software License version 3.0 // // http://www.apache.org/licenses/LICENSE-2.0 // // // ///////////////////////////////////////////////////////////// #include "BTriangleInteraction.h" #include "tml/message/packed_message_interface.h" /*! default constructor */ BTriangleInteraction::BTriangleInteraction() { m_p=NULL; m_t=NULL; m_tid=-1; m_pid=-1; } /*! constructor with parameters \param p a pointer to the particle \param t a pointer to the triangle \param param the interaction parameters \param iflag */ BTriangleInteraction::BTriangleInteraction(CParticle* p,Triangle* t,BTriMeshIP param,bool iflag) { m_p=p; m_t=t; m_k=param.k; m_break=param.brk*m_p->getRad(); m_inner_flag=iflag; // setup anchor point m_ap=m_t->toLocal(m_p->getPos()); m_dist=0.0; // inital distance is always 0.0 ! m_tid=m_t->getID(); m_pid=m_p->getID(); } /*! destructor */ BTriangleInteraction::~BTriangleInteraction() {} /*! calculate & apply forces */ void BTriangleInteraction::calcForces() { // transform anchor point to world coords Vec3 ap_global=m_t->toGlobal(m_ap); // get dist between anchor and particle const Vec3 D=ap_global-m_p->getPos(); m_dist=sqrt(D*D); // calc force Vec3 force=D*m_k; Vec3 pos=m_p->getPos(); // apply force m_p->applyForce(force,pos); if(m_inner_flag) m_t->applyForce(-1.0*force); } /*! return if the interaction is broken, i.e. the distance between particle and anchor point exceeds breaking distance, i.e. relative breaking distance x particle readius */ bool BTriangleInteraction::broken() { return (m_dist>m_break); } /*! returns the projection of the anchor point on the triangle */ Vec3 BTriangleInteraction::getAP() const { Vec3 app=Vec3(m_ap.X(),m_ap.Y(),0.0); // move point onto triangle Vec3 ap_global=m_t->toGlobal(app); // transfrom point to global coordinates return ap_global; } /*! Pack a BTriangleInteraction into a TML packed message \param I the interaction */ template<> void TML_PackedMessageInterface::pack<BTriangleInteraction>(const BTriangleInteraction& I) { append(I.m_k); append(I.m_dist); append(I.m_break); append(I.m_ap); append(I.getTid()); append(I.getPid()); } /*! Unpack a BTriangleInteraction from a TML packed message \param I the interaction */ template<> void TML_PackedMessageInterface::unpack<BTriangleInteraction>(BTriangleInteraction& I) { I.m_k=pop_double(); I.m_dist=pop_double(); I.m_break=pop_double(); I.m_ap=pop_vec3(); I.m_tid=pop_int(); I.m_pid=pop_int(); }
23.906977
96
0.63035
[ "transform" ]
7e9c498f1d9fc3ea326f0935521bcf90425529fc
3,269
hpp
C++
ThirdParty-mod/java2cpp/java/lang/Appendable.hpp
kakashidinho/HQEngine
8125b290afa7c62db6cc6eac14e964d8138c7fd0
[ "MIT" ]
1
2019-04-03T01:53:28.000Z
2019-04-03T01:53:28.000Z
ThirdParty-mod/java2cpp/java/lang/Appendable.hpp
kakashidinho/HQEngine
8125b290afa7c62db6cc6eac14e964d8138c7fd0
[ "MIT" ]
null
null
null
ThirdParty-mod/java2cpp/java/lang/Appendable.hpp
kakashidinho/HQEngine
8125b290afa7c62db6cc6eac14e964d8138c7fd0
[ "MIT" ]
null
null
null
/*================================================================================ code generated by: java2cpp author: Zoran Angelov, mailto://baldzar@gmail.com class: java.lang.Appendable ================================================================================*/ #ifndef J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVA_LANG_APPENDABLE_HPP_DECL #define J2CPP_JAVA_LANG_APPENDABLE_HPP_DECL namespace j2cpp { namespace java { namespace lang { class Object; } } } namespace j2cpp { namespace java { namespace lang { class CharSequence; } } } #include <java/lang/CharSequence.hpp> #include <java/lang/Object.hpp> namespace j2cpp { namespace java { namespace lang { class Appendable; class Appendable : public object<Appendable> { public: J2CPP_DECLARE_CLASS J2CPP_DECLARE_METHOD(0) J2CPP_DECLARE_METHOD(1) J2CPP_DECLARE_METHOD(2) explicit Appendable(jobject jobj) : object<Appendable>(jobj) { } operator local_ref<java::lang::Object>() const; local_ref< java::lang::Appendable > append(jchar); local_ref< java::lang::Appendable > append(local_ref< java::lang::CharSequence > const&); local_ref< java::lang::Appendable > append(local_ref< java::lang::CharSequence > const&, jint, jint); }; //class Appendable } //namespace lang } //namespace java } //namespace j2cpp #endif //J2CPP_JAVA_LANG_APPENDABLE_HPP_DECL #else //J2CPP_INCLUDE_IMPLEMENTATION #ifndef J2CPP_JAVA_LANG_APPENDABLE_HPP_IMPL #define J2CPP_JAVA_LANG_APPENDABLE_HPP_IMPL namespace j2cpp { java::lang::Appendable::operator local_ref<java::lang::Object>() const { return local_ref<java::lang::Object>(get_jobject()); } local_ref< java::lang::Appendable > java::lang::Appendable::append(jchar a0) { return call_method< java::lang::Appendable::J2CPP_CLASS_NAME, java::lang::Appendable::J2CPP_METHOD_NAME(0), java::lang::Appendable::J2CPP_METHOD_SIGNATURE(0), local_ref< java::lang::Appendable > >(get_jobject(), a0); } local_ref< java::lang::Appendable > java::lang::Appendable::append(local_ref< java::lang::CharSequence > const &a0) { return call_method< java::lang::Appendable::J2CPP_CLASS_NAME, java::lang::Appendable::J2CPP_METHOD_NAME(1), java::lang::Appendable::J2CPP_METHOD_SIGNATURE(1), local_ref< java::lang::Appendable > >(get_jobject(), a0); } local_ref< java::lang::Appendable > java::lang::Appendable::append(local_ref< java::lang::CharSequence > const &a0, jint a1, jint a2) { return call_method< java::lang::Appendable::J2CPP_CLASS_NAME, java::lang::Appendable::J2CPP_METHOD_NAME(2), java::lang::Appendable::J2CPP_METHOD_SIGNATURE(2), local_ref< java::lang::Appendable > >(get_jobject(), a0, a1, a2); } J2CPP_DEFINE_CLASS(java::lang::Appendable,"java/lang/Appendable") J2CPP_DEFINE_METHOD(java::lang::Appendable,0,"append","(C)Ljava/lang/Appendable;") J2CPP_DEFINE_METHOD(java::lang::Appendable,1,"append","(Ljava/lang/CharSequence;)Ljava/lang/Appendable;") J2CPP_DEFINE_METHOD(java::lang::Appendable,2,"append","(Ljava/lang/CharSequence;II)Ljava/lang/Appendable;") } //namespace j2cpp #endif //J2CPP_JAVA_LANG_APPENDABLE_HPP_IMPL #endif //J2CPP_INCLUDE_IMPLEMENTATION
28.929204
134
0.688896
[ "object" ]
7ea52ae3480dcb40513b493d1853aba85d7e85ab
4,227
cpp
C++
source/Polygon.cpp
MatthewScholefield/sentempa
d4b7376e73cbe9e2127d3ba6b61bfbb861ea32b1
[ "MIT" ]
null
null
null
source/Polygon.cpp
MatthewScholefield/sentempa
d4b7376e73cbe9e2127d3ba6b61bfbb861ea32b1
[ "MIT" ]
null
null
null
source/Polygon.cpp
MatthewScholefield/sentempa
d4b7376e73cbe9e2127d3ba6b61bfbb861ea32b1
[ "MIT" ]
null
null
null
#include <vector> #include <iostream> #include "Polygon.hpp" #include "Camera.hpp" #include "StarField.hpp" Triangle::Triangle(const Vec3<uint8_t> &color, const std::array<size_t, 3> &ids) : color(color), ids(ids) {} void Triangle::draw(Renderer &renderer, const Camera &camera, const std::vector<Vec3f> &pts) const { cauto canvasSize = renderer.getSize().cast<float>(); cauto dist = pts[ids[0]].dist(camera.getPos()); if (dist > Camera::viewDist) return; std::array<Vec2f, 3> triPts; bool offScreen = true; for (int i = 0; i < 3; ++i) { cauto proj = camera.projectPoint(pts[ids[i]], canvasSize); triPts[i] = proj.pt; if (proj.onScreen) offScreen = false; } if (offScreen) return; int alpha = 255.f * (1.f - dist / Camera::viewDist); renderer.drawFillTri(triPts, makeCol(color.x, color.y, color.z, alpha)); } int t = 0; RenderOrder Triangle::calcRenderOrder(const Triangle &other, const Camera &camera, const std::vector<Vec3f> &pts) const { size_t mDiffPId = 7; for (int pId = 0; pId < 3; ++pId) { bool isUnique = true; for (int oPId = 0; oPId < 3; ++oPId) { if (ids[pId] == other.ids[oPId]) { isUnique = false; break; } } if (isUnique) { mDiffPId = pId; break; } } Vec2<size_t> mAxisPIds = mDiffPId != 0 ? (mDiffPId != 1 ? Vec2<size_t>(0, 1) : Vec2<size_t>(0, 2)) : Vec2<size_t>(1, 2); size_t oDiffPId = ids[mAxisPIds.x] == other.ids[0] ? (ids[mAxisPIds.y] == other.ids[1] ? 2 : 1) : 0; cauto &axisPt1 = pts[ids[mAxisPIds.x]]; cauto &axisPt2 = pts[ids[mAxisPIds.y]]; cauto axis = axisPt2 - axisPt1; cfloat dotMag = axis.dotP(axis); auto orthoVec = [&](const Vec3f &p) { return p - (axisPt1 + axis * ((p - axisPt1).dotP(axis) / dotMag)); }; cauto camDir = orthoVec(camera.getPos()); cauto mDir = orthoVec(pts[ids[mDiffPId]]); cauto oDir = orthoVec(pts[other.ids[oDiffPId]]); cfloat camMag = camDir.mag(); cfloat mAngle = acos(camDir.dotP(mDir) / (mDir.mag() * camMag)); cfloat oAngle = acos(camDir.dotP(oDir) / (oDir.mag() * camMag)); auto ts = [](const Vec3f &f) { Vec3i a = f.cast<int>(); return std::to_string(a.x) + ", " + std::to_string(a.y) + ", " + std::to_string(a.z); }; return mAngle < oAngle ? RenderOrder::before : RenderOrder::after; } void Polygon::render(Renderer &renderer, const Camera &camera) const { std::vector<Vec3f> newPts(pts.begin(), pts.end()); for (Vec3f &p : newPts) { const float rotX = -rot.y; const float rotY = -rot.x; const float sx = sin(rotX), cx = cos(rotX); const float sy = sin(rotY), cy = cos(rotY); p = { p.x * cy + p.z * sy, p.x * sx * sy + p.y * cx - p.z * sx * cy, p.x * -cx * sy + p.y * sx + p.z * cx * cy }; p += pos; } using Entry = std::pair<size_t, float>; std::vector<size_t> renderOrder; renderOrder.reserve(triangles.size()); for (size_t i = 0; i < triangles.size(); ++i) { auto it = renderOrder.begin(); for (;; ++it) { if (it == renderOrder.end() || triangles[i].calcRenderOrder(triangles[*it], camera, newPts) == RenderOrder::before) { renderOrder.insert(it, i); break; } } } for (auto it = renderOrder.rbegin(); it != renderOrder.rend(); ++it) triangles[*it].draw(renderer, camera, newPts); } void Polygon::definePoint(size_t id, const Vec3f &pt) { if (id != pts.size()) throw std::logic_error("Point ids not in consecutive order!"); pts.emplace_back(pt); } void Polygon::centerPoints() { Vec3f av; for (cauto &i : pts) av += i; av /= pts.size(); for (auto &i : pts) i -= av; } void Polygon::addFace(const Triangle &tri) { triangles.push_back(tri); }
29.559441
109
0.5304
[ "render", "vector" ]
7eae7a17036a9b63ee96752c7187739ee2f37db3
2,025
cpp
C++
src/execs/agg_exec.cpp
farleyknight/PotatoDB
cf8e39a76caf8a66a0182310509756737c624cfa
[ "MIT" ]
3
2021-06-24T01:05:42.000Z
2021-07-23T07:24:16.000Z
src/execs/agg_exec.cpp
farleyknight/PotatoDB
cf8e39a76caf8a66a0182310509756737c624cfa
[ "MIT" ]
5
2021-06-25T00:13:51.000Z
2021-07-23T14:26:01.000Z
src/execs/agg_exec.cpp
farleyknight/PotatoDB
cf8e39a76caf8a66a0182310509756737c624cfa
[ "MIT" ]
null
null
null
#include "execs/agg_exec.hpp" void AggExec::init() { child_->init(); // TODO: Maybe move this assertion into the constructor assert(plan_ != nullptr); table_.init(plan_); table_.generate(); while (child_->has_next()){ auto tuple = child_->next_tuple(); auto agg_key = make_key(tuple); auto agg_value = make_val(tuple); table_.insert_combine(agg_key, agg_value); } table_iter_ = table_.begin(); } bool AggExec::has_next() { while (!at_the_end()) { if (!plan_->has_having()) { return true; } if (plan_->has_having() && match_found()) { return true; } ++table_iter_; } return false; } bool AggExec::at_the_end() { auto end = table_.end(); return table_iter_ == end; } bool AggExec::match_found() { auto key = table_iter_.key(); auto value = table_iter_.val(); auto pred = plan_->having(); auto result = pred.eval_agg(schema(), key.group_bys_, value.aggs_).as<bool>(); return result; } Tuple AggExec::next_tuple() { // create tuple according to output schema auto key = table_iter_.key(); auto value = table_iter_.val(); ValueMap value_map(schema().column_count()); for (auto const &col : schema().all()) { auto oid = col.oid(); auto evaled_value = col.eval_agg(schema(), key.group_bys_, value.aggs_); value_map.emplace(oid, move(evaled_value)); } ++table_iter_; auto &layout = schema().layout(); return layout.make(value_map, txn()); } AggKey AggExec::make_key(const Tuple& tuple) { vector<Value> keys; for (auto const &node : plan_->group_bys()) { std::cout << "GROUP BY! " << std::endl; keys.emplace_back(node.eval(tuple, schema())); } return AggKey(keys); } AggValue AggExec::make_val(const Tuple& tuple) { vector<Value> values; for (auto const &node : plan_->aggs()) { values.emplace_back(node.eval(tuple, child_schema())); } return AggValue(values); }
22.252747
58
0.613827
[ "vector" ]
7eaf02bd37bd86e2c0210d9e34b8fd452c1c7207
1,068
hpp
C++
p3iv_types/include/p3iv_types/scene_model.hpp
fzi-forschungszentrum-informatik/P3IV
51784e6dc03dcaa0ad58a5078475fa4daec774bd
[ "BSD-3-Clause" ]
4
2021-07-27T06:56:22.000Z
2022-03-22T11:21:30.000Z
p3iv_types/include/p3iv_types/scene_model.hpp
fzi-forschungszentrum-informatik/P3IV
51784e6dc03dcaa0ad58a5078475fa4daec774bd
[ "BSD-3-Clause" ]
null
null
null
p3iv_types/include/p3iv_types/scene_model.hpp
fzi-forschungszentrum-informatik/P3IV
51784e6dc03dcaa0ad58a5078475fa4daec774bd
[ "BSD-3-Clause" ]
1
2021-10-10T01:56:44.000Z
2021-10-10T01:56:44.000Z
#pragma once #include <map> #include <memory> #include "route_option.hpp" #include "scene_object.hpp" #include "traffic_rules.hpp" #include "visibility_information.hpp" namespace p3iv_types { class SceneModel { public: SceneModel(const int& ObjectId) : id{ObjectId} { } SceneModel(const int& ObjectId, const RouteOption& routeOption) : id{ObjectId}, route(routeOption) { } void addSceneObject(const int id, const double width, const double length, const MotionState& motionState, const double progress, std::vector<int> currentLanelets, const bool hasRightOfWay); void addSceneObject(const SceneObject SceneObject); bool getSceneObject(const int agentId, SceneObject& sceneObject); std::map<int, SceneObject>& getSceneObjects(); protected: const int id; std::map<int, SceneObject> sceneObjects; RouteOption route; Visibility visibility; }; } // namespace p3iv_types
25.428571
104
0.640449
[ "vector" ]
7eb15ddfa53260852992935315ae669767f00ec7
1,287
cpp
C++
LLY/LLY/resource/material/Pass.cpp
ooeyusea/GameEngine
85e7ceef7ddf663f9601a8a8787e29e8e8cdb425
[ "MIT" ]
3
2015-07-04T03:35:51.000Z
2017-09-10T08:23:25.000Z
LLY/LLY/resource/material/Pass.cpp
ooeyusea/GameEngine
85e7ceef7ddf663f9601a8a8787e29e8e8cdb425
[ "MIT" ]
null
null
null
LLY/LLY/resource/material/Pass.cpp
ooeyusea/GameEngine
85e7ceef7ddf663f9601a8a8787e29e8e8cdb425
[ "MIT" ]
null
null
null
#include "Pass.h" #include "../../util/Macros.h" #include "../Program.h" #include "../MeshPart.h" #include "../../render/RenderCommand.h" #include "../../System.h" namespace lly { Pass::Pass() : _id(0) , _program(0) { } Pass::~Pass() { if (_program > 0) { _program = 0; } } void Pass::draw(MeshPart& obj) { if (obj.get_index_buffer() != nullptr) { RenderCommand* command = new RenderCommand; if (command) { command->set_program(System::instance().get_resource_manager().get_program(_program)); command->set_index_buffer(obj.get_index_buffer()); command->set_render_option(_option.to_render()); System::instance().add_render_command(command); } } } void Pass::draw(IndexBuffer* index) { RenderCommand* command = new RenderCommand; if (command) { command->set_program(System::instance().get_resource_manager().get_program(_program)); command->set_index_buffer(index); command->set_render_option(_option.to_render()); System::instance().add_render_command(command); } } void Pass::merge_render_option(const RenderOption& option) { _option.merge(option); } Pass * Pass::clone() { Pass * ret = new Pass; ret->_id = _id; ret->_program = _program; ret->_option = _option; return ret; } }
19.208955
90
0.661228
[ "render" ]
7eb20509675d2865310a6c1bc8d145e6f0f75161
573
hpp
C++
data-struct/segment/LCARMQ.hpp
shiomusubi496/library
907f72eb6ee4ac6ef617bb359693588167f779e7
[ "MIT" ]
3
2021-11-04T08:45:12.000Z
2021-11-29T08:44:26.000Z
data-struct/segment/LCARMQ.hpp
shiomusubi496/library
907f72eb6ee4ac6ef617bb359693588167f779e7
[ "MIT" ]
null
null
null
data-struct/segment/LCARMQ.hpp
shiomusubi496/library
907f72eb6ee4ac6ef617bb359693588167f779e7
[ "MIT" ]
null
null
null
#pragma once #include "../../other/template.hpp" #include "../../graph/tree/CartesianTree.hpp" #include "../../graph/tree/PMORMQLCA.hpp" template<class T> class LCARMQ { protected: int n; std::vector<T> v; std::pair<Graph<int>, int> G; PMORMQLCA<int> LCA; public: LCARMQ(const std::vector<T>& v) : v(v), G(CartesianTree<T>(v).get_graph()), LCA(G.first, G.second) { n = v.size(); } T prod(int l, int r) { assert(0 <= l && l < r && r <= n); return v[LCA.lca(l, r - 1)]; } }; /** * @brief LCARMQ * @docs docs/LCARMQ.md */
22.92
120
0.560209
[ "vector" ]
7eb540f622be2527bc69f097c4c57f7f69f2c94b
333
cpp
C++
report.cpp
MatthewSmithPhysics/Ising-Model
af5e150603aa0cdae4fd73cdfe36975651ec528d
[ "MIT" ]
null
null
null
report.cpp
MatthewSmithPhysics/Ising-Model
af5e150603aa0cdae4fd73cdfe36975651ec528d
[ "MIT" ]
null
null
null
report.cpp
MatthewSmithPhysics/Ising-Model
af5e150603aa0cdae4fd73cdfe36975651ec528d
[ "MIT" ]
null
null
null
#include"report.h" using namespace std; void writeTXT(vector<vector<float>> A, string filename) { ofstream output; output.open(filename); for(int i = 0; i < A.size(); i++) { for(int j = 0; j < A[i].size() - 1; j++) output << A[i][j] << ", "; if(A[i].size() >= 1) output << A[i][A[i].size() - 1] << "\n"; } }
22.2
70
0.51952
[ "vector" ]
9d1a1dee0a0c056967231ea8a5a09cc372aaafd7
1,225
hpp
C++
crypto2/include/crypto2/pvss/Utils.hpp
nibeshrestha/optrand
584da68cb3f6162d7e5100f102b0f55b7e0660e6
[ "Apache-2.0" ]
null
null
null
crypto2/include/crypto2/pvss/Utils.hpp
nibeshrestha/optrand
584da68cb3f6162d7e5100f102b0f55b7e0660e6
[ "Apache-2.0" ]
null
null
null
crypto2/include/crypto2/pvss/Utils.hpp
nibeshrestha/optrand
584da68cb3f6162d7e5100f102b0f55b7e0660e6
[ "Apache-2.0" ]
null
null
null
#pragma once #include <libff/common/default_types/ec_pp.hpp> #include <vector> namespace optrand_crypto { #define MY_ASSERT(x,str) ({if((x)){throw std::runtime_error(str);}}) inline void initialize() { // Apparently, libff logs some extra info when computing pairings libff::inhibit_profiling_info = true; // AB: We _info disables printing of information and _counters prevents tracking of profiling information. If we are using the code in parallel, disable both the logs. libff::inhibit_profiling_counters = true; // Initializes the default EC curve, so as to avoid "surprises" libff::default_ec_pp::init_public_params(); } // Type of group G1 using G1 = typename libff::default_ec_pp::G1_type; // Type of group G2 using G2 = typename libff::default_ec_pp::G2_type; // Type of group GT (recall pairing e : G1 x G2 -> GT) using GT = typename libff::default_ec_pp::GT_type; // Type of the finite field "in the exponent" of the EC group elements using Fr = typename libff::default_ec_pp::Fp_type; using PK_Group = G1; using Com_Group = G2; #define PK_generator g1 #define Com_generator h1 class printable { virtual std::string pretty_print() const = 0; }; } // namespace optrand_crypto
29.166667
171
0.738776
[ "vector" ]
9d1c4f4552d2ece94b8f511f020f862b8f6af2eb
13,873
cpp
C++
Examples/AlbaViewer/appLogic.cpp
IOR-BIC/ALBA
b574968b05d9a3a2756dd2ac61d015a0d20232a4
[ "Apache-2.0", "BSD-3-Clause" ]
9
2018-11-19T10:15:29.000Z
2021-08-30T11:52:07.000Z
Examples/AlbaViewer/appLogic.cpp
IOR-BIC/ALBA
b574968b05d9a3a2756dd2ac61d015a0d20232a4
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
Examples/AlbaViewer/appLogic.cpp
IOR-BIC/ALBA
b574968b05d9a3a2756dd2ac61d015a0d20232a4
[ "Apache-2.0", "BSD-3-Clause" ]
3
2018-06-10T22:56:29.000Z
2019-12-12T06:22:56.000Z
/*========================================================================= Program: AlbaViewer Module: appLogic.cpp Language: C++ Date: $Date: 2019-01-01 12:00:00 $ Version: $Revision: 1.0.0.0 $ Authors: Nicola Vanella ========================================================================== Copyright (c) BIC-IOR 2019 (https://github.com/IOR-BIC) This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "albaDefines.h" //---------------------------------------------------------------------------- // NOTE: Every CPP file in the APP must include "albaDefines.h" as first. // This force to include Window, wxWidgets and VTK exactly in this order. //---------------------------------------------------------------------------- #include "appDecl.h" #include "appUtils.h" #include "appLogic.h" #include "appSideBar.h" #include "albaGUIAboutDialog.h" #include "albaGUIApplicationSettings.h" #include "albaLogicWithManagers.h" #include "albaOpImporterDicom.h" #include "albaOpManager.h" #include "albaSnapshotManager.h" #include "albaVME.h" #include "albaVMEGroup.h" #include "albaVMEIterator.h" #include "albaVMEVolumeGray.h" #include "albaView.h" #include "albaViewManager.h" #include "albaVTKLog.h" #ifdef USE_WIZARD #include "albaWizardManager.h" #endif #include "vtkObject.h" #include "vtkPointData.h" #include "vtkPoints.h" #include "albaGUIViewFrame.h" #include "albaGUIMDIChild.h" #include "vtkTimerLog.h" #include "albaTagArray.h" //---------------------------------------------------------------------------- appLogic::appLogic() : albaLogicWithManagers() { m_OpeningMSF = false; // Init Operations to plug in Toolbar m_OpImporterDicom = new albaOpImporterDicom("DICOM", true); m_Win->Maximize(); // Set project file extension m_Extension = "alba"; } //---------------------------------------------------------------------------- appLogic::~appLogic() { albaDEL(m_OpImporterDicom); delete m_SideBar; } //---------------------------------------------------------------------------- void appLogic::Init(int argc, char **argv) { albaLogicWithManagers::Init(argc, argv); m_Win->ShowDockPane("logbar", false); if (!wxDirExists(albaGetAppDataDirectory().c_str())) wxMkDir(albaGetAppDataDirectory().c_str()); InitAboutDialog(); SetApplicationStamp((albaString)"AlbaMaster"); m_VMEManager->IgnoreAppStamp(true); // Create and Open View ViewCreate(VIEW_START + 1); } //---------------------------------------------------------------------------- void appLogic::InitAboutDialog() { // Init About Dialog m_AboutDialog->SetTitle(m_AppTitle); m_AboutDialog->SetBuildNum(m_BuildNum.GetCStr()); m_AboutDialog->SetWebSite("https://github.com/IOR-BIC"); //m_AboutDialog->SetLicenseURL("https://github.com/IOR-BIC"); //m_AboutDialog->SetExtraMessage(""); // About Image wxString imageName = "AlbaViewerAbout"; wxString imagesPath = appUtils::GetConfigDirectory().c_str(); m_AboutDialog->SetImagePath(imagesPath + "/" + imageName + ".bmp"); } //---------------------------------------------------------------------------- void appLogic::OnEvent(albaEventBase *alba_event) { if (albaEvent *e = albaEvent::SafeDownCast(alba_event)) { switch (e->GetId()) { case VME_PICKED: { albaVME* selectedVme = m_OpManager->GetSelectedVme(); } break; // View Events case ID_SHOW_VIEW_VTK_SURFACE: { ViewCreate(VIEW_START); } break; case ID_SHOW_ORTHOSLICE_VIEW: { ViewCreate(VIEW_START + 1); } break; // WX Events case wxID_FILE1: case wxID_FILE2: case wxID_FILE3: case wxID_FILE4: case wxID_FILE5: case wxID_FILE6: case wxID_FILE7: case wxID_FILE8: case wxID_FILE9: { m_OpeningMSF = true; OnFileHistory(e->GetId()); m_OpeningMSF = false; ShowVMEOnView(); } break; case MENU_FILE_OPEN: { m_OpeningMSF = true; albaString *filename = e->GetString(); if (filename) { OnFileOpen((*filename).GetCStr()); } else { OnFileOpen(); } UpdateFrameTitle(); m_OpeningMSF = false; ShowVMEOnView(); } break; case ID_GET_FILENAME: { e->SetString(&(m_VMEManager->GetFileName())); } break; default: albaLogicWithManagers::OnEvent(alba_event); break; } // end switch case } // end if SafeDowncast else albaLogicWithManagers::OnEvent(alba_event); } //---------------------------------------------------------------------------- void appLogic::RunOp(albaOp *op) { m_OpManager->OpRun(op); } // Quit //---------------------------------------------------------------------------- void appLogic::OnQuit() { if (!m_FatalExptionOccurred && m_WizardManager && m_WizardRunning) { wxMessageBox(_("Please exit wizard before quit."), _("Wizard running"), wxOK | wxCENTER | wxICON_STOP); return; } if (!m_FatalExptionOccurred && m_OpManager && m_OpManager->Running()) { wxMessageBox(_("Please exit operation before quit."), _("Operation running"), wxOK | wxCENTER | wxICON_STOP); return; } if (!m_FatalExptionOccurred && m_OpManager && m_OpManager->Running()) { return; } StoreLayout(); albaGUIViewFrame::OnQuit(); albaGUIMDIChild::OnQuit(); m_Win->OnQuit(); if (m_SnapshotManager) cppDEL(m_SnapshotManager); cppDEL(m_VMEManager); cppDEL(m_MaterialChooser); cppDEL(m_HelpManager); cppDEL(m_ViewManager); cppDEL(m_InteractionManager); cppDEL(m_OpManager); // must be deleted after m_VMEManager cppDEL(m_SideBar); albaYield(); if (m_PlugLogPanel) { delete wxLog::SetActiveTarget(NULL); } vtkTimerLog::CleanupLog(); vtkDEL(m_VtkLog); m_Win->Destroy(); } // FILE ////////////////////////////////////////////////////////////////////// //---------------------------------------------------------------------------- void appLogic::OnFileNew() { if (m_OpManager) m_OpManager->VmeSelected(NULL); if (m_VMEManager) { m_VMEManager->MSFNew(); } m_Win->SetTitle(m_AppTitle); } //---------------------------------------------------------------------------- void appLogic::OnFileOpen(const char *file_to_open) { if (m_VMEManager) { wxString file; albaString wildc; const char *ext = m_Extension; wildc = wxString::Format("All Supported File (*.%s;*.z%s;msf;zmsf)|*.%s;*.%s;*.msf;*.zmsf", ext, ext, ext, ext); wildc += wxString::Format("|Alba Project File (*.%s)|*.%s", ext, ext); wildc += wxString::Format("|Alba Compressed File (*.z%s)|*.z%s", ext, ext); wildc += wxString::Format("|MAF Project File (*.msf)|*.msf"); wildc += wxString::Format("|MAF Compressed File (*.zmsf)|*.zmsf", ext, ext); if (file_to_open != NULL) { file = file_to_open; } else { wxString lastFolder = albaGetLastUserFolder().c_str(); file = albaGetOpenFile(lastFolder, wildc).c_str(); } if (file.IsEmpty()) return; int opened = m_VMEManager->MSFOpen(file); } } //---------------------------------------------------------------------------- void appLogic::ViewCreate(int viewId) { albaView *currentView = NULL; //currentView = m_ViewManager->GetSelectedView(); // Create only one view if (!currentView) { currentView = m_ViewManager->ViewCreate(viewId); currentView->GetFrame()->SetMaxSize(currentView->GetFrame()->GetSize()); ShowVMEOnView(); } } //---------------------------------------------------------------------------- void appLogic::ShowVMEOnView() { albaVMERoot *root = this->m_VMEManager->GetRoot(); albaVMEIterator *iter = root->NewIterator(); albaVME *volume = NULL; for (albaVME *iNode = iter->GetFirstNode(); iNode; iNode = iter->GetNextNode()) { if (iNode->IsA("albaVMEVolumeGray")) { volume = iNode; } } if (volume) { VmeShow(volume, true); // Show Last Volume } for (albaVME *iNode = iter->GetFirstNode(); iNode; iNode = iter->GetNextNode()) { if (!iNode->IsA("albaVMEVolumeGray")) { bool vme_in_tree = !iNode->GetTagArray()->IsTagPresent("VISIBLE_IN_THE_TREE") || (iNode->GetTagArray()->IsTagPresent("VISIBLE_IN_THE_TREE") && iNode->GetTagArray()->GetTag("VISIBLE_IN_THE_TREE")->GetValueAsDouble() != 0); VmeShow(iNode, vme_in_tree); // Show all VMEs } } iter->Delete(); } //---------------------------------------------------------------------------- void appLogic::VmeAdded(albaVME *vme) { albaLogicWithManagers::VmeAdded(vme); //VmeShow(vme, true); } //---------------------------------------------------------------------------- void appLogic::CreateMenu() { // Include Icons #include "pic/menu/EDIT_REDO.xpm" #include "pic/menu/EDIT_SETTINGS.xpm" #include "pic/menu/EDIT_UNDO.xpm" #include "pic/menu/FILE_EXIT.xpm" #include "pic/menu/FILE_NEW.xpm" #include "pic/menu/FILE_OPEN.xpm" #include "pic/menu/FILE_PRINT.xpm" #include "pic/menu/FILE_PRINT_PREVIEW.xpm" #include "pic/menu/FILE_SAVE.xpm" #include "pic/menu/HELP_ABOUT.xpm" #include "pic/menu/HELP_HELP.xpm" #include "pic/menu/HELP_LICENCE.xpm" m_MenuBar = new wxMenuBar; // File Menu ////////////////////////////////////////////////////////////////////////// wxMenu *file_menu = new wxMenu; albaGUI::AddMenuItem(file_menu, MENU_FILE_NEW, _("&New \tCtrl+N"), FILE_NEW_xpm); albaGUI::AddMenuItem(file_menu, MENU_FILE_OPEN, _("&Open \tCtrl+O"), FILE_OPEN_xpm); file_menu->AppendSeparator(); // Import menu item m_ImportMenu = new wxMenu; // NOT USED // Export menu item m_ExportMenu = new wxMenu; // NOT USED // Print menu item albaGUI::AddMenuItem(file_menu, MENU_FILE_PRINT, _("&Print \tCtrl+P"), FILE_PRINT_xpm); albaGUI::AddMenuItem(file_menu, MENU_FILE_PRINT_PREVIEW, _("Print Preview"), FILE_PRINT_PREVIEW_xpm); file_menu->Append(MENU_FILE_PRINT_SETUP, _("Printer Setup")); file_menu->Append(MENU_FILE_PRINT_PAGE_SETUP, _("Page Setup")); // Recent file item m_RecentFileMenu = new wxMenu; file_menu->AppendSeparator(); file_menu->Append(0, _("Recent Files"), m_RecentFileMenu); file_menu->AppendSeparator(); albaGUI::AddMenuItem(file_menu, MENU_FILE_QUIT, _("&Quit \tCtrl+Q"), FILE_EXIT_xpm); m_MenuBar->Append(file_menu, _("&File")); // Edit Menu ////////////////////////////////////////////////////////////////////////// wxMenu *edit_menu = new wxMenu; albaGUI::AddMenuItem(edit_menu, OP_UNDO, _("Undo \tCtrl+Z"), EDIT_UNDO_xpm); albaGUI::AddMenuItem(edit_menu, OP_REDO, _("Redo \tCtrl+Shift+Z"), EDIT_REDO_xpm); edit_menu->AppendSeparator(); albaGUI::AddMenuItem(edit_menu, ID_APP_SETTINGS, _("Settings..."), EDIT_SETTINGS_xpm); m_MenuBar->Append(edit_menu, _("&Edit")); // View Menu ////////////////////////////////////////////////////////////////////////// m_ViewMenu = new wxMenu; m_MenuBar->Append(m_ViewMenu, _("&View")); // Operations Menu //////////////////////////////////////////////////////////////////// m_OpMenu = new wxMenu; m_MenuBar->Append(m_OpMenu, _("&Operations")); // Wizard Menu //////////////////////////////////////////////////////////////////// if (m_UseWizardManager) { m_WizardMenu = new wxMenu; m_MenuBar->Append(m_WizardMenu, _("&Wizard")); } // Help Menu ////////////////////////////////////////////////////////////////////////// wxMenu *help_menu = new wxMenu; albaGUI::AddMenuItem(help_menu, ABOUT_APPLICATION, _("About"), HELP_ABOUT_xpm); albaGUI::AddMenuItem(help_menu, HELP_HOME, _("Help"), HELP_HELP_xpm); m_MenuBar->Append(help_menu, _("&Help")); m_Win->SetMenuBar(m_MenuBar); EnableItem(MENU_FILE_PRINT, false); EnableItem(MENU_FILE_PRINT_PREVIEW, false); EnableItem(MENU_FILE_PRINT_SETUP, false); EnableItem(MENU_FILE_PRINT_PAGE_SETUP, false); } //---------------------------------------------------------------------------- void appLogic::CreateToolbar() { m_ToolBar = new wxToolBar(m_Win, MENU_VIEW_TOOLBAR, wxPoint(0, 0), wxSize(-1, -1), wxTB_FLAT | wxTB_NODIVIDER); m_ToolBar->SetMargins(0, 0); m_ToolBar->SetToolSeparation(2); m_ToolBar->SetToolBitmapSize(wxSize(20, 20)); // File m_ToolBar->AddTool(MENU_FILE_NEW, albaPictureFactory::GetPictureFactory()->GetBmp("FILE_NEW"), _("New project")); m_ToolBar->AddTool(MENU_FILE_OPEN, albaPictureFactory::GetPictureFactory()->GetBmp("FILE_OPEN"), _("Open project")); m_ToolBar->AddSeparator(); // Views m_ToolBar->AddTool(ID_SHOW_VIEW_VTK_SURFACE, albaPictureFactory::GetPictureFactory()->GetBmp("VIEW_SURFACE_ICON"), _("View Surface")); m_ToolBar->AddTool(ID_SHOW_ORTHOSLICE_VIEW, albaPictureFactory::GetPictureFactory()->GetBmp("VIEW_ORTHO"), _("View OrthoSlice")); m_ToolBar->AddSeparator(); // Camera m_ToolBar->AddTool(CAMERA_RESET, albaPictureFactory::GetPictureFactory()->GetBmp("ZOOM_ALL"), _("Reset camera to fit all")); m_ToolBar->AddTool(CAMERA_FIT, albaPictureFactory::GetPictureFactory()->GetBmp("ZOOM_SEL"), _("Reset camera to fit selected object")); m_ToolBar->AddTool(CAMERA_FLYTO, albaPictureFactory::GetPictureFactory()->GetBmp("FLYTO"), _("Fly to object under mouse")); if (m_UseSnapshotManager) { // Snapshot tool m_ToolBar->AddSeparator(); m_ToolBar->AddTool(MENU_FILE_SNAPSHOT, albaPictureFactory::GetPictureFactory()->GetBmp("CAMERA"), _("Create Snapshot")); m_ToolBar->AddTool(MENU_FILE_MANAGE_SNAPSHOT, albaPictureFactory::GetPictureFactory()->GetBmp("IMAGE_PREVIEW"), _("Manage Snapshots")); } } //---------------------------------------------------------------------------- void appLogic::EnableMenuAndToolbar() { bool enable = !(m_RunningOperation || m_WizardRunning); albaLogicWithManagers::EnableMenuAndToolbar(); albaVME *node = m_OpManager->GetSelectedVme(); if (m_UseSnapshotManager && m_SnapshotManager) { EnableItem(MENU_FILE_MANAGE_SNAPSHOT, enable && m_SnapshotManager->HasSnapshots(m_VMEManager->GetRoot())); EnableItem(MENU_FILE_SNAPSHOT, enable && m_ViewManager->GetSelectedView() != NULL); } }
29.083857
137
0.612485
[ "object" ]
9d1eb22362e5528b32f26ad895aa4e62221e87ec
5,770
cpp
C++
engine/core/src/skydome.cpp
ericdefelice/Dungeon_Crawler
8be5ab92723e1d1c0ddd9802ec6716e7235706f4
[ "MIT" ]
null
null
null
engine/core/src/skydome.cpp
ericdefelice/Dungeon_Crawler
8be5ab92723e1d1c0ddd9802ec6716e7235706f4
[ "MIT" ]
null
null
null
engine/core/src/skydome.cpp
ericdefelice/Dungeon_Crawler
8be5ab92723e1d1c0ddd9802ec6716e7235706f4
[ "MIT" ]
1
2021-03-15T10:25:56.000Z
2021-03-15T10:25:56.000Z
/*! @file skydome.cpp @brief Functionality for sky domes in the engine. @detail */ //-------------------------------------------- // Includes //-------------------------------------------- #include "skydome.h" namespace Gumshoe { SkyDome::SkyDome() { m_model = nullptr; m_vertexBuffer = nullptr; m_indexBuffer = nullptr; } SkyDome::~SkyDome() { } bool SkyDome::Init(ID3D11Device* device) { bool result; // Load in the sky dome model. result = LoadSkyDomeModel("../assets/skydome.txt"); if(!result) { return false; } // Load the sky dome into a vertex and index buffer for rendering. result = InitializeBuffers(device); if(!result) { return false; } // Set the color at the top of the sky dome. m_apexColor = D3DXVECTOR4(0.52f, 0.76f, 0.97f, 1.0f); // Set the color at the center of the sky dome. m_centerColor = D3DXVECTOR4(0.65f, 0.88f, 0.97f, 1.0f); return true; } void SkyDome::Shutdown() { // Release the vertex and index buffer that were used for rendering the sky dome. ReleaseBuffers(); // Release the sky dome model. ReleaseSkyDomeModel(); return; } void SkyDome::Render(ID3D11DeviceContext* deviceContext) { // Render the sky dome. RenderBuffers(deviceContext); return; } int SkyDome::GetIndexCount() { return m_indexCount; } D3DXVECTOR4 SkyDome::GetApexColor() { return m_apexColor; } D3DXVECTOR4 SkyDome::GetCenterColor() { return m_centerColor; } bool SkyDome::LoadSkyDomeModel(char* filename) { ifstream fin; char input; int i; // Open the model file. fin.open(filename); // If it could not open the file then exit. if(fin.fail()) { return false; } // Read up to the value of vertex count. fin.get(input); while(input != ':') { fin.get(input); } // Read in the vertex count. fin >> m_vertexCount; // Set the number of indices to be the same as the vertex count. m_indexCount = m_vertexCount; // Create the model using the vertex count that was read in. m_model = new model_t[m_vertexCount]; if(!m_model) { return false; } // Read up to the beginning of the data. fin.get(input); while(input != ':') { fin.get(input); } fin.get(input); fin.get(input); // Read in the vertex data. for(i=0; i<m_vertexCount; i++) { fin >> m_model[i].x >> m_model[i].y >> m_model[i].z; fin >> m_model[i].tu >> m_model[i].tv; fin >> m_model[i].nx >> m_model[i].ny >> m_model[i].nz; } // Close the model file. fin.close(); return true; } void SkyDome::ReleaseSkyDomeModel() { if(m_model) { delete [] m_model; m_model = nullptr; } return; } bool SkyDome::InitializeBuffers(ID3D11Device* device) { vertex_t* vertices; unsigned long* indices; D3D11_BUFFER_DESC vertexBufferDesc, indexBufferDesc; D3D11_SUBRESOURCE_DATA vertexData, indexData; HRESULT result; int i; // Create the vertex array. vertices = new vertex_t[m_vertexCount]; if(!vertices) { return false; } // Create the index array. indices = new unsigned long[m_indexCount]; if(!indices) { return false; } // Load the vertex array and index array with data. for(i=0; i<m_vertexCount; i++) { vertices[i].position = D3DXVECTOR3(m_model[i].x, m_model[i].y, m_model[i].z); indices[i] = i; } // Set up the description of the vertex buffer. vertexBufferDesc.Usage = D3D11_USAGE_DEFAULT; vertexBufferDesc.ByteWidth = sizeof(vertex_t) * m_vertexCount; vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.CPUAccessFlags = 0; vertexBufferDesc.MiscFlags = 0; vertexBufferDesc.StructureByteStride = 0; // Give the subresource structure a pointer to the vertex data. vertexData.pSysMem = vertices; vertexData.SysMemPitch = 0; vertexData.SysMemSlicePitch = 0; // Now finally create the vertex buffer. result = device->CreateBuffer(&vertexBufferDesc, &vertexData, &m_vertexBuffer); if(FAILED(result)) { return false; } // Set up the description of the index buffer. indexBufferDesc.Usage = D3D11_USAGE_DEFAULT; indexBufferDesc.ByteWidth = sizeof(unsigned long) * m_indexCount; indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER; indexBufferDesc.CPUAccessFlags = 0; indexBufferDesc.MiscFlags = 0; indexBufferDesc.StructureByteStride = 0; // Give the subresource structure a pointer to the index data. indexData.pSysMem = indices; indexData.SysMemPitch = 0; indexData.SysMemSlicePitch = 0; // Create the index buffer. result = device->CreateBuffer(&indexBufferDesc, &indexData, &m_indexBuffer); if(FAILED(result)) { return false; } // Release the arrays now that the vertex and index buffers have been created and loaded. delete [] vertices; vertices = nullptr; delete [] indices; indices = nullptr; return true; } void SkyDome::ReleaseBuffers() { // Release the index buffer. if(m_indexBuffer) { m_indexBuffer->Release(); m_indexBuffer = nullptr; } // Release the vertex buffer. if(m_vertexBuffer) { m_vertexBuffer->Release(); m_vertexBuffer = nullptr; } return; } void SkyDome::RenderBuffers(ID3D11DeviceContext* deviceContext) { unsigned int stride; unsigned int offset; // Set vertex buffer stride and offset. stride = sizeof(vertex_t); offset = 0; // Set the vertex buffer to active in the input assembler so it can be rendered. deviceContext->IASetVertexBuffers(0, 1, &m_vertexBuffer, &stride, &offset); // Set the index buffer to active in the input assembler so it can be rendered. deviceContext->IASetIndexBuffer(m_indexBuffer, DXGI_FORMAT_R32_UINT, 0); // Set the type of primitive that should be rendered from this vertex buffer, in this case triangles. deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); return; } } // end of namespace Gumshoe
19.427609
105
0.695667
[ "render", "model" ]
9d2157b17b947820f2197b2476a5b5e73a8170c4
13,428
cpp
C++
ExternalCode/copasi/optimization/COptItem.cpp
dhlee4/Tinkercell_new
c4d1848bbb905f0e1f9e011837268ac80aff8711
[ "BSD-3-Clause" ]
1
2021-01-07T13:12:51.000Z
2021-01-07T13:12:51.000Z
ExternalCode/copasi/optimization/COptItem.cpp
dhlee4/Tinkercell_new
c4d1848bbb905f0e1f9e011837268ac80aff8711
[ "BSD-3-Clause" ]
7
2020-04-12T22:25:46.000Z
2020-04-13T07:50:40.000Z
ExternalCode/copasi/optimization/COptItem.cpp
daniel-anavaino/tinkercell
7896a7f809a0373ab3c848d25e3691d10a648437
[ "BSD-3-Clause" ]
2
2020-04-12T21:57:01.000Z
2020-04-12T21:59:29.000Z
// Begin CVS Header // $Source: /fs/turing/cvs/copasi_dev/copasi/optimization/COptItem.cpp,v $ // $Revision: 1.42 $ // $Name: Build-33 $ // $Author: shoops $ // $Date: 2010/03/16 18:56:24 $ // End CVS Header // Copyright (C) 2010 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., EML Research, gGmbH, University of Heidelberg, // and The University of Manchester. // All rights reserved. // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc. and EML Research, gGmbH. // All rights reserved. #include <limits> #include <math.h> #include <float.h> #include <sstream> #include <stdlib.h> #include "copasi.h" #include "COptItem.h" #include "randomGenerator/CRandom.h" #include "report/CCopasiContainer.h" #include "CopasiDataModel/CCopasiDataModel.h" #include "report/CCopasiObjectName.h" #include "utilities/CCopasiParameterGroup.h" #include "utilities/CCopasiMessage.h" #include "utilities/utility.h" C_FLOAT64 NaN = std::numeric_limits<C_FLOAT64>::quiet_NaN(); UpdateMethod DoNothing; CRandom * COptItem::mpRandom = NULL; COptItem::COptItem(const CCopasiContainer * pParent, const std::string & name): CCopasiParameterGroup(name, pParent), mpParmObjectCN(NULL), mpParmLowerBound(NULL), mpParmUpperBound(NULL), mpParmStartValue(NULL), mpObject(NULL), mpMethod(NULL), mpObjectValue(NULL), mpLowerObject(NULL), mpLowerBound(NULL), mLowerBound(0.0), mpUpperObject(NULL), mpUpperBound(NULL), mUpperBound(0.0) {initializeParameter();} COptItem::COptItem(const COptItem & src, const CCopasiContainer * pParent): CCopasiParameterGroup(src, (pParent != NULL) ? pParent : src.getObjectDataModel()), mpParmObjectCN(NULL), mpParmLowerBound(NULL), mpParmUpperBound(NULL), mpParmStartValue(NULL), mpObject(NULL), mpMethod(NULL), mpObjectValue(NULL), mpLowerObject(NULL), mpLowerBound(NULL), mLowerBound(0.0), mpUpperObject(NULL), mpUpperBound(NULL), mUpperBound(0.0) {initializeParameter();} COptItem::COptItem(const CCopasiParameterGroup & group, const CCopasiContainer * pParent): CCopasiParameterGroup(group, (pParent != NULL) ? pParent : group.getObjectDataModel()), mpParmObjectCN(NULL), mpParmLowerBound(NULL), mpParmUpperBound(NULL), mpParmStartValue(NULL), mpObject(NULL), mpMethod(NULL), mpObjectValue(NULL), mpLowerObject(NULL), mpLowerBound(NULL), mLowerBound(0.0), mpUpperObject(NULL), mpUpperBound(NULL), mUpperBound(0.0) {initializeParameter();} COptItem::~COptItem() {} void COptItem::initializeParameter() { mpParmObjectCN = assertParameter("ObjectCN", CCopasiParameter::CN, CCopasiObjectName(""))->getValue().pCN; mpParmLowerBound = assertParameter("LowerBound", CCopasiParameter::CN, CCopasiObjectName("-inf"))->getValue().pCN; mpParmUpperBound = assertParameter("UpperBound", CCopasiParameter::CN, CCopasiObjectName("inf"))->getValue().pCN; mpParmStartValue = assertParameter("StartValue", CCopasiParameter::DOUBLE, NaN)->getValue().pDOUBLE; } bool COptItem::setObjectCN(const CCopasiObjectName & objectCN) { const CCopasiDataModel * pDataModel = getObjectDataModel(); assert(pDataModel != NULL); const CCopasiObject * pObject = pDataModel->getObject(objectCN); if (pObject == NULL || !pObject->isValueDbl()) { CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 1, objectCN.c_str()); return false; } *mpParmObjectCN = objectCN; return true; } const CCopasiObject * COptItem::getObject() const {return mpObject;} const CCopasiObjectName COptItem::getObjectCN() const {return *mpParmObjectCN;} std::string COptItem::getObjectDisplayName() const { if (!mpObject && !const_cast<COptItem *>(this)->compile()) return "Invalid Optimization Item"; return mpObject->getObjectDisplayName(); } bool COptItem::setLowerBound(const CCopasiObjectName & lowerBound) { if (lowerBound[0] == '-' && lowerBound[lowerBound.length() - 1] == '%' && isNumber(lowerBound.substr(1, lowerBound.length() - 2))) { std::stringstream LowerBound; C_FLOAT64 StartValue = getStartValue(); LowerBound << StartValue + fabs(StartValue) * strToDouble(lowerBound.c_str(), NULL) / 100.0; *mpParmLowerBound = LowerBound.str(); return true; } else { *mpParmLowerBound = lowerBound; } return compileLowerBound(CCopasiContainer::EmptyList); } const std::string COptItem::getLowerBound() const {return *mpParmLowerBound;} bool COptItem::setUpperBound(const CCopasiObjectName & upperBound) { if (upperBound[0] == '+' && upperBound[upperBound.length() - 1] == '%' && isNumber(upperBound.substr(1, upperBound.length() - 2))) { std::stringstream UpperBound; C_FLOAT64 StartValue = getStartValue(); UpperBound << StartValue + fabs(StartValue) * strToDouble(upperBound.c_str(), NULL) / 100.0; *mpParmUpperBound = UpperBound.str(); return true; } else { *mpParmUpperBound = upperBound; } return compileUpperBound(CCopasiContainer::EmptyList); } const std::string COptItem::getUpperBound() const {return *mpParmUpperBound;} bool COptItem::setStartValue(const C_FLOAT64 & value) { *mpParmStartValue = value; return true; } const C_FLOAT64 & COptItem::getStartValue() const { if (!isnan(*mpParmStartValue)) return *mpParmStartValue; if (mpObjectValue == NULL) { const CCopasiDataModel* pDataModel = getObjectDataModel(); assert(pDataModel != NULL); const CCopasiObject * pObject = pDataModel->getObject(getObjectCN()); if (pObject != NULL && pObject->getValuePointer() != NULL) return *(C_FLOAT64 *) pObject->getValuePointer(); return NaN; } return *mpObjectValue; } C_FLOAT64 COptItem::getRandomValue(CRandom * pRandom) { C_FLOAT64 RandomValue; if (mpLowerBound == NULL || mpUpperBound == NULL) compile(); if (mpLowerBound == NULL || mpUpperBound == NULL) { RandomValue = NaN; return RandomValue; } if (pRandom == NULL) { if (mpRandom == NULL) mpRandom = CRandom::createGenerator(); pRandom = mpRandom; } C_FLOAT64 mn = *mpLowerBound; C_FLOAT64 mx = *mpUpperBound; C_FLOAT64 la; try { // First determine the location of the interval // Secondly determine whether to distribute the parameter linearly or not // depending on the location and act upon it. if (0.0 <= mn) // the interval [mn, mx) is in [0, inf) { la = log10(mx) - log10(std::max(mn, DBL_MIN)); if (la < 1.8 || !(mn > 0.0)) // linear RandomValue = mn + pRandom->getRandomCC() * (mx - mn); else RandomValue = pow(10.0, log10(std::max(mn, DBL_MIN)) + la * pRandom->getRandomCC()); } else if (mx > 0) // 0 is in the interval (mn, mx) { la = log10(mx) + log10(-mn); if (la < 3.6) // linear RandomValue = mn + pRandom->getRandomCC() * (mx - mn); else { C_FLOAT64 mean = (mx + mn) * 0.5; C_FLOAT64 sigma = std::min(DBL_MAX, mx - mn) / 3.0; do { RandomValue = pRandom->getRandomNormal(mean, sigma); } while ((RandomValue < mn) || (RandomValue > mx)); } } else // the interval (mn, mx] is in (-inf, 0] { // Switch lower and upper bound and change sign, i.e., // we can treat it similarly as location 1: mx = - *mpLowerBound; mn = - *mpUpperBound; la = log10(mx) - log10(std::max(mn, DBL_MIN)); if (la < 1.8 || !(mn > 0.0)) // linear RandomValue = - (mn + pRandom->getRandomCC() * (mx - mn)); else RandomValue = - pow(10.0, log10(std::max(mn, DBL_MIN)) + la * pRandom->getRandomCC()); } } catch (...) { RandomValue = (mx + mn) * 0.5; } return RandomValue; } UpdateMethod * COptItem::getUpdateMethod() const {return mpMethod;} bool COptItem::isValid() const { COptItem *pTmp = const_cast<COptItem *>(this); if (!pTmp->setObjectCN(getObjectCN())) return false; if (!pTmp->setLowerBound(getLowerBound())) return false; if (!pTmp->setUpperBound(getUpperBound())) return false; return true; } bool COptItem::isValid(CCopasiParameterGroup & group) { COptItem tmp(group); return tmp.isValid(); } bool COptItem::compile(const std::vector< CCopasiContainer * > listOfContainer) { clearDirectDependencies(); std::string Bound; mpMethod = &DoNothing; mpObjectValue = &NaN; if ((mpObject = getObjectDataModel()->ObjectFromName(listOfContainer, getObjectCN())) != NULL && mpObject->isValueDbl()) mpObjectValue = (C_FLOAT64 *) mpObject->getValuePointer(); if (mpObjectValue == &NaN) { CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 1, getObjectCN().c_str()); return false; } addDirectDependency(mpObject); mpMethod = mpObject->getUpdateMethod(); if (compileLowerBound(listOfContainer)) { if (mpLowerObject != NULL) { addDirectDependency(mpLowerObject); } } else { CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 2, mpParmLowerBound->c_str()); return false; } if (compileUpperBound(listOfContainer)) { if (mpUpperObject != NULL) { addDirectDependency(mpUpperObject); } } else { CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 2, mpParmUpperBound->c_str()); return false; } if (!mpUpperObject && !mpLowerObject && *mpUpperBound < *mpLowerBound) { CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 4, *mpLowerBound, *mpUpperBound); return false; } if (isnan(*mpParmStartValue)) *mpParmStartValue = *mpObjectValue; return true; } C_INT32 COptItem::checkConstraint() const { if (*mpLowerBound > *mpObjectValue) return - 1; if (*mpObjectValue > *mpUpperBound) return 1; return 0; } C_FLOAT64 COptItem::getConstraintViolation() const { switch (checkConstraint()) { case - 1: return *mpLowerBound - *mpObjectValue; break; case 1: return *mpObjectValue - *mpUpperBound; break; default: return 0.0; break; } } C_INT32 COptItem::checkConstraint(const C_FLOAT64 & value) const { if (*mpLowerBound > value) return - 1; if (value > *mpUpperBound) return 1; return 0; } bool COptItem::checkLowerBound(const C_FLOAT64 & value) const {return *mpLowerBound <= value;} bool COptItem::checkUpperBound(const C_FLOAT64 & value) const {return value <= *mpUpperBound;} const C_FLOAT64 * COptItem::getObjectValue() const {return mpObjectValue;} bool COptItem::compileLowerBound(const std::vector< CCopasiContainer * > & listOfContainer) { const CCopasiDataModel * pDataModel = getObjectDataModel(); assert(pDataModel != NULL); mpLowerObject = NULL; mpLowerBound = NULL; if (*mpParmLowerBound == "-inf") { mLowerBound = - DBL_MAX; mpLowerBound = &mLowerBound; } else if (isNumber(*mpParmLowerBound)) { mLowerBound = strToDouble(mpParmLowerBound->c_str(), NULL); mpLowerBound = &mLowerBound; } else if ((mpLowerObject = getObjectDataModel()->ObjectFromName(listOfContainer, *mpParmLowerBound)) != NULL && mpLowerObject->isValueDbl()) { mpLowerBound = (C_FLOAT64 *) mpLowerObject->getValuePointer(); } return mpLowerBound != NULL; } bool COptItem::compileUpperBound(const std::vector< CCopasiContainer * > & listOfContainer) { const CCopasiDataModel * pDataModel = getObjectDataModel(); assert(pDataModel != NULL); mpUpperObject = NULL; mpUpperBound = NULL; if (*mpParmUpperBound == "inf") { mUpperBound = DBL_MAX; mpUpperBound = &mUpperBound; } else if (isNumber(*mpParmUpperBound)) { mUpperBound = strToDouble(mpParmUpperBound->c_str(), NULL); mpUpperBound = &mUpperBound; } else if ((mpUpperObject = getObjectDataModel()->ObjectFromName(listOfContainer, *mpParmUpperBound)) != NULL && mpUpperObject->isValueDbl()) { mpUpperBound = (C_FLOAT64 *) mpUpperObject->getValuePointer(); addDirectDependency(mpUpperObject); } return mpUpperBound != NULL; } std::ostream &operator<<(std::ostream &os, const COptItem & o) { if (!o.mpObject && const_cast<COptItem *>(&o)->compile()) return os << "Invalid Optimization Item"; if (o.mpLowerObject) os << o.mpLowerObject->getObjectDisplayName(); else os << o.getLowerBound(); os << " <= "; os << o.mpObject->getObjectDisplayName(); os << " <= "; if (o.mpUpperObject) os << o.mpUpperObject->getObjectDisplayName(); else os << o.getUpperBound(); return os; }
25.823077
99
0.64157
[ "vector" ]
9d29c67a6f9a8f457b58210fce3bd9eb6e90817f
12,856
hpp
C++
src/she_c_impl.hpp
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
src/she_c_impl.hpp
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
src/she_c_impl.hpp
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
#include <iostream> #include <sstream> #include <vector> #include <string> #include <iosfwd> #include <stdint.h> #include <memory.h> #include "../src/bn_c_impl.hpp" #define MCLSHE_DLL_EXPORT #include <mcl/she.h> #include <mcl/she.hpp> using namespace mcl::she; using namespace mcl::bn_current; #if defined(CYBOZU_CPP_VERSION) && CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11 #include <mutex> #define USE_STD_MUTEX #else #include <cybozu/mutex.hpp> #endif static SecretKey *cast(sheSecretKey *p) { return reinterpret_cast<SecretKey*>(p); } static const SecretKey *cast(const sheSecretKey *p) { return reinterpret_cast<const SecretKey*>(p); } static PublicKey *cast(shePublicKey *p) { return reinterpret_cast<PublicKey*>(p); } static const PublicKey *cast(const shePublicKey *p) { return reinterpret_cast<const PublicKey*>(p); } static PrecomputedPublicKey *cast(shePrecomputedPublicKey *p) { return reinterpret_cast<PrecomputedPublicKey*>(p); } static const PrecomputedPublicKey *cast(const shePrecomputedPublicKey *p) { return reinterpret_cast<const PrecomputedPublicKey*>(p); } static CipherTextG1 *cast(sheCipherTextG1 *p) { return reinterpret_cast<CipherTextG1*>(p); } static const CipherTextG1 *cast(const sheCipherTextG1 *p) { return reinterpret_cast<const CipherTextG1*>(p); } static CipherTextG2 *cast(sheCipherTextG2 *p) { return reinterpret_cast<CipherTextG2*>(p); } static const CipherTextG2 *cast(const sheCipherTextG2 *p) { return reinterpret_cast<const CipherTextG2*>(p); } static CipherTextGT *cast(sheCipherTextGT *p) { return reinterpret_cast<CipherTextGT*>(p); } static const CipherTextGT *cast(const sheCipherTextGT *p) { return reinterpret_cast<const CipherTextGT*>(p); } int sheInit(int curve, int maxUnitSize) try { if (maxUnitSize != MCLBN_FP_UNIT_SIZE) { fprintf(stderr, "err sheInit:maxUnitSize is mismatch %d %d\n", maxUnitSize, MCLBN_FP_UNIT_SIZE); return -1; } #ifdef USE_STD_MUTEX static std::mutex m; std::lock_guard<std::mutex> lock(m); #else static cybozu::Mutex m; cybozu::AutoLock lock(m); #endif static int g_curve = -1; if (g_curve == curve) return 0; mcl::bn::CurveParam cp; switch (curve) { case mclBn_CurveFp254BNb: cp = mcl::bn::CurveFp254BNb; break; case mclBn_CurveFp382_1: cp = mcl::bn::CurveFp382_1; break; case mclBn_CurveFp382_2: cp = mcl::bn::CurveFp382_2; break; case mclBn_CurveFp462: cp = mcl::bn::CurveFp462; break; default: fprintf(stderr, "err bad curve %d\n", curve); return -1; } SHE::init(cp); g_curve = curve; return 0; } catch (std::exception& e) { fprintf(stderr, "err sheInit %s\n", e.what()); return -1; } template<class T> mclSize serialize(void *buf, mclSize maxBufSize, const T *x) try { return cast(x)->serialize(buf, maxBufSize); } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return 0; } mclSize sheSecretKeySerialize(void *buf, mclSize maxBufSize, const sheSecretKey *sec) { return serialize(buf, maxBufSize, sec); } mclSize shePublicKeySerialize(void *buf, mclSize maxBufSize, const shePublicKey *pub) { return serialize(buf, maxBufSize, pub); } mclSize sheCipherTextG1Serialize(void *buf, mclSize maxBufSize, const sheCipherTextG1 *c) { return serialize(buf, maxBufSize, c); } mclSize sheCipherTextG2Serialize(void *buf, mclSize maxBufSize, const sheCipherTextG2 *c) { return serialize(buf, maxBufSize, c); } mclSize sheCipherTextGTSerialize(void *buf, mclSize maxBufSize, const sheCipherTextGT *c) { return serialize(buf, maxBufSize, c); } template<class T> mclSize deserialize(T *x, const void *buf, mclSize bufSize) try { return cast(x)->deserialize(buf, bufSize); } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return 0; } mclSize sheSecretKeyDeserialize(sheSecretKey* sec, const void *buf, mclSize bufSize) { return deserialize(sec, buf, bufSize); } mclSize shePublicKeyDeserialize(shePublicKey* pub, const void *buf, mclSize bufSize) { return deserialize(pub, buf, bufSize); } mclSize sheCipherTextG1Deserialize(sheCipherTextG1* c, const void *buf, mclSize bufSize) { return deserialize(c, buf, bufSize); } mclSize sheCipherTextG2Deserialize(sheCipherTextG2* c, const void *buf, mclSize bufSize) { return deserialize(c, buf, bufSize); } mclSize sheCipherTextGTDeserialize(sheCipherTextGT* c, const void *buf, mclSize bufSize) { return deserialize(c, buf, bufSize); } int sheSecretKeySetByCSPRNG(sheSecretKey *sec) try { cast(sec)->setByCSPRNG(); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } void sheGetPublicKey(shePublicKey *pub, const sheSecretKey *sec) { cast(sec)->getPublicKey(*cast(pub)); } static int setRangeForDLP(void (*f)(mclSize), mclSize hashSize) try { f(hashSize); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheSetRangeForDLP(mclSize hashSize) { return setRangeForDLP(SHE::setRangeForDLP, hashSize); } int sheSetRangeForG1DLP(mclSize hashSize) { return setRangeForDLP(SHE::setRangeForG1DLP, hashSize); } int sheSetRangeForG2DLP(mclSize hashSize) { return setRangeForDLP(SHE::setRangeForG2DLP, hashSize); } int sheSetRangeForGTDLP(mclSize hashSize) { return setRangeForDLP(SHE::setRangeForGTDLP, hashSize); } void sheSetTryNum(mclSize tryNum) { SHE::setTryNum(tryNum); } void sheUseDecG1ViaGT(int use) { SHE::useDecG1ViaGT(use != 0); } void sheUseDecG2ViaGT(int use) { SHE::useDecG2ViaGT(use != 0); } template<class HashTable> mclSize loadTable(HashTable& table, const void *buf, mclSize bufSize) try { return table.load(buf, bufSize); } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return 0; } mclSize sheLoadTableForG1DLP(const void *buf, mclSize bufSize) { return loadTable(SHE::PhashTbl_, buf, bufSize); } mclSize sheLoadTableForG2DLP(const void *buf, mclSize bufSize) { return loadTable(SHE::QhashTbl_, buf, bufSize); } mclSize sheLoadTableForGTDLP(const void *buf, mclSize bufSize) { return loadTable(SHE::ePQhashTbl_, buf, bufSize); } template<class HashTable> mclSize saveTable(void *buf, mclSize maxBufSize, const HashTable& table) try { return table.save(buf, maxBufSize); } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return 0; } mclSize sheSaveTableForG1DLP(void *buf, mclSize maxBufSize) { return saveTable(buf, maxBufSize, SHE::PhashTbl_); } mclSize sheSaveTableForG2DLP(void *buf, mclSize maxBufSize) { return saveTable(buf, maxBufSize, SHE::QhashTbl_); } mclSize sheSaveTableForGTDLP(void *buf, mclSize maxBufSize) { return saveTable(buf, maxBufSize, SHE::ePQhashTbl_); } template<class CT> int encT(CT *c, const shePublicKey *pub, mclInt m) try { cast(pub)->enc(*cast(c), m); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheEncG1(sheCipherTextG1 *c, const shePublicKey *pub, mclInt m) { return encT(c, pub, m); } int sheEncG2(sheCipherTextG2 *c, const shePublicKey *pub, mclInt m) { return encT(c, pub, m); } int sheEncGT(sheCipherTextGT *c, const shePublicKey *pub, mclInt m) { return encT(c, pub, m); } template<class CT> int decT(mclInt *m, const sheSecretKey *sec, const CT *c) try { *m = (cast(sec)->dec)(*cast(c)); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheDecG1(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c) { return decT(m, sec, c); } int sheDecG2(mclInt *m, const sheSecretKey *sec, const sheCipherTextG2 *c) { return decT(m, sec, c); } int sheDecGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextGT *c) { return decT(m, sec, c); } template<class CT> int decViaGTT(mclInt *m, const sheSecretKey *sec, const CT *c) try { *m = (cast(sec)->decViaGT)(*cast(c)); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheDecG1ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c) { return decViaGTT(m, sec, c); } int sheDecG2ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG2 *c) { return decViaGTT(m, sec, c); } template<class CT> int isZeroT(const sheSecretKey *sec, const CT *c) try { return cast(sec)->isZero(*cast(c)); } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return 0; } int sheIsZeroG1(const sheSecretKey *sec, const sheCipherTextG1 *c) { return isZeroT(sec, c); } int sheIsZeroG2(const sheSecretKey *sec, const sheCipherTextG2 *c) { return isZeroT(sec, c); } int sheIsZeroGT(const sheSecretKey *sec, const sheCipherTextGT *c) { return isZeroT(sec, c); } template<class CT> int addT(CT& z, const CT& x, const CT& y) try { CT::add(z, x, y); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheAddG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, const sheCipherTextG1 *y) { return addT(*cast(z), *cast(x), *cast(y)); } int sheAddG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, const sheCipherTextG2 *y) { return addT(*cast(z), *cast(x), *cast(y)); } int sheAddGT(sheCipherTextGT *z, const sheCipherTextGT *x, const sheCipherTextGT *y) { return addT(*cast(z), *cast(x), *cast(y)); } template<class CT> int subT(CT& z, const CT& x, const CT& y) try { CT::sub(z, x, y); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheSubG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, const sheCipherTextG1 *y) { return subT(*cast(z), *cast(x), *cast(y)); } int sheSubG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, const sheCipherTextG2 *y) { return subT(*cast(z), *cast(x), *cast(y)); } int sheSubGT(sheCipherTextGT *z, const sheCipherTextGT *x, const sheCipherTextGT *y) { return subT(*cast(z), *cast(x), *cast(y)); } template<class CT1, class CT2, class CT3> int mulT(CT1& z, const CT2& x, const CT3& y) try { CT1::mul(z, x, y); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheMulG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, mclInt y) { return mulT(*cast(z), *cast(x), y); } int sheMulG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, mclInt y) { return mulT(*cast(z), *cast(x), y); } int sheMulGT(sheCipherTextGT *z, const sheCipherTextGT *x, mclInt y) { return mulT(*cast(z), *cast(x), y); } int sheMul(sheCipherTextGT *z, const sheCipherTextG1 *x, const sheCipherTextG2 *y) { return mulT(*cast(z), *cast(x), *cast(y)); } int sheMulML(sheCipherTextGT *z, const sheCipherTextG1 *x, const sheCipherTextG2 *y) try { CipherTextGT::mulML(*cast(z), *cast(x), *cast(y)); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheFinalExpGT(sheCipherTextGT *y, const sheCipherTextGT *x) try { CipherTextGT::finalExp(*cast(y), *cast(x)); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } template<class CT> int reRandT(CT& c, const shePublicKey *pub) try { cast(pub)->reRand(c); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheReRandG1(sheCipherTextG1 *c, const shePublicKey *pub) { return reRandT(*cast(c), pub); } int sheReRandG2(sheCipherTextG2 *c, const shePublicKey *pub) { return reRandT(*cast(c), pub); } int sheReRandGT(sheCipherTextGT *c, const shePublicKey *pub) { return reRandT(*cast(c), pub); } template<class CT> int convert(sheCipherTextGT *y, const shePublicKey *pub, const CT *x) try { cast(pub)->convert(*cast(y), *cast(x)); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int sheConvertG1(sheCipherTextGT *y, const shePublicKey *pub, const sheCipherTextG1 *x) { return convert(y, pub, x); } int sheConvertG2(sheCipherTextGT *y, const shePublicKey *pub, const sheCipherTextG2 *x) { return convert(y, pub, x); } shePrecomputedPublicKey *shePrecomputedPublicKeyCreate() try { return reinterpret_cast<shePrecomputedPublicKey*>(new PrecomputedPublicKey()); } catch (...) { return 0; } void shePrecomputedPublicKeyDestroy(shePrecomputedPublicKey *ppub) { delete cast(ppub); } int shePrecomputedPublicKeyInit(shePrecomputedPublicKey *ppub, const shePublicKey *pub) try { cast(ppub)->init(*cast(pub)); return 0; } catch (...) { return 1; } template<class CT> int pEncT(CT *c, const shePrecomputedPublicKey *pub, mclInt m) try { cast(pub)->enc(*cast(c), m); return 0; } catch (std::exception& e) { fprintf(stderr, "err %s\n", e.what()); return -1; } int shePrecomputedPublicKeyEncG1(sheCipherTextG1 *c, const shePrecomputedPublicKey *pub, mclInt m) { return pEncT(c, pub, m); } int shePrecomputedPublicKeyEncG2(sheCipherTextG2 *c, const shePrecomputedPublicKey *pub, mclInt m) { return pEncT(c, pub, m); } int shePrecomputedPublicKeyEncGT(sheCipherTextGT *c, const shePrecomputedPublicKey *pub, mclInt m) { return pEncT(c, pub, m); }
23.374545
134
0.717175
[ "vector" ]
9d2ac24f9a6e34d5c175489eb319dc845e4922a2
2,009
hpp
C++
include/Xpress/VecSum.hpp
robclu/Xpress
49ec95abaec9d350823204736c92d661422b6c34
[ "MIT" ]
null
null
null
include/Xpress/VecSum.hpp
robclu/Xpress
49ec95abaec9d350823204736c92d661422b6c34
[ "MIT" ]
null
null
null
include/Xpress/VecSum.hpp
robclu/Xpress
49ec95abaec9d350823204736c92d661422b6c34
[ "MIT" ]
null
null
null
//==--- Xpress/VecSum.hpp --------------------------------- -*- C++ -*- ---==// // // Xpress // // Copyright (c) 2016 Rob Clucas // // This file is distributed under the MIT License. See LICENSE for details. // //==-----------------------------------------------------------------------==// // /// \file VecSum.hpp /// \brief This file defines an expression to sum two vectors. // //==-----------------------------------------------------------------------==// #ifndef XPRESS_VEC_SUM_HPP #define XPRESS_VEC_SUM_HPP #include "VecExpression.hpp" namespace Xpress { /// The VecSum class sums the elements of two vectors. /// \tparam Exp1 The first vector expression in the sum. /// \tparam Exp2 The second vector expression in the sum. template <typename Exp1, typename Exp2> class VecSum : public VecExpression<VecSum<Exp1, Exp2>> { public: /// Constructor -- Ensures that the expressions being /// added have the same number of elements. /// \param[in] a A reference to the first expression. /// \param[in] b A reference to the second expression. VecSum(const VecExpression<Exp1>& a, const VecExpression<Exp2>& b) : A(a), B(b) { assert(a.size() == b.size() && "Expressions have different size!"); // TODO: Add static assert on Expr1::Type, Expr2::Type and ensure they are // convertible!! } decltype(auto) operator[](size_t i) const { return A[i] + B[i]; }; size_t size() const { return A.size(); } private: const Exp1& A; //!< The first vector expression in the sum. const Exp2& B; //!< The second vector expression in the sum. }; } // namespace Xpress // Overload of operator+ for two vector expression. template <typename Expr1, typename Expr2> Xpress::VecSum<Expr1, Expr2> operator+(const Jolt::VecExpression<Expr1>& a, const Xpress::VecExpression<Expr2>& b) { return Xpress::VecSum<Expr1, Expr2>(a, b); }; #endif // XPRESS_VEC_SUM_HPP
32.403226
79
0.579393
[ "vector" ]
9d2b058dba1103d9ca602989ba034378a06b1d1d
2,819
cpp
C++
source/mesh_simplifier/main.cpp
sergeiam/projects
20a59f6140ae387e4b539376e4f9a440842f343a
[ "MIT" ]
null
null
null
source/mesh_simplifier/main.cpp
sergeiam/projects
20a59f6140ae387e4b539376e4f9a440842f343a
[ "MIT" ]
null
null
null
source/mesh_simplifier/main.cpp
sergeiam/projects
20a59f6140ae387e4b539376e4f9a440842f343a
[ "MIT" ]
null
null
null
#include <stdio.h> #include <memory.h> #include <windows.h> #include <xr/mesh_simplifier.h> #include <xr/heightfield_simplifier.h> #include <xr/mesh.h> #include <xr/time.h> //#define SIMPLIFICATION_RATIO 0.15f // how much from the original mesh we would like to keep as face count #define SIMPLIFICATION_EPSILON 0.0136f //#define HOLE_TEST // circular hole in the center of the terrain #define INPUT_FILENAME "hf42k.raw" #define OUTPUT_FILENAME "mesh_hf.obj" #define W 4096 #define H 2048 #define XY_SCALE 0.005f #define HOLE_VALUE -1000.0f struct TEST { int a : 2; int b = 1; TEST() : a(0) {} }; bool load_heightfield(const char* file, float max_height, xr::VECTOR<float>& hf) { FILE* fp = fopen(file, "rb"); if (!fp) return false; fseek(fp, 0, SEEK_END); hf.resize(ftell(fp)); fseek(fp, 0, SEEK_SET); const float scale = max_height / 255.0f; unsigned char* buf = new unsigned char[hf.size()]; fread(buf, 1, hf.size(), fp); fclose(fp); for (int i = 0; i < hf.size(); ++i) hf[i] = float(buf[i]) * scale; delete[] buf; return true; } int main() { xr::VECTOR<float> heightfield; load_heightfield(INPUT_FILENAME, 1.0f, heightfield); xr::MESH mesh_hf; xr::VECTOR<int> mask; mask.resize(W*H); mask.fill(0); // draw a circle to test the weight/hole functionality #ifdef HOLE_TEST for (int i = 0; i < W*H; ++i ) { int x = (i%W) - (W / 2), y = (i / W) - (H / 2); int xysq = x*x + y*y; //mask[i] = (xysq >= (H*H / 16) && xysq <= ((H+1)*(H+1)/16)) ? 1 : 0; if( xysq >= (H*H / 16) && xysq <= ((H + 10)*(H + 10) / 16) ) heightfield[i] = HOLE_VALUE; } #endif xr::TIME_SCOPE time; #ifdef SIMPLIFICATION_RATIO float epsilon_l = 0.0f, epsilon_r = 0.0f; for (int y = 0; y < H - 1; ++y) { const float* ptr = &heightfield[y*W]; for (int x = 0; x < W - 1; ++x) { float dx = fabsf(ptr[0] - ptr[1]), dy = fabsf(ptr[0] - ptr[W]); if (dx > epsilon_r) epsilon_r = dx; if (dy > epsilon_r) epsilon_r = dy; } } const int target_vertices = W * H * SIMPLIFICATION_RATIO; for (int i = 0; i < 6; ++i) { const float epsilon = (epsilon_l + epsilon_r)*0.5f; mesh_hf.clear(); xr::heightfield_simplify(&heightfield[0], &mask[0], W, H, XY_SCALE, HOLE_VALUE, xr::Max(W / 16, H / 16), epsilon, mesh_hf); if (mesh_hf.positions.size() > target_vertices ) epsilon_l = epsilon; else epsilon_r = epsilon; } #elif defined(SIMPLIFICATION_EPSILON) xr::heightfield_simplify(&heightfield[0], &mask[0], W, H, XY_SCALE, HOLE_VALUE, xr::Max(W / 16, H / 16), SIMPLIFICATION_EPSILON, mesh_hf); #endif char pc[256]; sprintf(pc, "Simplify took %d ms\n", time.measure_duration_ms()); OutputDebugStringA(pc); time.reset(); mesh_hf.write_obj(OUTPUT_FILENAME); sprintf(pc, "WriteObj took %d ms\n", time.measure_duration_ms()); OutputDebugStringA(pc); return 0; }
23.689076
139
0.643491
[ "mesh", "vector" ]
9d30094db115af89988ef8ffb0f3b8c5a4a8e35c
5,626
cpp
C++
Editor/Source/Utils.cpp
Claudio-Marchini/Lumen
41183d71f0fe6dfe9964617b127b40b26339c822
[ "MIT" ]
null
null
null
Editor/Source/Utils.cpp
Claudio-Marchini/Lumen
41183d71f0fe6dfe9964617b127b40b26339c822
[ "MIT" ]
null
null
null
Editor/Source/Utils.cpp
Claudio-Marchini/Lumen
41183d71f0fe6dfe9964617b127b40b26339c822
[ "MIT" ]
null
null
null
#include "Utils.h" #include <imgui/imgui.h> #include "imgui/imgui_internal.h" b8 DrawVec3(const std::string& label, glm::vec3& vec, const glm::vec3& defaultValue) { b8 modified{ false }; ImGui::Text(label.c_str()); ImGui::PushID(label.c_str()); ImGui::PushMultiItemsWidths(3, ImGui::CalcItemWidth()); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 0, ImGui::GetCurrentContext()->Style.ItemSpacing.y }); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f); const f32 lineHeight{ ImGui::GetIO().FontDefault->FontSize + ImGui::GetCurrentContext()->Style.FramePadding.y * 2.0f }; const ImVec2 buttonSize{ lineHeight + 3.0f, lineHeight }; ImGui::PushStyleColor(ImGuiCol_Button, { 0.8f, 0.1f, 0.15f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.9f, 0.2f, 0.2f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.8f, 0.1f, 0.15f, 1.0f }); if (ImGui::Button("X", buttonSize)) { vec.x = defaultValue.x; modified = true; } ImGui::PopStyleColor(3); ImGui::SameLine(); modified |= ImGui::DragFloat("##X", &vec.x, 0.1f, 0, 0, "%.2f"); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Button, { 0.2f, 0.7f, 0.2f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.3f, 0.8f, 0.3f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.2f, 0.7f, 0.2f, 1.0f }); if (ImGui::Button("Y", buttonSize)) { vec.y = defaultValue.y; modified = true; } ImGui::PopStyleColor(3); ImGui::SameLine(); modified |= ImGui::DragFloat("##Y", &vec.y, 0.1f, 0, 0, "%.2f"); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Button, { 0.1f, 0.25f, 0.8f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.2f, 0.35f, 0.9f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.1f, 0.25f, 0.8f, 1.0f }); if (ImGui::Button("Z", buttonSize)) { vec.z = defaultValue.z; modified = true; } ImGui::PopStyleColor(3); ImGui::SameLine(); modified |= ImGui::DragFloat("##Z", &vec.z, 0.1f, 0, 0, "%.2f"); ImGui::PopItemWidth(); ImGui::PopStyleVar(2); ImGui::PopID(); return modified; } b8 DrawVec2(const std::string& label, glm::vec2& vec, const glm::vec2& defaultValue) { b8 modified{ false }; ImGui::Text(label.c_str()); ImGui::PushID(label.c_str()); ImGui::PushMultiItemsWidths(2, ImGui::CalcItemWidth()); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 0, ImGui::GetCurrentContext()->Style.ItemSpacing.y }); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f); const f32 lineHeight{ ImGui::GetIO().FontDefault->FontSize + ImGui::GetCurrentContext()->Style.FramePadding.y * 2.0f }; const ImVec2 buttonSize{ lineHeight + 3.0f, lineHeight }; ImGui::PushStyleColor(ImGuiCol_Button, { 0.8f, 0.1f, 0.15f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.9f, 0.2f, 0.2f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.8f, 0.1f, 0.15f, 1.0f }); if (ImGui::Button("X", buttonSize)) { vec.x = defaultValue.x; modified = true; } ImGui::PopStyleColor(3); ImGui::SameLine(); modified |= ImGui::DragFloat("##X", &vec.x, 0.1f, 0, 0, "%.2f"); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Button, { 0.2f, 0.7f, 0.2f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.3f, 0.8f, 0.3f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.2f, 0.7f, 0.2f, 1.0f }); if (ImGui::Button("Y", buttonSize)) { vec.y = defaultValue.y; modified = true; } ImGui::PopStyleColor(3); ImGui::SameLine(); modified |= ImGui::DragFloat("##Y", &vec.y, 0.1f, 0, 0, "%.2f"); ImGui::PopItemWidth(); ImGui::PopStyleVar(2); ImGui::PopID(); return modified; } void FileExplorer::SetCurrentPath(const std::filesystem::path path) { mCurrentPath = path; } void FileExplorer::Draw() { if (ImGui::Button("<")) { mCurrentPath = mCurrentPath.parent_path(); } std::vector<std::filesystem::path> subPaths; std::filesystem::path parent = mCurrentPath; while (parent != mCurrentPath.root_path()) { subPaths.push_back(parent); parent = parent.parent_path(); } ImGui::SameLine(); if(ImGui::Button(mCurrentPath.root_path().string().substr(0, 2).c_str())) { mCurrentPath = mCurrentPath.root_path(); } for(auto path = subPaths.rbegin(); path != subPaths.rend(); ++path) { const u64 start{ path->string().find_last_of('\\') }; std::string folder = path->string().substr(start + 1); ImGui::SameLine(); if (ImGui::Button(folder.c_str())) { mCurrentPath = *path; } } std::filesystem::path availablePath{}; for (const auto& dir : std::filesystem::directory_iterator{ mCurrentPath }) { if (dir.is_directory()) { availablePath = dir.path(); if (ImGui::Selectable(availablePath.string().c_str(), false, ImGuiSelectableFlags_DontClosePopups)) { mSelectedPath = availablePath; } if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { mSelectedPath = availablePath; mCurrentPath = availablePath; } } } ImGui::SeparatorEx(ImGuiSeparatorFlags_Horizontal); ImGui::Text(mSelectedPath.string().c_str()); }
33.488095
123
0.614291
[ "vector" ]
9d3c0e31a5378fb92e0311d373fae16f73eb6c09
16,409
cpp
C++
src/agg/agg2/src/agg_rasterizer_scanline_aa.cpp
maartenbreddels/kaplot
305026209f8026094d54373e14541f4f039501d5
[ "MIT" ]
null
null
null
src/agg/agg2/src/agg_rasterizer_scanline_aa.cpp
maartenbreddels/kaplot
305026209f8026094d54373e14541f4f039501d5
[ "MIT" ]
null
null
null
src/agg/agg2/src/agg_rasterizer_scanline_aa.cpp
maartenbreddels/kaplot
305026209f8026094d54373e14541f4f039501d5
[ "MIT" ]
null
null
null
//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.2 // Copyright (C) 2002-2004 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // The author gratefully acknowleges the support of David Turner, // Robert Wilhelm, and Werner Lemberg - the authors of the FreeType // libray - in producing this work. See http://www.freetype.org for details. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- // // Class outline_aa - implementation. // // Initially the rendering algorithm was designed by David Turner and the // other authors of the FreeType library - see the above notice. I nearly // created a similar renderer, but still I was far from David's work. // I completely redesigned the original code and adapted it for Anti-Grain // ideas. Two functions - render_line and render_hline are the core of // the algorithm - they calculate the exact coverage of each pixel cell // of the polygon. I left these functions almost as is, because there's // no way to improve the perfection - hats off to David and his group! // // All other code is very different from the original. // //---------------------------------------------------------------------------- #include <string.h> #include "agg_rasterizer_scanline_aa.h" namespace agg { //------------------------------------------------------------------------ inline void cell_aa::set_cover(int c, int a) { cover = c; area = a; } //------------------------------------------------------------------------ inline void cell_aa::add_cover(int c, int a) { cover += c; area += a; } //------------------------------------------------------------------------ inline void cell_aa::set_coord(int cx, int cy) { x = int16(cx); y = int16(cy); packed_coord = (cy << 16) + cx; } //------------------------------------------------------------------------ inline void cell_aa::set(int cx, int cy, int c, int a) { x = int16(cx); y = int16(cy); packed_coord = (cy << 16) + cx; cover = c; area = a; } //------------------------------------------------------------------------ outline_aa::~outline_aa() { delete [] m_sorted_cells; if(m_num_blocks) { cell_aa** ptr = m_cells + m_num_blocks - 1; while(m_num_blocks--) { delete [] *ptr; ptr--; } delete [] m_cells; } } //------------------------------------------------------------------------ outline_aa::outline_aa() : m_num_blocks(0), m_max_blocks(0), m_cur_block(0), m_num_cells(0), m_cells(0), m_cur_cell_ptr(0), m_sorted_cells(0), m_sorted_size(0), m_cur_x(0), m_cur_y(0), m_min_x(0x7FFFFFFF), m_min_y(0x7FFFFFFF), m_max_x(-0x7FFFFFFF), m_max_y(-0x7FFFFFFF), m_sorted(false) { m_cur_cell.set(0x7FFF, 0x7FFF, 0, 0); } //------------------------------------------------------------------------ void outline_aa::reset() { m_num_cells = 0; m_cur_block = 0; m_cur_cell.set(0x7FFF, 0x7FFF, 0, 0); m_sorted = false; m_min_x = 0x7FFFFFFF; m_min_y = 0x7FFFFFFF; m_max_x = -0x7FFFFFFF; m_max_y = -0x7FFFFFFF; } //------------------------------------------------------------------------ void outline_aa::allocate_block() { if(m_cur_block >= m_num_blocks) { if(m_num_blocks >= m_max_blocks) { cell_aa** new_cells = new cell_aa* [m_max_blocks + cell_block_pool]; if(m_cells) { memcpy(new_cells, m_cells, m_max_blocks * sizeof(cell_aa*)); delete [] m_cells; } m_cells = new_cells; m_max_blocks += cell_block_pool; } m_cells[m_num_blocks++] = new cell_aa [unsigned(cell_block_size)]; } m_cur_cell_ptr = m_cells[m_cur_block++]; } //------------------------------------------------------------------------ inline void outline_aa::add_cur_cell() { if(m_cur_cell.area | m_cur_cell.cover) { if((m_num_cells & cell_block_mask) == 0) { if(m_num_blocks >= cell_block_limit) return; allocate_block(); } *m_cur_cell_ptr++ = m_cur_cell; ++m_num_cells; if(m_cur_cell.x < m_min_x) m_min_x = m_cur_cell.x; if(m_cur_cell.x > m_max_x) m_max_x = m_cur_cell.x; } } //------------------------------------------------------------------------ inline void outline_aa::set_cur_cell(int x, int y) { if(m_cur_cell.packed_coord != (y << 16) + x) { add_cur_cell(); m_cur_cell.set(x, y, 0, 0); } } //------------------------------------------------------------------------ inline void outline_aa::render_hline(int ey, int x1, int y1, int x2, int y2) { int ex1 = x1 >> poly_base_shift; int ex2 = x2 >> poly_base_shift; int fx1 = x1 & poly_base_mask; int fx2 = x2 & poly_base_mask; int delta, p, first, dx; int incr, lift, mod, rem; //trivial case. Happens often if(y1 == y2) { set_cur_cell(ex2, ey); return; } //everything is located in a single cell. That is easy! if(ex1 == ex2) { delta = y2 - y1; m_cur_cell.add_cover(delta, (fx1 + fx2) * delta); return; } //ok, we'll have to render a run of adjacent cells on the same //hline... p = (poly_base_size - fx1) * (y2 - y1); first = poly_base_size; incr = 1; dx = x2 - x1; if(dx < 0) { p = fx1 * (y2 - y1); first = 0; incr = -1; dx = -dx; } delta = p / dx; mod = p % dx; if(mod < 0) { delta--; mod += dx; } m_cur_cell.add_cover(delta, (fx1 + first) * delta); ex1 += incr; set_cur_cell(ex1, ey); y1 += delta; if(ex1 != ex2) { p = poly_base_size * (y2 - y1 + delta); lift = p / dx; rem = p % dx; if (rem < 0) { lift--; rem += dx; } mod -= dx; while (ex1 != ex2) { delta = lift; mod += rem; if(mod >= 0) { mod -= dx; delta++; } m_cur_cell.add_cover(delta, (poly_base_size) * delta); y1 += delta; ex1 += incr; set_cur_cell(ex1, ey); } } delta = y2 - y1; m_cur_cell.add_cover(delta, (fx2 + poly_base_size - first) * delta); } //------------------------------------------------------------------------ void outline_aa::render_line(int x1, int y1, int x2, int y2) { int ey1 = y1 >> poly_base_shift; int ey2 = y2 >> poly_base_shift; int fy1 = y1 & poly_base_mask; int fy2 = y2 & poly_base_mask; int dx, dy, x_from, x_to; int p, rem, mod, lift, delta, first, incr; dx = x2 - x1; dy = y2 - y1; //everything is on a single hline if(ey1 == ey2) { render_hline(ey1, x1, fy1, x2, fy2); return; } //Vertical line - we have to calculate start and end cells, //and then - the common values of the area and coverage for //all cells of the line. We know exactly there's only one //cell, so, we don't have to call render_hline(). incr = 1; if(dx == 0) { int ex = x1 >> poly_base_shift; int two_fx = (x1 - (ex << poly_base_shift)) << 1; int area; first = poly_base_size; if(dy < 0) { first = 0; incr = -1; } x_from = x1; //render_hline(ey1, x_from, fy1, x_from, first); delta = first - fy1; m_cur_cell.add_cover(delta, two_fx * delta); ey1 += incr; set_cur_cell(ex, ey1); delta = first + first - poly_base_size; area = two_fx * delta; while(ey1 != ey2) { //render_hline(ey1, x_from, poly_base_size - first, x_from, first); m_cur_cell.set_cover(delta, area); ey1 += incr; set_cur_cell(ex, ey1); } //render_hline(ey1, x_from, poly_base_size - first, x_from, fy2); delta = fy2 - poly_base_size + first; m_cur_cell.add_cover(delta, two_fx * delta); return; } //ok, we have to render several hlines p = (poly_base_size - fy1) * dx; first = poly_base_size; if(dy < 0) { p = fy1 * dx; first = 0; incr = -1; dy = -dy; } delta = p / dy; mod = p % dy; if(mod < 0) { delta--; mod += dy; } x_from = x1 + delta; render_hline(ey1, x1, fy1, x_from, first); ey1 += incr; set_cur_cell(x_from >> poly_base_shift, ey1); if(ey1 != ey2) { p = poly_base_size * dx; lift = p / dy; rem = p % dy; if(rem < 0) { lift--; rem += dy; } mod -= dy; while(ey1 != ey2) { delta = lift; mod += rem; if (mod >= 0) { mod -= dy; delta++; } x_to = x_from + delta; render_hline(ey1, x_from, poly_base_size - first, x_to, first); x_from = x_to; ey1 += incr; set_cur_cell(x_from >> poly_base_shift, ey1); } } render_hline(ey1, x_from, poly_base_size - first, x2, fy2); } //------------------------------------------------------------------------ void outline_aa::move_to(int x, int y) { if(m_sorted) reset(); set_cur_cell(x >> poly_base_shift, y >> poly_base_shift); m_cur_x = x; m_cur_y = y; } //------------------------------------------------------------------------ void outline_aa::line_to(int x, int y) { render_line(m_cur_x, m_cur_y, x, y); m_cur_x = x; m_cur_y = y; m_sorted = false; } //------------------------------------------------------------------------ enum { qsort_threshold = 9 }; //------------------------------------------------------------------------ template <class T> static inline void swap_cells(T* a, T* b) { T temp = *a; *a = *b; *b = temp; } //------------------------------------------------------------------------ template <class T> static inline bool less_than(T* a, T* b) { return (*a)->packed_coord < (*b)->packed_coord; } //------------------------------------------------------------------------ void outline_aa::qsort_cells(cell_aa** start, unsigned num) { cell_aa** stack[80]; cell_aa*** top; cell_aa** limit; cell_aa** base; limit = start + num; base = start; top = stack; for (;;) { int len = int(limit - base); cell_aa** i; cell_aa** j; cell_aa** pivot; if(len > qsort_threshold) { // we use base + len/2 as the pivot pivot = base + len / 2; swap_cells(base, pivot); i = base + 1; j = limit - 1; // now ensure that *i <= *base <= *j if(less_than(j, i)) { swap_cells(i, j); } if(less_than(base, i)) { swap_cells(base, i); } if(less_than(j, base)) { swap_cells(base, j); } for(;;) { do i++; while( less_than(i, base) ); do j--; while( less_than(base, j) ); if ( i > j ) { break; } swap_cells(i, j); } swap_cells(base, j); // now, push the largest sub-array if(j - base > limit - i) { top[0] = base; top[1] = j; base = i; } else { top[0] = i; top[1] = limit; limit = j; } top += 2; } else { // the sub-array is small, perform insertion sort j = base; i = j + 1; for(; i < limit; j = i, i++) { for(; less_than(j + 1, j); j--) { swap_cells(j + 1, j); if (j == base) { break; } } } if(top > stack) { top -= 2; base = top[0]; limit = top[1]; } else { break; } } } } //------------------------------------------------------------------------ void outline_aa::sort_cells() { if(m_num_cells == 0) return; if(m_num_cells > m_sorted_size) { delete [] m_sorted_cells; m_sorted_size = m_num_cells; m_sorted_cells = new cell_aa* [m_num_cells + 1]; } cell_aa** sorted_ptr = m_sorted_cells; cell_aa** block_ptr = m_cells; cell_aa* cell_ptr; unsigned nb = m_num_cells >> cell_block_shift; unsigned i; while(nb--) { cell_ptr = *block_ptr++; i = cell_block_size; while(i--) { *sorted_ptr++ = cell_ptr++; } } cell_ptr = *block_ptr++; i = m_num_cells & cell_block_mask; while(i--) { *sorted_ptr++ = cell_ptr++; } m_sorted_cells[m_num_cells] = 0; qsort_cells(m_sorted_cells, m_num_cells); m_min_y = m_sorted_cells[0]->y; m_max_y = m_sorted_cells[m_num_cells - 1]->y; } //------------------------------------------------------------------------ const cell_aa* const* outline_aa::cells() { //Perform sort only the first time. if(!m_sorted) { add_cur_cell(); sort_cells(); m_sorted = true; } return m_sorted_cells; } }
26.381029
84
0.388811
[ "geometry", "render" ]
9d4915b4ae872a852deed4d92d98f95767309899
3,206
hh
C++
src/tunnuz/json.tab.hh
Barenboim/nativejson-benchmark
5c13c515443ac885b1b315a452345bbd1937052e
[ "MIT" ]
1,721
2015-03-25T02:21:25.000Z
2022-03-30T18:01:01.000Z
src/tunnuz/json.tab.hh
Barenboim/nativejson-benchmark
5c13c515443ac885b1b315a452345bbd1937052e
[ "MIT" ]
72
2015-04-16T03:35:22.000Z
2021-11-27T19:25:52.000Z
src/tunnuz/json.tab.hh
Barenboim/nativejson-benchmark
5c13c515443ac885b1b315a452345bbd1937052e
[ "MIT" ]
305
2015-01-30T16:16:54.000Z
2022-02-21T10:54:22.000Z
/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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. */ #ifndef YY_YY_USERS_MILOYIP_GITHUB_NATIVEJSON_BENCHMARK_SRC_TUNNUZ_JSON_TAB_HH_INCLUDED # define YY_YY_USERS_MILOYIP_GITHUB_NATIVEJSON_BENCHMARK_SRC_TUNNUZ_JSON_TAB_HH_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* "%code requires" blocks. */ #line 25 "/Users/miloyip/github/nativejson-benchmark/thirdparty/tunnuz/json.y" /* yacc.c:1915 */ #include "json_st.hh" #line 47 "/Users/miloyip/github/nativejson-benchmark/src/tunnuz/json.tab.hh" /* yacc.c:1915 */ /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { COMMA = 258, COLON = 259, SQUARE_BRACKET_L = 260, SQUARE_BRACKET_R = 261, CURLY_BRACKET_L = 262, CURLY_BRACKET_R = 263, DOUBLE_QUOTED_STRING = 264, SINGLE_QUOTED_STRING = 265, NUMBER_I = 266, NUMBER_F = 267, BOOLEAN = 268, NULL_T = 269 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 28 "/Users/miloyip/github/nativejson-benchmark/thirdparty/tunnuz/json.y" /* yacc.c:1915 */ // "Pure" types long long int int_v; long double float_v; bool bool_v; bool null_p; char* string_v; // Pointers to more complex classes JSON::Object* object_p; JSON::Array* array_p; JSON::Value* value_p; #line 88 "/Users/miloyip/github/nativejson-benchmark/src/tunnuz/json.tab.hh" /* yacc.c:1915 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_USERS_MILOYIP_GITHUB_NATIVEJSON_BENCHMARK_SRC_TUNNUZ_JSON_TAB_HH_INCLUDED */
31.742574
97
0.734872
[ "object" ]
9d52abcd8b05ded5f523bad0191e3d2fae59da11
11,934
hpp
C++
src/render/CoorConv.hpp
Wkkkkk/protype
3b0d77d545c177b86b8812be1a6e5392a6f7e367
[ "BSL-1.0" ]
9
2018-12-26T08:35:46.000Z
2021-11-08T08:51:10.000Z
src/render/CoorConv.hpp
Wkkkkk/protype
3b0d77d545c177b86b8812be1a6e5392a6f7e367
[ "BSL-1.0" ]
null
null
null
src/render/CoorConv.hpp
Wkkkkk/protype
3b0d77d545c177b86b8812be1a6e5392a6f7e367
[ "BSL-1.0" ]
7
2018-12-27T13:55:47.000Z
2021-04-23T08:45:04.000Z
#ifndef __COORCONV_H__ #define __COORCONV_H__ #include <cmath> double pi = 3.14159265358979; /* Ellipsoid model constants (actual values here are for WGS84) */ double sm_a = 6378137.0; double sm_b = 6356752.314; double sm_EccSquared = 6.69437999013e-03; double UTMScaleFactor = 0.9996; typedef struct tagUTMCorr { double x; double y; } UTMCoor; typedef struct tagWGS84Corr { double lat; double log; } WGS84Corr; /* * DegToRad * * Converts degrees to radians. * */ inline double DegToRad(double deg) { return (deg / 180.0 * pi); } /* * RadToDeg * * Converts radians to degrees. * */ inline double RadToDeg(double rad) { return (rad / pi * 180.0); } /* * ArcLengthOfMeridian * * Computes the ellipsoidal distance from the equator to a point at a * given latitude. * * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., * GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994. * * Inputs: * phi - Latitude of the point, in radians. * * Globals: * sm_a - Ellipsoid model major axis. * sm_b - Ellipsoid model minor axis. * * Returns: * The ellipsoidal distance of the point from the equator, in meters. * */ double ArcLengthOfMeridian(double phi) { double alpha, beta, gamma, delta, epsilon, n; double result; /* Precalculate n */ n = (sm_a - sm_b) / (sm_a + sm_b); /* Precalculate alpha */ alpha = ((sm_a + sm_b) / 2.0) * (1.0 + (pow(n, 2.0) / 4.0) + (pow(n, 4.0) / 64.0)); /* Precalculate beta */ beta = (-3.0 * n / 2.0) + (9.0 * pow(n, 3.0) / 16.0) + (-3.0 * pow(n, 5.0) / 32.0); /* Precalculate gamma */ gamma = (15.0 * pow(n, 2.0) / 16.0) + (-15.0 * pow(n, 4.0) / 32.0); /* Precalculate delta */ delta = (-35.0 * pow(n, 3.0) / 48.0) + (105.0 * pow(n, 5.0) / 256.0); /* Precalculate epsilon */ epsilon = (315.0 * pow(n, 4.0) / 512.0); /* Now calculate the sum of the series and return */ result = alpha * (phi + (beta * sin(2.0 * phi)) + (gamma * sin(4.0 * phi)) + (delta * sin(6.0 * phi)) + (epsilon * sin(8.0 * phi))); return result; } /* * UTMCentralMeridian * * Determines the central meridian for the given UTM zone. * * Inputs: * zone - An integer value designating the UTM zone, range [1,60]. * * Returns: * The central meridian for the given UTM zone, in radians, or zero * if the UTM zone parameter is outside the range [1,60]. * Range of the central meridian is the radian equivalent of [-177,+177]. * */ inline double UTMCentralMeridian(int zone) { return DegToRad(-183.0 + (zone * 6.0)); } /* * FootpointLatitude * * Computes the footpoint latitude for use in converting transverse * Mercator coordinates to ellipsoidal coordinates. * * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., * GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994. * * Inputs: * y - The UTM northing coordinate, in meters. * * Returns: * The footpoint latitude, in radians. * */ double FootpointLatitude(double y) { double y_, alpha_, beta_, gamma_, delta_, epsilon_, n; double result; /* Precalculate n (Eq. 10.18) */ n = (sm_a - sm_b) / (sm_a + sm_b); /* Precalculate alpha_ (Eq. 10.22) */ /* (Same as alpha in Eq. 10.17) */ alpha_ = ((sm_a + sm_b) / 2.0) * (1 + (pow(n, 2.0) / 4) + (pow(n, 4.0) / 64)); /* Precalculate y_ (Eq. 10.23) */ y_ = y / alpha_; /* Precalculate beta_ (Eq. 10.22) */ beta_ = (3.0 * n / 2.0) + (-27.0 * pow(n, 3.0) / 32.0) + (269.0 * pow(n, 5.0) / 512.0); /* Precalculate gamma_ (Eq. 10.22) */ gamma_ = (21.0 * pow(n, 2.0) / 16.0) + (-55.0 * pow(n, 4.0) / 32.0); /* Precalculate delta_ (Eq. 10.22) */ delta_ = (151.0 * pow(n, 3.0) / 96.0) + (-417.0 * pow(n, 5.0) / 128.0); /* Precalculate epsilon_ (Eq. 10.22) */ epsilon_ = (1097.0 * pow(n, 4.0) / 512.0); /* Now calculate the sum of the series (Eq. 10.21) */ result = y_ + (beta_ * sin(2.0 * y_)) + (gamma_ * sin(4.0 * y_)) + (delta_ * sin(6.0 * y_)) + (epsilon_ * sin(8.0 * y_)); return result; } /* * MapLatLonToXY * * Converts a latitude/longitude pair to x and y coordinates in the * Transverse Mercator projection. Note that Transverse Mercator is not * the same as UTM; a scale factor is required to convert between them. * * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., * GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994. * * Inputs: * phi - Latitude of the point, in radians. * lambda - Longitude of the point, in radians. * lambda0 - Longitude of the central meridian to be used, in radians. * * Outputs: * xy - A 2-element array containing the x and y coordinates * of the computed point. * * Returns: * The function does not return a value. * */ void MapLatLonToXY(double phi, double lambda, double lambda0, UTMCoor &xy) { double N, nu2, ep2, t, t2, l; double l3coef, l4coef, l5coef, l6coef, l7coef, l8coef; double tmp; /* Precalculate ep2 */ ep2 = (pow(sm_a, 2.0) - pow(sm_b, 2.0)) / pow(sm_b, 2.0); /* Precalculate nu2 */ nu2 = ep2 * pow(cos(phi), 2.0); /* Precalculate N */ N = pow(sm_a, 2.0) / (sm_b * sqrt(1 + nu2)); /* Precalculate t */ t = tan(phi); t2 = t * t; tmp = (t2 * t2 * t2) - pow(t, 6.0); /* Precalculate l */ l = lambda - lambda0; /* Precalculate coefficients for l**n in the equations below so a normal human being can read the expressions for easting and northing -- l**1 and l**2 have coefficients of 1.0 */ l3coef = 1.0 - t2 + nu2; l4coef = 5.0 - t2 + 9 * nu2 + 4.0 * (nu2 * nu2); l5coef = 5.0 - 18.0 * t2 + (t2 * t2) + 14.0 * nu2 - 58.0 * t2 * nu2; l6coef = 61.0 - 58.0 * t2 + (t2 * t2) + 270.0 * nu2 - 330.0 * t2 * nu2; l7coef = 61.0 - 479.0 * t2 + 179.0 * (t2 * t2) - (t2 * t2 * t2); l8coef = 1385.0 - 3111.0 * t2 + 543.0 * (t2 * t2) - (t2 * t2 * t2); /* Calculate easting (x) */ xy.x = N * cos(phi) * l + (N / 6.0 * pow(cos(phi), 3.0) * l3coef * pow(l, 3.0)) + (N / 120.0 * pow(cos(phi), 5.0) * l5coef * pow(l, 5.0)) + (N / 5040.0 * pow(cos(phi), 7.0) * l7coef * pow(l, 7.0)); /* Calculate northing (y) */ xy.y = ArcLengthOfMeridian(phi) + (t / 2.0 * N * pow(cos(phi), 2.0) * pow(l, 2.0)) + (t / 24.0 * N * pow(cos(phi), 4.0) * l4coef * pow(l, 4.0)) + (t / 720.0 * N * pow(cos(phi), 6.0) * l6coef * pow(l, 6.0)) + (t / 40320.0 * N * pow(cos(phi), 8.0) * l8coef * pow(l, 8.0)); } /* * MapXYToLatLon * * Converts x and y coordinates in the Transverse Mercator projection to * a latitude/longitude pair. Note that Transverse Mercator is not * the same as UTM; a scale factor is required to convert between them. * * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., * GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994. * * Inputs: * x - The easting of the point, in meters. * y - The northing of the point, in meters. * lambda0 - Longitude of the central meridian to be used, in radians. * * Outputs: * philambda - A 2-element containing the latitude and longitude * in radians. * * Returns: * The function does not return a value. * * Remarks: * The local variables Nf, nuf2, tf, and tf2 serve the same purpose as * N, nu2, t, and t2 in MapLatLonToXY, but they are computed with respect * to the footpoint latitude phif. * * x1frac, x2frac, x2poly, x3poly, etc. are to enhance readability and * to optimize computations. * */ void MapXYToLatLon(double x, double y, double lambda0, WGS84Corr &philambda) { double phif, Nf, Nfpow, nuf2, ep2, tf, tf2, tf4, cf; double x1frac, x2frac, x3frac, x4frac, x5frac, x6frac, x7frac, x8frac; double x2poly, x3poly, x4poly, x5poly, x6poly, x7poly, x8poly; /* Get the value of phif, the footpoint latitude. */ phif = FootpointLatitude(y); /* Precalculate ep2 */ ep2 = (pow(sm_a, 2.0) - pow(sm_b, 2.0)) / pow(sm_b, 2.0); /* Precalculate cos (phif) */ cf = cos(phif); /* Precalculate nuf2 */ nuf2 = ep2 * pow(cf, 2.0); /* Precalculate Nf and initialize Nfpow */ Nf = pow(sm_a, 2.0) / (sm_b * sqrt(1 + nuf2)); Nfpow = Nf; /* Precalculate tf */ tf = tan(phif); tf2 = tf * tf; tf4 = tf2 * tf2; /* Precalculate fractional coefficients for x**n in the equations below to simplify the expressions for latitude and longitude. */ x1frac = 1.0 / (Nfpow * cf); Nfpow *= Nf; /* now equals Nf**2) */ x2frac = tf / (2.0 * Nfpow); Nfpow *= Nf; /* now equals Nf**3) */ x3frac = 1.0 / (6.0 * Nfpow * cf); Nfpow *= Nf; /* now equals Nf**4) */ x4frac = tf / (24.0 * Nfpow); Nfpow *= Nf; /* now equals Nf**5) */ x5frac = 1.0 / (120.0 * Nfpow * cf); Nfpow *= Nf; /* now equals Nf**6) */ x6frac = tf / (720.0 * Nfpow); Nfpow *= Nf; /* now equals Nf**7) */ x7frac = 1.0 / (5040.0 * Nfpow * cf); Nfpow *= Nf; /* now equals Nf**8) */ x8frac = tf / (40320.0 * Nfpow); /* Precalculate polynomial coefficients for x**n. -- x**1 does not have a polynomial coefficient. */ x2poly = -1.0 - nuf2; x3poly = -1.0 - 2 * tf2 - nuf2; x4poly = 5.0 + 3.0 * tf2 + 6.0 * nuf2 - 6.0 * tf2 * nuf2 - 3.0 * (nuf2 * nuf2) - 9.0 * tf2 * (nuf2 * nuf2); x5poly = 5.0 + 28.0 * tf2 + 24.0 * tf4 + 6.0 * nuf2 + 8.0 * tf2 * nuf2; x6poly = -61.0 - 90.0 * tf2 - 45.0 * tf4 - 107.0 * nuf2 + 162.0 * tf2 * nuf2; x7poly = -61.0 - 662.0 * tf2 - 1320.0 * tf4 - 720.0 * (tf4 * tf2); x8poly = 1385.0 + 3633.0 * tf2 + 4095.0 * tf4 + 1575 * (tf4 * tf2); /* Calculate latitude */ philambda.lat = phif + x2frac * x2poly * (x * x) + x4frac * x4poly * pow(x, 4.0) + x6frac * x6poly * pow(x, 6.0) + x8frac * x8poly * pow(x, 8.0); /* Calculate longitude */ philambda.log = lambda0 + x1frac * x + x3frac * x3poly * pow(x, 3.0) + x5frac * x5poly * pow(x, 5.0) + x7frac * x7poly * pow(x, 7.0); } /* * LatLonToUTMXY * * Converts a latitude/longitude pair to x and y coordinates in the * Universal Transverse Mercator projection. * * Inputs: * lat - Latitude of the point, in radians. * lon - Longitude of the point, in radians. * zone - UTM zone to be used for calculating values for x and y. * If zone is less than 1 or greater than 60, the routine * will determine the appropriate zone from the value of lon. * * Outputs: * xy - A 2-element array where the UTM x and y values will be stored. * * Returns: * void * */ void LatLonToUTMXY(double lat, double lon, int zone, UTMCoor &xy) { MapLatLonToXY(lat, lon, UTMCentralMeridian(zone), xy); /* Adjust easting and northing for UTM system. */ xy.x = xy.x * UTMScaleFactor + 500000.0; xy.y = xy.y * UTMScaleFactor; if (xy.y < 0.0) xy.y += 10000000.0; } /* * UTMXYToLatLon * * Converts x and y coordinates in the Universal Transverse Mercator * projection to a latitude/longitude pair. * * Inputs: * x - The easting of the point, in meters. * y - The northing of the point, in meters. * zone - The UTM zone in which the point lies. * southhemi - True if the point is in the southern hemisphere; * false otherwise. * * Outputs: * latlon - A 2-element array containing the latitude and * longitude of the point, in radians. * * Returns: * The function does not return a value. * */ void UTMXYToLatLon(double x, double y, int zone, bool southhemi, WGS84Corr &latlon) { double cmeridian; x -= 500000.0; x /= UTMScaleFactor; /* If in southern hemisphere, adjust y accordingly. */ if (southhemi) y -= 10000000.0; y /= UTMScaleFactor; cmeridian = UTMCentralMeridian(zone); MapXYToLatLon(x, y, cmeridian, latlon); } #endif //__COORCONV_H__
28.966019
118
0.594939
[ "model" ]
9d5549fbc8fac809c74bc344dd7e41ae281c0ad0
2,306
cpp
C++
utils/tests/testTinyVector.cpp
Marc--Olivier/DataVisualization
8cbefa3db9807b21197efbc8c8d5b5846a1671ca
[ "BSL-1.0" ]
2
2019-07-23T13:51:46.000Z
2019-07-23T14:29:10.000Z
utils/tests/testTinyVector.cpp
Marc--Olivier/DataVisualization
8cbefa3db9807b21197efbc8c8d5b5846a1671ca
[ "BSL-1.0" ]
null
null
null
utils/tests/testTinyVector.cpp
Marc--Olivier/DataVisualization
8cbefa3db9807b21197efbc8c8d5b5846a1671ca
[ "BSL-1.0" ]
1
2018-10-19T12:56:01.000Z
2018-10-19T12:56:01.000Z
/** * Copyright Marc-Olivier Andrez 2018. * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * https://www.boost.org/LICENSE_1_0.txt) */ #include "utils/TinyArray.hpp" #include "utils/TinyVector.hpp" #include <catch2/catch.hpp> namespace utils::tests { TEST_CASE("maxCapacity") { REQUIRE(maxCapacity<1>() == 58); REQUIRE(maxCapacity<2>() == 29); REQUIRE(maxCapacity<3>() == 19); REQUIRE(maxCapacity<4>() == 15); } TEST_CASE("Tiny vector of uint8_t") { SECTION("Initialized vector") { TinyVector<uint8_t, 4, 10> tinyVectorFromVector{ std::vector<uint8_t>{{0, 1, 2, 3, 4, 5, 6}}}; TinyVector<uint8_t, 4> tinyVector{{0, 1, 2, 3, 4, 5, 6}}; INFO("Hash = " + std::to_string(static_cast<size_t>(tinyVector))); REQUIRE(tinyVector.size() == 7); for (size_t i = 0; i < tinyVector.size(); ++i) { INFO("Index #" + std::to_string(i)); REQUIRE(tinyVector[i] == i); REQUIRE(tinyVectorFromVector[i] == i); } } } TEST_CASE("Tiny vector of TinyArray") { using EdgesArray = TinyArray<uint8_t, 4, 2>; SECTION("Empty vector") { constexpr TinyVector<EdgesArray, 4> tinyVector; REQUIRE(sizeof(tinyVector) == sizeof(size_t)); REQUIRE(tinyVector.size() == 0); } SECTION("Initialized vector") { TinyVector<EdgesArray, 8> tinyVector{ {EdgesArray{{0, 1}}, EdgesArray{{0, 2}}, EdgesArray{{1, 2}}}}; INFO("Hash = " + std::to_string(static_cast<size_t>(tinyVector))); REQUIRE(tinyVector.size() == 3); REQUIRE(tinyVector[0][0] == 0); REQUIRE(tinyVector[0][1] == 1); REQUIRE(tinyVector[1][0] == 0); REQUIRE(tinyVector[1][1] == 2); REQUIRE(tinyVector[2][0] == 1); REQUIRE(tinyVector[2][1] == 2); std::vector<EdgesArray> vector{ {EdgesArray{{0, 1}}, EdgesArray{{0, 2}}, EdgesArray{{1, 2}}}}; TinyVector<EdgesArray, 8> tinyVectorFromVector{vector}; REQUIRE(tinyVectorFromVector.size() == vector.size()); REQUIRE(tinyVectorFromVector[0][0] == 0); REQUIRE(tinyVectorFromVector[0][1] == 1); REQUIRE(tinyVectorFromVector[1][0] == 0); REQUIRE(tinyVectorFromVector[1][1] == 2); REQUIRE(tinyVectorFromVector[2][0] == 1); REQUIRE(tinyVectorFromVector[2][1] == 2); } } } // namespace utils::tests
31.162162
70
0.634866
[ "vector" ]
9d6514b532ac5707dc8064c1a2d9a9eec2ed4e8d
61,774
cc
C++
content/browser/prerender/prerender_browsertest.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
content/browser/prerender/prerender_browsertest.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
content/browser/prerender/prerender_browsertest.cc
Ron423c/chromium
2edf7b980065b648f8b2a6e52193d83832fe36b7
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2021-03-07T14:20:02.000Z
2021-03-07T14:20:02.000Z
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/base_switches.h" #include "base/callback_helpers.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/synchronization/lock.h" #include "base/test/scoped_feature_list.h" #include "base/thread_annotations.h" #include "build/build_config.h" #include "content/browser/file_system_access/file_system_chooser_test_helpers.h" #include "content/browser/prerender/prerender_host.h" #include "content/browser/prerender/prerender_host_registry.h" #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/storage_partition_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_document_host_user_data.h" #include "content/public/common/content_client.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" #include "content/test/test_content_browser_client.h" #include "content/test/test_mojo_binder_policy_applier_unittest.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote_set.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/browser_interface_broker.mojom.h" #include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog_factory.h" #include "url/gurl.h" namespace content { namespace { // Example class which inherits the RenderDocumentHostUserData, all the data is // associated to the lifetime of the document. class DocumentData : public RenderDocumentHostUserData<DocumentData> { public: ~DocumentData() override = default; base::WeakPtr<DocumentData> GetWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); } private: explicit DocumentData(RenderFrameHost* render_frame_host) {} friend class content::RenderDocumentHostUserData<DocumentData>; base::WeakPtrFactory<DocumentData> weak_ptr_factory_{this}; RENDER_DOCUMENT_HOST_USER_DATA_KEY_DECL(); }; RENDER_DOCUMENT_HOST_USER_DATA_KEY_IMPL(DocumentData) // TODO(https://crbug.com/1132746): There are two different ways of prerendering // the page: a dedicated WebContents instance or using a separate FrameTree // instance (MPArch). The MPArch code is still in its very early stages but will // eventually completely replace the WebContents approach. In the meantime we // should try to get all test to pass with both implementations. enum PrerenderBrowserTestType { kWebContents, kMPArch, }; std::string ToString( const testing::TestParamInfo<PrerenderBrowserTestType>& info) { switch (info.param) { case PrerenderBrowserTestType::kWebContents: return "WebContents"; case PrerenderBrowserTestType::kMPArch: return "MPArch"; } } class PrerenderHostRegistryObserver : public PrerenderHostRegistry::Observer { public: explicit PrerenderHostRegistryObserver(PrerenderHostRegistry& registry) { observation_.Observe(&registry); } // Returns immediately if `url` was ever triggered before. void WaitForTrigger(const GURL& url) { if (triggered_.contains(url)) { return; } DCHECK(!waiting_.contains(url)); base::RunLoop loop; waiting_[url] = loop.QuitClosure(); loop.Run(); } void OnTrigger(const GURL& url) override { auto iter = waiting_.find(url); if (iter != waiting_.end()) { auto callback = std::move(iter->second); waiting_.erase(iter); std::move(callback).Run(); } else { DCHECK(!triggered_.contains(url)) << "this observer doesn't yet support multiple triggers"; triggered_.insert(url); } } void OnRegistryDestroyed() override { DCHECK(waiting_.empty()); observation_.Reset(); } base::ScopedObservation<PrerenderHostRegistry, PrerenderHostRegistry::Observer> observation_{this}; base::flat_map<GURL, base::OnceClosure> waiting_; base::flat_set<GURL> triggered_; }; class PrerenderBrowserTest : public ContentBrowserTest, public testing::WithParamInterface<PrerenderBrowserTestType> { public: using LifecycleState = RenderFrameHostImpl::LifecycleState; PrerenderBrowserTest() { std::map<std::string, std::string> parameters; if (IsMPArchActive()) { parameters["implementation"] = "mparch"; } feature_list_.InitAndEnableFeatureWithParameters( blink::features::kPrerender2, parameters); } ~PrerenderBrowserTest() override = default; void SetUpOnMainThread() override { DCHECK_CURRENTLY_ON(BrowserThread::UI); host_resolver()->AddRule("*", "127.0.0.1"); ssl_server_.AddDefaultHandlers(GetTestDataFilePath()); ssl_server_.SetSSLConfig( net::test_server::EmbeddedTestServer::CERT_TEST_NAMES); ssl_server_.RegisterRequestMonitor(base::BindRepeating( &PrerenderBrowserTest::MonitorResourceRequest, base::Unretained(this))); ASSERT_TRUE(ssl_server_.Start()); } void TearDownOnMainThread() override { DCHECK_CURRENTLY_ON(BrowserThread::UI); EXPECT_TRUE(ssl_server_.ShutdownAndWaitUntilComplete()); } void MonitorResourceRequest(const net::test_server::HttpRequest& request) { // This should be called on `EmbeddedTestServer::io_thread_`. DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); base::AutoLock auto_lock(lock_); request_count_by_path_[request.GetURL().PathForRequest()]++; } PrerenderHostRegistry& GetPrerenderHostRegistry() { DCHECK_CURRENTLY_ON(BrowserThread::UI); auto* storage_partition = static_cast<StoragePartitionImpl*>( BrowserContext::GetDefaultStoragePartition( shell()->web_contents()->GetBrowserContext())); return *storage_partition->GetPrerenderHostRegistry(); } // Must only be called if the host for `prerendering_url` will be // created. void WaitForPrerenderLoadCompletion(const GURL& prerendering_url) { PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* host = registry.FindHostByUrlForTesting(prerendering_url); // Wait for the host to be created if it hasn't yet. if (!host) { PrerenderHostRegistryObserver observer(registry); observer.WaitForTrigger(prerendering_url); host = registry.FindHostByUrlForTesting(prerendering_url); ASSERT_NE(host, nullptr); } host->WaitForLoadStopForTesting(); } // Adds <link rel=prerender> in the current main frame and waits until the // completion of prerendering. void AddPrerender(const GURL& prerendering_url) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Add the link tag that will prerender the URL. EXPECT_TRUE(ExecJs(shell()->web_contents(), JsReplace("add_prerender($1)", prerendering_url))); WaitForPrerenderLoadCompletion(prerendering_url); } // Navigates to the URL and waits until the completion of navigation. // // Navigations that could activate a prerendered page on the multiple // WebContents architecture (not multiple-pages architecture known as MPArch) // should use this function instead of the NavigateToURL() test helper. This // is because the test helper accesses the predecessor WebContents to be // destroyed during activation and results in crashes. // See https://crbug.com/1154501 for the MPArch migration. void NavigateWithLocation(const GURL& url) { DCHECK_CURRENTLY_ON(BrowserThread::UI); content::TestNavigationObserver observer(shell()->web_contents()); // Ignore the result of ExecJs(). // // Depending on timing, activation could destroy the current WebContents // before ExecJs() gets a result from the frame that executed scripts. This // results in execution failure even when the execution succeeded. See // https://crbug.com/1156141 for details. // // This part will drastically be modified by the MPArch, so we take the // approach just to ignore it instead of fixing the timing issue. When // ExecJs() actually fails, the remaining test steps should fail, so it // should be safe to ignore it. ignore_result( ExecJs(shell()->web_contents(), JsReplace("location = $1", url))); observer.Wait(); } GURL GetUrl(const std::string& path) { DCHECK_CURRENTLY_ON(BrowserThread::UI); return ssl_server_.GetURL("a.test", path); } GURL GetCrossOriginUrl(const std::string& path) { DCHECK_CURRENTLY_ON(BrowserThread::UI); return ssl_server_.GetURL("b.test", path); } int GetRequestCount(const GURL& url) { DCHECK_CURRENTLY_ON(BrowserThread::UI); base::AutoLock auto_lock(lock_); return request_count_by_path_[url.PathForRequest()]; } WebContentsImpl* web_contents() const { return static_cast<WebContentsImpl*>(shell()->web_contents()); } RenderFrameHostImpl* current_frame_host() { return web_contents()->GetMainFrame(); } bool IsActivationDisabled() const { return IsMPArchActive(); } bool IsMPArchActive() const { switch (GetParam()) { case kWebContents: return false; case kMPArch: return true; } } void TestHostPrerenderingState(const GURL& prerender_url) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // The initial page should not be for prerendering. RenderFrameHostImpl* initiator_render_frame_host = static_cast<RenderFrameHostImpl*>( shell()->web_contents()->GetMainFrame()); EXPECT_FALSE(initiator_render_frame_host->frame_tree()->is_prerendering()); EXPECT_NE(initiator_render_frame_host->lifecycle_state(), LifecycleState::kPrerendering); // Start a prerender. AddPrerender(prerender_url); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(prerender_url); // Verify all RenderFrameHostImpl in the prerendered page know the // prerendering state. RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); std::vector<RenderFrameHost*> frames = prerendered_render_frame_host->GetFramesInSubtree(); for (auto* frame : frames) { auto* rfhi = static_cast<RenderFrameHostImpl*>(frame); // All the subframes should be in LifecycleState::kPrerendering state // before activation. EXPECT_EQ(rfhi->lifecycle_state(), RenderFrameHostImpl::LifecycleState::kPrerendering); EXPECT_TRUE(rfhi->frame_tree()->is_prerendering()); } // Activate the prerendered page. NavigateWithLocation(prerender_url); EXPECT_EQ(shell()->web_contents()->GetURL(), prerender_url); // The activated page should no longer be in the prerendering state. RenderFrameHostImpl* navigated_render_frame_host = static_cast<RenderFrameHostImpl*>( shell()->web_contents()->GetMainFrame()); // The new page shouldn't be in the prerendering state. frames = navigated_render_frame_host->GetFramesInSubtree(); for (auto* frame : frames) { auto* rfhi = static_cast<RenderFrameHostImpl*>(frame); // All the subframes should be transitioned to LifecycleState::kActive // state after activation. EXPECT_EQ(rfhi->lifecycle_state(), RenderFrameHostImpl::LifecycleState::kActive); EXPECT_FALSE(rfhi->frame_tree()->is_prerendering()); } } private: net::test_server::EmbeddedTestServer ssl_server_{ net::test_server::EmbeddedTestServer::TYPE_HTTPS}; // Counts of requests sent to the server. Keyed by path (not by full URL) // because the host part of the requests is translated ("a.test" to // "127.0.0.1") before the server handles them. // This is accessed from the UI thread and `EmbeddedTestServer::io_thread_`. std::map<std::string, int> request_count_by_path_ GUARDED_BY(lock_); base::test::ScopedFeatureList feature_list_; base::Lock lock_; }; INSTANTIATE_TEST_SUITE_P(All, PrerenderBrowserTest, testing::Values(kWebContents, kMPArch), ToString); IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, LinkRelPrerender) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Add <link rel=prerender> that will prerender `kPrerenderingUrl`. ASSERT_EQ(GetRequestCount(kPrerenderingUrl), 0); AddPrerender(kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); // A prerender host for the URL should be registered. PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); // The prerender host should be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again. EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); } else { // Activating the prerendered page should not issue a request. EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); } } IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, LinkRelPrerender_Multiple) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl1 = GetUrl("/empty.html?1"); const GURL kPrerenderingUrl2 = GetUrl("/empty.html?2"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Add <link rel=prerender> that will prerender `kPrerenderingUrl1` and // `kPrerenderingUrl2`. ASSERT_EQ(GetRequestCount(kPrerenderingUrl1), 0); ASSERT_EQ(GetRequestCount(kPrerenderingUrl2), 0); AddPrerender(kPrerenderingUrl1); AddPrerender(kPrerenderingUrl2); EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 1); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 1); // Prerender hosts for `kPrerenderingUrl1` and `kPrerenderingUrl2` should be // registered. PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl1), nullptr); EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl2), nullptr); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl2); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl2); // The prerender hosts should be consumed or destroyed for activation. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl1), nullptr); EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl2), nullptr); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again. EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 1); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 2); } else { // Activating the prerendered page should not issue a request. EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 1); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 1); } } IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, LinkRelPrerender_Duplicate) { const GURL kInitialUrl = GetUrl("/prerender/duplicate_prerenders.html"); const GURL kPrerenderingUrl1 = GetUrl("/empty.html?1"); const GURL kPrerenderingUrl2 = GetUrl("/empty.html?2"); // Navigate to a page that initiates prerendering for `kPrerenderingUrl1` // twice. The second prerendering request should be ignored. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Wait until the completion of prerendering. WaitForPrerenderLoadCompletion(kPrerenderingUrl1); WaitForPrerenderLoadCompletion(kPrerenderingUrl2); // Requests should be issued once per prerendering URL. EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 1); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 1); // Prerender hosts for `kPrerenderingUrl1` and `kPrerenderingUrl2` should be // registered. PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl1), nullptr); EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl2), nullptr); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl1); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl1); // The prerender hosts should be consumed or destroyed for activation. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl1), nullptr); EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl2), nullptr); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again. EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 2); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 1); } else { // Activating the prerendered page should not issue a request. EXPECT_EQ(GetRequestCount(kPrerenderingUrl1), 1); EXPECT_EQ(GetRequestCount(kPrerenderingUrl2), 1); } } IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, SameOriginRedirection) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start prerendering a URL that causes same-origin redirection. const GURL kRedirectedUrl = GetUrl("/empty.html"); const GURL kPrerenderingUrl = GetUrl("/server-redirect?" + kRedirectedUrl.spec()); AddPrerender(kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); EXPECT_EQ(GetRequestCount(kRedirectedUrl), 1); // The prerender host should be registered for the initial request URL, not // the redirected URL. PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); EXPECT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); EXPECT_FALSE(registry.FindHostByUrlForTesting(kRedirectedUrl)); } IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, CrossOriginRedirection) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start prerendering a URL that causes cross-origin redirection. const GURL kRedirectedUrl = GetCrossOriginUrl("/empty.html"); const GURL kPrerenderingUrl = GetUrl("/server-redirect?" + kRedirectedUrl.spec()); AddPrerender(kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); EXPECT_EQ(GetRequestCount(kRedirectedUrl), 1); // The prerender host should be registered for the initial request URL, not // the redirected URL. // TODO(https://crbug.com/1132746): Disallow cross-origin redirection on // prerendering navigation for the initial milestone. PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); EXPECT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); EXPECT_FALSE(registry.FindHostByUrlForTesting(kRedirectedUrl)); } // TODO(https://crbug.com/1158248): Add tests for activation with a redirected // URL. // Makes sure that activation on navigation for an iframes doesn't happen. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, Activation_iFrame) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. const GURL kPrerenderingUrl = GetUrl("/empty.html"); AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); // Attempt to activate the prerendered page for an iframe. This should fail // and fallback to network request. ASSERT_EQ(GetRequestCount(kPrerenderingUrl), 1); EXPECT_EQ("LOADED", EvalJs(shell()->web_contents(), JsReplace("add_iframe($1)", kPrerenderingUrl))); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); // Activation shouldn't happen, so the prerender host should not be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), prerender_host); } // Makes sure that activation on navigation for a pop-up window doesn't happen. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, Activation_PopUpWindow) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. const GURL kPrerenderingUrl = GetUrl("/empty.html"); AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); // Attempt to activate the prerendered page for a pop-up window. This should // fail and fallback to network request. ASSERT_EQ(GetRequestCount(kPrerenderingUrl), 1); EXPECT_EQ("LOADED", EvalJs(shell()->web_contents(), JsReplace("open_window($1)", kPrerenderingUrl))); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); // Activation shouldn't happen, so the prerender host should not be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), prerender_host); } // Makes sure that activation on navigation for a page that has a pop-up window // doesn't happen. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, Activation_PageWithPopUpWindow) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. const GURL kPrerenderingUrl = GetUrl("/empty.html?next"); AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); ASSERT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); // Open a pop-up window. const GURL kWindowUrl = GetUrl("/empty.html?window"); EXPECT_EQ("LOADED", EvalJs(shell()->web_contents(), JsReplace("open_window($1)", kWindowUrl))); // Attempt to activate the prerendered page for the top-level frame. This // should fail and fallback to network request because the pop-up window // exists. ASSERT_EQ(GetRequestCount(kPrerenderingUrl), 1); NavigateWithLocation(kPrerenderingUrl); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); // Activation shouldn't happen, so the prerender host should not be consumed. // However, we don't check the existence of the prerender host here unlike // other activation tests because navigating the frame that triggered // prerendering abandons the prerendered page regardless of activation. } // Tests that back-forward history is preserved after activation. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, HistoryAfterActivation) { // This test is only meaningful with activation. if (IsActivationDisabled()) return; const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Make and activate a prerendered page. AddPrerender(kPrerenderingUrl); NavigateWithLocation(kPrerenderingUrl); EXPECT_EQ(shell()->web_contents()->GetLastCommittedURL(), kPrerenderingUrl); // Navigate back to the initial page. content::TestNavigationObserver observer(shell()->web_contents()); shell()->GoBackOrForward(-1); observer.Wait(); EXPECT_EQ(shell()->web_contents()->GetLastCommittedURL(), kInitialUrl); } // Tests that all RenderFrameHostImpls in the prerendering page know the // prerendering state. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, PrerenderIframe) { TestHostPrerenderingState(GetUrl("/page_with_iframe.html")); } // Blank <iframe> is a special case. Tests that the blank iframe knows the // prerendering state as well. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, PrerenderBlankIframe) { TestHostPrerenderingState(GetUrl("/page_with_blank_iframe.html")); } class MojoCapabilityControlTestContentBrowserClient : public TestContentBrowserClient, mojom::TestInterfaceForDefer, mojom::TestInterfaceForGrant, mojom::TestInterfaceForCancel { public: void RegisterBrowserInterfaceBindersForFrame( RenderFrameHost* render_frame_host, mojo::BinderMapWithContext<RenderFrameHost*>* map) override { map->Add<mojom::TestInterfaceForDefer>(base::BindRepeating( &MojoCapabilityControlTestContentBrowserClient::BindDeferInterface, base::Unretained(this))); map->Add<mojom::TestInterfaceForGrant>(base::BindRepeating( &MojoCapabilityControlTestContentBrowserClient::BindGrantInterface, base::Unretained(this))); map->Add<mojom::TestInterfaceForCancel>(base::BindRepeating( &MojoCapabilityControlTestContentBrowserClient::BindCancelInterface, base::Unretained(this))); } void RegisterMojoBinderPoliciesForSameOriginPrerendering( MojoBinderPolicyMap& policy_map) override { policy_map.SetPolicy<mojom::TestInterfaceForGrant>( MojoBinderPolicy::kGrant); policy_map.SetPolicy<mojom::TestInterfaceForCancel>( MojoBinderPolicy::kCancel); } void BindDeferInterface( RenderFrameHost* render_frame_host, mojo::PendingReceiver<content::mojom::TestInterfaceForDefer> receiver) { defer_receiver_set_.Add(this, std::move(receiver)); } void BindGrantInterface( RenderFrameHost* render_frame_host, mojo::PendingReceiver<mojom::TestInterfaceForGrant> receiver) { grant_receiver_set_.Add(this, std::move(receiver)); } void BindCancelInterface( RenderFrameHost* render_frame_host, mojo::PendingReceiver<mojom::TestInterfaceForCancel> receiver) { cancel_receiver_.Bind(std::move(receiver)); } size_t GetDeferReceiverSetSize() { return defer_receiver_set_.size(); } size_t GetGrantReceiverSetSize() { return grant_receiver_set_.size(); } private: mojo::ReceiverSet<mojom::TestInterfaceForDefer> defer_receiver_set_; mojo::ReceiverSet<mojom::TestInterfaceForGrant> grant_receiver_set_; mojo::Receiver<mojom::TestInterfaceForCancel> cancel_receiver_{this}; }; // Tests that binding requests are handled according to MojoBinderPolicyMap // during prerendering. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, MojoCapabilityControl) { MojoCapabilityControlTestContentBrowserClient test_browser_client; auto* old_browser_client = SetBrowserClientForTesting(&test_browser_client); const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/page_with_iframe.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); std::vector<RenderFrameHost*> frames = prerendered_render_frame_host->GetFramesInSubtree(); mojo::RemoteSet<mojom::TestInterfaceForDefer> defer_remote_set; mojo::RemoteSet<mojom::TestInterfaceForGrant> grant_remote_set; for (auto* frame : frames) { auto* rfhi = static_cast<RenderFrameHostImpl*>(frame); EXPECT_TRUE(rfhi->frame_tree()->is_prerendering()); EXPECT_EQ(rfhi->lifecycle_state(), LifecycleState::kPrerendering); mojo::Receiver<blink::mojom::BrowserInterfaceBroker>& bib = rfhi->browser_interface_broker_receiver_for_testing(); blink::mojom::BrowserInterfaceBroker* prerender_broker = bib.internal_state()->impl(); // Try to bind a kDefer interface. mojo::Remote<mojom::TestInterfaceForDefer> prerender_defer_remote; prerender_broker->GetInterface( prerender_defer_remote.BindNewPipeAndPassReceiver()); defer_remote_set.Add(std::move(prerender_defer_remote)); // Try to bind a kGrant interface. mojo::Remote<mojom::TestInterfaceForGrant> prerender_grant_remote; prerender_broker->GetInterface( prerender_grant_remote.BindNewPipeAndPassReceiver()); grant_remote_set.Add(std::move(prerender_grant_remote)); } // Verify that BrowserInterfaceBrokerImpl defers running binders whose // policies are kDefer until the prerendered page is activated. EXPECT_EQ(test_browser_client.GetDeferReceiverSetSize(), 0U); // Verify that BrowserInterfaceBrokerImpl executes kGrant binders immediately. EXPECT_EQ(test_browser_client.GetGrantReceiverSetSize(), frames.size()); // The rest of this test is only meaningful with activation. if (IsActivationDisabled()) { SetBrowserClientForTesting(old_browser_client); return; } // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); EXPECT_EQ(test_browser_client.GetDeferReceiverSetSize(), frames.size()); SetBrowserClientForTesting(old_browser_client); } // Tests that mojo capability control will cancel prerendering if the main frame // receives a request for a kCancel interface. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, MojoCapabilityControl_CancelMainFrame) { MojoCapabilityControlTestContentBrowserClient test_browser_client; auto* old_browser_client = SetBrowserClientForTesting(&test_browser_client); const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/page_with_iframe.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); mojo::Receiver<blink::mojom::BrowserInterfaceBroker>& bib = prerendered_render_frame_host ->browser_interface_broker_receiver_for_testing(); blink::mojom::BrowserInterfaceBroker* prerender_broker = bib.internal_state()->impl(); // Send a kCancel request to cancel prerendering. EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); mojo::Remote<mojom::TestInterfaceForCancel> remote; prerender_broker->GetInterface(remote.BindNewPipeAndPassReceiver()); EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); SetBrowserClientForTesting(old_browser_client); } // Tests that mojo capability control will cancel prerendering if child frames // receive a request for a kCancel interface. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, MojoCapabilityControl_CancelIframe) { MojoCapabilityControlTestContentBrowserClient test_browser_client; auto* old_browser_client = SetBrowserClientForTesting(&test_browser_client); const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/page_with_iframe.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); RenderFrameHostImpl* main_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); ASSERT_GE(main_render_frame_host->child_count(), 1U); RenderFrameHostImpl* child_render_frame_host = main_render_frame_host->child_at(0U)->current_frame_host(); EXPECT_NE(main_render_frame_host->GetLastCommittedURL(), child_render_frame_host->GetLastCommittedURL()); mojo::Receiver<blink::mojom::BrowserInterfaceBroker>& bib = child_render_frame_host->browser_interface_broker_receiver_for_testing(); blink::mojom::BrowserInterfaceBroker* prerender_broker = bib.internal_state()->impl(); // Send a kCancel request to cancel prerendering. EXPECT_NE(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); mojo::Remote<mojom::TestInterfaceForCancel> remote; prerender_broker->GetInterface(remote.BindNewPipeAndPassReceiver()); EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); SetBrowserClientForTesting(old_browser_client); } // TODO(https://crbug.com/1132746): Test canceling prerendering when its // initiator is no longer interested in prerending this page. // TODO(https://crbug.com/1132746): Test prerendering for 404 page, auth error, // cross origin, etc. // Tests for feature restrictions in prerendered pages ========================= // - Tests for feature-specific code methodology restrictions ================== // Tests that window.open() in a prerendering page fails. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, FeatureRestriction_WindowOpen) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. const GURL kPrerenderingUrl = GetUrl("/prerender/add_prerender.html?prerendering"); AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerender_frame = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Attempt to open a window in the prerendered page. This should fail. const GURL kWindowOpenUrl = GetUrl("/empty.html"); EXPECT_EQ("FAILED", EvalJs(prerender_frame, JsReplace("open_window($1)", kWindowOpenUrl))); EXPECT_EQ(GetRequestCount(kWindowOpenUrl), 0); // Opening a window shouldn't cancel prerendering. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), prerender_host); } // Tests that Clients#matchAll() on ServiceWorkerGlobalScope exposes clients in // the prerendering state. // TODO(https://crbug.com/1166470): This can be a tentative behavior. We may // stop exposing the clients. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, FeatureRestriction_ClientsMatchAll) { // Navigate to an initial page. const GURL kInitialUrl = GetUrl("/prerender/clients_matchall.html"); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. const GURL kPrerenderingUrl = GetUrl("/empty.html"); AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); // Make sure the prerendering page is exposed via Clients#matchAll(). EvalJsResult results = EvalJs(shell()->web_contents(), "get_exposed_client_urls()"); std::vector<std::string> client_urls; for (auto& result : results.ExtractList()) client_urls.push_back(result.GetString()); EXPECT_TRUE(base::Contains(client_urls, kInitialUrl)); EXPECT_TRUE(base::Contains(client_urls, kPrerenderingUrl)); } // Tests that same-origin prerendering pages have the access to Broadcast // Channel API. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, GrantBroadcastChannel) { const GURL kInitialUrl = GetUrl("/prerender/restriction_broadcast_channel.html"); const GURL kPrerenderingUrl = GetUrl("/prerender/restriction_broadcast_channel.html?prerendering"); const std::string initial_message = "This is a message sent from the initial page"; const std::string prerender_message = "This is a message sent from the prerendering page."; // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Make a same-origin prerendering page. AddPrerender(kPrerenderingUrl); // Send a message to the channel from the initial page. EXPECT_TRUE(ExecJs(shell()->web_contents(), JsReplace("bc.postMessage($1);", initial_message))); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); ASSERT_TRUE(prerender_host); // Check the prerendering page received the message sent by the initial page. EXPECT_EQ(initial_message, EvalJs(prerendered_render_frame_host, "messageReceived;")); // Send a message to the channel from the prerendering page. EXPECT_TRUE(ExecJs(prerendered_render_frame_host, JsReplace("bc.postMessage($1);", prerender_message))); // Check the initial page received the message sent by the prerendering page. EXPECT_EQ(prerender_message, EvalJs(shell()->web_contents(), "messageReceived;")); // Disconnect from the channel. EXPECT_TRUE(ExecJs(shell()->web_contents(), "bc.close();")); EXPECT_TRUE(ExecJs(prerendered_render_frame_host, "bc.close();")); } // - End: Tests for feature-specific code methodology restrictions ============= // - Tests for Mojo capability control methodology restrictions ================ // Tests that prerendering pages can access cookies. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, CookieAccess) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Set a cookie to the origin. const std::string initial_cookie = "initial_cookie=exist"; const std::string prerender_cookie = "prerender_cookie=exist"; EvalJsResult result = EvalJs(shell()->web_contents(), "document.cookie='" + initial_cookie + "; path=/'"); EXPECT_TRUE(result.error.empty()) << result.error; // Make a prerendered page. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Verify the prerendered page can read the cookie. EXPECT_EQ(initial_cookie, EvalJs(prerendered_render_frame_host, "document.cookie")); // Verify the prerendered page can update cookies. EvalJsResult prerender_result = EvalJs(prerendered_render_frame_host, "document.cookie='" + prerender_cookie + "; path=/'"); EXPECT_TRUE(prerender_result.error.empty()) << prerender_result.error; // Read the updated cookie from the initial page. EXPECT_EQ(initial_cookie + "; " + prerender_cookie, EvalJs(shell()->web_contents(), "document.cookie")); } // Test that a cross-site navigation from prerendering browser context will // load a new page and this page will later be activated on activating the // prerendered page. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, PrerenderedPageCrossSiteNavigation) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); const GURL kCrossSitePrerenderingUrl = GetCrossOriginUrl("/title1.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); EXPECT_TRUE(ExecJs( prerendered_render_frame_host, JsReplace("window.location.href = $1", kCrossSitePrerenderingUrl))); prerender_host->WaitForLoadStopForTesting(); // The prerender host should be registered for the initial request URL, not // the navigated cross-site URL. EXPECT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); EXPECT_FALSE(registry.FindHostByUrlForTesting(kCrossSitePrerenderingUrl)); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again // pointing to kPrerenderingUrl. EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); } else { // Activating the prerendered page should point to the navigated cross-site // URL without issuing a request again. EXPECT_EQ(shell()->web_contents()->GetURL(), kCrossSitePrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); } // The prerender host should be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); } // Test that a cross-site navigation with subframes from prerendering browser // context will load a new page and this page will later be activated on // activating the prerendered page. // // This test covers the same scenario has PrerenderedPageCrossSiteNavigation, // except that the navigating URL has subframes. This shouldn't make any // difference as prerendering is a page level concept. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, PrerenderedPageCrossSiteNavigationWithSubframes) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); const GURL kCrossSitePrerenderingUrl = GetCrossOriginUrl("/cross_site_iframe_factory.html?a(b)"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Navigate cross-site from the prerendered page. EXPECT_TRUE(ExecJs( prerendered_render_frame_host, JsReplace("window.location.href = $1", kCrossSitePrerenderingUrl))); prerender_host->WaitForLoadStopForTesting(); // The prerender host should be registered for the initial request URL, not // the navigated cross-site URL. EXPECT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); EXPECT_FALSE(registry.FindHostByUrlForTesting(kCrossSitePrerenderingUrl)); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again // pointing to kPrerenderingUrl. EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); } else { // Activating the prerendered page should point to the navigated cross-site // URL without issuing a request again. EXPECT_EQ(shell()->web_contents()->GetURL(), kCrossSitePrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); } // The prerender host should be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); } // Test that a same-site navigation from prerendering browser context will // load a new page and this page will later be activated on activating the // prerendered page. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, PrerenderedPageSameSiteNavigation) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); const GURL kSameSitePrerenderingUrl = GetUrl("/title1.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Navigate same-site from the prerendered page. EXPECT_TRUE( ExecJs(prerendered_render_frame_host, JsReplace("window.location.href = $1", kSameSitePrerenderingUrl))); prerender_host->WaitForLoadStopForTesting(); // The prerender host should be registered for the initial request URL, not // the navigated same-site URL. EXPECT_TRUE(registry.FindHostByUrlForTesting(kPrerenderingUrl)); EXPECT_FALSE(registry.FindHostByUrlForTesting(kSameSitePrerenderingUrl)); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); if (IsActivationDisabled()) { // Activation is disabled. The navigation should issue a request again // pointing to kPrerenderingUrl. EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 2); } else { // Activating the prerendered page should point to the navigated same-site // URL without issuing a request again. EXPECT_EQ(shell()->web_contents()->GetURL(), kSameSitePrerenderingUrl); EXPECT_EQ(GetRequestCount(kPrerenderingUrl), 1); } // The prerender host should be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); } IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, RenderFrameHostLifecycleState) { // This test is only meaningful with activation. if (IsActivationDisabled()) return; const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/cross_site_iframe_factory.html?a(b)"); const GURL kCrossSitePrerenderingUrl = GetCrossOriginUrl("/cross_site_iframe_factory.html?c(d)"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); EXPECT_EQ(current_frame_host()->lifecycle_state(), LifecycleState::kActive); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* rfh_a = prerender_host->GetPrerenderedMainFrameHostForTesting(); RenderFrameHostImpl* rfh_b = rfh_a->child_at(0)->current_frame_host(); // Both rfh_a and rfh_b lifecycle state's should be kPrerendering. EXPECT_EQ(LifecycleState::kPrerendering, rfh_a->lifecycle_state()); EXPECT_EQ(LifecycleState::kPrerendering, rfh_b->lifecycle_state()); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Navigate cross-site from the prerendered page. EXPECT_TRUE(ExecJs( prerendered_render_frame_host, JsReplace("window.location.href = $1", kCrossSitePrerenderingUrl))); prerender_host->WaitForLoadStopForTesting(); RenderFrameHostImpl* rfh_c = prerender_host->GetPrerenderedMainFrameHostForTesting(); RenderFrameHostImpl* rfh_d = rfh_c->child_at(0)->current_frame_host(); // Both rfh_c and rfh_d lifecycle state's should be kPrerendering. EXPECT_EQ(LifecycleState::kPrerendering, rfh_c->lifecycle_state()); EXPECT_EQ(LifecycleState::kPrerendering, rfh_d->lifecycle_state()); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); // Both rfh_c and rfh_d lifecycle state's should be kActive after activation. EXPECT_EQ(LifecycleState::kActive, rfh_c->lifecycle_state()); EXPECT_EQ(LifecycleState::kActive, rfh_d->lifecycle_state()); } // Tests that prerendering pages can access local storage. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, LocalStorageAccess) { const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Add an item to local storage from the initial page. const std::string key = "set_by"; const std::string initial_value = "initial"; const std::string prerender_value = "prerender"; EvalJsResult result = EvalJs( shell()->web_contents(), JsReplace("window.localStorage.setItem($1, $2)", key, initial_value)); EXPECT_TRUE(result.error.empty()) << result.error; // Make a prerendered page. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Verify the prerendered page can read the item that the initial page wrote. EXPECT_EQ(initial_value, EvalJs(prerendered_render_frame_host, JsReplace("window.localStorage.getItem($1)", key))); // Verify the prerendered page can update local storage. EvalJsResult prerender_result = EvalJs( prerendered_render_frame_host, JsReplace("window.localStorage.setItem($1, $2)", key, prerender_value)); EXPECT_TRUE(prerender_result.error.empty()) << prerender_result.error; // Read the updated item value from the initial page. EXPECT_EQ(prerender_value, EvalJs(shell()->web_contents(), JsReplace("window.localStorage.getItem($1)", key))); } // Tests that prerendering pages can access Indexed Database. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, IndexedDBAccess) { const GURL kInitialUrl = GetUrl("/prerender/restriction_indexeddb.html"); const GURL kPrerenderingUrl = GetUrl("/prerender/restriction_indexeddb.html?prerendering"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); const std::string initial_key = "initial"; const std::string initial_value = initial_key + "_set"; const std::string prerender_key = "prerender"; const std::string prerender_value = prerender_key + "_set"; // Write an object to Indexed Database. EXPECT_EQ(true, EvalJs(shell()->web_contents(), JsReplace("addData($1, $2);", initial_key, initial_value))); // Make a prerendered page. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerender_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Verify the prerendered page can read the object that the initial page // wrote. EXPECT_EQ(initial_value, EvalJs(prerender_render_frame_host, JsReplace("readData($1);", initial_key))); // The prerendered page writes another object to Indexed Database. EXPECT_EQ(true, EvalJs(prerender_render_frame_host, JsReplace("addData($1, $2);", prerender_key, prerender_value))); // Read the added object from the initial page. EXPECT_EQ(prerender_value, EvalJs(shell()->web_contents(), JsReplace("readData($1);", prerender_key))); } class PrerenderFileSystemAccessBrowserTest : public PrerenderBrowserTest { public: void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ContentBrowserTest::SetUp(); } protected: base::ScopedTempDir temp_dir_; }; INSTANTIATE_TEST_SUITE_P(All, PrerenderFileSystemAccessBrowserTest, testing::Values(kWebContents, kMPArch), ToString); // TODO(https://crbug.com/1182032): Now File System Access API is not supported // on Android. Enable this browser test after https://crbug.com/1011535 is // fixed. #if defined(OS_ANDROID) #define MAYBE_DeferFileSystemAccess DISABLED_DeferFileSystemAccess #else #define MAYBE_DeferFileSystemAccess DeferFileSystemAccess #endif // Tests that access to local file system is deferred on prerendering pages. IN_PROC_BROWSER_TEST_P(PrerenderFileSystemAccessBrowserTest, MAYBE_DeferFileSystemAccess) { // This test is only meaningful with activation. if (IsActivationDisabled()) return; base::FilePath temp_file; { base::ScopedAllowBlockingForTesting allow_blocking; EXPECT_TRUE( base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file)); } SelectFileDialogParams dialog_params; ui::SelectFileDialog::SetFactory( new FakeSelectFileDialogFactory({temp_file}, &dialog_params)); const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/prerender/restriction_file_system.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerender_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Access `temp_file` on the prerendered page. ExecuteScriptAsync(prerender_render_frame_host, "startShowOpenFilePicker();"); // Run a event loop so the page can fail the test. EXPECT_TRUE(ExecJs(prerender_render_frame_host, "runLoop();")); // Inform the prerendered page that it will be activated and activate it. EXPECT_TRUE(ExecJs(prerender_render_frame_host, "setWillActivate();")); NavigateWithLocation(kPrerenderingUrl); // `temp_file` should be selected after `willActivate` was set to true, // otherwise the prerendered page will throw an error. EXPECT_EQ(temp_file.BaseName().AsUTF8Unsafe(), EvalJs(prerender_render_frame_host, "result;")); ui::SelectFileDialog::SetFactory(nullptr); } // Tests that RenderDocumentHostUserData object is not cleared on activating a // prerendered page. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, RenderDocumentHostUserData) { // This test is only meaningful with activation. if (IsActivationDisabled()) return; const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); ASSERT_EQ(shell()->web_contents()->GetURL(), kInitialUrl); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Get the DocumentData associated with prerender RenderFrameHost. DocumentData::CreateForCurrentDocument(prerendered_render_frame_host); base::WeakPtr<DocumentData> data = DocumentData::GetForCurrentDocument(prerendered_render_frame_host) ->GetWeakPtr(); EXPECT_TRUE(data); // Activate the prerendered page. NavigateWithLocation(kPrerenderingUrl); EXPECT_EQ(shell()->web_contents()->GetURL(), kPrerenderingUrl); // The prerender host should be consumed. EXPECT_EQ(registry.FindHostByUrlForTesting(kPrerenderingUrl), nullptr); // DocumentData associated with document shouldn't have been cleared on // activating prerendered page. base::WeakPtr<DocumentData> data_after_activation = DocumentData::GetForCurrentDocument(current_frame_host())->GetWeakPtr(); EXPECT_TRUE(data_after_activation); // Both the instances of DocumentData before and after activation should point // to the same object and make sure they aren't null. EXPECT_EQ(data_after_activation.get(), data.get()); } // - End: Tests for Mojo capability control methodology restrictions =========== // End: Tests for feature restrictions in prerendered pages ==================== // Tests that prerendering doesn't run for low-end devices. IN_PROC_BROWSER_TEST_P(PrerenderBrowserTest, LowEndDevice) { base::HistogramTester histogram_tester; const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); // Set low-end device mode. base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableLowEndDeviceMode); // Attempt to prerender. PrerenderHostRegistryObserver observer(GetPrerenderHostRegistry()); ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); EXPECT_TRUE(ExecJs(shell()->web_contents(), JsReplace("add_prerender($1)", kPrerenderingUrl))); // It should fail. observer.WaitForTrigger(kPrerenderingUrl); PrerenderHostRegistry& registry = GetPrerenderHostRegistry(); PrerenderHost* prerender_host = registry.FindHostByUrlForTesting(kPrerenderingUrl); EXPECT_FALSE(prerender_host); histogram_tester.ExpectUniqueSample( "Prerender.Experimental.PrerenderHostFinalStatus", PrerenderHost::FinalStatus::kLowEndDevice, 1); } class PrerenderWithBackForwardCacheTest : public PrerenderBrowserTest { public: PrerenderWithBackForwardCacheTest() { feature_list_.InitWithFeaturesAndParameters( /*enabled_features=*/{{features::kBackForwardCache, {{"TimeToLiveInBackForwardCacheInSeconds", "3600"}, // Prevent evictions for long running // tests. {"enable_same_site", "true"}}}}, // Allow BackForwardCache for all devices regardless of their memory. /*disabled_features=*/{features::kBackForwardCacheMemoryControls}); } private: base::test::ScopedFeatureList feature_list_; }; INSTANTIATE_TEST_SUITE_P(All, PrerenderWithBackForwardCacheTest, testing::Values(kWebContents, kMPArch), ToString); // Make sure that when a navigation commits in the prerenderer frame tree, the // old page is not stored in back/forward cache and the appropriate reason is // recorded in the metrics. IN_PROC_BROWSER_TEST_P(PrerenderWithBackForwardCacheTest, BackForwardCacheDisabled) { base::HistogramTester histogram_tester; const GURL kInitialUrl = GetUrl("/prerender/add_prerender.html"); const GURL kPrerenderingUrl = GetUrl("/empty.html"); const GURL kSameSitePrerenderingUrl = GetUrl("/title1.html"); // Navigate to an initial page. ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); // Start a prerender. AddPrerender(kPrerenderingUrl); PrerenderHost* prerender_host = GetPrerenderHostRegistry().FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); RenderFrameHostImpl* prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Navigate the Prerender page to a new URL. EXPECT_TRUE( ExecJs(prerendered_render_frame_host, JsReplace("window.location.href = $1", kSameSitePrerenderingUrl))); prerender_host->WaitForLoadStopForTesting(); prerender_host = GetPrerenderHostRegistry().FindHostByUrlForTesting(kPrerenderingUrl); ASSERT_TRUE(prerender_host); prerendered_render_frame_host = prerender_host->GetPrerenderedMainFrameHostForTesting(); // Go back. The page should not be restored from the bfcache. EXPECT_TRUE(ExecJs(prerendered_render_frame_host, "history.back();")); prerender_host->WaitForLoadStopForTesting(); // Make sure that page is not cacheable for the right reason. histogram_tester.ExpectBucketCount( "BackForwardCache.HistoryNavigationOutcome." "NotRestoredReason", base::HistogramBase::Sample(BackForwardCacheMetrics::NotRestoredReason:: kBackForwardCacheDisabledForPrerender), 1); } } // namespace } // namespace content
41.23765
80
0.7531
[ "object", "vector" ]
9d755fdf7dd8373e42d8078007bfa1e1480f71dc
1,989
hpp
C++
Include/Private/Acdb/MarkerAdapter.hpp
garmin/ActiveCaptainCommunitySDK-common
a7574a3b85b77771ceb47e5fc9a99fd31a10d47a
[ "Apache-2.0" ]
null
null
null
Include/Private/Acdb/MarkerAdapter.hpp
garmin/ActiveCaptainCommunitySDK-common
a7574a3b85b77771ceb47e5fc9a99fd31a10d47a
[ "Apache-2.0" ]
null
null
null
Include/Private/Acdb/MarkerAdapter.hpp
garmin/ActiveCaptainCommunitySDK-common
a7574a3b85b77771ceb47e5fc9a99fd31a10d47a
[ "Apache-2.0" ]
null
null
null
/*------------------------------------------------------------------------------ Copyright 2021 Garmin Ltd. or its subsidiaries. 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. ------------------------------------------------------------------------------*/ /** @file Translation layer for retrieving/storing marker data from/to the database. Copyright 2017-2020 by Garmin Ltd. or its subsidiaries. */ #ifndef ACDB_MarkerAdapter_hpp #define ACDB_MarkerAdapter_hpp #include <vector> #include "Acdb/Queries/MarkerQuery.hpp" #include "Acdb/Queries/SearchMarkerQuery.hpp" #include "Acdb/Queries/ReviewSummaryQuery.hpp" #include "Acdb/MapMarkerFilter.hpp" #include "Acdb/SearchMarkerFilter.hpp" #include "Acdb/PrvTypes.hpp" #include "Acdb/PubTypes.hpp" namespace Acdb { class MarkerAdapter { public: MarkerAdapter(SQLite::Database& aDatabase); float GetAverageStars(const ACDB_marker_idx_type aIdx); IMapMarkerPtr GetMapMarker(const ACDB_marker_idx_type aIdx); void GetMapMarkersByFilter(const MapMarkerFilter& aFilter, std::vector<IMapMarkerPtr>& aResults); ISearchMarkerPtr GetSearchMarker(const ACDB_marker_idx_type aIdx); void GetSearchMarkersByFilter(const SearchMarkerFilter& aFilter, std::vector<ISearchMarkerPtr>& aResults); private: MarkerQuery mMarker; SearchMarkerQuery mSearchMarker; ReviewSummaryQuery mReviewSummary; }; // end of class MarkerAdapter } // end of namespace Acdb #endif // end of ACDB_MarkerAdapter_hpp
31.078125
99
0.713424
[ "vector" ]
9d7757e0b7eb480e3b23081c11f4cadc3b013f52
987
hpp
C++
dinky2d/Label.hpp
dongyanyan/cocosOpenGL
9fb50608de431d10888dfe06160e735d17b42657
[ "MIT" ]
35
2017-07-16T08:22:36.000Z
2022-02-25T12:13:51.000Z
dinky2d/Label.hpp
dongyanyan/cocosOpenGL
9fb50608de431d10888dfe06160e735d17b42657
[ "MIT" ]
null
null
null
dinky2d/Label.hpp
dongyanyan/cocosOpenGL
9fb50608de431d10888dfe06160e735d17b42657
[ "MIT" ]
16
2017-08-03T07:23:31.000Z
2022-02-23T07:10:59.000Z
// // Label.hpp // dinky2d // // Created by Vincent Yao on 2017/8/9. // Copyright © 2017年 ookcode. All rights reserved. // #ifndef Label_hpp #define Label_hpp #include "Node.hpp" #include <ft2build.h> #include <ftglyph.h> namespace Dinky { class Label : public Node { public: Label(const std::string& text, int fontSize, std::string font = ""); virtual ~Label() override; virtual void updateVertices() override; virtual void draw(Renderer* renderer, glm::mat4 &transform) override; void setFontSize(int fontSize); void setText(const std::string& text); void setFont(const std::string& font); private: void refresh(); Triangles _triangles; GLuint _texture = 0; FT_Face _face; FT_Library _ft; std::string _text; std::string _font; bool _isDirty = false; int _fontSize = 0; }; } #endif /* Label_hpp */
22.431818
77
0.590679
[ "transform" ]
9d7d354341a4745f3e2e4774a88d97ae6d850b5f
1,696
cpp
C++
Background.cpp
Risist/OpenGlArkanoid
c933aa1d059f900dac3f9d36f6c6cabbb4bcadbe
[ "MIT" ]
null
null
null
Background.cpp
Risist/OpenGlArkanoid
c933aa1d059f900dac3f9d36f6c6cabbb4bcadbe
[ "MIT" ]
null
null
null
Background.cpp
Risist/OpenGlArkanoid
c933aa1d059f900dac3f9d36f6c6cabbb4bcadbe
[ "MIT" ]
null
null
null
#include "Background.h" void Background::Init() { static const int sizeX = 19; static const int sizeY = 19; glm::vec3 color{ 0.25f, 0.35f, 0.8f }; color *= 0.25f; Rendering::Vertex v[sizeY][10*sizeX]; transform.scale *= 0.05; for (int i = 0; i < sizeY; ++i) { for (int j = 0; j < sizeX; ++j) { glm::vec2 offset{ 2 * j - sizeX + 1, 2 * i - sizeY + 1 }; v[i][10 * j] = { offset + glm::vec2{ -1,-1 }, color }; v[i][10 * j + 1] = { offset + glm::vec2{ 1, 1 }, color }; v[i][10 * j + 2] = { offset + glm::vec2{ -1, 1 }, color }; v[i][10 * j + 3] = { offset + glm::vec2{ 1, 1 }, color }; v[i][10 * j + 4] = { offset + glm::vec2{ -1,-1 }, color }; v[i][10 * j + 5] = { offset + glm::vec2{ 1,-1 }, color }; v[i][10 * j + 6] = { offset + glm::vec2{ -1,-1 }, color }; v[i][10 * j + 7] = { offset + glm::vec2{ -1, 1 }, color }; v[i][10 * j + 8] = { offset + glm::vec2{ 1,-1 }, color }; v[i][10 * j + 9] = { offset + glm::vec2{ 1, 1 }, color }; } } InitModel((Rendering::Vertex*)v, sizeof(v)/sizeof(Rendering::Vertex)/2); } void Background::FixedStep() { renderer.material.SetUniformMat3fv("mvp", transform.GetMatrix()); renderer.Display(); } void Background::OnPause() { renderer.material.SetUniformMat3fv("mvp", transform.GetMatrix()); renderer.Display(); } void Background::InitModel(Rendering::Vertex* v, unsigned int nV) { renderer.Init(); renderer.material.InitProgramFromFile("BasicShader.vert", "BasicShader.frag"); renderer.GenerateVertexBuffer(v, nV * 2); renderer.material.Bind(); renderer.layout.AddLayoutElemFloat("position", 2); renderer.layout.AddLayoutElemFloat("color", 3); renderer.ApplyLayout(); }
26.920635
79
0.581368
[ "transform" ]
9d8326e12ddd07059e55c82247797f1ced3a598d
535
cpp
C++
21-30/027 RemoveElement/RemoveElement.cpp
tiandaochouqin1/leetcode
9dcfc1aafd4dcf2e2a7cb0fa84677b59d7d34430
[ "Apache-2.0" ]
1
2021-04-17T17:32:56.000Z
2021-04-17T17:32:56.000Z
21-30/027 RemoveElement/RemoveElement.cpp
tiandaochouqin1/leetcode
9dcfc1aafd4dcf2e2a7cb0fa84677b59d7d34430
[ "Apache-2.0" ]
null
null
null
21-30/027 RemoveElement/RemoveElement.cpp
tiandaochouqin1/leetcode
9dcfc1aafd4dcf2e2a7cb0fa84677b59d7d34430
[ "Apache-2.0" ]
null
null
null
#include <iostream> #include <vector> using namespace std; class Solution { public: int RemoveElement(vector<int> &nums,int k) { int size=0; for (size_t i = 0; i < nums.size(); ++i) if (nums[i]!=k) nums[size++]=nums[i]; return size; } }; int main() { Solution s; vector<int> vec{1,2,3,4,5,5,5,6,7}; int a =s.RemoveElement(vec,5); cout<<a<<endl; for (size_t i = 0; i < a-1; ++i) cout<<vec[i]<<"->"; cout<<vec[a-1]<<endl; return 1; }
18.448276
48
0.500935
[ "vector" ]
9d8cdb745e47d68b54eaf843fa3098d23ecfee1c
2,304
cpp
C++
services/applypatch/command.cpp
openharmony-gitee-mirror/update_updater
72393623a6aa9d08346da98433bb3bdbe5f07120
[ "Apache-2.0" ]
null
null
null
services/applypatch/command.cpp
openharmony-gitee-mirror/update_updater
72393623a6aa9d08346da98433bb3bdbe5f07120
[ "Apache-2.0" ]
null
null
null
services/applypatch/command.cpp
openharmony-gitee-mirror/update_updater
72393623a6aa9d08346da98433bb3bdbe5f07120
[ "Apache-2.0" ]
1
2021-09-13T12:07:24.000Z
2021-09-13T12:07:24.000Z
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "applypatch/command.h" #include <cstdio> #include <vector> #include "applypatch/block_set.h" #include "log/log.h" #include "utils.h" namespace updater { bool Command::Init(const std::string &cmdLine) { cmdLine_ = std::move(cmdLine); tokens_.clear(); tokens_ = utils::SplitString(cmdLine_, " "); type_ = ParseCommandType(tokens_[H_ZERO_NUMBER]); return true; } Command::~Command() { fd_.reset(); } CommandType Command::GetCommandType() const { return type_; } std::string Command::GetArgumentByPos(size_t pos) const { if (pos >= tokens_.size()) { return ""; } return tokens_[pos]; } std::string Command::GetCommandLine() const { return cmdLine_; } void Command::SetFileDescriptor(int fd) { fd_ = std::make_unique<int>(fd); } int Command::GetFileDescriptor() const { return *fd_; } CommandType Command::ParseCommandType(const std::string &firstCmd) { if (firstCmd == "abort") { return CommandType::ABORT; } else if (firstCmd == "bsdiff") { return CommandType::BSDIFF; } else if (firstCmd == "erase") { return CommandType::ERASE; } else if (firstCmd == "free") { return CommandType::FREE; } else if (firstCmd == "pkgdiff") { return CommandType::IMGDIFF; } else if (firstCmd == "move") { return CommandType::MOVE; } else if (firstCmd == "new") { return CommandType::NEW; } else if (firstCmd == "stash") { return CommandType::STASH; } else if (firstCmd == "zero") { return CommandType::ZERO; } return CommandType::LAST; } }
25.88764
76
0.632378
[ "vector" ]
9d8fdd01a01db13ba9e1671f18297dbe8c046224
3,100
hpp
C++
wave_optimization/include/wave/optimization/ceres/ba.hpp
wavelab/wavelib
7bebff52859c8b77f088e39913223904988c141e
[ "MIT" ]
80
2017-03-12T18:57:33.000Z
2022-03-30T11:44:33.000Z
wave_optimization/include/wave/optimization/ceres/ba.hpp
wavelab/wavelib
7bebff52859c8b77f088e39913223904988c141e
[ "MIT" ]
210
2017-03-13T15:01:34.000Z
2022-01-15T03:19:44.000Z
wave_optimization/include/wave/optimization/ceres/ba.hpp
wavelab/wavelib
7bebff52859c8b77f088e39913223904988c141e
[ "MIT" ]
31
2017-08-14T16:54:52.000Z
2022-01-21T06:44:16.000Z
#ifndef WAVE_OPTIMIZATION_CERES_BA_HPP #define WAVE_OPTIMIZATION_CERES_BA_HPP #include <typeinfo> #include <ceres/ceres.h> #include "wave/utils/utils.hpp" #include "wave/vision/utils.hpp" #include "wave/vision/dataset/VoDataset.hpp" namespace wave { /** Bundle Adjustment Residual */ struct BAResidual { public: double fx; double fy; double cx; double cy; double x; double y; BAResidual() : fx(0.0), fy(0.0), cx(0.0), cy(0.0), x(0.0), y(0.0) {} BAResidual(Mat3 K, Vec2 x) : fx(K(0, 0)), fy(K(1, 1)), cx(K(0, 2)), cy(K(1, 2)), x(x(0)), y(x(1)) {} /** * Calculate Bundle Adjustment Residual * * @param q_GC Camera rotation parameterized with a quaternion (x, y, z, w) * @param G_p_GC Camera position in the world frame * @param G_p_GF Feature (landmark) position in the world frame * @param residual Calculated residual * * Note the camera frame is a right handed frame with origin at the centre * of the image plane, and z axis along the camera's optical axis -- that * is, the standard convention. See Scaramuzza and Fraundorfer's visual * odometry tutorial, 2011. **/ template <typename T> bool operator()(const T *const q_GC, const T *const G_p_GC, const T *const G_p_GF, T *residual) const { // build camera intrinsics matrix K Eigen::Matrix<T, 3, 3> K; K(0, 0) = T(this->fx); K(0, 1) = T(0.0); K(0, 2) = T(this->cx); K(1, 0) = T(0.0); K(1, 1) = T(this->fy); K(1, 2) = T(this->cy); K(2, 0) = T(0.0); K(2, 1) = T(0.0); K(2, 2) = T(1.0); // build rotation matrix from quaternion q = (w, x, y, z) Eigen::Map<const Eigen::Quaternion<T>> q{q_GC}; Eigen::Matrix<T, 3, 3> R_GC = q.matrix(); // build translation vector Eigen::Matrix<T, 3, 1> C{G_p_GC}; // build world_point vector Eigen::Matrix<T, 3, 1> X{G_p_GF}; // Note we construct the vectors above by *copying* from the buffer. // It would be more efficient to use Maps, but pinholeProject would // have to be changed to accept them. // get measurement Eigen::Matrix<T, 2, 1> est_pixel; pinholeProject(K, R_GC, C, X, est_pixel); // calculate residual error // diff between measured and estimated projection point residual[0] = T(this->x) - est_pixel(0); residual[1] = T(this->y) - est_pixel(1); return true; } }; class BundleAdjustment { public: ceres::Problem problem; ceres::Solver::Options options; ceres::Solver::Summary summary; BundleAdjustment() {} int addCamera(const Mat3 &K, const MatX &features, const std::vector<LandmarkId> &landmark_ids, double *cam_t, double *cam_q, LandmarkMap &landmarks); int solve(); }; } // namespace wave #endif
27.192982
79
0.560968
[ "vector" ]
9d91bd4a04ac9fe562ebe1264c9fe456407c7964
2,562
cpp
C++
Modules/planning/FastPlanner/traj_utils/src/planning_visualization.cpp
473867143/Prometheus
df1e1b0d861490223ac8b94d8cc4796537172292
[ "BSD-3-Clause" ]
1,217
2020-07-02T13:15:18.000Z
2022-03-31T06:17:44.000Z
Modules/planning/FastPlanner/traj_utils/src/planning_visualization.cpp
473867143/Prometheus
df1e1b0d861490223ac8b94d8cc4796537172292
[ "BSD-3-Clause" ]
167
2020-07-12T15:35:43.000Z
2022-03-31T11:57:40.000Z
Modules/planning/FastPlanner/traj_utils/src/planning_visualization.cpp
473867143/Prometheus
df1e1b0d861490223ac8b94d8cc4796537172292
[ "BSD-3-Clause" ]
270
2020-07-02T13:28:00.000Z
2022-03-28T05:43:08.000Z
#include <traj_utils/planning_visualization.h> using std::cout; using std::endl; namespace dyn_planner { PlanningVisualization::PlanningVisualization(ros::NodeHandle& nh) { node = nh; traj_pub = node.advertise<visualization_msgs::Marker>("/planning_vis/trajectory", 10); } void PlanningVisualization::displaySphereList(vector<Eigen::Vector3d> list, double resolution, Eigen::Vector4d color, int id) { visualization_msgs::Marker mk; mk.header.frame_id = "world"; mk.header.stamp = ros::Time::now(); mk.type = visualization_msgs::Marker::SPHERE_LIST; mk.action = visualization_msgs::Marker::DELETE; mk.id = id; traj_pub.publish(mk); mk.action = visualization_msgs::Marker::ADD; mk.pose.orientation.x = 0.0, mk.pose.orientation.y = 0.0, mk.pose.orientation.z = 0.0, mk.pose.orientation.w = 1.0; mk.color.r = color(0), mk.color.g = color(1), mk.color.b = color(2), mk.color.a = color(3); mk.scale.x = resolution, mk.scale.y = resolution, mk.scale.z = resolution; geometry_msgs::Point pt; for (int i = 0; i < int(list.size()); i++) { pt.x = list[i](0), pt.y = list[i](1), pt.z = list[i](2); mk.points.push_back(pt); } traj_pub.publish(mk); } void PlanningVisualization::drawBspline(NonUniformBspline bspline, double size, Eigen::Vector4d color, bool show_ctrl_pts, double size2, Eigen::Vector4d color2, int id1, int id2) { vector<Eigen::Vector3d> traj_pts; double tm, tmp; bspline.getTimeSpan(tm, tmp); for (double t = tm; t <= tmp; t += 0.01) { Eigen::Vector3d pt = bspline.evaluateDeBoor(t); traj_pts.push_back(pt); } displaySphereList(traj_pts, size, color, BSPLINE + id1 % 100); // draw the control point if (!show_ctrl_pts) return; Eigen::MatrixXd ctrl_pts = bspline.getControlPoint(); vector<Eigen::Vector3d> ctp; for (int i = 0; i < int(ctrl_pts.rows()); ++i) { Eigen::Vector3d pt = ctrl_pts.row(i).transpose(); ctp.push_back(pt); } displaySphereList(ctp, size2, color2, BSPLINE_CTRL_PT + id2 % 100); } void PlanningVisualization::drawGoal(Eigen::Vector3d goal, double resolution, Eigen::Vector4d color, int id) { vector<Eigen::Vector3d> goal_vec = { goal }; displaySphereList(goal_vec, resolution, color, GOAL + id % 100); } void PlanningVisualization::drawPath(vector<Eigen::Vector3d> path, double resolution, Eigen::Vector4d color, int id) { displaySphereList(path, resolution, color, PATH + id % 100); } // PlanningVisualization:: } // namespace dyn_planner
32.43038
117
0.676815
[ "vector" ]
9d93bdb9d94d59f7a9fcb54a4b3b4501cfd19a5a
4,982
cpp
C++
libs/full/naming_base/src/id_type.cpp
bhumitattarde/hpx
5b34d8d77b1664fa552445d44cd98e51dc69a74a
[ "BSL-1.0" ]
1
2022-02-08T05:55:09.000Z
2022-02-08T05:55:09.000Z
libs/full/naming_base/src/id_type.cpp
deepaksuresh1411/hpx
aa18024d35fe9884a977d4b6076c764dbb8b26d1
[ "BSL-1.0" ]
null
null
null
libs/full/naming_base/src/id_type.cpp
deepaksuresh1411/hpx
aa18024d35fe9884a977d4b6076c764dbb8b26d1
[ "BSL-1.0" ]
null
null
null
// Copyright (c) 2007-2022 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // 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 <hpx/config.hpp> #include <hpx/assert.hpp> #include <hpx/modules/memory.hpp> #include <hpx/naming_base/id_type.hpp> #include <ostream> #include <vector> /////////////////////////////////////////////////////////////////////////////// namespace hpx { /////////////////////////////////////////////////////////////////////////// namespace naming::detail { util::internal_allocator<id_type_impl> id_type_impl::alloc_; id_type_impl::deleter_type id_type_impl::get_deleter( hpx::id_type::management_type t) noexcept { switch (t) { case hpx::id_type::management_type::unmanaged: return &detail::gid_unmanaged_deleter; case hpx::id_type::management_type::managed: [[fallthrough]]; case hpx::id_type::management_type::managed_move_credit: return &detail::gid_managed_deleter; default: HPX_ASSERT(false); // invalid management type return &detail::gid_unmanaged_deleter; } return nullptr; } // support functions for hpx::intrusive_ptr void intrusive_ptr_add_ref(id_type_impl* p) noexcept { ++p->count_; } void intrusive_ptr_release(id_type_impl* p) noexcept { if (0 == --p->count_) { id_type_impl::get_deleter(p->get_management_type())(p); } } } // namespace naming::detail /////////////////////////////////////////////////////////////////////////// id_type& id_type::operator++() // pre-increment { ++(*gid_); return *this; } id_type id_type::operator++(int) // post-increment { return id_type((*gid_)++, management_type::unmanaged); } // comparison is required as well bool operator==(id_type const& lhs, id_type const& rhs) noexcept { if (!lhs) { return !rhs; } if (!rhs) { return !lhs; } return *lhs.gid_ == *rhs.gid_; } bool operator<(id_type const& lhs, id_type const& rhs) noexcept { // LHS is null, rhs is not. if (!lhs && rhs) { return true; } // RHS is null. if (!rhs) { return false; } return *lhs.gid_ < *rhs.gid_; } std::ostream& operator<<(std::ostream& os, id_type const& id) { if (!id) { os << "{invalid}"; } else { os << id.get_gid(); } return os; } } // namespace hpx namespace hpx::naming { /////////////////////////////////////////////////////////////////////////// inline constexpr char const* const management_type_names[] = { "management_type::unknown_deleter", // -1 "management_type::unmanaged", // 0 "management_type::managed", // 1 "management_type::managed_move_credit" // 2 }; char const* get_management_type_name( hpx::id_type::management_type m) noexcept { if (m < hpx::id_type::management_type::unknown_deleter || m > hpx::id_type::management_type::managed_move_credit) { return "invalid"; } return management_type_names[static_cast<int>(m) + 1]; } } // namespace hpx::naming /////////////////////////////////////////////////////////////////////////////// namespace hpx { namespace traits { hpx::id_type get_remote_result<hpx::id_type, naming::gid_type>::call( naming::gid_type const& rhs) { bool has_credits = naming::detail::has_credits(rhs); return hpx::id_type(rhs, has_credits ? hpx::id_type::management_type::managed : hpx::id_type::management_type::unmanaged); } // we need to specialize this template to allow for automatic conversion of // the vector<naming::gid_type> to a vector<hpx::id_type> std::vector<hpx::id_type> get_remote_result<std::vector<hpx::id_type>, std::vector<naming::gid_type>>:: call(std::vector<naming::gid_type> const& rhs) { std::vector<hpx::id_type> result; result.reserve(rhs.size()); for (naming::gid_type const& r : rhs) { bool has_credits = naming::detail::has_credits(r); result.push_back(hpx::id_type(r, has_credits ? hpx::id_type::management_type::managed : hpx::id_type::management_type::unmanaged)); } return result; } }} // namespace hpx::traits
30.193939
80
0.511642
[ "vector" ]
9d9c9f373b767ad9c6a0bc8963f4ace1cc0558c7
12,465
cc
C++
OpenVDB/include/openvdb/unittest/TestPointMask.cc
Vsevolod1983/RadeonProRenderSharedComponents
d9e34611e1148234afa48de4509afb72e1af138a
[ "BSL-1.0", "Apache-2.0", "MIT" ]
62
2022-02-04T10:34:29.000Z
2022-03-31T19:41:20.000Z
OpenVDB/include/openvdb/unittest/TestPointMask.cc
Vsevolod1983/RadeonProRenderSharedComponents
d9e34611e1148234afa48de4509afb72e1af138a
[ "BSL-1.0", "Apache-2.0", "MIT" ]
1
2021-03-11T16:26:01.000Z
2021-03-11T16:26:01.000Z
OpenVDB/include/openvdb/unittest/TestPointMask.cc
Vsevolod1983/RadeonProRenderSharedComponents
d9e34611e1148234afa48de4509afb72e1af138a
[ "BSL-1.0", "Apache-2.0", "MIT" ]
8
2020-05-13T15:46:11.000Z
2021-12-02T16:11:18.000Z
// Copyright Contributors to the OpenVDB Project // SPDX-License-Identifier: MPL-2.0 #include <cppunit/extensions/HelperMacros.h> #include <openvdb/openvdb.h> #include <openvdb/points/PointDataGrid.h> #include <openvdb/points/PointConversion.h> #include <openvdb/points/PointMask.h> #include <algorithm> #include <string> #include <vector> using namespace openvdb; using namespace openvdb::points; class TestPointMask: public CppUnit::TestCase { public: void setUp() override { openvdb::initialize(); } void tearDown() override { openvdb::uninitialize(); } CPPUNIT_TEST_SUITE(TestPointMask); CPPUNIT_TEST(testMask); CPPUNIT_TEST(testMaskDeformer); CPPUNIT_TEST_SUITE_END(); void testMask(); void testMaskDeformer(); }; // class TestPointMask void TestPointMask::testMask() { std::vector<Vec3s> positions = { {1, 1, 1}, {1, 5, 1}, {2, 1, 1}, {2, 2, 1}, }; const PointAttributeVector<Vec3s> pointList(positions); const float voxelSize = 0.1f; openvdb::math::Transform::Ptr transform( openvdb::math::Transform::createLinearTransform(voxelSize)); tools::PointIndexGrid::Ptr pointIndexGrid = tools::createPointIndexGrid<tools::PointIndexGrid>(pointList, *transform); PointDataGrid::Ptr points = createPointDataGrid<NullCodec, PointDataGrid>(*pointIndexGrid, pointList, *transform); { // simple topology copy auto mask = convertPointsToMask(*points); CPPUNIT_ASSERT_EQUAL(points->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(4)); } { // mask grid instead of bool grid auto mask = convertPointsToMask<PointDataGrid, MaskGrid>(*points); CPPUNIT_ASSERT_EQUAL(points->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(4)); } { // identical transform auto mask = convertPointsToMask(*points, *transform); CPPUNIT_ASSERT_EQUAL(points->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(4)); } // assign point 3 to new group "test" appendGroup(points->tree(), "test"); std::vector<short> groups{0,0,1,0}; setGroup(points->tree(), pointIndexGrid->tree(), groups, "test"); std::vector<std::string> includeGroups{"test"}; std::vector<std::string> excludeGroups; { // convert in turn "test" and not "test" MultiGroupFilter filter(includeGroups, excludeGroups, points->tree().cbeginLeaf()->attributeSet()); auto mask = convertPointsToMask(*points, filter); CPPUNIT_ASSERT_EQUAL(points->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(1)); MultiGroupFilter filter2(excludeGroups, includeGroups, points->tree().cbeginLeaf()->attributeSet()); mask = convertPointsToMask(*points, filter2); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(3)); } { // use a much larger voxel size that splits the points into two regions const float newVoxelSize(4); openvdb::math::Transform::Ptr newTransform( openvdb::math::Transform::createLinearTransform(newVoxelSize)); auto mask = convertPointsToMask(*points, *newTransform); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(2)); MultiGroupFilter filter(includeGroups, excludeGroups, points->tree().cbeginLeaf()->attributeSet()); mask = convertPointsToMask(*points, *newTransform, filter); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(1)); MultiGroupFilter filter2(excludeGroups, includeGroups, points->tree().cbeginLeaf()->attributeSet()); mask = convertPointsToMask(*points, *newTransform, filter2); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(2)); } } struct StaticVoxelDeformer { StaticVoxelDeformer(const Vec3d& position) : mPosition(position) { } template <typename LeafT> void reset(LeafT& /*leaf*/, size_t /*idx*/) { } template <typename IterT> void apply(Vec3d& position, IterT&) const { position = mPosition; } private: Vec3d mPosition; }; template <bool WorldSpace = true> struct YOffsetDeformer { YOffsetDeformer(const Vec3d& offset) : mOffset(offset) { } template <typename LeafT> void reset(LeafT& /*leaf*/, size_t /*idx*/) { } template <typename IterT> void apply(Vec3d& position, IterT&) const { position += mOffset; } Vec3d mOffset; }; namespace openvdb { OPENVDB_USE_VERSION_NAMESPACE namespace OPENVDB_VERSION_NAME { namespace points { // configure both voxel deformers to be applied in index-space template<> struct DeformerTraits<StaticVoxelDeformer> { static const bool IndexSpace = true; }; template<> struct DeformerTraits<YOffsetDeformer<false>> { static const bool IndexSpace = true; }; } // namespace points } // namespace OPENVDB_VERSION_NAME } // namespace openvdb void TestPointMask::testMaskDeformer() { // This test validates internal functionality that is used in various applications, such as // building masks and producing count grids. Note that by convention, methods that live // in an "internal" namespace are typically not promoted as part of the public API // and thus do not receive the same level of rigour in avoiding breaking API changes. std::vector<Vec3s> positions = { {1, 1, 1}, {1, 5, 1}, {2, 1, 1}, {2, 2, 1}, }; const PointAttributeVector<Vec3s> pointList(positions); const float voxelSize = 0.1f; openvdb::math::Transform::Ptr transform( openvdb::math::Transform::createLinearTransform(voxelSize)); tools::PointIndexGrid::Ptr pointIndexGrid = tools::createPointIndexGrid<tools::PointIndexGrid>(pointList, *transform); PointDataGrid::Ptr points = createPointDataGrid<NullCodec, PointDataGrid>(*pointIndexGrid, pointList, *transform); // assign point 3 to new group "test" appendGroup(points->tree(), "test"); std::vector<short> groups{0,0,1,0}; setGroup(points->tree(), pointIndexGrid->tree(), groups, "test"); NullFilter nullFilter; { // null deformer NullDeformer deformer; auto mask = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *transform, nullFilter, deformer); auto mask2 = convertPointsToMask(*points); CPPUNIT_ASSERT_EQUAL(points->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT(mask->tree().hasSameTopology(mask2->tree())); CPPUNIT_ASSERT(mask->tree().hasSameTopology(points->tree())); } { // static voxel deformer // collapse all points into a random voxel at (9, 13, 106) StaticVoxelDeformer deformer(Vec3d(9, 13, 106)); auto mask = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *transform, nullFilter, deformer); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(1)); CPPUNIT_ASSERT(!mask->tree().cbeginLeaf()->isValueOn(Coord(9, 13, 105))); CPPUNIT_ASSERT(mask->tree().cbeginLeaf()->isValueOn(Coord(9, 13, 106))); } { // +y offset deformer Vec3d offset(0, 41.7, 0); YOffsetDeformer</*world-space*/false> deformer(offset); auto mask = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *transform, nullFilter, deformer); // (repeat with deformer configured as world-space) YOffsetDeformer</*world-space*/true> deformerWS(offset * voxelSize); auto maskWS = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *transform, nullFilter, deformerWS); CPPUNIT_ASSERT_EQUAL(mask->tree().activeVoxelCount(), Index64(4)); CPPUNIT_ASSERT_EQUAL(maskWS->tree().activeVoxelCount(), Index64(4)); std::vector<Coord> maskVoxels; std::vector<Coord> maskVoxelsWS; std::vector<Coord> pointVoxels; for (auto leaf = mask->tree().cbeginLeaf(); leaf; ++leaf) { for (auto iter = leaf->cbeginValueOn(); iter; ++iter) { maskVoxels.emplace_back(iter.getCoord()); } } for (auto leaf = maskWS->tree().cbeginLeaf(); leaf; ++leaf) { for (auto iter = leaf->cbeginValueOn(); iter; ++iter) { maskVoxelsWS.emplace_back(iter.getCoord()); } } for (auto leaf = points->tree().cbeginLeaf(); leaf; ++leaf) { for (auto iter = leaf->cbeginValueOn(); iter; ++iter) { pointVoxels.emplace_back(iter.getCoord()); } } std::sort(maskVoxels.begin(), maskVoxels.end()); std::sort(maskVoxelsWS.begin(), maskVoxelsWS.end()); std::sort(pointVoxels.begin(), pointVoxels.end()); CPPUNIT_ASSERT_EQUAL(maskVoxels.size(), size_t(4)); CPPUNIT_ASSERT_EQUAL(maskVoxelsWS.size(), size_t(4)); CPPUNIT_ASSERT_EQUAL(pointVoxels.size(), size_t(4)); for (int i = 0; i < int(pointVoxels.size()); i++) { Coord newCoord(pointVoxels[i]); newCoord.x() = static_cast<Int32>(newCoord.x() + offset.x()); newCoord.y() = static_cast<Int32>(math::Round(newCoord.y() + offset.y())); newCoord.z() = static_cast<Int32>(newCoord.z() + offset.z()); CPPUNIT_ASSERT_EQUAL(maskVoxels[i], newCoord); CPPUNIT_ASSERT_EQUAL(maskVoxelsWS[i], newCoord); } // use a different transform to verify deformers and transforms can be used together const float newVoxelSize = 0.02f; openvdb::math::Transform::Ptr newTransform( openvdb::math::Transform::createLinearTransform(newVoxelSize)); auto mask2 = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *newTransform, nullFilter, deformer); CPPUNIT_ASSERT_EQUAL(mask2->tree().activeVoxelCount(), Index64(4)); std::vector<Coord> maskVoxels2; for (auto leaf = mask2->tree().cbeginLeaf(); leaf; ++leaf) { for (auto iter = leaf->cbeginValueOn(); iter; ++iter) { maskVoxels2.emplace_back(iter.getCoord()); } } std::sort(maskVoxels2.begin(), maskVoxels2.end()); for (int i = 0; i < int(maskVoxels.size()); i++) { Coord newCoord(pointVoxels[i]); newCoord.x() = static_cast<Int32>((newCoord.x() + offset.x()) * 5); newCoord.y() = static_cast<Int32>(math::Round((newCoord.y() + offset.y()) * 5)); newCoord.z() = static_cast<Int32>((newCoord.z() + offset.z()) * 5); CPPUNIT_ASSERT_EQUAL(maskVoxels2[i], newCoord); } // only use points in group "test" std::vector<std::string> includeGroups{"test"}; std::vector<std::string> excludeGroups; MultiGroupFilter filter(includeGroups, excludeGroups, points->tree().cbeginLeaf()->attributeSet()); auto mask3 = point_mask_internal::convertPointsToScalar<MaskGrid>( *points, *transform, filter, deformer); CPPUNIT_ASSERT_EQUAL(mask3->tree().activeVoxelCount(), Index64(1)); for (auto leaf = mask3->tree().cbeginLeaf(); leaf; ++leaf) { for (auto iter = leaf->cbeginValueOn(); iter; ++iter) { Coord newCoord(pointVoxels[2]); newCoord.x() = static_cast<Int32>(newCoord.x() + offset.x()); newCoord.y() = static_cast<Int32>(math::Round(newCoord.y() + offset.y())); newCoord.z() = static_cast<Int32>(newCoord.z() + offset.z()); CPPUNIT_ASSERT_EQUAL(iter.getCoord(), newCoord); } } } } CPPUNIT_TEST_SUITE_REGISTRATION(TestPointMask);
35.311615
95
0.622383
[ "vector", "transform" ]
9da1e5adb3a2a7aef1c1bd3b039ca38557e8f27f
1,627
cpp
C++
Leet/287_find_the_duplicate_number.cpp
qiufengyu/LetsCode
196fae0bf5c78ee20d05798a9439596e702fdb24
[ "MIT" ]
null
null
null
Leet/287_find_the_duplicate_number.cpp
qiufengyu/LetsCode
196fae0bf5c78ee20d05798a9439596e702fdb24
[ "MIT" ]
null
null
null
Leet/287_find_the_duplicate_number.cpp
qiufengyu/LetsCode
196fae0bf5c78ee20d05798a9439596e702fdb24
[ "MIT" ]
null
null
null
// // Created by Godfray on 2018/3/12. // #include <iostream> #include <cassert> #include <vector> #include <sstream> #include <algorithm> using namespace std; class Solution { public: int findDuplicate(vector<int>& nums) { int slow = nums[0]; int fast = nums[nums[0]]; while (slow != fast) { slow = nums[slow]; fast = nums[nums[fast]]; cout<<slow<<", "<<fast<<endl; } int entry = 0; while(entry != slow) { slow = nums[slow]; entry = nums[entry]; cout<<slow<<", "<<entry<<endl; } return entry; } }; void trimLeftTrailingSpaces(string &input) { input.erase(input.begin(), find_if(input.begin(), input.end(), [](int ch) { return !isspace(ch); })); } void trimRightTrailingSpaces(string &input) { input.erase(find_if(input.rbegin(), input.rend(), [](int ch) { return !isspace(ch); }).base(), input.end()); } vector<int> stringToIntegerVector(string input) { vector<int> output; trimLeftTrailingSpaces(input); trimRightTrailingSpaces(input); input = input.substr(1, input.length() - 2); stringstream ss; ss.str(input); string item; char delim = ','; while (getline(ss, item, delim)) { output.push_back(stoi(item)); } return output; } int main() { string line; while (getline(cin, line)) { vector<int> nums = stringToIntegerVector(line); int ret = Solution().findDuplicate(nums); string out = to_string(ret); cout << out << endl; } return 0; }
21.693333
79
0.564229
[ "vector" ]
9dabbdbcdd0747d0f8e33c43f2a6102529ec0d6b
3,441
hpp
C++
include/fastdtw_cpp/fastdtw.hpp
doge-of-the-day/FastDTW_CPP-
731d65bc26db218d1e6352683ee17a43474101d5
[ "BSD-3-Clause" ]
3
2017-11-09T21:49:18.000Z
2018-12-24T12:55:53.000Z
include/fastdtw_cpp/fastdtw.hpp
doge-of-the-day/FastDTW_CPP
731d65bc26db218d1e6352683ee17a43474101d5
[ "BSD-3-Clause" ]
null
null
null
include/fastdtw_cpp/fastdtw.hpp
doge-of-the-day/FastDTW_CPP
731d65bc26db218d1e6352683ee17a43474101d5
[ "BSD-3-Clause" ]
null
null
null
#ifndef FASTDTW_CPP_HPP #define FASTDTW_CPP_HPP #include "dtw.hpp" #include "utils.hpp" #include "projection.h" #include "projection.hpp" #include "fastdtw.h" #include <iostream> #include <fstream> #include <ostream> namespace fastdtw_cpp { namespace fastdtw { template<typename T> void applyDyn(const std::vector<T> &signal_a, const std::vector<T> &signal_b, const unsigned int radius, path::WarpPath<T> &path) { /// signal_a is rows /// signal_b is cols unsigned int min_size(radius + 2); downsampling::SignalPyramid<T, 2> pyr_a(signal_a, min_size); downsampling::SignalPyramid<T, 2> pyr_b(signal_b, min_size); std::vector<unsigned int> mods_a; downsampling::offset_vector<2>(signal_a.size(), min_size, mods_a); std::vector<unsigned int> mods_b; downsampling::offset_vector<2>(signal_b.size(), min_size, mods_b); int last(std::min(pyr_a.levels(), pyr_b.levels()) - 1); unsigned int size_a = pyr_a.levelSize(last); unsigned int size_b = pyr_b.levelSize(last); path::WarpPath<T> sub_path; dtw::apply(pyr_a.levelPtr(last), size_a, pyr_b.levelPtr(last), size_b, sub_path); --last; for(int i(last) ; i > -1 ; --i) { projection::Projection p(size_a, size_b, 2, mods_a.at(i + 1), mods_b.at(i + 1)); p.project(sub_path, radius); size_a = pyr_a.levelSize(i); size_b = pyr_b.levelSize(i); sub_path = path::WarpPath<T>(); dtw::apply(pyr_a.levelPtr(i), size_a, pyr_b.levelPtr(i), size_b, p.mask(), sub_path); } path = sub_path; } template<typename T, unsigned int Radius> void applyDyn(const std::vector<T> &signal_a, const std::vector<T> &signal_b, path::WarpPath<T> &path) { /// signal_a is rows /// signal_b is cols unsigned int min_size(Radius + 2); downsampling::SignalPyramid<T, 2> pyr_a(signal_a, min_size); downsampling::SignalPyramid<T, 2> pyr_b(signal_b, min_size); std::vector<unsigned int> mods_a; downsampling::offset_vector<2>(signal_a.size(), min_size, mods_a); std::vector<unsigned int> mods_b; downsampling::offset_vector<2>(signal_b.size(), min_size, mods_b); int last(std::min(pyr_a.levels(), pyr_b.levels()) - 1); unsigned int size_a = pyr_a.levelSize(last); unsigned int size_b = pyr_b.levelSize(last); path::WarpPath<T> sub_path(size_a, size_b); dtw::apply(pyr_a.levelPtr(last), size_a, pyr_b.levelPtr(last), size_b, sub_path); --last; for(int i(last) ; i > -1 ; --i) { projection::Projection p(size_a, size_b, 2, mods_a.at(i + 1), mods_b.at(i + 1)); p.project(sub_path, Radius); size_a = pyr_a.levelSize(i); size_b = pyr_b.levelSize(i); sub_path.clear(); Mask mask = p.mask(); dtw::apply(pyr_a.levelPtr(i), size_a, pyr_b.levelPtr(i), size_b, mask, sub_path); } path = sub_path; } } } #endif // FASTDTW_CPP_HPP
29.921739
70
0.555362
[ "vector" ]
9daec9aa301ed6413ae7d20f0909fa0390239c69
1,289
cpp
C++
src/cpp/node_eos_signature_provider.cpp
mixbytes/node-eosjs-signature-provider
7b1f8b66b451d9fc155baff2bc3a063cafd55ec2
[ "Apache-2.0" ]
3
2019-06-06T10:29:37.000Z
2021-07-16T06:45:59.000Z
src/cpp/node_eos_signature_provider.cpp
mixbytes/node-eosjs-signature-provider
7b1f8b66b451d9fc155baff2bc3a063cafd55ec2
[ "Apache-2.0" ]
null
null
null
src/cpp/node_eos_signature_provider.cpp
mixbytes/node-eosjs-signature-provider
7b1f8b66b451d9fc155baff2bc3a063cafd55ec2
[ "Apache-2.0" ]
null
null
null
#include <napi.h> #include <fc/crypto/pke.hpp> #include <fc/crypto/private_key.hpp> Napi::Value SignAll(const Napi::CallbackInfo &info) { Napi::Env env = info.Env(); Napi::Array stringPrivateKeys = info[0].As<Napi::Array>(); Napi::Uint8Array serializedTransaction = info[1].As<Napi::Uint8Array>(); size_t serializedTransactionLength = serializedTransaction.ElementLength(); fc::sha256::encoder encoder; for (size_t i = 0; i < serializedTransactionLength; i++) { encoder.put(serializedTransaction[i]); } fc::sha256 sha256 = encoder.result(); uint32_t stringPrivateKeysAmount = stringPrivateKeys.Length(); Napi::Array ans = Napi::Array::New(env, stringPrivateKeysAmount); for (uint32_t i = 0; i < stringPrivateKeysAmount; i++) { std::string stringPrivateKey = stringPrivateKeys.Get(i).ToString(); fc::crypto::private_key privateKey(stringPrivateKey); std::string signature(privateKey.sign(sha256)); ans.Set(i, Napi::String::New(env, signature)); } return ans; } Napi::Object Init(Napi::Env env, Napi::Object exports) { exports.Set(Napi::String::New(env, "sign"), Napi::Function::New(env, SignAll)); return exports; } NODE_API_MODULE(node_eos_signature_provider, Init)
34.837838
79
0.683476
[ "object" ]
9dbd55a5d8214c1e1de52afb2c750748a91b1c54
1,068
cpp
C++
CodeForces/794C/19413284_AC_46ms_888kB.cpp
BakaErii/ACM_Collection
d368b15c7f1c84472424d5e61e5ebc667f589025
[ "WTFPL" ]
null
null
null
CodeForces/794C/19413284_AC_46ms_888kB.cpp
BakaErii/ACM_Collection
d368b15c7f1c84472424d5e61e5ebc667f589025
[ "WTFPL" ]
null
null
null
CodeForces/794C/19413284_AC_46ms_888kB.cpp
BakaErii/ACM_Collection
d368b15c7f1c84472424d5e61e5ebc667f589025
[ "WTFPL" ]
null
null
null
/** * @author Moe_Sakiya sakiya@tun.moe * @date 2019-04-23 19:18:49 * */ #include <iostream> #include <string> #include <algorithm> #include <set> #include <map> #include <vector> #include <stack> #include <queue> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; const int maxN = 300005; char a[maxN]; char b[maxN]; char ans[maxN]; int aPtr, bPtr, aEnd, bEnd, ansFPtr, ansLPtr; int main(void) { ios::sync_with_stdio(false); cin.tie(NULL); gets(a); gets(b); int len = strlen(a); sort(a, a + len); sort(b, b + len, greater<char>()); if(len % 2 == 0) { aEnd = len / 2 - 1; bEnd = len / 2 - 1; } else { aEnd = len / 2; bEnd = len / 2 - 1; } int cnt = 0; ansLPtr = len - 1; while(ansFPtr <= ansLPtr) { if(cnt % 2 == 0) { if(a[aPtr] < b[bPtr]) ans[ansFPtr++] = a[aPtr++]; else ans[ansLPtr--] = a[aEnd--]; } else { if(a[aPtr] < b[bPtr]) ans[ansFPtr++] = b[bPtr++]; else ans[ansLPtr--] = b[bEnd--]; } cnt++; } ans[len] = '\0'; printf("%s\n", ans ); return 0; }
16.6875
45
0.568352
[ "vector" ]
9dc14b06b65aa5b3b3a4cfd12b78f6da9a900cd2
2,894
cpp
C++
test/test_scope_info.cpp
melven/pitts
491f503a99a7d1161a27672955ae53ca6b5d3412
[ "BSD-3-Clause" ]
2
2021-12-31T08:28:17.000Z
2022-01-12T14:48:49.000Z
test/test_scope_info.cpp
melven/pitts
491f503a99a7d1161a27672955ae53ca6b5d3412
[ "BSD-3-Clause" ]
null
null
null
test/test_scope_info.cpp
melven/pitts
491f503a99a7d1161a27672955ae53ca6b5d3412
[ "BSD-3-Clause" ]
null
null
null
#include <gtest/gtest.h> #include "pitts_scope_info.hpp" namespace { constexpr auto simpleFunction(int, int) { auto scope = PITTS::internal::ScopeInfo::current(); return scope; } constexpr auto templateFunction(std::vector<auto> x) { auto scope = PITTS::internal::ScopeInfo::current(); return scope; } constexpr auto getHash = PITTS::internal::ScopeInfo::Hash(); template<typename> struct TemplateType {}; } TEST(PITTS_ScopeInfo, internal_djb_hash) { using PITTS::internal::djb_hash; EXPECT_EQ(djb_hash("hello"), djb_hash("hello")); EXPECT_NE(djb_hash("hello"), djb_hash("world")); } TEST(PITTS_ScopeInfo, simpleFunction) { constexpr auto scope = simpleFunction(7, 8); EXPECT_STREQ("simpleFunction", scope.function_name()); // check that we can get the hash at compile time constexpr auto hash = getHash(scope); } TEST(PITTS_ScopeInfo, templateFunction) { std::vector<double> bla = {1., 2., 3.}; auto scope = templateFunction(bla); EXPECT_STREQ("templateFunction<double>", scope.function_name()); // check that we can get the hash at compile time auto hash = getHash(scope); } TEST(PITTS_ScopeInfo, ArgumentInfo) { constexpr PITTS::internal::ArgumentInfo noArgs; EXPECT_EQ("", noArgs.to_string()); constexpr PITTS::internal::ArgumentInfo<2> arg2Info{{"x", "y"}, {1, 8}}; EXPECT_EQ("x: 1, y: 8", arg2Info.to_string()); EXPECT_NE(noArgs.hash_values(), arg2Info.hash_values()); } TEST(PITTS_ScopeInfo, type) { constexpr auto scopeNone = PITTS::internal::ScopeInfo::current(); printf("type none: %s\n", scopeNone.type_name()); EXPECT_STREQ("", scopeNone.type_name()); // check that we can get the hash at compile time constexpr auto hashNone = getHash(scopeNone); // int constexpr auto scopeInt = PITTS::internal::ScopeInfo::current<int>(); printf("type int: %s\n", scopeInt.type_name()); EXPECT_STREQ("<int>", scopeInt.type_name()); // check that we can get the hash at compile time constexpr auto hashInt = getHash(scopeInt); EXPECT_NE(getHash(scopeInt), getHash(scopeNone)); } TEST(PITTS_ScopeInfo, ScopeWithArgumentInfo) { constexpr auto scope = PITTS::internal::ScopeInfo::current(); constexpr auto getHash = PITTS::internal::ScopeWithArgumentInfo::Hash(); const auto scopeWithNoArgs = PITTS::internal::ScopeWithArgumentInfo{scope, {}}; EXPECT_EQ("", scopeWithNoArgs.args.to_string()); const auto scopeWithSingleArg = PITTS::internal::ScopeWithArgumentInfo{scope, {{"N"},{7}}}; EXPECT_EQ("N: 7", scopeWithSingleArg.args.to_string()); const auto scopeWithFourArgs = PITTS::internal::ScopeWithArgumentInfo{scope, {{"A", "B", "C", "D"},{1, 2, 3, 4}}}; EXPECT_EQ("A: 1, B: 2, C: 3, D: 4", scopeWithFourArgs.args.to_string()); EXPECT_NE(getHash(scopeWithNoArgs), getHash(scopeWithSingleArg)); EXPECT_NE(getHash(scopeWithFourArgs), getHash(scopeWithSingleArg)); }
29.232323
116
0.711472
[ "vector" ]
e385f1dfee5e3a139838122d0888126b3dc1b3d0
33,020
cpp
C++
src/exerciseeditor.in.cpp
MathiasMen/FreeFit
d85f6e72bcc199eb3cb5bfa24d85b2c89ae3ae74
[ "MIT" ]
null
null
null
src/exerciseeditor.in.cpp
MathiasMen/FreeFit
d85f6e72bcc199eb3cb5bfa24d85b2c89ae3ae74
[ "MIT" ]
149
2020-04-19T07:35:30.000Z
2020-10-12T04:01:38.000Z
src/exerciseeditor.in.cpp
MathiasMen/FreeFit
d85f6e72bcc199eb3cb5bfa24d85b2c89ae3ae74
[ "MIT" ]
null
null
null
#include "include/exerciseeditor.h" namespace FreeFit { namespace GUI { ExerciseItem::ExerciseItem(QWidget* parent):QWidget(parent),muscle_definitions(),default_color("black") { this->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); this->setFocusPolicy(Qt::ClickFocus); ly = new QGridLayout(this); hashtag_widget = new HashtagBar(this); for (auto m : muscle_definitions.strings) hashtag_widget->addHashtag(m); processMovie = new QMovie("${CMAKE_SOURCE_DIR}/tools/loading.gif"); processLabel = new QLabel(this); processLabel->setMovie(processMovie); processLabel->hide(); name = new MaterialTextField("Name",this); url = new MaterialTextField("URL",this); start_stop = new MaterialSlider(this,10,20); start_time_lbl = new QLabel("00:00",this); stop_time_lbl = new QLabel("00:00",this); name->setToolTip("No special characters allowed."); url->setToolTip("Youtube-links only."); std::regex name_regex("[a-zA-Z0-9\\s]{1,256}"); auto func_name_regex = [name_regex](std::string s)->bool{return (std::regex_match(s,name_regex) && s != "Name");}; name->setValidationFunction(func_name_regex); std::regex url_regex("https:\\/\\/www\\.youtube\\.com\\/watch?.*"); auto func_url_regex = [url_regex](std::string s)->bool{return std::regex_match(s,url_regex);}; url->setValidationFunction(func_url_regex); name->validateText(); url->validateText(); connect(name,&QLineEdit::textChanged,this,&ExerciseItem::itemChanged); connect(url,&QLineEdit::textChanged,this,&ExerciseItem::itemChanged); connect(start_stop,&MaterialSlider::valuesChanged,this,&ExerciseItem::sliderChanged); connect(url,&QLineEdit::textChanged,this,&ExerciseItem::urlChanged); connect(name,&QLineEdit::textChanged,this,&ExerciseItem::nameChanged); item_downloaded_icon = new QLabel("",this); item_downloaded_text = new QLabel("",this); delete_item = new IconButton(QIcon("${CMAKE_SOURCE_DIR}/tools/trash.svg"),"",this); connect(delete_item,&QPushButton::clicked,this,&ExerciseItem::deleteClicked); int row_counter = -1; int col_counter = -1; row_counter = -1; ly->addWidget(name,++row_counter,++col_counter); ly->addWidget(url,++row_counter,col_counter); QHBoxLayout* slider_ly = new QHBoxLayout; slider_ly->addWidget(start_time_lbl,Qt::AlignRight); slider_ly->addWidget(start_stop,Qt::AlignHCenter); slider_ly->addWidget(stop_time_lbl,Qt::AlignLeft); ly->addLayout(slider_ly,++row_counter,col_counter); ly->addWidget(delete_item,0,++col_counter,row_counter+1,1,Qt::AlignCenter); ly->addWidget(processLabel,0,++col_counter,row_counter+1,1,Qt::AlignCenter); ly->addWidget(item_downloaded_text,0,++col_counter,row_counter+1,1,Qt::AlignCenter); ly->addWidget(item_downloaded_icon,0,++col_counter,row_counter+1,1,Qt::AlignCenter); ly->addWidget(hashtag_widget,++row_counter,0,col_counter,2,Qt::AlignLeft); } void ExerciseItem::setColor(std::string c) { start_time_lbl->setStyleSheet(QString::fromStdString("color:" + c + ";")); stop_time_lbl->setStyleSheet(QString::fromStdString("color:" + c + ";")); delete_item->setColor(c); start_stop->setColor(c); hashtag_widget->setColor(c); } std::list<std::string> ExerciseItem::getMuscleAreas() { return hashtag_widget->getToggledStrings(); } void ExerciseItem::setMuscleAreas(std::set<FreeFit::Data::MuscleGroup> muscles) { for (auto m : muscles) hashtag_widget->toggleHashtag(muscle_definitions.strings[m]); } bool ExerciseItem::inputIsValid() { return (name->validateText() && url->validateText()); } void ExerciseItem::highlightAsFaulty() { this->setStyleSheet("background-color:red;"); connect(name,&QLineEdit::textChanged,this,&ExerciseItem::resetStylesheetOnce); connect(url,&QLineEdit::textChanged,this,&ExerciseItem::resetStylesheetOnce); } void ExerciseItem::setDefaultBackground() { this->setStyleSheet("background-color:" + QString::fromStdString(default_color) + ";"); } void ExerciseItem::showWaitingSymbol() { processMovie->start(); processLabel->show(); } void ExerciseItem::hideWaitingSymbol() { processMovie->stop(); processLabel->hide(); } void ExerciseItem::setVideoStartTime(std::string t) { start_time_lbl->setText(QString::fromStdString(t)); } void ExerciseItem::setVideoStartTime(ExerciseItem* e, std::string t) { if (e == this) start_time_lbl->setText(QString::fromStdString(t)); } void ExerciseItem::setVideoEndTime(std::string t) { stop_time_lbl->setText(QString::fromStdString(t)); } void ExerciseItem::setVideoEndTime(ExerciseItem* e, std::string t) { if (e == this) stop_time_lbl->setText(QString::fromStdString(t)); } void ExerciseItem::resetStylesheetOnce() { setDefaultBackground(); disconnect(name,&QLineEdit::textChanged,this,&ExerciseItem::resetStylesheetOnce); disconnect(url,&QLineEdit::textChanged,this,&ExerciseItem::resetStylesheetOnce); } void ExerciseItem::itemChanged() { unchanged = false; disconnect(name,&QLineEdit::textChanged,this,&ExerciseItem::itemChanged); disconnect(url,&QLineEdit::textChanged,this,&ExerciseItem::itemChanged); emit dataChanged(); } void ExerciseItem::urlChanged() { emit dataChanged(); if(url->validateText()) emit urlChange(this,url->text().toStdString()); } void ExerciseItem::nameChanged() { emit dataChanged(); } void ExerciseItem::sliderChanged(int start, int stop) { start_time_lbl->setText(QString::fromStdString(timeIntToString(start))); stop_time_lbl->setText(QString::fromStdString(timeIntToString(stop))); emit dataChanged(); } void ExerciseItem::setSliderRange(int start, int stop) { start_stop->setMinValue(start); start_stop->setMaxValue(stop); } void ExerciseItem::setSliderRange(ExerciseItem* e, int start, int stop) { if (e == this) { start_stop->setMinValue(start); start_stop->setMaxValue(stop); } } std::string ExerciseItem::timeIntToString(int i) { int mins = (int)floor(i/60); int secs = i - mins*60; std::string s_m = (mins > 9 ? std::to_string(mins) : std::string("0" + std::to_string(mins))); std::string s_s = (secs > 9 ? std::to_string(secs) : std::string("0" + std::to_string(secs))); return s_m + ":" + s_s; } void ExerciseItem::paintEvent(QPaintEvent* e) { QStyleOption opt; opt.init(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } ExistingExerciseViewer::ExistingExerciseViewer(QWidget* parent) : QWidget(parent) { } ExerciseEditorBrowser::ExerciseEditorBrowser(QWidget* parent) : QWidget(parent) { this->setMinimumSize(600,600); this->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding); ly = new QVBoxLayout(this); browser = new QWebEngineView(this); address = new MaterialTextField("Youtube-URL",this); connect(address,&QLineEdit::returnPressed,this,&ExerciseEditorBrowser::addressEnterPressed); connect(browser,&QWebEngineView::loadStarted,this,&ExerciseEditorBrowser::browserStartedLoading); browser->load(start_url); ly->addWidget(address); ly->addWidget(browser); this->setLayout(ly); } void ExerciseEditorBrowser::addressEnterPressed() { if (validateAddress()) browser->load(QUrl(address->text())); } void ExerciseEditorBrowser::browserStartedLoading() { address->setText(browser->url().toString()); } bool ExerciseEditorBrowser::validateAddress() { std::regex url_regex("https:\\/\\/www\\.youtube\\.com.*"); return std::regex_match(address->text().toStdString(),url_regex); } ExerciseEditor::ExerciseEditor(FreeFit::Data::Profile t_p) : MaterialDialog("Workout Type","Profile",""),p(t_p),demand_handler(),info_demand_handler(), r(t_p.getPathToExerciseDB()),w(t_p.getPathToExerciseDB()) { connect(getAcceptButton(), &QPushButton::clicked, this, &QDialog::accept); connect(getRejectButton(), &QPushButton::clicked, this, &QDialog::reject); new_exercises_widget = new QWidget; QHBoxLayout* new_exercises_widget_ly = new QHBoxLayout(new_exercises_widget); browser = new ExerciseEditorBrowser(this); QGridLayout* new_exercises_right_panel_ly = new QGridLayout; new_exercise_label = new QLabel("New Exercises",this); new_exercise_area = new QWidget(this); new_exercise_area_ly = new QVBoxLayout(new_exercise_area); new_exercise_area_ly->addStretch(); new_exercise_area->setLayout(new_exercise_area_ly); new_exercise_scroll_area = new QScrollArea(this); new_exercise_scroll_area->setWidget(new_exercise_area); new_exercise_scroll_area->setAlignment(Qt::AlignTop); new_exercise_scroll_area->setWidgetResizable(true); download_exercises_button = new MaterialButton("Add to existing exercises",this); connect(download_exercises_button,&MaterialButton::rippleFinished,this,&ExerciseEditor::downloadAllExercises); add_button = new MaterialButton("Create new exercise",this); connect(add_button,&QPushButton::clicked,this,&ExerciseEditor::addExercise); new_exercises_right_panel_ly->addWidget(add_button,0,1,1,2); new_exercises_right_panel_ly->addWidget(new_exercise_label,1,1,1,2); new_exercises_right_panel_ly->addWidget(new_exercise_scroll_area,2,1,1,2); new_exercises_right_panel_ly->addWidget(download_exercises_button,3,1,1,2); new_exercises_widget_ly->addWidget(browser); new_exercises_widget_ly->addLayout(new_exercises_right_panel_ly); old_exercises_widget = new QWidget; QVBoxLayout* old_exercises_widget_ly = new QVBoxLayout(old_exercises_widget); old_exercises_filter_ln = new MaterialTextField("Filter",this); connect(old_exercises_filter_ln,&QLineEdit::textEdited,this,&ExerciseEditor::filterOldExercises); old_exercises_viewer = new ExistingExerciseViewer(this); old_exercise_area_ly = new QVBoxLayout(old_exercises_viewer); old_exercise_area_ly->addStretch(); old_exercises_viewer->setLayout(old_exercise_area_ly); old_exercise_scroll_area = new QScrollArea(this); old_exercise_scroll_area->setWidget(old_exercises_viewer); old_exercise_scroll_area->setAlignment(Qt::AlignTop); old_exercise_scroll_area->setWidgetResizable(true); old_exercises_widget_ly->addWidget(old_exercises_filter_ln); old_exercises_widget_ly->addWidget(old_exercise_scroll_area); tab_widget = new QTabWidget(this); tab_widget->setTabPosition(QTabWidget::North); tab_widget->addTab(old_exercises_widget,"Edit old Exercises"); tab_widget->addTab(new_exercises_widget,"Add new Exercises"); setTabsCss(); addWidget(tab_widget,0,0); r.read(); for (auto e_data : r.getExerciseList()) addExistingExercise(e_data); if (exercise_items.empty()) addExercise(); updateDownloadButtonStatus(); setColor("#ff0000"); } void ExerciseEditor::setColor(std::string c) { MaterialDialog::setColor(c); new_exercise_label->setStyleSheet(QString::fromStdString("color:" + c + ";")); add_button->setColor(c); download_exercises_button->setColor(c); for (auto ex : exercise_items) ex->setColor(c); for (auto new_ex : new_exercise_items) new_ex->setColor(c); setTabsCss(); } void ExerciseEditor::accept() { writeXML(); QDialog::accept(); } void ExerciseEditor::reject() { if (!new_exercise_items.empty()) { QMessageBox reject_box; reject_box.setText("Some exercises have not been downloaded yet. Properties of these will be lost. Continue?"); reject_box.setStandardButtons(QMessageBox::Yes | QMessageBox::No); int res = reject_box.exec(); if (res == QMessageBox::No) return; } writeXML(); QDialog::reject(); } void ExerciseEditor::writeXML() { std::list<FreeFit::Data::Exercise> lst; for (auto e : exercise_items) lst.push_back(exerciseItemToData(e)); w.createNodeTree(lst); w.write(); } void ExerciseEditor::filterOldExercises() { QString s = old_exercises_filter_ln->getText(); if (!s.isEmpty()) { for (auto e : exercise_items) if (!QString::fromStdString(e->getName()).contains(s, Qt::CaseInsensitive)) e->hide(); else e->show(); } else { for (auto e : exercise_items) e->show(); } } FreeFit::Data::Exercise ExerciseEditor::exerciseItemToData(ExerciseItem* e) { FreeFit::Data::Exercise e_dat; e_dat.setName(e->getName()); e_dat.setVideoURL(e->getURL()); e_dat.setVideoPath(e->getVideoPath()); e_dat.setThumbnailPath(e->getThumbnailPath()); e_dat.setVideoStartTime(std::to_string(timeFormatStringToSecondsInt(e->getVideoStartTime()))); e_dat.setVideoEndTime(std::to_string(timeFormatStringToSecondsInt(e->getVideoEndTime()))); for (auto m : e->getMuscleAreas()) e_dat.addTrainedMuscle(FreeFit::Data::stringToMuscleGroup(m)); return e_dat; } int ExerciseEditor::timeFormatStringToSecondsInt(std::string s) { size_t colon_pos = s.find(":"); std::string mins, secs; if (colon_pos == 1) { mins += "0"; mins += s[0]; } else if (colon_pos == 2) mins = s.substr(0,2); else mins = "00"; secs = s.substr(colon_pos+1,colon_pos+2); return std::stoi(mins)*60 + std::stoi(secs); } std::string ExerciseEditor::secondsIntToTimeFormatString(int i) { int mins = (int)floor(i/60); int secs = i - mins*60; std::string s_m = (mins > 9 ? std::to_string(mins) : std::string("0" + std::to_string(mins))); std::string s_s = (secs > 9 ? std::to_string(secs) : std::string("0" + std::to_string(secs))); return s_m + ":" + s_s; } void ExerciseEditor::updateDownloadButtonStatus() { if (new_exercise_items.empty()) download_exercises_button->setDisabled(true); else { bool valid_exercises = true; for (auto e : new_exercise_items) if (!e->inputIsValid()) { valid_exercises = false; break; } if (valid_exercises) download_exercises_button->setDisabled(false); else download_exercises_button->setDisabled(true); } } void ExerciseEditor::registerExerciseItem(ExerciseItem* e) { e->inputIsValid(); old_exercise_area_ly->insertWidget(0,e); connect(e,&ExerciseItem::deleteItemTriggered,this,&ExerciseEditor::deleteExercise); connect(e,&ExerciseItem::downloadItemTriggered,this,&ExerciseEditor::downloadExercise); exercise_items.push_back(e); } void ExerciseEditor::addExercise() { ExerciseItem* e = new ExerciseItem(this); e->setColor(color); new_exercise_items.push_back(e); new_exercise_area_ly->insertWidget(0,e); connect(e,&ExerciseItem::deleteItemTriggered,this,&ExerciseEditor::deleteExercise); connect(e,&ExerciseItem::downloadItemTriggered,this,&ExerciseEditor::downloadExercise); connect(this,SIGNAL(exerciseDownloaded(ExerciseItem*)),this,SLOT(moveExerciseToExisting(ExerciseItem*))); connect(e,SIGNAL(urlChange(ExerciseItem*,std::string)),this,SLOT(exerciseUrlChanged(ExerciseItem*,std::string))); connect(e,SIGNAL(dataChanged()),this,SLOT(updateDownloadButtonStatus())); connect(this,SIGNAL(setExerciseStartTimeSignal(ExerciseItem*,std::string)),e,SLOT(setVideoStartTime(ExerciseItem*,std::string))); connect(this,SIGNAL(setExerciseEndTimeSignal(ExerciseItem*,std::string)),e,SLOT(setVideoEndTime(ExerciseItem*,std::string))); connect(this,SIGNAL(setExerciseSliderRange(ExerciseItem*,int,int)),e,SLOT(setSliderRange(ExerciseItem*,int,int))); updateDownloadButtonStatus(); } void ExerciseEditor::addExistingExercise(FreeFit::Data::Exercise e_dat) { ExerciseItem* e = new ExerciseItem(this); e->setName(e_dat.getName()); e->setVideoPath(e_dat.getVideoPath()); e->setThumbnailPath(e_dat.getThumbnailPath()); e->setURL(e_dat.getVideoURL()); e->setMuscleAreas(e_dat.getTrainedMuscles()); e->setVideoStartTime(secondsIntToTimeFormatString(std::stoi(e_dat.getVideoStartTime()))); e->setVideoEndTime(secondsIntToTimeFormatString(std::stoi(e_dat.getVideoEndTime()))); registerExerciseItem(e); } void ExerciseEditor::exerciseUrlChanged(ExerciseItem* e,std::string url) { std::shared_ptr<InfoExerciseDemand> d = std::make_shared<InfoExerciseDemand>(); d->video_url = url; int video_length = info_demand_handler.executeDemand(d); emit setExerciseEndTimeSignal(e,secondsIntToTimeFormatString(video_length)); emit setExerciseStartTimeSignal(e,secondsIntToTimeFormatString(0)); emit setExerciseSliderRange(e,0,video_length); } std::shared_ptr<DownloadExerciseDemand> ExerciseEditor::generateDownloadExerciseDemand(ExerciseItem* e) { std::shared_ptr<DownloadExerciseDemand> d = std::make_shared<DownloadExerciseDemand>(); d->name = e->getName(); d->video_url = e->getURL(); d->video_start_time = std::to_string(timeFormatStringToSecondsInt(e->getVideoStartTime())); d->video_end_time = std::to_string(timeFormatStringToSecondsInt(e->getVideoEndTime())); d->muscle_areas = e->getMuscleAreas(); return d; } void ExerciseEditor::moveExerciseToExisting(ExerciseItem* e) { e->hideWaitingSymbol(); registerExerciseItem(e); new_exercise_items.remove(e); } bool ExerciseEditor::downloadExercise(ExerciseItem* e) { if(e->inputIsValid()) { QProgressDialog progress("Downloading files...", QString(), 0, 1, this); progress.setWindowModality(Qt::WindowModal); progress.show(); FreeFit::Data::Exercise e_dat = demand_handler.executeDemand(generateDownloadExerciseDemand(e)); e->setVideoPath(e_dat.getVideoPath()); e->setThumbnailPath(e_dat.getThumbnailPath()); emit exerciseDownloaded(e); return true; } else { e->highlightAsFaulty(); return false; } } void ExerciseEditor::downloadAllExercises() { std::list<ExerciseItem*> tmp_exercise_list = new_exercise_items; for(auto e : tmp_exercise_list) downloadExercise(e); } void ExerciseEditor::deleteExercise(ExerciseItem* e) { exercise_items.remove(e); new_exercise_items.remove(e); new_exercise_area_ly->removeWidget(e); disconnect(e,nullptr,nullptr,nullptr); delete e; updateDownloadButtonStatus(); } std::list<FreeFit::Data::Exercise> ExerciseEditor::getExerciseData() { return r.getExerciseList(); } void ExerciseEditor::setTabsCss() { QString c = QString::fromStdString(color); QString tab_css_const_part( "height: 25px;" "border-top: 2px solid " + c + "; border-right: 2px solid " + c + ";" "border-left: 2px solid " + c + "; border-top-left-radius:4px;" "border-top-right-radius:4px; padding:5px; margin-left:2px;" "margin-right:2px; margin-bottom:-2px;"); tab_widget->setStyleSheet( "QTabWidget::pane {border: 1px solid grey;} \n" "QTabBar::tab {background-color:white; color:" + c + ";" + tab_css_const_part + "}\n" "QTabBar::tab::selected {background-color:"+ c + "; color:white;" + tab_css_const_part + "} \n" "QTabWidget::tab-bar {left: 5px;}"); } std::shared_ptr<DownloadExerciseDemand> ExerciseEditorValidator::getFirstExerciseDemand() { return ee->generateDownloadExerciseDemand(*(ee->new_exercise_items.begin())); } void ExerciseEditorValidator::setOutPath(std::string s) { ee->w = FreeFit::Data::ExerciseWriter(s); } void ExerciseEditorValidator::setFirstNewExerciseNameText(std::string s) { ExerciseItem* e = *(ee->new_exercise_items.begin()); e->name->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setFirstNewExerciseURLText(std::string s) { ExerciseItem* e = *(ee->new_exercise_items.begin()); e->url->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setFirstNewExerciseMuscleArea(int id) { ExerciseItem* e = *(ee->new_exercise_items.begin()); e->hashtag_widget->toggleHashtag(e->muscle_definitions.strings[id]); } void ExerciseEditorValidator::setLastNewExerciseNameText(std::string s) { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); e->name->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setLastNewExerciseURLText(std::string s) { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); e->url->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setLastNewExerciseMuscleArea(int id) { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); e->hashtag_widget->toggleHashtag(e->muscle_definitions.strings[id]); } std::string ExerciseEditorValidator::getFirstNewExerciseNameText() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->name->text().toStdString(); } std::string ExerciseEditorValidator::getFirstNewExerciseURLText() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->url->text().toStdString(); } std::string ExerciseEditorValidator::getFirstNewExerciseStartTime() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->getVideoStartTime(); } std::string ExerciseEditorValidator::getFirstNewExerciseStopTime() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->getVideoEndTime(); } std::string ExerciseEditorValidator::getLastNewExerciseNameText() { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); return e->name->text().toStdString(); } std::string ExerciseEditorValidator::getLastNewExerciseURLText() { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); return e->url->text().toStdString(); } std::string ExerciseEditorValidator::getLastNewExerciseStartTime() { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); return e->getVideoStartTime(); } std::string ExerciseEditorValidator::getLastNewExerciseStopTime() { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); return e->getVideoEndTime(); } bool ExerciseEditorValidator::isFirstNewExerciseMuscleAreaSelected(int id) { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->hashtag_widget->isHashtagToggled(e->muscle_definitions.strings[id]); } bool ExerciseEditorValidator::isLastNewExerciseMuscleAreaSelected(int id) { ExerciseItem* e = *(ee->new_exercise_items.rbegin()); return e->hashtag_widget->isHashtagToggled(e->muscle_definitions.strings[id]); } bool ExerciseEditorValidator::isFirstNewExerciseNameValid() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->name->validateText(); } bool ExerciseEditorValidator::isFirstNewExerciseURLValid() { ExerciseItem* e = *(ee->new_exercise_items.begin()); return e->url->validateText(); } void ExerciseEditorValidator::setFirstOldExerciseNameText(std::string s) { ExerciseItem* e = *(ee->exercise_items.begin()); e->name->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setFirstOldExerciseURLText(std::string s) { ExerciseItem* e = *(ee->exercise_items.begin()); e->url->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setFirstOldExerciseMuscleArea(int id) { ExerciseItem* e = *(ee->exercise_items.begin()); e->hashtag_widget->toggleHashtag(e->muscle_definitions.strings[id]); } void ExerciseEditorValidator::setLastOldExerciseNameText(std::string s) { ExerciseItem* e = *(ee->exercise_items.rbegin()); e->name->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setLastOldExerciseURLText(std::string s) { ExerciseItem* e = *(ee->exercise_items.rbegin()); e->url->setText(QString::fromStdString(s)); } void ExerciseEditorValidator::setLastOldExerciseMuscleArea(int id) { ExerciseItem* e = *(ee->exercise_items.rbegin()); e->hashtag_widget->toggleHashtag(e->muscle_definitions.strings[id]); } std::string ExerciseEditorValidator::getFirstOldExerciseNameText() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->name->text().toStdString(); } std::string ExerciseEditorValidator::getFirstOldExerciseURLText() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->url->text().toStdString(); } std::string ExerciseEditorValidator::getFirstOldExerciseStartTime() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->getVideoStartTime(); } std::string ExerciseEditorValidator::getFirstOldExerciseStopTime() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->getVideoEndTime(); } std::string ExerciseEditorValidator::getLastOldExerciseNameText() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->name->text().toStdString(); } std::string ExerciseEditorValidator::getLastOldExerciseURLText() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->url->text().toStdString(); } std::string ExerciseEditorValidator::getLastOldExerciseStartTime() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->getVideoStartTime(); } std::string ExerciseEditorValidator::getLastOldExerciseStopTime() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->getVideoEndTime(); } bool ExerciseEditorValidator::isFirstOldExerciseMuscleAreaSelected(int id) { ExerciseItem* e = *(ee->exercise_items.begin()); return e->hashtag_widget->isHashtagToggled(e->muscle_definitions.strings[id]); } bool ExerciseEditorValidator::isLastOldExerciseMuscleAreaSelected(int id) { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->hashtag_widget->isHashtagToggled(e->muscle_definitions.strings[id]); } bool ExerciseEditorValidator::isFirstOldExerciseNameValid() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->name->validateText(); } bool ExerciseEditorValidator::isLastOldExerciseNameValid() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->name->validateText(); } bool ExerciseEditorValidator::isFirstOldExerciseURLValid() { ExerciseItem* e = *(ee->exercise_items.begin()); return e->url->validateText(); } bool ExerciseEditorValidator::isLastOldExerciseURLValid() { ExerciseItem* e = *(ee->exercise_items.rbegin()); return e->url->validateText(); } void ExerciseEditorValidator::connectToDownloadSignalsOfItems() { connect(ee,SIGNAL(exerciseDownloaded(ExerciseItem*)),this,SLOT(saveDemandFromDownloadClicked(ExerciseItem*))); } void ExerciseEditorValidator::pushDownloadAllButton() { ee->download_exercises_button->click(); } void ExerciseEditorValidator::pushFirstDeleteButtonOldExercises() { ExerciseItem* e = *(ee->exercise_items.begin()); e->delete_item->click(); } void ExerciseEditorValidator::pushFirstDeleteButtonNewExercises() { ExerciseItem* e = *(ee->new_exercise_items.begin()); e->delete_item->click(); } void ExerciseEditorValidator::saveDemandFromDownloadClicked(ExerciseItem* e) { last_demand = std::shared_ptr<GUI::DownloadExerciseDemand>(ee->generateDownloadExerciseDemand(e)); } } }
39.6875
141
0.589158
[ "solid" ]
e38af340fe6bdb16c213f463f39e2c88477a4077
332
cpp
C++
Escuadron.cpp
jlguevara99/Lab7P3_JuanGuevara
d06df8dfd0993939a9f8a5338a2e0412f63e0b7e
[ "MIT" ]
null
null
null
Escuadron.cpp
jlguevara99/Lab7P3_JuanGuevara
d06df8dfd0993939a9f8a5338a2e0412f63e0b7e
[ "MIT" ]
null
null
null
Escuadron.cpp
jlguevara99/Lab7P3_JuanGuevara
d06df8dfd0993939a9f8a5338a2e0412f63e0b7e
[ "MIT" ]
null
null
null
#include "Escuadron.h" Escuadron::Escuadron(string nEnom){ Enombre = nEnom; } string Escuadron::getEnombre(){ return Enombre; } vector<Soldado*> Escuadron::getSoldiers(){ return soldados; } void Escuadron::setEnombre(string pNom){ Enombre = pNom; } void Escuadron::setSoldiers(vector<Soldado*> psol){ soldados = psol; }
14.434783
51
0.722892
[ "vector" ]
e3913096e8d4313801541faa19cb15c655ed6530
4,613
hpp
C++
search/base/text_index/mem.hpp
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
4,879
2015-09-30T10:56:36.000Z
2022-03-31T18:43:03.000Z
search/base/text_index/mem.hpp
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
7,549
2015-09-30T10:52:53.000Z
2022-03-31T22:04:22.000Z
search/base/text_index/mem.hpp
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
1,493
2015-09-30T10:43:06.000Z
2022-03-21T09:16:49.000Z
#pragma once #include "search/base/text_index/dictionary.hpp" #include "search/base/text_index/header.hpp" #include "search/base/text_index/postings.hpp" #include "search/base/text_index/text_index.hpp" #include "search/base/text_index/utils.hpp" #include "coding/reader.hpp" #include "coding/varint.hpp" #include "base/assert.hpp" #include "base/string_utils.hpp" #include <algorithm> #include <cstdint> #include <map> #include <memory> #include <string> #include <utility> #include <vector> namespace search_base { class MemTextIndex { public: MemTextIndex() = default; void AddPosting(Token const & token, Posting const & posting); // Executes |fn| on every posting associated with |token|. // The order of postings is not specified. template <typename Fn> void ForEachPosting(Token const & token, Fn && fn) const { auto const it = m_postingsByToken.find(token); if (it == m_postingsByToken.end()) return; for (auto const p : it->second) fn(p); } template <typename Fn> void ForEachPosting(strings::UniString const & token, Fn && fn) const { auto const utf8s = strings::ToUtf8(token); ForEachPosting(std::move(utf8s), std::forward<Fn>(fn)); } template <typename Sink> void Serialize(Sink & sink) { SortPostings(); BuildDictionary(); TextIndexHeader header; uint64_t const startPos = sink.Pos(); // Will be filled in later. header.Serialize(sink); SerializeDictionary(sink, header, startPos); SerializePostingsLists(sink, header, startPos); uint64_t const finishPos = sink.Pos(); sink.Seek(startPos); header.Serialize(sink); sink.Seek(finishPos); } template <typename Source> void Deserialize(Source & source) { uint64_t startPos = source.Pos(); TextIndexHeader header; header.Deserialize(source); DeserializeDictionary(source, header, startPos); DeserializePostingsLists(source, header, startPos); } private: class MemPostingsFetcher : public PostingsFetcher { public: explicit MemPostingsFetcher(std::map<Token, std::vector<Posting>> const & postingsByToken) : m_postingsByToken(postingsByToken), m_it(m_postingsByToken.begin()) { } // PostingsFetcher overrides: bool IsValid() const override { return m_it != m_postingsByToken.end(); } void Advance() override { if (m_it != m_postingsByToken.end()) ++m_it; } void ForEachPosting(Fn const & fn) const override { CHECK(IsValid(), ()); for (uint32_t p : m_it->second) fn(p); } private: std::map<Token, std::vector<Posting>> const & m_postingsByToken; // Iterator to the current token that will be processed when ForEachPosting is called. std::map<Token, std::vector<Posting>>::const_iterator m_it; }; void SortPostings(); void BuildDictionary(); template <typename Sink> void SerializeDictionary(Sink & sink, TextIndexHeader & header, uint64_t startPos) const { m_dictionary.Serialize(sink, header, startPos); } template <typename Source> void DeserializeDictionary(Source & source, TextIndexHeader const & header, uint64_t startPos) { CHECK_EQUAL(source.Pos(), startPos + header.m_dictPositionsOffset, ()); m_dictionary.Deserialize(source, header); } template <typename Sink> void SerializePostingsLists(Sink & sink, TextIndexHeader & header, uint64_t startPos) const { MemPostingsFetcher fetcher(m_postingsByToken); WritePostings(sink, startPos, header, fetcher); } template <typename Source> void DeserializePostingsLists(Source & source, TextIndexHeader const & header, uint64_t startPos) { CHECK_EQUAL(source.Pos(), startPos + header.m_postingsStartsOffset, ()); std::vector<uint32_t> postingsStarts(header.m_numTokens + 1); for (uint32_t & start : postingsStarts) start = ReadPrimitiveFromSource<uint32_t>(source); auto const & tokens = m_dictionary.GetTokens(); CHECK_EQUAL(source.Pos(), startPos + header.m_postingsListsOffset, ()); m_postingsByToken.clear(); for (size_t i = 0; i < header.m_numTokens; ++i) { std::vector<uint32_t> postings; uint32_t last = 0; while (source.Pos() < startPos + postingsStarts[i + 1]) { last += ReadVarUint<uint32_t>(source); postings.emplace_back(last); } CHECK_EQUAL(source.Pos(), postingsStarts[i + 1], ()); m_postingsByToken.emplace(tokens[i], postings); } } std::map<Token, std::vector<Posting>> m_postingsByToken; TextIndexDictionary m_dictionary; }; } // namespace search_base
27.295858
99
0.693041
[ "vector" ]
e39195d4400cd9905c3a16da578e84810ccac955
1,326
cpp
C++
Lab3/3_2.cpp
toniminh161200/Computational-Mathematics
f7e1a7475d001fb654e14ea23393fe8838fcfb40
[ "MIT" ]
null
null
null
Lab3/3_2.cpp
toniminh161200/Computational-Mathematics
f7e1a7475d001fb654e14ea23393fe8838fcfb40
[ "MIT" ]
null
null
null
Lab3/3_2.cpp
toniminh161200/Computational-Mathematics
f7e1a7475d001fb654e14ea23393fe8838fcfb40
[ "MIT" ]
null
null
null
/* * Author : Nguyen Le Minh * Group : N3251 * Laboratory : 3 */ #include <iostream> #include <cmath> #include <vector> #include "matplotlibcpp.h" namespace plt = matplotlibcpp; double err = 0.001; double miN = -10, maX = 10; int points = 5000; double f(double x){ return /*function*/; } void divide(double min, double max, double err){ double mid; for(int i = 0; i < 1000; i++){ mid = (min+max)/2; if(f(min) == 0){ std::cout << "Корень: " << min << std::endl; return; } else if(f(max) == 0){ std::cout << "Корень: " << max << std::endl; return; } else if(f(min)*f(mid) < 0) max = mid; else if(f(mid)*f(max) < 0) min = mid; else{ std::cout << "Плохой интервал или нет корней" << std::endl; return; } if(max-min < err){ std::cout << "Корень: " << (min+max)/2 << std::endl; return; } } std::cout << "Превышен предел вычислений" << std::endl; } int main() { divide(miN, maX, err); double step = (maX - miN)/points; std::vector<double> x(points); for(int i=0; i<points; i++) x.at(i) = miN + i*step; plt::plot(x, [](int d){return 0;}, "r-", x, [](double d) { return f(d); }, "k-"); plt::show(); return 0; }
27.625
98
0.497738
[ "vector" ]
e391cbb0e83dd2b8fdf83c39c1f29c7a479fb0f7
5,023
cpp
C++
src/braft/log_fetcher.cpp
XingjZhang/braft
4515147ea61822e181fe5f781063651d03de9170
[ "Apache-2.0" ]
null
null
null
src/braft/log_fetcher.cpp
XingjZhang/braft
4515147ea61822e181fe5f781063651d03de9170
[ "Apache-2.0" ]
null
null
null
src/braft/log_fetcher.cpp
XingjZhang/braft
4515147ea61822e181fe5f781063651d03de9170
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2019 Baidu.com, 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. // Authors: Kai FAN(fankai@baidu.com) #include "braft/log_fetcher.h" #include "braft/learner.h" #include "braft/log_manager.h" namespace braft { DEFINE_int32(raft_max_fetch_log_size, 200000, "fetch log limit per cycle"); void FetchLogClosure::Run() { _learner->on_fetch_log_error(); delete this; } LogFetcher::LogFetcher(const GroupId& group_id, const PeerId& peer_id, LearnerImpl* learner, const int64_t last_log_index, const int fetch_log_timeout_s) : _group_id(group_id) , _peer_id(peer_id) , _learner(learner) , _fetch_log_timeout_s(fetch_log_timeout_s) { _next_index = last_log_index + 1; _expire_time_s = butil::timespec_to_seconds(butil::seconds_from_now(_fetch_log_timeout_s)); _learner->AddRef(); } LogFetcher::~LogFetcher() { _learner->Release(); _learner = NULL; } int LogFetcher::init() { brpc::ChannelOptions channel_option; if (_channel.Init(_peer_id.addr, &channel_option) != 0) { LOG(ERROR) << "Fail to initialize [" << _peer_id << "]"; return -1; } return 0; } void LogFetcher::fetch_log() { int64_t last_committed_index = _learner->last_committed_index(); CHECK(_next_index >= last_committed_index); int64_t uncommit_size = _next_index - last_committed_index; int max_size = FLAGS_raft_max_fetch_log_size > uncommit_size ? (FLAGS_raft_max_fetch_log_size - uncommit_size) : 0; if (max_size <= 0) { LOG(INFO) << "Skip fetch log round, too many uncommit logs, uncommit_size:" << uncommit_size; return; } int64_t now = butil::gettimeofday_s(); if (_expire_time_s <= now) { // TODO : session id BRAFT_VLOG << "Fail to fetch log, session expired"; FetchLogClosure* done = new FetchLogClosure(_learner); run_closure_in_bthread(done); return; } brpc::Controller cntl; ReadCommittedLogsRequest request; request.set_group_id(_group_id); request.set_peer_id(_peer_id.to_string()); request.set_first_index(_next_index); request.set_count(max_size); ReadCommittedLogsResponse response; RaftService_Stub stub(&_channel); cntl.set_timeout_ms(FLAGS_raft_learner_req_timeout_ms); stub.read_committed_logs(&cntl, &request, &response, NULL); if (cntl.Failed() || !response.success()) { LOG(INFO) << "Fail to fetch log, rpc failed, errmsg:" << cntl.ErrorText(); FetchLogClosure* done = new FetchLogClosure(_learner); run_closure_in_bthread(done); return; } std::vector<LogEntry*> entries; butil::IOBuf& data_buf = cntl.response_attachment(); entries.reserve(response.entries_size()); for (int i = 0; i < response.entries_size(); ++i) { const EntryMeta& meta = response.entries(i); LogEntry* entry = new LogEntry; entry->AddRef(); entry->type = meta.type(); entry->id = LogId(_next_index + i, meta.term()); if (meta.peers_size() > 0) { entry->peers = new std::vector<PeerId>; for (int i = 0; i < meta.peers_size(); ++i) { entry->peers->push_back(meta.peers(i)); } } if (meta.old_peers_size() > 0) { entry->old_peers = new std::vector<PeerId>; for (int i = 0; i < meta.old_peers_size(); ++i) { entry->old_peers->push_back(meta.old_peers(i)); } } data_buf.cutn(&entry->data, meta.data_len()); entries.push_back(entry); BRAFT_VLOG << "fetch log " << entry->id.index << ", length:" << meta.data_len(); } if (entries.empty()) { LOG(INFO) << "Skip handle fetch logs from " << _peer_id << ", entries empty"; return; } int count = _learner->append_entries(&entries); if (count < 0) { for (size_t i = 0; i < entries.size(); ++i) { entries[i]->Release(); } entries.clear(); FetchLogClosure* done = new FetchLogClosure(_learner); run_closure_in_bthread(done); return; } _next_index += count; _expire_time_s = butil::timespec_to_seconds(butil::seconds_from_now(_fetch_log_timeout_s)); LOG(INFO) << "Fetched logs from " << _peer_id << ", start_index:" << request.first_index() << ", max_size:" << max_size << ", count:" << count; } } // raft
35.624113
95
0.63687
[ "vector" ]
e3989c026f5f17c7f78411c2c3bc644a57b5aac2
40,799
cc
C++
src/StandAlone/tools/extractors/partextract.cc
damu1000/Uintah
0c768664c1fe0a80eff2bbbd9b837e27f281f0a5
[ "MIT" ]
2
2021-12-17T05:50:44.000Z
2021-12-22T21:37:32.000Z
src/StandAlone/tools/extractors/partextract.cc
damu1000/Uintah
0c768664c1fe0a80eff2bbbd9b837e27f281f0a5
[ "MIT" ]
null
null
null
src/StandAlone/tools/extractors/partextract.cc
damu1000/Uintah
0c768664c1fe0a80eff2bbbd9b837e27f281f0a5
[ "MIT" ]
1
2020-11-30T04:46:05.000Z
2020-11-30T04:46:05.000Z
/* * The MIT License * * Copyright (c) 1997-2020 The University of Utah * * 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. */ /* * partextract.cc: Print out a uintah data archive for particle data * * Written by: * Biswajit Banerjee * July 2004 * Rewritten extensively by Jim Guilkey * October 2018 * Now, by specifying multiple -partvar arguments, user can extract multiple * particle variables into a single line * e.g.; > partextract -mat 0 -partvar p.damage -partvar p.velocity -timestep 2 -include_position_output MyData.uda.000 * output now includes a header line descibing what variables have been output * */ #if defined( __PGI ) // pgCC version 7.1-2 does not define strtoll (in stdlib.h or // anywhere)... However, this seems to fake the compiler into // not complaining. # define _ISOC99_SOURCE #endif #include <Core/Disclosure/TypeDescription.h> #include <Core/Geometry/Point.h> #include <Core/Geometry/Vector.h> #include <Core/Grid/Box.h> #include <Core/Grid/Grid.h> #include <Core/Grid/Level.h> //#include <Core/Grid/Variables/ShareAssignParticleVariable.h> #include <Core/Math/Matrix3.h> #include <Core/Math/MinMax.h> #include <Core/Math/SymmMatrix3.h> #include <Core/OS/Dir.h> #include <Core/Parallel/Parallel.h> #include <Core/DataArchive/DataArchive.h> #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <sstream> #include <string> #include <vector> #include <stdlib.h> // for strtoll using namespace std; using namespace Uintah; // declarations void usage(const std::string& badarg, const std::string& progname); void getParticleStrains(DataArchive* da, int mat, long64 particleID, string flag, unsigned long time_step_lower, unsigned long time_step_upper); void getParticleStresses(DataArchive* da, int mat, long64 particleID, string flag, unsigned long time_step_lower, unsigned long time_step_upper, bool include_position_output); void printParticleVariables(DataArchive* da, int mat, vector<string> particleVariable, long64 particleID, unsigned long time_step_lower, unsigned long time_step_upper, unsigned long time_step_inc, bool include_position_output); void computeEquivStress(const Matrix3& sig, double& sigeqv); void computePressure(const Matrix3& sig, double& press); void computeEquivStrain(const Matrix3& F, double& epseqv); void computeTrueStrain(const Matrix3& F, Vector& strain); void computeGreenLagrangeStrain(const Matrix3& F, Matrix3& E); void computeGreenAlmansiStrain(const Matrix3& F, Matrix3& e); void computeStretchRotation(const Matrix3& F, Matrix3& R, Matrix3& U); void printCauchyStress(const Matrix3& stress); int main( int argc, char** argv ) { Uintah::Parallel::initializeManager(argc, argv); /* * Default values */ int mat = -1; bool do_partvar=false; // bool do_partid=false; bool do_part_stress = false; bool do_part_pressure = false; bool do_part_strain = false; bool do_av_part_stress = false; bool do_av_part_strain = false; bool do_equiv_part_stress = false; bool do_equiv_part_strain = false; bool do_true_part_strain = false; bool do_lagrange_part_strain = false; bool do_euler_part_strain = false; bool include_position_output = false; unsigned long time_step_lower = 0; unsigned long time_step_upper = 1; unsigned long time_step_inc = 1; bool tslow_set = false; bool tsup_set = false; // bool tsinc_set = false; string filebase; vector<string> particleVariable; long64 particleID = 0; // set defaults for cout cout.setf(ios::scientific,ios::floatfield); cout.precision(8); /* * Parse arguments */ for(int i=1;i<argc;i++){ string s=argv[i]; if(s == "-mat"){ mat = atoi(argv[++i]); } else if(s == "-partvar"){ do_partvar=true; // particleVariable = argv[++i]; particleVariable.push_back(argv[++i]); if (particleVariable[particleVariable.size()-1][0] == '-') usage("-partvar <particle variable name>", argv[0]); } else if(s == "-partid"){ // do_partid=true; string id = argv[++i]; if (id[0] == '-') usage("-partid <particle id>", argv[0]); particleID = strtoll(argv[i],(char**)nullptr,10); } else if(s == "-part_stress"){ do_part_stress = true; if (++i < argc) { s = argv[i]; if (s == "avg") do_av_part_stress=true; else if (s == "equiv") do_equiv_part_stress=true; else if (s == "all") do_part_stress=true; else if (s == "pressure") do_part_pressure=true; else usage("-part_stress [avg or equiv or pressure or all]", argv[0]); } } else if(s == "-part_strain"){ do_part_strain = true; if (++i < argc) { s = argv[i]; if (s == "avg") do_av_part_strain=true; else if (s == "true") do_true_part_strain=true; else if (s == "equiv") do_equiv_part_strain=true; else if (s == "all") do_part_strain=true; else if (s == "lagrangian") do_lagrange_part_strain=true; else if (s == "eulerian") do_euler_part_strain=true; else usage("-part_strain [avg / true / all / lagrangian / eulerian]", argv[0]); } } else if (s == "-timestep") { time_step_lower = strtoul(argv[++i],(char**)nullptr,10); time_step_upper = time_step_lower; tslow_set = true; tsup_set = true; } else if (s == "-timesteplow") { time_step_lower = strtoul(argv[++i],(char**)nullptr,10); tslow_set = true; } else if (s == "-timestephigh") { time_step_upper = strtoul(argv[++i],(char**)nullptr,10); tsup_set = true; } else if (s == "-timestepinc") { time_step_inc = strtoul(argv[++i],(char**)nullptr,10); } else if (s == "-include_position_output") { include_position_output = true; } } filebase = argv[argc-1]; if(filebase == "" || filebase == argv[0]){ cerr << "No archive file specified\n"; usage("", argv[0]); } try { DataArchive* da = scinew DataArchive(filebase); // Recover time data vector<int> index; vector<double> times; da->queryTimesteps(index, times); ASSERTEQ(index.size(), times.size()); if (!tslow_set) time_step_lower =0; else if (time_step_lower >= times.size()) { cerr << "timesteplow must be between 0 and " << times.size()-1 << endl; abort(); } if (!tsup_set) time_step_upper = times.size()-1; else if (time_step_upper >= times.size()) { cerr << "timestephigh must be between 0 and " << times.size()-1 <<endl; abort(); } // Get the particle stresses if (do_part_stress) { if (do_av_part_stress) { cout << "\t Volume average stress = " << endl; getParticleStresses(da, mat, particleID,"avg", time_step_lower, time_step_upper, include_position_output); } else if (do_equiv_part_stress) { getParticleStresses(da, mat, particleID,"equiv",time_step_lower, time_step_upper, include_position_output); } else if (do_part_pressure) { getParticleStresses(da, mat, particleID,"pressure",time_step_lower, time_step_upper, include_position_output); } else { getParticleStresses(da, mat, particleID,"all", time_step_lower, time_step_upper, include_position_output); } } // Get the particle strains if (do_part_strain) { if (do_av_part_strain) { cout << "\t Volume average strain = " << endl; getParticleStrains(da,mat, particleID,"avg", time_step_lower,time_step_upper); } else if (do_true_part_strain) { getParticleStrains(da,mat, particleID,"true", time_step_lower,time_step_upper); } else if (do_equiv_part_strain) { getParticleStrains(da,mat, particleID,"equiv", time_step_lower,time_step_upper); } else if (do_lagrange_part_strain) { getParticleStrains(da,mat, particleID,"lagrange",time_step_lower,time_step_upper); } else if (do_euler_part_strain) { getParticleStrains(da,mat, particleID,"euler", time_step_lower,time_step_upper); } else { getParticleStrains(da,mat, particleID,"all", time_step_lower,time_step_upper); } } // Print a particular particle variable if (do_partvar) { printParticleVariables(da, mat, particleVariable, particleID, time_step_lower, time_step_upper, time_step_inc, include_position_output); } } catch (Exception& e) { cerr << "Caught exception: " << e.message() << endl; abort(); } catch(...){ cerr << "Caught unknown exception\n"; abort(); } } void usage(const std::string& badarg, const std::string& progname) { if(badarg != "") cerr << "Error parsing argument: " << badarg << endl; cerr << "Usage: " << progname << " [options] <archive file>\n\n"; cerr << "Valid options are:\n"; cerr << " -mat <material id>\n"; cerr << " -partvar <variable name>\n"; cerr << " -partid <particleid>\n"; cerr << " -part_stress [avg or equiv or pressure or all]\n"; cerr << " -part_strain [avg/true/equiv/all/lagrangian/eulerian]\n", cerr << " -timestep [int] (only outputs data for timestep int)\n"; cerr << " -timesteplow [int] (only outputs timestep from int)\n"; cerr << " -timestephigh [int] (only outputs timesteps upto int)\n"; cerr << " -include_position_output (add particle position before other data output)\n"; cerr << "USAGE IS NOT FINISHED\n\n"; exit(1); } //////////////////////////////////////////////////////////////////////////// // // Get particle strains (avg, true or all) // //////////////////////////////////////////////////////////////////////////// void getParticleStrains(DataArchive* da, int mat, long64 particleID, string flag, unsigned long time_step_lower, unsigned long time_step_upper) { // Parse the flag and check which option is needed bool doAverage = false; bool doTrue = false; bool doLagrange = false; bool doEuler = false; bool doEquiv = false; // bool doAll = false; if (flag == "avg") doAverage = true; else if (flag == "equiv") doEquiv = true; else if (flag == "true") doTrue = true; else if (flag == "lagrange") doLagrange = true; else if (flag == "euler") doEuler = true; // else doAll = true; // Check if all the required variables are there .. for all cases // we need p.deformationMeasure and for the volume average we need p.volume vector<string> vars; vector<int> num_matls; vector<const Uintah::TypeDescription*> types; da->queryVariables( vars, num_matls, types ); ASSERTEQ( vars.size(), types.size() ); bool gotVolume = false; bool gotDeform = false; for(unsigned int v=0;v<vars.size();v++){ std::string var = vars[v]; if (var == "p.volume") gotVolume = true; if (var == "p.deformationMeasure") gotDeform = true; } if (!gotDeform) { cerr << "\n **Error** getParticleStrains : DataArchiver does not " << "contain p.deformationMeasure\n"; exit(1); } if (doAverage && !gotVolume) { cerr << "\n **Error** getParticleStrains : DataArchiver does not " << "contain p.volume\n"; exit(1); } // Now that the variables have been found, get the data for all available // time steps from the data archive vector<int> index; vector<double> times; da->queryTimesteps(index, times); ASSERTEQ(index.size(), times.size()); // cerr << "There are " << index.size() << " timesteps:\n"; // Loop thru all time steps and store the volume and variable (stress/strain) for(unsigned long t=time_step_lower;t<=time_step_upper;t++){ double time = times[t]; //cerr << "Time = " << time << endl; GridP grid = da->queryGrid(t); vector<double> volumeVector; vector<Matrix3> deformVector; double totVol = 0.0; // Loop thru all the levels for(int l=0;l<grid->numLevels();l++){ LevelP level = grid->getLevel(l); // Loop thru all the patches Level::const_patch_iterator iter = level->patchesBegin(); int patchIndex = 0; for(; iter != level->patchesEnd(); iter++){ const Patch* patch = *iter; ++patchIndex; // Loop thru all the variables for(int v=0;v<(int)vars.size();v++){ std::string var = vars[v]; if (var != "p.volume" && var != "p.deformationMeasure") continue; const Uintah::TypeDescription* td = types[v]; // Check if the variable is a ParticleVariable if(td->getType() == Uintah::TypeDescription::ParticleVariable) { // loop thru all the materials ConsecutiveRangeSet matls = da->queryMaterials(var, patch, t); ConsecutiveRangeSet::iterator matlIter = matls.begin(); for(; matlIter != matls.end(); matlIter++){ int matl = *matlIter; if (mat != -1 && matl != mat) continue; // Find the name of the variable if (doAverage) { cerr << "Finding volume average strains ... " << endl; if (var == "p.volume") { switch(td->getSubType()->getType()) { case Uintah::TypeDescription::double_type: { ParticleVariable<double> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ volumeVector.push_back(value[*iter]); totVol += value[*iter]; } } } break; case Uintah::TypeDescription::float_type: { ParticleVariable<float> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ volumeVector.push_back((double)(value[*iter])); totVol += value[*iter]; } } } break; default: cerr << "Particle Variable of unknown type: " << td->getSubType()->getType() << endl; break; } } else if (var == "p.deformationMeasure") { //cerr << "Material: " << matl << endl; ParticleVariable<Matrix3> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ particleIndex idx = *iter; // Find the right stretch tensor Matrix3 deformGrad = value[idx]; Matrix3 stretch(0.0), rotation(0.0); deformGrad.polarDecomposition(stretch, rotation, 1.0e-10, true); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); deformVector.push_back(stretch); } } // end of pset > 0 } // end of var if continue; } // end of doAverage // If not an average calculation if (var == "p.deformationMeasure") { //cerr << "Material: " << matl << endl; ParticleVariable<Matrix3> value; da->query(value, var, matl, patch, t); ParticleVariable<long64> pid; da->query(pid, "p.particleID", matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); if (particleID == 0) { for(;iter != pset->end(); iter++){ particleIndex idx = *iter; // Get the deformation gradient Matrix3 F = value[idx]; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << time << " " << pid[idx] << " " << patchIndex << " " << matl ; if (doTrue) { Vector trueStrain(0.0); computeTrueStrain(F, trueStrain); } else if (doEquiv) { double equiv_strain = 0.0; computeEquivStrain(F, equiv_strain); } else if (doLagrange) { Matrix3 E(0.0); computeGreenLagrangeStrain(F,E); } else if (doEuler) { Matrix3 e(0.0); computeGreenAlmansiStrain(F,e); } else { Matrix3 U(0.0), R(0.0); computeStretchRotation(F,R,U); } } } else { for(;iter != pset->end(); iter++){ particleIndex idx = *iter; if (particleID != pid[*iter]) continue; // Get the deformation gradient Matrix3 F = value[idx]; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << time << " " << pid[idx] << " " << patchIndex << " " << matl ; if (doTrue) { Vector trueStrain(0.0); computeTrueStrain(F, trueStrain); } else if (doEquiv) { double equiv_strain = 0.0; computeEquivStrain(F, equiv_strain); } else if (doLagrange) { Matrix3 E(0.0); computeGreenLagrangeStrain(F,E); } else if (doEuler) { Matrix3 e(0.0); computeGreenAlmansiStrain(F,e); } else { Matrix3 U(0.0), R(0.0); computeStretchRotation(F,R,U); } break; } // end of pset iter loop } // end of particleId = 0 if } // end of numparticle > 0 if } // end of var compare if } // end of material loop } // end of ParticleVariable if } // end of variable loop } // end of patch loop } // end of level loop if (doAverage) { // Now that the volume vector and variable vector are available just // do a weighted average ASSERTEQ(volumeVector.size(), deformVector.size()); Matrix3 avVar; for (unsigned int ii = 0; ii < volumeVector.size() ; ++ii) { avVar += ((deformVector[ii]*volumeVector[ii])/totVol); } for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << avVar(ii,jj) << " " ; } cout << endl; } } } // end of time step loop } //////////////////////////////////////////////////////////////////////////// // // Get particle stresses (avg, equiv or all) // //////////////////////////////////////////////////////////////////////////// void getParticleStresses(DataArchive* da, int mat, long64 particleID, string flag, unsigned long time_step_lower, unsigned long time_step_upper, bool include_position_output) { // Parse the flag and check which option is needed bool doAverage = false; bool doEquiv = false; bool doPress = false; // bool doAll = false; if (flag == "avg"){ doAverage = true; } else if (flag == "equiv"){ doEquiv = true; } else if (flag == "pressure"){ doPress = true; } // else doAll = true; // Check if all the required variables are there .. for all cases // we need p.stress and for the volume average we need p.volume vector<string> vars; vector<int> num_matls; vector<const Uintah::TypeDescription*> types; da->queryVariables( vars, num_matls, types ); ASSERTEQ(vars.size(), types.size()); bool gotVolume = false; bool gotStress = false; for(unsigned int v=0;v<vars.size();v++){ std::string var = vars[v]; if (var == "p.volume") gotVolume = true; if (var == "p.stress") gotStress = true; } if (!gotStress) { cerr << "\n **Error** getParticleStresses : DataArchiver does not " << "contain p.stress\n"; exit(1); } if (doAverage && !gotVolume) { cerr << "\n **Error** getParticleStresses : DataArchiver does not " << "contain p.volume\n"; exit(1); } // Now that the variables have been found, get the data for all available // time steps // from the data archive vector<int> index; vector<double> times; da->queryTimesteps(index, times); ASSERTEQ(index.size(), times.size()); //cout << "There are " << index.size() << " timesteps:\n"; // Loop thru all time steps and store the volume and variable (stress/strain) for(unsigned long t=time_step_lower;t<=time_step_upper;t++){ double time = times[t]; //cout << "Time = " << time << endl; GridP grid = da->queryGrid(t); vector<double> volumeVector; vector<Matrix3> stressVector; vector<Point> posVector; double totVol = 0.0; // Loop thru all the levels for(int l=0;l<grid->numLevels();l++){ LevelP level = grid->getLevel(l); // Loop thru all the patches Level::const_patch_iterator iter = level->patchesBegin(); int patchIndex = 0; for(; iter != level->patchesEnd(); iter++){ const Patch* patch = *iter; ++patchIndex; // Loop thru all the variables for(int v=0;v<(int)vars.size();v++){ std::string var = vars[v]; const Uintah::TypeDescription* td = types[v]; // Check if the variable is a ParticleVariable if(td->getType() == Uintah::TypeDescription::ParticleVariable) { // loop thru all the materials ConsecutiveRangeSet matls = da->queryMaterials(var, patch, t); ConsecutiveRangeSet::iterator matlIter = matls.begin(); for(;matlIter != matls.end(); matlIter++){ int matl = *matlIter; if (mat != -1 && matl != mat) continue; // Find the name of the variable if (doAverage) { if (var == "p.volume") { switch(td->getSubType()->getType()) { case Uintah::TypeDescription::double_type: { ParticleVariable<double> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ volumeVector.push_back(value[*iter]); totVol += value[*iter]; } } } break; case Uintah::TypeDescription::float_type: { ParticleVariable<float> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ volumeVector.push_back((double)(value[*iter])); totVol += value[*iter]; } } } break; default: cerr << "Particle Variable of unknown type: " << td->getSubType()->getType() << endl; break; } } else if (var == "p.stress") { ParticleVariable<Matrix3> value; da->query(value, var, matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ stressVector.push_back(value[*iter]); } } } continue; } // If not a volume averaged quantity if (var == "p.stress") { ParticleVariable<Matrix3> value; da->query(value, var, matl, patch, t); ParticleVariable<long64> pid; da->query(pid, "p.particleID", matl, patch, t); ParticleSubset* pset = value.getParticleSubset(); ParticleVariable<Point> value_pos; da->query(value_pos, "p.x", matl, patch, t); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ if (particleID == 0) { Matrix3 stress = value[*iter]; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << time << " " << pid[*iter] << " " << patchIndex << " " << matl ; if(include_position_output){ cout << " " << value_pos[*iter].x() << " " << value_pos[*iter].y() << " " << value_pos[*iter].z() ; } if (doEquiv) { double sigeff = 0.0; computeEquivStress(stress, sigeff); } else if(doPress) { double press = 0.0; computePressure(stress, press); } else { printCauchyStress(stress); } } else { Matrix3 stress = value[*iter]; if (particleID != pid[*iter]) continue; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << time << " " << pid[*iter] << " " << patchIndex << " " << matl ; if(include_position_output){ cout << " " << value_pos[*iter].x() << " " << value_pos[*iter].y() << " " << value_pos[*iter].z() ; } if (doEquiv) { double sigeff = 0.0; computeEquivStress(stress, sigeff); } else if(doPress) { double press = 0.0; computePressure(stress, press); } else { printCauchyStress(stress); } break; } } } } // end of var compare if } // end of material loop } // end of ParticleVariable if } // end of variable loop } // end of patch loop } // end of level loop if (doAverage) { // Now that the volume vector and variable vector are available just // do a weighted average ASSERTEQ(volumeVector.size(), stressVector.size()); Matrix3 avVar; for (unsigned int ii = 0; ii < volumeVector.size() ; ++ii) { avVar += ((stressVector[ii]*volumeVector[ii])/totVol); } for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << avVar(ii,jj) << " " ; } cout << endl; } } } // end of time step loop } //////////////////////////////////////////////////////////////////////////// // // Print a particle variable // //////////////////////////////////////////////////////////////////////////// void printParticleVariables(DataArchive* da, int mat, vector<string> particleVariable, long64 particleID, unsigned long time_step_lower, unsigned long time_step_upper, unsigned long time_step_inc, bool include_position_output) { // Check if the particle variable is available vector<string> vars; vector<int> num_matls; vector<const Uintah::TypeDescription*> types; da->queryVariables( vars, num_matls, types ); ASSERTEQ(vars.size(), types.size()); // Check to see if p.particleID is available bool have_partIDs = false; for(unsigned int v=0;v<vars.size();v++){ std::string var = vars[v]; if(var == "p.particleID"){ have_partIDs = true; } } // Make sure other variables requested are in the saved data for(unsigned int pv=0;pv<particleVariable.size();pv++){ bool variableFound = false; for(unsigned int v=0;v<vars.size();v++){ std::string var = vars[v]; const Uintah::TypeDescription* td = types[v]; if(var == particleVariable[pv]){ variableFound = true; if(td->getType() != Uintah::TypeDescription::ParticleVariable) { cerr << "partextract is only for particle variables" << endl; exit(1); } // end of ParticleVariable if } } // loop over list of all variables if (!variableFound) { cerr << "Variable " << particleVariable[pv] << " not found\n"; exit(1); } } // loop over particleVariables // Print out a header line if(have_partIDs){ cout << "% Time patchIndex material particleID"; } else { cout << "% Time patchIndex material"; } if(include_position_output){ cout << " position"; } for(unsigned int pv=0;pv<particleVariable.size();pv++){ cout << " " << particleVariable[pv]; } cout << endl; // Now that the variables have been found, get the data for all // available time steps from the data archive vector<int> index; vector<double> times; da->queryTimesteps(index, times); ASSERTEQ(index.size(), times.size()); //cout << "There are " << index.size() << " timesteps:\n"; int matl = mat; // Loop thru all time steps and store the volume and variable (stress/strain) for(unsigned long t=time_step_lower;t<=time_step_upper;t+=time_step_inc){ double time = times[t]; //cout << "Time = " << time << endl; GridP grid = da->queryGrid(t); // Loop thru all the levels for(int l=0;l<grid->numLevels();l++){ LevelP level = grid->getLevel(l); // Loop thru all the patches Level::const_patch_iterator iter = level->patchesBegin(); int patchIndex = 0; for(; iter != level->patchesEnd(); iter++){ const Patch* patch = *iter; ++patchIndex; // Find the name of the variable ParticleVariable<Point> pos; da->query(pos, "p.x", matl, patch, t); ParticleVariable<long64> pid; if(have_partIDs){ da->query(pid, "p.particleID", matl, patch, t); } ParticleSubset* pset = pos.getParticleSubset(); if(pset->numParticles() > 0){ ParticleSubset::iterator iter = pset->begin(); for(;iter != pset->end(); iter++){ if (particleID == 0 || particleID == pid[*iter]) { cout << time << " " << patchIndex << " " << matl; if(have_partIDs){ cout << " " << pid[*iter]; } if(include_position_output){ cout << " " << pos[*iter].x() << " " << pos[*iter].y() << " " << pos[*iter].z() ; } // Loop over all the requested particle variables for(unsigned int pv=0;pv<particleVariable.size();pv++){ // Loop thru all the variables for(int v=0;v<(int)vars.size();v++){ std::string var = vars[v]; const Uintah::TypeDescription* td = types[v]; const Uintah::TypeDescription* subtype = td->getSubType(); if (var == particleVariable[pv]) { switch(subtype->getType()){ case Uintah::TypeDescription::double_type: { ParticleVariable<double> value; da->query(value, var, matl, patch, t); cout << " " << value[*iter]; } break; case Uintah::TypeDescription::float_type: { ParticleVariable<float> value; da->query(value, var, matl, patch, t); cout << " " << value[*iter]; } break; case Uintah::TypeDescription::int_type: { ParticleVariable<int> value; da->query(value, var, matl, patch, t); cout << " " << value[*iter]; } break; case Uintah::TypeDescription::Point: { ParticleVariable<Point> value; ParticleSubset::iterator iter = pset->begin(); cout << " " << value[*iter](0) << " " << value[*iter](1) << " " << value[*iter](2) << " "; } break; case Uintah::TypeDescription::Vector: { ParticleVariable<Vector> value; da->query(value, var, matl, patch, t); cout << " " << value[*iter][0] << " " << value[*iter][1] << " " << value[*iter][2] << " "; } break; case Uintah::TypeDescription::Matrix3: { ParticleVariable<Matrix3> value; da->query(value, var, matl, patch, t); for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << " " << value[*iter](ii,jj) ; } } cout << " "; } break; case Uintah::TypeDescription::long64_type: { ParticleVariable<long64> value; da->query(value, var, matl, patch, t); cout << " " << value[*iter] << " "; } break; default: cerr << "Particle Variable of unknown type: " << subtype->getType() << endl; break; } // switch } // end of var compare if } // end of variable loop } // end of loop over particleVariables } // if all particleIDs or this particular particleID cout << endl; } // end of loop over particles } // if pset not empty } // end of patch loop } // end of level loop } // end of time step loop } void computeEquivStress(const Matrix3& stress, double& sigeff) { Matrix3 I; I.Identity(); Matrix3 s = stress - I*stress.Trace()/3.0; sigeff = sqrt(1.5*s.NormSquared()); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << " " << sigeff << endl; } void computePressure(const Matrix3& stress, double& press) { press = (-1./3.)*stress.Trace(); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << " " << press << endl; } void computeEquivStrain(const Matrix3& F, double& equiv_strain) { Matrix3 I; I.Identity(); Matrix3 E = (F.Transpose()*F-I)*0.5; equiv_strain = sqrt(E.NormSquared()/1.5); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << " " << equiv_strain ; cout << endl; } void computeTrueStrain(const Matrix3& F, Vector& strain) { // Compute the left Cauchy-Green tensor Matrix3 C = F.Transpose()*F; // Find the eigenvalues of C Vector Lambda; Matrix3 direction; C.eigen(Lambda, direction); // Find the stretches Vector lambda; for (int ii =0; ii < 3; ++ii) { lambda[ii] = sqrt(Lambda[ii]); strain[ii] = log(lambda[ii]); } cout.setf(ios::scientific,ios::floatfield); cout.precision(6); for (int ii = 0; ii < 3; ++ii) { cout << " " << strain[ii] ; } cout << endl; } void computeGreenLagrangeStrain(const Matrix3& F, Matrix3& E) { Matrix3 I; I.Identity(); Matrix3 C = F.Transpose()*F; E = (C - I)*0.5; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); for (int ii = 0; ii < 3; ++ii) cout << " " << E(ii,ii); cout << " " << E(1,2); cout << " " << E(2,0); cout << " " << E(0,1); cout << endl; } // Calculate the Almansi-Hamel strain tensor void computeGreenAlmansiStrain(const Matrix3& F, Matrix3& e) { Matrix3 I; I.Identity(); Matrix3 b = F*F.Transpose(); Matrix3 binv = b.Inverse(); e = (I - binv)*0.5; cout.setf(ios::scientific,ios::floatfield); cout.precision(6); for (int ii = 0; ii < 3; ++ii) cout << " " << e(ii,ii); cout << " " << e(1,2); cout << " " << e(2,0); cout << " " << e(0,1); cout << endl; } void computeStretchRotation(const Matrix3& F, Matrix3& R, Matrix3& U) { F.polarDecomposition(U, R, 1.0e-10, true); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << " " << F(ii,jj); } } for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << " " << U(ii,jj); } } for (int ii = 0; ii < 3; ++ii) { for (int jj = 0; jj < 3; ++jj) { cout << " " << R(ii,jj); } } cout << endl; } void printCauchyStress(const Matrix3& stress) { double sig11 = stress(0,0); double sig12 = stress(0,1); double sig13 = stress(0,2); double sig22 = stress(1,1); double sig23 = stress(1,2); double sig33 = stress(2,2); cout.setf(ios::scientific,ios::floatfield); cout.precision(6); cout << " " << sig11 << " " << sig22 << " " << sig33 << " " << sig23 << " " << sig13 << " " << sig12 << endl; }
36.460232
121
0.519351
[ "geometry", "vector" ]
e3a2d8c47d55e9ddde2fe09f5c12bffc0c3c0412
4,327
cpp
C++
clients/cpp-tiny/generated/lib/Models/PipelineRunNode.cpp
cliffano/jenkins-api-clients-generator
522d02b3a130a29471df5ec1d3d22c822b3d0813
[ "MIT" ]
null
null
null
clients/cpp-tiny/generated/lib/Models/PipelineRunNode.cpp
cliffano/jenkins-api-clients-generator
522d02b3a130a29471df5ec1d3d22c822b3d0813
[ "MIT" ]
null
null
null
clients/cpp-tiny/generated/lib/Models/PipelineRunNode.cpp
cliffano/jenkins-api-clients-generator
522d02b3a130a29471df5ec1d3d22c822b3d0813
[ "MIT" ]
null
null
null
#include "PipelineRunNode.h" using namespace Tiny; PipelineRunNode::PipelineRunNode() { _class = std::string(); displayName = std::string(); durationInMillis = int(0); edges = std::list<PipelineRunNodeedges>(); id = std::string(); result = std::string(); startTime = std::string(); state = std::string(); } PipelineRunNode::PipelineRunNode(std::string jsonString) { this->fromJson(jsonString); } PipelineRunNode::~PipelineRunNode() { } void PipelineRunNode::fromJson(std::string jsonObj) { bourne::json object = bourne::json::parse(jsonObj); const char *_classKey = "_class"; if(object.has_key(_classKey)) { bourne::json value = object[_classKey]; jsonToValue(&_class, value, "std::string"); } const char *displayNameKey = "displayName"; if(object.has_key(displayNameKey)) { bourne::json value = object[displayNameKey]; jsonToValue(&displayName, value, "std::string"); } const char *durationInMillisKey = "durationInMillis"; if(object.has_key(durationInMillisKey)) { bourne::json value = object[durationInMillisKey]; jsonToValue(&durationInMillis, value, "int"); } const char *edgesKey = "edges"; if(object.has_key(edgesKey)) { bourne::json value = object[edgesKey]; std::list<PipelineRunNodeedges> edges_list; PipelineRunNodeedges element; for(auto& var : value.array_range()) { element.fromJson(var.dump()); edges_list.push_back(element); } edges = edges_list; } const char *idKey = "id"; if(object.has_key(idKey)) { bourne::json value = object[idKey]; jsonToValue(&id, value, "std::string"); } const char *resultKey = "result"; if(object.has_key(resultKey)) { bourne::json value = object[resultKey]; jsonToValue(&result, value, "std::string"); } const char *startTimeKey = "startTime"; if(object.has_key(startTimeKey)) { bourne::json value = object[startTimeKey]; jsonToValue(&startTime, value, "std::string"); } const char *stateKey = "state"; if(object.has_key(stateKey)) { bourne::json value = object[stateKey]; jsonToValue(&state, value, "std::string"); } } bourne::json PipelineRunNode::toJson() { bourne::json object = bourne::json::object(); object["_class"] = getClass(); object["displayName"] = getDisplayName(); object["durationInMillis"] = getDurationInMillis(); std::list<PipelineRunNodeedges> edges_list = getEdges(); bourne::json edges_arr = bourne::json::array(); for(auto& var : edges_list) { PipelineRunNodeedges obj = var; edges_arr.append(obj.toJson()); } object["edges"] = edges_arr; object["id"] = getId(); object["result"] = getResult(); object["startTime"] = getStartTime(); object["state"] = getState(); return object; } std::string PipelineRunNode::getClass() { return _class; } void PipelineRunNode::setClass(std::string _class) { this->_class = _class; } std::string PipelineRunNode::getDisplayName() { return displayName; } void PipelineRunNode::setDisplayName(std::string displayName) { this->displayName = displayName; } int PipelineRunNode::getDurationInMillis() { return durationInMillis; } void PipelineRunNode::setDurationInMillis(int durationInMillis) { this->durationInMillis = durationInMillis; } std::list<PipelineRunNodeedges> PipelineRunNode::getEdges() { return edges; } void PipelineRunNode::setEdges(std::list <PipelineRunNodeedges> edges) { this->edges = edges; } std::string PipelineRunNode::getId() { return id; } void PipelineRunNode::setId(std::string id) { this->id = id; } std::string PipelineRunNode::getResult() { return result; } void PipelineRunNode::setResult(std::string result) { this->result = result; } std::string PipelineRunNode::getStartTime() { return startTime; } void PipelineRunNode::setStartTime(std::string startTime) { this->startTime = startTime; } std::string PipelineRunNode::getState() { return state; } void PipelineRunNode::setState(std::string state) { this->state = state; }
13.437888
65
0.644557
[ "object" ]
e3a418b981ecd64ab2e891fbd0edfa3622ddced8
3,538
cpp
C++
src/PokerTable.cpp
InversePalindrome/Variadic-Poker
68f7fe5ab8f9adc641719f96c82a6812d2c939fe
[ "MIT" ]
8
2017-04-13T15:38:15.000Z
2022-02-01T03:18:48.000Z
src/PokerTable.cpp
InversePalindrome/Variadic-Poker
68f7fe5ab8f9adc641719f96c82a6812d2c939fe
[ "MIT" ]
1
2020-06-28T08:45:05.000Z
2020-06-28T08:45:05.000Z
src/PokerTable.cpp
InversePalindrome/Variadic-Poker
68f7fe5ab8f9adc641719f96c82a6812d2c939fe
[ "MIT" ]
3
2019-09-27T04:24:00.000Z
2021-12-11T18:42:26.000Z
/* Copyright (c) 2017 InversePalindrome VariadicPoker - PokerTable.cpp InversePalindrome.com */ #include <algorithm> #include "PokerTable.hpp" PokerTable::PokerTable(const std::vector<Player>& players) : PokerTable(players, 10, 0) { } PokerTable::PokerTable(const std::vector<Player>& players, std::size_t bigBlind) : PokerTable(players, bigBlind, 0) { } PokerTable::PokerTable(const std::vector<Player>& players, std::size_t bigBlind, std::size_t ante) : players(players), bigBlind(bigBlind), ante(ante), pot(0) { } Player PokerTable::getPlayer(const std::string& playerName) const { return this->players.at(std::distance(this->players.begin(), std::find_if(this->players.begin(), this->players.end(), [&](const Player & player) { return player.getName() == playerName; }))); } std::vector<Player> PokerTable::getPlayers() const { return this->players; } std::size_t PokerTable::getBigBlind() const { return this->bigBlind; } std::size_t PokerTable::getAnte() const { return this->ante; } std::size_t PokerTable::getPot() const { return this->pot; } std::size_t PokerTable::getSize() const { return this->players.size(); } void PokerTable::setPlayers(const std::vector<Player>& players) { this->players = players; } void PokerTable::setBigBlind(std::size_t chips) { this->bigBlind = chips; } void PokerTable::setAnte(std::size_t chips) { this->ante = chips; } void PokerTable::setPot(std::size_t chips) { this->pot = chips; } void PokerTable::addPlayer(const Player& player) { this->players.push_back(player); } void PokerTable::addToPot(std::size_t chips) { this->pot += chips; } void PokerTable::addChipsToPlayer(const std::string& playerName, std::size_t chips) { this->players.at(this->findPlayer(playerName)).addToStack(chips); } void PokerTable::removePlayer(const std::string& playerName) { this->players.erase(this->players.begin() + this->findPlayer(playerName)); } void PokerTable::removeChipsFromPlayer(const std::string & playerName, std::size_t chips) { this->players.at(this->findPlayer(playerName)).removeFromStack(chips); } void PokerTable::insertPlayer(const Player & player, std::size_t playerPosition) { this->players.insert(this->players.begin() + playerPosition, player); } void PokerTable::clearPlayers() { this->players.clear(); } void PokerTable::clearPot() { this->pot = 0; } std::size_t PokerTable::findPlayer(const std::string & playerName) const { return std::distance(this->players.begin(), std::find_if(this->players.begin(), this->players.end(), [&](const Player & player2) { return playerName == player2.getName(); })); } std::size_t PokerTable::activePlayerCount() const { return std::count_if(this->players.begin(), this->players.end(), [&](const Player & player) { return player.isActive() && player.getStack() > 0; }); } std::size_t PokerTable::allInCount() const { return std::count_if(this->players.begin(), this->players.end(), [&](const Player & player) { return player.isActive() && player.getStack() == 0; }); } bool PokerTable::hasPlayers() const { return !this->players.empty(); } std::string PokerTable::toString() const { return "| " + std::to_string(this->bigBlind / 2) + " / " + std::to_string(this->bigBlind) + " blinds | " + std::to_string(this->ante) + " ante |"; }
24.232877
151
0.657151
[ "vector" ]
e3a70e29424a46b23a779795cb1daec205255a54
3,566
cpp
C++
experiment/midi.cpp
keryell/muSYCL
130e4b29c3a4daf4c908b08263b53910acb13787
[ "Apache-2.0" ]
16
2021-05-07T11:33:59.000Z
2022-03-05T02:36:06.000Z
experiment/midi.cpp
keryell/muSYCL
130e4b29c3a4daf4c908b08263b53910acb13787
[ "Apache-2.0" ]
null
null
null
experiment/midi.cpp
keryell/muSYCL
130e4b29c3a4daf4c908b08263b53910acb13787
[ "Apache-2.0" ]
null
null
null
#include "rtmidi/RtMidi.h" #include <atomic> #include <chrono> #include <csignal> #include <cstdint> #include <cstdlib> #include <iostream> #include <memory> #include <thread> #include <vector> /// The configuration part to adapt to the context // Jack auto constexpr midi_api = RtMidi::UNIX_JACK; auto constexpr midi_in_port = 0; // ALSA //auto constexpr midi_api = RtMidi::LINUX_ALSA; //auto constexpr midi_in_port = 1; // To use time unit literals directly using namespace std::chrono_literals; namespace { /// Set to true to end the infinite loop std::atomic<bool> done = false; } /// Execute some RtMidi code while checking for error auto check_error = [] (auto&& function) { try { return function(); } catch (const RtMidiError &error) { error.printMessage(); std::exit(EXIT_FAILURE); } }; int main() { std::cout << "RtMidi version " << RtMidi::getVersion() << std::endl; /* Only from RtMidi 4.0.0... std::cout << "RtMidi version " << RtMidi::getVersion() << "\nAPI availables:" << std::endl; std::vector<RtMidi::Api> apis; RtMidi::getCompiledApi(apis); for (auto a : apis) std::cout << '\t' << RtMidi::getApiName(a) << std::endl; */ // Create a MIDI input using Jack and a fancy client name auto midi_in = check_error([] { return RtMidiIn { midi_api, "muSYCLtest" }; }); // Check inputs auto n_in_ports = midi_in.getPortCount(); std::cout << "\nThere are " << n_in_ports << " MIDI input sources available.\n"; // Use some shared point because RtMidiIn is a broken type, it is // neither copyable neither movable std::vector<std::shared_ptr<RtMidiIn>> midi_ins; for (auto i = 0; i < n_in_ports; ++i) { auto port_name = check_error([&] { return midi_in.getPortName(i); }); std::cout << " Input Port #" << i << ": " << port_name << '\n'; midi_ins.push_back(check_error([] { return std::make_shared<RtMidiIn>(midi_api, "muSYCLtest", 1000); })); check_error([&] { midi_ins[i]->openPort(i, "testMIDIinput"); }); // Don't ignore sysex, timing, or active sensing messages midi_ins[i]->ignoreTypes(false, false, false); } // Create a MIDI output auto midi_out = check_error([] { return RtMidiOut {}; }); // Check outputs. auto n_out_ports = midi_out.getPortCount(); std::cout << "\nThere are " << n_out_ports << " MIDI output ports available.\n"; for (auto i = 0; i < n_out_ports; ++i) { auto port_name = check_error([&] { return midi_out.getPortName(i); }); std::cout << " Output Port #" << i << ": " << port_name << std::endl; } std::cout << "\nReading MIDI from port ... quit with Ctrl-C.\n\n"; // Trap SIGINT often related to Ctrl-C std::signal(SIGINT, [] (int) { done = true; }); std::vector<std::uint8_t> message; while (!done) { for (auto i = 0; i < n_in_ports; ++i) { auto stamp = midi_ins[i]->getMessage(&message); if (!message.empty()) { std::cout << "Received from port " << i << " at stamp = " << stamp << " seconds:" <<std::endl << '\t'; for (auto c : message) std::cout << std::hex << int { c } << ' '; std::cout << std::endl << '\t'; auto n_bytes = message.size(); for (int i = 0; i < n_bytes; ++i) std::cout << std::dec << "Byte " << i << " = " << static_cast<int>(message[i]) << ", "; std::cout << std::endl; } } } std::cout << "\nDone!" << std::endl; return 0; }
31.280702
74
0.584128
[ "vector" ]
e3b41973bd005a76c24f0665fd6935912c39e194
38,846
cpp
C++
Sources/Elastos/Frameworks/Droid/Base/Services/Server/src/elastos/droid/server/CAssetAtlasService.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/Services/Server/src/elastos/droid/server/CAssetAtlasService.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/Frameworks/Droid/Base/Services/Server/src/elastos/droid/server/CAssetAtlasService.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/server/CAssetAtlasService.h" #include <elastos/droid/os/Environment.h> #include <elastos/droid/os/Process.h> #include <elastos/core/Math.h> #include <elastos/core/Thread.h> #include <elastos/core/StringUtils.h> #include <elastos/core/StringBuilder.h> #include <elastos/utility/logging/Logger.h> #include <elastos/droid/system/OsConstants.h> #include <Elastos.Droid.Os.h> #include <Elastos.Droid.Content.h> #include <Elastos.Droid.Utility.h> #include <Elastos.CoreLibrary.IO.h> #include <Elastos.CoreLibrary.Utility.h> #include <Elastos.CoreLibrary.Libcore.h> #include <cutils/log.h> #include <utils/StrongPointer.h> #include <ui/GraphicBuffer.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include <SkCanvas.h> #include <SkBitmap.h> using Elastos::Droid::Os::ISystemProperties; using Elastos::Droid::Os::CSystemProperties; using Elastos::Droid::Os::Process; using Elastos::Droid::Os::Environment; using Elastos::Droid::Os::EIID_IBinder; using Elastos::Droid::View::EIID_IIAssetAtlas; using Elastos::Droid::View::IGraphicBufferHelper; using Elastos::Droid::View::CGraphicBufferHelper; using Elastos::Droid::Content::Pm::IApplicationInfo; using Elastos::Droid::Graphics::CCanvas; using Elastos::Droid::Graphics::CPaint; using Elastos::Droid::Graphics::IBitmapHelper; using Elastos::Droid::Graphics::CBitmapHelper; using Elastos::Droid::Graphics::CPaint; using Elastos::Droid::Graphics::IXfermode; using Elastos::Droid::Graphics::PorterDuffMode_SRC; using Elastos::Droid::Graphics::CPorterDuffXfermode; using Elastos::Droid::Graphics::BitmapConfig; using Elastos::Droid::Graphics::BitmapConfig_ARGB_8888; using Elastos::Droid::Graphics::BitmapCompressFormat_PNG; using Elastos::Droid::Graphics::AtlasType_SliceMinArea; using Elastos::Droid::Graphics::AtlasType_COUNT; using Elastos::Droid::Graphics::Drawable::IDrawableConstantState; using Elastos::Droid::Graphics::Drawable::EIID_IDrawableConstantState; using Elastos::Droid::Graphics::CAtlas; using Elastos::Droid::Graphics::CAtlasEntry; using Elastos::Core::Thread; using Elastos::Core::IThread; using Elastos::Core::CThread; using Elastos::Core::ISystem; using Elastos::Core::CSystem; using Elastos::Core::StringUtils; using Elastos::Core::StringBuilder; using Elastos::Core::EIID_IComparator; using Elastos::IO::IWriter; using Elastos::IO::IReader; using Elastos::IO::ICloseable; using Elastos::IO::CFile; using Elastos::IO::IInputStream; using Elastos::IO::IOutputStream; using Elastos::IO::CFileInputStream; using Elastos::IO::CFileOutputStream; using Elastos::IO::COutputStreamWriter; using Elastos::IO::CInputStreamReader; using Elastos::IO::CBufferedWriter; using Elastos::IO::CBufferedReader; using Elastos::Utility::ICollections; using Elastos::Utility::CCollections; using Elastos::Utility::IIterator; using Elastos::Utility::CArrayList; using Elastos::Utility::Concurrent::CCountDownLatch; using Elastos::Utility::Concurrent::ITimeUnit; using Elastos::Utility::Concurrent::ITimeUnitHelper; using Elastos::Utility::Concurrent::CTimeUnitHelper; using Elastos::Utility::Concurrent::Atomic::CAtomicBoolean; using Elastos::Utility::Logging::Logger; using Elastos::Droid::System::OsConstants; using Libcore::IO::IOs; using Libcore::IO::ILibcore; using Libcore::IO::CLibcore; namespace Elastos { namespace Droid { namespace Server { /** * Name of the <code>CAssetAtlasService</code>. */ const String CAssetAtlasService::ASSET_ATLAS_SERVICE("assetatlas"); const String CAssetAtlasService::TAG("CAssetAtlasService"); // Turns debug logs on/off. Debug logs are kept to a minimum and should // remain on to diagnose issues const Boolean CAssetAtlasService::DEBUG_ATLAS = FALSE; // When set to TRUE the content of the atlas will be saved to disk // in /data/system/atlas.png. The shared GraphicBuffer may be empty const Boolean CAssetAtlasService::DEBUG_ATLAS_TEXTURE = FALSE; // Minimum size in pixels to consider for the resulting texture const Int32 CAssetAtlasService::MIN_SIZE = 768; // Maximum size in pixels to consider for the resulting texture const Int32 CAssetAtlasService::MAX_SIZE = 2048; // Increment in number of pixels between size variants when looking // for the best texture dimensions const Int32 CAssetAtlasService::STEP = 64; // This percentage of the total number of pixels represents the minimum // number of pixels we want to be able to pack in the atlas const Float CAssetAtlasService::PACKING_THRESHOLD = 0.8f; // Defines the number of Int32 fields used to represent a single entry // in the atlas map. This number defines the size of the array returned // by the GetMap(). See the mAtlasMap field for more information const Int32 CAssetAtlasService::ATLAS_MAP_ENTRY_FIELD_COUNT = 4; // Specifies how our GraphicBuffer will be used. To get proper swizzling // the buffer will be written to using OpenGL (from JNI) so we can leave // the software flag set to "never" const Int32 CAssetAtlasService::GRAPHIC_BUFFER_USAGE = IGraphicBuffer::USAGE_SW_READ_NEVER | IGraphicBuffer::USAGE_SW_WRITE_NEVER | IGraphicBuffer::USAGE_HW_TEXTURE; //=============================================================================== // CAssetAtlasService::Renderer //=============================================================================== CAssetAtlasService::Renderer::Renderer( /* [in] */ List<AutoPtr<IBitmap> >* bitmaps, /* [in] */ Int32 pixelCount, /* [in] */ CAssetAtlasService* host) { mBitmaps = bitmaps; mPixelCount = pixelCount; mNativeBitmap = 0; mHost = host; } ECode CAssetAtlasService::Renderer::Run() { AutoPtr<Configuration> config = mHost->ChooseConfiguration( mBitmaps, mPixelCount, mHost->mVersionName); if (DEBUG_ATLAS) Logger::D(CAssetAtlasService::TAG, "Loaded configuration: %s", TO_CSTR(config)); if (config != NULL) { AutoPtr<IGraphicBufferHelper> helper; CGraphicBufferHelper::AcquireSingleton((IGraphicBufferHelper**)&helper); mHost->mBuffer = NULL; helper->Create(config->mWidth, config->mHeight, IPixelFormat::RGBA_8888, CAssetAtlasService::GRAPHIC_BUFFER_USAGE, (IGraphicBuffer**)&mHost->mBuffer); if (mHost->mBuffer != NULL) { AutoPtr<IAtlas> atlas; CAtlas::New(config->mType, config->mWidth, config->mHeight, config->mFlags, (IAtlas**)&atlas); if (RenderAtlas(mHost->mBuffer, atlas, config->mCount)) { mHost->mAtlasReady->Set(TRUE); } } } return NOERROR; } Boolean CAssetAtlasService::Renderer::RenderAtlas( /* [in] */ IGraphicBuffer* buffer, /* [in] */ IAtlas* atlas, /* [in] */ Int32 packCount) { if (DEBUG_ATLAS) Logger::I(TAG, " RenderAtlas: packCount=%d, buffer:%s", packCount, TO_CSTR(buffer)); // Use a Source blend mode to improve performance, the target bitmap // will be zero'd out so there's no need to waste time applying blending AutoPtr<IPaint> paint; CPaint::New((IPaint**)&paint); AutoPtr<IPorterDuffXfermode> pdm; CPorterDuffXfermode::New(PorterDuffMode_SRC, (IPorterDuffXfermode**)&pdm); paint->SetXfermode(IXfermode::Probe(pdm)); // We always render the atlas into a bitmap. This bitmap is then // uploaded into the GraphicBuffer using OpenGL to swizzle the content Int32 w, h; buffer->GetWidth(&w); buffer->GetHeight(&h); AutoPtr<ICanvas> canvas = AcquireCanvas(w, h); if (canvas == NULL) return FALSE; AutoPtr<IAtlasEntry> entry; CAtlasEntry::New((IAtlasEntry**)&entry); mHost->mAtlasMap = ArrayOf<Int64>::Alloc(packCount * ATLAS_MAP_ENTRY_FIELD_COUNT); AutoPtr< ArrayOf<Int64> > atlasMap = mHost->mAtlasMap; Int32 mapIndex = 0; AutoPtr<ISystem> system; CSystem::AcquireSingleton((ISystem**)&system); Boolean result = FALSE; Int64 startRender; system->GetNanoTime(&startRender); Int32 x, y, ival; Handle64 bmp; Boolean rotated; List<AutoPtr<IBitmap> >::Iterator it; Int32 index = 0; for (it = mBitmaps->Begin(); it != mBitmaps->End(); ++it) { AutoPtr<IBitmap> bitmap = *it; bitmap->GetWidth(&w); bitmap->GetHeight(&h); AutoPtr<IAtlasEntry> ae; atlas->Pack(w, h, entry, (IAtlasEntry**)&ae); if (ae != NULL) { // We have more bitmaps to pack than the current configuration // says, we were most likely not able to detect a change in the // list of preloaded drawables, abort and delete the configuration if (mapIndex >= mHost->mAtlasMap->GetLength()) { DeleteDataFile(); break; } entry->GetX(&x); entry->GetY(&y); entry->GetRotated(&rotated); canvas->Save(&ival); canvas->Translate(x, y); if (rotated) { bitmap->GetHeight(&h); canvas->Translate(h, 0.0f); canvas->Rotate(90.0f); } canvas->DrawBitmap(bitmap, 0.0f, 0.0f, NULL); canvas->Restore(); bitmap->GetNativeBitmap(&bmp); atlasMap->Set(mapIndex++, bmp); atlasMap->Set(mapIndex++, x); atlasMap->Set(mapIndex++, y); atlasMap->Set(mapIndex++, rotated ? 1 : 0); } else { if (DEBUG_ATLAS) Logger::W(TAG, " RenderAtlas: pack bitmap at %d failed, bitmap:%s, w:h=(%d, %d)", index, TO_CSTR(bitmap), w, h); } index++; } Int64 endRender; system->GetNanoTime(&endRender); if (mNativeBitmap != 0) { result = mHost->NavtiveUploadAtlas(buffer, mNativeBitmap); } Int64 endUpload; system->GetNanoTime(&endUpload); if (DEBUG_ATLAS) { Float renderDuration = (endRender - startRender) / 1000.0f / 1000.0f; Float uploadDuration = (endUpload - endRender) / 1000.0f / 1000.0f; Logger::D(CAssetAtlasService::TAG, "Rendered atlas in %.2fms (%.2f+%.2fms)", renderDuration + uploadDuration, renderDuration, uploadDuration); } ReleaseCanvas(canvas); return result; } AutoPtr<ICanvas> CAssetAtlasService::Renderer::AcquireCanvas( /* [in] */ Int32 width, /* [in] */ Int32 height) { AutoPtr<ICanvas> canvas; if (DEBUG_ATLAS_TEXTURE) { AutoPtr<IBitmapHelper> helper; CBitmapHelper::AcquireSingleton((IBitmapHelper**)&helper); helper->CreateBitmap(width, height, BitmapConfig_ARGB_8888, (IBitmap**)&mAtlasBitmap); CCanvas::New(mAtlasBitmap, (ICanvas**)&canvas); } else { CCanvas::New((ICanvas**)&canvas); mNativeBitmap = mHost->NativeAcquireAtlasCanvas(canvas, width, height); } return canvas; } void CAssetAtlasService::Renderer::ReleaseCanvas( /* [in] */ ICanvas* canvas) { if (DEBUG_ATLAS_TEXTURE) { canvas->SetBitmap(NULL); AutoPtr<IFile> systemDirectory; CFile::New(Environment::GetDataDirectory(), String("system"), (IFile**)&systemDirectory); AutoPtr<IFile> dataFile; CFile::New(systemDirectory, String("atlas.png"), (IFile**)&dataFile); // try { AutoPtr<IOutputStream> out; CFileOutputStream::New(dataFile, (IOutputStream**)&out); Boolean bval; mAtlasBitmap->Compress(BitmapCompressFormat_PNG, 100, out, &bval); ICloseable::Probe(out)->Close(); // } catch (FileNotFoundException e) { // // Ignore // } catch (IOException e) { // // Ignore // } mAtlasBitmap->Recycle(); mAtlasBitmap = NULL; } else { mHost->NativeReleaseAtlasCanvas(canvas, mNativeBitmap); } } //=============================================================================== // CAssetAtlasService::Configuration //=============================================================================== CAssetAtlasService::Configuration::Configuration( /* [in] */ AtlasType type, /* [in] */ Int32 width, /* [in] */ Int32 height, /* [in] */ Int32 count) : mType(type) , mWidth(width) , mHeight(height) , mCount(count) , mFlags(IAtlas::FLAG_DEFAULTS) { } CAssetAtlasService::Configuration::Configuration( /* [in] */ AtlasType type, /* [in] */ Int32 width, /* [in] */ Int32 height, /* [in] */ Int32 count, /* [in] */ Int32 flags) : mType(type) , mWidth(width) , mHeight(height) , mCount(count) , mFlags(flags) {} //@Override ECode CAssetAtlasService::Configuration::ToString( /* [out] */ String* str) { VALIDATE_NOT_NULL(str) StringBuilder sb(128); sb += "configuration{type="; sb += mType; sb += ", ("; sb += mWidth; sb += "x"; sb += mHeight; sb += ")"; sb += ", flags=0x"; sb += StringUtils::ToHexString(mFlags); sb += ", count="; sb += mCount; sb += "}"; *str = sb.ToString(); return NOERROR; } //=============================================================================== // CAssetAtlasService::WorkerResult //=============================================================================== CAssetAtlasService::WorkerResult::WorkerResult( /* [in] */ AtlasType type, /* [in] */ Int32 width, /* [in] */ Int32 height, /* [in] */ Int32 count) : mType(type) , mWidth(width) , mHeight(height) , mCount(count) { } //@Override ECode CAssetAtlasService::WorkerResult::ToString( /* [out] */ String* str) { VALIDATE_NOT_NULL(str) StringBuilder sb(128); sb += mType; sb += "("; sb += mWidth; sb += "x"; sb += mHeight; sb += ")"; *str = sb.ToString(); return NOERROR; } //=============================================================================== // CAssetAtlasService::ComputeWorker //=============================================================================== CAssetAtlasService::ComputeWorker::ComputeWorker( /* [in] */ Int32 start, /* [in] */ Int32 end, /* [in] */ Int32 step, /* [in] */ List<AutoPtr<IBitmap> >* bitmaps, /* [in] */ Int32 pixelCount, /* [in] */ IList* results, /* [in] */ ICountDownLatch* signal) : mStart(start) , mEnd(end) , mStep(step) , mBitmaps(bitmaps) , mResults(results) , mSignal(signal) { // Minimum number of pixels we want to be able to pack Int32 threshold = (Int32) (pixelCount * PACKING_THRESHOLD); // Make sure we can find at least one configuration while (threshold > MAX_SIZE * MAX_SIZE) { threshold >>= 1; } mThreshold = threshold; } //@Override ECode CAssetAtlasService::ComputeWorker::Run() { if (DEBUG_ATLAS) { String name; Thread::GetCurrentThread()->GetName(&name); Logger::D(TAG, "Running %s", name.string()); } AutoPtr<IAtlasEntry> entry; CAtlasEntry::New((IAtlasEntry**)&entry); for (Int32 type = AtlasType_SliceMinArea; type < AtlasType_COUNT; ++type) { for (Int32 width = mStart; width < mEnd; width += mStep) { for (Int32 height = MIN_SIZE; height < MAX_SIZE; height += STEP) { // If the atlas is not big enough, skip it if (width * height <= mThreshold) continue; Int32 count = PackBitmaps(type, width, height, entry); if (count > 0) { AutoPtr<WorkerResult> wr = new WorkerResult(type, width, height, count); mResults->Add(TO_IINTERFACE(wr)); // If we were able to pack everything let's stop here // Increasing the height further won't make things better if (count == (Int32)mBitmaps->GetSize()) { break; } } } } } if (mSignal != NULL) { mSignal->CountDown(); } return NOERROR; } Int32 CAssetAtlasService::ComputeWorker::PackBitmaps( /* [in] */ AtlasType type, /* [in] */ Int32 width, /* [in] */ Int32 height, /* [in] */ IAtlasEntry* entry) { Int32 total = 0; AutoPtr<IAtlas> atlas; CAtlas::New(type, width, height, (IAtlas**)&atlas); Int32 w, h; List<AutoPtr<IBitmap> >::Iterator it; for (it = mBitmaps->Begin(); it != mBitmaps->End(); ++it) { AutoPtr<IBitmap> bitmap = *it; if (bitmap) { bitmap->GetWidth(&w); bitmap->GetHeight(&h); AutoPtr<IAtlasEntry> ae; atlas->Pack(w, h, entry, (IAtlasEntry**)&ae); if (ae != NULL) { total++; } } } return total; } //=============================================================================== // CAssetAtlasService::BitmapComparator //=============================================================================== CAR_INTERFACE_IMPL(CAssetAtlasService::BitmapComparator, Object, IComparator) //@Override ECode CAssetAtlasService::BitmapComparator::Compare( /* [in] */ IInterface* o1, /* [in] */ IInterface* o2, /* [out] */ Int32* result) { VALIDATE_NOT_NULL(result) IBitmap* b1 = IBitmap::Probe(o1); IBitmap* b2 = IBitmap::Probe(o2); Int32 w1, w2, h1, h2; b1->GetWidth(&w1); b2->GetWidth(&w2); b1->GetHeight(&h1); b2->GetHeight(&h2); if (w1 == w2) { *result = h2 - h1; return NOERROR; } *result = w2 - w1; return NOERROR; } //=============================================================================== // CAssetAtlasService::BitmapComparator //=============================================================================== CAR_INTERFACE_IMPL(CAssetAtlasService::WorkerResultComparator, Object, IComparator) CARAPI CAssetAtlasService::WorkerResultComparator::Compare( /* [in] */ IInterface* o1, /* [in] */ IInterface* o2, /* [out] */ Int32* result) { VALIDATE_NOT_NULL(result) WorkerResult* r1 = (WorkerResult*)IObject::Probe(o1); WorkerResult* r2 = (WorkerResult*)IObject::Probe(o2); Int32 delta = r2->mCount - r1->mCount; if (delta != 0) { *result = delta; return NOERROR; } *result = r1->mWidth * r1->mHeight - r2->mWidth * r2->mHeight; return NOERROR; } //=============================================================================== // CAssetAtlasService //=============================================================================== CAR_INTERFACE_IMPL_2(CAssetAtlasService, Object, IIAssetAtlas, IBinder) CAR_OBJECT_IMPL(CAssetAtlasService) CAssetAtlasService::CAssetAtlasService() {} ECode CAssetAtlasService::constructor( /* [in] */ IContext* context) { CAtomicBoolean::New(FALSE, (IAtomicBoolean**)&mAtlasReady); mContext = context; mVersionName = QueryVersionName(context); AutoPtr<IArrayList> bitmaps; CArrayList::New(300, (IArrayList**)&bitmaps); Int32 totalPixelCount = 0; // We only care about drawables that hold bitmaps AutoPtr<IResources> resources; context->GetResources((IResources**)&resources); AutoPtr<IInt64SparseArray> drawables; resources->GetPreloadedDrawables((IInt64SparseArray**)&drawables); Int32 count, w, h; drawables->GetSize(&count); for (Int32 i = 0; i < count; i++) { AutoPtr<IInterface> obj; drawables->ValueAt(i, (IInterface**)&obj); IDrawableConstantState* dcs = IDrawableConstantState::Probe(obj); AutoPtr<IBitmap> bitmap; dcs->GetBitmap((IBitmap**)&bitmap); if (bitmap != NULL) { BitmapConfig config; bitmap->GetConfig(&config); if (config == BitmapConfig_ARGB_8888) { bitmaps->Add(bitmap.Get()); bitmap->GetWidth(&w); bitmap->GetHeight(&h); totalPixelCount += w * h; } } } // Our algorithms perform better when the bitmaps are first sorted // The comparator will sort the bitmap by width first, then by height AutoPtr<ICollections> collections; CCollections::AcquireSingleton((ICollections**)&collections); AutoPtr<IComparator> cpt = new BitmapComparator(); collections->Sort(IList::Probe(bitmaps), cpt); // Kick off the packing work on a worker thread AutoPtr<List<AutoPtr<IBitmap> > > bmps = new List<AutoPtr<IBitmap> >(); AutoPtr<IIterator> it; bitmaps->GetIterator((IIterator**)&it); Boolean hasNext; while (it->HasNext(&hasNext), hasNext) { AutoPtr<IInterface> obj; it->GetNext((IInterface**)&obj); AutoPtr<IBitmap> bmp = IBitmap::Probe(obj); bmps->PushBack(bmp); } AutoPtr<IRunnable> runnable = new Renderer(bmps, totalPixelCount, this); AutoPtr<IThread> thread; CThread::New(runnable, (IThread**)&thread); return thread->Start(); } String CAssetAtlasService::QueryVersionName( /* [in] */ IContext* context) { String packageName; context->GetPackageName(&packageName); AutoPtr<IPackageManager> pm; context->GetPackageManager((IPackageManager**)&pm); AutoPtr<IPackageInfo> info; ECode ec = pm->GetPackageInfo(packageName, 0, (IPackageInfo**)&info); if (ec == (ECode)E_PACKAGEMANAGER_NAME_NOT_FOUND_EXCEPTION) { Logger::W(TAG, "Could not get package info"); return String(NULL); } String str; info->GetVersionName(&str); return str; } ECode CAssetAtlasService::SystemRunning() { return NOERROR; } ECode CAssetAtlasService::IsCompatible( /* [in] */ Int32 ppid, /* [out] */ Boolean* result) { VALIDATE_NOT_NULL(result) *result = ppid == Process::MyPpid(); return NOERROR; } ECode CAssetAtlasService::GetBuffer( /* [out] */ IGraphicBuffer** gb) { VALIDATE_NOT_NULL(gb) *gb = NULL; Boolean ready; mAtlasReady->Get(&ready); if (ready) { *gb = mBuffer; REFCOUNT_ADD(*gb) } return NOERROR; } ECode CAssetAtlasService::GetMap( /* [out, callee] */ ArrayOf<Int64>** map) { VALIDATE_NOT_NULL(map) *map = NULL; Boolean ready; mAtlasReady->Get(&ready); if (ready) { *map = mAtlasMap; REFCOUNT_ADD(*map) } return NOERROR; } AutoPtr<CAssetAtlasService::Configuration> CAssetAtlasService::ComputeBestConfiguration( /* [in] */ List<AutoPtr<IBitmap> >* bitmaps, /* [in] */ Int32 pixelCount) { if (DEBUG_ATLAS) { Logger::D(TAG, "Computing best atlas configuration...bitmaps:%d, pixelCount:%d", bitmaps ? bitmaps->GetSize() : 0, pixelCount); } AutoPtr<ISystem> system; CSystem::AcquireSingleton((ISystem**)&system); Int64 begin; system->GetNanoTime(&begin); AutoPtr<ICollections> collections; CCollections::AcquireSingleton((ICollections**)&collections); AutoPtr<IList> wrList; CArrayList::New((IList**)&wrList); AutoPtr<IList> results; collections->SynchronizedList(wrList, (IList**)&results); // Don't bother with an extra thread if there's only one processor AutoPtr<IOs> os; AutoPtr<ILibcore> libcore; CLibcore::AcquireSingleton((ILibcore**)&libcore); libcore->GetOs((IOs**)&os); Int64 numCpu = 1; os->Sysconf(OsConstants::__SC_NPROCESSORS_CONF, &numCpu); Int32 cpuCount = numCpu; assert(cpuCount > 0); if (cpuCount == 1) { AutoPtr<ComputeWorker> cw = new ComputeWorker( MIN_SIZE, MAX_SIZE, STEP, bitmaps, pixelCount, results, NULL); cw->Run(); } else { Int32 start = MIN_SIZE; Int32 end = MAX_SIZE - (cpuCount - 1) * STEP; Int32 step = STEP * cpuCount; Boolean bval; AutoPtr<ITimeUnitHelper> helper; CTimeUnitHelper::AcquireSingleton((ITimeUnitHelper**)&helper); AutoPtr<ITimeUnit> seconds; helper->GetSECONDS((ITimeUnit**)&seconds); AutoPtr<ICountDownLatch> sig; CCountDownLatch::New(cpuCount, (ICountDownLatch**)&sig); for (Int32 i = 0; i < cpuCount; i++, start += STEP, end += STEP) { AutoPtr<ComputeWorker> worker = new ComputeWorker(start, end, step, bitmaps, pixelCount, results, sig); StringBuilder sb("Atlas Worker #"); sb += (i + 1); AutoPtr<IThread> thread; CThread::New((IRunnable*)worker.Get(), sb.ToString(), (IThread**)&thread); thread->Start(); } ECode ec = sig->Await(10, seconds, &bval); if (ec == (ECode)E_INTERRUPTED_EXCEPTION) { Logger::W(TAG, "Could not complete configuration computation"); return NULL; } } Int32 rSize = 0; results->GetSize(&rSize); if (rSize == 0) { if (DEBUG_ATLAS) { Logger::W(TAG, "No atlas configuration found!"); } return NULL; } // Maximize the number of packed bitmaps, minimize the texture size AutoPtr<IComparator> wrCmp = new WorkerResultComparator(); collections->Sort(results, wrCmp); if (DEBUG_ATLAS) { Int64 nt; system->GetNanoTime(&nt); Float delay = (nt - begin) / 1000.0f / 1000.0f / 1000.0f; Logger::D(TAG, "Found best atlas configuration in %.2fs", delay); } AutoPtr<IInterface> obj; results->Get(0, (IInterface**)&obj); AutoPtr<WorkerResult> result = (WorkerResult*)IObject::Probe(obj); AutoPtr<Configuration> cfg = new Configuration(result->mType, result->mWidth, result->mHeight, result->mCount); return cfg; } AutoPtr<IFile> CAssetAtlasService::GetDataFile() { AutoPtr<IFile> dir = Environment::GetDataDirectory(); AutoPtr<IFile> systemDirectory; CFile::New(dir, String("system"), (IFile**)&systemDirectory); AutoPtr<IFile> result; CFile::New(systemDirectory, String("framework_atlas.config"), (IFile**)&result); return result; } void CAssetAtlasService::DeleteDataFile() { Logger::W(TAG, "Current configuration inconsistent with assets list"); AutoPtr<IFile> file = GetDataFile(); Boolean bval; file->Delete(&bval); if (!bval) { Logger::W(TAG, "Could not delete the current configuration"); } } AutoPtr<IFile> CAssetAtlasService::GetFrameworkResourcesFile() { AutoPtr<IApplicationInfo> ai; mContext->GetApplicationInfo((IApplicationInfo**)&ai); String sourceDir; ai->GetSourceDir(&sourceDir); AutoPtr<IFile> result; CFile::New(sourceDir, (IFile**)&result); return result; } AutoPtr<CAssetAtlasService::Configuration> CAssetAtlasService::ChooseConfiguration( /* [in] */ List<AutoPtr<IBitmap> >* bitmaps, /* [in] */ Int32 pixelCount, /* [in] */ const String& versionName) { AutoPtr<Configuration> config; AutoPtr<IFile> dataFile = GetDataFile(); Boolean exists; dataFile->Exists(&exists); if (exists) { config = ReadConfiguration(dataFile, versionName); } if (config == NULL) { config = ComputeBestConfiguration(bitmaps, pixelCount); if (config != NULL) WriteConfiguration(config, dataFile, versionName); } return config; } void CAssetAtlasService::WriteConfiguration( /* [in] */ Configuration* config, /* [in] */ IFile* file, /* [in] */ const String& versionName) { AutoPtr<IBufferedWriter> writer; AutoPtr<IOutputStream> out; CFileOutputStream::New(file, (IOutputStream**)&out); AutoPtr<IWriter> wr; COutputStreamWriter::New(out, (IWriter**)&wr); CBufferedWriter::New(wr, (IBufferedWriter**)&writer); IWriter* bw = IWriter::Probe(writer); bw->Write(GetBuildIdentifier(versionName)); writer->NewLine(); bw->Write(StringUtils::ToString((Int32)config->mType)); writer->NewLine(); bw->Write(StringUtils::ToString(config->mWidth)); writer->NewLine(); bw->Write(StringUtils::ToString(config->mHeight)); writer->NewLine(); bw->Write(StringUtils::ToString(config->mCount)); writer->NewLine(); bw->Write(StringUtils::ToString(config->mFlags)); writer->NewLine(); // } catch (FileNotFoundException e) { // Logger::W(TAG, "Could not write " + file, e); // } catch (IOException e) { // Logger::W(TAG, "Could not write " + file, e); // } finally if (writer != NULL) { ICloseable::Probe(writer)->Close(); } } AutoPtr<CAssetAtlasService::Configuration> CAssetAtlasService::ReadConfiguration( /* [in] */ IFile* file, /* [in] */ const String& versionName) { AutoPtr<IBufferedReader> reader; AutoPtr<Configuration> config; AutoPtr<IInputStream> in; CFileInputStream::New(file, (IInputStream**)&in); AutoPtr<IReader> rd; CInputStreamReader::New(in, (IReader**)&rd); CBufferedReader::New(rd, (IBufferedReader**)&reader); if (CheckBuildIdentifier(reader, versionName)) { String line; reader->ReadLine(&line); AtlasType type = (AtlasType)StringUtils::ParseInt32(line); Int32 width = ReadInt(reader, MIN_SIZE, MAX_SIZE); Int32 height = ReadInt(reader, MIN_SIZE, MAX_SIZE); Int32 count = ReadInt(reader, 0, Elastos::Core::Math::INT32_MAX_VALUE); Int32 flags = ReadInt(reader, Elastos::Core::Math::INT32_MIN_VALUE, Elastos::Core::Math::INT32_MAX_VALUE); config = new Configuration(type, width, height, count, flags); } // } catch (IllegalArgumentException e) { // Logger::W(TAG, "Invalid parameter value in " + file, e); // } catch (FileNotFoundException e) { // Logger::W(TAG, "Could not read " + file, e); // } catch (IOException e) { // Logger::W(TAG, "Could not read " + file, e); // } finally { if (reader != NULL) { ICloseable::Probe(reader)->Close(); } return config; } Int32 CAssetAtlasService::ReadInt( /* [in] */ IBufferedReader* reader, /* [in] */ Int32 min, /* [in] */ Int32 max) { String line; reader->ReadLine(&line); Int32 value = StringUtils::ParseInt32(line); value = Elastos::Core::Math::Min(max, value); value = Elastos::Core::Math::Max(min, value); return value; } Boolean CAssetAtlasService::CheckBuildIdentifier( /* [in] */ IBufferedReader* reader, /* [in] */ const String& versionName) { String deviceBuildId = GetBuildIdentifier(versionName); String buildId; reader->ReadLine(&buildId); return deviceBuildId.Equals(buildId); } String CAssetAtlasService::GetBuildIdentifier( /* [in] */ const String& versionName) { AutoPtr<ISystemProperties> sysProp; CSystemProperties::AcquireSingleton((ISystemProperties**)&sysProp); String id; sysProp->Get(String("ro.build.fingerprint"), String(""), &id); StringBuilder sb(id); sb += '/'; sb += versionName; sb += '/'; AutoPtr<IFile> file = GetFrameworkResourcesFile(); Int64 length; file->GetLength(&length); sb += StringUtils::ToString(length); return sb.ToString(); } //======================================================================= // Native //======================================================================= Int64 CAssetAtlasService::NativeAcquireAtlasCanvas( /* [in] */ ICanvas* canvas, /* [in] */ Int32 width, /* [in] */ Int32 height) { SkBitmap* bitmap = new SkBitmap; bitmap->allocN32Pixels(width, height); bitmap->eraseColor(0); Int64 handle = reinterpret_cast<Int64>(bitmap); canvas->SetNativeBitmap(handle); return handle; } void CAssetAtlasService::NativeReleaseAtlasCanvas( /* [in] */ ICanvas* canvas, /* [in] */ Int64 bitmapHandle) { SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); canvas->SetNativeBitmap(0); delete bitmap; } // Defines how long to wait for the GPU when uploading the atlas // This timeout is defined in nanoseconds (see EGL_KHR_fence_sync extension) #define FENCE_TIMEOUT 2000000000 #define CLEANUP_GL_AND_RETURN(result) \ if (fence != EGL_NO_SYNC_KHR) eglDestroySyncKHR(display, fence); \ if (image) eglDestroyImageKHR(display, image); \ if (texture) glDeleteTextures(1, &texture); \ if (surface != EGL_NO_SURFACE) eglDestroySurface(display, surface); \ if (context != EGL_NO_CONTEXT) eglDestroyContext(display, context); \ eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); \ eglReleaseThread(); \ eglTerminate(display); \ return result; // ---------------------------------------------------------------------------- // Types // ---------------------------------------------------------------------------- static android::sp<android::GraphicBuffer> graphicBufferForJavaObject(IGraphicBuffer* obj) { if (obj) { Int64 nativeObject; obj->GetNativeObject(&nativeObject); if (nativeObject != 0) { android::sp<android::GraphicBuffer> gb = reinterpret_cast<android::GraphicBuffer*>(nativeObject); return gb; } } return NULL; } Boolean CAssetAtlasService::NavtiveUploadAtlas( /* [in] */ IGraphicBuffer* graphicBuffer, /* [in] */ Int64 bitmapHandle) { SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); // The goal of this method is to copy the bitmap into the GraphicBuffer // using the GPU to swizzle the texture content android::sp<android::GraphicBuffer> buffer(graphicBufferForJavaObject(graphicBuffer)); if (buffer != NULL) { EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (display == EGL_NO_DISPLAY) return FALSE; EGLint major; EGLint minor; if (!eglInitialize(display, &major, &minor)) { Logger::W(TAG, "Could not initialize EGL"); return FALSE; } // We're going to use a 1x1 pbuffer surface later on // The configuration doesn't really matter for what we're trying to do EGLint configAttrs[] = { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 0, EGL_DEPTH_SIZE, 0, EGL_STENCIL_SIZE, 0, EGL_NONE }; EGLConfig configs[1]; EGLint configCount; if (!eglChooseConfig(display, configAttrs, configs, 1, &configCount)) { Logger::W(TAG, "Could not select EGL configuration"); eglReleaseThread(); eglTerminate(display); return FALSE; } if (configCount <= 0) { Logger::W(TAG, "Could not find EGL configuration"); eglReleaseThread(); eglTerminate(display); return FALSE; } // These objects are initialized below but the default "null" // values are used to cleanup properly at any point in the // initialization sequence GLuint texture = 0; EGLImageKHR image = EGL_NO_IMAGE_KHR; EGLSurface surface = EGL_NO_SURFACE; EGLSyncKHR fence = EGL_NO_SYNC_KHR; EGLint attrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; EGLContext context = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, attrs); if (context == EGL_NO_CONTEXT) { Logger::W(TAG, "Could not create EGL context"); CLEANUP_GL_AND_RETURN(FALSE); } // Create the 1x1 pbuffer EGLint surfaceAttrs[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE }; surface = eglCreatePbufferSurface(display, configs[0], surfaceAttrs); if (surface == EGL_NO_SURFACE) { Logger::W(TAG, "Could not create EGL surface"); CLEANUP_GL_AND_RETURN(FALSE); } if (!eglMakeCurrent(display, surface, surface, context)) { Logger::W(TAG, "Could not change current EGL context"); CLEANUP_GL_AND_RETURN(FALSE); } // We use an EGLImage to access the content of the GraphicBuffer // The EGL image is later bound to a 2D texture EGLClientBuffer clientBuffer = (EGLClientBuffer) buffer->getNativeBuffer(); EGLint imageAttrs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE }; image = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, imageAttrs); if (image == EGL_NO_IMAGE_KHR) { Logger::W(TAG, "Could not create EGL image"); CLEANUP_GL_AND_RETURN(FALSE); } glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); if (glGetError() != GL_NO_ERROR) { Logger::W(TAG, "Could not create/bind texture"); CLEANUP_GL_AND_RETURN(FALSE); } // Upload the content of the bitmap in the GraphicBuffer glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap->width(), bitmap->height(), GL_RGBA, GL_UNSIGNED_BYTE, bitmap->getPixels()); if (glGetError() != GL_NO_ERROR) { Logger::W(TAG, "Could not upload to texture"); CLEANUP_GL_AND_RETURN(FALSE); } // The fence is used to wait for the texture upload to finish // properly. We cannot rely on glFlush() and glFinish() as // some drivers completely ignore these API calls fence = eglCreateSyncKHR(display, EGL_SYNC_FENCE_KHR, NULL); if (fence == EGL_NO_SYNC_KHR) { Logger::W(TAG, "Could not create sync fence %#x", eglGetError()); CLEANUP_GL_AND_RETURN(FALSE); } // The flag EGL_SYNC_FLUSH_COMMANDS_BIT_KHR will trigger a // pipeline flush (similar to what a glFlush() would do.) EGLint waitStatus = eglClientWaitSyncKHR(display, fence, EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, FENCE_TIMEOUT); if (waitStatus != EGL_CONDITION_SATISFIED_KHR) { Logger::W(TAG, "Failed to wait for the fence %#x", eglGetError()); CLEANUP_GL_AND_RETURN(FALSE); } CLEANUP_GL_AND_RETURN(TRUE); } return FALSE; } } // Server } // Droid } // Elastos
33.372852
110
0.615996
[ "render", "object" ]
e3bf3ea04359780f48203456ebc17452704bfac1
793
cpp
C++
LeetCode/0132. Palindrome Partitioning II/solution.cpp
InnoFang/oh-my-algorithms
f559dba371ce725a926725ad28d5e1c2facd0ab2
[ "Apache-2.0" ]
19
2018-08-26T03:10:58.000Z
2022-03-07T18:12:52.000Z
LeetCode/0132. Palindrome Partitioning II/solution.cpp
InnoFang/Algorithm-Library
1896b9d8b1fa4cd73879aaecf97bc32d13ae0169
[ "Apache-2.0" ]
null
null
null
LeetCode/0132. Palindrome Partitioning II/solution.cpp
InnoFang/Algorithm-Library
1896b9d8b1fa4cd73879aaecf97bc32d13ae0169
[ "Apache-2.0" ]
6
2020-03-16T23:00:06.000Z
2022-01-13T07:02:08.000Z
/** * 29 / 29 test cases passed. * Runtime: 52 ms * Memory Usage: 19.3 MB */ class Solution { public: int minCut(string s) { int n = s.size(); vector<vector<int>> dp(n, vector<int>(n, 1)); for (int i = n - 1; i >= 0; -- i) { for (int j = i + 1; j < n; ++ j) { dp[i][j] = s[i] == s[j] && dp[i + 1][j - 1]; } } vector<int> f(n); for (int i = 1; i < n; ++ i) { if (dp[0][i]) f[i] = 0; else { f[i] = f[i - 1] + 1; for (int j = 1; j < i; ++ j) { if (dp[j][i]) { f[i] = min(f[i], f[j - 1] + 1); } } } } return f[n - 1]; } };
24.78125
60
0.296343
[ "vector" ]
e3c4ad43effffca38c20eb535c632c7046142b7c
20,241
cpp
C++
CollisionDetection/Collision2DResponse.cpp
brendankeesing/Collision-Detection
cac654a32cebd1985f6510fc935a844885aa33bf
[ "Unlicense" ]
null
null
null
CollisionDetection/Collision2DResponse.cpp
brendankeesing/Collision-Detection
cac654a32cebd1985f6510fc935a844885aa33bf
[ "Unlicense" ]
null
null
null
CollisionDetection/Collision2DResponse.cpp
brendankeesing/Collision-Detection
cac654a32cebd1985f6510fc935a844885aa33bf
[ "Unlicense" ]
null
null
null
#include "Collision2DResponse.h" #include "CollisionUtility.h" #undef min #undef max #include <algorithm> // AABB bool Collision2DResponse_AABB_AABB(const Collision2DAABB& a, const MthVector2& apos, const Collision2DAABB& b, const MthVector2& bpos, Collision2DResult& result) { // calculate edges float left = (bpos.x - b.HalfWidth) - (apos.x + a.HalfWidth); float right = (bpos.x + b.HalfWidth) - (apos.x - a.HalfWidth); float top = (bpos.y - b.HalfHeight) - (apos.y + a.HalfHeight); float bottom = (bpos.y + b.HalfHeight) - (apos.y - a.HalfHeight); // check to see if there is no overlap on each axes if ((left > 0.0f) == (right > 0.0f) || (bottom > 0.0f) == (top > 0.0f)) return false; // compare on x-axis if (fabs(left) < right) result.Direction.x = left; else result.Direction.x = right; // compare on y-axis if (fabs(top) < bottom) result.Direction.y = top; else result.Direction.y = bottom; // do not move on the axis that requires more movement than the other if (fabs(result.Direction.x) < fabs(result.Direction.y)) result.Direction.y = 0; else result.Direction.x = 0; return true; } bool Collision2DResponse_AABB_Circle(const Collision2DAABB& a, const MthVector2& apos, const Collision2DCircle& b, const MthVector2& bpos, Collision2DResult& result) { MthVector2 diff = apos - bpos; // if circle center point is in the box if (bpos.x > apos.x - a.HalfWidth && bpos.x < apos.x + a.HalfWidth && bpos.y > apos.y - a.HalfHeight && bpos.y < apos.y + a.HalfHeight) { // horizontal check if (abs(diff.x) > abs(diff.y)) { const float combinedradius = b.Radius + a.HalfWidth; if (diff.x > combinedradius || diff.x < -combinedradius) return false; result.Direction.y = 0.0f; result.Direction.x = (diff.x > 0.0f ? combinedradius : -combinedradius) - diff.x; return true; } // vertical check const float combinedradius = b.Radius + a.HalfHeight; if (diff.y > combinedradius || diff.y < -combinedradius) return false; result.Direction.x = 0.0f; result.Direction.y = (diff.y > 0.0f ? combinedradius : -combinedradius) - diff.y; return true; } // horizontal check if (bpos.x >= apos.x + a.HalfWidth || bpos.x <= apos.x - a.HalfWidth) { // corner check if (bpos.y >= apos.y + a.HalfHeight || bpos.y <= apos.y - a.HalfHeight) { MthVector2 diff = bpos - apos; if (diff.x > 0.0f) { if (diff.y > 0.0f) return Collision2DResponse_Circle_Point(b, bpos, MthVector2(apos.x + a.HalfWidth, apos.y + a.HalfHeight), result); // top right point else return Collision2DResponse_Circle_Point(b, bpos, MthVector2(apos.x + a.HalfWidth, apos.y - a.HalfHeight), result); // bottom right point } else { if (diff.y > 0.0f) return Collision2DResponse_Circle_Point(b, bpos, MthVector2(apos.x - a.HalfWidth, apos.y + a.HalfHeight), result); // top left point else return Collision2DResponse_Circle_Point(b, bpos, MthVector2(apos.x - a.HalfWidth, apos.y - a.HalfHeight), result); // bottom left point } } // horizontal check else { const float combinedradius = b.Radius + a.HalfWidth; if (diff.x > combinedradius || diff.x < -combinedradius) return false; result.Direction.y = 0.0f; result.Direction.x = (diff.x > 0.0f ? combinedradius : -combinedradius) - diff.x; return true; } } // vertical check const float combinedradius = b.Radius + a.HalfHeight; if (diff.y > combinedradius || diff.y < -combinedradius) return false; result.Direction.x = 0.0f; result.Direction.y = (diff.y > 0.0f ? combinedradius : -combinedradius) - diff.y; return true; } bool Collision2DResponse_AABB_CapsuleY(const Collision2DAABB& a, const MthVector2& apos, const Collision2DCapsuleY& b, const MthVector2& bpos, Collision2DResult& result) { const float circledist = abs(b.HalfHeight - b.HalfWidth); // top circle if (apos.y > bpos.y + circledist) return Collision2DResponse_AABB_Circle(a, apos, Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y + circledist), result); // bottom circle if (apos.y < bpos.y - circledist) return Collision2DResponse_AABB_Circle(a, apos, Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y - circledist), result); // box check float xdiff = bpos.x - apos.x; const float combinedradius = a.HalfWidth + b.HalfWidth; // if no horizontal collision if (abs(xdiff) > combinedradius) return false; result.Direction = MthVector2(xdiff + (xdiff > 0.0f ? -combinedradius : combinedradius), 0.0f); return true; } bool Collision2DResponse_AABB_CapsuleX(const Collision2DAABB& a, const MthVector2& apos, const Collision2DCapsuleX& b, const MthVector2& bpos, Collision2DResult& result) { const float circledist = abs(b.HalfWidth - b.HalfHeight); // top circle if (apos.x > bpos.x + circledist) return Collision2DResponse_AABB_Circle(a, apos, Collision2DCircle(b.HalfHeight), MthVector2(bpos.x + circledist, bpos.y), result); // bottom circle if (apos.x < bpos.x - circledist) return Collision2DResponse_AABB_Circle(a, apos, Collision2DCircle(b.HalfHeight), MthVector2(bpos.x - circledist, bpos.y), result); // box check float ydiff = bpos.y - apos.y; const float combinedradius = a.HalfHeight + b.HalfHeight; // if no horizontal collision if (abs(ydiff) > combinedradius) return false; result.Direction = MthVector2(0.0f, ydiff + (ydiff > 0.0f ? -combinedradius : combinedradius)); return true; } bool Collision2DResponse_AABB_ConvexHull(const Collision2DAABB& a, const MthVector2& apos, const Collision2DConvexHull& b, const MthVector2& bpos, Collision2DResult& result) { // Uses the separate axis theorem (SAT) // get box's points MthVector2 boxpoints[4] = { MthVector2(-a.HalfWidth, a.HalfHeight), MthVector2(-a.HalfWidth, -a.HalfHeight), MthVector2(a.HalfWidth, -a.HalfHeight), MthVector2(a.HalfWidth, a.HalfHeight) }; // get axes std::vector<MthVector2> axes; axes.push_back(MthVector2(0.0f, 1.0f)); // box's axis axes.push_back(MthVector2(1.0f, 0.0f)); // box's axis GetNormalizedAxesFromConvexHull(b.GetPoints(), b.PointsCount, axes); float smallestoverlap = 99999999.0f; // very high value MthVector2* smallestaxis = nullptr; float amin, amax; float bmin, bmax; for (auto& axis : axes) { GetProjectionOnAxis(boxpoints, 4, apos, axis, amin, amax); GetProjectionOnAxis(b.GetPoints(), b.PointsCount, bpos, axis, bmin, bmax); // if no collision if (amin > bmax || bmin > amax) return false; // find overlap float overlap = amax - bmin; const float alternateoverlap = bmax - amin; if (abs(overlap) > abs(alternateoverlap)) overlap = -alternateoverlap; // check to see if it is the smallest if (abs(overlap) < abs(smallestoverlap)) { smallestoverlap = overlap; smallestaxis = &axis; } } result.Direction = *smallestaxis * -smallestoverlap; return true; } bool Collision2DResponse_AABB_Point(const Collision2DAABB& a, const MthVector2& apos, const MthVector2& b, Collision2DResult& result) { MthVector2 diff = b - apos; // horizontal collision if (abs(diff.x) > abs(diff.y)) { if (diff.x > a.HalfWidth || diff.x < -a.HalfWidth) return false; result.Direction.y = 0.0f; result.Direction.x = (diff.x > 0.0f ? a.HalfWidth : -a.HalfWidth) - diff.x; return true; } // vertical collision if (diff.y > a.HalfHeight || diff.y < -a.HalfHeight) return false; result.Direction.y = (diff.y > 0.0f ? a.HalfHeight : -a.HalfHeight) - diff.y; result.Direction.x = 0.0f; return true; } // Circle bool Collision2DResponse_Circle_Circle(const Collision2DCircle& a, const MthVector2& apos, const Collision2DCircle& b, const MthVector2& bpos, Collision2DResult& result) { MthVector2 diff = apos - bpos; float length = sqrtf(diff.x * diff.x + diff.y * diff.y); if (length < a.Radius + b.Radius) { result.Direction = diff / length * (a.Radius + b.Radius - length); return true; } return false; } bool Collision2DResponse_Circle_CapsuleY(const Collision2DCircle& a, const MthVector2& apos, const Collision2DCapsuleY& b, const MthVector2& bpos, Collision2DResult& result) { const float circledist = abs(b.HalfHeight - b.HalfWidth); // check with top circle if (apos.y >= bpos.y + circledist) return Collision2DResponse_Circle_Circle(a, apos, Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y + circledist), result); // check with bottom circle else if (apos.y <= bpos.y - circledist) return Collision2DResponse_Circle_Circle(a, apos, Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y - circledist), result); // check with box float xdiff = apos.x - bpos.x; const float combinedradius = a.Radius + b.HalfWidth; if (xdiff > combinedradius || xdiff < -combinedradius) return false; result.Direction.x = (xdiff > 0.0f ? combinedradius : -combinedradius) - xdiff; result.Direction.y = 0.0f; return true; } bool Collision2DResponse_Circle_CapsuleX(const Collision2DCircle& a, const MthVector2& apos, const Collision2DCapsuleX& b, const MthVector2& bpos, Collision2DResult& result) { const float circledist = abs(b.HalfWidth - b.HalfHeight); // check with right circle if (apos.x >= bpos.x + circledist) return Collision2DResponse_Circle_Circle(a, apos, Collision2DCircle(b.HalfHeight), MthVector2(bpos.x + circledist, bpos.y), result); // check with left circle else if (apos.x <= bpos.x - circledist) return Collision2DResponse_Circle_Circle(a, apos, Collision2DCircle(b.HalfHeight), MthVector2(bpos.x - circledist, bpos.y), result); // check with box float ydiff = apos.y - bpos.y; const float combinedradius = a.Radius + b.HalfHeight; if (ydiff > combinedradius || ydiff < -combinedradius) return false; result.Direction.x = 0.0f; result.Direction.y = (ydiff > 0.0f ? combinedradius : -combinedradius) - ydiff; return true; } bool Collision2DResponse_Circle_ConvexHull(const Collision2DCircle& a, const MthVector2& apos, const Collision2DConvexHull& b, const MthVector2& bpos, Collision2DResult& result) { // Uses the separate axis theorem (SAT) // get axes std::vector<MthVector2> axes; axes.push_back(b.GetPoints()[FindClosestPoint(b.GetPoints(), b.PointsCount, apos - bpos)] + bpos - apos); // axis from hull's closest point to circle's center axes[0].Normalize(); GetNormalizedAxesFromConvexHull(b.GetPoints(), b.PointsCount, axes); float smallestoverlap = 99999999.0f; // very high value MthVector2* smallestaxis = nullptr; float amin, amax; float bmin, bmax; for (auto& axis : axes) { GetProjectionOnAxis(b.GetPoints(), b.PointsCount, bpos, axis, bmin, bmax); amin = axis.Dot(apos); // calculate circle's projection amax = amin + a.Radius; amin -= a.Radius; // if no collision if (amin >= bmax || bmin >= amax) return false; // find overlap float overlap = amax - bmin; const float alternateoverlap = bmax - amin; if (abs(overlap) > abs(alternateoverlap)) overlap = -alternateoverlap; // check to see if it is the smallest if (abs(overlap) < abs(smallestoverlap)) { smallestoverlap = overlap; smallestaxis = &axis; } } result.Direction = *smallestaxis * -smallestoverlap; return true; } bool Collision2DResponse_Circle_Point(const Collision2DCircle& a, const MthVector2& apos, const MthVector2& b, Collision2DResult& result) { MthVector2 diff = b - apos; float length = sqrtf(diff.x * diff.x + diff.y * diff.y); result.Direction = diff / length * (a.Radius - length); return length < a.Radius; }; // CapsuleY bool Collision2DResponse_CapsuleY_CapsuleY(const Collision2DCapsuleY& a, const MthVector2& apos, const Collision2DCapsuleY& b, const MthVector2& bpos, Collision2DResult& result) { // if too far away horizontally if (abs(apos.x - bpos.x) >= a.HalfWidth + b.HalfWidth) return false; const float acircledist = abs(a.HalfHeight - a.HalfWidth); const float bcircledist = abs(b.HalfHeight - b.HalfWidth); // A's top circle if (apos.y + acircledist < bpos.y - bcircledist) return Collision2DResponse_Circle_Circle(Collision2DCircle(a.HalfWidth), MthVector2(apos.x, apos.y + acircledist), Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y - bcircledist), result); // A's bottom circle else if (apos.y - acircledist > bpos.y + bcircledist) return Collision2DResponse_Circle_Circle(Collision2DCircle(a.HalfWidth), MthVector2(apos.x, apos.y - acircledist), Collision2DCircle(b.HalfWidth), MthVector2(bpos.x, bpos.y + bcircledist), result); // horizontal box checks float xdiff = apos.x - bpos.x; const float combinedradius = a.HalfWidth + b.HalfWidth; if (xdiff > combinedradius || xdiff < -combinedradius) return false; result.Direction.x = (xdiff > 0.0f ? combinedradius : -combinedradius) - xdiff; result.Direction.y = 0.0f; return true; } bool Collision2DResponse_CapsuleY_CapsuleX(const Collision2DCapsuleY& a, const MthVector2& apos, const Collision2DCapsuleX& b, const MthVector2& bpos, Collision2DResult& result) { return false; } bool Collision2DResponse_CapsuleY_ConvexHull(const Collision2DCapsuleY& a, const MthVector2& apos, const Collision2DConvexHull& b, const MthVector2& bpos, Collision2DResult& result) { return false; } bool Collision2DResponse_CapsuleY_Point(const Collision2DCapsuleY& a, const MthVector2& apos, const MthVector2& b, Collision2DResult& result) { const float circledist = abs(a.HalfHeight - a.HalfWidth); // check with top circle if (b.y >= apos.y + circledist) return Collision2DResponse_Circle_Point(Collision2DCircle(a.HalfWidth), MthVector2(apos.x, apos.y + circledist), b, result); // check with bottom circle else if (b.y <= apos.y - circledist) return Collision2DResponse_Circle_Point(Collision2DCircle(a.HalfWidth), MthVector2(apos.x, apos.y - circledist), b, result); // check with box float xdiff = apos.x - b.x; if (xdiff > a.HalfWidth || xdiff < -a.HalfWidth) return false; result.Direction.x = (xdiff > 0.0f ? a.HalfWidth : -a.HalfWidth) - xdiff; result.Direction.y = 0.0f; return true; } // CapsuleX bool Collision2DResponse_CapsuleX_CapsuleX(const Collision2DCapsuleX& a, const MthVector2& apos, const Collision2DCapsuleX& b, const MthVector2& bpos, Collision2DResult& result) { // if too far away vertically if (abs(apos.y - bpos.y) >= a.HalfHeight + b.HalfHeight) return false; const float acircledist = abs(a.HalfWidth - a.HalfHeight); const float bcircledist = abs(b.HalfWidth - b.HalfHeight); // A's right circle if (apos.x + acircledist < bpos.x - bcircledist) return Collision2DResponse_Circle_Circle(Collision2DCircle(a.HalfHeight), MthVector2(apos.x + acircledist, apos.y), Collision2DCircle(b.HalfHeight), MthVector2(bpos.x - bcircledist, bpos.y), result); // A's left circle else if (apos.x - acircledist > bpos.x + bcircledist) return Collision2DResponse_Circle_Circle(Collision2DCircle(a.HalfHeight), MthVector2(apos.x - acircledist, apos.y), Collision2DCircle(b.HalfHeight), MthVector2(bpos.x + bcircledist, bpos.y), result); // vertical box checks float ydiff = apos.y - bpos.y; const float combinedradius = a.HalfHeight + b.HalfHeight; if (ydiff > combinedradius || ydiff < -combinedradius) return false; result.Direction.x = 0.0f; result.Direction.y = (ydiff > 0.0f ? combinedradius : -combinedradius) - ydiff; return true; } bool Collision2DResponse_CapsuleX_ConvexHull(const Collision2DCapsuleX& a, const MthVector2& apos, const Collision2DConvexHull& b, const MthVector2& bpos, Collision2DResult& result) { return false; } bool Collision2DResponse_CapsuleX_Point(const Collision2DCapsuleX& a, const MthVector2& apos, const MthVector2& b, Collision2DResult& result) { const float circledist = abs(a.HalfWidth - a.HalfHeight); // check with right circle if (b.x >= apos.x + circledist) return Collision2DResponse_Circle_Point(Collision2DCircle(a.HalfHeight), MthVector2(apos.x + circledist, apos.y), b, result); // check with left circle else if (b.x <= apos.x - circledist) return Collision2DResponse_Circle_Point(Collision2DCircle(a.HalfHeight), MthVector2(apos.x - circledist, apos.y), b, result); // check with box float ydiff = apos.y - b.y; if (ydiff > a.HalfHeight || ydiff < -a.HalfHeight) return false; result.Direction.x = 0.0f; result.Direction.y = (ydiff > 0.0f ? a.HalfHeight : -a.HalfHeight) - ydiff; return true; } // Hull bool Collision2DResponse_ConvexHull_ConvexHull(Collision2DConvexHull& a, MthVector2& apos, Collision2DConvexHull& b, MthVector2& bpos, Collision2DResult& result) { // Uses the separate axis theorem (SAT) // get axes std::vector<MthVector2> axes; //GetAxesFromConvexHull(a.GetPoints(), a.PointsCount, axes); //GetAxesFromConvexHull(b.GetPoints(), b.PointsCount, axes); GetNormalizedAxesFromConvexHull(a.GetPoints(), a.PointsCount, axes); GetNormalizedAxesFromConvexHull(b.GetPoints(), b.PointsCount, axes); // find out which is larger so then positions can be relative to the larger object // this should speed things up quite a bit when calling GetProjectionOnAxis bool aislarger = a.PointsCount > b.PointsCount; MthVector2 relativeposition = aislarger ? bpos - apos : apos - bpos; float smallestoverlap = 99999999.0f; // very high value MthVector2* smallestaxis = nullptr; float amin, amax; float bmin, bmax; for (auto& axis : axes) { /* POSSIBLE OPTIMISATION!! if (aislarger) { GetProjectionOnAxis(a.GetPoints(), a.PointsCount, axis, amin, amax); GetProjectionOnAxis(b.GetPoints(), b.PointsCount, relativeposition, axis, bmin, bmax); } else { GetProjectionOnAxis(a.GetPoints(), a.PointsCount, relativeposition, axis, amin, amax); GetProjectionOnAxis(b.GetPoints(), b.PointsCount, axis, bmin, bmax); } */ GetProjectionOnAxis(a.GetPoints(), a.PointsCount, apos, axis, amin, amax); GetProjectionOnAxis(b.GetPoints(), b.PointsCount, bpos, axis, bmin, bmax); // if no collision if (amin > bmax || bmin > amax) return false; // find overlap float overlap = amax - bmin; const float alternateoverlap = bmax - amin; if (abs(overlap) > abs(alternateoverlap)) overlap = -alternateoverlap; // check to see if it is the smallest if (abs(overlap) < abs(smallestoverlap)) { smallestoverlap = overlap; smallestaxis = &axis; } } result.Direction = *smallestaxis * -smallestoverlap; return true; } // collision checker typedef bool (*ColFnc)(const Collision2DShape&, const MthVector2&, const Collision2DShape&, const MthVector2&, Collision2DResult& result); static ColFnc Collision2DResponseFunctions[6][6] = { {(ColFnc)Collision2DResponse_AABB_AABB, (ColFnc)Collision2DResponse_AABB_Circle, (ColFnc)Collision2DResponse_AABB_CapsuleY, (ColFnc)Collision2DResponse_AABB_CapsuleX, (ColFnc)Collision2DResponse_AABB_ConvexHull, (ColFnc)nullptr}, {(ColFnc)nullptr, (ColFnc)Collision2DResponse_Circle_Circle, (ColFnc)Collision2DResponse_Circle_CapsuleY, (ColFnc)Collision2DResponse_Circle_CapsuleX, (ColFnc)Collision2DResponse_Circle_ConvexHull, (ColFnc)nullptr}, {(ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)Collision2DResponse_CapsuleY_CapsuleY, (ColFnc)Collision2DResponse_CapsuleY_CapsuleX, (ColFnc)Collision2DResponse_CapsuleY_ConvexHull, (ColFnc)nullptr}, {(ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)Collision2DResponse_CapsuleX_CapsuleX, (ColFnc)Collision2DResponse_CapsuleX_ConvexHull, (ColFnc)nullptr}, {(ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)Collision2DResponse_ConvexHull_ConvexHull, (ColFnc)nullptr}, {(ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr, (ColFnc)nullptr}, }; bool Collision2DResponse(const Collision2DShape& a, const MthVector2& apos, const Collision2DShape&b, const MthVector2& bpos, Collision2DResult& result) { if (Collision2DResponseFunctions[(int)a.Type][(int)b.Type]) return Collision2DResponseFunctions[(int)a.Type][(int)b.Type](a, apos, b, bpos, result); else if (Collision2DResponseFunctions[(int)b.Type][(int)a.Type]) { if (Collision2DResponseFunctions[(int)b.Type][(int)a.Type](b, bpos, a, apos, result)) { result.Direction = -result.Direction; // reverse the direction of response because the shapes were swapped return true; } } return false; };
36.801818
233
0.726002
[ "object", "vector" ]
e3cdcd8d0660a5792ce99c43155d39e1343bf8c6
3,773
inl
C++
src/fixie_lib/handle_manager.inl
vonture/fixie
7fa1a6787ae26ee141a906fe39fb85c2e3cf4dfc
[ "MIT" ]
7
2015-01-09T22:08:17.000Z
2021-10-12T10:32:58.000Z
src/fixie_lib/handle_manager.inl
vonture/fixie
7fa1a6787ae26ee141a906fe39fb85c2e3cf4dfc
[ "MIT" ]
1
2015-08-19T07:51:53.000Z
2015-08-19T07:51:53.000Z
src/fixie_lib/handle_manager.inl
vonture/fixie
7fa1a6787ae26ee141a906fe39fb85c2e3cf4dfc
[ "MIT" ]
5
2015-08-20T07:10:23.000Z
2022-03-24T07:09:10.000Z
#include "fixie_lib/util.hpp" namespace fixie { template <typename handle_type, typename object_type> handle_manager<handle_type, object_type>::handle_manager(handle_type first_handle) : _allocations() , _cur_handle(first_handle) , _free_list() { } template <typename handle_type, typename object_type> handle_type handle_manager<handle_type, object_type>::allocate_object(std::unique_ptr<object_type> object, bool protected_object) { while (_free_list.size() > 0) { handle_type handle = _free_list.back(); _free_list.pop_back(); if (_allocations.find(handle) == end(_allocations)) { insert_object(handle, std::move(object), protected_object); return handle; } } while (_allocations.find(_cur_handle) != end(_allocations)) { ++_cur_handle; } insert_object(_cur_handle, std::move(object), protected_object); return _cur_handle; } template <typename handle_type, typename object_type> void handle_manager<handle_type, object_type>::insert_object(handle_type handle, std::unique_ptr<object_type> object, bool protected_object) { _allocations.insert(std::make_pair(handle, std::make_pair(std::shared_ptr<object_type>(std::move(object)), protected_object))); } template <typename handle_type, typename object_type> void handle_manager<handle_type, object_type>::erase_object(handle_type handle) { auto iter = _allocations.find(handle); if (iter != _allocations.end() && !iter->second.second) { _allocations.erase(iter); _free_list.push_back(handle); } } template <typename handle_type, typename object_type> bool handle_manager<handle_type, object_type>::contains_handle(handle_type handle) const { return _allocations.find(handle) != end(_allocations); } namespace priv { template <typename iterator_type, typename second_type> static iterator_type reverse_find_handle(iterator_type first, iterator_type last, const second_type& item) { for (iterator_type i = first; i != last; ++i) { if (i->second.first == item) { return i; } } return last; } } template <typename handle_type, typename object_type> bool handle_manager<handle_type, object_type>::contains_object(std::weak_ptr<const object_type> object) const { return priv::reverse_find_handle(begin(_allocations), end(_allocations), object.lock()) != end(_allocations); } template <typename handle_type, typename object_type> handle_type handle_manager<handle_type, object_type>::get_handle(std::weak_ptr<const object_type> object) const { return priv::reverse_find_handle(begin(_allocations), end(_allocations), object.lock())->first; } template <typename handle_type, typename object_type> std::weak_ptr<const object_type> handle_manager<handle_type, object_type>::get_object(handle_type handle) const { auto iter = _allocations.find(handle); return (iter != end(_allocations)) ? iter->second.first : std::weak_ptr<object_type>(); } template <typename handle_type, typename object_type> std::weak_ptr<object_type> handle_manager<handle_type, object_type>::get_object(handle_type handle) { auto iter = _allocations.find(handle); return (iter != end(_allocations)) ? iter->second.first : std::weak_ptr<object_type>(); } }
36.278846
135
0.644315
[ "object" ]
e3d0f7ec96b84a524dca0b8d39fed127549a1409
2,782
cc
C++
src/EngineImpl/Renderer2D.cc
cyf-gh/HoneyGame
2448f4574c6e1a847f1395d97a3186d79b499b22
[ "MIT" ]
3
2021-11-27T01:24:26.000Z
2021-12-31T07:17:38.000Z
src/EngineImpl/Renderer2D.cc
cyf-gh/HGEngine
2448f4574c6e1a847f1395d97a3186d79b499b22
[ "MIT" ]
null
null
null
src/EngineImpl/Renderer2D.cc
cyf-gh/HGEngine
2448f4574c6e1a847f1395d97a3186d79b499b22
[ "MIT" ]
1
2021-10-01T07:18:58.000Z
2021-10-01T07:18:58.000Z
// // Created by cyf-m on 2020/12/10. // #include <string> #include <SDL_image.h> #include <Math.hpp> #include <Log.h> #include "Spirte.hpp" #include "Renderer2D.h" #include "Texture.h" #include "Label.hpp" #include "GameObject.h" #include "Geometry.hpp" using namespace HGEngine::V1SDL; using namespace HG::Math; SDL_Texture* Renderer2D::CreateTextureFromFile( const char* pStrFileName ) { auto pImg = IMG_Load( pStrFileName ); if( !pImg ) { HG_LOG_FAILED( std::format( "Texture|{}| ?Failed Creation \n[{}]", IMG_GetError() ).c_str() ); return nullptr; } else { HG_LOG_SUCCESS( std::format( "Texture|{}| !Created", pStrFileName ).c_str() ); } auto pTex = SDL_CreateTextureFromSurface( pHandle, pImg ); if( pTex == nullptr ) { HG_LOG_SDL_ERROR( SDL_LOG_CATEGORY_RENDER, "SDL_CreateTextureFromSurface in Renderer2D::CreateTextureFromFile" ); return nullptr; } SDL_FreeSurface( pImg ); pImg = nullptr; return pTex; } void Renderer2D::Copy( const GameObject* pGameObject, const SDL_Rect* pSrcRect, const SDL_Rect* pDstRect ) { CopyEx( pGameObject, pSrcRect, pDstRect, 0, nullptr, SDL_FLIP_NONE ); } void HGEngine::V1SDL::Renderer2D::CopyEx( const GameObject* pGameObject, const SDL_Rect* pSrcRect, const SDL_Rect* pDstRect, const double f64Angle, const SDL_Point* pCenter, const SDL_RendererFlip& tFlip ) { if( !pGameObject ) { return; } auto vecRC = pGameObject->GetRenderableComponentsSorted(); for( auto& rc : vecRC ) { if( rc != nullptr ) { auto* pRt = rc->GetRenderTarget( this ); auto* pLR = rc->GetLocalRectOffset(); if( pRt != nullptr ) { if( pLR == nullptr ) { SDL_RenderCopyEx( pHandle, pRt->GetHandle(), pSrcRect, pDstRect, f64Angle, pCenter, tFlip ); } else { if( pLR->IsZero() ) { SDL_RenderCopyEx( pHandle, pRt->GetHandle(), pSrcRect, pDstRect, f64Angle, pCenter, tFlip ); } else { SDL_Rect r; r.x = pLR->X + pDstRect->x; r.y = pLR->Y + pDstRect->y; r.w = pLR->W; r.h = pLR->H; SDL_RenderCopyEx( pHandle, pRt->GetHandle(), pSrcRect, &r, f64Angle, pCenter, tFlip ); } } } } } } void HGEngine::V1SDL::Renderer2D::SetDrawColor( Uint8 r, Uint8 g, Uint8 b, Uint8 a ) { SDL_SetRenderDrawColor( pHandle, r, g, b, a ); } void HGEngine::V1SDL::Renderer2D::SetDrawColor( const DrawableGeo* pdg ) { SDL_SetRenderDrawColor( pHandle, pdg->r, pdg->g, pdg->b, pdg->a ); } void HGEngine::V1SDL::Renderer2D::SetDrawColor( const HG::Math::HGColor& tc ) { SetDrawColor( tc.R, tc.G, tc.B, tc.A ); } void HGEngine::V1SDL::Renderer2D::SetDrawBlendMode( const SDL_BlendMode eBm ) { SDL_SetRenderDrawBlendMode( pHandle, eBm ); } int HGEngine::V1SDL::Renderer2D::DrawLine( int x, int y, int xx, int yy ) { return SDL_RenderDrawLine( pHandle, x, y, xx, yy ); }
30.23913
207
0.680446
[ "geometry" ]
e3d77733f3911796b146ac6635a394a6e0120d1a
1,682
cpp
C++
Alhythm/src/Game_Object_BarLine.cpp
Nao-Shirotsu/Siv3D_Alhythm
d602832e535831a07d0e7c3fb589caa5d356aaf2
[ "MIT" ]
4
2018-12-19T12:36:42.000Z
2021-05-24T06:13:33.000Z
Alhythm/src/Game_Object_BarLine.cpp
Nao-Shirotsu/Siv3D_Alhythm
d602832e535831a07d0e7c3fb589caa5d356aaf2
[ "MIT" ]
1
2019-01-07T03:04:11.000Z
2019-01-07T03:04:11.000Z
Alhythm/src/Game_Object_BarLine.cpp
Nao-Shirotsu/Siv3D_Alhythm
d602832e535831a07d0e7c3fb589caa5d356aaf2
[ "MIT" ]
2
2020-04-15T06:15:51.000Z
2021-12-16T02:22:12.000Z
#include <unordered_map> #include <cmath> #include "Game_Object_BarLine.h" #include "Game_Object_Constant.h" namespace{ // 小節線の色 constexpr s3d::Color NOTE_COLOR{ 200, 200, 200 }; // 1小節のどの拍で小節線が判定ラインまで落ちてくるか constexpr int BARLINE_VALID_BEAT{ 1 }; } Game::Object::BarLine::BarLine( int barNum_, const std::shared_ptr<Track>& track_ ): track( track_ ), posY( 0 ), lineL( L_JUDGELINE_POS_X, 0, L_JUDGELINE_POS_X + JUDGELINE_LENGTH, 0 ), lineR( R_JUDGELINE_POS_X, 0, R_JUDGELINE_POS_X + JUDGELINE_LENGTH, 0 ), barNumFont( 10 ), barNumStr( s3d::Format( barNum_ ) ){ noteIndicateTime = NOTE_INDICATE_TIME / settingState.HispeedRate(); secOnMusic = track->SecOnBarBeat( barNum_, BARLINE_VALID_BEAT ); timeDiff = secOnMusic - track->CurSec(); } Game::Object::BarLine::BarLine(){} Game::Object::BarLine::~BarLine(){} void Game::Object::BarLine::Update(){ // posYの更新 timeDiff = secOnMusic - track->CurSec(); // この小節線が判定される秒数内ならば if( 0.0 < timeDiff && timeDiff < noteIndicateTime ){ posY = JUDGELINE_HEGHT - static_cast<int>( ( timeDiff / noteIndicateTime ) * JUDGELINE_HEGHT ) + NOTE_HEIGHT; lineL.set( L_JUDGELINE_POS_X, posY, L_JUDGELINE_POS_X + JUDGELINE_LENGTH, posY ); lineR.set( R_JUDGELINE_POS_X, posY, R_JUDGELINE_POS_X + JUDGELINE_LENGTH, posY ); } } void Game::Object::BarLine::Draw() const{ if( 0.0 < timeDiff && timeDiff < noteIndicateTime ){ #ifdef NOTESINFODEBUG barNumFont( barNumStr ).draw( L_JUDGELINE_POS_X - 30, posY ); #endif lineL.draw(); lineR.draw(); } } bool Game::Object::BarLine::IsValidToIndicate() const{ return secOnMusic - track->CurSec() < noteIndicateTime; }
29
112
0.701546
[ "object" ]
e3db809f56a2a0610554d499c3d069d7dcaaac4d
13,329
cpp
C++
src/main.cpp
rvaser/heron
b8516d2732850d15e41256bd09729b220d5c7665
[ "MIT" ]
null
null
null
src/main.cpp
rvaser/heron
b8516d2732850d15e41256bd09729b220d5c7665
[ "MIT" ]
null
null
null
src/main.cpp
rvaser/heron
b8516d2732850d15e41256bd09729b220d5c7665
[ "MIT" ]
1
2021-12-05T18:04:48.000Z
2021-12-05T18:04:48.000Z
// Copyright (c) 2021 Robert Vaser #include <getopt.h> #include <cstdint> #include <iostream> #include <unordered_map> #include "bioparser/fasta_parser.hpp" #include "bioparser/fastq_parser.hpp" #include "biosoup/nucleic_acid.hpp" #include "biosoup/timer.hpp" #include "edlib.h" // NOLINT #include "ksw2.h" // NOLINT #include "ram/minimizer_engine.hpp" #include "thread_pool/thread_pool.hpp" std::atomic<std::uint32_t> biosoup::NucleicAcid::num_objects{0}; namespace { static struct option options[] = { {"coverage", required_argument, nullptr, 'c'}, {"low", required_argument, nullptr, 'L'}, {"high", required_argument, nullptr, 'H'}, {"frequencies", no_argument, nullptr, 'f'}, {"ksw2", no_argument, nullptr, 'k'}, {"threads", required_argument, nullptr, 't'}, {"version", no_argument, nullptr, 'v'}, {"help", no_argument, nullptr, 'h'}, {nullptr, 0, nullptr, 0} }; std::unique_ptr<bioparser::Parser<biosoup::NucleicAcid>> CreateParser( const std::string& path) { auto is_suffix = [] (const std::string& s, const std::string& suff) { return s.size() < suff.size() ? false : s.compare(s.size() - suff.size(), suff.size(), suff) == 0; }; if (is_suffix(path, ".fasta") || is_suffix(path, ".fasta.gz") || is_suffix(path, ".fna") || is_suffix(path, ".fna.gz") || is_suffix(path, ".fa") || is_suffix(path, ".fa.gz")) { try { return bioparser::Parser<biosoup::NucleicAcid>::Create<bioparser::FastaParser>(path); // NOLINT } catch (const std::invalid_argument& exception) { std::cerr << exception.what() << std::endl; return nullptr; } } if (is_suffix(path, ".fastq") || is_suffix(path, ".fastq.gz") || is_suffix(path, ".fq") || is_suffix(path, ".fq.gz")) { try { return bioparser::Parser<biosoup::NucleicAcid>::Create<bioparser::FastqParser>(path); // NOLINT } catch (const std::invalid_argument& exception) { std::cerr << exception.what() << std::endl; return nullptr; } } std::cerr << "[heron::CreateParser] error: file " << path << " has unsupported format extension (valid extensions: .fasta, " << ".fasta.gz, .fna, .fna.gz, .fa, .fa.gz, .fastq, .fastq.gz, " << ".fq, .fq.gz)" << std::endl; return nullptr; } void Help() { std::cout << "usage: heron [options ...] <sequences>\n" "\n" " # default output is to stdout\n" " <sequences>\n" " input file in FASTA/FASTQ format (can be compressed with gzip)\n" "\n" " options:\n" " --coverage <int>\n" " default: 3\n" " declare solid base with coverage greater than provided value\n" " --low <double>\n" " default: 0.333\n" " declare solid base with frequency greater than provided value\n" " --high <double>\n" " default: 0.666\n" " declare solid base with frequency less than provided value\n" " -f, --frequencies\n" " default: \n" " technique to detect variants\n" " -k, --ksw2\n" " default: edlib\n" " used alignment method\n" " -t, --threads <int>\n" " default: 1\n" " number of threads\n" " --version\n" " prints the version number\n" " -h, --help\n" " prints the usage\n"; } } // namespace int main(int argc, char** argv) { std::uint32_t coverage = 3; double low = 0.333; double high = 0.666; bool use_frequencies = false; bool use_ksw2 = false; std::uint32_t num_threads = 1; std::string optstr = "fkt:h"; int arg; while ((arg = getopt_long(argc, argv, optstr.c_str(), options, nullptr)) != -1) { // NOLINT switch (arg) { case 'c': coverage = std::atoi(optarg); break; case 'L': low = std::atof(optarg); break; case 'H': high = std::atof(optarg); break; case 'f': use_frequencies = true; break; case 'k': use_ksw2 = true; break; case 't': num_threads = std::atoi(optarg); break; case 'v': std::cout << VERSION << std::endl; return 0; case 'h': Help(); return 0; default: return 1; } } if (argc == 1) { Help(); return 0; } if (optind >= argc) { std::cerr << "[heron::] error: missing input file!" << std::endl; return 1; } auto sparser = CreateParser(argv[optind]); if (sparser == nullptr) { return 1; } biosoup::Timer timer{}; timer.Start(); std::vector<std::unique_ptr<biosoup::NucleicAcid>> sequences; try { sequences = sparser->Parse(-1); } catch (const std::invalid_argument& exception) { std::cerr << exception.what() << std::endl; return 1; } std::cerr << "[heron::] parsed " << sequences.size() << " sequences " << std::fixed << timer.Stop() << "s" << std::endl; struct Pile { std::uint32_t a; std::uint32_t c; std::uint32_t g; std::uint32_t t; std::uint32_t i; }; std::vector<std::vector<Pile>> piles(sequences.size()); for (const auto& it : sequences) { piles[it->id].resize(it->inflated_len); } auto thread_pool = std::make_shared<thread_pool::ThreadPool>(num_threads); ram::MinimizerEngine minimizer_engine{thread_pool, 15U, 5U}; auto edlib_wrapper = [&] ( std::uint32_t i, const biosoup::Overlap& it, const std::string& lhs, const std::string& rhs) -> void { EdlibAlignResult result = edlibAlign( lhs.c_str(), lhs.size(), rhs.c_str(), rhs.size(), edlibNewAlignConfig(-1, EDLIB_MODE_NW, EDLIB_TASK_PATH, nullptr, 0)); if (result.status == EDLIB_STATUS_OK) { std::uint32_t lhs_pos = it.lhs_begin; std::uint32_t rhs_pos = 0; for (int j = 0; j < result.alignmentLength; ++j) { switch (result.alignment[j]) { case 0: case 3: { switch (rhs[rhs_pos]) { case 'A': ++piles[i][lhs_pos].a; break; case 'C': ++piles[i][lhs_pos].c; break; case 'G': ++piles[i][lhs_pos].g; break; case 'T': ++piles[i][lhs_pos].t; break; default: break; } ++lhs_pos; ++rhs_pos; break; } case 1: { ++piles[i][lhs_pos].i; ++lhs_pos; break; } case 2: { ++rhs_pos; break; } default: break; } } } edlibFreeAlignResult(result); }; auto ksw2_wrapper = [&] ( std::uint32_t i, const biosoup::Overlap& it, const std::string& lhs, const std::string& rhs) -> void { std::int8_t m = 3; std::int8_t n = -5; std::int8_t g = 4; std::int8_t e = 4; std::int8_t mn[25] = { m, n, n, n, 0, n, m, n, n, 0, n, n, m, n, 0, n, n, n, m, 0, 0, 0, 0, 0, 0 }; std::unordered_map<char, std::uint8_t> transform = { {'A', 0}, {'a', 0}, {'C', 1}, {'c', 1}, {'G', 2}, {'g', 2}, {'T', 3}, {'t', 3} }; auto lhs_ = new std::uint8_t[lhs.size()]; for (std::size_t j = 0; j < lhs.size(); ++j) { lhs_[j] = transform[lhs[j]]; } auto rhs_ = new std::uint8_t[rhs.size()]; for (std::size_t j = 0; j < rhs.size(); ++j) { rhs_[j] = transform[rhs[j]]; } int m_cigar = 0, n_cigar = 0; std::uint32_t* cigar = nullptr; auto score = ksw_gg2_sse( nullptr, // void *km lhs.size(), // int qlen lhs_, // const uint8_t *query rhs.size(), // int tlen rhs_, // const uint8_t *target 5, // int8_t m mn, // const int8_t *mat g, // int8_t gapo e, // int8_t gape 500, // int w &m_cigar, // int *m_cigar_ &n_cigar, // int *n_cigar_ &cigar); // uint32_t **cigar_ if (score > 0 && n_cigar > 0) { std::uint32_t lhs_pos = it.lhs_begin; std::uint32_t rhs_pos = 0; for (std::size_t j = 0; j < static_cast<std::size_t>(n_cigar); ++j) { std::size_t count = cigar[j] >> 4; std::size_t op = cigar[j] & 15; switch (op) { case 0: { // M for (std::size_t k = 0; k < count; ++k) { switch (rhs[rhs_pos + k]) { case 'A': ++piles[i][lhs_pos + k].a; break; case 'C': ++piles[i][lhs_pos + k].c; break; case 'G': ++piles[i][lhs_pos + k].g; break; case 'T': ++piles[i][lhs_pos + k].t; break; default: break; } } lhs_pos += count; rhs_pos += count; break; } case 1: { // I for (std::size_t k = 0; k < count; ++k) { ++piles[i][lhs_pos + k].i; } lhs_pos += count; break; } case 2: { // D rhs_pos += count; break; } default: break; } } } free(cigar); delete[] rhs_; delete[] lhs_; }; std::size_t bytes = 0; for (std::uint32_t i = 0, j = 0; i < sequences.size(); ++i) { bytes += sequences[i]->inflated_len; if (i != sequences.size() - 1 && bytes < (1ULL << 32)) { continue; } bytes = 0; timer.Start(); minimizer_engine.Minimize( sequences.begin() + j, sequences.begin() + i + 1, true); minimizer_engine.Filter(0.001); std::cerr << "[heron::] minimized " << j << " - " << i + 1 << " / " << sequences.size() << " " << std::fixed << timer.Stop() << "s" << std::endl; timer.Start(); std::vector<std::future<void>> futures; for (std::uint32_t k = 0; k < i + 1; ++k) { futures.emplace_back(thread_pool->Submit( [&] (std::uint32_t i) -> void { auto overlaps = minimizer_engine.Map(sequences[i], true, false, true); // NOLINT for (const auto& it : overlaps) { auto lhs = sequences[i]->InflateData( it.lhs_begin, it.lhs_end - it.lhs_begin); biosoup::NucleicAcid rhs_{"", sequences[it.rhs_id]->InflateData( it.rhs_begin, it.rhs_end - it.rhs_begin)}; if (!it.strand) { rhs_.ReverseAndComplement(); } auto rhs = rhs_.InflateData(); if (use_ksw2) { ksw2_wrapper(i, it, lhs, rhs); } else { edlib_wrapper(i, it, lhs, rhs); } } }, k)); bytes += sequences[k]->inflated_len; if (k != i && bytes < (1U << 30)) { continue; } bytes = 0; for (const auto& it : futures) { it.wait(); } } std::cerr << "[heron::] mapped sequences " << std::fixed << timer.Stop() << "s" << std::endl; j = i + 1; } timer.Stop(); timer.Start(); std::size_t zeros = 0, predictable = 0, total = 0, snps = 0, solid = 0; std::vector<std::vector<std::uint32_t>> rsnps(piles.size()); std::size_t i = 0; for (const auto& it : piles) { total += it.size(); std::vector<std::uint32_t> cov; cov.reserve(it.size()); for (const auto& jt : it) { cov.emplace_back(jt.a + jt.c + jt.g + jt.t); } std::nth_element(cov.begin(), cov.begin() + cov.size() / 2, cov.end()); double m = cov[cov.size() / 2] * 2. / 3.; std::size_t j = 0; for (const auto& jt : it) { std::vector<double> counts = { static_cast<double>(jt.a), static_cast<double>(jt.c), static_cast<double>(jt.g), static_cast<double>(jt.t) }; double sum = std::accumulate(counts.begin(), counts.end(), 0); if (use_frequencies) { for (auto& kt : counts) { kt /= sum; } } if (sum == 0.) { ++zeros; } else if (sum > m) { ++predictable; std::size_t variants = 0; for (const auto& it : counts) { if (use_frequencies) { if (low < it && it < high) { ++variants; } } else { if (it > coverage) { ++variants; } } } if (variants > 1) { rsnps[i].emplace_back(j); ++snps; } else { ++solid; } } ++j; } ++i; } std::cerr << "[heron::] num bases = " << total << std::endl; std::cerr << "[heron::] num bad bases = " << zeros << std::endl; std::cerr << "[heron::] num predictable bases = " << predictable << std::endl; std::cerr << "[heron::] num solid = " << solid << std::endl; std::cerr << "[heron::] num snps = " << snps << std::endl; std::cerr << "[heron::] calculated statistics " << std::fixed << timer.Stop() << "s" << std::endl; for (std::uint32_t i = 0; i < rsnps.size(); ++i) { if (rsnps[i].empty()) { continue; } std::cout << i; for (const auto& jt : rsnps[i]) { std::cout << " " << jt; } std::cout << std::endl; } std::cerr << "[heron::] " << std::fixed << timer.elapsed_time() << "s" << std::endl; return 0; }
28.541756
102
0.499662
[ "vector", "transform", "solid" ]
e3eefa3729d5b9028668a2ee1b20ee0781b63f33
6,397
cpp
C++
Sources/Internal/FileSystem/Private/FileWatcher.unittest.cpp
stinvi/dava.engine
2b396ca49cdf10cdc98ad8a9ffcf7768a05e285e
[ "BSD-3-Clause" ]
26
2018-09-03T08:48:22.000Z
2022-02-14T05:14:50.000Z
Sources/Internal/FileSystem/Private/FileWatcher.unittest.cpp
ANHELL-blitz/dava.engine
ed83624326f000866e29166c7f4cccfed1bb41d4
[ "BSD-3-Clause" ]
null
null
null
Sources/Internal/FileSystem/Private/FileWatcher.unittest.cpp
ANHELL-blitz/dava.engine
ed83624326f000866e29166c7f4cccfed1bb41d4
[ "BSD-3-Clause" ]
45
2018-05-11T06:47:17.000Z
2022-02-03T11:30:55.000Z
#include "UnitTests/UnitTests.h" #if defined(__DAVAENGINE_WIN32__) || defined(__DAVAENGINE_MACOS__) #include <Base/String.h> #include <Concurrency/Thread.h> #include <Engine/Engine.h> #include <Engine/EngineContext.h> #include <FileSystem/FilePath.h> #include <FileSystem/FileSystem.h> #include <FileSystem/FileWatcher.h> #include <Functional/Function.h> #include <Logger/Logger.h> #include <Time/SystemTimer.h> #include <Debug/DebuggerDetection.h> DAVA_TESTCLASS (FileWatcherTests) { struct ExpectedEvent { DAVA::String path; DAVA::FileWatcher::eWatchEvent event; }; struct TestEvent { DAVA::Vector<ExpectedEvent> e; DAVA::Function<void()> fn; }; ExpectedEvent MakeExpectedEvent(const DAVA::String& path, DAVA::FileWatcher::eWatchEvent e) { ExpectedEvent ev; ev.path = testFolder.GetAbsolutePathname() + path; ev.event = e; return ev; } FileWatcherTests() { const DAVA::EngineContext* ctx = DAVA::GetEngineContext(); testFolder = ctx->fileSystem->GetTempDirectoryPath(); testFolder.MakeDirectoryPathname(); testFolder += "FileWatcherTest/"; ctx->fileSystem->DeleteDirectory(testFolder, true); ctx->fileSystem->CreateDirectory(testFolder); DAVA::Thread::Sleep(100); startMs = DAVA::SystemTimer::GetMs(); watcher = new DAVA::FileWatcher(); } ~FileWatcherTests() { delete watcher; DAVA::GetEngineContext()->fileSystem->DeleteDirectory(testFolder, true); } void Step1() { DAVA::FileSystem* fs = DAVA::GetEngineContext()->fileSystem; fs->CreateDirectory(testFolder + "A"); fs->CreateDirectory(testFolder + "B"); DAVA::ScopedPtr<DAVA::File> aaFile(DAVA::File::Create(testFolder + "A/aa", DAVA::File::CREATE | DAVA::File::WRITE)); aaFile->WriteString("Hello", false); aaFile->Flush(); DAVA::ScopedPtr<DAVA::File> bbFile(DAVA::File::Create(testFolder + "B/bb", DAVA::File::CREATE | DAVA::File::WRITE)); bbFile->WriteString("world", false); bbFile->Flush(); } void Step2() { DAVA::FileSystem* fs = DAVA::GetEngineContext()->fileSystem; fs->MoveFile(testFolder + "A/aa", testFolder + "A/a"); } void Step3() { DAVA::FileSystem* fs = DAVA::GetEngineContext()->fileSystem; fs->DeleteDirectory(testFolder + "B/"); } void Step4() { DAVA::Thread::Sleep(1000); DAVA::ScopedPtr<DAVA::File> aaFile(DAVA::File::Create(testFolder + "A/a", DAVA::File::OPEN | DAVA::File::WRITE | DAVA::File::APPEND)); aaFile->WriteString(" world", false); aaFile->Flush(); } DAVA_TEST (FileCreationTest) { using namespace DAVA; watcher->Add(testFolder.GetAbsolutePathname(), true); { TestEvent ev; ev.e.push_back(MakeExpectedEvent("A", FileWatcher::FILE_CREATED)); ev.e.push_back(MakeExpectedEvent("B", FileWatcher::FILE_CREATED)); ev.e.push_back(MakeExpectedEvent("A/aa", FileWatcher::FILE_CREATED)); ev.e.push_back(MakeExpectedEvent("B/bb", FileWatcher::FILE_CREATED)); #if defined(__DAVAENGINE_WIN32__) ev.e.push_back(MakeExpectedEvent("B/bb", FileWatcher::FILE_MODIFIED)); ev.e.push_back(MakeExpectedEvent("A/aa", FileWatcher::FILE_MODIFIED)); #endif //__DAVAENGINE_WIN32__ ev.fn = MakeFunction(this, &FileWatcherTests::Step2); queue.push_back(ev); } { TestEvent ev; ev.e.push_back(MakeExpectedEvent("A/aa", FileWatcher::FILE_REMOVED)); ev.e.push_back(MakeExpectedEvent("A/a", FileWatcher::FILE_CREATED)); #if defined(__DAVAENGINE_WIN32__) ev.e.push_back(MakeExpectedEvent("A", FileWatcher::FILE_MODIFIED)); ev.e.push_back(MakeExpectedEvent("A", FileWatcher::FILE_MODIFIED)); #endif //__DAVAENGINE_WIN32__ ev.fn = MakeFunction(this, &FileWatcherTests::Step3); queue.push_back(ev); } { TestEvent ev; ev.e.push_back(MakeExpectedEvent("B/bb", FileWatcher::FILE_REMOVED)); ev.e.push_back(MakeExpectedEvent("B", FileWatcher::FILE_REMOVED)); #if defined(__DAVAENGINE_WIN32__) ev.e.push_back(MakeExpectedEvent("B", FileWatcher::FILE_MODIFIED)); ev.e.push_back(MakeExpectedEvent("B", FileWatcher::FILE_MODIFIED)); #endif //__DAVAENGINE_WIN32__ ev.fn = MakeFunction(this, &FileWatcherTests::Step4); queue.push_back(ev); } { TestEvent ev; ev.e.push_back(MakeExpectedEvent("A/a", FileWatcher::FILE_MODIFIED)); ev.fn = [] {}; queue.push_back(ev); } watcher->onWatchersChanged.Connect([this](const DAVA::String& filename, DAVA::FileWatcher::eWatchEvent e) { DAVA::Logger::Info("FileWatcher event %s : %d", filename.c_str(), static_cast<int>(e)); TEST_VERIFY(DAVA::Thread::IsMainThread() == true); TestEvent& expectation = queue.front(); bool found = false; auto iter = expectation.e.begin(); while (iter != expectation.e.end()) { if (iter->event == e && iter->path == filename) { found = true; iter = expectation.e.erase(iter); break; } ++iter; } TEST_VERIFY(found == true); if (expectation.e.empty()) { expectation.fn(); queue.pop_front(); } }); Step1(); } bool TestComplete(const DAVA::String& testName) const { if (DAVA::IsDebuggerPresent() == false) { if ((DAVA::SystemTimer::GetMs() - startMs) < 500) { TEST_VERIFY((DAVA::SystemTimer::GetMs() - startMs) < 500); return true; } } return queue.empty(); } void TearDown(const DAVA::String& testName) { watcher->onWatchersChanged.DisconnectAll(); } DAVA::Deque<TestEvent> queue; DAVA::FileWatcher* watcher = nullptr; DAVA::FilePath testFolder; DAVA::int64 startMs = 0; }; #endif
31.825871
142
0.591527
[ "vector" ]
e3f36a59908a82bea778ebec0907bef3a94b1191
24,422
cpp
C++
toolkit/Source/src/engine/Entity/ETHEntity.cpp
LuizTedesco/ethanon
c140bd360092dcdf11b242a11dee67e79fbbd025
[ "Unlicense" ]
64
2015-01-02T12:27:29.000Z
2022-03-07T03:23:33.000Z
toolkit/Source/src/engine/Entity/ETHEntity.cpp
theomission/ethanon
c140bd360092dcdf11b242a11dee67e79fbbd025
[ "Unlicense" ]
5
2015-03-31T00:09:29.000Z
2022-03-07T18:16:42.000Z
toolkit/Source/src/engine/Entity/ETHEntity.cpp
theomission/ethanon
c140bd360092dcdf11b242a11dee67e79fbbd025
[ "Unlicense" ]
40
2015-01-14T09:47:56.000Z
2022-02-07T22:07:24.000Z
/*-------------------------------------------------------------------------------------- Ethanon Engine (C) Copyright 2008-2013 Andre Santee http://ethanonengine.com/ 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 "ETHEntity.h" #include "../Physics/ETHPhysicsSimulator.h" Sprite::ENTITY_ORIGIN ETHEntity::ConvertToGSSO(const ETHEntityProperties::ENTITY_TYPE type) { switch (type) { case ETHEntityProperties::ET_GROUND_DECAL: case ETHEntityProperties::ET_OPAQUE_DECAL: case ETHEntityProperties::ET_OVERALL: case ETHEntityProperties::ET_LAYERABLE: case ETHEntityProperties::ET_HORIZONTAL: return Sprite::EO_CENTER; break; case ETHEntityProperties::ET_VERTICAL: return Sprite::EO_CENTER_BOTTOM; break; default: return Sprite::EO_DEFAULT; }; } float ETHEntity::ComputeDepth(const float height, const float maxHeight, const float minHeight) { return ((height - minHeight) / (maxHeight - minHeight)); } ETHEntity::ETHEntity(const str_type::string& filePath, const int nId, const Platform::FileManagerPtr& fileManager) : ETHScriptEntity(), m_properties(filePath, fileManager), m_id(nId), m_controller(new ETHRawEntityController(Vector3(0, 0, 0), 0.0f)) { Zero(); } ETHEntity::ETHEntity( TiXmlElement *pElement, ETHEntityCache& entityCache, const str_type::string &entityPath, Platform::FileManagerPtr fileManager) : ETHScriptEntity(), m_id(-1), m_controller(new ETHRawEntityController(Vector3(0, 0, 0), 0.0f)) { Zero(); ReadFromXMLFile(pElement, entityCache, entityPath, fileManager); } ETHEntity::ETHEntity() : ETHScriptEntity(), m_id(-1), m_controller(new ETHRawEntityController(Vector3(0, 0, 0), 0.0f)) { Zero(); } ETHEntity::~ETHEntity() { if (m_gcDict) { m_gcDict->Release(); } m_controller->Destroy(); } void ETHEntity::InstantiateDictionary() { asIScriptEngine *engine = asGetActiveContext()->GetEngine(); m_gcDict = new CScriptDictionary(engine); } #define ETH_DEFAULT_COLOR Vector4(1, 1, 1, 1) void ETHEntity::Zero() { m_v4Color = ETH_DEFAULT_COLOR; m_spriteFrame = (0); m_shadowZ = (0.0f); m_hide = m_flipX = m_flipY = (ETH_FALSE); m_gcDict = 0; } void ETHEntity::SetAngelScriptObject(const str_type::string &name, void *value, int typeId) { if (!m_gcDict) InstantiateDictionary(); m_gcDict->Set(name, value, typeId); } bool ETHEntity::GetAngelScriptObject(const str_type::string &name, void *value, int typeId) { if (!m_gcDict) return false; return m_gcDict->Get(name, value, typeId); } bool ETHEntity::WriteToXMLFile( TiXmlElement *pHeadRoot, ETHEntityCache& entityCache, const str_type::string &entityPath, Platform::FileManagerPtr fileManager) const { TiXmlElement *pEntity = new TiXmlElement(GS_L("Entity")); pHeadRoot->LinkEndChild(pEntity); TiXmlElement *pElement; // if it has a specific name, save it if (m_properties.entityName != GS_L("")) { pElement = new TiXmlElement(GS_L("EntityName")); pElement->LinkEndChild(new TiXmlText(m_properties.entityName)); pEntity->LinkEndChild(pElement); } if (m_v4Color != ETH_DEFAULT_COLOR) ETHEntityProperties::SetColorPropertyToXmlElement(pEntity, GS_L("Color"), m_v4Color); pElement = new TiXmlElement(GS_L("Position")); pEntity->LinkEndChild(pElement); { const Vector3 pos(m_controller->GetPos()); pElement->SetDoubleAttribute(GS_L("x"), pos.x); pElement->SetDoubleAttribute(GS_L("y"), pos.y); pElement->SetDoubleAttribute(GS_L("z"), pos.z); pElement->SetDoubleAttribute(GS_L("angle"), m_controller->GetAngle()); } pEntity->SetAttribute(GS_L("id"), m_id); pEntity->SetAttribute(GS_L("spriteFrame"), m_spriteFrame); if (m_spriteFrame > 0) pEntity->SetDoubleAttribute(GS_L("spriteFrame"), m_spriteFrame); if (m_properties.castShadow) pEntity->SetDoubleAttribute(GS_L("shadowZ"), m_shadowZ); ETHEntityProperties::SetBooleanPropertyToXmlElement(pEntity, GS_L("hide"), m_hide, ETH_FALSE); ETHEntityProperties::SetBooleanPropertyToXmlElement(pEntity, GS_L("flipX"), m_flipX, ETH_FALSE); ETHEntityProperties::SetBooleanPropertyToXmlElement(pEntity, GS_L("flipY"), m_flipY, ETH_FALSE); // write entity data as file reference or inline data (if the entity source file doesn't exist) if (entityCache.Get(m_properties.entityName, entityPath, fileManager)) { m_properties.WriteEntityNameToXMLFile(pEntity); } else { m_properties.WriteContentToXMLFile(pEntity); } return true; } bool ETHEntity::ReadFromXMLFile(TiXmlElement *pElement) { ReadInSceneDataFromXMLFile(pElement); TiXmlNode *pNode = pElement->FirstChild(GS_L("Entity")); if (pNode) { return m_properties.ReadFromXMLFile(pNode->ToElement()); } else { return false; } } bool ETHEntity::ReadFromXMLFile( TiXmlElement *pElement, ETHEntityCache& entityCache, const str_type::string &entityPath, Platform::FileManagerPtr fileManager) { ReadInSceneDataFromXMLFile(pElement); TiXmlNode *pNode = pElement->FirstChild(GS_L("Entity")); if (pNode) { return m_properties.ReadFromXMLFile(pNode->ToElement(), entityCache, entityPath, fileManager); } else { return false; } } void ETHEntity::ReadInSceneDataFromXMLFile(TiXmlElement *pElement) { pElement->QueryIntAttribute(GS_L("id"), &m_id); pElement->QueryFloatAttribute(GS_L("shadowZ"), &m_shadowZ); m_hide = ETHEntityProperties::ReadBooleanPropertyFromXmlElement(pElement, GS_L("hide"), m_hide); m_flipX = ETHEntityProperties::ReadBooleanPropertyFromXmlElement(pElement, GS_L("flipX"), m_flipX); m_flipY = ETHEntityProperties::ReadBooleanPropertyFromXmlElement(pElement, GS_L("flipY"), m_flipX); int signedSpriteFrame = 0; pElement->QueryIntAttribute(GS_L("spriteFrame"), &signedSpriteFrame); m_spriteFrame = static_cast<unsigned int>(signedSpriteFrame); TiXmlNode *pNode; TiXmlElement *pStringElement; pNode = pElement->FirstChild(GS_L("EntityName")); if (pNode) { pStringElement = pNode->ToElement(); if (pStringElement) { m_properties.entityName = pStringElement->GetText(); } } ETHEntityProperties::ReadColorPropertyFromXmlElement(pElement, GS_L("Color"), m_v4Color); pNode = pElement->FirstChild(GS_L("Position")); if (pNode) { TiXmlElement *pIter = pNode->ToElement(); if (pIter) { Vector3 pos; float angle = 0.0f; pIter->QueryFloatAttribute(GS_L("x"), &pos.x); pIter->QueryFloatAttribute(GS_L("y"), &pos.y); pIter->QueryFloatAttribute(GS_L("z"), &pos.z); pIter->QueryFloatAttribute(GS_L("angle"), &angle); m_controller->SetPos(pos); m_controller->SetAngle(angle); } } } int ETHEntity::GetID() const { return m_id; } ETHEntityControllerPtr ETHEntity::GetController() { return m_controller; } void ETHEntity::SetController(const ETHEntityControllerPtr& controller) { m_controller = controller; } Vector2 ETHEntity::ComputeAbsoluteOrigin(const Vector2 &v2Size) const { Vector2 v2Center; switch (ETHEntity::ConvertToGSSO(GetType())) { case Sprite::EO_RECT_CENTER: case Sprite::EO_CENTER: v2Center.x = v2Size.x / 2.0f; v2Center.y = v2Size.y / 2.0f; break; case Sprite::EO_RECT_CENTER_BOTTOM: case Sprite::EO_CENTER_BOTTOM: v2Center.x = v2Size.x / 2.0f; v2Center.y = v2Size.y; break; case Sprite::EO_RECT_CENTER_TOP: case Sprite::EO_CENTER_TOP: v2Center.x = v2Size.x / 2.0f; v2Center.y = 0.0f; break; default: case Sprite::EO_DEFAULT: v2Center.x = 0.0f; v2Center.y = 0.0f; break; }; return (v2Center + (m_properties.pivotAdjust * m_properties.scale)); } Vector2 ETHEntity::ComputeOrigin(const Vector2 &v2Size) const { return (ComputeAbsoluteOrigin(v2Size) / v2Size); } void ETHEntity::ChangeEntityName(const str_type::string& name) { m_properties.entityName = name; } str_type::string ETHEntity::GetEntityName() const { return m_properties.entityName; } ETHCollisionBox ETHEntity::GetCollisionBox() const { if (IsCollidable()) { return *m_properties.collision.get(); } return ETHCollisionBox(Vector3(0,0,0), Vector3(0,0,0)); } std::size_t ETHEntity::GetNumParticleSystems() const { return m_properties.particleSystems.size(); } ETHEntityProperties::ENTITY_TYPE ETHEntity::GetType() const { return m_properties.type; } ETHEntityProperties::BODY_SHAPE ETHEntity::GetShape() const { return m_properties.shape; } Vector3 ETHEntity::GetPosition() const { return m_controller->GetPos(); } Vector2 ETHEntity::GetPositionXY() const { return m_controller->GetPosXY(); } float ETHEntity::GetPositionX() const { return m_controller->GetPosX(); } float ETHEntity::GetPositionY() const { return m_controller->GetPosY(); } float ETHEntity::GetPositionZ() const { return m_controller->GetPosZ(); } void ETHEntity::SetPosition(const Vector3& pos, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->SetPos(pos); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::SetPositionXY(const Vector2& pos, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->SetPosXY(pos); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::SetPositionX(const float v, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->SetPosX(v); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::SetPositionY(const float v, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->SetPosY(v); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::SetPositionZ(const float v) { m_controller->SetPosZ(v); } void ETHEntity::AddToPosition(const Vector3& pos, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->AddToPos(pos); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::AddToPositionXY(const Vector2& pos, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->AddToPosXY(pos); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::AddToPositionX(const float v, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->AddToPosX(v); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::AddToPositionY(const float v, ETHBucketManager& buckets) { const Vector2& oldPos(GetPositionXY()); m_controller->AddToPosY(v); buckets.RequestBucketMove(this, oldPos, GetPositionXY()); } void ETHEntity::AddToPositionZ(const float v) { m_controller->AddToPosZ(v); } void ETHEntity::SetOrphanPosition(const Vector3& pos) { m_controller->SetPos(pos); } void ETHEntity::SetOrphanPositionXY(const Vector2& pos) { m_controller->SetPos(Vector3(pos, m_controller->GetPos().z)); } void ETHEntity::SetAngle(const float angle) { m_controller->SetAngle(angle); } void ETHEntity::AddToAngle(const float angle) { m_controller->AddToAngle(angle); } float ETHEntity::GetAngle() const { return m_controller->GetAngle(); } void ETHEntity::SetLightRange(const float range) { if (HasLightSource()) m_properties.light->range = range; } float ETHEntity::GetLightRange() const { if (HasLightSource()) return m_properties.light->range; else return 0.0f; } void ETHEntity::SetLightColor(const Vector3 &color) { if (HasLightSource()) m_properties.light->color = color; } Vector3 ETHEntity::GetLightColor() const { if (HasLightSource()) return m_properties.light->color; else return Vector3(0, 0, 0); } void ETHEntity::SetEmissiveColor(const Vector3 &color) { m_properties.emissiveColor = Vector4(color, 1); } Vector3 ETHEntity::GetEmissiveColor() const { const Vector4 *pColor = &m_properties.emissiveColor; return Vector3(pColor->x, pColor->y, pColor->z); } void ETHEntity::SetColor(const Vector3& color) { m_v4Color.x = color.x; m_v4Color.y = color.y; m_v4Color.z = color.z; } void ETHEntity::SetColor(const Vector4& color) { m_v4Color = color; } void ETHEntity::SetAlpha(const float alpha) { m_v4Color.w = alpha; } Vector3 ETHEntity::GetColor() const { return Vector3(m_v4Color.x, m_v4Color.y, m_v4Color.z); } Vector4 ETHEntity::GetColorARGB() const { return m_v4Color; } float ETHEntity::GetAlpha() const { return m_v4Color.w; } void ETHEntity::SetShadowZ(const float z) { m_shadowZ = z; } float ETHEntity::GetShadowZ() const { return m_shadowZ; } bool ETHEntity::HasShadow() const { return (m_properties.castShadow == ETH_TRUE); } void ETHEntity::SetLayerDepth(const float depth) { m_properties.type = ETHEntityProperties::ET_LAYERABLE; m_properties.layerDepth = Max(0.0f, Min(depth, 1.0f)); } float ETHEntity::GetLayerDepth() const { return (m_properties.type == ETHEntityProperties::ET_LAYERABLE) ? m_properties.layerDepth : -1.0f; } float ETHEntity::GetDensity(const unsigned int fixtureIdx) const { if (m_properties.shape == ETHEntityProperties::BS_COMPOUND) { if (m_properties.compoundShape) return m_properties.compoundShape->GetIndividualDensity(fixtureIdx, m_properties.density); } return m_properties.density; } float ETHEntity::GetFriction(const unsigned int fixtureIdx) const { if (m_properties.shape == ETHEntityProperties::BS_COMPOUND) { if (m_properties.compoundShape) return m_properties.compoundShape->GetIndividualFriction(fixtureIdx, m_properties.friction); } return m_properties.friction; } float ETHEntity::GetRestitution(const unsigned int fixtureIdx) const { if (m_properties.shape == ETHEntityProperties::BS_COMPOUND) { if (m_properties.compoundShape) return m_properties.compoundShape->GetIndividualRestitution(fixtureIdx, m_properties.restitution); } return m_properties.restitution; } void ETHEntity::Scale(const Vector2& scale) { m_properties.scale = m_properties.scale * scale; for (std::size_t t = 0; t < GetNumParticleSystems(); t++) { ScaleParticleSystem(static_cast<unsigned int>(t), (scale.x + scale.y) / 2.0f); } m_controller->Scale(scale, this); } void ETHEntity::Scale(const float scale) { m_properties.scale *= scale; for (std::size_t t = 0; t < GetNumParticleSystems(); t++) { ScaleParticleSystem(static_cast<unsigned int>(t), scale); } m_controller->Scale(Vector2(scale, scale), this); } void ETHEntity::SetScale(const Vector2& scale) { m_properties.scale = scale; /*for (std::size_t t = 0; t < GetNumParticleSystems(); t++) { ScaleParticleSystem(t, (scale.x + scale.y) / 2.0f); }*/ } Vector2 ETHEntity::GetScale() const { return m_properties.scale; } void ETHEntity::ScaleParticleSystemOrigin(const unsigned int n, const float scale) { if (m_properties.particleSystems[n]) m_properties.particleSystems[n]->Scale(scale); } bool ETHEntity::IsRotatable() const { return GetType() != ETHEntityProperties::ET_VERTICAL; } bool ETHEntity::HasLightSource() const { return (m_properties.light); } bool ETHEntity::HasParticleSystems() const { return (m_properties.particleSystems.size() > 0); } Vector3 ETHEntity::GetLightPosition() const { if (HasLightSource()) return GetPosition() + m_properties.light->pos; else return Vector3(0,0,0); } Vector3 ETHEntity::GetLightRelativePosition() const { if (HasLightSource()) return m_properties.light->pos; else return Vector3(0,0,0); } bool ETHEntity::HasHalo() const { return (!HasLightSource()) ? false : (!m_properties.light->haloBitmap.empty()); } bool ETHEntity::IsCollidable() const { return (m_properties.collision); } Video::ALPHA_MODE ETHEntity::GetBlendMode() const { return m_properties.blendMode; } unsigned int ETHEntity::GetNumFrames() const { return static_cast<unsigned int>(m_properties.spriteCut.x * m_properties.spriteCut.y); } bool ETHEntity::HasAnyCallbackFunction() const { return m_controller->HasAnyCallbackFunction(); } bool ETHEntity::IsStatic() const { return ETHGlobal::ToBool(m_properties.staticEntity); } bool ETHEntity::IsApplyLight() const { return ETHGlobal::ToBool(m_properties.applyLight); } void ETHEntity::Hide(const bool hide) { m_hide = hide; } bool ETHEntity::IsHidden() const { return !(m_hide == ETH_FALSE); } bool ETHEntity::IsTemporary() const { unsigned int temporary = 0, existent = 0; for (std::size_t t=0; t<m_properties.particleSystems.size(); t++) { if (m_properties.particleSystems[t]->nParticles > 0) { if (m_properties.particleSystems[t]->repeat > 0) temporary++; existent++; } } if (existent && temporary == existent && m_properties.spriteFile == GS_L("")) { return true; } else { return false; } } bool ETHEntity::IsCastShadow() const { return !(m_properties.castShadow == ETH_FALSE); } bool ETHEntity::IsInvisible() const { return (m_properties.spriteFile == GS_L("") && !HasParticleSystems()); } bool ETHEntity::IsBody() const { return (m_properties.shape != ETHEntityProperties::BS_NONE && IsCollidable()); } Vector2 ETHEntity::GetCurrentBucket(const ETHBucketManager& buckets) const { return ETHBucketManager::GetBucket(GetPositionXY(), buckets.GetBucketSize()); } const ETHLight* ETHEntity::GetLight() const { return m_properties.light.get(); } bool ETHEntity::SetFrame(const unsigned int frame) { const Vector2i *pv2Cut = &m_properties.spriteCut; if (frame > static_cast<unsigned int>(pv2Cut->x * pv2Cut->y)) { m_spriteFrame = (0); return false; } else { m_spriteFrame = (frame); return true; } } unsigned int ETHEntity::GetFrame() const { return m_spriteFrame; } bool ETHEntity::SetFrame(const unsigned int column, const unsigned int row) { const Vector2i *pv2Cut = &m_properties.spriteCut; const unsigned int cutX = static_cast<unsigned int>(pv2Cut->x); const unsigned int cutY = static_cast<unsigned int>(pv2Cut->y); if (column >= cutX || row >= cutY) { m_spriteFrame = (0); return false; } else { m_spriteFrame = ((row*cutX)+column); return true; } } bool ETHEntity::RunCallbackScript() { return m_controller->RunCallback(this); } float ETHEntity::GetSpecularPower() const { return m_properties.specularPower; } float ETHEntity::GetSpecularBrightness() const { return m_properties.specularBrightness; } void ETHEntity::TurnDynamic() { m_properties.staticEntity = false; if (m_properties.light) m_properties.light->staticLight = false; } void ETHEntity::TurnStatic() { m_properties.staticEntity = true; if (m_properties.light) m_properties.light->staticLight = true; } const ETHCustomDataManager *ETHEntity::GetCustomDataManager() const { return &m_properties; } void ETHEntity::AddData(const str_type::string &name, const ETHCustomDataConstPtr &dataIn) { m_properties.AddData(name, dataIn); } void ETHEntity::SetFloat(const str_type::string &name, const float &value) { m_properties.SetFloat(name, value); } void ETHEntity::SetInt(const str_type::string &name, const int &value) { m_properties.SetInt(name, value); } void ETHEntity::SetUInt(const str_type::string &name, const unsigned int &value) { m_properties.SetUInt(name, value); } void ETHEntity::SetString(const str_type::string &name, const str_type::string &value) { m_properties.SetString(name, value); } void ETHEntity::SetVector2(const str_type::string &name, const Vector2 &value) { m_properties.SetVector2(name, value); } void ETHEntity::SetVector3(const str_type::string &name, const Vector3 &value) { m_properties.SetVector3(name, value); } float ETHEntity::GetFloat(const str_type::string &name) const { float fOut = 0.0f; m_properties.GetFloat(name, fOut); return fOut; } int ETHEntity::GetInt(const str_type::string &name) const { int nOut = 0; m_properties.GetInt(name, nOut); return nOut; } unsigned int ETHEntity::GetUInt(const str_type::string &name) const { unsigned int nOut = 0; m_properties.GetUInt(name, nOut); return nOut; } str_type::string ETHEntity::GetString(const str_type::string &name) const { str_type::string sOut = GS_L(""); m_properties.GetString(name, sOut); return sOut; } Vector2 ETHEntity::GetVector2(const str_type::string &name) const { Vector2 vOut(0,0); m_properties.GetVector2(name, vOut); return vOut; } Vector3 ETHEntity::GetVector3(const str_type::string &name) const { Vector3 vOut(0,0,0); m_properties.GetVector3(name, vOut); return vOut; } void ETHEntity::AddToFloat(const str_type::string &name, const float &value) { m_properties.AddToFloat(name, value); } void ETHEntity::AddToInt(const str_type::string &name, const int &value) { m_properties.AddToInt(name, value); } void ETHEntity::AddToUInt(const str_type::string &name, const unsigned int &value) { m_properties.AddToUInt(name, value); } void ETHEntity::AddToVector2(const str_type::string &name, const Vector2 &v) { m_properties.AddToVector2(name, v); } void ETHEntity::AddToVector3(const str_type::string &name, const Vector3 &v) { m_properties.AddToVector3(name, v); } void ETHEntity::MultiplyFloat(const str_type::string &name, const float &value) { m_properties.MultiplyFloat(name, value); } void ETHEntity::MultiplyInt(const str_type::string &name, const int &value) { m_properties.MultiplyInt(name, value); } void ETHEntity::MultiplyUInt(const str_type::string &name, const unsigned int &value) { m_properties.MultiplyUInt(name, value); } void ETHEntity::MultiplyVector2(const str_type::string &name, const float &value) { m_properties.MultiplyVector2(name, value); } void ETHEntity::MultiplyVector3(const str_type::string &name, const float &value) { m_properties.MultiplyVector3(name, value); } void ETHEntity::InsertData(const ETHCustomDataManager &dataIn) { m_properties.InsertData(dataIn); } void ETHEntity::MoveData(ETHCustomDataManager &dataOut) const { m_properties.MoveData(dataOut); } bool ETHEntity::EraseData(const str_type::string &name) { return m_properties.EraseData(name); } ETHCustomData::DATA_TYPE ETHEntity::CheckCustomData(const str_type::string &name) const { return m_properties.Check(name); } bool ETHEntity::HasCustomData() const { return m_properties.HasData(); } void ETHEntity::DebugPrintCustomData() const { GS2D_COUT << m_properties.GetDebugStringData(); } void ETHEntity::ClearCustomData() { m_properties.Clear(); } void ETHEntity::Kill() { ETHScriptEntity::Kill(); m_controller->Destroy(); } bool ETHEntity::IsFixedRotation() const { return (m_properties.fixedRotation == ETH_TRUE); } bool ETHEntity::IsSensor() const { return (m_properties.sensor == ETH_TRUE); } bool ETHEntity::HasSimulatedBody() const { return (boost::dynamic_pointer_cast<ETHPhysicsEntityController>(m_controller)); } bool ETHEntity::IsBullet() { return (m_properties.bullet == ETH_TRUE); } float ETHEntity::GetParallaxIndividualIntensity() const { return m_properties.parallaxIntensity; } void ETHEntity::SetParallaxIndividualIntensity(const float& individualIntensity) { m_properties.parallaxIntensity = individualIntensity; } ETHPolygonPtr ETHEntity::GetPolygon() const { return m_properties.polygon; } void ETHEntity::SetPivotAdjust(const Vector2& p) { m_properties.pivotAdjust = p / GetScale(); } gs2d::math::Vector2 ETHEntity::GetPivotAdjust() const { return m_properties.pivotAdjust * GetScale(); } ETHCompoundShapePtr ETHEntity::GetCompoundShape() const { return m_properties.compoundShape; } void ETHEntity::DisableLightSource() { m_properties.light.reset(); } void ETHEntity::SetFlipX(const bool flipX) { m_flipX = (flipX) ? ETH_TRUE : ETH_FALSE; } void ETHEntity::SetFlipY(const bool flipY) { m_flipY = (flipY) ? ETH_TRUE : ETH_FALSE; } bool ETHEntity::GetFlipX() const { return (m_flipX == ETH_TRUE); } bool ETHEntity::GetFlipY() const { return (m_flipY == ETH_TRUE); }
23.083176
116
0.745557
[ "shape" ]
54071711c7f8119c52f2614d79013b596181b748
11,475
cpp
C++
Game/Source/Player.cpp
AlCh440/SmallBrains
5798777beafc9449f42389bc3fd8fa0d166b2847
[ "MIT" ]
3
2021-02-22T08:45:29.000Z
2021-03-15T08:17:08.000Z
Game/Source/Player.cpp
AlCh440/SmallBrains
5798777beafc9449f42389bc3fd8fa0d166b2847
[ "MIT" ]
null
null
null
Game/Source/Player.cpp
AlCh440/SmallBrains
5798777beafc9449f42389bc3fd8fa0d166b2847
[ "MIT" ]
null
null
null
#include "App.h" #include "Player.h" #include "Textures.h" #include "Input.h" #include "Audio.h" #include "Render.h" #include "Window.h" #include "Collider.h" #include "Box.h" #include "LevelManager.h" #include "Collisions.h" #include "Log.h" #include "iostream" Player::Player(bool startEnabled) : Module(startEnabled) // { // Still playerhitbox = { (int)positionX, (int)positionY, 24, 24 }; StillAnim.PushBack({ 1, 51, 24, 24 }); StillAnim.loop = false; // move up upAnim.PushBack({ 1, 76, 24, 24 }); upAnim.PushBack({ 26, 76, 24, 24 }); upAnim.PushBack({ 51, 76, 24, 24 }); upAnim.PushBack({ 76, 76, 24, 24 }); upAnim.PushBack({ 101, 76, 24, 24 }); upAnim.PushBack({ 126, 76, 24, 24 }); upAnim.PushBack({ 151, 76, 24, 24 }); upAnim.PushBack({ 176, 76, 24, 24 }); upAnim.PushBack({ 1, 76, 24, 24 }); upAnim.loop = false; upAnim.speed = 1.f; // move down downAnim.PushBack({ 1, 1, 24, 24 }); downAnim.PushBack({ 26, 1, 24, 24 }); downAnim.PushBack({ 51, 1, 24, 24 }); downAnim.PushBack({ 76, 1, 24, 24 }); downAnim.PushBack({ 101, 1, 24, 24 }); downAnim.PushBack({ 126, 1, 24, 24 }); downAnim.PushBack({ 151, 1, 24, 24 }); downAnim.PushBack({ 176, 1, 24, 24 }); downAnim.PushBack({ 1, 1, 24, 24 }); downAnim.loop = false; downAnim.speed = 1.f; // move left leftAnim.PushBack({ 1, 26, 24, 24 }); leftAnim.PushBack({ 26, 26, 24, 24 }); leftAnim.PushBack({ 51, 26, 24, 24 }); leftAnim.PushBack({ 76, 26, 24, 24 }); leftAnim.PushBack({ 101, 26, 24, 24 }); leftAnim.PushBack({ 126, 26, 24, 24 }); leftAnim.PushBack({ 151, 26, 24, 24 }); leftAnim.PushBack({ 176, 26, 24, 24 }); leftAnim.PushBack({ 1, 26, 24, 24 }); leftAnim.loop = false; leftAnim.speed = 1.f; // move right rightAnim.PushBack({ 1, 51, 24, 24 }); rightAnim.PushBack({ 26, 51, 24, 24 }); rightAnim.PushBack({ 51, 51, 24, 24 }); rightAnim.PushBack({ 76, 51, 24, 24 }); rightAnim.PushBack({ 101, 51, 24, 24 }); rightAnim.PushBack({ 126, 51, 24, 24 }); rightAnim.PushBack({ 151, 51, 24, 24 }); rightAnim.PushBack({ 176, 51, 24, 24 }); rightAnim.PushBack({ 1, 51, 24, 24 }); rightAnim.loop = false; rightAnim.speed = 1.f; // move up pushing upPushAnim.PushBack({ 1, 176, 24, 24 }); upPushAnim.PushBack({ 26, 176, 24, 24 }); upPushAnim.PushBack({ 51, 176, 24, 24 }); upPushAnim.PushBack({ 76, 176, 24, 24 }); upPushAnim.PushBack({ 101, 176, 24, 24 }); upPushAnim.PushBack({ 126, 176, 24, 24 }); upPushAnim.PushBack({ 151, 176, 24, 24 }); upPushAnim.PushBack({ 176, 176, 24, 24 }); upPushAnim.PushBack({ 1, 76, 24, 24 }); upPushAnim.loop = false; upPushAnim.speed = 1.f; // move down pushing downPushAnim.PushBack({ 1, 101, 24, 24 }); downPushAnim.PushBack({ 26, 101, 24, 24 }); downPushAnim.PushBack({ 51, 101, 24, 24 }); downPushAnim.PushBack({ 76, 101, 24, 24 }); downPushAnim.PushBack({ 101, 101, 24, 24 }); downPushAnim.PushBack({ 126, 101, 24, 24 }); downPushAnim.PushBack({ 151, 101, 24, 24 }); downPushAnim.PushBack({ 176, 101, 24, 24 }); downPushAnim.PushBack({ 1, 1, 24, 24 }); downPushAnim.loop = false; downPushAnim.speed = 1.f; // move left pushing leftPushAnim.PushBack({ 1, 151, 24, 24 }); leftPushAnim.PushBack({ 26, 151, 24, 24 }); leftPushAnim.PushBack({ 51, 151, 24, 24 }); leftPushAnim.PushBack({ 76, 151, 24, 24 }); leftPushAnim.PushBack({ 101, 151, 24, 24 }); leftPushAnim.PushBack({ 126, 151, 24, 24 }); leftPushAnim.PushBack({ 151, 151, 24, 24 }); leftPushAnim.PushBack({ 176, 151, 24, 24 }); leftPushAnim.PushBack({ 1, 26, 24, 24 }); leftPushAnim.loop = false; leftPushAnim.speed = 1.f; // move right pushing rightPushAnim.PushBack({ 1, 126, 24, 24 }); rightPushAnim.PushBack({ 26, 126, 24, 24 }); rightPushAnim.PushBack({ 51, 126, 24, 24 }); rightPushAnim.PushBack({ 76, 126, 24, 24 }); rightPushAnim.PushBack({ 101, 126, 24, 24 }); rightPushAnim.PushBack({ 126, 126, 24, 24 }); rightPushAnim.PushBack({ 151, 126, 24, 24 }); rightPushAnim.PushBack({ 176, 126, 24, 24 }); rightPushAnim.PushBack({ 1, 51, 24, 24 }); rightPushAnim.loop = false; rightPushAnim.speed = 1.f; for (int i = 0; i < 4; i++) { playerCanMove[i] = true; } currentAnimation = &StillAnim; move = true; moveAction = 0; positionX = 0; positionY = 0; count = true; } Player::~Player() { } bool Player::Awake(pugi::xml_node& config) { return true; } bool Player::Start() { LOG("Loading player textures"); bool ret = true; spriteSheet = app->tex->Load("Assets/Textures/spriteSheet.png"); positionX = 0.0f; positionY = 0.0f; playerSteps = 0; direction = 1; stepCount = 0; collPlayer = app->collisions->AddCollider({ (int)positionX, (int)positionY, 24, 24 }, Collider::Type::PLAYER, app->player); collPlayerRight = app->collisions->AddCollider({ (int)positionX + 24, (int)positionY, 24, 24 }, Collider::Type::NEAR, app->player); collPlayerLeft = app->collisions->AddCollider({ (int)positionX - 24, (int)positionY, 24, 24 }, Collider::Type::NEAR, app->player); collPlayerUp = app->collisions->AddCollider({ (int)positionX, (int)positionY - 24, 24, 24 }, Collider::Type::NEAR, app->player); collPlayerDown = app->collisions->AddCollider({ (int)positionX, (int)positionY + 24, 24, 24 }, Collider::Type::NEAR, app->player); collPlayerFarRight = app->collisions->AddCollider({ (int)positionX + 48, (int)positionY, 24, 24 }, Collider::Type::FAR, app->player); collPlayerFarLeft = app->collisions->AddCollider({ (int)positionX - 48, (int)positionY, 24, 24 }, Collider::Type::FAR, app->player); collPlayerFarUp = app->collisions->AddCollider({ (int)positionX, (int)positionY - 48, 24, 24 }, Collider::Type::FAR, app->player); collPlayerFarDown = app->collisions->AddCollider({ (int)positionX, (int)positionY + 48, 24, 24 }, Collider::Type::FAR, app->player); afterGame = false; count = false; return true; } bool Player::LevelStart(int level) { if (level == 1) { } return true; } bool Player::Update(float dt) { if (move) { if ((app->input->GetKey(SDL_SCANCODE_A) == KEY_REPEAT) && (playerCanMove[2] == true)) { direction = 3; // Left move = false; leftAnim.Reset(); leftPushAnim.Reset(); if (playerPushing[2]) currentAnimation = &leftPushAnim; else currentAnimation = &leftAnim; stepCount++; } if ((app->input->GetKey(SDL_SCANCODE_D) == KEY_REPEAT) && (playerCanMove[3] == true)) { direction = 4; // Right move = false; rightAnim.Reset(); rightPushAnim.Reset(); if (playerPushing[3]) currentAnimation = &rightPushAnim; else currentAnimation = &rightAnim; stepCount++; } if ((app->input->GetKey(SDL_SCANCODE_W) == KEY_REPEAT) && (playerCanMove[0] == true)) { direction = 1; // Up move = false; upAnim.Reset(); upPushAnim.Reset(); if (playerPushing[0]) currentAnimation = &upPushAnim; else currentAnimation = &upAnim; stepCount++; } if ((app->input->GetKey(SDL_SCANCODE_S) == KEY_REPEAT) && (playerCanMove[1] == true)) { direction = 2; // Down move = false; downAnim.Reset(); downPushAnim.Reset(); if (playerPushing[1]) currentAnimation = &downPushAnim; else currentAnimation = &downAnim; stepCount++; } } else if ((moveAction < step) && (!move)) { moveAction += 1; if (direction == 1) { positionY -= 3; } else if (direction == 2) { positionY += 3; } else if (direction == 3) { positionX -= 3; } else if (direction == 4) { positionX += 3; } } else if (moveAction >= step) { if (!afterGame) { move = true; moveAction = 0; } } currentAnimation->Update(); drawPlayer(); collPlayer->SetPos(positionX, positionY); collPlayerLeft->SetPos(positionX - 24, positionY); collPlayerRight->SetPos(positionX + 24, positionY); collPlayerUp->SetPos(positionX, positionY - 24); collPlayerDown->SetPos(positionX, positionY + 24); collPlayerFarLeft->SetPos(positionX - 48, positionY); collPlayerFarRight->SetPos(positionX + 48, positionY); collPlayerFarUp->SetPos(positionX, positionY - 48); collPlayerFarDown->SetPos(positionX, positionY + 48); for (int i = 0; i < 4; i++) { playerCanMove[i] = true; } return true; } bool Player::PostUpdate() { for (int i = 0; i < 4; i++) { playerPushing[i] = false; } return true; } bool Player::CleanUp() { /*app->collisions->RemoveCollider(collPlayer); app->collisions->RemoveCollider(collPlayerDown); app->collisions->RemoveCollider(collPlayerUp); app->collisions->RemoveCollider(collPlayerLeft); app->collisions->RemoveCollider(collPlayerRight); app->collisions->RemoveCollider(collPlayerFarLeft); app->collisions->RemoveCollider(collPlayerFarRight); app->collisions->RemoveCollider(collPlayerFarUp); app->collisions->RemoveCollider(collPlayerFarDown); */ return true; } bool Player::isPlayerMoving() { return move; } int Player::playerDirection() { return direction; } void Player::drawPlayer() { app->render->DrawTexture(spriteSheet, positionX, positionY, &currentAnimation->GetCurrentFrame()); } void Player::OnCollision(Collider* c1, Collider* c2) { if (c2->type == Collider::Type::BOXMIDDLE) { if (c1 == collPlayerLeft) { playerPushing[2] = true; } else if (c1 == collPlayerRight) { playerPushing[3] = true; } else if (c1 == collPlayerUp) { playerPushing[0] = true; } else if (c1 == collPlayerDown) { playerPushing[1] = true; } } if (c2->type == Collider::Type::WALL) { if (c1 == collPlayerLeft) { playerCanMove[2] = false; } else if (c1 == collPlayerRight) { playerCanMove[3] = false; } else if (c1 == collPlayerUp) { playerCanMove[0] = false; } else if (c1 == collPlayerDown) { playerCanMove[1] = false; } } if ((c1->type == Collider::Type::NEAR) && (c2->type == Collider::Type::BOXMIDDLE)) { Collider* c3; if (c1 == collPlayerLeft) { for (uint k = 0; k < MAX_COLLIDERS; ++k) { if (app->collisions->colliders[k] == nullptr) continue; c3 = app->collisions->colliders[k]; if (app->collisions->matrix[c3->type][Collider::Type::FAR] && c3->Intersects({ (int)positionX - 48, (int)positionY, 24, 24 })) { playerCanMove[2] = false; } } } else if (c1 == collPlayerRight) { for (uint k = 0; k < MAX_COLLIDERS; ++k) { // skip empty colliders if (app->collisions->colliders[k] == nullptr) continue; c3 = app->collisions->colliders[k]; if (app->collisions->matrix[c3->type][Collider::Type::FAR] && c3->Intersects({ (int)positionX + 48, (int)positionY, 24, 24 })) { playerCanMove[3] = false; } } } else if (c1 == collPlayerUp) { for (uint k = 0; k < MAX_COLLIDERS; ++k) { // skip empty colliders if (app->collisions->colliders[k] == nullptr) continue; c3 = app->collisions->colliders[k]; if (app->collisions->matrix[c3->type][Collider::Type::FAR] && c3->Intersects({ (int)positionX, (int)positionY - 48, 24, 24 })) { playerCanMove[0] = false; } } } else if (c1 == collPlayerDown) { for (uint k = 0; k < MAX_COLLIDERS; ++k) { // skip empty colliders if (app->collisions->colliders[k] == nullptr) continue; c3 = app->collisions->colliders[k]; if (app->collisions->matrix[c3->type][Collider::Type::FAR] && c3->Intersects({ (int)positionX, (int)positionY + 48, 24, 24 })) { playerCanMove[1] = false; } } } } }
25
135
0.630675
[ "render" ]
540912978f4066017c5acc7a4d15df6c84066177
4,716
cpp
C++
tc tournaments/BalancingGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
3
2015-05-25T06:24:37.000Z
2016-09-10T07:58:00.000Z
tc tournaments/BalancingGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
null
null
null
tc tournaments/BalancingGame.cpp
ibudiselic/contest-problem-solutions
88082981b4d87da843472e3ca9ed5f4c42b3f0aa
[ "BSD-2-Clause" ]
5
2015-05-25T06:24:40.000Z
2021-08-19T19:22:29.000Z
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> using namespace std; int tx[1<<20]; int ty[1<<20]; bool done[1<<20]; bool dp[1<<20]; int N; int T; long long sqr(long long x) { return x*x; } long long magn(int mask) { return sqr(tx[mask]) + sqr(ty[mask]); } bool win(int mask) { if (mask == 0) return N%2; if (done[mask]) return dp[mask]; done[mask] = 1; for (int i=0; i<N; ++i) if (mask & (1<<i)) if (magn(mask ^ (1<<i))<=sqr(T) && !win(mask ^ (1<<i))) return dp[mask] = 1; return dp[mask] = 0; } class BalancingGame { public: vector <int> winningMoves(vector <int> x, vector <int> y, vector <int> w, int threshold) { N = x.size(); T = threshold; memset(tx, 0, sizeof tx); memset(ty, 0, sizeof ty); for (int i=0; i<N; ++i) for (int m=1; m<(1<<N); ++m) if (m & (1<<i)) { tx[m] -= y[i]*w[i]; ty[m] += x[i]*w[i]; } if (magn((1<<N)-1) > sqr(T)) return vector<int> (1, -1); memset(done, 0, sizeof done); vector<int> sol; for (int i=0; i<N; ++i) { int mask = ((1<<N)-1) ^ (1<<i); if (magn(mask)<=sqr(T) && !win(mask)) sol.push_back(i); } return sol; } // BEGIN CUT HERE public: void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); } private: template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); } void verify_case(int Case, const vector <int> &Expected, const vector <int> &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: " << print_array(Expected) << endl; cerr << "\tReceived: " << print_array(Received) << endl; } } void test_case_0() { int Arr0[] = { -10, 0, 10 }; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { 0, 0, 0 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arr2[] = { 5, 5, 5 }; vector <int> Arg2(Arr2, Arr2 + (sizeof(Arr2) / sizeof(Arr2[0]))); int Arg3 = 1; int Arr4[] = {1 }; vector <int> Arg4(Arr4, Arr4 + (sizeof(Arr4) / sizeof(Arr4[0]))); verify_case(0, Arg4, winningMoves(Arg0, Arg1, Arg2, Arg3)); } void test_case_1() { int Arr0[] = { 1, -1, 1, -1 }; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { -1, -1, 1, 1 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arr2[] = { 2, 3, 4, 5 }; vector <int> Arg2(Arr2, Arr2 + (sizeof(Arr2) / sizeof(Arr2[0]))); int Arg3 = 10000; int Arr4[] = { }; vector <int> Arg4(Arr4, Arr4 + (sizeof(Arr4) / sizeof(Arr4[0]))); verify_case(1, Arg4, winningMoves(Arg0, Arg1, Arg2, Arg3)); } void test_case_2() { int Arr0[] = { 0 }; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { 10 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arr2[] = { 50 }; vector <int> Arg2(Arr2, Arr2 + (sizeof(Arr2) / sizeof(Arr2[0]))); int Arg3 = 15; int Arr4[] = {-1 }; vector <int> Arg4(Arr4, Arr4 + (sizeof(Arr4) / sizeof(Arr4[0]))); verify_case(2, Arg4, winningMoves(Arg0, Arg1, Arg2, Arg3)); } void test_case_3() { int Arr0[] = { -20, -21, 60 }; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { 0, 0, 0 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arr2[] = { 20, 20, 10 }; vector <int> Arg2(Arr2, Arr2 + (sizeof(Arr2) / sizeof(Arr2[0]))); int Arg3 = 300; int Arr4[] = {0, 1 }; vector <int> Arg4(Arr4, Arr4 + (sizeof(Arr4) / sizeof(Arr4[0]))); verify_case(3, Arg4, winningMoves(Arg0, Arg1, Arg2, Arg3)); } void test_case_4() { int Arr0[] = { -3, -30, 0, 0, 3, 30 }; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { -2, 20, 3, -30, -2, 20 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arr2[] = { 6, 50, 7, 51, 8, 52 }; vector <int> Arg2(Arr2, Arr2 + (sizeof(Arr2) / sizeof(Arr2[0]))); int Arg3 = 1000; int Arr4[] = {0, 2, 4 }; vector <int> Arg4(Arr4, Arr4 + (sizeof(Arr4) / sizeof(Arr4[0]))); verify_case(4, Arg4, winningMoves(Arg0, Arg1, Arg2, Arg3)); } // END CUT HERE }; // BEGIN CUT HERE int main() { BalancingGame ___test; ___test.run_test(-1); } // END CUT HERE
47.636364
508
0.563613
[ "vector" ]
540abf23b94343288b21dd15e974201b52772b94
14,017
cpp
C++
src/common/net/server.cpp
arthurmco/familyline
849eee40cff266af9a3f848395ed139b7ce66197
[ "MIT" ]
6
2018-05-11T23:16:02.000Z
2019-06-13T01:35:07.000Z
src/common/net/server.cpp
arthurmco/familyline
849eee40cff266af9a3f848395ed139b7ce66197
[ "MIT" ]
33
2018-05-11T14:12:22.000Z
2022-03-12T00:55:25.000Z
src/common/net/server.cpp
arthurmco/familyline
849eee40cff266af9a3f848395ed139b7ce66197
[ "MIT" ]
1
2018-12-06T23:39:55.000Z
2018-12-06T23:39:55.000Z
#include <fmt/format.h> #include <algorithm> #include <common/logger.hpp> #include <common/net/server.hpp> #include <iterator> // for std::back_inserter #include <nlohmann/detail/exceptions.hpp> #include <nlohmann/json.hpp> #include <optional> #include <sstream> #include <string_view> #include "common/net/game_packet_server.hpp" using namespace familyline::net; using json = nlohmann::json; #include <curlpp/Easy.hpp> #include <curlpp/Exception.hpp> #include <curlpp/Infos.hpp> #include <curlpp/Options.hpp> #include <curlpp/cURLpp.hpp> using namespace curlpp::options; std::stringstream CServer::buildRequest( curlpp::Easy& req, std::string endpoint, std::string method, bool jsonbody, std::string data) { std::stringstream outstr; // Set the URL and the timeout lue. req.setOpt<Url>(fmt::format("http://{}/{}", http_address_, endpoint)); req.setOpt<Timeout>(timeout_secs_); req.setOpt<WriteStream>(&outstr); if (method == "POST") { req.setOpt<Post>(true); } if (method == "PUT") { req.setOpt<CustomRequest>("PUT"); } if (jsonbody) { std::list<std::string> header; auto datasize = data.size(); header.push_back("Accept: application/json"); header.push_back("Content-Type: application/json"); req.setOpt<HttpHeader>(header); req.setOpt<PostFields>(data); req.setOpt<PostFieldSize>(data.size()); } return outstr; } uint64_t CServer::getUserID() const { return cci_.has_value() ? cci_->info.id : 0; } bool CServer::isLogged() const { return cci_.has_value(); } std::string CServer::getAddress() const { if (isLogged()) return http_address_; return ""; } NetResult CServer::checkErrors(unsigned httpcode, std::stringstream& body) { body.seekg(0); auto& log = LoggerService::getLogger(); if (httpcode < 200 || httpcode > 299) { switch (httpcode) { case 400: { json response = json::parse(body); std::string message = response["message"]; log->write("cli-server", LogType::Error, "login failure: %s", message.c_str()); if (message.find("Not all clients are ready") != std::string::npos) { return NetResult::NotAllClientsConnected; } return NetResult::LoginFailure; } default: log->write( "cli-server", LogType::Error, "login returned weird HTTP code: %d", httpcode); return NetResult::ConnectionError; } } body.seekg(0); return NetResult::OK; } NetResult CServer::login(std::string address, std::string username) { http_address_ = address; auto& log = LoggerService::getLogger(); log->write("cli-server", LogType::Info, "logging to %s", address.c_str()); unsigned httpcode = 0; try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; json j; j["name"] = username; auto sstr = this->buildRequest(myRequest, "login", "POST", true, j.dump()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); auto httpcode = curlpp::infos::ResponseCode::get(myRequest); if (auto e = this->checkErrors(httpcode, sstr); e != NetResult::OK) { return e; } json response = json::parse(sstr); std::string token = response["token"]; uint64_t userid = response["user_id"]; if (response["name"] != username || token == "" || userid == 0) { return NetResult::ServerError; } cci_ = std::optional(CurrentClientInfo{CClientInfo{userid, username, false}, token}); log->write( "cli-server", LogType::Info, "logged succesfully: username=%s, userid=%ull, token=<XXX>", username.c_str(), userid); } catch (curlpp::RuntimeError& e) { std::string_view exc{e.what()}; log->write("cli-server", LogType::Error, "CURL error: %s,", exc.data()); if (exc.find("timed out") != std::string::npos) { return NetResult::ConnectionTimeout; } if (exc.find("Could not resolve host") != std::string::npos) { return NetResult::ConnectionError; } if (exc.find("Connection refused") != std::string::npos) { return NetResult::ConnectionError; } if (exc.find("reset by peer") != std::string::npos) { return NetResult::ConnectionError; } return NetResult::ServerError; } catch (curlpp::LogicError& e) { std::cerr << "Logic: " << e.what() << std::endl; } catch (nlohmann::detail::exception& e) { log->write( "cli-server", LogType::Error, "server returned status %d and we could not parse the incoming JSON (%s),", httpcode, e.what()); return NetResult::ServerError; } return NetResult::OK; } json createTokenMessage(std::string token) { json j; j["token"] = token; return j; } /** * Logout from the server * * This function should not fail, but, like the real life, where some retarded * people might not let you leave a certain place because 'they want to stay with you', * the server might act retarded. * Or the server might crash. * * You must be prepared for that. */ NetResult CServer::logout() { auto& log = LoggerService::getLogger(); if (!isLogged()) { log->write("cli-server", LogType::Warning, "logging out but already logged off"); return NetResult::AlreadyLoggedOff; } log->write("cli-server", LogType::Info, "logging out from %s", http_address_.c_str()); unsigned httpcode = 0; try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; json j = createTokenMessage(cci_->token); auto sstr = this->buildRequest(myRequest, "logout", "POST", true, j.dump()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); auto httpcode = curlpp::infos::ResponseCode::get(myRequest); if (auto e = this->checkErrors(httpcode, sstr); e != NetResult::OK) { return e; } json response = json::parse(sstr); auto serverid = response["id"]; if (serverid != cci_->info.id) { log->write( "cli-server", LogType::Error, "for some reason, IDs between client and server differ (cli %llx != ser %llx)", cci_->info.id, (uint64_t)serverid); return NetResult::ServerError; } log->write("cli-server", LogType::Info, "logged out succesfully"); } catch (curlpp::RuntimeError& e) { std::string_view exc{e.what()}; if (exc.find("Connection timed out") != std::string::npos) { return NetResult::ConnectionTimeout; } } catch (curlpp::LogicError& e) { std::cerr << "Logic: " << e.what() << std::endl; } catch (nlohmann::detail::exception& e) { log->write( "cli-server", LogType::Error, "server returned status %d and we could not parse the incoming JSON (%s),", httpcode, e.what()); return NetResult::ServerError; } return NetResult::OK; } NetResult CServer::getServerInfo(CServerInfo& info) { auto& log = LoggerService::getLogger(); if (!isLogged()) { log->write("cli-server", LogType::Warning, "getting server info but already logged off"); return NetResult::AlreadyLoggedOff; } log->write("cli-server", LogType::Info, "getting server info from %s", http_address_.c_str()); unsigned httpcode = 0; try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; json j = createTokenMessage(cci_->token); auto sstr = this->buildRequest(myRequest, "info", "POST", true, j.dump()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); auto httpcode = curlpp::infos::ResponseCode::get(myRequest); if (auto e = this->checkErrors(httpcode, sstr); e != NetResult::OK) { return e; } json response = json::parse(sstr); info.name = response["name"]; info.max_clients = response["max_clients"]; auto& jclients = response["clients"]; info.clients.clear(); std::transform( std::begin(jclients), std::end(jclients), std::back_inserter(info.clients), [&](auto& jclient) { return CClientInfo{jclient["user_id"], jclient["name"], jclient["ready"]}; }); info_ = info; } catch (curlpp::RuntimeError& e) { std::string_view exc{e.what()}; if (exc.find("Connection timed out") != std::string::npos) { return NetResult::ConnectionTimeout; } } catch (curlpp::LogicError& e) { std::cerr << "Logic: " << e.what() << std::endl; } catch (nlohmann::detail::exception& e) { log->write( "cli-server", LogType::Error, "server returned status %d and we could not parse the incoming JSON (%s),", httpcode, e.what()); return NetResult::ServerError; } return NetResult::OK; } bool CServer::isReady() const { return cci_->info.ready; } NetResult CServer::toggleReady(bool value) { auto& log = LoggerService::getLogger(); if (!isLogged()) { log->write("cli-server", LogType::Warning, "getting server info but already logged off"); return NetResult::AlreadyLoggedOff; } log->write( "cli-server", LogType::Info, "setting ready from %s to %s", http_address_.c_str(), value ? "true" : "false"); unsigned httpcode = 0; try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; json j = createTokenMessage(cci_->token); std::string endpoint = fmt::format("ready/{}", value ? "set" : "unset"); auto sstr = this->buildRequest(myRequest, endpoint, "PUT", true, j.dump()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); auto httpcode = curlpp::infos::ResponseCode::get(myRequest); if (auto e = this->checkErrors(httpcode, sstr); e != NetResult::OK) { return e; } cci_->info.ready = value; } catch (curlpp::RuntimeError& e) { std::string_view exc{e.what()}; if (exc.find("Connection timed out") != std::string::npos) { return NetResult::ConnectionTimeout; } } catch (curlpp::LogicError& e) { std::cerr << "Logic: " << e.what() << std::endl; } catch (nlohmann::detail::exception& e) { log->write( "cli-server", LogType::Error, "server returned status %d and we could not parse the incoming JSON (%s),", httpcode, e.what()); return NetResult::ServerError; } return NetResult::OK; } bool CServer::isConnecting() const { return (gsi_->address != "" && gsi_->port > 0); } NetResult CServer::connect() { auto& log = LoggerService::getLogger(); if (!isLogged()) { log->write("cli-server", LogType::Warning, "getting server info but already logged off"); return NetResult::AlreadyLoggedOff; } log->write("cli-server", LogType::Info, "connecting to %s", http_address_.c_str()); unsigned httpcode = 0; try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; json j = createTokenMessage(cci_->token); auto sstr = this->buildRequest(myRequest, "connect", "POST", true, j.dump()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); auto httpcode = curlpp::infos::ResponseCode::get(myRequest); if (auto e = this->checkErrors(httpcode, sstr); e != NetResult::OK) { return e; } json response = json::parse(sstr); std::string address = response["address"]; int port = response["port"]; gsi_ = std::optional(GameServerInfo{address, port}); log->write( "cli-server", LogType::Info, "game data transmission server at %s:%d", address.c_str(), port); } catch (curlpp::RuntimeError& e) { std::string_view exc{e.what()}; if (exc.find("Connection timed out") != std::string::npos) { return NetResult::ConnectionTimeout; } } catch (curlpp::LogicError& e) { std::cerr << "Logic: " << e.what() << std::endl; } catch (nlohmann::detail::exception& e) { log->write( "cli-server", LogType::Error, "server returned status %d and we could not parse the incoming JSON (%s),", httpcode, e.what()); return NetResult::ServerError; } return NetResult::OK; } std::optional<GamePacketServer> CServer::getGameServer() { if (!this->isLogged() || !this->isConnecting()) { return std::nullopt; } return std::make_optional<GamePacketServer>( gsi_->address, gsi_->port, cci_->token, cci_->info.id, info_.clients); }
31.428251
99
0.587644
[ "transform" ]
540e7d8b0f069de2b9d13b250f7c3a801bae7530
752
cpp
C++
BeginnerContest217/d.cpp
t15cs028/acCode_ABC
04588b31bcf5380aac4aa082aadcbb849e102789
[ "MIT" ]
null
null
null
BeginnerContest217/d.cpp
t15cs028/acCode_ABC
04588b31bcf5380aac4aa082aadcbb849e102789
[ "MIT" ]
null
null
null
BeginnerContest217/d.cpp
t15cs028/acCode_ABC
04588b31bcf5380aac4aa082aadcbb849e102789
[ "MIT" ]
null
null
null
/** * AtCoder Beginner Contest 217 * D - Cutting Woods */ #include <iostream> #include <string> #include <algorithm> #include <vector> #define rep(i,n) for(int i = 0; i < n; ++i) using namespace std; using uInt = unsigned int; int main(){ uInt l; int q; vector<uInt> p; cin >> l >> q; p.push_back(l); rep(i,q) { int c; uInt x; cin >> c >> x; switch(c) { case 1: p.push_back(x); break; case 2: sort(p.begin(), p.end()); uInt min = 0; uInt max = p.at((int)p.size()-1); rep(i,(int)p.size()) { if(x > p.at(i)) { min = p.at(i); } else { max = p.at(i); break; } } cout << max-min << endl; break; } } cout << endl; return 0; }
14.188679
43
0.486702
[ "vector" ]
5414b1e4a8171422d6694fa03283210856601944
3,475
cc
C++
src/MSM/msm_metric_sim.cc
ecr05/MSM_HOCR
c56f832436b18e612e95d3802b1961453910b283
[ "Unlicense" ]
21
2018-06-19T17:12:37.000Z
2022-02-12T11:47:17.000Z
src/MSM/msm_metric_sim.cc
ecr05/MSM_HOCR
c56f832436b18e612e95d3802b1961453910b283
[ "Unlicense" ]
16
2019-03-25T23:32:20.000Z
2021-12-13T13:07:12.000Z
src/MSM/msm_metric_sim.cc
ecr05/MSM_HOCR
c56f832436b18e612e95d3802b1961453910b283
[ "Unlicense" ]
8
2018-07-18T22:19:37.000Z
2021-10-05T13:54:20.000Z
#include <time.h> #include <stdio.h> #include "newmesh/meshfns.h" #include "MeshReg/meshreg.h" using namespace std; using namespace MISCMATHS; using namespace NEWMESH; using namespace MESHREG; void Usage() { cout << "msm_metric_sim <surface1> <surface2> <outbase> " << endl; cout << "Input are func files assumes surfaces have been resampled to same mesh " << endl; cout << " options: " << endl; cout << "-compare X compare correlation to this file " << endl; } int main( int argc, char **argv ) { newmesh SURFACE1, SURFACE2, OUTSURF,COMP; vector<double> data1,data2; string outputname; sparsesimkernel<double> sim; double correlation,sum=0.0; bool _compare=false; bool _exclude=false; int ok=0; if(argc < 3){ Usage(); exit(0); } SURFACE1.load(argv[1],false,false); argc--; argv++; SURFACE2.load(argv[1],false,false); argc--; argv++; outputname=argv[1]; argc--; argv++; while (argc > 1) { ok = 0; if((ok == 0) && (strcmp(argv[1], "-compare") == 0)){ argc--; argv++; _compare=true; COMP.load(argv[1],false,true); argc--; argv++; ok = 1; } else if((ok == 0) && (strcmp(argv[1], "-excl") == 0)){ argc--; argv++; _exclude=true; ok = 1; } } if(SURFACE1.npvalues()!=SURFACE2.npvalues() || SURFACE1.get_dimension()!=SURFACE2.get_dimension()) { cout << " surfaces have different number of vertices, or features abort! " << endl; exit(1);} boost::shared_ptr<NEWMESH::newmesh> EXCL_IN, EXCL_REF; if(_exclude){ Matrix DATAIN,DATAREF; DATAIN=SURFACE1.get_pvalues(); EXCL_IN= boost::shared_ptr<NEWMESH::newmesh>(new NEWMESH::newmesh(create_exclusion(SURFACE1,DATAIN,0,0))); DATAREF=SURFACE2.get_pvalues(); EXCL_REF= boost::shared_ptr<NEWMESH::newmesh>(new NEWMESH::newmesh(create_exclusion(SURFACE1,DATAREF,0,0))); }else{ EXCL_IN= boost::shared_ptr<NEWMESH::newmesh>(new NEWMESH::newmesh(SURFACE1)); EXCL_REF= boost::shared_ptr<NEWMESH::newmesh>(new NEWMESH::newmesh(SURFACE2)); for(int i=0;i<SURFACE1.npvalues();i++){ EXCL_IN->set_pvalue(i,1); EXCL_REF->set_pvalue(i,1); } } OUTSURF=SURFACE1; OUTSURF.clear_data(); ColumnVector allcorr(SURFACE1.npvalues()); if(SURFACE1.get_dimension()==1){ for (int i=0;i<SURFACE1.npvalues();i++){ if(EXCL_IN->get_pvalue(i)>0 && EXCL_REF->get_pvalue(i) > 0){ data1.push_back(SURFACE1.get_pvalue(i)); data2.push_back(SURFACE2.get_pvalue(i)); } } correlation=sim.corr(data1,data2); cout << " mean=" << correlation << endl; } else{ for (int i=0;i<SURFACE1.npvalues();i++){ data1.clear();data2.clear(); for (int j=0;j<SURFACE1.get_dimension();j++){ data1.push_back(SURFACE1.get_pvalue(i,j)); data2.push_back(SURFACE2.get_pvalue(i,j)); } correlation=sim.corr(data1,data2); allcorr(i+1)= correlation; sum+=correlation; } OUTSURF.set_pvalues(allcorr); double mean,var=0.0; mean=sum/SURFACE1.npvalues(); for (int i=0;i<SURFACE1.npvalues();i++) var+=(OUTSURF.get_pvalue(i) -mean)*(OUTSURF.get_pvalue(i) -mean); var/=SURFACE1.npvalues(); cout << " mean=" << mean << endl; cout << " var=" << var << endl; OUTSURF.save(outputname+".func.gii"); } if(_compare){ for (int i=0;i<SURFACE1.npvalues();i++){ double diff=OUTSURF.get_pvalue(i)-COMP.get_pvalue(i); OUTSURF.set_pvalue(i,diff); } OUTSURF.save(outputname+"DIFF.func.gii"); } }
25.551471
198
0.638849
[ "mesh", "vector" ]
54156a27aaa3b36a5edb405a88cf4b8d729d1f0d
2,628
cpp
C++
Tutorials/EB/LevelSet/Src/make_poly.cpp
ylunalin/amrex
5715b2fc8a77e0db17bfe7907982e29ec44811ca
[ "BSD-3-Clause-LBNL" ]
null
null
null
Tutorials/EB/LevelSet/Src/make_poly.cpp
ylunalin/amrex
5715b2fc8a77e0db17bfe7907982e29ec44811ca
[ "BSD-3-Clause-LBNL" ]
null
null
null
Tutorials/EB/LevelSet/Src/make_poly.cpp
ylunalin/amrex
5715b2fc8a77e0db17bfe7907982e29ec44811ca
[ "BSD-3-Clause-LBNL" ]
1
2020-01-17T05:00:26.000Z
2020-01-17T05:00:26.000Z
#include <AMReX_ParmParse.H> #include <make_shapes.H> using namespace amrex; std::unique_ptr<CylinderIF> make_poly_eb2_geom(int lev, int max_order, std::string field_prefix) { // Construct the ParamParse database field names based on the // `field_prefix` string: ParmParse pp("poly"); // Coefficients vector is stored in the inputs database with the field name: // <field_prefix>_[x,y,z]_coeffs const std::array<const std::string, 3> var_names{"x", "y", "z"}; std::array<std::string, 3> field_names; for(int i = 0; i < 3; i++) { std::stringstream field_name; field_name << field_prefix; field_name << "_" << var_names[i] << "_coeffs"; field_names[i] = field_name.str(); } // There are two more fields associated with the PolynomialIF: // <field_prefix>_mirror (true if fluid is inside the PolynomialIF) // <field_prefix>_translate (vector representing center-axis position) std::stringstream mirror_field, translate_field; mirror_field << field_prefix << "_mirror"; translate_field << field_prefix << "_translate"; // Generate vector representing polynomial Vector<EB2::PolyTerm> poly; for(int idir = 0; idir < 3; idir++) { Vector<Real> coefvec(SpaceDim); if(idir == 0) pp.getarr(field_names[idir].c_str(), coefvec, 0, max_order); else if(idir == 1) pp.getarr(field_names[idir].c_str(), coefvec, 0, max_order); else if(idir == 2) pp.getarr(field_names[idir].c_str(), coefvec, 0, max_order); for(int lc = 0; lc < max_order; lc++) { // x^(lc) term Real coef = coefvec[lc]; IntVect powers = IntVect::Zero; powers[idir] = lc; EB2::PolyTerm mono = {.coef = coef, .powers = powers}; poly.push_back(mono); } } /**************************************************************************** * Construct PolynomialIF (called CylinderIF here when used within a * * TranslationIF, see make_shapes.H ) * ****************************************************************************/ bool flip = true; pp.query(mirror_field.str().c_str(), flip); Vector<Real> transvec(SpaceDim); pp.getarr(translate_field.str().c_str(), transvec, 0, SpaceDim); RealArray offset = {AMREX_D_DECL(transvec[0], transvec[1], transvec[2])}; CylinderIF poly2(EB2::PolynomialIF(poly, flip), offset); std::unique_ptr<CylinderIF> ret = std::unique_ptr<CylinderIF>(new CylinderIF(poly2)); return ret; }
34.578947
89
0.583714
[ "vector" ]
542112a29d7ccce65b73d3233385ca05a6d9e996
972
cpp
C++
UVA/uva 483.cpp
dipta007/Competitive-Programming
998d47f08984703c5b415b98365ddbc84ad289c4
[ "MIT" ]
6
2018-10-15T18:45:05.000Z
2022-03-29T04:30:10.000Z
UVA/uva 483.cpp
dipta007/Competitive-Programming
998d47f08984703c5b415b98365ddbc84ad289c4
[ "MIT" ]
null
null
null
UVA/uva 483.cpp
dipta007/Competitive-Programming
998d47f08984703c5b415b98365ddbc84ad289c4
[ "MIT" ]
4
2018-01-07T06:20:07.000Z
2019-08-21T15:45:59.000Z
#include<cstdio> #include<sstream> #include<cstdlib> #include<cctype> #include<cmath> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include<vector> #include<cstring> #include<map> #include<iterator> using namespace std; int main() { int s; char a[10000],b[10000]; while(gets(a)) { s=strlen(a); int l=0; for(int i=0;i<s;i++) { if(i==s-1) { int k=i; for(l=l;k>=0 && a[l]!=' ';l++,k--) { b[l]=a[k]; } } else if(a[i]==' ') { int k=i-1; for(l=l;l>=0 && a[l]!=' ';l++,k--) { b[l]=a[k]; } b[l++]=' '; } } b[s]=0; cout << b << endl; } }
17.672727
50
0.391975
[ "vector" ]
5424e5060510ad028ce3e67dc1155410ca3db7a7
34,038
inl
C++
contrib/epee/include/net/connection_impl.inl
flywithfang/dfa
8f796294a2c8ed24f142183545ab87afd77c2b4e
[ "MIT" ]
null
null
null
contrib/epee/include/net/connection_impl.inl
flywithfang/dfa
8f796294a2c8ed24f142183545ab87afd77c2b4e
[ "MIT" ]
null
null
null
contrib/epee/include/net/connection_impl.inl
flywithfang/dfa
8f796294a2c8ed24f142183545ab87afd77c2b4e
[ "MIT" ]
null
null
null
PRAGMA_WARNING_PUSH namespace epee { namespace net_utils { template<typename T> T& check_and_get(std::shared_ptr<T>& ptr) { CHECK_AND_ASSERT_THROW_MES(bool(ptr), "shared_state cannot be null"); return *ptr; } /************************************************************************/ /* */ /************************************************************************/ PRAGMA_WARNING_DISABLE_VS(4355) template<class t_wire_handler> connection<t_wire_handler>::connection( boost::asio::io_service& io_service,std::shared_ptr<shared_state> state,t_connection_type connection_type, ssl_support_t ssl_support ) : connection(boost::asio::ip::tcp::socket{io_service}, std::move(state), connection_type, ssl_support) { } template<class t_wire_handler> connection<t_wire_handler>::connection( boost::asio::ip::tcp::socket&& sock,std::shared_ptr<shared_state> state,t_connection_type connection_type,ssl_support_t ssl_support ) : connection_basic(std::move(sock), state, ssl_support), m_wire_handler(this, check_and_get(state), m_con_context), buffer_ssl_init_fill(0), m_connection_type( connection_type ), m_throttle_speed_in("speed_in", "throttle_speed_in"), m_throttle_speed_out("speed_out", "throttle_speed_out"), m_timer(GET_IO_SERVICE(socket_)), m_local(false), m_ready_to_close(false) { MDEBUG("test, connection constructor set m_connection_type="<<m_connection_type); } PRAGMA_WARNING_DISABLE_VS(4355) //--------------------------------------------------------------------------------- template<class t_wire_handler> connection<t_wire_handler>::~connection() noexcept(false) { if(!m_was_shutdown) { MINFO("[sock " << socket().native_handle() << "] Socket destroyed without shutdown."); shutdown(); } MINFO("[sock " << socket().native_handle() << "] Socket destroyed"); } //--------------------------------------------------------------------------------- template<class t_wire_handler> boost::shared_ptr<connection<t_wire_handler> > connection<t_wire_handler>::safe_shared_from_this() { try { return connection<t_wire_handler>::shared_from_this(); } catch (const boost::bad_weak_ptr&) { // It happens when the connection is being deleted return boost::shared_ptr<connection<t_wire_handler> >(); } } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::start(bool is_income, bool is_multithreaded) { TRY_ENTRY(); boost::system::error_code ec; auto remote_ep = socket().remote_endpoint(ec); CHECK_AND_NO_ASSERT_MES(!ec, false, "Failed to get remote endpoint: " << ec.message() << ':' << ec.value()); CHECK_AND_NO_ASSERT_MES(remote_ep.address().is_v4() || remote_ep.address().is_v6(), false, "only IPv4 and IPv6 supported here"); if (remote_ep.address().is_v4()) { const unsigned long ip_ = boost::asio::detail::socket_ops::host_to_network_long(remote_ep.address().to_v4().to_ulong()); return start(is_income, is_multithreaded, ipv4_network_address{uint32_t(ip_), remote_ep.port()}); } else { const auto ip_ = remote_ep.address().to_v6(); return start(is_income, is_multithreaded, ipv6_network_address{ip_, remote_ep.port()}); } CATCH_ENTRY_L0("connection<t_wire_handler>::start()", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::start(bool is_income, bool is_multithreaded, network_address real_remote) { TRY_ENTRY(); // Use safe_shared_from_this, because of this is public method and it can be called on the object being deleted auto self = safe_shared_from_this(); if(!self) return false; m_is_multithreaded = is_multithreaded; m_local = real_remote.is_loopback() || real_remote.is_local(); // create a random uuid, we don't need crypto strength here const boost::uuids::uuid random_uuid = boost::uuids::random_generator()(); m_con_context = t_connection_context{}; bool ssl = m_ssl_support == epee::net_utils::ssl_support_t::e_ssl_support_enabled; m_con_context.set_details(random_uuid, std::move(real_remote), is_income, ssl); boost::system::error_code ec; auto local_ep = socket().local_endpoint(ec); CHECK_AND_NO_ASSERT_MES(!ec, false, "Failed to get local endpoint: " << ec.message() << ':' << ec.value()); MINFO("connection start() [sock " << socket_.native_handle() << "] from " << print_connection_context_short(m_con_context) << " to " << local_ep.address().to_string() << ':' << local_ep.port() << ", total sockets objects " << get_state().sock_count); if(static_cast<shared_state&>(get_state()).pfilter && !static_cast<shared_state&>(get_state()).pfilter->is_remote_host_allowed(m_con_context.m_remote_address)) { MINFO("[sock " << socket().native_handle() << "] host denied " << m_con_context.m_remote_address.host_str() << ", shutdowning connection"); close(); return false; } m_host = m_con_context.m_remote_address.host_str(); try { host_count(m_host, 1); } catch(...) { /* ignore */ } m_wire_handler.after_init_connection(); reset_timer(boost::posix_time::milliseconds(m_local ? NEW_CONNECTION_TIMEOUT_LOCAL : NEW_CONNECTION_TIMEOUT_REMOTE), false); // first read on the raw socket to detect SSL for the server buffer_ssl_init_fill = 0; if (is_income && m_ssl_support != epee::net_utils::ssl_support_t::e_ssl_support_disabled) socket().async_receive(boost::asio::buffer(buffer_), strand_.wrap(std::bind(&MyType::handle_receive, self, std::placeholders::_1,std::placeholders::_2))); else async_read_some(boost::asio::buffer(buffer_), strand_.wrap(std::bind(&MyType::handle_read, self,std::placeholders::_1,std::placeholders::_2))); boost::asio::ip::tcp::no_delay noDelayOption(false); socket().set_option(noDelayOption); return true; CATCH_ENTRY_L0("connection<t_wire_handler>::start()", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::request_callback() { TRY_ENTRY(); MINFO("[" << print_connection_context_short(m_con_context) << "] request_callback"); // Use safe_shared_from_this, because of this is public method and it can be called on the object being deleted auto self = safe_shared_from_this(); if(!self) return false; strand_.post(boost::bind(&connection<t_wire_handler>::call_back_starter, self)); CATCH_ENTRY_L0("connection<t_wire_handler>::request_callback()", false); return true; } //--------------------------------------------------------------------------------- template<class t_wire_handler> boost::asio::io_service& connection<t_wire_handler>::get_io_service() {; auto & s = socket(); return ((boost::asio::io_context&)(s).get_executor().context()); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::add_ref() { TRY_ENTRY(); // Use safe_shared_from_this, because of this is public method and it can be called on the object being deleted auto self = safe_shared_from_this(); if(!self) return false; //MINFO("[sock " << socket().native_handle() << "] add_ref, m_peer_number=" << mI->m_peer_number); CRITICAL_REGION_LOCAL(self->m_self_refs_lock); //MINFO("[sock " << socket().native_handle() << "] add_ref 2, m_peer_number=" << mI->m_peer_number); ++m_reference_count; m_self_ref = std::move(self); return true; CATCH_ENTRY_L0("connection<t_wire_handler>::add_ref()", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::release() { TRY_ENTRY(); boost::shared_ptr<connection<t_wire_handler> > back_connection_copy; LOG_TRACE_CC(m_con_context, "[sock " << socket().native_handle() << "] release"); CRITICAL_REGION_BEGIN(m_self_refs_lock); CHECK_AND_ASSERT_MES(m_reference_count, false, "[sock " << socket().native_handle() << "] m_reference_count already at 0 at connection<t_wire_handler>::release() call"); // is this the last reference? if (--m_reference_count == 0) { // move the held reference to a local variable, keeping the object alive until the function terminates std::swap(back_connection_copy, m_self_ref); } CRITICAL_REGION_END(); return true; CATCH_ENTRY_L0("connection<t_wire_handler>::release()", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::call_back_starter() { TRY_ENTRY(); MINFO("[" << print_connection_context_short(m_con_context) << "] fired_callback"); m_wire_handler.handle_qued_callback(); CATCH_ENTRY_L0("connection<t_wire_handler>::call_back_starter()", void()); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::save_dbg_log() { std::string address, port; boost::system::error_code e; boost::asio::ip::tcp::endpoint endpoint = socket().remote_endpoint(e); if (e) { address = "<not connected>"; port = "<not connected>"; } else { address = endpoint.address().to_string(); port = boost::lexical_cast<std::string>(endpoint.port()); } MDEBUG("save_dbg_log connection type " << to_string( m_connection_type ) << " " << socket().local_endpoint().address().to_string() << ":" << socket().local_endpoint().port() << " <--> " << m_con_context.m_remote_address.str() << " (via " << address << ":" << port << ")"); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::handle_read(const boost::system::error_code& e, std::size_t bytes_transferred) { TRY_ENTRY(); //_info("[sock " << socket().native_handle() << "] Async read calledback."); if (m_was_shutdown) return; if (!e) { double current_speed_down; { CRITICAL_REGION_LOCAL(m_throttle_speed_in_mutex); m_throttle_speed_in.handle_trafic_exact(bytes_transferred); current_speed_down = m_throttle_speed_in.get_current_speed(); } m_con_context.m_current_speed_down = current_speed_down; m_con_context.m_max_speed_down = std::max(m_con_context.m_max_speed_down, current_speed_down); { CRITICAL_REGION_LOCAL( epee::net_utils::network_throttle_manager::network_throttle_manager::m_lock_get_global_throttle_in ); epee::net_utils::network_throttle_manager::network_throttle_manager::get_global_throttle_in().handle_trafic_exact(bytes_transferred); } double delay=0; // will be calculated - how much we should sleep to obey speed limit etc if (speed_limit_is_enabled()) { do // keep sleeping if we should sleep { { //_scope_dbg1("CRITICAL_REGION_LOCAL"); CRITICAL_REGION_LOCAL( epee::net_utils::network_throttle_manager::m_lock_get_global_throttle_in ); delay = epee::net_utils::network_throttle_manager::get_global_throttle_in().get_sleep_time_after_tick( bytes_transferred ); } if (m_was_shutdown) return; delay *= 0.5; long int ms = (long int)(delay * 100); if (ms > 0) { reset_timer(boost::posix_time::milliseconds(ms + 1), true); boost::this_thread::sleep_for(boost::chrono::milliseconds(ms)); } } while(delay > 0); } // any form of sleeping //_info("[sock " << socket().native_handle() << "] RECV " << bytes_transferred); logger_handle_net_read(bytes_transferred); m_con_context.m_last_recv = time(NULL); m_con_context.m_recv_cnt += bytes_transferred; m_ready_to_close = false; bool recv_res = m_wire_handler.handle_recv(buffer_.data(), bytes_transferred); if(!recv_res) { //_info("[sock " << socket().native_handle() << "] protocol_want_close"); //some error in protocol, protocol handler ask to close connection boost::interprocess::ipcdetail::atomic_write32(&m_want_close_connection, 1); bool do_shutdown = false; CRITICAL_REGION_BEGIN(m_send_que_lock); if(!m_send_que.size()) do_shutdown = true; CRITICAL_REGION_END(); if(do_shutdown) shutdown(); }else { reset_timer(get_timeout_from_bytes_read(bytes_transferred), false); async_read_some(boost::asio::buffer(buffer_), strand_.wrap( boost::bind(&MyType::handle_read, connection<t_wire_handler>::shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred))); //_info("[sock " << socket().native_handle() << "]Async read requested."); } }else { MINFO("[sock " << socket().native_handle() << "] Some not success at read: " << e.message() << ':' << e.value()); if(e.value() != 2) { MINFO("[sock " << socket().native_handle() << "] Some problems at read: " << e.message() << ':' << e.value()); shutdown(); } else { MINFO("[sock " << socket().native_handle() << "] peer closed connection"); bool do_shutdown = false; CRITICAL_REGION_BEGIN(m_send_que_lock); if(!m_send_que.size()) do_shutdown = true; CRITICAL_REGION_END(); if (m_ready_to_close || do_shutdown) shutdown(); } m_ready_to_close = true; } // If an error occurs then no new asynchronous operations are started. This // means that all shared_ptr references to the connection object will // disappear and the object will be destroyed automatically after this // handler returns. The connection class's destructor closes the socket. CATCH_ENTRY_L0("connection<t_wire_handler>::handle_read", void()); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::handle_receive(const boost::system::error_code& e, std::size_t bytes_transferred) { TRY_ENTRY(); if (m_was_shutdown) return; if (e) { // offload the error case handle_read(e, bytes_transferred); return; } buffer_ssl_init_fill += bytes_transferred; MTRACE("we now have " << buffer_ssl_init_fill << "/" << get_ssl_magic_size() << " bytes needed to detect SSL"); if (buffer_ssl_init_fill < get_ssl_magic_size()) { socket().async_receive(boost::asio::buffer(buffer_.data() + buffer_ssl_init_fill, buffer_.size() - buffer_ssl_init_fill), strand_.wrap( boost::bind(&connection<t_wire_handler>::handle_receive, connection<t_wire_handler>::shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred))); return; } // detect SSL if (m_ssl_support == epee::net_utils::ssl_support_t::e_ssl_support_autodetect) { if (is_ssl((const unsigned char*)buffer_.data(), buffer_ssl_init_fill)) { MDEBUG("That looks like SSL"); m_ssl_support = epee::net_utils::ssl_support_t::e_ssl_support_enabled; // read/write to the SSL socket } else { MDEBUG("That does not look like SSL"); m_ssl_support = epee::net_utils::ssl_support_t::e_ssl_support_disabled; // read/write to the raw socket } } if (m_ssl_support == epee::net_utils::ssl_support_t::e_ssl_support_enabled) { // Handshake if (!handshake(boost::asio::ssl::stream_base::server, boost::asio::const_buffer(buffer_.data(), buffer_ssl_init_fill))) { MERROR("SSL handshake failed"); boost::interprocess::ipcdetail::atomic_write32(&m_want_close_connection, 1); m_ready_to_close = true; bool do_shutdown = false; CRITICAL_REGION_BEGIN(m_send_que_lock); if(!m_send_que.size()) do_shutdown = true; CRITICAL_REGION_END(); if(do_shutdown) shutdown(); return; } } else { handle_read(e, buffer_ssl_init_fill); return; } async_read_some(boost::asio::buffer(buffer_), strand_.wrap( boost::bind(&MyType::handle_read, connection<t_wire_handler>::shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred))); // If an error occurs then no new asynchronous operations are started. This // means that all shared_ptr references to the connection object will // disappear and the object will be destroyed automatically after this // handler returns. The connection class's destructor closes the socket. CATCH_ENTRY_L0("connection<t_wire_handler>::handle_receive", void()); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::call_run_once_service_io() { TRY_ENTRY(); if(!m_is_multithreaded) { //single thread model, we can wait in blocked call size_t cnt = GET_IO_SERVICE(socket()).run_one(); if(!cnt)//service is going to quit return false; }else { //multi thread model, we can't(!) wait in blocked call //so we make non blocking call and releasing CPU by calling sleep(0); //if no handlers were called //TODO: Maybe we need to have have critical section + event + callback to upper protocol to //ask it inside(!) critical region if we still able to go in event wait... size_t cnt = ((boost::asio::io_context&)(socket()).get_executor().context()).poll_one(); if(!cnt) misc_utils::sleep_no_w(1); } return true; CATCH_ENTRY_L0("connection<t_wire_handler>::call_run_once_service_io", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::do_send(byte_slice message) { TRY_ENTRY(); // Use safe_shared_from_this, because of this is public method and it can be called on the object being deleted auto self = safe_shared_from_this(); if (!self) return false; if (m_was_shutdown) return false; // TODO avoid copy std::uint8_t const* const message_data = message.data(); const std::size_t message_size = message.size(); const double factor = 32; // TODO config typedef long long signed int t_safe; // my t_size to avoid any overunderflow in arithmetic const t_safe chunksize_good = (t_safe)( 1024 * std::max(1.0,factor) ); const t_safe chunksize_max = chunksize_good * 2 ; const bool allow_split = (m_connection_type == e_connection_type_RPC) ? false : true; // do not split RPC data CHECK_AND_ASSERT_MES(! (chunksize_max<0), false, "Negative chunksize_max" ); // make sure it is unsigned before removin sign with cast: long long unsigned int chunksize_max_unsigned = static_cast<long long unsigned int>( chunksize_max ) ; if (allow_split && (message_size > chunksize_max_unsigned)) { { // LOCK: chunking epee::critical_region_t<decltype(m_chunking_lock)> send_guard(m_chunking_lock); // *** critical *** MDEBUG("do_send() will SPLIT into small chunks, from packet="<<message_size<<" B for ptr="<<(const void*)message_data); // 01234567890 // ^^^^ (pos=0, len=4) ; pos:=pos+len, pos=4 // ^^^^ (pos=4, len=4) ; pos:=pos+len, pos=8 // ^^^ (pos=8, len=4) ; // const size_t bufsize = chunksize_good; // TODO safecast // char* buf = new char[ bufsize ]; bool all_ok = true; while (!message.empty()) { byte_slice chunk = message.take_slice(chunksize_good); MDEBUG("chunk_start="<<(void*)chunk.data()<<" ptr="<<(const void*)message_data<<" pos="<<(chunk.data() - message_data)); MDEBUG("part of " << message.size() << ": pos="<<(chunk.data() - message_data) << " len="<<chunk.size()); bool ok = do_send_chunk(std::move(chunk)); // <====== *** all_ok = all_ok && ok; if (!all_ok) { MDEBUG("do_send() DONE ***FAILED*** from packet="<<message_size<<" B for ptr="<<(const void*)message_data); MDEBUG("do_send() SEND was aborted in middle of big package - this is mostly harmless " << " (e.g. peer closed connection) but if it causes trouble tell us at #monero-dev. " << message_size); return false; // partial failure in sending } // (in catch block, or uniq pointer) delete buf; } // each chunk MDEBUG("do_send() DONE SPLIT from packet="<<message_size<<" B for ptr="<<(const void*)message_data); MDEBUG("do_send() m_connection_type = " << m_connection_type); return all_ok; // done - e.g. queued - all the chunks of current do_send call } // LOCK: chunking } // a big block (to be chunked) - all chunks else { // small block return do_send_chunk(std::move(message)); // just send as 1 big chunk } CATCH_ENTRY_L0("connection<t_wire_handler>::do_send", false); } // do_send() //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::do_send_chunk(byte_slice chunk) { TRY_ENTRY(); // Use safe_shared_from_this, because of this is public method and it can be called on the object being deleted auto self = safe_shared_from_this(); if(!self) return false; if(m_was_shutdown) return false; double current_speed_up; { CRITICAL_REGION_LOCAL(m_throttle_speed_out_mutex); m_throttle_speed_out.handle_trafic_exact(chunk.size()); current_speed_up = m_throttle_speed_out.get_current_speed(); } m_con_context.m_current_speed_up = current_speed_up; m_con_context.m_max_speed_up = std::max(m_con_context.m_max_speed_up, current_speed_up); //_info("[sock " << socket().native_handle() << "] SEND " << cb); m_con_context.m_last_send = time(NULL); m_con_context.m_send_cnt += chunk.size(); //some data should be wrote to stream //request complete // No sleeping here; sleeping is done once and for all in "handle_write" m_send_que_lock.lock(); // *** critical *** epee::misc_utils::auto_scope_leave_caller scope_exit_handler = epee::misc_utils::create_scope_leave_handler([&](){m_send_que_lock.unlock();}); long int retry=0; const long int retry_limit = 5*4; while (m_send_que.size() > ABSTRACT_SERVER_SEND_QUE_MAX_COUNT) { retry++; /* if ( ::cryptonote::core::get_is_stopping() ) { // TODO re-add fast stop _fact("ABORT queue wait due to stopping"); return false; // aborted }*/ using engine = std::mt19937; engine rng; std::random_device dev; std::seed_seq::result_type rand[engine::state_size]{}; // Use complete bit space std::generate_n(rand, engine::state_size, std::ref(dev)); std::seed_seq seed(rand, rand + engine::state_size); rng.seed(seed); long int ms = 250 + (rng() % 50); MDEBUG("Sleeping because QUEUE is FULL, in " << __FUNCTION__ << " for " << ms << " ms before packet_size="<<chunk.size()); // XXX debug sleep m_send_que_lock.unlock(); boost::this_thread::sleep(boost::posix_time::milliseconds( ms ) ); m_send_que_lock.lock(); _dbg1("sleep for queue: " << ms); if (m_was_shutdown) return false; if (retry > retry_limit) { MWARNING("send que size is more than ABSTRACT_SERVER_SEND_QUE_MAX_COUNT(" << ABSTRACT_SERVER_SEND_QUE_MAX_COUNT << "), shutting down connection"); shutdown(); return false; } } m_send_que.push_back(std::move(chunk)); if(m_send_que.size() > 1) { // active operation should be in progress, nothing to do, just wait last operation callback auto size_now = m_send_que.back().size(); MDEBUG("do_send_chunk() NOW just queues: packet="<<size_now<<" B, is added to queue-size="<<m_send_que.size()); //do_send_handler_delayed( ptr , size_now ); // (((H))) // empty function LOG_TRACE_CC(m_con_context, "[sock " << socket().native_handle() << "] Async send requested " << m_send_que.front().size()); } else { // no active operation if(m_send_que.size()!=1) { _erro("Looks like no active operations, but send que size != 1!!"); return false; } auto size_now = m_send_que.front().size(); MDEBUG("do_send_chunk() NOW SENSD: packet="<<size_now<<" B"); if (speed_limit_is_enabled()) do_send_handler_write( m_send_que.back().data(), m_send_que.back().size() ); // (((H))) CHECK_AND_ASSERT_MES( size_now == m_send_que.front().size(), false, "Unexpected queue size"); reset_timer(get_default_timeout(), false); async_write(boost::asio::buffer(m_send_que.front().data(), size_now ) , strand_.wrap( std::bind(&connection<t_wire_handler>::handle_write, self, std::placeholders::_1, std::placeholders::_2) ) ); //MINFO("(chunk): " << size_now); //logger_handle_net_write(size_now); //_info("[sock " << socket().native_handle() << "] Async send requested " << m_send_que.front().size()); } //do_send_handler_stop( ptr , cb ); // empty function return true; CATCH_ENTRY_L0("connection<t_wire_handler>::do_send_chunk", false); } // do_send_chunk //--------------------------------------------------------------------------------- template<class t_wire_handler> boost::posix_time::milliseconds connection<t_wire_handler>::get_default_timeout() { unsigned count; try { count = host_count(m_host); } catch (...) { count = 0; } const unsigned shift = get_state().sock_count > AGGRESSIVE_TIMEOUT_THRESHOLD ? std::min(std::max(count, 1u) - 1, 8u) : 0; boost::posix_time::milliseconds timeout(0); if (m_local) timeout = boost::posix_time::milliseconds(DEFAULT_TIMEOUT_MS_LOCAL >> shift); else timeout = boost::posix_time::milliseconds(DEFAULT_TIMEOUT_MS_REMOTE >> shift); return timeout; } //--------------------------------------------------------------------------------- template<class t_wire_handler> boost::posix_time::milliseconds connection<t_wire_handler>::get_timeout_from_bytes_read(size_t bytes) { boost::posix_time::milliseconds ms = (boost::posix_time::milliseconds)(unsigned)(bytes * TIMEOUT_EXTRA_MS_PER_BYTE); const auto cur = m_timer.expires_from_now().total_milliseconds(); if (cur > 0) ms += (boost::posix_time::milliseconds)cur; if (ms > get_default_timeout()) ms = get_default_timeout(); return ms; } //--------------------------------------------------------------------------------- template<class t_wire_handler> unsigned int connection<t_wire_handler>::host_count(const std::string &host, int delta) { static boost::mutex hosts_mutex; CRITICAL_REGION_LOCAL(hosts_mutex); static std::map<std::string, unsigned int> hosts; unsigned int &val = hosts[host]; if (delta > 0) MTRACE("New connection from host " << host << ": " << val); else if (delta < 0) MTRACE("Closed connection from host " << host << ": " << val); CHECK_AND_ASSERT_THROW_MES(delta >= 0 || val >= (unsigned)-delta, "Count would go negative"); CHECK_AND_ASSERT_THROW_MES(delta <= 0 || val <= std::numeric_limits<unsigned int>::max() - (unsigned)delta, "Count would wrap"); val += delta; return val; } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::reset_timer(boost::posix_time::milliseconds ms, bool add) { const auto tms = ms.total_milliseconds(); if (tms < 0 || (add && tms == 0)) { MWARNING("Ignoring negative timeout " << ms); return; } MTRACE((add ? "Adding" : "Setting") << " " << ms << " expiry"); auto self = safe_shared_from_this(); if(!self) { MERROR("Resetting timer on a dead object"); return; } if (m_was_shutdown) { MERROR("Setting timer on a shut down object"); return; } if (add) { const auto cur = m_timer.expires_from_now().total_milliseconds(); if (cur > 0) ms += (boost::posix_time::milliseconds)cur; } m_timer.expires_from_now(ms); m_timer.async_wait([=](const boost::system::error_code& ec) { if(ec == boost::asio::error::operation_aborted) return; MDEBUG(m_con_context << "connection timeout, closing"); self->close(); }); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::shutdown() { CRITICAL_REGION_BEGIN(m_shutdown_lock); if (m_was_shutdown) return true; m_was_shutdown = true; // Initiate graceful connection closure. m_timer.cancel(); boost::system::error_code ignored_ec; if (m_ssl_support == epee::net_utils::ssl_support_t::e_ssl_support_enabled) { const shared_state &state = static_cast<const shared_state&>(get_state()); if (!state.stop_signal_sent) socket_.shutdown(ignored_ec); } socket().shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); if (!m_host.empty()) { try { host_count(m_host, -1); } catch (...) { /* ignore */ } m_host = ""; } CRITICAL_REGION_END(); m_wire_handler.release_protocol(); return true; } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::close() { TRY_ENTRY(); auto self = safe_shared_from_this(); if(!self) return false; //_info("[sock " << socket().native_handle() << "] Que Shutdown called."); m_timer.cancel(); size_t send_que_size = 0; CRITICAL_REGION_BEGIN(m_send_que_lock); send_que_size = m_send_que.size(); CRITICAL_REGION_END(); boost::interprocess::ipcdetail::atomic_write32(&m_want_close_connection, 1); if(!send_que_size) { shutdown(); } return true; CATCH_ENTRY_L0("connection<t_wire_handler>::close", false); } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::send_done() { if (m_ready_to_close) return close(); m_ready_to_close = true; return true; } //--------------------------------------------------------------------------------- template<class t_wire_handler> bool connection<t_wire_handler>::cancel() { return close(); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::handle_write(const boost::system::error_code& e, size_t cb) { TRY_ENTRY(); LOG_TRACE_CC(m_con_context, "[sock " << socket().native_handle() << "] Async send calledback " << cb); if (e) { _dbg1("[sock " << socket().native_handle() << "] Some problems at write: " << e.message() << ':' << e.value()); shutdown(); return; } logger_handle_net_write(cb); // The single sleeping that is needed for correctly handling "out" speed throttling if (speed_limit_is_enabled()) { sleep_before_packet(cb, 1, 1); } bool do_shutdown = false; CRITICAL_REGION_BEGIN(m_send_que_lock); if(m_send_que.empty()) { _erro("[sock " << socket().native_handle() << "] m_send_que.size() == 0 at handle_write!"); return; } m_send_que.pop_front(); if(m_send_que.empty()) { if(boost::interprocess::ipcdetail::atomic_read32(&m_want_close_connection)) { do_shutdown = true; } }else { //have more data to send reset_timer(get_default_timeout(), false); auto size_now = m_send_que.front().size(); MDEBUG("handle_write() NOW SENDS: packet="<<size_now<<" B" <<", from queue size="<<m_send_que.size()); if (speed_limit_is_enabled()) do_send_handler_write_from_queue(e, m_send_que.front().size() , m_send_que.size()); // (((H))) CHECK_AND_ASSERT_MES( size_now == m_send_que.front().size(), void(), "Unexpected queue size"); async_write(boost::asio::buffer(m_send_que.front().data(), size_now) , strand_.wrap( std::bind(&connection<t_wire_handler>::handle_write, connection<t_wire_handler>::shared_from_this(), std::placeholders::_1, std::placeholders::_2) ) ); //MINFO("(normal)" << size_now); } CRITICAL_REGION_END(); if(do_shutdown) { shutdown(); } CATCH_ENTRY_L0("connection<t_wire_handler>::handle_write", void()); } //--------------------------------------------------------------------------------- template<class t_wire_handler> void connection<t_wire_handler>::setRpcStation() { m_connection_type = e_connection_type_RPC; MDEBUG("set m_connection_type = RPC "); } template<class t_wire_handler> bool connection<t_wire_handler>::speed_limit_is_enabled() const { return m_connection_type != e_connection_type_RPC ; } } } PRAGMA_WARNING_POP
39.950704
176
0.616722
[ "object", "model" ]
542cab1f61b863d3945957e33434fae1a4b268df
514
cpp
C++
contest/AtCoder/agc049/A.cpp
not522/Competitive-Programming
be4a7d25caf5acbb70783b12899474a56c34dedb
[ "Unlicense" ]
7
2018-04-14T14:55:51.000Z
2022-01-31T10:49:49.000Z
contest/AtCoder/agc049/A.cpp
not522/Competitive-Programming
be4a7d25caf5acbb70783b12899474a56c34dedb
[ "Unlicense" ]
5
2018-04-14T14:28:49.000Z
2019-05-11T02:22:10.000Z
contest/AtCoder/agc049/A.cpp
not522/Competitive-Programming
be4a7d25caf5acbb70783b12899474a56c34dedb
[ "Unlicense" ]
null
null
null
#include "graph/adjacency_list.hpp" #include "graph/all_pairs_reachability.hpp" #include "string.hpp" int main() { int n(in); Vector<String> s(n, in); AdjacencyList<Edge> graph(n); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (s[i][j] == '1') { graph.addEdge(j, i); } } } auto reachable = reachability(graph); double res = 0; for (int i = 0; i < n; ++i) { res += 1.0 / reachable[i].count_if([](bool b) { return b; }); } cout << res << endl; }
22.347826
65
0.531128
[ "vector" ]
f9b31e502cc8b10fa29e2ddc74b4fe9beb68d243
12,406
cpp
C++
Bullet3D/ModuleSceneIntro.cpp
LaiaMartinezMotis/Bullet3D
a883722f677e1949330033334a3e712a74b4aa0c
[ "MIT" ]
null
null
null
Bullet3D/ModuleSceneIntro.cpp
LaiaMartinezMotis/Bullet3D
a883722f677e1949330033334a3e712a74b4aa0c
[ "MIT" ]
null
null
null
Bullet3D/ModuleSceneIntro.cpp
LaiaMartinezMotis/Bullet3D
a883722f677e1949330033334a3e712a74b4aa0c
[ "MIT" ]
null
null
null
#include "Globals.h" #include "Application.h" #include "ModuleSceneIntro.h" #include "Primitive.h" #include "PhysBody3D.h" #include "PhysVehicle3D.h" #include "ModulePlayer.h" ModuleSceneIntro::ModuleSceneIntro(Application* app, bool start_enabled) : Module(app, start_enabled) { } ModuleSceneIntro::~ModuleSceneIntro() {} // Load assets bool ModuleSceneIntro::Start() { LOG("Loading Intro assets"); bool ret = true; App->camera->Move(vec3(1.0f, 1.0f, 0.0f)); App->camera->LookAt(vec3(0, 0, 0)); //Play BSO App->audio->PlayMusic("Drift/Deja_Vu.ogg"); //Load Fx lose_fx = App->audio->LoadFx("Drift/lose.wav"); win_fx = App->audio->LoadFx("Drift/win1.wav"); coin_fx = App->audio->LoadFx("Drift/coin.wav"); //Create City CreateMap(-100, -100, 300, 300, 40, 40, 30); CreateLimits(); //Create Blocks CreateTriggers(80, -115, 14, 7); CreateTriggers(10, -55, 4, 9); CreateTriggers(-130, -25, 25, 4); CreateTriggers(-180, 25, 25, 4); CreateTriggers(-80, 45, 15, 4); CreateTriggers(-80, 35, 15, 4); CreateTriggers(68, 45, 12, 4); CreateTriggers(68, 35, 12, 4); CreateTriggers(180, 125, 18, 4); CreateTriggers(180, 115, 18, 4); CreateTriggers(40, 135, 14, 19); CreateTriggers(40, 190, 14, 19); //Borders CreateWall(96, -150, 10, 70); CreateWall(56, -150, 10, 70); CreateWall(-157, -115, 70, 10); CreateWall(-115, 165, 10, 70); CreateWall(157, 55, 60, 10); //Interior Walls CreateWall(5, -85, 30, 10); CreateWall(5, -45, 30, 10); /*CreateWall(5, 25, 30, 10);*/ CreateWall(5, -15, 30, 10); CreateWall(75, -15, 30, 10); CreateWall(-65, -45, 30, 10); CreateWall(-65, -115, 30, 10); CreateWall(75, -45, 30, 10); CreateWall(-65, 95, 30, 10); CreateWall(75, 95, 30, 10); /*CreateWall(5, 125, 30, 10);*/ CreateWall(96, -65, 10, 30); CreateWall(96, 0, 10, 30); CreateWall(55, 75, 10, 30); CreateWall(-115, 5, 10, 30); CreateWall(-45, 75, 10, 30); //Create Rewards CreateRewards(-65, -105); CreateRewards(-65, -35); CreateRewards(-150, -65); CreateRewards(-105, 5); CreateRewards(5, 5); CreateRewards(-65, 105); CreateRewards(35, 75); CreateRewards(5, 75); CreateRewards(-25, 75); CreateRewards(5, 165); CreateRewards(75, 165); CreateRewards(75, 75); //Create Pendul CreatePendul(5,125, 5, 25, 25, 1); //Win condition CreateWin(); game_timer.Start(); return ret; } update_status ModuleSceneIntro::PreUpdate(float dt) { //Left light if (App->input->GetKey(SDL_SCANCODE_A) == KEY_DOWN) { App->player->vehicle->left_light_turned = !App->player->vehicle->left_light_turned; limit_time_left.Start(); } if (App->input->GetKey(SDL_SCANCODE_D) == KEY_DOWN) { App->player->vehicle->right_light_turned = !App->player->vehicle->right_light_turned; limit_time_right.Start(); } if (App->input->GetKey(SDL_SCANCODE_R) == KEY_DOWN) { ResetGame(); } /*if (App->input->GetKey(SDL_SCANCODE_SPACE) == KEY_DOWN) { App->player->vehicle->SetPos(80, 0, 100); }*/ CarLights(); return UPDATE_CONTINUE; } // Load assets bool ModuleSceneIntro::CleanUp() { LOG("Unloading Intro scene"); buildings_phys.clear(); return true; } // Update update_status ModuleSceneIntro::Update(float dt) { p2List_item<Cube>* item_building = buildings.getFirst(); p2List_item<PhysBody3D*>* item_phy_b = buildings_phys.getFirst(); p2List_item<Sphere>* item_rew = rewards.getFirst(); p2List_item<PhysBody3D*>* item_phy_rew = rewards_phys.getFirst(); p2List_item<Cube>* item_grou = ground.getFirst(); p2List_item<PhysBody3D*>* item_phy_grou = ground_phys.getFirst(); p2List_item<Cube>* item_win = win.getFirst(); p2List_item<PhysBody3D*>* item_phy_win = win_phys.getFirst(); p2List_item<Cube>* item_hammer = hammer_list.getFirst(); p2List_item<PhysBody3D*>* item_phy_ham = hammer.getFirst(); p2List_item<Cube>* item_hinge = hinge_list.getFirst(); p2List_item<PhysBody3D*>* item_phy_hin = hinge_phys.getFirst(); p2List_item<Cube>* item_right = right_triggers.getFirst(); p2List_item<PhysBody3D*>* item_phy_right = right_triggers_phys.getFirst(); while (item_building && item_phy_b) { item_phy_b->data->GetTransform(&item_building->data.transform); item_building->data.color.Set(0.69, 0.69, 0.69,1); item_building->data.Render(); item_phy_b = item_phy_b->next; item_building = item_building->next; } while (item_grou && item_phy_grou) { item_phy_grou->data->GetTransform(&item_grou->data.transform); item_grou->data.color.Set(0.39, 0.46, 0.52, 1); item_grou->data.Render(); item_phy_grou = item_phy_grou->next; item_grou = item_grou->next; } while (item_rew && item_phy_rew) { item_phy_rew->data->GetTransform(&item_rew->data.transform); item_rew->data.color.Set(0.57, 0.43, 0.85, 1); item_rew->data.Render(); item_phy_rew = item_phy_rew->next; item_rew = item_rew->next; } while (item_win && item_phy_win) { item_phy_win->data->GetTransform(&item_win->data.transform); item_win->data.color.Set(0.62, 0.50, 0.37, 1); item_win->data.Render(); item_phy_win = item_phy_win->next; item_win = item_win->next; } while (item_hinge && item_phy_hin) { item_phy_hin->data->GetTransform(&item_hinge->data.transform); item_hinge->data.color.Set(0.61, 0.83, 0.67, 1); item_hinge->data.Render(); item_phy_hin = item_phy_hin->next; item_hinge = item_hinge->next; } while (item_hammer && item_phy_ham) { item_phy_ham->data->GetTransform(&item_hammer->data.transform); item_hammer->data.color.Set(0.61, 0.83, 0.67, 1); item_hammer->data.Render(); item_phy_ham = item_phy_ham->next; item_hammer = item_hammer->next; } while (item_right && item_phy_right) { item_phy_right->data->GetTransform(&item_right->data.transform); item_right->data.color.Set(0.99, 0.72, 0.38, 1); item_right->data.Render(); item_phy_right = item_phy_right->next; item_right = item_right->next; } finish_time = 75000 - App->scene_intro->game_timer.Read(); minutes = finish_time / 60000; if (finish_time < 0) { App->audio->PlayFx(lose_fx); ResetGame(); } if (App->player->vehicle->GetKmh() > 100) { App->player->vehicle->score--; } if (App->player->vehicle->score < 0) { App->player->vehicle->score = 0; } return UPDATE_CONTINUE; } void ModuleSceneIntro::OnCollision(PhysBody3D* body1, PhysBody3D* body2) { if (body1 == App->player->vehicle) { LOG("owo"); p2List_item<PhysBody3D*>* item_phy_rew = rewards_phys.getFirst(); while (item_phy_rew) { if (body2 == item_phy_rew->data) { App->audio->PlayFx(coin_fx); App->player->vehicle->score += 100; } item_phy_rew = item_phy_rew->next; } p2List_item<PhysBody3D*>* item_win = win_phys.getFirst(); if (body2 == item_win->data) { App->audio->PlayFx(win_fx); ResetGame(); } p2List_item<PhysBody3D*>* item_phy_b = buildings_phys.getFirst(); while (item_phy_b) { if (body2 == item_phy_b->data) { App->player->vehicle->score -= 100; } item_phy_b = item_phy_b->next; } p2List_item<PhysBody3D*>* item_right = right_triggers_phys.getFirst(); while (item_right) { if (body2 == item_right->data) { App->player->vehicle->score -= 100; }; item_right = item_right->next; } } } void ModuleSceneIntro::CreateTriggers(int x, int z, int width, int heigh) { Cube right(width, 4, heigh); right.SetPos(x, 0, z); right_triggers.add(right); right_triggers_phys.add(App->physics->AddBody(right, 100000.00F)); right.Render(); } void ModuleSceneIntro::CreatePendul(int x, int z, int r, int s, int width, int height) { Cube axis_door_one(40,2,2); Cube door_one(width, 50, height); Cube axis_door_two(40, 2, 2); Cube door_two(width, 50, height); axis_door_one.SetPos(x,50,z); door_one.SetPos(x,0,z); axis_door_two.SetPos(r, 50, s); door_two.SetPos(r, 0, s); hammer_list.add(door_one); hinge_list.add(axis_door_one); hammer_list.add(door_two); hinge_list.add(axis_door_two); hinge_phys.add(App->physics->AddBody(axis_door_one, 1000.0F)); hammer.add(App->physics->AddBody(door_one,10.0f)); hinge_phys.add(App->physics->AddBody(axis_door_two, 1000.0F)); hammer.add(App->physics->AddBody(door_two, 10.0f)); for (int i = 0; i <= hammer.count(); i++) { PhysBody3D* bodyA; PhysBody3D* bodyB; hinge_phys.at(i, bodyA); hammer.at(i, bodyB); App->physics->AddConstraintHinge(*bodyA, *bodyB, vec3(0, -22, 0), (0, 0, 0), (1, -22, 1), (1, -22, 1), true); } axis_door_one.Render(); door_one.Render(); axis_door_two.Render(); door_two.Render(); } void ModuleSceneIntro::CreateWin() { Cube end_left(5, 30, 5); Cube end_right(5, 30, 5); Cube end_up(5, 5, 32); Cube end_wall(5, 30, 32); win.add(end_wall); win.add(end_left); win.add(end_right); win.add(end_up); end_wall.SetPos(-95, 0, 163); end_left.SetPos(-90, 0, 178); end_right.SetPos(-90, 0, 148); end_up.SetPos(-90, 30, 163); win_phys.add(App->physics->AddBody(end_wall, 100000.0F)); win_phys.add(App->physics->AddBody(end_left, 10000.0F)); win_phys.add(App->physics->AddBody(end_right, 10000.0F)); win_phys.add(App->physics->AddBody(end_up, 10000.0F)); end_wall.Render(); end_left.Render(); end_right.Render(); end_up.Render(); } void ModuleSceneIntro::CreateLimits() { Cube limit_one(400, 10, 10); Cube limit_two(10, 10, 390); Cube limit_three(10, 10, 390); Cube limit_four(400, 10, 10); Cube plane(400, 0, 400); ground.add(limit_one); ground.add(limit_two); ground.add(limit_three); ground.add(limit_four); ground.add(plane); limit_one.SetPos(0, 0, 195); limit_two.SetPos(-195, 0, 0); limit_three.SetPos(195, 0, 0); limit_four.SetPos(0, 0, -195); plane.SetPos(0, -10, 0); ground_phys.add(App->physics->AddBody(limit_one, 100000.00F)); ground_phys.add(App->physics->AddBody(limit_two, 100000.00F)); ground_phys.add(App->physics->AddBody(limit_three, 100000.00F)); ground_phys.add(App->physics->AddBody(limit_four, 100000.00F)); ground_phys.add(App->physics->AddBody(plane, 100000.00F)); } void ModuleSceneIntro::CreateMap(int x, int z, int width, int height, int b_width, int b_height, int street) { int building_row = (int)(width / (b_width + street)); int building_col = (int)(height / (b_height + street)); for (int col = 0; col < building_col; col++) { for (int row = 0; row < building_row; row++) { int b_x = row * (street + b_width); int b_z = col * (street + b_height); Cube c(b_width, 50, b_height); //Cube box(15, 3.75, 5); buildings.add(c); //cars.add(box); c.SetPos(x + b_x, 0, z + b_z); //box.SetPos(x + b_x, 0, z + b_z); buildings_phys.add(App->physics->AddBody(c, 100000.00F)); //cars_phys.add(App->physics->AddBody(box, 100000.00F)); } } } void ModuleSceneIntro::CreateRewards(int x, int z) { Sphere r(2.0); r.SetPos(x, 0, z); rewards.add(r); rewards_phys.add(App->physics->AddBody(r, 100.0F)); r.Render(); } void ModuleSceneIntro::CreateWall(int x, int z, int width, int height) { Cube c(width, 50, height); c.SetPos(x, 0, z); buildings.add(c); buildings_phys.add(App->physics->AddBody(c, 100000.00F)); c.Render(); } void ModuleSceneIntro::CarLights() { //Left Light if (App->player->vehicle->left_light_turned) { if (timer_left.Read() > 500) { App->player->vehicle->left_light.color.Set(1.0f, 1.0f, 1.0f, 1.0f); if (timer_left.Read() > 1000) timer_left.Start(); } else { App->player->vehicle->left_light.color.Set(0.6f, 0.5f, 0.1f, 0.8f); } } else { timer_left.Start(); App->player->vehicle->left_light.color.Set(1.0f, 1.0f, 1.0f, 1.0f); } //Right Light if (App->player->vehicle->right_light_turned) { if (timer_right.Read() > 500) { App->player->vehicle->right_light.color.Set(1.0f, 1.0f, 1.0f, 1.0f); if (timer_right.Read() > 1000) timer_right.Start(); } else { App->player->vehicle->right_light.color.Set(0.6f, 0.5f, 0.1f, 0.8f); } } else { timer_right.Start(); App->player->vehicle->right_light.color.Set(1.0f, 1.0f, 1.0f, 1.0f); } if (limit_time_left.Read() > 5000) { App->player->vehicle->left_light_turned = false; } if (limit_time_right.Read() > 5000) { App->player->vehicle->right_light_turned = false; } } void ModuleSceneIntro::ResetGame() { App->player->vehicle->score = 0; game_timer.Start(); App->player->vehicle->SetPos(70, 0, -150); App->player->vehicle->Orientation(0); App->player->vehicle->SetLinearVelocity(0, 0, 0); App->audio->PlayMusic("Drift/Deja_Vu.ogg"); }
22.763303
111
0.676205
[ "render", "transform" ]
f9bfd9a93b4e424555608e76ab8036fa41fb58f3
22,875
cpp
C++
Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
RTSandberg/WarpX
78d3d84649692d711baf5872f476bbe7522ae36c
[ "BSD-3-Clause-LBNL" ]
null
null
null
Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
RTSandberg/WarpX
78d3d84649692d711baf5872f476bbe7522ae36c
[ "BSD-3-Clause-LBNL" ]
null
null
null
Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
RTSandberg/WarpX
78d3d84649692d711baf5872f476bbe7522ae36c
[ "BSD-3-Clause-LBNL" ]
null
null
null
/* Copyright 2021 Modern Electron * * This file is part of WarpX. * * License: BSD-3-Clause-LBNL */ #include "BackgroundMCCCollision.H" #include "ImpactIonization.H" #include "Particles/ParticleCreation/FilterCopyTransform.H" #include "Particles/ParticleCreation/SmartCopy.H" #include "Utils/TextMsg.H" #include "Utils/ParticleUtils.H" #include "Utils/WarpXUtil.H" #include "Utils/WarpXProfilerWrapper.H" #include "WarpX.H" #include <AMReX_ParmParse.H> #include <AMReX_REAL.H> #include <AMReX_Vector.H> #include <string> BackgroundMCCCollision::BackgroundMCCCollision (std::string const collision_name) : CollisionBase(collision_name) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_species_names.size() == 1, "Background MCC must have exactly one species."); amrex::ParmParse pp_collision_name(collision_name); amrex::Real background_density = 0; if (queryWithParser(pp_collision_name, "background_density", background_density)) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( (background_density > 0), "The background density must be greater than 0." ); m_background_density_parser = makeParser(std::to_string(background_density), {"x", "y", "z", "t"}); } else { std::string background_density_str; pp_collision_name.get("background_density(x,y,z,t)", background_density_str); m_background_density_parser = makeParser(background_density_str, {"x", "y", "z", "t"}); } amrex::Real background_temperature; if (queryWithParser(pp_collision_name, "background_temperature", background_temperature)) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( (background_temperature >= 0), "The background temperature must be positive." ); m_background_temperature_parser = makeParser(std::to_string(background_temperature), {"x", "y", "z", "t"}); } else { std::string background_temperature_str; pp_collision_name.get("background_temperature(x,y,z,t)", background_temperature_str); m_background_temperature_parser = makeParser(background_temperature_str, {"x", "y", "z", "t"}); } // compile parsers for background density and temperature m_background_density_func = m_background_density_parser.compile<4>(); m_background_temperature_func = m_background_temperature_parser.compile<4>(); queryWithParser(pp_collision_name, "max_background_density", m_max_background_density); // if the background density is constant we can use that number to calculate // the maximum collision probability, if `max_background_density` was not // specified if (m_max_background_density == 0 && background_density != 0) { m_max_background_density = background_density; } WARPX_ALWAYS_ASSERT_WITH_MESSAGE( (m_max_background_density > 0), "The maximum background density must be greater than 0." ); // if the neutral mass is specified use it, but if ionization is // included the mass of the secondary species of that interaction // will be used. If no neutral mass is specified and ionization is not // included the mass of the colliding species will be used m_background_mass = -1; queryWithParser(pp_collision_name, "background_mass", m_background_mass); // query for a list of collision processes // these could be elastic, excitation, charge_exchange, back, etc. amrex::Vector<std::string> scattering_process_names; pp_collision_name.queryarr("scattering_processes", scattering_process_names); // create a vector of MCCProcess objects from each scattering // process name for (const auto& scattering_process : scattering_process_names) { std::string kw_cross_section = scattering_process + "_cross_section"; std::string cross_section_file; pp_collision_name.query(kw_cross_section.c_str(), cross_section_file); amrex::Real energy = 0.0; // if the scattering process is excitation or ionization get the // energy associated with that process if (scattering_process.find("excitation") != std::string::npos || scattering_process.find("ionization") != std::string::npos) { std::string kw_energy = scattering_process + "_energy"; getWithParser(pp_collision_name, kw_energy.c_str(), energy); } MCCProcess process(scattering_process, cross_section_file, energy); WARPX_ALWAYS_ASSERT_WITH_MESSAGE(process.type() != MCCProcessType::INVALID, "Cannot add an unknown MCC process type"); // if the scattering process is ionization get the secondary species // only one ionization process is supported, the vector // m_ionization_processes is only used to make it simple to calculate // the maximum collision frequency with the same function used for // particle conserving processes if (process.type() == MCCProcessType::IONIZATION) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE(!ionization_flag, "Background MCC only supports a single ionization process"); ionization_flag = true; std::string secondary_species; pp_collision_name.get("ionization_species", secondary_species); m_species_names.push_back(secondary_species); m_ionization_processes.push_back(std::move(process)); } else { m_scattering_processes.push_back(std::move(process)); } } #ifdef AMREX_USE_GPU amrex::Gpu::HostVector<MCCProcess::Executor> h_scattering_processes_exe; amrex::Gpu::HostVector<MCCProcess::Executor> h_ionization_processes_exe; for (auto const& p : m_scattering_processes) { h_scattering_processes_exe.push_back(p.executor()); } for (auto const& p : m_ionization_processes) { h_ionization_processes_exe.push_back(p.executor()); } m_scattering_processes_exe.resize(h_scattering_processes_exe.size()); m_ionization_processes_exe.resize(h_ionization_processes_exe.size()); amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, h_scattering_processes_exe.begin(), h_scattering_processes_exe.end(), m_scattering_processes_exe.begin()); amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, h_ionization_processes_exe.begin(), h_ionization_processes_exe.end(), m_ionization_processes_exe.begin()); amrex::Gpu::streamSynchronize(); #else for (auto const& p : m_scattering_processes) { m_scattering_processes_exe.push_back(p.executor()); } for (auto const& p : m_ionization_processes) { m_ionization_processes_exe.push_back(p.executor()); } #endif } /** Calculate the maximum collision frequency using a fixed energy grid that * ranges from 1e-4 to 5000 eV in 0.2 eV increments */ amrex::Real BackgroundMCCCollision::get_nu_max(amrex::Vector<MCCProcess> const& mcc_processes) { using namespace amrex::literals; amrex::Real nu, nu_max = 0.0; amrex::Real E_start = 1e-4_rt; amrex::Real E_end = 5000._rt; amrex::Real E_step = 0.2_rt; // set the energy limits and step size for calculating nu_max based // on the given cross-section inputs for (const auto &process : mcc_processes) { auto energy_lo = process.getMinEnergyInput(); E_start = (energy_lo < E_start) ? energy_lo : E_start; auto energy_hi = process.getMaxEnergyInput(); E_end = (energy_hi > E_end) ? energy_hi : E_end; auto energy_step = process.getEnergyInputStep(); E_step = (energy_step < E_step) ? energy_step : E_step; } for (amrex::Real E = E_start; E < E_end; E+=E_step) { amrex::Real sigma_E = 0.0; // loop through all collision pathways for (const auto &scattering_process : mcc_processes) { // get collision cross-section sigma_E += scattering_process.getCrossSection(E); } // calculate collision frequency nu = ( m_max_background_density * std::sqrt(2.0_rt / m_mass1 * PhysConst::q_e) * sigma_E * std::sqrt(E) ); if (nu > nu_max) { nu_max = nu; } } return nu_max; } void BackgroundMCCCollision::doCollisions (amrex::Real cur_time, amrex::Real dt, MultiParticleContainer* mypc) { WARPX_PROFILE("BackgroundMCCCollision::doCollisions()"); using namespace amrex::literals; auto& species1 = mypc->GetParticleContainerFromName(m_species_names[0]); // this is a very ugly hack to have species2 be a reference and be // defined in the scope of doCollisions auto& species2 = ( (m_species_names.size() == 2) ? mypc->GetParticleContainerFromName(m_species_names[1]) : mypc->GetParticleContainerFromName(m_species_names[0]) ); if (!init_flag) { m_mass1 = species1.getMass(); // calculate maximum collision frequency without ionization m_nu_max = get_nu_max(m_scattering_processes); // calculate total collision probability auto coll_n = m_nu_max * dt; m_total_collision_prob = 1.0_rt - std::exp(-coll_n); // dt has to be small enough that a linear expansion of the collision // probability is sufficiently accurately, otherwise the MCC results // will be very heavily affected by small changes in the timestep WARPX_ALWAYS_ASSERT_WITH_MESSAGE(coll_n < 0.1_rt, "dt is too large to ensure accurate MCC results" ); if (ionization_flag) { // calculate maximum collision frequency for ionization m_nu_max_ioniz = get_nu_max(m_ionization_processes); // calculate total ionization probability auto coll_n_ioniz = m_nu_max_ioniz * dt; m_total_collision_prob_ioniz = 1.0_rt - std::exp(-coll_n_ioniz); WARPX_ALWAYS_ASSERT_WITH_MESSAGE(coll_n_ioniz < 0.1_rt, "dt is too large to ensure accurate MCC results" ); // if an ionization process is included the secondary species mass // is taken as the background mass m_background_mass = species2.getMass(); } // if no neutral species mass was specified and ionization is not // included assume that the collisions will be with neutrals of the // same mass as the colliding species (as in ion-neutral collisions) else if (m_background_mass == -1) { m_background_mass = species1.getMass(); } amrex::Print() << Utils::TextMsg::Info( "Setting up collisions for " + m_species_names[0] + " with:\n" + " total non-ionization collision probability: " + std::to_string(m_total_collision_prob) + "\n total ionization collision probability: " + std::to_string(m_total_collision_prob_ioniz) ); init_flag = true; } // Loop over refinement levels auto const flvl = species1.finestLevel(); for (int lev = 0; lev <= flvl; ++lev) { auto cost = WarpX::getCosts(lev); // firstly loop over particles box by box and do all particle conserving // scattering #ifdef _OPENMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif for (WarpXParIter pti(species1, lev); pti.isValid(); ++pti) { if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { amrex::Gpu::synchronize(); } amrex::Real wt = amrex::second(); doBackgroundCollisionsWithinTile(pti, cur_time); if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { amrex::Gpu::synchronize(); wt = amrex::second() - wt; amrex::HostDevice::Atomic::Add( &(*cost)[pti.index()], wt); } } // secondly perform ionization through the SmartCopyFactory if needed if (ionization_flag) { doBackgroundIonization(lev, cost, species1, species2, cur_time); } } } void BackgroundMCCCollision::doBackgroundCollisionsWithinTile ( WarpXParIter& pti, amrex::Real t ) { using namespace amrex::literals; // So that CUDA code gets its intrinsic, not the host-only C++ library version using std::sqrt; // get particle count const long np = pti.numParticles(); // get parsers for the background density and temperature auto n_a_func = m_background_density_func; auto T_a_func = m_background_temperature_func; // get collision parameters auto scattering_processes = m_scattering_processes_exe.data(); int const process_count = m_scattering_processes_exe.size(); auto const total_collision_prob = m_total_collision_prob; auto const nu_max = m_nu_max; // store projectile and target masses auto const m = m_mass1; auto const M = m_background_mass; // precalculate often used value constexpr auto c2 = PhysConst::c * PhysConst::c; auto const mc2 = m*c2; // we need particle positions in order to calculate the local density // and temperature auto GetPosition = GetParticlePosition(pti); // get Struct-Of-Array particle data, also called attribs auto& attribs = pti.GetAttribs(); amrex::ParticleReal* const AMREX_RESTRICT ux = attribs[PIdx::ux].dataPtr(); amrex::ParticleReal* const AMREX_RESTRICT uy = attribs[PIdx::uy].dataPtr(); amrex::ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr(); amrex::ParallelForRNG(np, [=] AMREX_GPU_HOST_DEVICE (long ip, amrex::RandomEngine const& engine) { // determine if this particle should collide if (amrex::Random(engine) > total_collision_prob) return; amrex::ParticleReal x, y, z; GetPosition.AsStored(ip, x, y, z); amrex::Real n_a = n_a_func(x, y, z, t); amrex::Real T_a = T_a_func(x, y, z, t); amrex::Real v_coll, v_coll2, sigma_E, nu_i = 0; double gamma, E_coll; amrex::ParticleReal ua_x, ua_y, ua_z, vx, vy, vz; amrex::ParticleReal uCOM_x, uCOM_y, uCOM_z; amrex::Real col_select = amrex::Random(engine); // get velocities of gas particles from a Maxwellian distribution auto const vel_std = sqrt(PhysConst::kb * T_a / M); ua_x = vel_std * amrex::RandomNormal(0_rt, 1.0_rt, engine); ua_y = vel_std * amrex::RandomNormal(0_rt, 1.0_rt, engine); ua_z = vel_std * amrex::RandomNormal(0_rt, 1.0_rt, engine); // we assume the target particle is not relativistic (in // the lab frame) and therefore we can transform the projectile // velocity to a frame in which the target is stationary with // a simple Galilean boost // not doing the full Lorentz boost here saves us computation // since most particles will not actually collide vx = ux[ip] - ua_x; vy = uy[ip] - ua_y; vz = uz[ip] - ua_z; v_coll2 = (vx*vx + vy*vy + vz*vz); v_coll = sqrt(v_coll2); // calculate the collision energy in eV ParticleUtils::getCollisionEnergy(v_coll2, m, M, gamma, E_coll); // loop through all collision pathways for (int i = 0; i < process_count; i++) { auto const& scattering_process = *(scattering_processes + i); // get collision cross-section sigma_E = scattering_process.getCrossSection(E_coll); // calculate normalized collision frequency nu_i += n_a * sigma_E * v_coll / nu_max; // check if this collision should be performed if (col_select > nu_i) continue; // charge exchange is implemented as a simple swap of the projectile // and target velocities which doesn't require any of the Lorentz // transformations below; note that if the projectile and target // have the same mass this is identical to back scattering if (scattering_process.m_type == MCCProcessType::CHARGE_EXCHANGE) { ux[ip] = ua_x; uy[ip] = ua_y; uz[ip] = ua_z; break; } // At this point the given particle has been chosen for a collision // and so we perform the needed calculations to transform to the // COM frame. uCOM_x = m * vx / (gamma * m + M); uCOM_y = m * vy / (gamma * m + M); uCOM_z = m * vz / (gamma * m + M); // subtract any energy penalty of the collision from the // projectile energy if (scattering_process.m_energy_penalty > 0.0_rt) { ParticleUtils::getEnergy(v_coll2, m, E_coll); E_coll = (E_coll - scattering_process.m_energy_penalty) * PhysConst::q_e; auto scale_fac = sqrt(E_coll * (E_coll + 2.0_prt*mc2) / c2) / m / v_coll; vx *= scale_fac; vy *= scale_fac; vz *= scale_fac; } // transform to COM frame ParticleUtils::doLorentzTransform(vx, vy, vz, uCOM_x, uCOM_y, uCOM_z); if ((scattering_process.m_type == MCCProcessType::ELASTIC) || (scattering_process.m_type == MCCProcessType::EXCITATION)) { ParticleUtils::RandomizeVelocity( vx, vy, vz, sqrt(vx*vx + vy*vy + vz*vz), engine ); } else if (scattering_process.m_type == MCCProcessType::BACK) { // elastic scattering with cos(chi) = -1 (i.e. 180 degrees) vx *= -1.0_prt; vy *= -1.0_prt; vz *= -1.0_prt; } // transform back to scattering frame ParticleUtils::doLorentzTransform(vx, vy, vz, -uCOM_x, -uCOM_y, -uCOM_z); // update particle velocity with new components in labframe ux[ip] = vx + ua_x; uy[ip] = vy + ua_y; uz[ip] = vz + ua_z; break; } } ); } void BackgroundMCCCollision::doBackgroundIonization ( int lev, amrex::LayoutData<amrex::Real>* cost, WarpXParticleContainer& species1, WarpXParticleContainer& species2, amrex::Real t) { WARPX_PROFILE("BackgroundMCCCollision::doBackgroundIonization()"); SmartCopyFactory copy_factory_elec(species1, species1); SmartCopyFactory copy_factory_ion(species1, species2); const auto CopyElec = copy_factory_elec.getSmartCopy(); const auto CopyIon = copy_factory_ion.getSmartCopy(); const auto Filter = ImpactIonizationFilterFunc( m_ionization_processes[0], m_mass1, m_total_collision_prob_ioniz, m_nu_max_ioniz, m_background_density_func, t ); amrex::Real sqrt_kb_m = std::sqrt(PhysConst::kb / m_background_mass); #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif for (WarpXParIter pti(species1, lev); pti.isValid(); ++pti) { if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { amrex::Gpu::synchronize(); } amrex::Real wt = amrex::second(); auto& elec_tile = species1.ParticlesAt(lev, pti); auto& ion_tile = species2.ParticlesAt(lev, pti); const auto np_elec = elec_tile.numParticles(); const auto np_ion = ion_tile.numParticles(); auto Transform = ImpactIonizationTransformFunc( m_ionization_processes[0].getEnergyPenalty(), m_mass1, sqrt_kb_m, m_background_temperature_func, t ); const auto num_added = filterCopyTransformParticles<1>( elec_tile, ion_tile, elec_tile, np_elec, np_ion, Filter, CopyElec, CopyIon, Transform ); setNewParticleIDs(elec_tile, np_elec, num_added); setNewParticleIDs(ion_tile, np_ion, num_added); if (cost && WarpX::load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::Timers) { amrex::Gpu::synchronize(); wt = amrex::second() - wt; amrex::HostDevice::Atomic::Add( &(*cost)[pti.index()], wt); } } }
45.118343
115
0.577093
[ "vector", "transform" ]
f9c4f266d41fe312d52a45941dd6777685eff4d3
1,142
cpp
C++
tests/test043.cpp
rpnx-net/rntcsv
dedb3463602dbefd10fb6e4c24673a304959616c
[ "BSD-3-Clause" ]
null
null
null
tests/test043.cpp
rpnx-net/rntcsv
dedb3463602dbefd10fb6e4c24673a304959616c
[ "BSD-3-Clause" ]
null
null
null
tests/test043.cpp
rpnx-net/rntcsv
dedb3463602dbefd10fb6e4c24673a304959616c
[ "BSD-3-Clause" ]
null
null
null
// test043.cpp - read column and row values as char #include <rntcsv.h> #include "unittest.h" int main() { int rv = 0; std::string csv = "-,A,B,C\n" "1,a,b,c\n" "2,x,y,z\n" ; std::string path = unittest::TempPath(); unittest::WriteFile(path, csv); try { rntcsv::document doc(path, rntcsv::label_parameters(0, 0)); std::vector<char> chars; chars = doc.column<char>(0); unittest::ExpectEqual(size_t, chars.size(), 2); unittest::ExpectEqual(char, chars.at(0), 'a'); unittest::ExpectEqual(char, chars.at(1), 'x'); chars = doc.column<char>("B"); unittest::ExpectEqual(size_t, chars.size(), 2); unittest::ExpectEqual(char, chars.at(0), 'b'); unittest::ExpectEqual(char, chars.at(1), 'y'); chars = doc.row<char>("2"); unittest::ExpectEqual(size_t, chars.size(), 3); unittest::ExpectEqual(char, chars.at(0), 'x'); unittest::ExpectEqual(char, chars.at(1), 'y'); unittest::ExpectEqual(char, chars.at(2), 'z'); } catch (const std::exception& ex) { std::cout << ex.what() << std::endl; rv = 1; } unittest::DeleteFile(path); return rv; }
22.392157
63
0.600701
[ "vector" ]
f9c8b908a9a18f2291f24f68056ee13bd19676f2
917
cpp
C++
LeetCode/Daily-Challenge/Unique Email Addresses.cpp
Sowmik23/All-Codes
212ef0d940fa84624bb2972a257768a830a709a3
[ "MIT" ]
5
2021-02-14T17:48:21.000Z
2022-01-24T14:29:44.000Z
LeetCode/Daily-Challenge/Unique Email Addresses.cpp
Sowmik23/All-Codes
212ef0d940fa84624bb2972a257768a830a709a3
[ "MIT" ]
null
null
null
LeetCode/Daily-Challenge/Unique Email Addresses.cpp
Sowmik23/All-Codes
212ef0d940fa84624bb2972a257768a830a709a3
[ "MIT" ]
null
null
null
class Solution { public: int numUniqueEmails(vector<string>& emails) { // unordered_map<string, int> sameEmails; unordered_set<string> uniqueEmails; for(int i=0;i<emails.size();i++){ string mail = emails[i]; string m = ""; bool flag = false; int j = 0; for(j = 0; ;j++){ if(mail[j]=='+'){ flag = true; continue; } if(mail[j]=='@') break; if(mail[j]!='.' and flag==false) m+=mail[j]; } string domain = mail.substr(j+1, mail.size()-j-1); cout<<m<<" "<<domain<<endl; uniqueEmails.insert(m+"@"+domain); // sameEmails[m+"@"+domain]++; } return uniqueEmails.size(); } };
26.970588
62
0.391494
[ "vector" ]
f9c94d51c677abc3b404d427c2219b8910a4f1a3
2,288
hpp
C++
external_libs/link/examples/linkaudio/AudioEngine.hpp
llloret/sp_link
b87ee622517fc68845b8f1d19c735c0e3bd05176
[ "MIT" ]
null
null
null
external_libs/link/examples/linkaudio/AudioEngine.hpp
llloret/sp_link
b87ee622517fc68845b8f1d19c735c0e3bd05176
[ "MIT" ]
null
null
null
external_libs/link/examples/linkaudio/AudioEngine.hpp
llloret/sp_link
b87ee622517fc68845b8f1d19c735c0e3bd05176
[ "MIT" ]
1
2021-02-22T11:37:41.000Z
2021-02-22T11:37:41.000Z
/* Copyright 2016, Ableton AG, Berlin. All rights reserved. * * 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/>. * * If you would like to incorporate Link into a proprietary software application, * please contact <link-devs@ableton.com>. */ #pragma once // Make sure to define this before <cmath> is included for Windows #define _USE_MATH_DEFINES #include <ableton/Link.hpp> #include <atomic> #include <mutex> namespace ableton { namespace linkaudio { class AudioEngine { public: AudioEngine(Link& link); void startPlaying(); void stopPlaying(); bool isPlaying() const; double beatTime() const; void setTempo(double tempo); double quantum() const; void setQuantum(double quantum); bool isStartStopSyncEnabled() const; void setStartStopSyncEnabled(bool enabled); private: struct EngineData { double requestedTempo; bool requestStart; bool requestStop; double quantum; bool startStopSyncOn; }; void setBufferSize(std::size_t size); void setSampleRate(double sampleRate); EngineData pullEngineData(); void renderMetronomeIntoBuffer(Link::SessionState sessionState, double quantum, std::chrono::microseconds beginHostTime, std::size_t numSamples); void audioCallback(const std::chrono::microseconds hostTime, std::size_t numSamples); Link& mLink; double mSampleRate; std::atomic<std::chrono::microseconds> mOutputLatency; std::vector<double> mBuffer; EngineData mSharedEngineData; EngineData mLockfreeEngineData; std::chrono::microseconds mTimeAtLastClick; bool mIsPlaying; std::mutex mEngineDataGuard; friend class AudioPlatform; }; } // namespace linkaudio } // namespace ableton
27.902439
87
0.745192
[ "vector" ]
f9d769a18f73548b88bba19ae579fa9a11658648
1,979
cpp
C++
2020/Dec/3-dec/min_subarray.cpp
pdet/cqc
14d096274d4d3670ba28f3279102fb817ae795be
[ "MIT" ]
2
2020-11-27T12:31:08.000Z
2021-02-01T07:01:14.000Z
2020/Dec/3-dec/min_subarray.cpp
pdet/cqc
14d096274d4d3670ba28f3279102fb817ae795be
[ "MIT" ]
null
null
null
2020/Dec/3-dec/min_subarray.cpp
pdet/cqc
14d096274d4d3670ba28f3279102fb817ae795be
[ "MIT" ]
1
2020-11-27T19:16:15.000Z
2020-11-27T19:16:15.000Z
#include <iostream> #include <vector> #include <algorithm> #include <unordered_map> #include <numeric> using namespace std; // prefix_sum % p equals to r = sum(arr) % p // int minSubarray(vector<int>& nums, int p) { long sum{0}; auto r = std::accumulate(nums.begin(), nums.end(), 0) % p; if (r == 0) return 0; int ans = nums.size(); std::unordered_map<long, int> map; for (int i = 0; i < nums.size(); i++) { sum = (sum + nums[i]) % p; auto res = map.find((sum + p - r) % p); if (res != map.end()) { ans = std::min(i - res->second, ans); } map[sum] = i; } if (ans == nums.size()) return -1; return ans; } void test() { { vector<int> nums = {3,1,4,2}; int p = 6; int answer = 1; int output = minSubarray(nums, p); if (output != answer) { cout << "Wrong output for test 1. Expected " << answer << ", got " << output << endl; } } { vector<int> nums = {6,3,5,2}; int p = 9; int answer = 2; int output = minSubarray(nums, p); if (output != answer) { cout << "Wrong output for test 2. Expected " << answer << ", got " << output << endl; } } { vector<int> nums = {1,2,3}; int p = 3; int answer = 0; int output = minSubarray(nums, p); if (output != answer) { cout << "Wrong output for test 3. Expected " << answer << ", got " << output << endl; } } { vector<int> nums = {1,2,3}; int p = 7; int answer = -1; int output = minSubarray(nums, p); if (output != answer) { cout << "Wrong output for test 4. Expected " << answer << ", got " << output << endl; } } { vector<int> nums = {1000000000,1000000000,1000000000}; // vector<int> nums = {1,1,1}; int p = 3; int answer = 0; int output = minSubarray(nums, p); if (output != answer) { cout << "Wrong output for test 5. Expected " << answer << ", got " << output << endl; } } } int main() { test(); }
21.51087
91
0.52097
[ "vector" ]
f9e0be9422692c99a44bd6c46716de634687f3d9
33,146
cpp
C++
export/windows/obj/src/lime/_internal/unifill/_Utf8/Utf8_Impl_.cpp
seanbashaw/frozenlight
47c540d30d63e946ea2dc787b4bb602cc9347d21
[ "MIT" ]
null
null
null
export/windows/obj/src/lime/_internal/unifill/_Utf8/Utf8_Impl_.cpp
seanbashaw/frozenlight
47c540d30d63e946ea2dc787b4bb602cc9347d21
[ "MIT" ]
null
null
null
export/windows/obj/src/lime/_internal/unifill/_Utf8/Utf8_Impl_.cpp
seanbashaw/frozenlight
47c540d30d63e946ea2dc787b4bb602cc9347d21
[ "MIT" ]
null
null
null
// Generated by Haxe 3.4.7 #include <hxcpp.h> #ifndef INCLUDED_haxe_io_Bytes #include <haxe/io/Bytes.h> #endif #ifndef INCLUDED_haxe_io_BytesBuffer #include <haxe/io/BytesBuffer.h> #endif #ifndef INCLUDED_lime__internal_unifill_Exception #include <lime/_internal/unifill/Exception.h> #endif #ifndef INCLUDED_lime__internal_unifill_InvalidCodePoint #include <lime/_internal/unifill/InvalidCodePoint.h> #endif #ifndef INCLUDED_lime__internal_unifill__Utf8_Utf8Impl #include <lime/_internal/unifill/_Utf8/Utf8Impl.h> #endif #ifndef INCLUDED_lime__internal_unifill__Utf8_Utf8_Impl_ #include <lime/_internal/unifill/_Utf8/Utf8_Impl_.h> #endif HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_11_fromCodePoint,"lime._internal.unifill._Utf8.Utf8_Impl_","fromCodePoint",0xf5d65640,"lime._internal.unifill._Utf8.Utf8_Impl_.fromCodePoint","lime/_internal/unifill/Utf8.hx",11,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_20_fromCodePoints,"lime._internal.unifill._Utf8.Utf8_Impl_","fromCodePoints",0x25b52233,"lime._internal.unifill._Utf8.Utf8_Impl_.fromCodePoints","lime/_internal/unifill/Utf8.hx",20,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_29_fromString,"lime._internal.unifill._Utf8.Utf8_Impl_","fromString",0xe394f654,"lime._internal.unifill._Utf8.Utf8_Impl_.fromString","lime/_internal/unifill/Utf8.hx",29,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_33_fromBytes,"lime._internal.unifill._Utf8.Utf8_Impl_","fromBytes",0xb4349c48,"lime._internal.unifill._Utf8.Utf8_Impl_.fromBytes","lime/_internal/unifill/Utf8.hx",33,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_37_encodeWith,"lime._internal.unifill._Utf8.Utf8_Impl_","encodeWith",0x93881fb5,"lime._internal.unifill._Utf8.Utf8_Impl_.encodeWith","lime/_internal/unifill/Utf8.hx",37,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_46_codeUnitAt,"lime._internal.unifill._Utf8.Utf8_Impl_","codeUnitAt",0xba6f3a1d,"lime._internal.unifill._Utf8.Utf8_Impl_.codeUnitAt","lime/_internal/unifill/Utf8.hx",46,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_54_codePointAt,"lime._internal.unifill._Utf8.Utf8_Impl_","codePointAt",0xf982e91d,"lime._internal.unifill._Utf8.Utf8_Impl_.codePointAt","lime/_internal/unifill/Utf8.hx",54,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_62_charAt,"lime._internal.unifill._Utf8.Utf8_Impl_","charAt",0xc8185162,"lime._internal.unifill._Utf8.Utf8_Impl_.charAt","lime/_internal/unifill/Utf8.hx",62,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_69_codePointCount,"lime._internal.unifill._Utf8.Utf8_Impl_","codePointCount",0x9d7826e5,"lime._internal.unifill._Utf8.Utf8_Impl_.codePointCount","lime/_internal/unifill/Utf8.hx",69,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_83_codePointWidthAt,"lime._internal.unifill._Utf8.Utf8_Impl_","codePointWidthAt",0x1ca3102f,"lime._internal.unifill._Utf8.Utf8_Impl_.codePointWidthAt","lime/_internal/unifill/Utf8.hx",83,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_93_codePointWidthBefore,"lime._internal.unifill._Utf8.Utf8_Impl_","codePointWidthBefore",0x2a595dbb,"lime._internal.unifill._Utf8.Utf8_Impl_.codePointWidthBefore","lime/_internal/unifill/Utf8.hx",93,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_101_offsetByCodePoints,"lime._internal.unifill._Utf8.Utf8_Impl_","offsetByCodePoints",0x69a56193,"lime._internal.unifill._Utf8.Utf8_Impl_.offsetByCodePoints","lime/_internal/unifill/Utf8.hx",101,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_112_substr,"lime._internal.unifill._Utf8.Utf8_Impl_","substr",0xaaadc72a,"lime._internal.unifill._Utf8.Utf8_Impl_.substr","lime/_internal/unifill/Utf8.hx",112,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_123_validate,"lime._internal.unifill._Utf8.Utf8_Impl_","validate",0xa5e758cf,"lime._internal.unifill._Utf8.Utf8_Impl_.validate","lime/_internal/unifill/Utf8.hx",123,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_121_validate,"lime._internal.unifill._Utf8.Utf8_Impl_","validate",0xa5e758cf,"lime._internal.unifill._Utf8.Utf8_Impl_.validate","lime/_internal/unifill/Utf8.hx",121,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_132_toString,"lime._internal.unifill._Utf8.Utf8_Impl_","toString",0xd97258e5,"lime._internal.unifill._Utf8.Utf8_Impl_.toString","lime/_internal/unifill/Utf8.hx",132,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_136_toBytes,"lime._internal.unifill._Utf8.Utf8_Impl_","toBytes",0x07f676d7,"lime._internal.unifill._Utf8.Utf8_Impl_.toBytes","lime/_internal/unifill/Utf8.hx",136,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_139__new,"lime._internal.unifill._Utf8.Utf8_Impl_","_new",0x21d9cd1a,"lime._internal.unifill._Utf8.Utf8_Impl_._new","lime/_internal/unifill/Utf8.hx",139,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_144_get_length,"lime._internal.unifill._Utf8.Utf8_Impl_","get_length",0x1eafcd28,"lime._internal.unifill._Utf8.Utf8_Impl_.get_length","lime/_internal/unifill/Utf8.hx",144,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_147_forward_offset_by_code_points,"lime._internal.unifill._Utf8.Utf8_Impl_","forward_offset_by_code_points",0x635b78e6,"lime._internal.unifill._Utf8.Utf8_Impl_.forward_offset_by_code_points","lime/_internal/unifill/Utf8.hx",147,0x18196bc4) HX_LOCAL_STACK_FRAME(_hx_pos_c51f253b6aef78e6_157_backward_offset_by_code_points,"lime._internal.unifill._Utf8.Utf8_Impl_","backward_offset_by_code_points",0x3a92ad56,"lime._internal.unifill._Utf8.Utf8_Impl_.backward_offset_by_code_points","lime/_internal/unifill/Utf8.hx",157,0x18196bc4) namespace lime{ namespace _internal{ namespace unifill{ namespace _Utf8{ void Utf8_Impl__obj::__construct() { } Dynamic Utf8_Impl__obj::__CreateEmpty() { return new Utf8_Impl__obj; } void *Utf8_Impl__obj::_hx_vtable = 0; Dynamic Utf8_Impl__obj::__Create(hx::DynamicArray inArgs) { hx::ObjectPtr< Utf8_Impl__obj > _hx_result = new Utf8_Impl__obj(); _hx_result->__construct(); return _hx_result; } bool Utf8_Impl__obj::_hx_isInstanceOf(int inClassId) { return inClassId==(int)0x00000001 || inClassId==(int)0x1bad0d75; } ::String Utf8_Impl__obj::fromCodePoint(int codePoint){ HX_GC_STACKFRAME(&_hx_pos_c51f253b6aef78e6_11_fromCodePoint) HXLINE( 12) ::haxe::io::BytesBuffer buf = ::haxe::io::BytesBuffer_obj::__alloc( HX_CTX ); HXLINE( 13) if ((codePoint <= (int)127)) { HXLINE( 13) buf->b->push(codePoint); } else { HXLINE( 13) if ((codePoint <= (int)2047)) { HXLINE( 13) ::Array< unsigned char > buf1 = buf->b; HXDLIN( 13) buf1->push(((int)(int)192 | (int)((int)codePoint >> (int)(int)6))); HXDLIN( 13) ::Array< unsigned char > buf2 = buf->b; HXDLIN( 13) buf2->push(((int)(int)128 | (int)((int)codePoint & (int)(int)63))); } else { HXLINE( 13) if ((codePoint <= (int)65535)) { HXLINE( 13) ::Array< unsigned char > buf3 = buf->b; HXDLIN( 13) buf3->push(((int)(int)224 | (int)((int)codePoint >> (int)(int)12))); HXDLIN( 13) ::Array< unsigned char > buf4 = buf->b; HXDLIN( 13) buf4->push(((int)(int)128 | (int)((int)((int)codePoint >> (int)(int)6) & (int)(int)63))); HXDLIN( 13) ::Array< unsigned char > buf5 = buf->b; HXDLIN( 13) buf5->push(((int)(int)128 | (int)((int)codePoint & (int)(int)63))); } else { HXLINE( 13) if ((codePoint <= (int)1114111)) { HXLINE( 13) ::Array< unsigned char > buf6 = buf->b; HXDLIN( 13) buf6->push(((int)(int)240 | (int)((int)codePoint >> (int)(int)18))); HXDLIN( 13) ::Array< unsigned char > buf7 = buf->b; HXDLIN( 13) buf7->push(((int)(int)128 | (int)((int)((int)codePoint >> (int)(int)12) & (int)(int)63))); HXDLIN( 13) ::Array< unsigned char > buf8 = buf->b; HXDLIN( 13) buf8->push(((int)(int)128 | (int)((int)((int)codePoint >> (int)(int)6) & (int)(int)63))); HXDLIN( 13) ::Array< unsigned char > buf9 = buf->b; HXDLIN( 13) buf9->push(((int)(int)128 | (int)((int)codePoint & (int)(int)63))); } else { HXLINE( 13) HX_STACK_DO_THROW( ::lime::_internal::unifill::InvalidCodePoint_obj::__alloc( HX_CTX ,codePoint)); } } } } HXLINE( 14) ::String this1 = buf->getBytes()->toString(); HXDLIN( 14) ::String this2 = this1; HXDLIN( 14) return this2; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,fromCodePoint,return ) ::String Utf8_Impl__obj::fromCodePoints( ::Dynamic codePoints){ HX_GC_STACKFRAME(&_hx_pos_c51f253b6aef78e6_20_fromCodePoints) HXLINE( 21) ::haxe::io::BytesBuffer buf = ::haxe::io::BytesBuffer_obj::__alloc( HX_CTX ); HXLINE( 22) { HXLINE( 22) ::Dynamic c = codePoints->__Field(HX_("iterator",ee,49,9a,93),hx::paccDynamic)(); HXDLIN( 22) while(( (bool)(c->__Field(HX_("hasNext",6d,a5,46,18),hx::paccDynamic)()) )){ HXLINE( 22) int c1 = ( (int)(c->__Field(HX_("next",f3,84,02,49),hx::paccDynamic)()) ); HXLINE( 23) if ((c1 <= (int)127)) { HXLINE( 23) buf->b->push(c1); } else { HXLINE( 23) if ((c1 <= (int)2047)) { HXLINE( 23) ::Array< unsigned char > buf1 = buf->b; HXDLIN( 23) buf1->push(((int)(int)192 | (int)((int)c1 >> (int)(int)6))); HXDLIN( 23) ::Array< unsigned char > buf2 = buf->b; HXDLIN( 23) buf2->push(((int)(int)128 | (int)((int)c1 & (int)(int)63))); } else { HXLINE( 23) if ((c1 <= (int)65535)) { HXLINE( 23) ::Array< unsigned char > buf3 = buf->b; HXDLIN( 23) buf3->push(((int)(int)224 | (int)((int)c1 >> (int)(int)12))); HXDLIN( 23) ::Array< unsigned char > buf4 = buf->b; HXDLIN( 23) buf4->push(((int)(int)128 | (int)((int)((int)c1 >> (int)(int)6) & (int)(int)63))); HXDLIN( 23) ::Array< unsigned char > buf5 = buf->b; HXDLIN( 23) buf5->push(((int)(int)128 | (int)((int)c1 & (int)(int)63))); } else { HXLINE( 23) if ((c1 <= (int)1114111)) { HXLINE( 23) ::Array< unsigned char > buf6 = buf->b; HXDLIN( 23) buf6->push(((int)(int)240 | (int)((int)c1 >> (int)(int)18))); HXDLIN( 23) ::Array< unsigned char > buf7 = buf->b; HXDLIN( 23) buf7->push(((int)(int)128 | (int)((int)((int)c1 >> (int)(int)12) & (int)(int)63))); HXDLIN( 23) ::Array< unsigned char > buf8 = buf->b; HXDLIN( 23) buf8->push(((int)(int)128 | (int)((int)((int)c1 >> (int)(int)6) & (int)(int)63))); HXDLIN( 23) ::Array< unsigned char > buf9 = buf->b; HXDLIN( 23) buf9->push(((int)(int)128 | (int)((int)c1 & (int)(int)63))); } else { HXLINE( 23) HX_STACK_DO_THROW( ::lime::_internal::unifill::InvalidCodePoint_obj::__alloc( HX_CTX ,c1)); } } } } } } HXLINE( 25) ::String this1 = buf->getBytes()->toString(); HXDLIN( 25) ::String this2 = this1; HXDLIN( 25) return this2; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,fromCodePoints,return ) ::String Utf8_Impl__obj::fromString(::String s){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_29_fromString) HXDLIN( 29) ::String this1 = s; HXDLIN( 29) ::String this2 = this1; HXDLIN( 29) return this2; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,fromString,return ) ::String Utf8_Impl__obj::fromBytes( ::haxe::io::Bytes b){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_33_fromBytes) HXDLIN( 33) ::String this1 = b->toString(); HXDLIN( 33) ::String this2 = this1; HXDLIN( 33) return this2; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,fromBytes,return ) void Utf8_Impl__obj::encodeWith( ::Dynamic f,int c){ HX_GC_STACKFRAME(&_hx_pos_c51f253b6aef78e6_37_encodeWith) HXDLIN( 37) if ((c <= (int)127)) { HXDLIN( 37) f(c); } else { HXDLIN( 37) if ((c <= (int)2047)) { HXDLIN( 37) f(((int)(int)192 | (int)((int)c >> (int)(int)6))); HXDLIN( 37) f(((int)(int)128 | (int)((int)c & (int)(int)63))); } else { HXDLIN( 37) if ((c <= (int)65535)) { HXDLIN( 37) f(((int)(int)224 | (int)((int)c >> (int)(int)12))); HXDLIN( 37) f(((int)(int)128 | (int)((int)((int)c >> (int)(int)6) & (int)(int)63))); HXDLIN( 37) f(((int)(int)128 | (int)((int)c & (int)(int)63))); } else { HXDLIN( 37) if ((c <= (int)1114111)) { HXDLIN( 37) f(((int)(int)240 | (int)((int)c >> (int)(int)18))); HXDLIN( 37) f(((int)(int)128 | (int)((int)((int)c >> (int)(int)12) & (int)(int)63))); HXDLIN( 37) f(((int)(int)128 | (int)((int)((int)c >> (int)(int)6) & (int)(int)63))); HXDLIN( 37) f(((int)(int)128 | (int)((int)c & (int)(int)63))); } else { HXDLIN( 37) HX_STACK_DO_THROW( ::lime::_internal::unifill::InvalidCodePoint_obj::__alloc( HX_CTX ,c)); } } } } } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,encodeWith,(void)) int Utf8_Impl__obj::codeUnitAt(::String this1,int index){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_46_codeUnitAt) HXDLIN( 46) return this1.cca(index); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,codeUnitAt,return ) int Utf8_Impl__obj::codePointAt(::String this1,int index){ HX_BEGIN_LOCAL_FUNC_S1(hx::LocalFunc,_hx_Closure_0,::String,this1) HXARGC(1) int _hx_run(int i){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_54_codePointAt) HXDLIN( 54) return this1.cca(i); } HX_END_LOCAL_FUNC1(return) HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_54_codePointAt) HXDLIN( 54) return ::lime::_internal::unifill::_Utf8::Utf8Impl_obj::decode_code_point(this1.length, ::Dynamic(new _hx_Closure_0(this1)),index); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,codePointAt,return ) ::String Utf8_Impl__obj::charAt(::String this1,int index){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_62_charAt) HXDLIN( 62) int c = this1.cca(index); HXDLIN( 62) ::Dynamic len; HXDLIN( 62) if ((c < (int)192)) { HXDLIN( 62) len = (int)1; } else { HXDLIN( 62) if ((c < (int)224)) { HXDLIN( 62) len = (int)2; } else { HXDLIN( 62) if ((c < (int)240)) { HXDLIN( 62) len = (int)3; } else { HXDLIN( 62) if ((c < (int)248)) { HXDLIN( 62) len = (int)4; } else { HXDLIN( 62) len = (int)1; } } } } HXDLIN( 62) ::String this2 = this1.substr(index,len); HXDLIN( 62) ::String this3 = this2; HXDLIN( 62) return this3; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,charAt,return ) int Utf8_Impl__obj::codePointCount(::String this1,int beginIndex,int endIndex){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_69_codePointCount) HXLINE( 70) int index = beginIndex; HXLINE( 71) int i = (int)0; HXLINE( 72) while((index < endIndex)){ HXLINE( 73) int c = this1.cca(index); HXDLIN( 73) int index1; HXDLIN( 73) if ((c < (int)192)) { HXLINE( 73) index1 = (int)1; } else { HXLINE( 73) if ((c < (int)224)) { HXLINE( 73) index1 = (int)2; } else { HXLINE( 73) if ((c < (int)240)) { HXLINE( 73) index1 = (int)3; } else { HXLINE( 73) if ((c < (int)248)) { HXLINE( 73) index1 = (int)4; } else { HXLINE( 73) index1 = (int)1; } } } } HXDLIN( 73) index = (index + index1); HXLINE( 74) i = (i + (int)1); } HXLINE( 76) return i; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(Utf8_Impl__obj,codePointCount,return ) int Utf8_Impl__obj::codePointWidthAt(::String this1,int index){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_83_codePointWidthAt) HXLINE( 84) int c = this1.cca(index); HXLINE( 85) if ((c < (int)192)) { HXLINE( 85) return (int)1; } else { HXLINE( 85) if ((c < (int)224)) { HXLINE( 85) return (int)2; } else { HXLINE( 85) if ((c < (int)240)) { HXLINE( 85) return (int)3; } else { HXLINE( 85) if ((c < (int)248)) { HXLINE( 85) return (int)4; } else { HXLINE( 85) return (int)1; } } } } HXDLIN( 85) return (int)0; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,codePointWidthAt,return ) int Utf8_Impl__obj::codePointWidthBefore(::String this1,int index){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_93_codePointWidthBefore) HXDLIN( 93) ::String this2 = this1; HXDLIN( 93) int c1 = this2.cca((index - (int)1)); HXDLIN( 93) bool _hx_tmp; HXDLIN( 93) if ((c1 >= (int)128)) { HXDLIN( 93) _hx_tmp = (c1 >= (int)192); } else { HXDLIN( 93) _hx_tmp = true; } HXDLIN( 93) if (_hx_tmp) { HXDLIN( 93) return (int)1; } else { HXDLIN( 93) ::String this3 = this1; HXDLIN( 93) if ((((int)this3.cca((index - (int)2)) & (int)(int)224) == (int)192)) { HXDLIN( 93) return (int)2; } else { HXDLIN( 93) ::String this4 = this1; HXDLIN( 93) if ((((int)this4.cca((index - (int)3)) & (int)(int)240) == (int)224)) { HXDLIN( 93) return (int)3; } else { HXDLIN( 93) ::String this5 = this1; HXDLIN( 93) if ((((int)this5.cca((index - (int)4)) & (int)(int)248) == (int)240)) { HXDLIN( 93) return (int)4; } else { HXDLIN( 93) return (int)1; } } } } HXDLIN( 93) return (int)0; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(Utf8_Impl__obj,codePointWidthBefore,return ) int Utf8_Impl__obj::offsetByCodePoints(::String this1,int index,int codePointOffset){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_101_offsetByCodePoints) HXDLIN( 101) if ((codePointOffset >= (int)0)) { HXLINE( 102) int index1 = index; HXDLIN( 102) int len = this1.length; HXDLIN( 102) int i = (int)0; HXDLIN( 102) while(true){ HXLINE( 102) bool _hx_tmp; HXDLIN( 102) if ((i < codePointOffset)) { HXLINE( 102) _hx_tmp = (index1 < len); } else { HXLINE( 102) _hx_tmp = false; } HXDLIN( 102) if (!(_hx_tmp)) { HXLINE( 102) goto _hx_goto_14; } HXDLIN( 102) int c = this1.cca(index1); HXDLIN( 102) int index2; HXDLIN( 102) if ((c < (int)192)) { HXLINE( 102) index2 = (int)1; } else { HXLINE( 102) if ((c < (int)224)) { HXLINE( 102) index2 = (int)2; } else { HXLINE( 102) if ((c < (int)240)) { HXLINE( 102) index2 = (int)3; } else { HXLINE( 102) if ((c < (int)248)) { HXLINE( 102) index2 = (int)4; } else { HXLINE( 102) index2 = (int)1; } } } } HXDLIN( 102) index1 = (index1 + index2); HXDLIN( 102) i = (i + (int)1); } _hx_goto_14:; HXDLIN( 102) return index1; } else { HXLINE( 104) int index3 = index; HXDLIN( 104) int count = (int)0; HXDLIN( 104) while(true){ HXLINE( 104) bool _hx_tmp1; HXDLIN( 104) if ((count < -(codePointOffset))) { HXLINE( 104) _hx_tmp1 = ((int)0 < index3); } else { HXLINE( 104) _hx_tmp1 = false; } HXDLIN( 104) if (!(_hx_tmp1)) { HXLINE( 104) goto _hx_goto_15; } HXDLIN( 104) ::String this2 = this1; HXDLIN( 104) ::String this3 = this2; HXDLIN( 104) int c1 = this3.cca((index3 - (int)1)); HXDLIN( 104) int index4; HXDLIN( 104) bool index5; HXDLIN( 104) if ((c1 >= (int)128)) { HXLINE( 104) index5 = (c1 >= (int)192); } else { HXLINE( 104) index5 = true; } HXDLIN( 104) if (index5) { HXLINE( 104) index4 = (int)1; } else { HXLINE( 104) ::String this4 = this2; HXDLIN( 104) if ((((int)this4.cca((index3 - (int)2)) & (int)(int)224) == (int)192)) { HXLINE( 104) index4 = (int)2; } else { HXLINE( 104) ::String this5 = this2; HXDLIN( 104) if ((((int)this5.cca((index3 - (int)3)) & (int)(int)240) == (int)224)) { HXLINE( 104) index4 = (int)3; } else { HXLINE( 104) ::String this6 = this2; HXDLIN( 104) if ((((int)this6.cca((index3 - (int)4)) & (int)(int)248) == (int)240)) { HXLINE( 104) index4 = (int)4; } else { HXLINE( 104) index4 = (int)1; } } } } HXDLIN( 104) index3 = (index3 - index4); HXDLIN( 104) count = (count + (int)1); } _hx_goto_15:; HXDLIN( 104) return index3; } HXLINE( 101) return (int)0; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(Utf8_Impl__obj,offsetByCodePoints,return ) ::String Utf8_Impl__obj::substr(::String this1,int index, ::Dynamic len){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_112_substr) HXDLIN( 112) ::String this2 = this1.substr(index,len); HXDLIN( 112) ::String this3 = this2; HXDLIN( 112) return this3; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(Utf8_Impl__obj,substr,return ) void Utf8_Impl__obj::validate(::String this1){ HX_BEGIN_LOCAL_FUNC_S1(hx::LocalFunc,_hx_Closure_0,::String,this1) HXARGC(1) int _hx_run(int i){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_123_validate) HXLINE( 123) return this1.cca(i); } HX_END_LOCAL_FUNC1(return) HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_121_validate) HXLINE( 122) int len = this1.length; HXLINE( 123) ::Dynamic accessor = ::Dynamic(new _hx_Closure_0(this1)); HXLINE( 124) int i1 = (int)0; HXLINE( 125) while((i1 < len)){ HXLINE( 126) ::lime::_internal::unifill::_Utf8::Utf8Impl_obj::decode_code_point(len,accessor,i1); HXLINE( 127) int c = this1.cca(i1); HXDLIN( 127) int i2; HXDLIN( 127) if ((c < (int)192)) { HXLINE( 127) i2 = (int)1; } else { HXLINE( 127) if ((c < (int)224)) { HXLINE( 127) i2 = (int)2; } else { HXLINE( 127) if ((c < (int)240)) { HXLINE( 127) i2 = (int)3; } else { HXLINE( 127) if ((c < (int)248)) { HXLINE( 127) i2 = (int)4; } else { HXLINE( 127) i2 = (int)1; } } } } HXDLIN( 127) i1 = (i1 + i2); } } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,validate,(void)) ::String Utf8_Impl__obj::toString(::String this1){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_132_toString) HXDLIN( 132) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,toString,return ) ::haxe::io::Bytes Utf8_Impl__obj::toBytes(::String this1){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_136_toBytes) HXDLIN( 136) return ::haxe::io::Bytes_obj::ofString(this1); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,toBytes,return ) ::String Utf8_Impl__obj::_new(::String s){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_139__new) HXDLIN( 139) ::String this1 = s; HXDLIN( 139) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,_new,return ) int Utf8_Impl__obj::get_length(::String this1){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_144_get_length) HXDLIN( 144) return this1.length; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(Utf8_Impl__obj,get_length,return ) int Utf8_Impl__obj::forward_offset_by_code_points(::String this1,int index,int codePointOffset){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_147_forward_offset_by_code_points) HXLINE( 148) int len = this1.length; HXLINE( 149) int i = (int)0; HXLINE( 150) while(true){ HXLINE( 150) bool _hx_tmp; HXDLIN( 150) if ((i < codePointOffset)) { HXLINE( 150) _hx_tmp = (index < len); } else { HXLINE( 150) _hx_tmp = false; } HXDLIN( 150) if (!(_hx_tmp)) { HXLINE( 150) goto _hx_goto_25; } HXLINE( 151) int c = this1.cca(index); HXDLIN( 151) int index1; HXDLIN( 151) if ((c < (int)192)) { HXLINE( 151) index1 = (int)1; } else { HXLINE( 151) if ((c < (int)224)) { HXLINE( 151) index1 = (int)2; } else { HXLINE( 151) if ((c < (int)240)) { HXLINE( 151) index1 = (int)3; } else { HXLINE( 151) if ((c < (int)248)) { HXLINE( 151) index1 = (int)4; } else { HXLINE( 151) index1 = (int)1; } } } } HXDLIN( 151) index = (index + index1); HXLINE( 152) i = (i + (int)1); } _hx_goto_25:; HXLINE( 154) return index; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(Utf8_Impl__obj,forward_offset_by_code_points,return ) int Utf8_Impl__obj::backward_offset_by_code_points(::String this1,int index,int codePointOffset){ HX_STACKFRAME(&_hx_pos_c51f253b6aef78e6_157_backward_offset_by_code_points) HXLINE( 158) int count = (int)0; HXLINE( 159) while(true){ HXLINE( 159) bool _hx_tmp; HXDLIN( 159) if ((count < codePointOffset)) { HXLINE( 159) _hx_tmp = ((int)0 < index); } else { HXLINE( 159) _hx_tmp = false; } HXDLIN( 159) if (!(_hx_tmp)) { HXLINE( 159) goto _hx_goto_27; } HXLINE( 160) ::String this2 = this1; HXDLIN( 160) ::String this3 = this2; HXDLIN( 160) int c1 = this3.cca((index - (int)1)); HXDLIN( 160) int index1; HXDLIN( 160) bool index2; HXDLIN( 160) if ((c1 >= (int)128)) { HXLINE( 160) index2 = (c1 >= (int)192); } else { HXLINE( 160) index2 = true; } HXDLIN( 160) if (index2) { HXLINE( 160) index1 = (int)1; } else { HXLINE( 160) ::String this4 = this2; HXDLIN( 160) if ((((int)this4.cca((index - (int)2)) & (int)(int)224) == (int)192)) { HXLINE( 160) index1 = (int)2; } else { HXLINE( 160) ::String this5 = this2; HXDLIN( 160) if ((((int)this5.cca((index - (int)3)) & (int)(int)240) == (int)224)) { HXLINE( 160) index1 = (int)3; } else { HXLINE( 160) ::String this6 = this2; HXDLIN( 160) if ((((int)this6.cca((index - (int)4)) & (int)(int)248) == (int)240)) { HXLINE( 160) index1 = (int)4; } else { HXLINE( 160) index1 = (int)1; } } } } HXDLIN( 160) index = (index - index1); HXLINE( 161) count = (count + (int)1); } _hx_goto_27:; HXLINE( 163) return index; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(Utf8_Impl__obj,backward_offset_by_code_points,return ) Utf8_Impl__obj::Utf8_Impl__obj() { } bool Utf8_Impl__obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp) { switch(inName.length) { case 4: if (HX_FIELD_EQ(inName,"_new") ) { outValue = _new_dyn(); return true; } break; case 6: if (HX_FIELD_EQ(inName,"charAt") ) { outValue = charAt_dyn(); return true; } if (HX_FIELD_EQ(inName,"substr") ) { outValue = substr_dyn(); return true; } break; case 7: if (HX_FIELD_EQ(inName,"toBytes") ) { outValue = toBytes_dyn(); return true; } break; case 8: if (HX_FIELD_EQ(inName,"validate") ) { outValue = validate_dyn(); return true; } if (HX_FIELD_EQ(inName,"toString") ) { outValue = toString_dyn(); return true; } break; case 9: if (HX_FIELD_EQ(inName,"fromBytes") ) { outValue = fromBytes_dyn(); return true; } break; case 10: if (HX_FIELD_EQ(inName,"fromString") ) { outValue = fromString_dyn(); return true; } if (HX_FIELD_EQ(inName,"encodeWith") ) { outValue = encodeWith_dyn(); return true; } if (HX_FIELD_EQ(inName,"codeUnitAt") ) { outValue = codeUnitAt_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_length") ) { outValue = get_length_dyn(); return true; } break; case 11: if (HX_FIELD_EQ(inName,"codePointAt") ) { outValue = codePointAt_dyn(); return true; } break; case 13: if (HX_FIELD_EQ(inName,"fromCodePoint") ) { outValue = fromCodePoint_dyn(); return true; } break; case 14: if (HX_FIELD_EQ(inName,"fromCodePoints") ) { outValue = fromCodePoints_dyn(); return true; } if (HX_FIELD_EQ(inName,"codePointCount") ) { outValue = codePointCount_dyn(); return true; } break; case 16: if (HX_FIELD_EQ(inName,"codePointWidthAt") ) { outValue = codePointWidthAt_dyn(); return true; } break; case 18: if (HX_FIELD_EQ(inName,"offsetByCodePoints") ) { outValue = offsetByCodePoints_dyn(); return true; } break; case 20: if (HX_FIELD_EQ(inName,"codePointWidthBefore") ) { outValue = codePointWidthBefore_dyn(); return true; } break; case 29: if (HX_FIELD_EQ(inName,"forward_offset_by_code_points") ) { outValue = forward_offset_by_code_points_dyn(); return true; } break; case 30: if (HX_FIELD_EQ(inName,"backward_offset_by_code_points") ) { outValue = backward_offset_by_code_points_dyn(); return true; } } return false; } #if HXCPP_SCRIPTABLE static hx::StorageInfo *Utf8_Impl__obj_sMemberStorageInfo = 0; static hx::StaticInfo *Utf8_Impl__obj_sStaticStorageInfo = 0; #endif static void Utf8_Impl__obj_sMarkStatics(HX_MARK_PARAMS) { HX_MARK_MEMBER_NAME(Utf8_Impl__obj::__mClass,"__mClass"); }; #ifdef HXCPP_VISIT_ALLOCS static void Utf8_Impl__obj_sVisitStatics(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(Utf8_Impl__obj::__mClass,"__mClass"); }; #endif hx::Class Utf8_Impl__obj::__mClass; static ::String Utf8_Impl__obj_sStaticFields[] = { HX_HCSTRING("fromCodePoint","\x19","\x4d","\x4f","\xce"), HX_HCSTRING("fromCodePoints","\x3a","\x29","\x14","\xb7"), HX_HCSTRING("fromString","\xdb","\x2d","\x74","\x54"), HX_HCSTRING("fromBytes","\xa1","\xf2","\x20","\x72"), HX_HCSTRING("encodeWith","\x3c","\x57","\x67","\x04"), HX_HCSTRING("codeUnitAt","\xa4","\x71","\x4e","\x2b"), HX_HCSTRING("codePointAt","\xb6","\x47","\xf4","\x4b"), HX_HCSTRING("charAt","\x69","\x79","\x75","\xb7"), HX_HCSTRING("codePointCount","\xec","\x2d","\xd7","\x2e"), HX_HCSTRING("codePointWidthAt","\xf6","\x26","\x17","\x09"), HX_HCSTRING("codePointWidthBefore","\x02","\xe4","\x4d","\xc6"), HX_HCSTRING("offsetByCodePoints","\x1a","\xf8","\x61","\x6c"), HX_HCSTRING("substr","\x31","\xef","\x0a","\x9a"), HX_HCSTRING("validate","\x96","\xd0","\xe3","\x04"), HX_HCSTRING("toString","\xac","\xd0","\x6e","\x38"), HX_HCSTRING("toBytes","\xf0","\x54","\x1c","\x8a"), HX_HCSTRING("_new","\x61","\x15","\x1f","\x3f"), HX_HCSTRING("get_length","\xaf","\x04","\x8f","\x8f"), HX_HCSTRING("forward_offset_by_code_points","\xbf","\x71","\x4d","\xf8"), HX_HCSTRING("backward_offset_by_code_points","\x5d","\x72","\x5a","\xf9"), ::String(null()) }; void Utf8_Impl__obj::__register() { hx::Object *dummy = new Utf8_Impl__obj; Utf8_Impl__obj::_hx_vtable = *(void **)dummy; hx::Static(__mClass) = new hx::Class_obj(); __mClass->mName = HX_HCSTRING("lime._internal.unifill._Utf8.Utf8_Impl_","\x55","\xc3","\xa6","\x33"); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &Utf8_Impl__obj::__GetStatic; __mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField; __mClass->mMarkFunc = Utf8_Impl__obj_sMarkStatics; __mClass->mStatics = hx::Class_obj::dupFunctions(Utf8_Impl__obj_sStaticFields); __mClass->mMembers = hx::Class_obj::dupFunctions(0 /* sMemberFields */); __mClass->mCanCast = hx::TCanCast< Utf8_Impl__obj >; #ifdef HXCPP_VISIT_ALLOCS __mClass->mVisitFunc = Utf8_Impl__obj_sVisitStatics; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = Utf8_Impl__obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = Utf8_Impl__obj_sStaticStorageInfo; #endif hx::_hx_RegisterClass(__mClass->mName, __mClass); } } // end namespace lime } // end namespace _internal } // end namespace unifill } // end namespace _Utf8
40.570379
288
0.615549
[ "object" ]