hexsha stringlengths 40 40 | size int64 7 1.05M | ext stringclasses 13 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 269 | max_stars_repo_name stringlengths 5 108 | 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 4 269 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 9 | max_issues_count float64 1 77k ⌀ | 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 4 269 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 7 1.05M | avg_line_length float64 1.21 653k | max_line_length int64 6 990k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1000a752a3d78a5e8e0d8768c934aef709d301b2 | 7,329 | cc | C++ | zircon/kernel/object/buffer_chain_tests.cc | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | 1 | 2020-12-29T17:07:06.000Z | 2020-12-29T17:07:06.000Z | zircon/kernel/object/buffer_chain_tests.cc | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | null | null | null | zircon/kernel/object/buffer_chain_tests.cc | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | null | null | null | // Copyright 2018 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
#include <lib/unittest/unittest.h>
#include <lib/unittest/user_memory.h>
#include <lib/user_copy/user_ptr.h>
#include <stdio.h>
#include <fbl/auto_call.h>
#include "object/buffer_chain.h"
namespace {
using testing::UserMemory;
static bool alloc_free_basic() {
BEGIN_TEST;
// An empty chain requires one buffer
BufferChain* bc = BufferChain::Alloc(0);
ASSERT_NE(bc, nullptr);
ASSERT_FALSE(bc->buffers()->is_empty());
ASSERT_EQ(bc->buffers()->size_slow(), 1u);
BufferChain::Free(bc);
// One Buffer is enough to hold one byte.
bc = BufferChain::Alloc(1);
ASSERT_FALSE(bc->buffers()->is_empty());
ASSERT_EQ(bc->buffers()->size_slow(), 1u);
ASSERT_NE(bc, nullptr);
BufferChain::Free(bc);
// One Buffer is still enough.
bc = BufferChain::Alloc(BufferChain::kContig);
ASSERT_FALSE(bc->buffers()->is_empty());
ASSERT_EQ(bc->buffers()->size_slow(), 1u);
ASSERT_NE(bc, nullptr);
BufferChain::Free(bc);
// Two pages allocated, only one used for the buffer.
bc = BufferChain::Alloc(BufferChain::kContig + 1);
ASSERT_FALSE(bc->buffers()->is_empty());
ASSERT_EQ(bc->buffers()->size_slow(), 1u);
ASSERT_NE(bc, nullptr);
BufferChain::Free(bc);
// Several pages allocated, only one used for the buffer.
bc = BufferChain::Alloc(10000 * BufferChain::kRawDataSize);
ASSERT_FALSE(bc->buffers()->is_empty());
ASSERT_EQ(bc->buffers()->size_slow(), 1u);
ASSERT_NE(bc, nullptr);
BufferChain::Free(bc);
END_TEST;
}
static bool append_copy_out() {
BEGIN_TEST;
constexpr size_t kOffset = 24;
constexpr size_t kFirstCopy = BufferChain::kContig + 8;
constexpr size_t kSecondCopy = BufferChain::kRawDataSize + 16;
constexpr size_t kSize = kOffset + kFirstCopy + kSecondCopy;
fbl::AllocChecker ac;
auto buf = ktl::unique_ptr<char[]>(new (&ac) char[kSize]);
ASSERT_TRUE(ac.check());
ktl::unique_ptr<UserMemory> mem = UserMemory::Create(kSize);
auto mem_in = mem->user_in<char>();
auto mem_out = mem->user_out<char>();
BufferChain* bc = BufferChain::Alloc(kSize);
ASSERT_NE(nullptr, bc);
auto free_bc = fbl::MakeAutoCall([&bc]() { BufferChain::Free(bc); });
ASSERT_EQ(1u, bc->buffers()->size_slow());
bc->Skip(kOffset);
// Fill the chain with 'A'.
memset(buf.get(), 'A', kFirstCopy);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kFirstCopy));
ASSERT_EQ(ZX_OK, bc->Append(mem_in, kFirstCopy));
// Verify it.
auto iter = bc->buffers()->begin();
for (size_t i = kOffset; i < BufferChain::kContig; ++i) {
ASSERT_EQ('A', iter->data()[i]);
}
++iter;
for (size_t i = 0; i < kOffset + kFirstCopy - BufferChain::kContig; ++i) {
ASSERT_EQ('A', iter->data()[i]);
}
// Write a chunk of 'B' straddling all three buffers.
memset(buf.get(), 'B', kSecondCopy);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kSecondCopy));
ASSERT_EQ(ZX_OK, bc->Append(mem_in, kSecondCopy));
// Verify it.
iter = bc->buffers()->begin();
for (size_t i = kOffset; i < BufferChain::kContig; ++i) {
ASSERT_EQ('A', iter->data()[i]);
}
++iter;
for (size_t i = 0; i < kOffset + kFirstCopy - BufferChain::kContig; ++i) {
ASSERT_EQ('A', iter->data()[i]);
}
for (size_t i = kOffset + kFirstCopy - BufferChain::kContig; i < BufferChain::kRawDataSize; ++i) {
ASSERT_EQ('B', iter->data()[i]);
}
++iter;
for (size_t i = 0;
i < kOffset + kFirstCopy + kSecondCopy - BufferChain::kContig - BufferChain::kRawDataSize;
++i) {
if (iter->data()[i] != 'B') {
ASSERT_EQ(int(i), -1);
}
ASSERT_EQ('B', iter->data()[i]);
}
ASSERT_TRUE(++iter == bc->buffers()->end());
// Copy it all out.
memset(buf.get(), 0, kSize);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kSize));
ASSERT_EQ(ZX_OK, bc->CopyOut(mem_out, 0, kSize));
// Verify it.
memset(buf.get(), 0, kSize);
ASSERT_EQ(ZX_OK, mem_in.copy_array_from_user(buf.get(), kSize));
size_t index = kOffset;
for (size_t i = 0; i < kFirstCopy; ++i) {
ASSERT_EQ('A', buf[index++]);
}
for (size_t i = 0; i < kSecondCopy; ++i) {
ASSERT_EQ('B', buf[index++]);
}
END_TEST;
}
static bool free_unused_pages() {
BEGIN_TEST;
constexpr size_t kSize = 8 * PAGE_SIZE;
constexpr size_t kWriteSize = BufferChain::kContig + 1;
fbl::AllocChecker ac;
auto buf = ktl::unique_ptr<char[]>(new (&ac) char[kWriteSize]);
ASSERT_TRUE(ac.check());
ktl::unique_ptr<UserMemory> mem = UserMemory::Create(kWriteSize);
auto mem_in = mem->user_in<char>();
auto mem_out = mem->user_out<char>();
BufferChain* bc = BufferChain::Alloc(kSize);
ASSERT_NE(nullptr, bc);
auto free_bc = fbl::MakeAutoCall([&bc]() { BufferChain::Free(bc); });
ASSERT_EQ(1u, bc->buffers()->size_slow());
memset(buf.get(), 0, kWriteSize);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kWriteSize));
ASSERT_EQ(ZX_OK, bc->Append(mem_in, kWriteSize));
ASSERT_EQ(2u, bc->buffers()->size_slow());
bc->FreeUnusedBuffers();
ASSERT_EQ(2u, bc->buffers()->size_slow());
END_TEST;
}
static bool append_more_than_allocated() {
BEGIN_TEST;
constexpr size_t kAllocSize = 2 * PAGE_SIZE;
constexpr size_t kWriteSize = 2 * kAllocSize;
fbl::AllocChecker ac;
auto buf = ktl::unique_ptr<char[]>(new (&ac) char[kWriteSize]);
ASSERT_TRUE(ac.check());
ktl::unique_ptr<UserMemory> mem = UserMemory::Create(kWriteSize);
auto mem_in = mem->user_in<char>();
auto mem_out = mem->user_out<char>();
BufferChain* bc = BufferChain::Alloc(kAllocSize);
ASSERT_NE(nullptr, bc);
auto free_bc = fbl::MakeAutoCall([&bc]() { BufferChain::Free(bc); });
ASSERT_EQ(1u, bc->buffers()->size_slow());
memset(buf.get(), 0, kWriteSize);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kWriteSize));
ASSERT_EQ(ZX_ERR_OUT_OF_RANGE, bc->Append(mem_in, kWriteSize));
END_TEST;
}
static bool append_after_fail_fails() {
BEGIN_TEST;
constexpr size_t kAllocSize = 2 * PAGE_SIZE;
constexpr size_t kWriteSize = PAGE_SIZE;
fbl::AllocChecker ac;
auto buf = ktl::unique_ptr<char[]>(new (&ac) char[kWriteSize]);
ASSERT_TRUE(ac.check());
ktl::unique_ptr<UserMemory> mem = UserMemory::Create(kWriteSize);
auto mem_in = mem->user_in<char>();
auto mem_out = mem->user_out<char>();
BufferChain* bc = BufferChain::Alloc(kAllocSize);
ASSERT_NE(nullptr, bc);
auto free_bc = fbl::MakeAutoCall([&bc]() { BufferChain::Free(bc); });
ASSERT_EQ(1u, bc->buffers()->size_slow());
ASSERT_EQ(ZX_ERR_INVALID_ARGS,
bc->Append(make_user_in_ptr(static_cast<const char*>(nullptr)), kWriteSize));
memset(buf.get(), 0, kWriteSize);
ASSERT_EQ(ZX_OK, mem_out.copy_array_to_user(buf.get(), kWriteSize));
ASSERT_EQ(ZX_ERR_OUT_OF_RANGE, bc->Append(mem_in, kWriteSize));
END_TEST;
}
} // namespace
UNITTEST_START_TESTCASE(buffer_chain_tests)
UNITTEST("alloc_free_basic", alloc_free_basic)
UNITTEST("append_copy_out", append_copy_out)
UNITTEST("free_unused_pages", free_unused_pages)
UNITTEST("append_more_than_allocated", append_more_than_allocated)
UNITTEST("append_after_fail_fails", append_after_fail_fails)
UNITTEST_END_TESTCASE(buffer_chain_tests, "buffer_chain", "BufferChain tests")
| 31.055085 | 100 | 0.682631 |
1000c09c62ceed98bac0813f3d35ec640d46abb2 | 3,358 | cpp | C++ | src/anax/detail/EntityIdPool.cpp | shadwstalkr/anax | b0055500525c9cdf28e5325fc1583861948f692f | [
"MIT"
] | null | null | null | src/anax/detail/EntityIdPool.cpp | shadwstalkr/anax | b0055500525c9cdf28e5325fc1583861948f692f | [
"MIT"
] | null | null | null | src/anax/detail/EntityIdPool.cpp | shadwstalkr/anax | b0055500525c9cdf28e5325fc1583861948f692f | [
"MIT"
] | null | null | null | ///
/// anax
/// An open source C++ entity system.
///
/// Copyright (C) 2013-2014 Miguel Martin (miguel@miguel-martin.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 <anax/detail/EntityIdPool.hpp>
namespace anax
{
namespace detail
{
EntityIdPool::EntityIdPool(std::size_t poolSize) :
m_defaultPoolSize(poolSize),
m_nextId(0),
m_entities(poolSize)
{
}
Entity::Id EntityIdPool::create()
{
Entity::Id id;
// if we need to add more entities to the pool
if(!m_freeList.empty())
{
id = m_freeList.back();
m_freeList.pop_back();
// Update the ID counter before issuing
//id.counter = m_entities[id.index];
}
else
{
id.index = m_nextId++;
// an ID given out cannot have a counter of 0.
// 0 is an "invalid" counter, thus we must update
// the counter within the pool for the corresponding
// entity
m_entities[id.index] = id.counter = 1;
}
return id;
}
void EntityIdPool::remove(Entity::Id id)
{
auto& counter = m_entities[id.index];
++counter; // increment the counter in the cache
m_freeList.emplace_back(static_cast<Entity::Id::int_type>(id.index), counter); // add the ID to the freeList
}
Entity::Id EntityIdPool::get(std::size_t index) const
{
assert(!(m_entities[index] == 0) && "Entity ID does not exist");
return Entity::Id{index, m_entities[index]};
}
bool EntityIdPool::isValid(Entity::Id id) const
{
return id.counter == m_entities[id.index];
}
std::size_t EntityIdPool::getSize() const
{
return m_entities.size();
}
void EntityIdPool::resize(std::size_t amount)
{
m_entities.resize(amount);
}
void EntityIdPool::clear()
{
m_entities.clear();
m_freeList.clear();
m_nextId = 0;
m_entities.resize(m_defaultPoolSize);
}
}
}
| 32.601942 | 120 | 0.589637 |
1001e65903df0d119542540a8123ddfd2f84da3a | 6,712 | hpp | C++ | inference-engine/include/cpp/ie_executable_network.hpp | ledmonster/openvino | c1b1e2e7afc698ac82b32bb1f502ad2e90cd1419 | [
"Apache-2.0"
] | null | null | null | inference-engine/include/cpp/ie_executable_network.hpp | ledmonster/openvino | c1b1e2e7afc698ac82b32bb1f502ad2e90cd1419 | [
"Apache-2.0"
] | 15 | 2021-05-14T09:24:06.000Z | 2022-02-21T13:07:57.000Z | inference-engine/include/cpp/ie_executable_network.hpp | ledmonster/openvino | c1b1e2e7afc698ac82b32bb1f502ad2e90cd1419 | [
"Apache-2.0"
] | null | null | null | // Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief A header file that provides ExecutableNetwork class
*
* @file ie_executable_network.hpp
*/
#pragma once
#include <ostream>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "cpp/ie_cnn_network.h"
#include "cpp/ie_infer_request.hpp"
namespace InferenceEngine {
namespace details {
class SharedObjectLoader;
}
class IExecutableNetworkInternal;
class IExecutableNetwork;
/**
* @brief This is an interface of an executable network
*/
class INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) {
std::shared_ptr<IExecutableNetworkInternal> _impl;
std::shared_ptr<details::SharedObjectLoader> _so;
ExecutableNetwork(const std::shared_ptr<IExecutableNetworkInternal>& impl,
const std::shared_ptr<details::SharedObjectLoader>& so);
friend class InferencePlugin;
public:
/**
* @brief Default constructor
*/
ExecutableNetwork() = default;
/**
* @brief Default destructor
*/
~ExecutableNetwork();
/**
* @brief Gets the Executable network output Data node information.
*
* The received info is stored in the given InferenceEngine::ConstOutputsDataMap node.
* This method need to be called to find output names for using them later
* when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob
*
* @return A collection that contains string as key, and const Data smart pointer as value
*/
ConstOutputsDataMap GetOutputsInfo() const;
/**
* @brief Gets the executable network input Data node information.
*
* The received info is stored in the given InferenceEngine::ConstInputsDataMap object.
* This method need to be called to find out input names for using them later
* when calling InferenceEngine::InferRequest::SetBlob
*
* @param inputs Reference to InferenceEngine::ConstInputsDataMap object.
* @return A collection that contains string as key, and const InputInfo smart pointer as value
*/
ConstInputsDataMap GetInputsInfo() const;
/**
* @brief Creates an inference request object used to infer the network.
*
* The created request has allocated input and output blobs (that can be changed later).
*
* @return InferRequest object
*/
InferRequest CreateInferRequest();
/**
* @brief Exports the current executable network.
*
* @see Core::ImportNetwork
*
* @param modelFileName Full path to the location of the exported file
*/
void Export(const std::string& modelFileName);
/**
* @brief Exports the current executable network.
*
* @see Core::ImportNetwork
*
* @param networkModel Network model output stream
*/
void Export(std::ostream& networkModel);
/**
* @copybrief IExecutableNetwork::GetExecGraphInfo
*
* Wraps IExecutableNetwork::GetExecGraphInfo.
* @return CNNetwork containing Executable Graph Info
*/
CNNNetwork GetExecGraphInfo();
/**
* @brief Sets configuration for current executable network
*
* @param config Map of pairs: (config parameter name, config parameter value)
*/
void SetConfig(const std::map<std::string, Parameter>& config);
/** @brief Gets configuration for current executable network.
*
* The method is responsible to extract information
* which affects executable network execution. The list of supported configuration values can be extracted via
* ExecutableNetwork::GetMetric with the SUPPORTED_CONFIG_KEYS key, but some of these keys cannot be changed
* dynamically, e.g. DEVICE_ID cannot changed if an executable network has already been compiled for particular
* device.
*
* @param name config key, can be found in ie_plugin_config.hpp
* @return Configuration parameter value
*/
Parameter GetConfig(const std::string& name) const;
/**
* @brief Gets general runtime metric for an executable network.
*
* It can be network name, actual device ID on
* which executable network is running or all other properties which cannot be changed dynamically.
*
* @param name metric name to request
* @return Metric parameter value
*/
Parameter GetMetric(const std::string& name) const;
/**
* @brief Returns pointer to plugin-specific shared context
* on remote accelerator device that was used to create this ExecutableNetwork
* @return A context
*/
RemoteContext::Ptr GetContext() const;
/**
* @brief Checks if current ExecutableNetwork object is not initialized
* @return true if current ExecutableNetwork object is not initialized, false - otherwise
*/
bool operator!() const noexcept;
/**
* @brief Checks if current ExecutableNetwork object is initialized
* @return true if current ExecutableNetwork object is initialized, false - otherwise
*/
explicit operator bool() const noexcept;
IE_SUPPRESS_DEPRECATED_START
/**
* @deprecated The method Will be removed
* @brief reset owned object to new pointer.
*
* Essential for cases when simultaneously loaded networks not expected.
* @param newActual actual pointed object
*/
INFERENCE_ENGINE_DEPRECATED("The method will be removed")
void reset(std::shared_ptr<IExecutableNetwork> newActual);
/**
* @deprecated Will be removed. Use operator bool
* @brief cast operator is used when this wrapper initialized by LoadNetwork
* @return A shared pointer to IExecutableNetwork interface.
*/
INFERENCE_ENGINE_DEPRECATED("The method will be removed. Use operator bool")
operator std::shared_ptr<IExecutableNetwork>();
/**
* @deprecated Use ExecutableNetwork::CreateInferRequest
* @copybrief IExecutableNetwork::CreateInferRequest
*
* Wraps IExecutableNetwork::CreateInferRequest.
* @return shared pointer on InferenceEngine::InferRequest object
*/
INFERENCE_ENGINE_DEPRECATED("Use ExecutableNetwork::CreateInferRequest instead")
InferRequest::Ptr CreateInferRequestPtr();
/**
* @deprecated Use InferRequest::QueryState instead
* @brief Gets state control interface for given executable network.
*
* State control essential for recurrent networks
*
* @return A vector of Memory State objects
*/
INFERENCE_ENGINE_DEPRECATED("Use InferRequest::QueryState instead")
std::vector<VariableState> QueryState();
IE_SUPPRESS_DEPRECATED_END
};
} // namespace InferenceEngine
| 32.741463 | 115 | 0.701579 |
1002cec105c9f2962ed7b66d5ebe8dd85283d9f9 | 2,651 | cpp | C++ | archive/old/codeforces/675/D.cpp | irvinodjuana/acm | d111d310a6970779eb0e28f4e612c44c30eb1b41 | [
"MIT"
] | null | null | null | archive/old/codeforces/675/D.cpp | irvinodjuana/acm | d111d310a6970779eb0e28f4e612c44c30eb1b41 | [
"MIT"
] | null | null | null | archive/old/codeforces/675/D.cpp | irvinodjuana/acm | d111d310a6970779eb0e28f4e612c44c30eb1b41 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
// shortened type names
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> node;
// macros
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i < b; i++)
#define REPI(i, a, b) for (int i = a; i <= b; i++)
void print_vector(vector<int> v) {
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
cout << "\n";
}
void read_array(vector<int> & v, int n) {
int num;
while (n--) {
cin >> num;
v.push_back(num);
}
}
int solve (node s, node f, vector<node> ims) {
map<node, vector<pair<node, int>>> graph;
graph[s].push_back({f, abs(s.X - f.X) + abs(s.Y - f.Y)});
for (int i = 0; i < ims.size(); i++) {
node im1 = ims[i];
for (int j = i + 1; j < ims.size(); j++) {
node im2 = ims[2];
graph[im1].push_back({im2, min(abs(im1.X - im2.X), abs(im1.Y - im2.Y))});
graph[im2].push_back({im1, min(abs(im1.X - im2.X), abs(im1.Y - im2.Y))});
}
graph[s].push_back({im1, min(abs(s.X - im1.X), abs(s.Y - im1.Y))});
graph[im1].push_back({f, abs(f.X - im1.X) + abs(f.Y - im1.Y)});
}
priority_queue<pair<int, node>, vector<pair<int, node>>, greater<pair<int,node>>> pq;
set<node> visited;
pq.push({0, s});
while (!pq.empty()) {
auto p = pq.top();
pq.pop();
int dist = p.first;
node curr = p.second;
// std::cout << dist << " (" << curr.first << "," << curr.second << ")\n";
if (curr == f) return dist;
if (visited.count(curr)) continue;
visited.insert(curr);
for (auto& edge : graph[curr]) {
node nbor = edge.first;
int edgeLen = edge.second;
// std::cout << "nbor: " << edgeLen << " [" << nbor.X << "," << nbor.Y << "]\n";
if (visited.count(nbor)) continue;
pq.push({dist + edgeLen, nbor});
}
}
return -1;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
// int tests;
// cin >> tests;
// REP(tt, 0, tests) {
// code here
int n, m, sx, sy, fx, fy;
cin >> n >> m;
cin >> sx >> sy >> fx >> fy;
node s = {sx, sy};
node f = {fx, fy};
vector<node> ims;
// std::cout << f.X << " " << f.Y << endl;
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
ims.push_back({x, y});
}
std::cout << solve(s, f, ims) << "\n";
// }
std::cout.flush();
return 0;
} | 22.853448 | 92 | 0.462844 |
1003137bdb08f5a813b64750bb6e7d0494459cb2 | 2,686 | cpp | C++ | buildcc/lib/target/src/api/include_api.cpp | coder137/build_in_cpp | 296b0312eb0f4773fb2d40b01ed302f74f26f7a8 | [
"Apache-2.0"
] | 48 | 2021-06-15T08:34:42.000Z | 2022-03-24T20:35:54.000Z | buildcc/lib/target/src/api/include_api.cpp | coder137/build_in_cpp | 296b0312eb0f4773fb2d40b01ed302f74f26f7a8 | [
"Apache-2.0"
] | 100 | 2021-06-14T00:21:49.000Z | 2022-03-29T03:59:42.000Z | buildcc/lib/target/src/api/include_api.cpp | coder137/build_in_cpp | 296b0312eb0f4773fb2d40b01ed302f74f26f7a8 | [
"Apache-2.0"
] | 1 | 2021-06-17T01:03:36.000Z | 2021-06-17T01:03:36.000Z | /*
* Copyright 2021-2022 Niket Naidu. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "target/api/include_api.h"
#include "target/target_info.h"
namespace buildcc::base {
template <typename T>
void IncludeApi<T>::AddHeaderAbsolute(const fs::path &absolute_filepath) {
T &t = static_cast<T &>(*this);
t.state_.ExpectsUnlock();
t.config_.ExpectsValidHeader(absolute_filepath);
t.storer_.current_header_files.user.insert(absolute_filepath);
}
template <typename T>
void IncludeApi<T>::AddHeader(const fs::path &relative_filename,
const fs::path &relative_to_target_path) {
T &t = static_cast<T &>(*this);
// Check Source
fs::path absolute_filepath =
t.env_.GetTargetRootDir() / relative_to_target_path / relative_filename;
AddHeaderAbsolute(absolute_filepath);
}
template <typename T>
void IncludeApi<T>::GlobHeaders(const fs::path &relative_to_target_path) {
T &t = static_cast<T &>(*this);
fs::path absolute_path = t.env_.GetTargetRootDir() / relative_to_target_path;
GlobHeadersAbsolute(absolute_path);
}
template <typename T>
void IncludeApi<T>::GlobHeadersAbsolute(const fs::path &absolute_path) {
T &t = static_cast<T &>(*this);
for (const auto &p : fs::directory_iterator(absolute_path)) {
if (t.config_.IsValidHeader(p.path())) {
AddHeaderAbsolute(p.path());
}
}
}
template <typename T>
void IncludeApi<T>::AddIncludeDir(const fs::path &relative_include_dir,
bool glob_headers) {
T &t = static_cast<T &>(*this);
const fs::path absolute_include_dir =
t.env_.GetTargetRootDir() / relative_include_dir;
AddIncludeDirAbsolute(absolute_include_dir, glob_headers);
}
template <typename T>
void IncludeApi<T>::AddIncludeDirAbsolute(const fs::path &absolute_include_dir,
bool glob_headers) {
T &t = static_cast<T &>(*this);
t.state_.ExpectsUnlock();
t.storer_.current_include_dirs.insert(absolute_include_dir);
if (glob_headers) {
GlobHeadersAbsolute(absolute_include_dir);
}
}
template class IncludeApi<TargetInfo>;
} // namespace buildcc::base
| 30.522727 | 79 | 0.71035 |
1005e682e5dca863df5c1a3a0eac5c17ae1c7487 | 2,414 | cpp | C++ | dev/test/so_5/coop/coop_notify_3/main.cpp | eao197/SObjectizer | 73b0d1bf5b4bdf543c24bc4969d2c408e0cea812 | [
"BSD-3-Clause"
] | 272 | 2019-05-16T11:45:54.000Z | 2022-03-28T09:32:14.000Z | dev/test/so_5/coop/coop_notify_3/main.cpp | eao197/SObjectizer | 73b0d1bf5b4bdf543c24bc4969d2c408e0cea812 | [
"BSD-3-Clause"
] | 40 | 2019-10-29T18:19:18.000Z | 2022-03-30T09:02:49.000Z | dev/test/so_5/coop/coop_notify_3/main.cpp | eao197/SObjectizer | 73b0d1bf5b4bdf543c24bc4969d2c408e0cea812 | [
"BSD-3-Clause"
] | 29 | 2019-05-16T12:05:32.000Z | 2022-03-19T12:28:33.000Z | /*
* A test for stardard coop reg/dereg notificators.
*/
#include <iostream>
#include <sstream>
#include <so_5/all.hpp>
#include <test/3rd_party/various_helpers/time_limited_execution.hpp>
struct msg_child_deregistered : public so_5::signal_t {};
class a_child_t : public so_5::agent_t
{
typedef so_5::agent_t base_type_t;
public :
a_child_t(
so_5::environment_t & env )
: base_type_t( env )
{
}
};
class a_test_t : public so_5::agent_t
{
typedef so_5::agent_t base_type_t;
public :
a_test_t(
so_5::environment_t & env )
: base_type_t( env )
, m_mbox( env.create_mbox() )
, m_cycle( 0 )
{}
void
so_define_agent() override
{
so_subscribe( m_mbox ).in( st_wait_registration )
.event( &a_test_t::evt_coop_registered );
so_subscribe( m_mbox ).in( st_wait_deregistration )
.event( &a_test_t::evt_coop_deregistered );
}
void
so_evt_start() override
{
so_change_state( st_wait_registration );
create_next_coop();
}
void
evt_coop_registered(
mhood_t< so_5::msg_coop_registered > evt )
{
std::cout << "registered: " << evt->m_coop << std::endl;
so_change_state( st_wait_deregistration );
so_environment().deregister_coop(
evt->m_coop,
so_5::dereg_reason::normal );
}
void
evt_coop_deregistered(
mhood_t< so_5::msg_coop_deregistered > evt )
{
std::cout << "deregistered: " << evt->m_coop << std::endl;
if( 5 == m_cycle )
so_environment().stop();
else
{
++m_cycle;
so_change_state( st_wait_registration );
create_next_coop();
}
}
private :
const so_5::mbox_t m_mbox;
int m_cycle;
so_5::state_t st_wait_registration{ this };
so_5::state_t st_wait_deregistration{ this };
void
create_next_coop()
{
auto child_coop = so_environment().make_coop(
so_coop(),
so_5::disp::active_obj::make_dispatcher(
so_environment() ).binder() );
child_coop->add_reg_notificator(
so_5::make_coop_reg_notificator( m_mbox ) );
child_coop->add_dereg_notificator(
so_5::make_coop_dereg_notificator( m_mbox ) );
child_coop->make_agent< a_child_t >();
so_environment().register_coop( std::move( child_coop ) );
}
};
int
main()
{
run_with_time_limit( [] {
so_5::launch(
[]( so_5::environment_t & env )
{
env.register_agent_as_coop(
env.make_agent< a_test_t >() );
} );
},
10 );
return 0;
}
| 18.859375 | 68 | 0.6628 |
100645af911c20a835e8d020943b16061bf039d5 | 15,343 | cpp | C++ | modules/platforms/cpp/thin-client/src/impl/cache/cache_client_impl.cpp | mwwx/ignite | 49e063cb3ce748d4f6caa1dea66ae1f4fd21997d | [
"Apache-2.0"
] | 2 | 2022-03-04T09:18:47.000Z | 2022-03-04T09:18:52.000Z | modules/platforms/cpp/thin-client/src/impl/cache/cache_client_impl.cpp | mwwx/ignite | 49e063cb3ce748d4f6caa1dea66ae1f4fd21997d | [
"Apache-2.0"
] | null | null | null | modules/platforms/cpp/thin-client/src/impl/cache/cache_client_impl.cpp | mwwx/ignite | 49e063cb3ce748d4f6caa1dea66ae1f4fd21997d | [
"Apache-2.0"
] | null | null | null | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <ignite/impl/thin/writable_key.h>
#include "impl/response_status.h"
#include "impl/message.h"
#include "impl/cache/cache_client_impl.h"
#include "impl/cache/query/continuous/continuous_query_notification_handler.h"
#include "impl/transactions/transactions_impl.h"
using namespace ignite::impl::thin::transactions;
using namespace ignite::common::concurrent;
namespace ignite
{
namespace impl
{
namespace thin
{
namespace cache
{
typedef SharedPointer<TransactionImpl> SP_TransactionImpl;
CacheClientImpl::CacheClientImpl(
const SP_DataRouter& router,
const transactions::SP_TransactionsImpl& tx,
const std::string& name,
int32_t id) :
router(router),
tx(tx),
name(name),
id(id),
binary(false)
{
// No-op.
}
CacheClientImpl::~CacheClientImpl()
{
// No-op.
}
template<typename ReqT, typename RspT>
void CacheClientImpl::SyncCacheKeyMessage(const WritableKey& key, ReqT& req, RspT& rsp)
{
DataRouter& router0 = *router.Get();
if (router0.IsPartitionAwarenessEnabled())
{
affinity::SP_AffinityAssignment affinityInfo = router0.GetAffinityAssignment(id);
if (!affinityInfo.IsValid())
{
router0.RefreshAffinityMapping(id);
affinityInfo = router0.GetAffinityAssignment(id);
}
if (!affinityInfo.IsValid() || affinityInfo.Get()->GetPartitionsNum() == 0)
{
router0.SyncMessage(req, rsp);
}
else
{
const Guid& guid = affinityInfo.Get()->GetNodeGuid(key);
router0.SyncMessage(req, rsp, guid);
}
}
else
{
router0.SyncMessage(req, rsp);
}
if (rsp.GetStatus() != ResponseStatus::SUCCESS)
throw IgniteError(IgniteError::IGNITE_ERR_CACHE, rsp.GetError().c_str());
}
template<typename ReqT, typename RspT>
SP_DataChannel CacheClientImpl::SyncMessage(ReqT& req, RspT& rsp)
{
SP_DataChannel channel = router.Get()->SyncMessage(req, rsp);
if (rsp.GetStatus() != ResponseStatus::SUCCESS)
throw IgniteError(IgniteError::IGNITE_ERR_CACHE, rsp.GetError().c_str());
return channel;
}
template<typename ReqT, typename RspT>
SP_DataChannel CacheClientImpl::SyncMessageSql(ReqT& req, RspT& rsp)
{
SP_DataChannel channel;
try {
channel = router.Get()->SyncMessage(req, rsp);
}
catch (IgniteError& err)
{
std::string msg("08001: ");
msg += err.GetText();
throw IgniteError(err.GetCode(), msg.c_str());
}
if (rsp.GetStatus() != ResponseStatus::SUCCESS)
throw IgniteError(IgniteError::IGNITE_ERR_CACHE, rsp.GetError().c_str());
return channel;
}
template<typename ReqT, typename RspT>
void CacheClientImpl::TransactionalSyncCacheKeyMessage(const WritableKey &key, ReqT &req,
RspT &rsp)
{
if (!TryProcessTransactional(req, rsp))
SyncCacheKeyMessage(key, req, rsp);
}
template<typename ReqT, typename RspT>
void CacheClientImpl::TransactionalSyncMessage(ReqT &req, RspT &rsp)
{
if (!TryProcessTransactional(req, rsp))
SyncMessage(req, rsp);
}
template<typename ReqT, typename RspT>
bool CacheClientImpl::TryProcessTransactional(ReqT& req, RspT& rsp)
{
TransactionImpl* activeTx = tx.Get()->GetCurrent().Get();
if (!activeTx)
return false;
req.activeTx(true, activeTx->TxId());
SP_DataChannel channel = activeTx->GetChannel();
channel.Get()->SyncMessage(req, rsp, router.Get()->GetIoTimeout());
if (rsp.GetStatus() != ResponseStatus::SUCCESS)
throw IgniteError(IgniteError::IGNITE_ERR_CACHE, rsp.GetError().c_str());
return true;
}
void CacheClientImpl::Put(const WritableKey& key, const Writable& value)
{
Cache2ValueRequest<MessageType::CACHE_PUT> req(id, binary, key, value);
Response rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
void CacheClientImpl::Get(const WritableKey& key, Readable& value)
{
CacheValueRequest<MessageType::CACHE_GET> req(id, binary, key);
CacheValueResponse rsp(value);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
void CacheClientImpl::PutAll(const Writable & pairs)
{
CacheValueRequest<MessageType::CACHE_PUT_ALL> req(id, binary, pairs);
Response rsp;
TransactionalSyncMessage(req, rsp);
}
void CacheClientImpl::GetAll(const Writable& keys, Readable& pairs)
{
CacheValueRequest<MessageType::CACHE_GET_ALL> req(id, binary, keys);
CacheValueResponse rsp(pairs);
TransactionalSyncMessage(req, rsp);
}
bool CacheClientImpl::Replace(const WritableKey& key, const Writable& value)
{
Cache2ValueRequest<MessageType::CACHE_REPLACE> req(id, binary, key, value);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
bool CacheClientImpl::ContainsKey(const WritableKey& key)
{
CacheValueRequest<MessageType::CACHE_CONTAINS_KEY> req(id, binary, key);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
bool CacheClientImpl::ContainsKeys(const Writable& keys)
{
CacheValueRequest<MessageType::CACHE_CONTAINS_KEYS> req(id, binary, keys);
BoolResponse rsp;
TransactionalSyncMessage(req, rsp);
return rsp.GetValue();
}
int64_t CacheClientImpl::GetSize(int32_t peekModes)
{
CacheGetSizeRequest req(id, binary, peekModes);
Int64Response rsp;
TransactionalSyncMessage(req, rsp);
return rsp.GetValue();
}
bool CacheClientImpl::Remove(const WritableKey& key)
{
CacheValueRequest<MessageType::CACHE_REMOVE_KEY> req(id, binary, key);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
bool CacheClientImpl::Remove(const WritableKey& key, const Writable& val)
{
Cache2ValueRequest<MessageType::CACHE_REMOVE_IF_EQUALS> req(id, binary, key, val);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
void CacheClientImpl::RemoveAll(const Writable& keys)
{
CacheValueRequest<MessageType::CACHE_REMOVE_KEYS> req(id, binary, keys);
Response rsp;
TransactionalSyncMessage(req, rsp);
}
void CacheClientImpl::RemoveAll()
{
CacheRequest<MessageType::CACHE_REMOVE_ALL> req(id, binary);
Response rsp;
TransactionalSyncMessage(req, rsp);
}
void CacheClientImpl::Clear(const WritableKey& key)
{
CacheValueRequest<MessageType::CACHE_CLEAR_KEY> req(id, binary, key);
Response rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
void CacheClientImpl::Clear()
{
CacheRequest<MessageType::CACHE_CLEAR> req(id, binary);
Response rsp;
TransactionalSyncMessage(req, rsp);
}
void CacheClientImpl::ClearAll(const Writable& keys)
{
CacheValueRequest<MessageType::CACHE_CLEAR_KEYS> req(id, binary, keys);
Response rsp;
TransactionalSyncMessage(req, rsp);
}
void CacheClientImpl::LocalPeek(const WritableKey& key, Readable& value)
{
CacheValueRequest<MessageType::CACHE_LOCAL_PEEK> req(id, binary, key);
CacheValueResponse rsp(value);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
bool CacheClientImpl::Replace(const WritableKey& key, const Writable& oldVal, const Writable& newVal)
{
Cache3ValueRequest<MessageType::CACHE_REPLACE_IF_EQUALS> req(id, binary, key, oldVal, newVal);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
void CacheClientImpl::GetAndPut(const WritableKey& key, const Writable& valIn, Readable& valOut)
{
Cache2ValueRequest<MessageType::CACHE_GET_AND_PUT> req(id, binary, key, valIn);
CacheValueResponse rsp(valOut);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
void CacheClientImpl::GetAndRemove(const WritableKey& key, Readable& valOut)
{
CacheValueRequest<MessageType::CACHE_GET_AND_REMOVE> req(id, binary, key);
CacheValueResponse rsp(valOut);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
void CacheClientImpl::GetAndReplace(const WritableKey& key, const Writable& valIn, Readable& valOut)
{
Cache2ValueRequest<MessageType::CACHE_GET_AND_REPLACE> req(id, binary, key, valIn);
CacheValueResponse rsp(valOut);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
bool CacheClientImpl::PutIfAbsent(const WritableKey& key, const Writable& val)
{
Cache2ValueRequest<MessageType::CACHE_PUT_IF_ABSENT> req(id, binary, key, val);
BoolResponse rsp;
TransactionalSyncCacheKeyMessage(key, req, rsp);
return rsp.GetValue();
}
void CacheClientImpl::GetAndPutIfAbsent(const WritableKey& key, const Writable& valIn, Readable& valOut)
{
Cache2ValueRequest<MessageType::CACHE_GET_AND_PUT_IF_ABSENT> req(id, binary, key, valIn);
CacheValueResponse rsp(valOut);
TransactionalSyncCacheKeyMessage(key, req, rsp);
}
query::SP_QueryFieldsCursorImpl CacheClientImpl::Query(
const ignite::thin::cache::query::SqlFieldsQuery &qry)
{
SqlFieldsQueryRequest req(id, qry);
SqlFieldsQueryResponse rsp;
SP_DataChannel channel = SyncMessageSql(req, rsp);
query::SP_QueryFieldsCursorImpl cursorImpl(
new query::QueryFieldsCursorImpl(
rsp.GetCursorId(),
rsp.GetColumns(),
rsp.GetCursorPage(),
channel,
static_cast<int32_t>(qry.GetTimeout())));
return cursorImpl;
}
query::continuous::SP_ContinuousQueryHandleClientImpl CacheClientImpl::QueryContinuous(
const query::continuous::SP_ContinuousQueryClientHolderBase& continuousQuery)
{
const query::continuous::ContinuousQueryClientHolderBase& cq = *continuousQuery.Get();
ContinuousQueryRequest req(id, cq.GetBufferSize(), cq.GetTimeInterval(), cq.GetIncludeExpired());
ContinuousQueryResponse rsp;
SP_DataChannel channel = SyncMessage(req, rsp);
query::continuous::SP_ContinuousQueryNotificationHandler handler(
new query::continuous::ContinuousQueryNotificationHandler(*channel.Get(), continuousQuery));
channel.Get()->RegisterNotificationHandler(rsp.GetQueryId(), handler);
return query::continuous::SP_ContinuousQueryHandleClientImpl(
new query::continuous::ContinuousQueryHandleClientImpl(channel, rsp.GetQueryId()));
}
}
}
}
}
| 38.843038 | 120 | 0.519455 |
10077d08646da48db50bac94e8ee2a908644b6f6 | 7,138 | cpp | C++ | samples/daal/cpp/mpi/sources/svd_fast_distributed_mpi.cpp | cmsxbc/oneDAL | eeb8523285907dc359c84ca4894579d5d1d9f57e | [
"Apache-2.0"
] | 169 | 2020-03-30T09:13:05.000Z | 2022-03-15T11:12:36.000Z | samples/daal/cpp/mpi/sources/svd_fast_distributed_mpi.cpp | cmsxbc/oneDAL | eeb8523285907dc359c84ca4894579d5d1d9f57e | [
"Apache-2.0"
] | 1,198 | 2020-03-24T17:26:18.000Z | 2022-03-31T08:06:15.000Z | samples/daal/cpp/mpi/sources/svd_fast_distributed_mpi.cpp | cmsxbc/oneDAL | eeb8523285907dc359c84ca4894579d5d1d9f57e | [
"Apache-2.0"
] | 75 | 2020-03-30T11:39:58.000Z | 2022-03-26T05:16:20.000Z | /* file: svd_fast_distributed_mpi.cpp */
/*******************************************************************************
* Copyright 2017-2021 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/*
! Content:
! C++ sample of computing singular value decomposition (SVD) in the
! distributed processing mode
!******************************************************************************/
/**
* <a name="DAAL-EXAMPLE-CPP-SVD_FAST_DISTRIBUTED_MPI"></a>
* \example svd_fast_distributed_mpi.cpp
*/
#include <mpi.h>
#include "daal.h"
#include "service.h"
using namespace std;
using namespace daal;
using namespace daal::algorithms;
/* Input data set parameters */
const size_t nBlocks = 4;
const string datasetFileNames[] = { "./data/distributed/svd_1.csv", "./data/distributed/svd_2.csv", "./data/distributed/svd_3.csv",
"./data/distributed/svd_4.csv" };
void computestep1Local();
void computeOnMasterNode();
void finalizeComputestep1Local();
int rankId;
int commSize;
#define mpiRoot 0
data_management::DataCollectionPtr dataFromStep1ForStep3;
NumericTablePtr Sigma;
NumericTablePtr V;
NumericTablePtr Ui;
services::SharedPtr<byte> serializedData;
size_t perNodeArchLength;
int main(int argc, char * argv[])
{
checkArguments(argc, argv, 4, &datasetFileNames[0], &datasetFileNames[1], &datasetFileNames[2], &datasetFileNames[3]);
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &commSize);
MPI_Comm_rank(MPI_COMM_WORLD, &rankId);
if (nBlocks != commSize)
{
if (rankId == mpiRoot)
{
std::cout << commSize << " MPI ranks != " << nBlocks << " datasets available, so please start exactly " << nBlocks << " ranks.\n"
<< std::endl;
}
MPI_Finalize();
return 0;
}
computestep1Local();
if (rankId == mpiRoot)
{
computeOnMasterNode();
}
finalizeComputestep1Local();
/* Print the results */
if (rankId == mpiRoot)
{
printNumericTable(Sigma, "Singular values:");
printNumericTable(V, "Right orthogonal matrix V:");
printNumericTable(Ui, "Part of left orthogonal matrix U from root node:", 10);
}
MPI_Finalize();
return 0;
}
void computestep1Local()
{
/* Initialize FileDataSource<CSVFeatureManager> to retrieve the input data from a .csv file */
FileDataSource<CSVFeatureManager> dataSource(datasetFileNames[rankId], DataSource::doAllocateNumericTable, DataSource::doDictionaryFromContext);
/* Retrieve the input data */
dataSource.loadDataBlock();
/* Create an algorithm to compute SVD on local nodes */
svd::Distributed<step1Local> alg;
alg.input.set(svd::data, dataSource.getNumericTable());
/* Compute SVD */
alg.compute();
data_management::DataCollectionPtr dataFromStep1ForStep2;
dataFromStep1ForStep2 = alg.getPartialResult()->get(svd::outputOfStep1ForStep2);
dataFromStep1ForStep3 = alg.getPartialResult()->get(svd::outputOfStep1ForStep3);
/* Serialize partial results required by step 2 */
InputDataArchive dataArch;
dataFromStep1ForStep2->serialize(dataArch);
perNodeArchLength = dataArch.getSizeOfArchive();
/* Serialized data is of equal size on each node if each node called compute() equal number of times */
if (rankId == mpiRoot)
{
serializedData = services::SharedPtr<byte>(new byte[perNodeArchLength * nBlocks]);
}
byte * nodeResults = new byte[perNodeArchLength];
dataArch.copyArchiveToArray(nodeResults, perNodeArchLength);
/* Transfer partial results to step 2 on the root node */
MPI_Gather(nodeResults, perNodeArchLength, MPI_CHAR, serializedData.get(), perNodeArchLength, MPI_CHAR, mpiRoot, MPI_COMM_WORLD);
delete[] nodeResults;
}
void computeOnMasterNode()
{
/* Create an algorithm to compute SVD on the master node */
svd::Distributed<step2Master> alg;
for (size_t i = 0; i < nBlocks; i++)
{
/* Deserialize partial results from step 1 */
OutputDataArchive dataArch(serializedData.get() + perNodeArchLength * i, perNodeArchLength);
data_management::DataCollectionPtr dataForStep2FromStep1 = data_management::DataCollectionPtr(new data_management::DataCollection());
dataForStep2FromStep1->deserialize(dataArch);
alg.input.add(svd::inputOfStep2FromStep1, i, dataForStep2FromStep1);
}
/* Compute SVD */
alg.compute();
svd::DistributedPartialResultPtr pres = alg.getPartialResult();
KeyValueDataCollectionPtr inputForStep3FromStep2 = pres->get(svd::outputOfStep2ForStep3);
for (size_t i = 0; i < nBlocks; i++)
{
/* Serialize partial results to transfer to local nodes for step 3 */
InputDataArchive dataArch;
(*inputForStep3FromStep2)[i]->serialize(dataArch);
if (i == 0)
{
perNodeArchLength = dataArch.getSizeOfArchive();
/* Serialized data is of equal size for each node if it was equal in step 1 */
serializedData = services::SharedPtr<byte>(new byte[perNodeArchLength * nBlocks]);
}
dataArch.copyArchiveToArray(serializedData.get() + perNodeArchLength * i, perNodeArchLength);
}
svd::ResultPtr res = alg.getResult();
Sigma = res->get(svd::singularValues);
V = res->get(svd::rightSingularMatrix);
}
void finalizeComputestep1Local()
{
/* Get the size of the serialized input */
MPI_Bcast(&perNodeArchLength, sizeof(size_t), MPI_CHAR, mpiRoot, MPI_COMM_WORLD);
byte * nodeResults = new byte[perNodeArchLength];
/* Transfer partial results from the root node */
MPI_Scatter(serializedData.get(), perNodeArchLength, MPI_CHAR, nodeResults, perNodeArchLength, MPI_CHAR, mpiRoot, MPI_COMM_WORLD);
/* Deserialize partial results from step 2 */
OutputDataArchive dataArch(nodeResults, perNodeArchLength);
data_management::DataCollectionPtr dataFromStep2ForStep3 = data_management::DataCollectionPtr(new data_management::DataCollection());
dataFromStep2ForStep3->deserialize(dataArch);
delete[] nodeResults;
/* Create an algorithm to compute SVD on the master node */
svd::Distributed<step3Local> alg;
alg.input.set(svd::inputOfStep3FromStep1, dataFromStep1ForStep3);
alg.input.set(svd::inputOfStep3FromStep2, dataFromStep2ForStep3);
/* Compute SVD */
alg.compute();
alg.finalizeCompute();
svd::ResultPtr res = alg.getResult();
Ui = res->get(svd::leftSingularMatrix);
}
| 32.894009 | 148 | 0.67582 |
10078e224a15ab6c61479f045a4bc0234839df60 | 2,506 | cc | C++ | examples/sdk/node/node_modules/hfc/node_modules/grpc/third_party/boringssl/tool/rand.cc | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 598 | 2017-06-29T17:02:45.000Z | 2022-03-22T16:57:13.000Z | examples/sdk/node/node_modules/hfc/node_modules/grpc/third_party/boringssl/tool/rand.cc | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 26 | 2017-07-22T20:30:06.000Z | 2021-08-03T08:16:59.000Z | examples/sdk/node/node_modules/hfc/node_modules/grpc/third_party/boringssl/tool/rand.cc | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 54 | 2017-06-30T03:40:56.000Z | 2021-12-16T11:28:33.000Z | /* Copyright (c) 2015, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#include <string>
#include <vector>
#include <stdint.h>
#include <stdlib.h>
#include <openssl/rand.h>
#include "internal.h"
static const struct argument kArguments[] = {
{
"-hex", kBooleanArgument,
"Hex encoded output."
},
{
"", kOptionalArgument, "",
},
};
bool Rand(const std::vector<std::string> &args) {
bool forever = true, hex = false;
size_t len = 0;
if (!args.empty()) {
std::vector<std::string> args_copy(args);
const std::string &last_arg = args.back();
if (last_arg.size() > 0 && last_arg[0] != '-') {
char *endptr;
unsigned long long num = strtoull(last_arg.c_str(), &endptr, 10);
if (*endptr == 0) {
len = num;
forever = false;
args_copy.pop_back();
}
}
std::map<std::string, std::string> args_map;
if (!ParseKeyValueArguments(&args_map, args_copy, kArguments)) {
PrintUsage(kArguments);
return false;
}
hex = args_map.count("-hex") > 0;
}
uint8_t buf[4096];
uint8_t hex_buf[8192];
size_t done = 0;
while (forever || done < len) {
size_t todo = sizeof(buf);
if (!forever && todo > len - done) {
todo = len - done;
}
RAND_bytes(buf, todo);
if (hex) {
static const char hextable[] = "0123456789abdef";
for (unsigned i = 0; i < todo; i++) {
hex_buf[i*2] = hextable[buf[i] >> 4];
hex_buf[i*2 + 1] = hextable[buf[i] & 0xf];
}
if (fwrite(hex_buf, todo*2, 1, stdout) != 1) {
return false;
}
} else {
if (fwrite(buf, todo, 1, stdout) != 1) {
return false;
}
}
done += todo;
}
if (hex && fwrite("\n", 1, 1, stdout) != 1) {
return false;
}
return true;
}
| 26.104167 | 79 | 0.611333 |
1008a580f480d9cbf3d40839a7e2089315060b97 | 1,596 | cpp | C++ | src/ossim/base/ossimStdOutProgress.cpp | rkanavath/ossim18 | d2e8204d11559a6a868755a490f2ec155407fa96 | [
"MIT"
] | null | null | null | src/ossim/base/ossimStdOutProgress.cpp | rkanavath/ossim18 | d2e8204d11559a6a868755a490f2ec155407fa96 | [
"MIT"
] | null | null | null | src/ossim/base/ossimStdOutProgress.cpp | rkanavath/ossim18 | d2e8204d11559a6a868755a490f2ec155407fa96 | [
"MIT"
] | 1 | 2019-09-25T00:43:35.000Z | 2019-09-25T00:43:35.000Z | //*******************************************************************
// Copyright (C) 2000 ImageLinks Inc.
//
// License: MIT
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: Garrett Potts
//
//*************************************************************************
// $Id: ossimStdOutProgress.cpp 23664 2015-12-14 14:17:27Z dburken $
#include <iomanip>
#include <ossim/base/ossimStdOutProgress.h>
RTTI_DEF1(ossimStdOutProgress, "ossimStdOutProgress", ossimProcessListener);
ossimStdOutProgress theStdOutProgress;
ossimStdOutProgress::ossimStdOutProgress(ossim_uint32 precision,
bool flushStream)
:
ossimProcessListener(),
thePrecision(precision),
theFlushStreamFlag(flushStream)
{
}
void ossimStdOutProgress::processProgressEvent(ossimProcessProgressEvent& event)
{
if (event.getOutputMessageFlag())
{
ossimString s;
event.getMessage(s);
if (!s.empty())
{
ossimNotify(ossimNotifyLevel_NOTICE) << s.c_str() << std::endl;
}
return; // Don't output percentage on a message update.
}
double p = event.getPercentComplete();
ossimNotify(ossimNotifyLevel_NOTICE)
<< std::setiosflags(std::ios::fixed)
<< std::setprecision(thePrecision)
<< p << "%\r";
if(theFlushStreamFlag)
{
(p != 100.0) ?
ossimNotify(ossimNotifyLevel_NOTICE).flush() :
ossimNotify(ossimNotifyLevel_NOTICE) << "\n";
}
}
void ossimStdOutProgress::setFlushStreamFlag(bool flag)
{
theFlushStreamFlag = flag;
}
| 25.333333 | 80 | 0.607143 |
1008fe156071b30791a1cbb289813bc5447f7d6c | 13,115 | cpp | C++ | src/checkpoints/checkpoints.cpp | Fez29/loki | 6890c5d52b906f8127a3fa71911f56ecbf4a8680 | [
"BSD-3-Clause"
] | null | null | null | src/checkpoints/checkpoints.cpp | Fez29/loki | 6890c5d52b906f8127a3fa71911f56ecbf4a8680 | [
"BSD-3-Clause"
] | null | null | null | src/checkpoints/checkpoints.cpp | Fez29/loki | 6890c5d52b906f8127a3fa71911f56ecbf4a8680 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2018, The Loki Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#include "checkpoints.h"
#include "common/dns_utils.h"
#include "string_tools.h"
#include "storages/portable_storage_template_helper.h" // epee json include
#include "serialization/keyvalue_serialization.h"
#include "cryptonote_core/service_node_rules.h"
#include <vector>
#include "syncobj.h"
#include "blockchain_db/blockchain_db.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
using namespace epee;
#include "common/loki_integration_test_hooks.h"
#include "common/loki.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "checkpoints"
namespace cryptonote
{
bool checkpoint_t::check(crypto::hash const &hash) const
{
bool result = block_hash == hash;
if (result) MINFO ("CHECKPOINT PASSED FOR HEIGHT " << height << " " << block_hash);
else MWARNING("CHECKPOINT FAILED FOR HEIGHT " << height << ". EXPECTED HASH " << block_hash << "GIVEN HASH: " << hash);
return result;
}
height_to_hash const HARDCODED_MAINNET_CHECKPOINTS[] =
{
{0, "08ff156d993012b0bdf2816c4bee47c9bbc7930593b70ee02574edddf15ee933"},
{1, "647997953a5ea9b5ab329c2291d4cbb08eed587c287e451eeeb2c79bab9b940f"},
{10, "4a7cd8b9bff380d48d6f3533a5e0509f8589cc77d18218b3f7218846e77738fc"},
{100, "01b8d33a50713ff837f8ad7146021b8e3060e0316b5e4afc407e46cdb50b6760"},
{1000, "5e3b0a1f931885bc0ab1d6ecdc625816576feae29e2f9ac94c5ccdbedb1465ac"},
{86535, "52b7c5a60b97bf1efbf0d63a0aa1a313e8f0abe4627eb354b0c5a73cb1f4391e"},
{97407, "504af73abbaba85a14ddc16634658bf4dcc241dc288b1eaad09e216836b71023"},
{98552, "2058d5c675bd91284f4996435593499c9ab84a5a0f569f57a86cde2e815e57da"},
{144650, "a1ab207afc790675070ecd7aac874eb0691eb6349ea37c44f8f58697a5d6cbc4"},
{266284, "c42801a37a41e3e9f934a266063483646072a94bfc7269ace178e93c91414b1f"},
{301187, "e23e4cf3a2fe3e9f0ffced5cc76426e5bdffd3aad822268f4ad63d82cb958559"},
};
height_to_hash const HARDCODED_TESTNET_CHECKPOINTS[] =
{
{127028, "83f6ea8d62601733a257d2f075fd960edd80886dc090d8751478c0a738caa09e"},
};
crypto::hash get_newest_hardcoded_checkpoint(cryptonote::network_type nettype, uint64_t *height)
{
crypto::hash result = crypto::null_hash;
*height = 0;
if (nettype != MAINNET && nettype != TESTNET)
return result;
if (nettype == MAINNET)
{
uint64_t last_index = loki::array_count(HARDCODED_MAINNET_CHECKPOINTS) - 1;
height_to_hash const &entry = HARDCODED_MAINNET_CHECKPOINTS[last_index];
if (epee::string_tools::hex_to_pod(entry.hash, result))
*height = entry.height;
}
else
{
uint64_t last_index = loki::array_count(HARDCODED_TESTNET_CHECKPOINTS) - 1;
height_to_hash const &entry = HARDCODED_TESTNET_CHECKPOINTS[last_index];
if (epee::string_tools::hex_to_pod(entry.hash, result))
*height = entry.height;
}
return result;
}
bool load_checkpoints_from_json(const std::string &json_hashfile_fullpath, std::vector<height_to_hash> &checkpoint_hashes)
{
boost::system::error_code errcode;
if (! (boost::filesystem::exists(json_hashfile_fullpath, errcode)))
{
LOG_PRINT_L1("Blockchain checkpoints file not found");
return true;
}
height_to_hash_json hashes;
if (!epee::serialization::load_t_from_json_file(hashes, json_hashfile_fullpath))
{
MERROR("Error loading checkpoints from " << json_hashfile_fullpath);
return false;
}
checkpoint_hashes = std::move(hashes.hashlines);
return true;
}
bool checkpoints::get_checkpoint(uint64_t height, checkpoint_t &checkpoint) const
{
try
{
auto guard = db_rtxn_guard(m_db);
return m_db->get_block_checkpoint(height, checkpoint);
}
catch (const std::exception &e)
{
MERROR("Get block checkpoint from DB failed at height: " << height << ", what = " << e.what());
return false;
}
}
//---------------------------------------------------------------------------
bool checkpoints::add_checkpoint(uint64_t height, const std::string& hash_str)
{
crypto::hash h = crypto::null_hash;
bool r = epee::string_tools::hex_to_pod(hash_str, h);
CHECK_AND_ASSERT_MES(r, false, "Failed to parse checkpoint hash string into binary representation!");
checkpoint_t checkpoint = {};
if (get_checkpoint(height, checkpoint))
{
crypto::hash const &curr_hash = checkpoint.block_hash;
CHECK_AND_ASSERT_MES(h == curr_hash, false, "Checkpoint at given height already exists, and hash for new checkpoint was different!");
}
else
{
checkpoint.type = checkpoint_type::hardcoded;
checkpoint.height = height;
checkpoint.block_hash = h;
r = update_checkpoint(checkpoint);
}
return r;
}
bool checkpoints::update_checkpoint(checkpoint_t const &checkpoint)
{
// NOTE(loki): Assumes checkpoint is valid
bool result = true;
bool batch_started = false;
try
{
batch_started = m_db->batch_start();
m_db->update_block_checkpoint(checkpoint);
}
catch (const std::exception& e)
{
MERROR("Failed to add checkpoint with hash: " << checkpoint.block_hash << " at height: " << checkpoint.height << ", what = " << e.what());
result = false;
}
if (batch_started)
m_db->batch_stop();
return result;
}
//---------------------------------------------------------------------------
bool checkpoints::block_added(const cryptonote::block& block, const std::vector<cryptonote::transaction>& txs, checkpoint_t const *checkpoint)
{
uint64_t const height = get_block_height(block);
if (height < service_nodes::CHECKPOINT_STORE_PERSISTENTLY_INTERVAL || block.major_version < network_version_12_checkpointing)
return true;
uint64_t end_cull_height = 0;
{
checkpoint_t immutable_checkpoint;
if (m_db->get_immutable_checkpoint(&immutable_checkpoint, height + 1))
end_cull_height = immutable_checkpoint.height;
}
uint64_t start_cull_height = (end_cull_height < service_nodes::CHECKPOINT_STORE_PERSISTENTLY_INTERVAL)
? 0
: end_cull_height - service_nodes::CHECKPOINT_STORE_PERSISTENTLY_INTERVAL;
if ((start_cull_height % service_nodes::CHECKPOINT_INTERVAL) > 0)
start_cull_height += (service_nodes::CHECKPOINT_INTERVAL - (start_cull_height % service_nodes::CHECKPOINT_INTERVAL));
m_last_cull_height = std::max(m_last_cull_height, start_cull_height);
auto guard = db_wtxn_guard(m_db);
for (; m_last_cull_height < end_cull_height; m_last_cull_height += service_nodes::CHECKPOINT_INTERVAL)
{
if (m_last_cull_height % service_nodes::CHECKPOINT_STORE_PERSISTENTLY_INTERVAL == 0)
continue;
try
{
m_db->remove_block_checkpoint(m_last_cull_height);
}
catch (const std::exception &e)
{
MERROR("Pruning block checkpoint on block added failed non-trivially at height: " << m_last_cull_height << ", what = " << e.what());
}
}
if (checkpoint)
update_checkpoint(*checkpoint);
return true;
}
//---------------------------------------------------------------------------
void checkpoints::blockchain_detached(uint64_t height, bool /*by_pop_blocks*/)
{
m_last_cull_height = std::min(m_last_cull_height, height);
checkpoint_t top_checkpoint;
auto guard = db_wtxn_guard(m_db);
if (m_db->get_top_checkpoint(top_checkpoint))
{
uint64_t start_height = top_checkpoint.height;
for (size_t delete_height = start_height;
delete_height >= height && delete_height >= service_nodes::CHECKPOINT_INTERVAL;
delete_height -= service_nodes::CHECKPOINT_INTERVAL)
{
try
{
m_db->remove_block_checkpoint(delete_height);
}
catch (const std::exception &e)
{
MERROR("Remove block checkpoint on detach failed non-trivially at height: " << delete_height << ", what = " << e.what());
}
}
}
}
//---------------------------------------------------------------------------
bool checkpoints::is_in_checkpoint_zone(uint64_t height) const
{
uint64_t top_checkpoint_height = 0;
checkpoint_t top_checkpoint;
if (m_db->get_top_checkpoint(top_checkpoint))
top_checkpoint_height = top_checkpoint.height;
return height <= top_checkpoint_height;
}
//---------------------------------------------------------------------------
bool checkpoints::check_block(uint64_t height, const crypto::hash& h, bool* is_a_checkpoint, bool *service_node_checkpoint) const
{
checkpoint_t checkpoint;
bool found = get_checkpoint(height, checkpoint);
if (is_a_checkpoint) *is_a_checkpoint = found;
if (service_node_checkpoint) *service_node_checkpoint = false;
if(!found)
return true;
bool result = checkpoint.check(h);
if (service_node_checkpoint)
*service_node_checkpoint = (checkpoint.type == checkpoint_type::service_node);
return result;
}
//---------------------------------------------------------------------------
bool checkpoints::is_alternative_block_allowed(uint64_t blockchain_height, uint64_t block_height, bool *service_node_checkpoint)
{
if (service_node_checkpoint)
*service_node_checkpoint = false;
if (0 == block_height)
return false;
{
std::vector<checkpoint_t> const first_checkpoint = m_db->get_checkpoints_range(0, blockchain_height, 1);
if (first_checkpoint.empty() || blockchain_height < first_checkpoint[0].height)
return true;
}
checkpoint_t immutable_checkpoint;
uint64_t immutable_height = 0;
if (m_db->get_immutable_checkpoint(&immutable_checkpoint, blockchain_height))
{
immutable_height = immutable_checkpoint.height;
if (service_node_checkpoint)
*service_node_checkpoint = (immutable_checkpoint.type == checkpoint_type::service_node);
}
m_immutable_height = std::max(immutable_height, m_immutable_height);
bool result = block_height > m_immutable_height;
return result;
}
//---------------------------------------------------------------------------
uint64_t checkpoints::get_max_height() const
{
uint64_t result = 0;
checkpoint_t top_checkpoint;
if (m_db->get_top_checkpoint(top_checkpoint))
result = top_checkpoint.height;
return result;
}
//---------------------------------------------------------------------------
bool checkpoints::init(network_type nettype, struct BlockchainDB *db)
{
*this = {};
m_db = db;
m_nettype = nettype;
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
if (nettype == MAINNET)
{
for (size_t i = 0; i < loki::array_count(HARDCODED_MAINNET_CHECKPOINTS); ++i)
{
height_to_hash const &checkpoint = HARDCODED_MAINNET_CHECKPOINTS[i];
ADD_CHECKPOINT(checkpoint.height, checkpoint.hash);
}
}
else if (nettype == TESTNET)
{
for (size_t i = 0; i < loki::array_count(HARDCODED_TESTNET_CHECKPOINTS); ++i)
{
height_to_hash const &checkpoint = HARDCODED_TESTNET_CHECKPOINTS[i];
ADD_CHECKPOINT(checkpoint.height, checkpoint.hash);
}
}
#endif
return true;
}
}
| 37.686782 | 144 | 0.672817 |
100940d91b663d0269562179b936cb41854b4838 | 453 | cpp | C++ | 0801-0900/0884-Uncommon Words from Two Sentences/0884-Uncommon Words from Two Sentences.cpp | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0801-0900/0884-Uncommon Words from Two Sentences/0884-Uncommon Words from Two Sentences.cpp | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0801-0900/0884-Uncommon Words from Two Sentences/0884-Uncommon Words from Two Sentences.cpp | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class Solution {
public:
vector<string> uncommonFromSentences(string A, string B) {
stringstream ss(A + ' ' + B);
string s;
unordered_map<string, int> table;
while (getline(ss, s, ' ')) {
++table[s];
}
vector<string> result;
for (auto& p : table) {
if (p.second == 1) {
result.push_back(p.first);
}
}
return result;
}
};
| 23.842105 | 62 | 0.465784 |
100b59559ed64364ff11a6367089636feb09f5d2 | 4,886 | cpp | C++ | laser_filters/src/scan_to_scan_filter_chain.cpp | kilinmao/sarl_star | dde9bb2b690c705a615195f4b570af3ea9dfe05e | [
"MIT"
] | 59 | 2020-08-03T04:03:04.000Z | 2022-03-29T07:25:23.000Z | laser_filters/src/scan_to_scan_filter_chain.cpp | kilinmao/sarl_star | dde9bb2b690c705a615195f4b570af3ea9dfe05e | [
"MIT"
] | 2 | 2021-09-03T06:19:13.000Z | 2021-09-14T02:30:55.000Z | laser_filters/src/scan_to_scan_filter_chain.cpp | kilinmao/sarl_star | dde9bb2b690c705a615195f4b570af3ea9dfe05e | [
"MIT"
] | 22 | 2020-08-13T07:16:12.000Z | 2022-03-13T03:06:29.000Z | /*
* Copyright (c) 2008, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "ros/ros.h"
#include "sensor_msgs/LaserScan.h"
#include "message_filters/subscriber.h"
#include "tf/message_filter.h"
#include "tf/transform_listener.h"
#include "filters/filter_chain.h"
class ScanToScanFilterChain
{
protected:
// Our NodeHandle
ros::NodeHandle nh_;
ros::NodeHandle private_nh_;
// Components for tf::MessageFilter
tf::TransformListener *tf_;
message_filters::Subscriber<sensor_msgs::LaserScan> scan_sub_;
tf::MessageFilter<sensor_msgs::LaserScan> *tf_filter_;
double tf_filter_tolerance_;
// Filter Chain
filters::FilterChain<sensor_msgs::LaserScan> filter_chain_;
// Components for publishing
sensor_msgs::LaserScan msg_;
ros::Publisher output_pub_;
// Deprecation helpers
ros::Timer deprecation_timer_;
bool using_filter_chain_deprecated_;
public:
// Constructor
ScanToScanFilterChain() :
private_nh_("~"),
scan_sub_(nh_, "scan", 50),
tf_(NULL),
tf_filter_(NULL),
filter_chain_("sensor_msgs::LaserScan")
{
// Configure filter chain
using_filter_chain_deprecated_ = private_nh_.hasParam("filter_chain");
if (using_filter_chain_deprecated_)
filter_chain_.configure("filter_chain", private_nh_);
else
filter_chain_.configure("scan_filter_chain", private_nh_);
std::string tf_message_filter_target_frame;
if (private_nh_.hasParam("tf_message_filter_target_frame"))
{
private_nh_.getParam("tf_message_filter_target_frame", tf_message_filter_target_frame);
private_nh_.param("tf_message_filter_tolerance", tf_filter_tolerance_, 0.03);
tf_ = new tf::TransformListener();
tf_filter_ = new tf::MessageFilter<sensor_msgs::LaserScan>(scan_sub_, *tf_, "", 50);
tf_filter_->setTargetFrame(tf_message_filter_target_frame);
tf_filter_->setTolerance(ros::Duration(tf_filter_tolerance_));
// Setup tf::MessageFilter generates callback
tf_filter_->registerCallback(boost::bind(&ScanToScanFilterChain::callback, this, _1));
}
else
{
// Pass through if no tf_message_filter_target_frame
scan_sub_.registerCallback(boost::bind(&ScanToScanFilterChain::callback, this, _1));
}
// Advertise output
output_pub_ = nh_.advertise<sensor_msgs::LaserScan>("scan_filtered", 1000);
// Set up deprecation printout
deprecation_timer_ = nh_.createTimer(ros::Duration(5.0), boost::bind(&ScanToScanFilterChain::deprecation_warn, this, _1));
}
// Destructor
~ScanToScanFilterChain()
{
if (tf_filter_)
delete tf_filter_;
if (tf_)
delete tf_;
}
// Deprecation warning callback
void deprecation_warn(const ros::TimerEvent& e)
{
if (using_filter_chain_deprecated_)
ROS_WARN("Use of '~filter_chain' parameter in scan_to_scan_filter_chain has been deprecated. Please replace with '~scan_filter_chain'.");
}
// Callback
void callback(const sensor_msgs::LaserScan::ConstPtr& msg_in)
{
// Run the filter chain
if (filter_chain_.update(*msg_in, msg_))
{
//only publish result if filter succeeded
output_pub_.publish(msg_);
}
}
};
int main(int argc, char **argv)
{
ros::init(argc, argv, "scan_to_scan_filter_chain");
ScanToScanFilterChain t;
ros::spin();
return 0;
}
| 33.465753 | 143 | 0.729636 |
100d10a26da0790c1cd139427219e95d8530dc63 | 53,580 | cpp | C++ | embree-2.0/examples/renderer/device_coi/coi_device.cpp | PetrVevoda/smallupbp | 15430256733938d529a2f5c7ef4cdcd940ae4208 | [
"MIT",
"Apache-2.0",
"Unlicense"
] | 107 | 2015-01-27T22:01:49.000Z | 2021-12-27T07:44:25.000Z | examples/renderer/device_coi/coi_device.cpp | mbdriscoll/embree | 77bb760c005fb7097335da2defe4b4711c15cdd3 | [
"Intel",
"Apache-2.0"
] | 1 | 2015-03-17T18:53:59.000Z | 2015-03-17T18:53:59.000Z | examples/renderer/device_coi/coi_device.cpp | mbdriscoll/embree | 77bb760c005fb7097335da2defe4b4711c15cdd3 | [
"Intel",
"Apache-2.0"
] | 17 | 2015-03-12T19:11:30.000Z | 2020-11-30T15:51:23.000Z | // ======================================================================== //
// Copyright 2009-2013 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#include "coi_device.h"
#include "sys/stl/string.h"
#include "sys/sysinfo.h"
#include "sys/filename.h"
#include "image/image.h"
namespace embree
{
COIDevice::COIProcess::COIProcess (int cardID, const char* executable, size_t numThreads, size_t verbose)
{
/* assume MIC executable to be in same folder as host executable */
FileName fname = FileName(getExecutableFileName()).path() + FileName(executable);
/* get engine handle */
COIRESULT result;
result = COIEngineGetHandle( COI_ISA_MIC, cardID, &engine );
if (result != COI_SUCCESS)
throw std::runtime_error("Failed to load engine number " + std::stringOf(cardID) + ": " + COIResultGetName(result));
/* print info of engine */
COI_ENGINE_INFO info;
result = COIEngineGetInfo(engine,sizeof(info),&info);
if (result != COI_SUCCESS)
throw std::runtime_error("COIEngineGetInfo failed: "+std::string(COIResultGetName(result)));
std::cout << "Found Xeon Phi device with " << info.NumCores << " cores and " << (info.PhysicalMemory/1024/1024) << "MB memory" << std::endl;
std::string strNumThreads = std::stringOf(numThreads);
std::string strVerbose = std::stringOf(verbose);
const char* argv[2] = { strNumThreads.c_str(), strVerbose.c_str() };
/* create process */
result = COIProcessCreateFromFile
(engine,
fname.c_str(), // The local path to the sink side binary to launch.
2, argv, // argc and argv for the sink process.
false, NULL, // Environment variables to set for the sink process.
true, NULL, // Enable the proxy but don't specify a proxy root path.
0, // The amount of memory to reserve for COIBuffers.
NULL, // Path to search for dependencies
&process // The resulting process handle.
);
// if fail check loading by name
if (result != COI_SUCCESS) {
fname = FileName(executable);
result = COIProcessCreateFromFile
(engine,
fname.c_str(), // The local path to the sink side binary to launch.
2, argv, // argc and argv for the sink process.
false, NULL, // Environment variables to set for the sink process.
true, NULL, // Enable the proxy but don't specify a proxy root path.
0, // The amount of memory to reserve for COIBuffers.
NULL, // Path to search for dependencies
&process // The resulting process handle.
);
}
if (result != COI_SUCCESS)
throw std::runtime_error("Failed to create process " + std::string(executable) +": " + COIResultGetName(result));
/* create pipeline */
COI_CPU_MASK cpuMask;
COIPipelineClearCPUMask(&cpuMask);
COIPipelineSetCPUMask(process,info.NumCores-1,0,&cpuMask);
COIPipelineSetCPUMask(process,info.NumCores-1,1,&cpuMask);
COIPipelineSetCPUMask(process,info.NumCores-1,2,&cpuMask);
COIPipelineSetCPUMask(process,info.NumCores-1,3,&cpuMask);
result = COIPipelineCreate(process,cpuMask,0,&pipeline);
if (result != COI_SUCCESS)
throw std::runtime_error(std::string("Failed to create pipeline : ") + COIResultGetName(result));
/* get run functions */
const char *fctNameArray[] = {
"rtNewCamera",
"rtNewData",
"rtNewImage",
"rtNewTexture",
"rtNewMaterial",
"rtNewShape",
"rtNewLight",
"rtNewShapePrimitive",
"rtNewLightPrimitive",
"rtTransformPrimitive",
"rtNewScene",
"rtSetPrimitive",
"rtNewToneMapper",
"rtNewRenderer",
"rtNewFrameBuffer",
"rtSwapBuffers",
"rtIncRef",
"rtDecRef",
"rtSetBool1",
"rtSetBool2",
"rtSetBool3",
"rtSetBool4",
"rtSetInt1",
"rtSetInt2",
"rtSetInt3",
"rtSetInt4",
"rtSetFloat1",
"rtSetFloat2",
"rtSetFloat3",
"rtSetFloat4",
"rtSetArray",
"rtSetString",
"rtSetImage",
"rtSetTexture",
"rtSetTransform",
"rtClear",
"rtCommit",
"rtRenderFrame",
"rtPick",
"rtNewDataStart",
"rtNewDataSet",
"rtNewDataEnd"
};
result = COIProcessGetFunctionHandles (process, sizeof(fctNameArray)/sizeof(char*), fctNameArray, &runNewCamera);
if (result != COI_SUCCESS)
throw std::runtime_error("COIProcessGetFunctionHandles failed: "+std::string(COIResultGetName(result)));
result = COIBufferCreate(STREAM_BUFFER_SIZE,COI_BUFFER_NORMAL,0,NULL,1,&process,&stream);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferCreate failed: " + std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::loadLibrary (const char* library)
{
std::cout << "Loading library from file \"" << library << "\"" << std::endl;
COILIBRARY lib;
COIRESULT result = COIProcessLoadLibraryFromFile(process,library,library,NULL,&lib);
if (result != COI_SUCCESS)
throw std::runtime_error(std::string("Failed to load libary: ") + COIResultGetName(result));
libs.push_back(lib);
}
COIDevice::COIProcess::~COIProcess ()
{
for (size_t i=0; i<libs.size(); i++)
{
COIRESULT result = COIProcessUnloadLibrary(process,libs[i]);
if (result != COI_SUCCESS)
throw std::runtime_error(std::string("Unloading library failed: ") + std::string(COIResultGetName(result)));
}
COIRESULT result = COIProcessDestroy(process,-1,0,NULL,NULL);
if (result != COI_SUCCESS)
throw std::runtime_error(std::string("Destroying COI process failed: ") + std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::free (int id) {
swapchains.erase(id);
}
COIRESULT COIPipelineRunFunctionSync(COIPIPELINE in_Pipeline,
COIFUNCTION in_Function,
uint32_t in_NumBuffers,
const COIBUFFER* in_pBuffers,
const COI_ACCESS_FLAGS* in_pBufferAccessFlags,
uint32_t in_NumDependencies,
const COIEVENT* in_pDependencies,
const void* in_pMiscData,
uint16_t in_MiscDataLen,
void* out_pAsyncReturnValue,
uint16_t in_AsyncReturnValueLen)
{
COIEVENT completion;
COIRESULT result = COIPipelineRunFunction (in_Pipeline,
in_Function,
in_NumBuffers,
in_pBuffers,
in_pBufferAccessFlags,
in_NumDependencies,
in_pDependencies,
in_pMiscData,
in_MiscDataLen,
out_pAsyncReturnValue,
in_AsyncReturnValueLen,
&completion);
COIEventWait(1,&completion,-1,true,NULL,NULL);
return result;
}
/*******************************************************************
creation of objects
*******************************************************************/
void COIDevice::COIProcess::rtNewCamera(Device::RTCamera id, const char* type)
{
parmsNewCamera parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewCamera, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunctionSync failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewData(Device::RTData id, const char* type, size_t bytes, const void* data)
{
#if 0
parmsNewData parms;
parms.id = (int) (long) id;
parms.bytes = bytes;
COIBUFFER buffer;
COIRESULT result = COIBufferCreate(max(bytes,size_t(1)),COI_BUFFER_STREAMING_TO_SINK,0,data,1,&process,&buffer);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferCreate failed: " + std::string(COIResultGetName(result)));
COI_ACCESS_FLAGS flag = COI_SINK_READ;
result = COIPipelineRunFunctionSync (pipeline, runNewData, 1, &buffer, &flag, 0, NULL, &parms, sizeof(parms), NULL, 0);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunctionSync failed: "+std::string(COIResultGetName(result)));
result = COIBufferDestroy(buffer);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferDestroy failed: "+std::string(COIResultGetName(result)));
#else
parmsNewDataStart parms0;
parms0.id = (int) (long) id;
parms0.bytes = bytes;
COIRESULT result = COIPipelineRunFunction (pipeline, runNewDataStart, 0, NULL, NULL, 0, NULL, &parms0, sizeof(parms0), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
for (size_t i=0; i<bytes; i+=STREAM_BUFFER_SIZE)
{
void* dst = NULL;
size_t offset = i;
size_t dbytes = min(size_t(STREAM_BUFFER_SIZE),bytes-i);
COIEVENT completion;
COIRESULT result = COIBufferWrite(stream,0,(char*)data+offset,dbytes,COI_COPY_USE_DMA,0,NULL,&completion);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferWrite failed: "+std::string(COIResultGetName(result)));
COIEventWait(1,&completion,-1,true,NULL,NULL);
parmsNewDataSet parms1;
parms1.offset = offset;
parms1.bytes = dbytes;
COI_ACCESS_FLAGS flag = COI_SINK_READ;
result = COIPipelineRunFunctionSync (pipeline, runNewDataSet, 1, &stream, &flag, 0, NULL, &parms1, sizeof(parms1), NULL, 0);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
COI_ACCESS_FLAGS flag = COI_SINK_READ;
result = COIPipelineRunFunction (pipeline, runNewDataEnd, 0, NULL, NULL, 0, NULL, &parms0, sizeof(parms0), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
#endif
}
void COIDevice::COIProcess::rtNewImage(Device::RTImage id, const char* type, size_t width, size_t height, const void* data)
{
parmsNewImage parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
parms.width = width;
parms.height = height;
size_t bytes = 0;
if (!strcasecmp(type,"RGB8" )) bytes = width*height*3*sizeof(char);
else if (!strcasecmp(type,"RGBA8" )) bytes = width*height*4*sizeof(char);
else if (!strcasecmp(type,"RGB_FLOAT32" )) bytes = width*height*3*sizeof(float);
else if (!strcasecmp(type,"RGBA_FLOAT32")) bytes = width*height*4*sizeof(float);
else throw std::runtime_error("unknown image type: "+std::string(type));
COIBUFFER buffer;
COIRESULT result = COIBufferCreate(max(bytes,size_t(1)),COI_BUFFER_STREAMING_TO_SINK,0,data,1,&process,&buffer);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferCreate failed: " + std::string(COIResultGetName(result)));
COI_ACCESS_FLAGS flag = COI_SINK_READ;
result = COIPipelineRunFunctionSync (pipeline, runNewImage, 1, &buffer, &flag, 0, NULL, &parms, sizeof(parms), NULL, 0);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
result = COIBufferDestroy(buffer);
if (result != COI_SUCCESS) throw std::runtime_error("COIBufferDestroy failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewTexture(Device::RTTexture id, const char* type)
{
parmsNewTexture parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewTexture, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewMaterial(Device::RTMaterial id, const char* type)
{
parmsNewMaterial parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewMaterial, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewShape(Device::RTShape id, const char* type)
{
parmsNewShape parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewShape, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewLight(Device::RTLight id, const char* type)
{
parmsNewLight parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewLight, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewShapePrimitive(Device::RTPrimitive id,
Device::RTShape shape,
Device::RTMaterial material,
const float* transform)
{
parmsNewShapePrimitive parms;
parms.id = (int) (long) id;
parms.shape = (int) (long) shape;
parms.material = (int) (long) material;
if (transform) {
for (size_t i=0; i<12; i++)
parms.transform[i] = transform[i];
} else {
parms.transform[ 0] = 1.0f; parms.transform[ 1] = 0.0f; parms.transform[ 2] = 0.0f;
parms.transform[ 3] = 0.0f; parms.transform[ 4] = 1.0f; parms.transform[ 5] = 0.0f;
parms.transform[ 6] = 0.0f; parms.transform[ 7] = 0.0f; parms.transform[ 8] = 1.0f;
parms.transform[ 9] = 0.0f; parms.transform[10] = 0.0f; parms.transform[11] = 0.0f;
}
COIRESULT result = COIPipelineRunFunction (pipeline, runNewShapePrimitive, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewLightPrimitive(Device::RTPrimitive id,
Device::RTLight light,
Device::RTMaterial material,
const float* transform)
{
parmsNewLightPrimitive parms;
parms.id = (int) (long) id;
parms.light = (int) (long) light;
parms.material = (int) (long) material;
if (transform) {
for (size_t i=0; i<12; i++)
parms.transform[i] = transform[i];
} else {
parms.transform[ 0] = 1.0f; parms.transform[ 1] = 0.0f; parms.transform[ 2] = 0.0f;
parms.transform[ 3] = 0.0f; parms.transform[ 4] = 1.0f; parms.transform[ 5] = 0.0f;
parms.transform[ 6] = 0.0f; parms.transform[ 7] = 0.0f; parms.transform[ 8] = 1.0f;
parms.transform[ 9] = 0.0f; parms.transform[10] = 0.0f; parms.transform[11] = 0.0f;
}
COIRESULT result = COIPipelineRunFunction (pipeline, runNewLightPrimitive, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtTransformPrimitive(Device::RTPrimitive id, Device::RTPrimitive primitive, const float* transform)
{
parmsTransformPrimitive parms;
parms.id = (int) (long) id;
parms.primitive = (int) (long) primitive;
if (transform) {
for (size_t i=0; i<12; i++)
parms.transform[i] = transform[i];
} else {
parms.transform[ 0] = 1.0f; parms.transform[ 1] = 0.0f; parms.transform[ 2] = 0.0f;
parms.transform[ 3] = 0.0f; parms.transform[ 4] = 1.0f; parms.transform[ 5] = 0.0f;
parms.transform[ 6] = 0.0f; parms.transform[ 7] = 0.0f; parms.transform[ 8] = 1.0f;
parms.transform[ 9] = 0.0f; parms.transform[10] = 0.0f; parms.transform[11] = 0.0f;
}
COIRESULT result = COIPipelineRunFunction (pipeline, runTransformPrimitive, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewScene(Device::RTScene id, const char* type)
{
parmsNewScene parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewScene, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetPrimitive(RTScene scene, size_t slot, RTPrimitive prim)
{
parmsSetPrimitive parms;
parms.scene = (int) (long) scene;
parms.slot = slot;
parms.prim = (int) (long) prim;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetPrimitive, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewToneMapper(Device::RTToneMapper id, const char* type)
{
parmsNewToneMapper parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewToneMapper, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewRenderer(Device::RTRenderer id, const char* type)
{
parmsNewRenderer parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runNewRenderer, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtNewFrameBuffer(Device::RTFrameBuffer id, const char* type, size_t width, size_t height, size_t numBuffers)
{
SwapChain* swapchain = NULL;
if (!strcasecmp(type,"RGB_FLOAT32")) swapchain = new SwapChain(&process,width*height*3*sizeof(float),numBuffers);
else if (!strcasecmp(type,"RGBA8" )) swapchain = new SwapChain(&process,width*height*4,numBuffers);
else if (!strcasecmp(type,"RGB8" )) swapchain = new SwapChain(&process,width*height*3,numBuffers);
else throw std::runtime_error("unknown framebuffer type: "+std::string(type));
swapchains[(int)(long)id] = swapchain;
parmsNewFrameBuffer parms;
parms.id = (int) (long) id;
strncpy(parms.type,type,sizeof(parms.type)-1);
parms.width = width;
parms.height = height;
parms.depth = numBuffers;
COIRESULT result = COIPipelineRunFunction (pipeline, runNewFrameBuffer,
numBuffers, swapchain->buffer, swapchain->flag,
0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS)
throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void* COIDevice::COIProcess::rtMapFrameBuffer(RTFrameBuffer frameBuffer, int bufID)
{
Ref<SwapChain> swapchain = swapchains[(int)(long)frameBuffer];
if (bufID < 0) bufID = swapchain->curBuffer;
return swapchain->map(bufID);
}
void COIDevice::COIProcess::rtUnmapFrameBuffer(RTFrameBuffer frameBuffer, int bufID)
{
Ref<SwapChain> swapchain = swapchains[(int)(long)frameBuffer];
if (bufID < 0) bufID = swapchain->curBuffer;
return swapchain->unmap(bufID);
}
void COIDevice::COIProcess::rtSwapBuffers(Device::RTFrameBuffer frameBuffer)
{
parmsSwapBuffers parms;
parms.framebuffer = (int) (long) frameBuffer;
COIRESULT result = COIPipelineRunFunction (pipeline, runSwapBuffers, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
Ref<SwapChain> swapchain = swapchains[(int)(long)frameBuffer];
swapchain->swapBuffers();
}
void COIDevice::COIProcess::rtIncRef(Device::RTHandle handle)
{
parmsIncRef parms;
parms.handle = (int) (long) handle;
COIRESULT result = COIPipelineRunFunction (pipeline, runIncRef, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtDecRef(Device::RTHandle handle)
{
parmsDecRef parms;
parms.handle = (int) (long) handle;
COIRESULT result = COIPipelineRunFunction (pipeline, runDecRef, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
/*******************************************************************
setting of parameters
*******************************************************************/
void COIDevice::COIProcess::rtSetBool1(Device::RTHandle handle, const char* property, bool x)
{
parmsSetBoolN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = false;
parms.z = false;
parms.w = false;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetBool1, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetBool2(Device::RTHandle handle, const char* property, bool x, bool y)
{
parmsSetBoolN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = false;
parms.w = false;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetBool2, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetBool3(Device::RTHandle handle, const char* property, bool x, bool y, bool z)
{
parmsSetBoolN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = false;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetBool3, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetBool4(Device::RTHandle handle, const char* property, bool x, bool y, bool z, bool w)
{
parmsSetBoolN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = w;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetBool4, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetInt1(Device::RTHandle handle, const char* property, int x)
{
parmsSetIntN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = 0;
parms.z = 0;
parms.w = 0;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetInt1, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetInt2(Device::RTHandle handle, const char* property, int x, int y)
{
parmsSetIntN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = 0;
parms.w = 0;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetInt2, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetInt3(Device::RTHandle handle, const char* property, int x, int y, int z)
{
parmsSetIntN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = 0;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetInt3, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetInt4(Device::RTHandle handle, const char* property, int x, int y, int z, int w)
{
parmsSetIntN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = w;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetInt4, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetFloat1(Device::RTHandle handle, const char* property, float x)
{
parmsSetFloatN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = 0.0f;
parms.z = 0.0f;
parms.w = 0.0f;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetFloat1, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetFloat2(Device::RTHandle handle, const char* property, float x, float y)
{
parmsSetFloatN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = 0.0f;
parms.w = 0.0f;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetFloat2, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetFloat3(Device::RTHandle handle, const char* property, float x, float y, float z)
{
parmsSetFloatN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = 0.0f;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetFloat3, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetFloat4(Device::RTHandle handle, const char* property, float x, float y, float z, float w)
{
parmsSetFloatN parms;
parms.handle = (int) (long) handle;
parms.x = x;
parms.y = y;
parms.z = z;
parms.w = w;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetFloat4, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetArray(Device::RTHandle handle, const char* property, const char* type, Device::RTData data, size_t size, size_t stride, size_t ofs)
{
parmsSetArray parms;
parms.handle = (int) (long) handle;
strncpy(parms.property,property,sizeof(parms.property)-1);
strncpy(parms.type,type,sizeof(parms.type)-1);
parms.data = (int) (long) data;
parms.size = size;
parms.stride = stride;
parms.ofs = ofs;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetArray, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetString(Device::RTHandle handle, const char* property, const char* str)
{
parmsSetString parms;
parms.handle = (int) (long) handle;
strncpy(parms.property,property,sizeof(parms.property)-1);
strncpy(parms.str,str,sizeof(parms.str)-1);
COIRESULT result = COIPipelineRunFunction (pipeline, runSetString, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetImage(Device::RTHandle handle, const char* property, Device::RTImage image)
{
parmsSetImage parms;
parms.handle = (int) (long) handle;
parms.image = (int) (long) image;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetImage, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetTexture(Device::RTHandle handle, const char* property, Device::RTTexture texture)
{
parmsSetTexture parms;
parms.handle = (int) (long) handle;
parms.texture = (int) (long) texture;
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetTexture, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtSetTransform(Device::RTHandle handle, const char* property, const float* transform)
{
parmsSetTransform parms;
parms.handle = (int) (long) handle;
for (size_t i=0; i<12; i++) parms.transform[i] = transform[i];
strncpy(parms.property,property,sizeof(parms.property)-1);
size_t zeros = sizeof(parms.property)-strlen(parms.property)-1;
COIRESULT result = COIPipelineRunFunction (pipeline, runSetTransform, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms)-zeros, NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtClear(Device::RTHandle handle)
{
parmsClear parms;
parms.handle = (int) (long) handle;
COIRESULT result = COIPipelineRunFunction (pipeline, runClear, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
void COIDevice::COIProcess::rtCommit(Device::RTHandle handle)
{
parmsCommit parms;
parms.handle = (int) (long) handle;
COIRESULT result = COIPipelineRunFunction (pipeline, runCommit, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
/*******************************************************************
render calls
*******************************************************************/
void COIDevice::COIProcess::rtRenderFrame(Device::RTRenderer renderer, Device::RTCamera camera, Device::RTScene scene,
Device::RTToneMapper toneMapper, Device::RTFrameBuffer frameBuffer, int accumulate)
{
parmsRenderFrame parms;
parms.renderer = (int) (long) renderer;
parms.camera = (int) (long) camera;
parms.scene = (int) (long) scene;
parms.toneMapper = (int) (long) toneMapper;
parms.frameBuffer = (int) (long) frameBuffer;
parms.accumulate = accumulate;
Ref<SwapChain> swapchain = swapchains[(int)(long)frameBuffer];
COIRESULT result = COIPipelineRunFunction (pipeline, runRenderFrame,
1, &swapchain->buffer[swapchain->curBuffer], &swapchain->flag[swapchain->curBuffer],
0, NULL, &parms, sizeof(parms), NULL, 0, NULL);
if (result != COI_SUCCESS)
throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
}
bool COIDevice::COIProcess::rtPick(Device::RTCamera camera, float x, float y, Device::RTScene scene, float& px, float& py, float& pz)
{
parmsPick parms;
parms.camera = (int) (long) camera;
parms.x = x;
parms.y = y;
parms.scene = (int) (long) scene;
returnPick ret;
COIRESULT result = COIPipelineRunFunctionSync (pipeline, runPick, 0, NULL, NULL, 0, NULL, &parms, sizeof(parms), &ret, sizeof(ret));
if (result != COI_SUCCESS) throw std::runtime_error("COIPipelineRunFunction failed: "+std::string(COIResultGetName(result)));
/*! return pick data */
px = ret.x;
py = ret.y;
pz = ret.z;
return ret.hit;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
COIDevice::COIDevice(const char* executable, size_t numThreads, size_t verbose)
: nextHandle(1), serverID(0), serverCount(1)
{
uint32_t engines = 0;
COIEngineGetCount( COI_ISA_MIC, &engines );
if (engines == 0) throw std::runtime_error("no Xeon Phi device found");
/* initialize all devices */
for (uint32_t i=0; i<engines; i++)
devices.push_back(new COIProcess(i,executable,numThreads,verbose));
/* set server ID of devices */
for (size_t i=0; i<devices.size(); i++)
{
int id = serverID*devices.size()+i;
int count = serverCount*devices.size();
devices[i]->rtSetInt1(NULL,"serverID",id);
devices[i]->rtSetInt1(NULL,"serverCount",count);
}
/* dummy 0 handle */
counters.push_back(0);
buffers.push_back(NULL);
}
COIDevice::~COIDevice()
{
for (size_t i=0; i<devices.size(); i++) delete devices[i];
devices.clear();
}
/*******************************************************************
handle ID allocations
*******************************************************************/
int COIDevice::allocHandle()
{
if (pool.empty()) {
pool.push_back(nextHandle++);
counters.push_back(0);
buffers.push_back(NULL);
}
int id = pool.back();
counters[id] = 1;
pool.pop_back();
return id;
}
void COIDevice::incRef(int id) {
Lock<MutexSys> lock(handleMutex);
counters[id]++;
}
bool COIDevice::decRef(int id)
{
Lock<MutexSys> lock(handleMutex);
if (--counters[id] == 0) {
pool.push_back((int)id);
buffers[id] = null;
for (size_t i=0; i<devices.size(); i++)
devices[i]->free((int)id);
return true;
}
return false;
}
/*******************************************************************
creation of objects
*******************************************************************/
Device::RTCamera COIDevice::rtNewCamera(const char* type)
{
Device::RTCamera id = (Device::RTCamera) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewCamera(id,type);
return id;
}
Device::RTData COIDevice::rtNewData(const char* type, size_t bytes, const void* data)
{
Device::RTData id = (Device::RTData) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewData(id,type,bytes,data);
if (!strcasecmp(type,"immutable_managed"))
alignedFree((void*)data);
return id;
}
Device::RTData COIDevice::rtNewDataFromFile(const char* type, const char* fileName, size_t offset, size_t bytes)
{
if (strcasecmp(type,"immutable"))
throw std::runtime_error("unknown data type: "+(std::string)type);
/*! read data from file */
FILE* file = fopen(fileName,"rb");
if (!file) throw std::runtime_error("cannot open file "+(std::string)fileName);
fseek(file,(long)offset,SEEK_SET);
char* data = (char*) alignedMalloc(bytes);
if (bytes != fread(data,1,sizeof(bytes),file))
throw std::runtime_error("error filling data buffer from file");
fclose(file);
return rtNewData("immutable_managed", bytes, data);
}
Device::RTImage COIDevice::rtNewImage(const char* type, size_t width, size_t height, const void* data, const bool copy)
{
Device::RTImage id = (Device::RTImage) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewImage(id,type,width,height,data);
if (!copy) free((void*)data);
return id;
}
Device::RTImage COIDevice::rtNewImageFromFile(const char* fileName)
{
/*! load image locally */
Ref<Image> image = loadImage(fileName);
if (!image) throw std::runtime_error("cannot load image: "+std::string(fileName));
else if (Ref<Image3c> cimg = image.dynamicCast<Image3c>())
return rtNewImage("RGB8",cimg->width,cimg->height,cimg->steal_ptr(),false);
else if (Ref<Image4c> cimg = image.dynamicCast<Image4c>())
return rtNewImage("RGBA8",cimg->width,cimg->height,cimg->steal_ptr(),false);
else if (Ref<Image3f> fimg = image.dynamicCast<Image3f>())
return rtNewImage("RGB_FLOAT32",fimg->width,fimg->height,fimg->steal_ptr(),false);
else if (Ref<Image4f> fimg = image.dynamicCast<Image4f>())
return rtNewImage("RGBA_FLOAT32",fimg->width,fimg->height,fimg->steal_ptr(),false);
else
throw std::runtime_error("unknown image type");
}
Device::RTTexture COIDevice::rtNewTexture(const char* type)
{
Device::RTTexture id = (Device::RTTexture) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewTexture(id,type);
return id;
}
Device::RTMaterial COIDevice::rtNewMaterial(const char* type)
{
Device::RTMaterial id = (Device::RTMaterial) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewMaterial(id,type);
return id;
}
Device::RTShape COIDevice::rtNewShape(const char* type)
{
Device::RTShape id = (Device::RTShape) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewShape(id,type);
return id;
}
Device::RTLight COIDevice::rtNewLight(const char* type)
{
Device::RTLight id = (Device::RTLight) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewLight(id,type);
return id;
}
Device::RTPrimitive COIDevice::rtNewShapePrimitive(Device::RTShape shape, Device::RTMaterial material, const float* transform)
{
Device::RTPrimitive id = (Device::RTPrimitive) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewShapePrimitive(id,shape,material,transform);
return id;
}
Device::RTPrimitive COIDevice::rtNewLightPrimitive(Device::RTLight light, Device::RTMaterial material, const float* transform)
{
Device::RTPrimitive id = (Device::RTPrimitive) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewLightPrimitive(id,light,material,transform);
return id;
}
Device::RTPrimitive COIDevice::rtTransformPrimitive(Device::RTPrimitive primitive, const float* transform)
{
Device::RTPrimitive id = (Device::RTPrimitive) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtTransformPrimitive(id,primitive,transform);
return id;
}
Device::RTScene COIDevice::rtNewScene(const char* type)
{
Device::RTScene id = (Device::RTScene) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewScene(id,type);
return id;
}
void COIDevice::rtSetPrimitive(RTScene scene, size_t slot, RTPrimitive prim)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetPrimitive(scene,slot,prim);
}
Device::RTToneMapper COIDevice::rtNewToneMapper(const char* type)
{
Device::RTToneMapper id = (Device::RTToneMapper) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewToneMapper(id,type);
return id;
}
Device::RTRenderer COIDevice::rtNewRenderer(const char* type)
{
Device::RTRenderer id = (Device::RTRenderer) allocHandle();
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewRenderer(id,type);
return id;
}
Device::RTFrameBuffer COIDevice::rtNewFrameBuffer(const char* type, size_t width, size_t height, size_t numBuffers, void** ptrs)
{
int id = allocHandle();
Device::RTFrameBuffer hid = (Device::RTFrameBuffer) id;
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtNewFrameBuffer(hid,type,width,height,numBuffers);
if (!strcasecmp(type,"RGB_FLOAT32")) buffers[id] = new SwapChain(type,width,height,numBuffers,ptrs,FrameBufferRGBFloat32::create);
else if (!strcasecmp(type,"RGBA8" )) buffers[id] = new SwapChain(type,width,height,numBuffers,ptrs,FrameBufferRGBA8 ::create);
else if (!strcasecmp(type,"RGB8" )) buffers[id] = new SwapChain(type,width,height,numBuffers,ptrs,FrameBufferRGB8 ::create);
else throw std::runtime_error("unknown framebuffer type: "+std::string(type));
return hid;
}
void* COIDevice::rtMapFrameBuffer(Device::RTFrameBuffer frameBuffer, int bufID)
{
Ref<SwapChain>& swapChain = buffers[(size_t)frameBuffer];
if (bufID < 0) bufID = swapChain->id();
if (devices.size() == 1)
return devices[0]->rtMapFrameBuffer(frameBuffer,bufID);
/* map framebuffers of all devices */
std::vector<char*> ptrs(devices.size());
for (size_t i=0; i<devices.size(); i++)
ptrs[i] = (char*) devices[i]->rtMapFrameBuffer(frameBuffer,bufID);
/* merge images from different devices */
Ref<FrameBuffer>& buffer = swapChain->buffer(bufID);
char* dptr = (char*) buffer->getData();
size_t stride = buffer->getStride();
for (size_t y=0; y<buffer->getHeight(); y++) {
size_t row = y/4, subrow = y%4;
size_t devRow = row/devices.size();
size_t devID = row%devices.size();
char* src = ptrs[devID]+stride*(4*devRow+subrow);
char* dst = dptr+y*stride;
memcpy(dst,src,stride);
}
/* unmap framebuffers of all devices */
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtUnmapFrameBuffer(frameBuffer,bufID);
return dptr;
}
void COIDevice::rtUnmapFrameBuffer(Device::RTFrameBuffer frameBuffer, int bufID)
{
Ref<SwapChain>& swapChain = buffers[(size_t)frameBuffer];
if (bufID < 0) bufID = swapChain->id();
if (devices.size() == 1)
devices[0]->rtUnmapFrameBuffer(frameBuffer,bufID);
}
void COIDevice::rtSwapBuffers(Device::RTFrameBuffer frameBuffer)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSwapBuffers(frameBuffer);
Ref<SwapChain>& swapchain = buffers[(int)(long)frameBuffer];
swapchain->swapBuffers();
}
void COIDevice::rtIncRef(Device::RTHandle handle)
{
incRef((int)(size_t)handle);
}
void COIDevice::rtDecRef(Device::RTHandle handle)
{
if (decRef((int)(size_t)handle)) {
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtDecRef(handle);
}
}
/*******************************************************************
setting of parameters
*******************************************************************/
void COIDevice::rtSetBool1(Device::RTHandle handle, const char* property, bool x)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetBool1(handle,property,x);
}
void COIDevice::rtSetBool2(Device::RTHandle handle, const char* property, bool x, bool y)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetBool2(handle,property,x,y);
}
void COIDevice::rtSetBool3(Device::RTHandle handle, const char* property, bool x, bool y, bool z)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetBool3(handle,property,x,y,z);
}
void COIDevice::rtSetBool4(Device::RTHandle handle, const char* property, bool x, bool y, bool z, bool w)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetBool4(handle,property,x,y,z,w);
}
void COIDevice::rtSetInt1(Device::RTHandle handle, const char* property, int x)
{
if (!handle) {
if (!strcmp(property,"serverID" ))
serverID = x;
else if (!strcmp(property,"serverCount")) {
serverCount = x;
for (size_t i=0; i<devices.size(); i++) {
int id = serverID*devices.size()+i;
int count = serverCount*devices.size();
devices[i]->rtSetInt1(NULL,"serverID",id);
devices[i]->rtSetInt1(NULL,"serverCount",count);
}
}
else
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetInt1(handle,property,x);
}
else
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetInt1(handle,property,x);
}
void COIDevice::rtSetInt2(Device::RTHandle handle, const char* property, int x, int y)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetInt2(handle,property,x,y);
}
void COIDevice::rtSetInt3(Device::RTHandle handle, const char* property, int x, int y, int z)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetInt3(handle,property,x,y,z);
}
void COIDevice::rtSetInt4(Device::RTHandle handle, const char* property, int x, int y, int z, int w)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetInt4(handle,property,x,y,z,w);
}
void COIDevice::rtSetFloat1(Device::RTHandle handle, const char* property, float x)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetFloat1(handle,property,x);
}
void COIDevice::rtSetFloat2(Device::RTHandle handle, const char* property, float x, float y)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetFloat2(handle,property,x,y);
}
void COIDevice::rtSetFloat3(Device::RTHandle handle, const char* property, float x, float y, float z)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetFloat3(handle,property,x,y,z);
}
void COIDevice::rtSetFloat4(Device::RTHandle handle, const char* property, float x, float y, float z, float w)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetFloat4(handle,property,x,y,z,w);
}
void COIDevice::rtSetArray(Device::RTHandle handle, const char* property, const char* type, Device::RTData data, size_t size, size_t stride, size_t ofs)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetArray(handle,property,type,data,size,stride,ofs);
}
void COIDevice::rtSetString(Device::RTHandle handle, const char* property, const char* str)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetString(handle,property,str);
}
void COIDevice::rtSetImage(Device::RTHandle handle, const char* property, Device::RTImage img)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetImage(handle,property,img);
}
void COIDevice::rtSetTexture(Device::RTHandle handle, const char* property, Device::RTTexture tex)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetTexture(handle,property,tex);
}
void COIDevice::rtSetTransform(Device::RTHandle handle, const char* property, const float* transform)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtSetTransform(handle,property,transform);
}
void COIDevice::rtClear(Device::RTHandle handle)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtClear(handle);
}
void COIDevice::rtCommit(Device::RTHandle handle)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtCommit(handle);
}
/*******************************************************************
render calls
*******************************************************************/
void COIDevice::rtRenderFrame(Device::RTRenderer renderer, Device::RTCamera camera, Device::RTScene scene,
Device::RTToneMapper toneMapper, Device::RTFrameBuffer frameBuffer, int accumulate)
{
for (size_t i=0; i<devices.size(); i++)
devices[i]->rtRenderFrame(renderer,camera,scene,toneMapper,frameBuffer,accumulate);
}
bool COIDevice::rtPick(Device::RTCamera camera, float x, float y, Device::RTScene scene, float& px, float& py, float& pz)
{
return devices[0]->rtPick(camera,x,y,scene,px,py,pz);
}
__dllexport Device* create(const char* parms, size_t numThreads, size_t verbose)
{
return new COIDevice(parms,numThreads,verbose);
}
}
| 41.728972 | 166 | 0.630926 |
100d963f8642163d678f79d96b1652b03bc2016c | 3,139 | cpp | C++ | src/interface/uiMenu.cpp | santaclose/noose | e963138b81f380ca0f46369941cf65c4349bd4fb | [
"Apache-2.0"
] | 8 | 2021-01-31T11:30:05.000Z | 2021-09-01T07:48:34.000Z | src/interface/uiMenu.cpp | santaclose/noose | e963138b81f380ca0f46369941cf65c4349bd4fb | [
"Apache-2.0"
] | 4 | 2021-09-01T08:17:18.000Z | 2021-09-24T22:32:24.000Z | src/interface/uiMenu.cpp | santaclose/noose | e963138b81f380ca0f46369941cf65c4349bd4fb | [
"Apache-2.0"
] | 1 | 2021-09-01T07:49:58.000Z | 2021-09-01T07:49:58.000Z | #include "uiMenu.h"
#include "uiSelectionBox.h"
#include "uiNodeSystem.h"
#include "../serializer.h"
#include "../pathUtils.h"
#include <iostream>
#include <portable-file-dialogs.h>
namespace uiMenu {
sf::RenderWindow* renderWindow;
const sf::Vector2i* mouseScreenPosPointer;
uiSelectionBox selectionBox;
std::vector<std::string> selectionBoxOptions = { "Open project", "Save project", "Clear project" };
sf::Vector2f buttonCenterPos;
std::string continueMessageBoxTitle = "Alert";
std::string continueMessageBoxMessage = "The current state of the node editor will be lost, do you want to continue?";
}
void uiMenu::initialize(sf::RenderWindow& window, const sf::Vector2i* mouseScreenPosPointer)
{
renderWindow = &window;
uiMenu::mouseScreenPosPointer = mouseScreenPosPointer;
selectionBox.initialize();
}
void uiMenu::terminate()
{
selectionBox.terminate();
}
void uiMenu::onPollEvent(const sf::Event& e)
{
switch (e.type)
{
case sf::Event::MouseButtonPressed:
if (e.mouseButton.button != sf::Mouse::Left)
break;
int mouseOverIndex = selectionBox.mouseOver((sf::Vector2f)*mouseScreenPosPointer);
if (mouseOverIndex > -1)
{
switch (mouseOverIndex)
{
case 0: // load
{
if (!uiNodeSystem::isEmpty())
{
pfd::button choice = pfd::message(continueMessageBoxTitle, continueMessageBoxMessage, pfd::choice::yes_no, pfd::icon::warning).result();
if (choice == pfd::button::no)
break;
}
std::vector<std::string> selection = pfd::open_file("Open file", "", { "Noose file (.ns)", "*.ns" }).result();
if (selection.size() == 0)
{
std::cout << "[UI] File not loaded\n";
break;
}
uiNodeSystem::clearNodeSelection(); // unselect if there is a node selected
serializer::LoadFromFile(selection[0]);
break;
}
case 1: // save
{
std::string destination = pfd::save_file("Save file", "", { "Noose file (.ns)", "*.ns" }).result();
if (destination.length() == 0)
{
std::cout << "[UI] File not saved\n";
break;
}
destination = destination + (pathUtils::fileHasExtension(destination.c_str(), "ns") ? "" : ".ns");
serializer::SaveIntoFile(destination);
break;
}
case 2: // clear
{
if (!uiNodeSystem::isEmpty())
{
pfd::button choice = pfd::message(continueMessageBoxTitle, continueMessageBoxMessage, pfd::choice::yes_no, pfd::icon::warning).result();
if (choice == pfd::button::no)
break;
}
uiNodeSystem::clearNodeSelection();
uiNodeSystem::clearEverything();
break;
}
}
}
selectionBox.hide();
}
}
void uiMenu::onClickFloatingButton(const sf::Vector2f& buttonPos)
{
buttonCenterPos = buttonPos;
selectionBox.display(
buttonCenterPos,
selectionBoxOptions,
uiSelectionBox::DisplayMode::TopLeftCorner
);
}
void uiMenu::draw()
{
sf::FloatRect visibleArea(0, 0, renderWindow->getSize().x, renderWindow->getSize().y);
renderWindow->setView(sf::View(visibleArea));
sf::Vector2f mousePos = (sf::Vector2f)*mouseScreenPosPointer;
selectionBox.draw(*renderWindow, mousePos);
}
bool uiMenu::isActive()
{
return selectionBox.isVisible();
}
| 25.729508 | 141 | 0.677286 |
100dc784f0a595b54e20f57e996fb353a9a9ea32 | 13,447 | cpp | C++ | src/codec/SkBmpStandardCodec.cpp | derp-caf/external_skia | b09dc92e00edce8366085aaad7dcce94ceb11b69 | [
"BSD-3-Clause"
] | 1 | 2019-05-29T09:54:38.000Z | 2019-05-29T09:54:38.000Z | src/codec/SkBmpStandardCodec.cpp | derp-caf/external_skia | b09dc92e00edce8366085aaad7dcce94ceb11b69 | [
"BSD-3-Clause"
] | null | null | null | src/codec/SkBmpStandardCodec.cpp | derp-caf/external_skia | b09dc92e00edce8366085aaad7dcce94ceb11b69 | [
"BSD-3-Clause"
] | 8 | 2019-01-12T23:06:45.000Z | 2021-09-03T00:15:46.000Z | /*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkBmpStandardCodec.h"
#include "SkCodecPriv.h"
#include "SkColorData.h"
#include "SkStream.h"
/*
* Creates an instance of the decoder
* Called only by NewFromStream
*/
SkBmpStandardCodec::SkBmpStandardCodec(int width, int height, const SkEncodedInfo& info,
std::unique_ptr<SkStream> stream, uint16_t bitsPerPixel,
uint32_t numColors, uint32_t bytesPerColor, uint32_t offset,
SkCodec::SkScanlineOrder rowOrder,
bool isOpaque, bool inIco)
: INHERITED(width, height, info, std::move(stream), bitsPerPixel, rowOrder)
, fColorTable(nullptr)
, fNumColors(numColors)
, fBytesPerColor(bytesPerColor)
, fOffset(offset)
, fSwizzler(nullptr)
, fIsOpaque(isOpaque)
, fInIco(inIco)
, fAndMaskRowBytes(fInIco ? SkAlign4(compute_row_bytes(this->getInfo().width(), 1)) : 0)
{}
/*
* Initiates the bitmap decode
*/
SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo,
void* dst, size_t dstRowBytes,
const Options& opts,
int* rowsDecoded) {
if (opts.fSubset) {
// Subsets are not supported.
return kUnimplemented;
}
if (dstInfo.dimensions() != this->getInfo().dimensions()) {
SkCodecPrintf("Error: scaling not supported.\n");
return kInvalidScale;
}
Result result = this->prepareToDecode(dstInfo, opts);
if (kSuccess != result) {
return result;
}
int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts);
if (rows != dstInfo.height()) {
*rowsDecoded = rows;
return kIncompleteInput;
}
return kSuccess;
}
/*
* Process the color table for the bmp input
*/
bool SkBmpStandardCodec::createColorTable(SkColorType dstColorType, SkAlphaType dstAlphaType) {
// Allocate memory for color table
uint32_t colorBytes = 0;
SkPMColor colorTable[256];
if (this->bitsPerPixel() <= 8) {
// Inform the caller of the number of colors
uint32_t maxColors = 1 << this->bitsPerPixel();
// Don't bother reading more than maxColors.
const uint32_t numColorsToRead =
fNumColors == 0 ? maxColors : SkTMin(fNumColors, maxColors);
// Read the color table from the stream
colorBytes = numColorsToRead * fBytesPerColor;
std::unique_ptr<uint8_t[]> cBuffer(new uint8_t[colorBytes]);
if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) {
SkCodecPrintf("Error: unable to read color table.\n");
return false;
}
SkColorType packColorType = dstColorType;
SkAlphaType packAlphaType = dstAlphaType;
if (this->colorXform()) {
packColorType = kBGRA_8888_SkColorType;
packAlphaType = kUnpremul_SkAlphaType;
}
// Choose the proper packing function
bool isPremul = (kPremul_SkAlphaType == packAlphaType) && !fIsOpaque;
PackColorProc packARGB = choose_pack_color_proc(isPremul, packColorType);
// Fill in the color table
uint32_t i = 0;
for (; i < numColorsToRead; i++) {
uint8_t blue = get_byte(cBuffer.get(), i*fBytesPerColor);
uint8_t green = get_byte(cBuffer.get(), i*fBytesPerColor + 1);
uint8_t red = get_byte(cBuffer.get(), i*fBytesPerColor + 2);
uint8_t alpha;
if (fIsOpaque) {
alpha = 0xFF;
} else {
alpha = get_byte(cBuffer.get(), i*fBytesPerColor + 3);
}
colorTable[i] = packARGB(alpha, red, green, blue);
}
// To avoid segmentation faults on bad pixel data, fill the end of the
// color table with black. This is the same the behavior as the
// chromium decoder.
for (; i < maxColors; i++) {
colorTable[i] = SkPackARGB32NoCheck(0xFF, 0, 0, 0);
}
if (this->colorXform() && !this->xformOnDecode()) {
this->applyColorXform(colorTable, colorTable, maxColors);
}
// Set the color table
fColorTable.reset(new SkColorTable(colorTable, maxColors));
}
// Bmp-in-Ico files do not use an offset to indicate where the pixel data
// begins. Pixel data always begins immediately after the color table.
if (!fInIco) {
// Check that we have not read past the pixel array offset
if(fOffset < colorBytes) {
// This may occur on OS 2.1 and other old versions where the color
// table defaults to max size, and the bmp tries to use a smaller
// color table. This is invalid, and our decision is to indicate
// an error, rather than try to guess the intended size of the
// color table.
SkCodecPrintf("Error: pixel data offset less than color table size.\n");
return false;
}
// After reading the color table, skip to the start of the pixel array
if (stream()->skip(fOffset - colorBytes) != fOffset - colorBytes) {
SkCodecPrintf("Error: unable to skip to image data.\n");
return false;
}
}
// Return true on success
return true;
}
void SkBmpStandardCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts) {
// In the case of bmp-in-icos, we will report BGRA to the client,
// since we may be required to apply an alpha mask after the decode.
// However, the swizzler needs to know the actual format of the bmp.
SkEncodedInfo encodedInfo = this->getEncodedInfo();
if (fInIco) {
if (this->bitsPerPixel() <= 8) {
encodedInfo = SkEncodedInfo::Make(SkEncodedInfo::kPalette_Color,
encodedInfo.alpha(), this->bitsPerPixel());
} else if (this->bitsPerPixel() == 24) {
encodedInfo = SkEncodedInfo::Make(SkEncodedInfo::kBGR_Color,
SkEncodedInfo::kOpaque_Alpha, 8);
}
}
// Get a pointer to the color table if it exists
const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
SkImageInfo swizzlerInfo = dstInfo;
SkCodec::Options swizzlerOptions = opts;
if (this->colorXform()) {
swizzlerInfo = swizzlerInfo.makeColorType(kXformSrcColorType);
if (kPremul_SkAlphaType == dstInfo.alphaType()) {
swizzlerInfo = swizzlerInfo.makeAlphaType(kUnpremul_SkAlphaType);
}
swizzlerOptions.fZeroInitialized = kNo_ZeroInitialized;
}
fSwizzler = SkSwizzler::Make(encodedInfo, colorPtr, swizzlerInfo, swizzlerOptions);
SkASSERT(fSwizzler);
}
SkCodec::Result SkBmpStandardCodec::onPrepareToDecode(const SkImageInfo& dstInfo,
const SkCodec::Options& options) {
if (this->xformOnDecode()) {
this->resetXformBuffer(dstInfo.width());
}
// Create the color table if necessary and prepare the stream for decode
// Note that if it is non-NULL, inputColorCount will be modified
if (!this->createColorTable(dstInfo.colorType(), dstInfo.alphaType())) {
SkCodecPrintf("Error: could not create color table.\n");
return SkCodec::kInvalidInput;
}
// Initialize a swizzler
this->initializeSwizzler(dstInfo, options);
return SkCodec::kSuccess;
}
/*
* Performs the bitmap decoding for standard input format
*/
int SkBmpStandardCodec::decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
const Options& opts) {
// Iterate over rows of the image
const int height = dstInfo.height();
for (int y = 0; y < height; y++) {
// Read a row of the input
if (this->stream()->read(this->srcBuffer(), this->srcRowBytes()) != this->srcRowBytes()) {
SkCodecPrintf("Warning: incomplete input stream.\n");
return y;
}
// Decode the row in destination format
uint32_t row = this->getDstRow(y, dstInfo.height());
void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes);
if (this->xformOnDecode()) {
SkASSERT(this->colorXform());
fSwizzler->swizzle(this->xformBuffer(), this->srcBuffer());
this->applyColorXform(dstRow, this->xformBuffer(), fSwizzler->swizzleWidth());
} else {
fSwizzler->swizzle(dstRow, this->srcBuffer());
}
}
if (fInIco && fIsOpaque) {
const int startScanline = this->currScanline();
if (startScanline < 0) {
// We are not performing a scanline decode.
// Just decode the entire ICO mask and return.
decodeIcoMask(this->stream(), dstInfo, dst, dstRowBytes);
return height;
}
// In order to perform a scanline ICO decode, we must be able
// to skip ahead in the stream in order to apply the AND mask
// to the requested scanlines.
// We will do this by taking advantage of the fact that
// SkIcoCodec always uses a SkMemoryStream as its underlying
// representation of the stream.
const void* memoryBase = this->stream()->getMemoryBase();
SkASSERT(nullptr != memoryBase);
SkASSERT(this->stream()->hasLength());
SkASSERT(this->stream()->hasPosition());
const size_t length = this->stream()->getLength();
const size_t currPosition = this->stream()->getPosition();
// Calculate how many bytes we must skip to reach the AND mask.
const int remainingScanlines = this->getInfo().height() - startScanline - height;
const size_t bytesToSkip = remainingScanlines * this->srcRowBytes() +
startScanline * fAndMaskRowBytes;
const size_t subStreamStartPosition = currPosition + bytesToSkip;
if (subStreamStartPosition >= length) {
// FIXME: How can we indicate that this decode was actually incomplete?
return height;
}
// Create a subStream to pass to decodeIcoMask(). It is useful to encapsulate
// the memory base into a stream in order to safely handle incomplete images
// without reading out of bounds memory.
const void* subStreamMemoryBase = SkTAddOffset<const void>(memoryBase,
subStreamStartPosition);
const size_t subStreamLength = length - subStreamStartPosition;
// This call does not transfer ownership of the subStreamMemoryBase.
SkMemoryStream subStream(subStreamMemoryBase, subStreamLength, false);
// FIXME: If decodeIcoMask does not succeed, is there a way that we can
// indicate the decode was incomplete?
decodeIcoMask(&subStream, dstInfo, dst, dstRowBytes);
}
return height;
}
void SkBmpStandardCodec::decodeIcoMask(SkStream* stream, const SkImageInfo& dstInfo,
void* dst, size_t dstRowBytes) {
// BMP in ICO have transparency, so this cannot be 565. The below code depends
// on the output being an SkPMColor.
SkASSERT(kRGBA_8888_SkColorType == dstInfo.colorType() ||
kBGRA_8888_SkColorType == dstInfo.colorType() ||
kRGBA_F16_SkColorType == dstInfo.colorType());
// If we are sampling, make sure that we only mask the sampled pixels.
// We do not need to worry about sampling in the y-dimension because that
// should be handled by SkSampledCodec.
const int sampleX = fSwizzler->sampleX();
const int sampledWidth = get_scaled_dimension(this->getInfo().width(), sampleX);
const int srcStartX = get_start_coord(sampleX);
SkPMColor* dstPtr = (SkPMColor*) dst;
for (int y = 0; y < dstInfo.height(); y++) {
// The srcBuffer will at least be large enough
if (stream->read(this->srcBuffer(), fAndMaskRowBytes) != fAndMaskRowBytes) {
SkCodecPrintf("Warning: incomplete AND mask for bmp-in-ico.\n");
return;
}
auto applyMask = [dstInfo](void* dstRow, int x, uint64_t bit) {
if (kRGBA_F16_SkColorType == dstInfo.colorType()) {
uint64_t* dst64 = (uint64_t*) dstRow;
dst64[x] &= bit - 1;
} else {
uint32_t* dst32 = (uint32_t*) dstRow;
dst32[x] &= bit - 1;
}
};
int row = this->getDstRow(y, dstInfo.height());
void* dstRow = SkTAddOffset<SkPMColor>(dstPtr, row * dstRowBytes);
int srcX = srcStartX;
for (int dstX = 0; dstX < sampledWidth; dstX++) {
int quotient;
int modulus;
SkTDivMod(srcX, 8, "ient, &modulus);
uint32_t shift = 7 - modulus;
uint64_t alphaBit = (this->srcBuffer()[quotient] >> shift) & 0x1;
applyMask(dstRow, dstX, alphaBit);
srcX += sampleX;
}
}
}
uint64_t SkBmpStandardCodec::onGetFillValue(const SkImageInfo& dstInfo) const {
const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
if (colorPtr) {
return get_color_table_fill_value(dstInfo.colorType(), dstInfo.alphaType(), colorPtr, 0,
this->colorXform(), false);
}
return INHERITED::onGetFillValue(dstInfo);
}
| 39.902077 | 99 | 0.620733 |
100fc140ed2f9df5e98dd798ba9e82b3a91a8bd5 | 11,315 | cc | C++ | id_theft/functions/node_modules/grpc/deps/grpc/src/core/lib/transport/metadata_batch.cc | jluisfgarza/Id-Theft-Hack2018 | 101ef7d6d251ee1a4cd1716fb4f8f0edc31f53bf | [
"MIT"
] | null | null | null | id_theft/functions/node_modules/grpc/deps/grpc/src/core/lib/transport/metadata_batch.cc | jluisfgarza/Id-Theft-Hack2018 | 101ef7d6d251ee1a4cd1716fb4f8f0edc31f53bf | [
"MIT"
] | null | null | null | id_theft/functions/node_modules/grpc/deps/grpc/src/core/lib/transport/metadata_batch.cc | jluisfgarza/Id-Theft-Hack2018 | 101ef7d6d251ee1a4cd1716fb4f8f0edc31f53bf | [
"MIT"
] | null | null | null | /*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/lib/transport/metadata_batch.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
static void assert_valid_list(grpc_mdelem_list* list) {
#ifndef NDEBUG
grpc_linked_mdelem* l;
GPR_ASSERT((list->head == nullptr) == (list->tail == nullptr));
if (!list->head) return;
GPR_ASSERT(list->head->prev == nullptr);
GPR_ASSERT(list->tail->next == nullptr);
GPR_ASSERT((list->head == list->tail) == (list->head->next == nullptr));
size_t verified_count = 0;
for (l = list->head; l; l = l->next) {
GPR_ASSERT(!GRPC_MDISNULL(l->md));
GPR_ASSERT((l->prev == nullptr) == (l == list->head));
GPR_ASSERT((l->next == nullptr) == (l == list->tail));
if (l->next) GPR_ASSERT(l->next->prev == l);
if (l->prev) GPR_ASSERT(l->prev->next == l);
verified_count++;
}
GPR_ASSERT(list->count == verified_count);
#endif /* NDEBUG */
}
static void assert_valid_callouts(grpc_metadata_batch* batch) {
#ifndef NDEBUG
for (grpc_linked_mdelem* l = batch->list.head; l != nullptr; l = l->next) {
grpc_slice key_interned = grpc_slice_intern(GRPC_MDKEY(l->md));
grpc_metadata_batch_callouts_index callout_idx =
GRPC_BATCH_INDEX_OF(key_interned);
if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
GPR_ASSERT(batch->idx.array[callout_idx] == l);
}
grpc_slice_unref_internal(key_interned);
}
#endif
}
#ifndef NDEBUG
void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
assert_valid_list(&batch->list);
}
#endif /* NDEBUG */
void grpc_metadata_batch_init(grpc_metadata_batch* batch) {
memset(batch, 0, sizeof(*batch));
batch->deadline = GRPC_MILLIS_INF_FUTURE;
}
void grpc_metadata_batch_destroy(grpc_metadata_batch* batch) {
grpc_linked_mdelem* l;
for (l = batch->list.head; l; l = l->next) {
GRPC_MDELEM_UNREF(l->md);
}
}
grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md) {
grpc_error* out = grpc_error_set_str(
grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
grpc_slice_ref_internal(GRPC_MDKEY(md))),
GRPC_ERROR_STR_VALUE, grpc_slice_ref_internal(GRPC_MDVALUE(md)));
return out;
}
static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage)
GRPC_MUST_USE_RESULT;
static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage) {
grpc_metadata_batch_callouts_index idx =
GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
return GRPC_ERROR_NONE;
}
if (batch->idx.array[idx] == nullptr) {
if (grpc_static_callout_is_default[idx]) ++batch->list.default_count;
batch->idx.array[idx] = storage;
return GRPC_ERROR_NONE;
}
return grpc_attach_md_to_error(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"),
storage->md);
}
static void maybe_unlink_callout(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage) {
grpc_metadata_batch_callouts_index idx =
GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
return;
}
if (grpc_static_callout_is_default[idx]) --batch->list.default_count;
GPR_ASSERT(batch->idx.array[idx] != nullptr);
batch->idx.array[idx] = nullptr;
}
grpc_error* grpc_metadata_batch_add_head(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage,
grpc_mdelem elem_to_add) {
GPR_ASSERT(!GRPC_MDISNULL(elem_to_add));
storage->md = elem_to_add;
return grpc_metadata_batch_link_head(batch, storage);
}
static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
assert_valid_list(list);
GPR_ASSERT(!GRPC_MDISNULL(storage->md));
storage->prev = nullptr;
storage->next = list->head;
if (list->head != nullptr) {
list->head->prev = storage;
} else {
list->tail = storage;
}
list->head = storage;
list->count++;
assert_valid_list(list);
}
grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage) {
assert_valid_callouts(batch);
grpc_error* err = maybe_link_callout(batch, storage);
if (err != GRPC_ERROR_NONE) {
assert_valid_callouts(batch);
return err;
}
link_head(&batch->list, storage);
assert_valid_callouts(batch);
return GRPC_ERROR_NONE;
}
grpc_error* grpc_metadata_batch_add_tail(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage,
grpc_mdelem elem_to_add) {
GPR_ASSERT(!GRPC_MDISNULL(elem_to_add));
storage->md = elem_to_add;
return grpc_metadata_batch_link_tail(batch, storage);
}
static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
assert_valid_list(list);
GPR_ASSERT(!GRPC_MDISNULL(storage->md));
storage->prev = list->tail;
storage->next = nullptr;
storage->reserved = nullptr;
if (list->tail != nullptr) {
list->tail->next = storage;
} else {
list->head = storage;
}
list->tail = storage;
list->count++;
assert_valid_list(list);
}
grpc_error* grpc_metadata_batch_link_tail(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage) {
assert_valid_callouts(batch);
grpc_error* err = maybe_link_callout(batch, storage);
if (err != GRPC_ERROR_NONE) {
assert_valid_callouts(batch);
return err;
}
link_tail(&batch->list, storage);
assert_valid_callouts(batch);
return GRPC_ERROR_NONE;
}
static void unlink_storage(grpc_mdelem_list* list,
grpc_linked_mdelem* storage) {
assert_valid_list(list);
if (storage->prev != nullptr) {
storage->prev->next = storage->next;
} else {
list->head = storage->next;
}
if (storage->next != nullptr) {
storage->next->prev = storage->prev;
} else {
list->tail = storage->prev;
}
list->count--;
assert_valid_list(list);
}
void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage) {
assert_valid_callouts(batch);
maybe_unlink_callout(batch, storage);
unlink_storage(&batch->list, storage);
GRPC_MDELEM_UNREF(storage->md);
assert_valid_callouts(batch);
}
void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
grpc_slice value) {
grpc_mdelem old_mdelem = storage->md;
grpc_mdelem new_mdelem = grpc_mdelem_from_slices(
grpc_slice_ref_internal(GRPC_MDKEY(old_mdelem)), value);
storage->md = new_mdelem;
GRPC_MDELEM_UNREF(old_mdelem);
}
grpc_error* grpc_metadata_batch_substitute(grpc_metadata_batch* batch,
grpc_linked_mdelem* storage,
grpc_mdelem new_mdelem) {
assert_valid_callouts(batch);
grpc_error* error = GRPC_ERROR_NONE;
grpc_mdelem old_mdelem = storage->md;
if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
maybe_unlink_callout(batch, storage);
storage->md = new_mdelem;
error = maybe_link_callout(batch, storage);
if (error != GRPC_ERROR_NONE) {
unlink_storage(&batch->list, storage);
GRPC_MDELEM_UNREF(storage->md);
}
} else {
storage->md = new_mdelem;
}
GRPC_MDELEM_UNREF(old_mdelem);
assert_valid_callouts(batch);
return error;
}
void grpc_metadata_batch_clear(grpc_metadata_batch* batch) {
grpc_metadata_batch_destroy(batch);
grpc_metadata_batch_init(batch);
}
bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch) {
return batch->list.head == nullptr &&
batch->deadline == GRPC_MILLIS_INF_FUTURE;
}
size_t grpc_metadata_batch_size(grpc_metadata_batch* batch) {
size_t size = 0;
for (grpc_linked_mdelem* elem = batch->list.head; elem != nullptr;
elem = elem->next) {
size += GRPC_MDELEM_LENGTH(elem->md);
}
return size;
}
static void add_error(grpc_error** composite, grpc_error* error,
const char* composite_error_string) {
if (error == GRPC_ERROR_NONE) return;
if (*composite == GRPC_ERROR_NONE) {
*composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
}
*composite = grpc_error_add_child(*composite, error);
}
grpc_error* grpc_metadata_batch_filter(grpc_metadata_batch* batch,
grpc_metadata_batch_filter_func func,
void* user_data,
const char* composite_error_string) {
grpc_linked_mdelem* l = batch->list.head;
grpc_error* error = GRPC_ERROR_NONE;
while (l) {
grpc_linked_mdelem* next = l->next;
grpc_filtered_mdelem new_mdelem = func(user_data, l->md);
add_error(&error, new_mdelem.error, composite_error_string);
if (GRPC_MDISNULL(new_mdelem.md)) {
grpc_metadata_batch_remove(batch, l);
} else if (new_mdelem.md.payload != l->md.payload) {
grpc_metadata_batch_substitute(batch, l, new_mdelem.md);
}
l = next;
}
return error;
}
void grpc_metadata_batch_copy(grpc_metadata_batch* src,
grpc_metadata_batch* dst,
grpc_linked_mdelem* storage) {
grpc_metadata_batch_init(dst);
dst->deadline = src->deadline;
size_t i = 0;
for (grpc_linked_mdelem* elem = src->list.head; elem != nullptr;
elem = elem->next) {
grpc_error* error = grpc_metadata_batch_add_tail(dst, &storage[i++],
GRPC_MDELEM_REF(elem->md));
// The only way that grpc_metadata_batch_add_tail() can fail is if
// there's a duplicate entry for a callout. However, that can't be
// the case here, because we would not have been allowed to create
// a source batch that had that kind of conflict.
GPR_ASSERT(error == GRPC_ERROR_NONE);
}
}
void grpc_metadata_batch_move(grpc_metadata_batch* src,
grpc_metadata_batch* dst) {
*dst = *src;
grpc_metadata_batch_init(src);
}
| 34.287879 | 81 | 0.656209 |
10104565dabc53bdc1d26316795244b0ebfcbfa0 | 2,523 | hpp | C++ | boost/polygon/polygon.hpp | Ron2014/boost_1_48_0 | 19673f69677ffcba7c7bd6e08ec07ee3962f161c | [
"BSL-1.0"
] | 76 | 2015-01-02T10:59:25.000Z | 2022-03-08T09:43:12.000Z | boost/polygon/polygon.hpp | Ron2014/boost_1_48_0 | 19673f69677ffcba7c7bd6e08ec07ee3962f161c | [
"BSL-1.0"
] | 4 | 2015-02-19T22:30:02.000Z | 2018-08-31T14:58:05.000Z | boost/polygon/polygon.hpp | Ron2014/boost_1_48_0 | 19673f69677ffcba7c7bd6e08ec07ee3962f161c | [
"BSL-1.0"
] | 26 | 2015-02-11T15:34:54.000Z | 2021-12-02T08:20:22.000Z | /*
Copyright 2008 Intel Corporation
Use, modification and distribution are subject to 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).
*/
#ifndef BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_VERSION 014401
#include "isotropy.hpp"
//point
#include "point_data.hpp"
#include "point_traits.hpp"
#include "point_concept.hpp"
//point 3d
#include "point_3d_data.hpp"
#include "point_3d_traits.hpp"
#include "point_3d_concept.hpp"
#include "transform.hpp"
#include "detail/transform_detail.hpp"
//interval
#include "interval_data.hpp"
#include "interval_traits.hpp"
#include "interval_concept.hpp"
//rectangle
#include "rectangle_data.hpp"
#include "rectangle_traits.hpp"
#include "rectangle_concept.hpp"
//algorithms needed by polygon types
#include "detail/iterator_points_to_compact.hpp"
#include "detail/iterator_compact_to_points.hpp"
//polygons
#include "polygon_45_data.hpp"
#include "polygon_data.hpp"
#include "polygon_90_data.hpp"
#include "polygon_90_with_holes_data.hpp"
#include "polygon_45_with_holes_data.hpp"
#include "polygon_with_holes_data.hpp"
#include "polygon_traits.hpp"
//manhattan boolean algorithms
#include "detail/boolean_op.hpp"
#include "detail/polygon_formation.hpp"
#include "detail/rectangle_formation.hpp"
#include "detail/max_cover.hpp"
#include "detail/property_merge.hpp"
#include "detail/polygon_90_touch.hpp"
#include "detail/iterator_geometry_to_set.hpp"
//45 boolean op algorithms
#include "detail/boolean_op_45.hpp"
#include "detail/polygon_45_formation.hpp"
//polygon set data types
#include "polygon_90_set_data.hpp"
//polygon set trait types
#include "polygon_90_set_traits.hpp"
//polygon set concepts
#include "polygon_90_set_concept.hpp"
//boolean operator syntax
#include "detail/polygon_90_set_view.hpp"
//45 boolean op algorithms
#include "detail/polygon_45_touch.hpp"
#include "detail/property_merge_45.hpp"
#include "polygon_45_set_data.hpp"
#include "polygon_45_set_traits.hpp"
#include "polygon_45_set_concept.hpp"
#include "detail/polygon_45_set_view.hpp"
//arbitrary polygon algorithms
#include "detail/polygon_arbitrary_formation.hpp"
#include "polygon_set_data.hpp"
//general scanline
#include "detail/scan_arbitrary.hpp"
#include "polygon_set_traits.hpp"
#include "detail/polygon_set_view.hpp"
#include "polygon_set_concept.hpp"
#endif
| 27.423913 | 80 | 0.778438 |
1012ccce9c382fa36e9cfe4642d8ff08f30f8eea | 16,125 | cc | C++ | Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/rtc_base/messagequeue.cc | Yash-Wasalwar-07/Boss2D | 37c5ba0f1c83c89810359a207cabfa0905f803d2 | [
"MIT"
] | null | null | null | Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/rtc_base/messagequeue.cc | Yash-Wasalwar-07/Boss2D | 37c5ba0f1c83c89810359a207cabfa0905f803d2 | [
"MIT"
] | null | null | null | Boss2D/addon/_old/webrtc-qt5.11.2_for_boss/rtc_base/messagequeue.cc | Yash-Wasalwar-07/Boss2D | 37c5ba0f1c83c89810359a207cabfa0905f803d2 | [
"MIT"
] | null | null | null | /*
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm>
#include BOSS_WEBRTC_U_rtc_base__atomicops_h //original-code:"rtc_base/atomicops.h"
#include BOSS_WEBRTC_U_rtc_base__checks_h //original-code:"rtc_base/checks.h"
#include BOSS_WEBRTC_U_rtc_base__logging_h //original-code:"rtc_base/logging.h"
#include BOSS_WEBRTC_U_rtc_base__messagequeue_h //original-code:"rtc_base/messagequeue.h"
#include BOSS_WEBRTC_U_rtc_base__stringencode_h //original-code:"rtc_base/stringencode.h"
#include BOSS_WEBRTC_U_rtc_base__thread_h //original-code:"rtc_base/thread.h"
#include BOSS_WEBRTC_U_rtc_base__trace_event_h //original-code:"rtc_base/trace_event.h"
namespace rtc {
namespace {
const int kMaxMsgLatency = 150; // 150 ms
const int kSlowDispatchLoggingThreshold = 50; // 50 ms
class RTC_SCOPED_LOCKABLE MarkProcessingCritScope {
public:
MarkProcessingCritScope(const CriticalSection* cs, size_t* processing)
RTC_EXCLUSIVE_LOCK_FUNCTION(cs)
: cs_(cs), processing_(processing) {
cs_->Enter();
*processing_ += 1;
}
~MarkProcessingCritScope() RTC_UNLOCK_FUNCTION() {
*processing_ -= 1;
cs_->Leave();
}
private:
const CriticalSection* const cs_;
size_t* processing_;
RTC_DISALLOW_COPY_AND_ASSIGN(MarkProcessingCritScope);
};
} // namespace
//------------------------------------------------------------------
// MessageQueueManager
MessageQueueManager* MessageQueueManager::instance_ = nullptr;
MessageQueueManager* MessageQueueManager::Instance() {
// Note: This is not thread safe, but it is first called before threads are
// spawned.
if (!instance_)
instance_ = new MessageQueueManager;
return instance_;
}
bool MessageQueueManager::IsInitialized() {
return instance_ != nullptr;
}
MessageQueueManager::MessageQueueManager() : processing_(0) {}
MessageQueueManager::~MessageQueueManager() {
}
void MessageQueueManager::Add(MessageQueue *message_queue) {
return Instance()->AddInternal(message_queue);
}
void MessageQueueManager::AddInternal(MessageQueue *message_queue) {
CritScope cs(&crit_);
// Prevent changes while the list of message queues is processed.
RTC_DCHECK_EQ(processing_, 0);
message_queues_.push_back(message_queue);
}
void MessageQueueManager::Remove(MessageQueue *message_queue) {
// If there isn't a message queue manager instance, then there isn't a queue
// to remove.
if (!instance_) return;
return Instance()->RemoveInternal(message_queue);
}
void MessageQueueManager::RemoveInternal(MessageQueue *message_queue) {
// If this is the last MessageQueue, destroy the manager as well so that
// we don't leak this object at program shutdown. As mentioned above, this is
// not thread-safe, but this should only happen at program termination (when
// the ThreadManager is destroyed, and threads are no longer active).
bool destroy = false;
{
CritScope cs(&crit_);
// Prevent changes while the list of message queues is processed.
RTC_DCHECK_EQ(processing_, 0);
std::vector<MessageQueue *>::iterator iter;
iter = std::find(message_queues_.begin(), message_queues_.end(),
message_queue);
if (iter != message_queues_.end()) {
message_queues_.erase(iter);
}
destroy = message_queues_.empty();
}
if (destroy) {
instance_ = nullptr;
delete this;
}
}
void MessageQueueManager::Clear(MessageHandler *handler) {
// If there isn't a message queue manager instance, then there aren't any
// queues to remove this handler from.
if (!instance_) return;
return Instance()->ClearInternal(handler);
}
void MessageQueueManager::ClearInternal(MessageHandler *handler) {
// Deleted objects may cause re-entrant calls to ClearInternal. This is
// allowed as the list of message queues does not change while queues are
// cleared.
MarkProcessingCritScope cs(&crit_, &processing_);
std::vector<MessageQueue *>::iterator iter;
for (MessageQueue* queue : message_queues_) {
queue->Clear(handler);
}
}
void MessageQueueManager::ProcessAllMessageQueues() {
if (!instance_) {
return;
}
return Instance()->ProcessAllMessageQueuesInternal();
}
void MessageQueueManager::ProcessAllMessageQueuesInternal() {
// This works by posting a delayed message at the current time and waiting
// for it to be dispatched on all queues, which will ensure that all messages
// that came before it were also dispatched.
volatile int queues_not_done = 0;
// This class is used so that whether the posted message is processed, or the
// message queue is simply cleared, queues_not_done gets decremented.
class ScopedIncrement : public MessageData {
public:
ScopedIncrement(volatile int* value) : value_(value) {
AtomicOps::Increment(value_);
}
~ScopedIncrement() override { AtomicOps::Decrement(value_); }
private:
volatile int* value_;
};
{
MarkProcessingCritScope cs(&crit_, &processing_);
for (MessageQueue* queue : message_queues_) {
if (!queue->IsProcessingMessages()) {
// If the queue is not processing messages, it can
// be ignored. If we tried to post a message to it, it would be dropped
// or ignored.
continue;
}
queue->PostDelayed(RTC_FROM_HERE, 0, nullptr, MQID_DISPOSE,
new ScopedIncrement(&queues_not_done));
}
}
// Note: One of the message queues may have been on this thread, which is why
// we can't synchronously wait for queues_not_done to go to 0; we need to
// process messages as well.
while (AtomicOps::AcquireLoad(&queues_not_done) > 0) {
rtc::Thread::Current()->ProcessMessages(0);
}
}
//------------------------------------------------------------------
// MessageQueue
MessageQueue::MessageQueue(SocketServer* ss, bool init_queue)
: fPeekKeep_(false),
dmsgq_next_num_(0),
fInitialized_(false),
fDestroyed_(false),
stop_(0),
ss_(ss) {
RTC_DCHECK(ss);
// Currently, MessageQueue holds a socket server, and is the base class for
// Thread. It seems like it makes more sense for Thread to hold the socket
// server, and provide it to the MessageQueue, since the Thread controls
// the I/O model, and MQ is agnostic to those details. Anyway, this causes
// messagequeue_unittest to depend on network libraries... yuck.
ss_->SetMessageQueue(this);
if (init_queue) {
DoInit();
}
}
MessageQueue::MessageQueue(std::unique_ptr<SocketServer> ss, bool init_queue)
: MessageQueue(ss.get(), init_queue) {
own_ss_ = std::move(ss);
}
MessageQueue::~MessageQueue() {
DoDestroy();
}
void MessageQueue::DoInit() {
if (fInitialized_) {
return;
}
fInitialized_ = true;
MessageQueueManager::Add(this);
}
void MessageQueue::DoDestroy() {
if (fDestroyed_) {
return;
}
fDestroyed_ = true;
// The signal is done from here to ensure
// that it always gets called when the queue
// is going away.
SignalQueueDestroyed();
MessageQueueManager::Remove(this);
Clear(nullptr);
if (ss_) {
ss_->SetMessageQueue(nullptr);
}
}
SocketServer* MessageQueue::socketserver() {
return ss_;
}
void MessageQueue::WakeUpSocketServer() {
ss_->WakeUp();
}
void MessageQueue::Quit() {
AtomicOps::ReleaseStore(&stop_, 1);
WakeUpSocketServer();
}
bool MessageQueue::IsQuitting() {
return AtomicOps::AcquireLoad(&stop_) != 0;
}
bool MessageQueue::IsProcessingMessages() {
return !IsQuitting();
}
void MessageQueue::Restart() {
AtomicOps::ReleaseStore(&stop_, 0);
}
bool MessageQueue::Peek(Message *pmsg, int cmsWait) {
if (fPeekKeep_) {
*pmsg = msgPeek_;
return true;
}
if (!Get(pmsg, cmsWait))
return false;
msgPeek_ = *pmsg;
fPeekKeep_ = true;
return true;
}
bool MessageQueue::Get(Message *pmsg, int cmsWait, bool process_io) {
// Return and clear peek if present
// Always return the peek if it exists so there is Peek/Get symmetry
if (fPeekKeep_) {
*pmsg = msgPeek_;
fPeekKeep_ = false;
return true;
}
// Get w/wait + timer scan / dispatch + socket / event multiplexer dispatch
int64_t cmsTotal = cmsWait;
int64_t cmsElapsed = 0;
int64_t msStart = TimeMillis();
int64_t msCurrent = msStart;
while (true) {
// Check for sent messages
ReceiveSends();
// Check for posted events
int64_t cmsDelayNext = kForever;
bool first_pass = true;
while (true) {
// All queue operations need to be locked, but nothing else in this loop
// (specifically handling disposed message) can happen inside the crit.
// Otherwise, disposed MessageHandlers will cause deadlocks.
{
CritScope cs(&crit_);
// On the first pass, check for delayed messages that have been
// triggered and calculate the next trigger time.
if (first_pass) {
first_pass = false;
while (!dmsgq_.empty()) {
if (msCurrent < dmsgq_.top().msTrigger_) {
cmsDelayNext = TimeDiff(dmsgq_.top().msTrigger_, msCurrent);
break;
}
msgq_.push_back(dmsgq_.top().msg_);
dmsgq_.pop();
}
}
// Pull a message off the message queue, if available.
if (msgq_.empty()) {
break;
} else {
*pmsg = msgq_.front();
msgq_.pop_front();
}
} // crit_ is released here.
// Log a warning for time-sensitive messages that we're late to deliver.
if (pmsg->ts_sensitive) {
int64_t delay = TimeDiff(msCurrent, pmsg->ts_sensitive);
if (delay > 0) {
RTC_LOG_F(LS_WARNING)
<< "id: " << pmsg->message_id
<< " delay: " << (delay + kMaxMsgLatency) << "ms";
}
}
// If this was a dispose message, delete it and skip it.
if (MQID_DISPOSE == pmsg->message_id) {
RTC_DCHECK(nullptr == pmsg->phandler);
delete pmsg->pdata;
*pmsg = Message();
continue;
}
return true;
}
if (IsQuitting())
break;
// Which is shorter, the delay wait or the asked wait?
int64_t cmsNext;
if (cmsWait == kForever) {
cmsNext = cmsDelayNext;
} else {
cmsNext = std::max<int64_t>(0, cmsTotal - cmsElapsed);
if ((cmsDelayNext != kForever) && (cmsDelayNext < cmsNext))
cmsNext = cmsDelayNext;
}
{
// Wait and multiplex in the meantime
if (!ss_->Wait(static_cast<int>(cmsNext), process_io))
return false;
}
// If the specified timeout expired, return
msCurrent = TimeMillis();
cmsElapsed = TimeDiff(msCurrent, msStart);
if (cmsWait != kForever) {
if (cmsElapsed >= cmsWait)
return false;
}
}
return false;
}
void MessageQueue::ReceiveSends() {
}
void MessageQueue::Post(const Location& posted_from,
MessageHandler* phandler,
uint32_t id,
MessageData* pdata,
bool time_sensitive) {
if (IsQuitting())
return;
// Keep thread safe
// Add the message to the end of the queue
// Signal for the multiplexer to return
{
CritScope cs(&crit_);
Message msg;
msg.posted_from = posted_from;
msg.phandler = phandler;
msg.message_id = id;
msg.pdata = pdata;
if (time_sensitive) {
msg.ts_sensitive = TimeMillis() + kMaxMsgLatency;
}
msgq_.push_back(msg);
}
WakeUpSocketServer();
}
void MessageQueue::PostDelayed(const Location& posted_from,
int cmsDelay,
MessageHandler* phandler,
uint32_t id,
MessageData* pdata) {
return DoDelayPost(posted_from, cmsDelay, TimeAfter(cmsDelay), phandler, id,
pdata);
}
void MessageQueue::PostAt(const Location& posted_from,
uint32_t tstamp,
MessageHandler* phandler,
uint32_t id,
MessageData* pdata) {
// This should work even if it is used (unexpectedly).
int64_t delay = static_cast<uint32_t>(TimeMillis()) - tstamp;
return DoDelayPost(posted_from, delay, tstamp, phandler, id, pdata);
}
void MessageQueue::PostAt(const Location& posted_from,
int64_t tstamp,
MessageHandler* phandler,
uint32_t id,
MessageData* pdata) {
return DoDelayPost(posted_from, TimeUntil(tstamp), tstamp, phandler, id,
pdata);
}
void MessageQueue::DoDelayPost(const Location& posted_from,
int64_t cmsDelay,
int64_t tstamp,
MessageHandler* phandler,
uint32_t id,
MessageData* pdata) {
if (IsQuitting()) {
return;
}
// Keep thread safe
// Add to the priority queue. Gets sorted soonest first.
// Signal for the multiplexer to return.
{
CritScope cs(&crit_);
Message msg;
msg.posted_from = posted_from;
msg.phandler = phandler;
msg.message_id = id;
msg.pdata = pdata;
DelayedMessage dmsg(cmsDelay, tstamp, dmsgq_next_num_, msg);
dmsgq_.push(dmsg);
// If this message queue processes 1 message every millisecond for 50 days,
// we will wrap this number. Even then, only messages with identical times
// will be misordered, and then only briefly. This is probably ok.
++dmsgq_next_num_;
RTC_DCHECK_NE(0, dmsgq_next_num_);
}
WakeUpSocketServer();
}
int MessageQueue::GetDelay() {
CritScope cs(&crit_);
if (!msgq_.empty())
return 0;
if (!dmsgq_.empty()) {
int delay = TimeUntil(dmsgq_.top().msTrigger_);
if (delay < 0)
delay = 0;
return delay;
}
return kForever;
}
void MessageQueue::Clear(MessageHandler* phandler,
uint32_t id,
MessageList* removed) {
CritScope cs(&crit_);
// Remove messages with phandler
if (fPeekKeep_ && msgPeek_.Match(phandler, id)) {
if (removed) {
removed->push_back(msgPeek_);
} else {
delete msgPeek_.pdata;
}
fPeekKeep_ = false;
}
// Remove from ordered message queue
for (MessageList::iterator it = msgq_.begin(); it != msgq_.end();) {
if (it->Match(phandler, id)) {
if (removed) {
removed->push_back(*it);
} else {
delete it->pdata;
}
it = msgq_.erase(it);
} else {
++it;
}
}
// Remove from priority queue. Not directly iterable, so use this approach
PriorityQueue::container_type::iterator new_end = dmsgq_.container().begin();
for (PriorityQueue::container_type::iterator it = new_end;
it != dmsgq_.container().end(); ++it) {
if (it->msg_.Match(phandler, id)) {
if (removed) {
removed->push_back(it->msg_);
} else {
delete it->msg_.pdata;
}
} else {
*new_end++ = *it;
}
}
dmsgq_.container().erase(new_end, dmsgq_.container().end());
dmsgq_.reheap();
}
void MessageQueue::Dispatch(Message *pmsg) {
TRACE_EVENT2("webrtc", "MessageQueue::Dispatch", "src_file_and_line",
pmsg->posted_from.file_and_line(), "src_func",
pmsg->posted_from.function_name());
int64_t start_time = TimeMillis();
pmsg->phandler->OnMessage(pmsg);
int64_t end_time = TimeMillis();
int64_t diff = TimeDiff(end_time, start_time);
if (diff >= kSlowDispatchLoggingThreshold) {
RTC_LOG(LS_INFO) << "Message took " << diff
<< "ms to dispatch. Posted from: "
<< pmsg->posted_from.ToString();
}
}
} // namespace rtc
| 29.750923 | 89 | 0.642543 |
1013d979cb9a05c9b3343497013e27b161b94ddc | 17,443 | cpp | C++ | mplapack/reference/Rorbdb.cpp | Ndersam/mplapack | f2ef54d7ce95e4028d3f101a901c75d18d3f1327 | [
"BSD-3-Clause-Open-MPI"
] | 26 | 2019-03-20T04:06:03.000Z | 2022-03-02T10:21:01.000Z | mplapack/reference/Rorbdb.cpp | Ndersam/mplapack | f2ef54d7ce95e4028d3f101a901c75d18d3f1327 | [
"BSD-3-Clause-Open-MPI"
] | 5 | 2019-03-04T03:32:41.000Z | 2021-12-01T07:47:25.000Z | mplapack/reference/Rorbdb.cpp | Ndersam/mplapack | f2ef54d7ce95e4028d3f101a901c75d18d3f1327 | [
"BSD-3-Clause-Open-MPI"
] | 5 | 2019-03-09T17:50:26.000Z | 2022-03-10T19:46:20.000Z | /*
* Copyright (c) 2021
* Nakata, Maho
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <mpblas.h>
#include <mplapack.h>
void Rorbdb(const char *trans, const char *signs, INTEGER const m, INTEGER const p, INTEGER const q, REAL *x11, INTEGER const ldx11, REAL *x12, INTEGER const ldx12, REAL *x21, INTEGER const ldx21, REAL *x22, INTEGER const ldx22, REAL *theta, REAL *phi, REAL *taup1, REAL *taup2, REAL *tauq1, REAL *tauq2, REAL *work, INTEGER const lwork, INTEGER &info) {
//
// Test input arguments
//
#if defined ___MPLAPACK_BUILD_WITH_GMP___
printf("MPLAPACK ERROR Rorbdb.cpp is not supported for GMP\n");
exit(1);
#endif
info = 0;
bool colmajor = !Mlsame(trans, "T");
const REAL realone = 1.0;
REAL z1 = 0.0;
REAL z2 = 0.0;
REAL z3 = 0.0;
REAL z4 = 0.0;
if (!Mlsame(signs, "O")) {
z1 = realone;
z2 = realone;
z3 = realone;
z4 = realone;
} else {
z1 = realone;
z2 = -realone;
z3 = realone;
z4 = -realone;
}
bool lquery = lwork == -1;
//
if (m < 0) {
info = -3;
} else if (p < 0 || p > m) {
info = -4;
} else if (q < 0 || q > p || q > m - p || q > m - q) {
info = -5;
} else if (colmajor && ldx11 < max((INTEGER)1, p)) {
info = -7;
} else if (!colmajor && ldx11 < max((INTEGER)1, q)) {
info = -7;
} else if (colmajor && ldx12 < max((INTEGER)1, p)) {
info = -9;
} else if (!colmajor && ldx12 < max((INTEGER)1, m - q)) {
info = -9;
} else if (colmajor && ldx21 < max((INTEGER)1, m - p)) {
info = -11;
} else if (!colmajor && ldx21 < max((INTEGER)1, q)) {
info = -11;
} else if (colmajor && ldx22 < max((INTEGER)1, m - p)) {
info = -13;
} else if (!colmajor && ldx22 < max((INTEGER)1, m - q)) {
info = -13;
}
//
// Compute workspace
//
INTEGER lworkopt = 0;
INTEGER lworkmin = 0;
if (info == 0) {
lworkopt = m - q;
lworkmin = m - q;
work[1 - 1] = lworkopt;
if (lwork < lworkmin && !lquery) {
info = -21;
}
}
if (info != 0) {
Mxerbla("xORBDB", -info);
return;
} else if (lquery) {
return;
}
//
// Handle column-major and row-major separately
//
INTEGER i = 0;
const REAL one = 1.0;
if (colmajor) {
//
// Reduce columns 1, ..., Q of X11, X12, X21, and X22
//
for (i = 1; i <= q; i = i + 1) {
//
if (i == 1) {
Rscal(p - i + 1, z1, &x11[(i - 1) + (i - 1) * ldx11], 1);
} else {
Rscal(p - i + 1, z1 * cos(phi[(i - 1) - 1]), &x11[(i - 1) + (i - 1) * ldx11], 1);
Raxpy(p - i + 1, -z1 * z3 * z4 * sin(phi[(i - 1) - 1]), &x12[(i - 1) + ((i - 1) - 1) * ldx12], 1, &x11[(i - 1) + (i - 1) * ldx11], 1);
}
if (i == 1) {
Rscal(m - p - i + 1, z2, &x21[(i - 1) + (i - 1) * ldx21], 1);
} else {
Rscal(m - p - i + 1, z2 * cos(phi[(i - 1) - 1]), &x21[(i - 1) + (i - 1) * ldx21], 1);
Raxpy(m - p - i + 1, -z2 * z3 * z4 * sin(phi[(i - 1) - 1]), &x22[(i - 1) + ((i - 1) - 1) * ldx22], 1, &x21[(i - 1) + (i - 1) * ldx21], 1);
}
//
theta[i - 1] = atan2(Rnrm2(m - p - i + 1, &x21[(i - 1) + (i - 1) * ldx21], 1), Rnrm2(p - i + 1, &x11[(i - 1) + (i - 1) * ldx11], 1));
//
if (p > i) {
Rlarfgp(p - i + 1, x11[(i - 1) + (i - 1) * ldx11], &x11[((i + 1) - 1) + (i - 1) * ldx11], 1, taup1[i - 1]);
} else if (p == i) {
Rlarfgp(p - i + 1, x11[(i - 1) + (i - 1) * ldx11], &x11[(i - 1) + (i - 1) * ldx11], 1, taup1[i - 1]);
}
x11[(i - 1) + (i - 1) * ldx11] = one;
if (m - p > i) {
Rlarfgp(m - p - i + 1, x21[(i - 1) + (i - 1) * ldx21], &x21[((i + 1) - 1) + (i - 1) * ldx21], 1, taup2[i - 1]);
} else if (m - p == i) {
Rlarfgp(m - p - i + 1, x21[(i - 1) + (i - 1) * ldx21], &x21[(i - 1) + (i - 1) * ldx21], 1, taup2[i - 1]);
}
x21[(i - 1) + (i - 1) * ldx21] = one;
//
if (q > i) {
Rlarf("L", p - i + 1, q - i, &x11[(i - 1) + (i - 1) * ldx11], 1, taup1[i - 1], &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11, work);
}
if (m - q + 1 > i) {
Rlarf("L", p - i + 1, m - q - i + 1, &x11[(i - 1) + (i - 1) * ldx11], 1, taup1[i - 1], &x12[(i - 1) + (i - 1) * ldx12], ldx12, work);
}
if (q > i) {
Rlarf("L", m - p - i + 1, q - i, &x21[(i - 1) + (i - 1) * ldx21], 1, taup2[i - 1], &x21[(i - 1) + ((i + 1) - 1) * ldx21], ldx21, work);
}
if (m - q + 1 > i) {
Rlarf("L", m - p - i + 1, m - q - i + 1, &x21[(i - 1) + (i - 1) * ldx21], 1, taup2[i - 1], &x22[(i - 1) + (i - 1) * ldx22], ldx22, work);
}
//
if (i < q) {
Rscal(q - i, -z1 * z3 * sin(theta[i - 1]), &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11);
Raxpy(q - i, z2 * z3 * cos(theta[i - 1]), &x21[(i - 1) + ((i + 1) - 1) * ldx21], ldx21, &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11);
}
Rscal(m - q - i + 1, -z1 * z4 * sin(theta[i - 1]), &x12[(i - 1) + (i - 1) * ldx12], ldx12);
Raxpy(m - q - i + 1, z2 * z4 * cos(theta[i - 1]), &x22[(i - 1) + (i - 1) * ldx22], ldx22, &x12[(i - 1) + (i - 1) * ldx12], ldx12);
//
if (i < q) {
phi[i - 1] = atan2(Rnrm2(q - i, &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11), Rnrm2(m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], ldx12));
}
//
if (i < q) {
if (q - i == 1) {
Rlarfgp(q - i, x11[(i - 1) + ((i + 1) - 1) * ldx11], &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11, tauq1[i - 1]);
} else {
Rlarfgp(q - i, x11[(i - 1) + ((i + 1) - 1) * ldx11], &x11[(i - 1) + ((i + 2) - 1) * ldx11], ldx11, tauq1[i - 1]);
}
x11[(i - 1) + ((i + 1) - 1) * ldx11] = one;
}
if (q + i - 1 < m) {
if (m - q == i) {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1]);
} else {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[(i - 1) + ((i + 1) - 1) * ldx12], ldx12, tauq2[i - 1]);
}
}
x12[(i - 1) + (i - 1) * ldx12] = one;
//
if (i < q) {
Rlarf("R", p - i, q - i, &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11, tauq1[i - 1], &x11[((i + 1) - 1) + ((i + 1) - 1) * ldx11], ldx11, work);
Rlarf("R", m - p - i, q - i, &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11, tauq1[i - 1], &x21[((i + 1) - 1) + ((i + 1) - 1) * ldx21], ldx21, work);
}
if (p > i) {
Rlarf("R", p - i, m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1], &x12[((i + 1) - 1) + (i - 1) * ldx12], ldx12, work);
}
if (m - p > i) {
Rlarf("R", m - p - i, m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1], &x22[((i + 1) - 1) + (i - 1) * ldx22], ldx22, work);
}
//
}
//
// Reduce columns Q + 1, ..., P of X12, X22
//
for (i = q + 1; i <= p; i = i + 1) {
//
Rscal(m - q - i + 1, -z1 * z4, &x12[(i - 1) + (i - 1) * ldx12], ldx12);
if (i >= m - q) {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1]);
} else {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[(i - 1) + ((i + 1) - 1) * ldx12], ldx12, tauq2[i - 1]);
}
x12[(i - 1) + (i - 1) * ldx12] = one;
//
if (p > i) {
Rlarf("R", p - i, m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1], &x12[((i + 1) - 1) + (i - 1) * ldx12], ldx12, work);
}
if (m - p - q >= 1) {
Rlarf("R", m - p - q, m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], ldx12, tauq2[i - 1], &x22[((q + 1) - 1) + (i - 1) * ldx22], ldx22, work);
}
//
}
//
// Reduce columns P + 1, ..., M - Q of X12, X22
//
for (i = 1; i <= m - p - q; i = i + 1) {
//
Rscal(m - p - q - i + 1, z2 * z4, &x22[((q + i) - 1) + ((p + i) - 1) * ldx22], ldx22);
if (i == m - p - q) {
Rlarfgp(m - p - q - i + 1, x22[((q + i) - 1) + ((p + i) - 1) * ldx22], &x22[((q + i) - 1) + ((p + i) - 1) * ldx22], ldx22, tauq2[(p + i) - 1]);
} else {
Rlarfgp(m - p - q - i + 1, x22[((q + i) - 1) + ((p + i) - 1) * ldx22], &x22[((q + i) - 1) + ((p + i + 1) - 1) * ldx22], ldx22, tauq2[(p + i) - 1]);
}
x22[((q + i) - 1) + ((p + i) - 1) * ldx22] = one;
if (i < m - p - q) {
Rlarf("R", m - p - q - i, m - p - q - i + 1, &x22[((q + i) - 1) + ((p + i) - 1) * ldx22], ldx22, tauq2[(p + i) - 1], &x22[((q + i + 1) - 1) + ((p + i) - 1) * ldx22], ldx22, work);
}
//
}
//
} else {
//
// Reduce columns 1, ..., Q of X11, X12, X21, X22
//
for (i = 1; i <= q; i = i + 1) {
//
if (i == 1) {
Rscal(p - i + 1, z1, &x11[(i - 1) + (i - 1) * ldx11], ldx11);
} else {
Rscal(p - i + 1, z1 * cos(phi[(i - 1) - 1]), &x11[(i - 1) + (i - 1) * ldx11], ldx11);
Raxpy(p - i + 1, -z1 * z3 * z4 * sin(phi[(i - 1) - 1]), &x12[((i - 1) - 1) + (i - 1) * ldx12], ldx12, &x11[(i - 1) + (i - 1) * ldx11], ldx11);
}
if (i == 1) {
Rscal(m - p - i + 1, z2, &x21[(i - 1) + (i - 1) * ldx21], ldx21);
} else {
Rscal(m - p - i + 1, z2 * cos(phi[(i - 1) - 1]), &x21[(i - 1) + (i - 1) * ldx21], ldx21);
Raxpy(m - p - i + 1, -z2 * z3 * z4 * sin(phi[(i - 1) - 1]), &x22[((i - 1) - 1) + (i - 1) * ldx22], ldx22, &x21[(i - 1) + (i - 1) * ldx21], ldx21);
}
//
theta[i - 1] = atan2(Rnrm2(m - p - i + 1, &x21[(i - 1) + (i - 1) * ldx21], ldx21), Rnrm2(p - i + 1, &x11[(i - 1) + (i - 1) * ldx11], ldx11));
//
Rlarfgp(p - i + 1, x11[(i - 1) + (i - 1) * ldx11], &x11[(i - 1) + ((i + 1) - 1) * ldx11], ldx11, taup1[i - 1]);
x11[(i - 1) + (i - 1) * ldx11] = one;
if (i == m - p) {
Rlarfgp(m - p - i + 1, x21[(i - 1) + (i - 1) * ldx21], &x21[(i - 1) + (i - 1) * ldx21], ldx21, taup2[i - 1]);
} else {
Rlarfgp(m - p - i + 1, x21[(i - 1) + (i - 1) * ldx21], &x21[(i - 1) + ((i + 1) - 1) * ldx21], ldx21, taup2[i - 1]);
}
x21[(i - 1) + (i - 1) * ldx21] = one;
//
if (q > i) {
Rlarf("R", q - i, p - i + 1, &x11[(i - 1) + (i - 1) * ldx11], ldx11, taup1[i - 1], &x11[((i + 1) - 1) + (i - 1) * ldx11], ldx11, work);
}
if (m - q + 1 > i) {
Rlarf("R", m - q - i + 1, p - i + 1, &x11[(i - 1) + (i - 1) * ldx11], ldx11, taup1[i - 1], &x12[(i - 1) + (i - 1) * ldx12], ldx12, work);
}
if (q > i) {
Rlarf("R", q - i, m - p - i + 1, &x21[(i - 1) + (i - 1) * ldx21], ldx21, taup2[i - 1], &x21[((i + 1) - 1) + (i - 1) * ldx21], ldx21, work);
}
if (m - q + 1 > i) {
Rlarf("R", m - q - i + 1, m - p - i + 1, &x21[(i - 1) + (i - 1) * ldx21], ldx21, taup2[i - 1], &x22[(i - 1) + (i - 1) * ldx22], ldx22, work);
}
//
if (i < q) {
Rscal(q - i, -z1 * z3 * sin(theta[i - 1]), &x11[((i + 1) - 1) + (i - 1) * ldx11], 1);
Raxpy(q - i, z2 * z3 * cos(theta[i - 1]), &x21[((i + 1) - 1) + (i - 1) * ldx21], 1, &x11[((i + 1) - 1) + (i - 1) * ldx11], 1);
}
Rscal(m - q - i + 1, -z1 * z4 * sin(theta[i - 1]), &x12[(i - 1) + (i - 1) * ldx12], 1);
Raxpy(m - q - i + 1, z2 * z4 * cos(theta[i - 1]), &x22[(i - 1) + (i - 1) * ldx22], 1, &x12[(i - 1) + (i - 1) * ldx12], 1);
//
if (i < q) {
phi[i - 1] = atan2(Rnrm2(q - i, &x11[((i + 1) - 1) + (i - 1) * ldx11], 1), Rnrm2(m - q - i + 1, &x12[(i - 1) + (i - 1) * ldx12], 1));
}
//
if (i < q) {
if (q - i == 1) {
Rlarfgp(q - i, x11[((i + 1) - 1) + (i - 1) * ldx11], &x11[((i + 1) - 1) + (i - 1) * ldx11], 1, tauq1[i - 1]);
} else {
Rlarfgp(q - i, x11[((i + 1) - 1) + (i - 1) * ldx11], &x11[((i + 2) - 1) + (i - 1) * ldx11], 1, tauq1[i - 1]);
}
x11[((i + 1) - 1) + (i - 1) * ldx11] = one;
}
if (m - q > i) {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[((i + 1) - 1) + (i - 1) * ldx12], 1, tauq2[i - 1]);
} else {
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[(i - 1) + (i - 1) * ldx12], 1, tauq2[i - 1]);
}
x12[(i - 1) + (i - 1) * ldx12] = one;
//
if (i < q) {
Rlarf("L", q - i, p - i, &x11[((i + 1) - 1) + (i - 1) * ldx11], 1, tauq1[i - 1], &x11[((i + 1) - 1) + ((i + 1) - 1) * ldx11], ldx11, work);
Rlarf("L", q - i, m - p - i, &x11[((i + 1) - 1) + (i - 1) * ldx11], 1, tauq1[i - 1], &x21[((i + 1) - 1) + ((i + 1) - 1) * ldx21], ldx21, work);
}
Rlarf("L", m - q - i + 1, p - i, &x12[(i - 1) + (i - 1) * ldx12], 1, tauq2[i - 1], &x12[(i - 1) + ((i + 1) - 1) * ldx12], ldx12, work);
if (m - p - i > 0) {
Rlarf("L", m - q - i + 1, m - p - i, &x12[(i - 1) + (i - 1) * ldx12], 1, tauq2[i - 1], &x22[(i - 1) + ((i + 1) - 1) * ldx22], ldx22, work);
}
//
}
//
// Reduce columns Q + 1, ..., P of X12, X22
//
for (i = q + 1; i <= p; i = i + 1) {
//
Rscal(m - q - i + 1, -z1 * z4, &x12[(i - 1) + (i - 1) * ldx12], 1);
Rlarfgp(m - q - i + 1, x12[(i - 1) + (i - 1) * ldx12], &x12[((i + 1) - 1) + (i - 1) * ldx12], 1, tauq2[i - 1]);
x12[(i - 1) + (i - 1) * ldx12] = one;
//
if (p > i) {
Rlarf("L", m - q - i + 1, p - i, &x12[(i - 1) + (i - 1) * ldx12], 1, tauq2[i - 1], &x12[(i - 1) + ((i + 1) - 1) * ldx12], ldx12, work);
}
if (m - p - q >= 1) {
Rlarf("L", m - q - i + 1, m - p - q, &x12[(i - 1) + (i - 1) * ldx12], 1, tauq2[i - 1], &x22[(i - 1) + ((q + 1) - 1) * ldx22], ldx22, work);
}
//
}
//
// Reduce columns P + 1, ..., M - Q of X12, X22
//
for (i = 1; i <= m - p - q; i = i + 1) {
//
Rscal(m - p - q - i + 1, z2 * z4, &x22[((p + i) - 1) + ((q + i) - 1) * ldx22], 1);
if (m - p - q == i) {
Rlarfgp(m - p - q - i + 1, x22[((p + i) - 1) + ((q + i) - 1) * ldx22], &x22[((p + i) - 1) + ((q + i) - 1) * ldx22], 1, tauq2[(p + i) - 1]);
} else {
Rlarfgp(m - p - q - i + 1, x22[((p + i) - 1) + ((q + i) - 1) * ldx22], &x22[((p + i + 1) - 1) + ((q + i) - 1) * ldx22], 1, tauq2[(p + i) - 1]);
Rlarf("L", m - p - q - i + 1, m - p - q - i, &x22[((p + i) - 1) + ((q + i) - 1) * ldx22], 1, tauq2[(p + i) - 1], &x22[((p + i) - 1) + ((q + i + 1) - 1) * ldx22], ldx22, work);
}
x22[((p + i) - 1) + ((q + i) - 1) * ldx22] = one;
//
}
//
}
//
// End of Rorbdb
//
}
| 49.837143 | 354 | 0.362495 |
1014af167428fc32c22c10b42218f1bb5ed96ed9 | 4,051 | cpp | C++ | src/ftxui/component/radiobox_test.cpp | AetherealLlama/FTXUI | a56bb50807a6cdb9c7ad8b9851da98b3086beee1 | [
"MIT"
] | null | null | null | src/ftxui/component/radiobox_test.cpp | AetherealLlama/FTXUI | a56bb50807a6cdb9c7ad8b9851da98b3086beee1 | [
"MIT"
] | null | null | null | src/ftxui/component/radiobox_test.cpp | AetherealLlama/FTXUI | a56bb50807a6cdb9c7ad8b9851da98b3086beee1 | [
"MIT"
] | null | null | null | #include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApiResolver, TestFactoryImpl
#include <memory> // for __shared_ptr_access, shared_ptr, allocator
#include <string> // for wstring, basic_string
#include <vector> // for vector
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Radiobox
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/event.hpp" // for Event, Event::Return, Event::ArrowDown, Event::ArrowUp, Event::Tab, Event::TabReverse
#include "gtest/gtest_pred_impl.h" // for EXPECT_EQ, Test, TEST
using namespace ftxui;
TEST(RadioboxTest, Navigation) {
int selected = 0;
std::vector<std::wstring> entries = {L"1", L"2", L"3"};
auto radiobox = Radiobox(&entries, &selected);
// With arrow key.
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
// With vim like characters.
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::Character('j'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::Character('j'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::Character('j'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::Character('k'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::Character('k'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::Character('k'));
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
// With more entries
entries = {L"1", L"2", L"3"};
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::ArrowDown);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::ArrowUp);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
// With tab.
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::Tab);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::Tab);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::Tab);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::Tab);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::Tab);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::TabReverse);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::TabReverse);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 0);
radiobox->OnEvent(Event::TabReverse);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 2);
radiobox->OnEvent(Event::TabReverse);
radiobox->OnEvent(Event::Return);
EXPECT_EQ(selected, 1);
radiobox->OnEvent(Event::TabReverse);
radiobox->OnEvent(Event::Return);
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
| 33.758333 | 130 | 0.712417 |
1015da01c8a857b469a67c3e3b264bc09c66e4b4 | 1,051 | cpp | C++ | move_ptr/main.cpp | Kevingaow/cpp11_new_feature | 39d8c2c33eed12eaeca45bc51e19d0b80079d594 | [
"Apache-2.0"
] | null | null | null | move_ptr/main.cpp | Kevingaow/cpp11_new_feature | 39d8c2c33eed12eaeca45bc51e19d0b80079d594 | [
"Apache-2.0"
] | null | null | null | move_ptr/main.cpp | Kevingaow/cpp11_new_feature | 39d8c2c33eed12eaeca45bc51e19d0b80079d594 | [
"Apache-2.0"
] | null | null | null | #include <iostream>
using namespace std;
#define MOVE_CTOR
class MovePtr {
public:
MovePtr() : d(new int(0)) {
cout << "ctor:" << ++n_ctor << endl;
}
MovePtr(const MovePtr& m) : d(new int(*(m.d))) {
cout << "copy ctor:" << ++n_cptr << endl;
}
#ifdef MOVE_CTOR
MovePtr(MovePtr&& m) : d(m.d) {
m.d = nullptr;
cout << "move ctor:" << ++n_mtor << endl;
}
#endif
~MovePtr() {
delete d;
cout << "dtor:" << ++n_dtor << endl;
}
static int n_ctor;
static int n_cptr;
static int n_dtor;
#ifdef MOVE_CTOR
static int n_mtor;
#endif
int* d;
};
int MovePtr::n_ctor = 0;
int MovePtr::n_cptr = 0;
int MovePtr::n_dtor = 0;
#ifdef MOVE_CTOR
int MovePtr::n_mtor = 0;
#endif
MovePtr getMovePtr() {
#ifdef MOVE_CTOR
MovePtr m1;
cout << "m1.d:" << hex << m1.d << endl;
return m1;
#else
MovePtr a1;
MovePtr a2(a1);
return a2;
#endif
}
int main() {
MovePtr mp = getMovePtr();
cout << "mp.d:" << hex << mp.d << endl;
return 0;
}
| 16.68254 | 52 | 0.543292 |
101677ac55f15a407b8f28b15dee4bc3c4e9a638 | 11,440 | cpp | C++ | SDK/platform/nxp_kinetis_e/driver/wdog.cpp | ghsecuritylab/CppSDK | 50da768a887241d4e670b3ef73c041b21645620e | [
"Unlicense"
] | 1 | 2019-12-15T12:26:52.000Z | 2019-12-15T12:26:52.000Z | SDK/platform/nxp_kinetis_e/driver/wdog.cpp | ghsecuritylab/CppSDK | 50da768a887241d4e670b3ef73c041b21645620e | [
"Unlicense"
] | null | null | null | SDK/platform/nxp_kinetis_e/driver/wdog.cpp | ghsecuritylab/CppSDK | 50da768a887241d4e670b3ef73c041b21645620e | [
"Unlicense"
] | 1 | 2020-03-07T20:47:45.000Z | 2020-03-07T20:47:45.000Z |
/******************************************************************************
*
* Freescale Semiconductor Inc.
* (c) Copyright 2013 Freescale Semiconductor, Inc.
* ALL RIGHTS RESERVED.
*
***************************************************************************
*
* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************//*!
*
* @file wdog.c
*
* @author Freescale
*
*
* @brief Provide common watchdog module routines.
*
******************************************************************************/
#include "wdog.h"
#include <include/derivative.h>
#include "nvic.h"
/******************************************************************************
* Global variables
******************************************************************************/
/******************************************************************************
* Constants and macros
******************************************************************************/
#define DisableInterrupts asm(" CPSID i");
#define EnableInterrupts asm(" CPSIE i");
/******************************************************************************
* Local types
******************************************************************************/
/******************************************************************************
* Local function prototypes
******************************************************************************/
/******************************************************************************
* Local variables
******************************************************************************/
/*!
* @brief global variable to store RTC callbacks.
*
*/
WDOG_CallbackType WDOG_Callback[1] = {(WDOG_CallbackType)(0)}; /*!< WDOG initial callback */
/******************************************************************************
* Local functions
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
void WDOG_IRQHandler(void);
#ifdef __cplusplus
}
#endif
/******************************************************************************
* Global functions
******************************************************************************/
/******************************************************************************
* define watchdog API list
*
*//*! @addtogroup wdog_api_list
* @{
*******************************************************************************/
/*****************************************************************************//*!
*
* @brief Watchdog timer disable routine.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @see WDOG_Enable
*****************************************************************************/
void WDOG_Disable(void)
{
uint8_t u8Cs1 = WDOG->CS1;
uint8_t u8Cs2 = WDOG->CS2;
uint16_t u16TOVAL = WDOG->TOVAL;
uint16_t u16WIN = WDOG->WIN;
u8Cs1 &= ~WDOG_CS1_EN_MASK;
/* First unlock the watchdog so that we can write to registers */
WDOG_Unlock();
WDOG->CS2 = u8Cs2;
WDOG->TOVAL = u16TOVAL;
WDOG->WIN = u16WIN;
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief Watchdog timer disable routine with update enabled.
*
* Disable watchdog but the watchdog can be enabled and updated later.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @see WDOG_Enable
*****************************************************************************/
void WDOG_DisableWDOGEnableUpdate(void)
{
uint8_t u8Cs1 = WDOG->CS1;
uint8_t u8Cs2 = WDOG->CS2;
uint16_t u16TOVAL = WDOG->TOVAL;
uint16_t u16WIN = WDOG->WIN;
u8Cs1 &= ~WDOG_CS1_EN_MASK;
u8Cs1 |= WDOG_CS1_UPDATE_MASK;
/* First unlock the watchdog so that we can write to registers */
WDOG_Unlock();
WDOG->CS2 = u8Cs2;
WDOG->TOVAL = u16TOVAL;
WDOG->WIN = u16WIN;
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief Watchdog timer enable routine.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @see WDOG_Disable
*****************************************************************************/
void WDOG_Enable(void)
{
uint8_t u8Cs1 = WDOG->CS1;
u8Cs1 |= WDOG_CS1_EN_MASK;
/* First unlock the watchdog so that we can write to registers */
WDOG_Unlock();
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief initialize watchdog.
*
* @param[in] pConfig poiner to watchdog configuration strcture.
*
* @return none
*
* @ Pass/ Fail criteria: none
*
* @warning make sure that WDOG is not initialized after reset or WDOG update is enabled
* after reset by calling WDOG_EnableUpdate / WDOG_DisableWDOGEnableUpdate.
*
* @see WDOG_EnableUpdate, WDOG_DisableWDOGEnableUpdate
*
*****************************************************************************/
void WDOG_Init(WDOG_ConfigPtr pConfig)
{
uint8_t u8Cs1;
uint8_t u8Cs2;
uint16_t u16Toval;
uint16_t u16Win;
u8Cs1 = 0x80; /* default CS1 register value */
u8Cs2 = 0;
u16Toval = pConfig->u16TimeOut;
u16Win = pConfig->u16WinTime;
if(pConfig->sBits.bDisable)
{
u8Cs1 &= ~WDOG_CS1_EN_MASK;
}
else
{
u8Cs1 |= WDOG_CS1_EN_MASK;
}
if(pConfig->sBits.bIntEnable)
{
u8Cs1 |= WDOG_CS1_INT_MASK;
Enable_Interrupt(WDOG_IRQn);
}
else
{
u8Cs1 &= ~WDOG_CS1_INT_MASK;
Disable_Interrupt(WDOG_IRQn);
}
if(pConfig->sBits.bStopEnable)
{
u8Cs1 |= WDOG_CS1_STOP_MASK;
}
else
{
u8Cs1 &= ~WDOG_CS1_STOP_MASK;
}
if(pConfig->sBits.bDbgEnable)
{
u8Cs1 |= WDOG_CS1_DBG_MASK;
}
else
{
u8Cs1 &= ~WDOG_CS1_DBG_MASK;
}
if(pConfig->sBits.bWaitEnable)
{
u8Cs1 |= WDOG_CS1_WAIT_MASK;
}
else
{
u8Cs1 &= ~WDOG_CS1_WAIT_MASK;
}
if(pConfig->sBits.bUpdateEnable)
{
u8Cs1 |= WDOG_CS1_UPDATE_MASK;
}
else
{
u8Cs1 &= ~WDOG_CS1_UPDATE_MASK;
}
if(pConfig->sBits.bWinEnable)
{
u8Cs2 |= WDOG_CS2_WIN_MASK;
}
else
{
u8Cs2 &= ~WDOG_CS2_WIN_MASK;
}
if(pConfig->sBits.bPrescaler)
{
u8Cs2 |= WDOG_CS2_PRES_MASK;
}
u8Cs2 |= (pConfig->sBits.bClkSrc & 0x03);
/* write regisers */
WDOG_Unlock(); /* unlock watchdog first */
WDOG->CS2 = u8Cs2;
WDOG->TOVAL8B.TOVALL = u16Toval;
WDOG->TOVAL8B.TOVALH = u16Toval >> 8;
WDOG->WIN8B.WINL = u16Win;
WDOG->WIN8B.WINH = u16Win >> 8;
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief initialize watchdog to the default state.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @warning make sure that WDOG update is enabled after reset by calling WDOG_EnableUpdate.
* or by calling WDOG_DisableWDOGEnableUpdate.
*
* @see WDOG_DisableWDOGEnableUpdate, WDOG_EnableUpdate
*
*****************************************************************************/
void WDOG_DeInit(void)
{
WDOG_Unlock();
WDOG->CS2 = WDOG_CS2_DEFAULT_VALUE;
WDOG->TOVAL = WDOG_TOVAL_DEFAULT_VALUE;
WDOG->WIN = WDOG_WIN_DEFAULT_VALUE;
WDOG->CS1 = WDOG_CS1_DEFAULT_VALUE;
}
/*****************************************************************************//*!
*
* @brief feed/refresh watchdog.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
*****************************************************************************/
void WDOG_Feed(void)
{
DisableInterrupts;
WDOG->CNT = 0x02A6;
WDOG->CNT = 0x80B4;
EnableInterrupts;
}
/*****************************************************************************//*!
*
* @brief enable update of WDOG.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @warning this must be the last step of writing control bits sequence.
*****************************************************************************/
void WDOG_EnableUpdate(void)
{
uint8_t u8Cs1 = WDOG->CS1;
uint8_t u8Cs2 = WDOG->CS2;
uint16_t u16TOVAL = WDOG->TOVAL;
uint16_t u16WIN = WDOG->WIN;
u8Cs1 |= WDOG_CS1_UPDATE_MASK;
/* First unlock the watchdog so that we can write to registers */
WDOG_Unlock();
WDOG->CS2 = u8Cs2;
WDOG->TOVAL = u16TOVAL;
WDOG->WIN = u16WIN;
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief disable update of WDOG.
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
* @warning this must be the last step of writing control bits sequence.
*****************************************************************************/
void WDOG_DisableUpdate(void)
{
uint8_t u8Cs1 = WDOG->CS1;
uint8_t u8Cs2 = WDOG->CS2;
uint16_t u16TOVAL = WDOG->TOVAL;
uint16_t u16WIN = WDOG->WIN;
u8Cs1 &= ~WDOG_CS1_UPDATE_MASK;
/* First unlock the watchdog so that we can write to registers */
WDOG_Unlock();
WDOG->CS2 = u8Cs2;
WDOG->TOVAL = u16TOVAL;
WDOG->WIN = u16WIN;
WDOG->CS1 = u8Cs1;
}
/*****************************************************************************//*!
*
* @brief set call back function for wdog module
*
* @param[in] pfnCallback point to call back function
*
* @return none
*
* @ Pass/ Fail criteria: none
*****************************************************************************/
void WDOG_SetCallback(WDOG_CallbackType pfnCallback)
{
WDOG_Callback[0] = pfnCallback;
}
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************//*!
*
* @brief WDOG module interrupt service routine
*
* @param none
*
* @return none
*
* @ Pass/ Fail criteria: none
*****************************************************************************/
void WDOG_IRQHandler(void)
{
/* Clear WDOG flag*/
WDOG_CS2|=WDOG_CS2_FLG_MASK;
if (WDOG_Callback[0])
{
WDOG_Callback[0]();
}
}
#ifdef __cplusplus
}
#endif
/********************************************************************/
/*! @} End of wdog_api_list */
| 26 | 95 | 0.444755 |
1016b9c7e038a150fe021104d85235412968ba07 | 11,591 | cc | C++ | SimRomanPot/SimFP420/src/FP420DigiMain.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | SimRomanPot/SimFP420/src/FP420DigiMain.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | SimRomanPot/SimFP420/src/FP420DigiMain.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | ///////////////////////////////////////////////////////////////////////////////
// File: FP420DigiMain.cc
// Date: 12.2006
// Description: FP420DigiMain for FP420
// Modifications:
///////////////////////////////////////////////////////////////////////////////
#include "SimDataFormats/TrackingHit/interface/PSimHit.h"
#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
#include "SimRomanPot/SimFP420/interface/FP420DigiMain.h"
#include "SimRomanPot/SimFP420/interface/ChargeDividerFP420.h"
#include "SimRomanPot/SimFP420/interface/ChargeDrifterFP420.h"
#include "DataFormats/FP420Digi/interface/HDigiFP420.h"
#include "CLHEP/Random/RandFlat.h"
#include "CLHEP/Random/RandGauss.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include <gsl/gsl_sf_erf.h>
#include <iostream>
#include <vector>
using namespace std;
//#define CBOLTZ (1.38E-23)
//#define e_SI (1.6E-19)
FP420DigiMain::FP420DigiMain(const edm::ParameterSet &conf) : conf_(conf) {
edm::LogInfo("SimRomanPotSimFP420") << "Creating a FP420DigiMain";
ndigis = 0;
verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
theElectronPerADC = conf_.getParameter<double>("ElectronFP420PerAdc");
theThreshold = conf_.getParameter<double>("AdcFP420Threshold");
noNoise = conf_.getParameter<bool>("NoFP420Noise");
addNoisyPixels = conf_.getParameter<bool>("AddNoisyPixels");
thez420 = conf_.getParameter<double>("z420");
thezD2 = conf_.getParameter<double>("zD2");
thezD3 = conf_.getParameter<double>("zD3");
theApplyTofCut = conf_.getParameter<bool>("ApplyTofCut");
tofCut = conf_.getParameter<double>("LowtofCutAndTo200ns");
// sn0 = 3;// number of stations
// pn0 = 6;// number of superplanes
// rn0 = 3; // number of sensors in superlayer
xytype = 2;
edm::LogInfo("SimRomanPotSimFP420") << "theApplyTofCut=" << theApplyTofCut << " tofCut=" << tofCut << "\n"
<< "FP420DigiMain theElectronPerADC=" << theElectronPerADC
<< " theThreshold=" << theThreshold << " noNoise=" << noNoise;
// X (or Y)define type of sensor (xytype=1 or 2 used to derive it: 1-Y, 2-X)
// for every type there is normal pixel size=0.05 and Wide 0.400 mm
Thick300 = 0.300; // = 0.300 mm normalized to 300micron Silicon
// ENC= 2160.; // EquivalentNoiseCharge300um = 2160. +
// other sources of noise
ENC = 960.; // EquivalentNoiseCharge300um = 2160. + other sources of
// noise
ldriftX = 0.050; // in mm(xytype=1)
ldriftY = 0.050; // in mm(xytype=2)
moduleThickness = 0.250; // mm(xytype=1)(xytype=2)
pitchY = 0.050; // in mm(xytype=1)
pitchX = 0.050; // in mm(xytype=2)
// numStripsY = 200; // Y plate number of strips:200*0.050=10mm
// (xytype=1) numStripsX = 400; // X plate number of
// strips:400*0.050=20mm (xytype=2)
numStripsY = 144; // Y plate number of strips:144*0.050=7.2mm (xytype=1)
numStripsX = 160; // X plate number of strips:160*0.050=8.0mm (xytype=2)
pitchYW = 0.400; // in mm(xytype=1)
pitchXW = 0.400; // in mm(xytype=2)
// numStripsYW = 50; // Y plate number of W strips:50 *0.400=20mm
// (xytype=1) - W have ortogonal projection numStripsXW = 25; // X
// plate number of W strips:25 *0.400=10mm (xytype=2) - W have ortogonal
// projection
numStripsYW = 20; // Y plate number of W strips:20 *0.400=8.0mm (xytype=1) - W
// have ortogonal projection
numStripsXW = 18; // X plate number of W strips:18 *0.400=7.2mm (xytype=2) - W
// have ortogonal projection
// tofCut = 1350.; // Cut on the particle TOF range = 1380 - 1500
elossCut = 0.00003; // Cut on the particle TOF = 100 or 50
edm::LogInfo("SimRomanPotSimFP420") << "FP420DigiMain moduleThickness=" << moduleThickness;
float noiseRMS = ENC * moduleThickness / Thick300;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Y:
if (xytype == 1) {
numStrips = numStripsY; // Y plate number of strips:200*0.050=10mm -->
// 100*0.100=10mm
pitch = pitchY;
ldrift = ldriftX; // because drift is in local coordinates which 90 degree
// rotated ( for correct timeNormalization & noiseRMS
// calculations)
numStripsW = numStripsYW; // Y plate number of strips:200*0.050=10mm -->
// 100*0.100=10mm
pitchW = pitchYW;
}
// X:
if (xytype == 2) {
numStrips = numStripsX; // X plate number of strips:400*0.050=20mm -->
// 200*0.100=20mm
pitch = pitchX;
ldrift = ldriftY; // because drift is in local coordinates which 90 degree
// rotated ( for correct timeNormalization & noiseRMS
// calculations)
numStripsW = numStripsXW; // X plate number of strips:400*0.050=20mm -->
// 200*0.100=20mm
pitchW = pitchXW;
}
theHitDigitizerFP420 =
new HitDigitizerFP420(moduleThickness, ldrift, ldriftY, ldriftX, thez420, thezD2, thezD3, verbosity);
int numPixels = numStrips * numStripsW;
theGNoiseFP420 = new GaussNoiseFP420(numPixels, noiseRMS, theThreshold, addNoisyPixels, verbosity);
theZSuppressFP420 = new ZeroSuppressFP420(conf_, noiseRMS / theElectronPerADC);
thePileUpFP420 = new PileUpFP420();
theDConverterFP420 = new DigiConverterFP420(theElectronPerADC, verbosity);
edm::LogInfo("SimRomanPotSimFP420") << "FP420DigiMain end of constructor";
}
FP420DigiMain::~FP420DigiMain() {
delete theGNoiseFP420;
delete theZSuppressFP420;
delete theHitDigitizerFP420;
delete thePileUpFP420;
delete theDConverterFP420;
}
// Run the algorithm
// ------------------
vector<HDigiFP420> FP420DigiMain::run(const std::vector<PSimHit> &input, const G4ThreeVector &bfield, unsigned int iu) {
thePileUpFP420->reset();
bool first = true;
// main loop
//
// First: loop on the SimHits
//
std::vector<PSimHit>::const_iterator simHitIter = input.begin();
std::vector<PSimHit>::const_iterator simHitIterEnd = input.end();
for (; simHitIter != simHitIterEnd; ++simHitIter) {
const PSimHit ihit = *simHitIter;
if (first) {
// detID = ihit.detUnitId();
first = false;
}
// main part here:
double losenergy = ihit.energyLoss();
float tof = ihit.tof();
if (verbosity > 1) {
unsigned int unitID = ihit.detUnitId();
std::cout << " *******FP420DigiMain: intindex= " << iu << std::endl;
std::cout << " tof= " << tof << " EnergyLoss= " << losenergy << " pabs= " << ihit.pabs() << std::endl;
std::cout << " EntryLocalP x= " << ihit.entryPoint().x() << " EntryLocalP y= " << ihit.entryPoint().y()
<< std::endl;
std::cout << " ExitLocalP x= " << ihit.exitPoint().x() << " ExitLocalP y= " << ihit.exitPoint().y() << std::endl;
std::cout << " EntryLocalP z= " << ihit.entryPoint().z() << " ExitLocalP z= " << ihit.exitPoint().z()
<< std::endl;
std::cout << " unitID= " << unitID << " xytype= " << xytype << " particleType= " << ihit.particleType()
<< " trackId= " << ihit.trackId() << std::endl;
// std::cout << " det= " << det << " sector= " << sector << " zmodule=
// " << zmodule << std::endl;
std::cout << " bfield= " << bfield << std::endl;
}
if (verbosity > 0) {
std::cout << " *******FP420DigiMain: theApplyTofCut= " << theApplyTofCut << std::endl;
std::cout << " tof= " << tof << " EnergyLoss= " << losenergy << " pabs= " << ihit.pabs() << std::endl;
std::cout << " particleType= " << ihit.particleType() << std::endl;
}
if ((!(theApplyTofCut) || (theApplyTofCut && abs(tof) > tofCut && abs(tof) < (tofCut + 200.))) &&
losenergy > elossCut) {
if (verbosity > 0)
std::cout << " inside tof: OK " << std::endl;
HitDigitizerFP420::hit_map_type _temp = theHitDigitizerFP420->processHit(
ihit, bfield, xytype, numStrips, pitch, numStripsW, pitchW, moduleThickness, verbosity);
thePileUpFP420->add(_temp, ihit, verbosity);
}
// main part end (AZ)
} // for
// main loop end (AZ)
PileUpFP420::signal_map_type theSignal = thePileUpFP420->dumpSignal();
PileUpFP420::HitToDigisMapType theLink = thePileUpFP420->dumpLink();
PileUpFP420::signal_map_type afterNoise;
if (noNoise) {
afterNoise = theSignal;
} else {
afterNoise = theGNoiseFP420->addNoise(theSignal);
// add_noise();
}
digis.clear();
push_digis(theZSuppressFP420->zeroSuppress(theDConverterFP420->convert(afterNoise), verbosity), theLink, afterNoise);
return digis; // to HDigiFP420
}
void FP420DigiMain::push_digis(const DigitalMapType &dm,
const HitToDigisMapType &htd,
const PileUpFP420::signal_map_type &afterNoise) {
//
if (verbosity > 0) {
std::cout << " ****FP420DigiMain: push_digis start: do for loop dm.size()=" << dm.size() << std::endl;
}
digis.reserve(50);
digis.clear();
// link_coll.clear();
for (DigitalMapType::const_iterator i = dm.begin(); i != dm.end(); i++) {
// Load digis
// push to digis the content of first and second words of HDigiFP420 vector
// for every strip pointer (*i)
digis.push_back(HDigiFP420((*i).first, (*i).second));
ndigis++;
// very useful check:
if (verbosity > 0) {
std::cout << " ****FP420DigiMain:push_digis: ndigis = " << ndigis << std::endl;
std::cout << "push_digis: strip = " << (*i).first << " adc = " << (*i).second << std::endl;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
// reworked to access the fraction of amplitude per simhit
for (HitToDigisMapType::const_iterator mi = htd.begin(); mi != htd.end(); mi++) {
//
if (dm.find((*mi).first) != dm.end()) {
// --- For each channel, sum up the signals from a simtrack
//
map<const PSimHit *, Amplitude> totalAmplitudePerSimHit;
for (std::vector<std::pair<const PSimHit *, Amplitude>>::const_iterator simul = (*mi).second.begin();
simul != (*mi).second.end();
simul++) {
totalAmplitudePerSimHit[(*simul).first] += (*simul).second;
}
/*
//--- include the noise as well
PileUpFP420::signal_map_type& temp1 =
const_cast<PileUpFP420::signal_map_type&>(afterNoise); float
totalAmplitude1 = temp1[(*mi).first];
//--- digisimlink
for (std::map<const PSimHit *, Amplitude>::const_iterator iter =
totalAmplitudePerSimHit.begin(); iter != totalAmplitudePerSimHit.end();
iter++){
float threshold = 0.;
if (totalAmplitudePerSimHit[(*iter).first]/totalAmplitude1 >= threshold) {
float fraction = totalAmplitudePerSimHit[(*iter).first]/totalAmplitude1;
//Noise fluctuation could make fraction>1. Unphysical, set it by hand.
if(fraction >1.) fraction = 1.;
link_coll.push_back(StripDigiSimLink( (*mi).first, //channel
((*iter).first)->trackId(), //simhit
fraction)); //fraction
}//if
}//for
*/
//
} // if
} // for
}
| 41.396429 | 120 | 0.590113 |
1018985615e46a1fe06030f7bdf94e3da98f7b4a | 16,123 | hpp | C++ | src/cpu/x64/rnn/jit_uni_lstm_cell_postgemm_bwd.hpp | lznamens/oneDNN | e7d00d60ac184d18a1f18535bd6ead4468103dfb | [
"Apache-2.0"
] | null | null | null | src/cpu/x64/rnn/jit_uni_lstm_cell_postgemm_bwd.hpp | lznamens/oneDNN | e7d00d60ac184d18a1f18535bd6ead4468103dfb | [
"Apache-2.0"
] | null | null | null | src/cpu/x64/rnn/jit_uni_lstm_cell_postgemm_bwd.hpp | lznamens/oneDNN | e7d00d60ac184d18a1f18535bd6ead4468103dfb | [
"Apache-2.0"
] | null | null | null | /*******************************************************************************
* Copyright 2019-2022 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#ifndef CPU_X64_RNN_JIT_UNI_LSTM_CELL_POSTGEMM_BWD_HPP
#define CPU_X64_RNN_JIT_UNI_LSTM_CELL_POSTGEMM_BWD_HPP
#include <memory>
#include "common/utils.hpp"
#include "cpu/x64/rnn/jit_uni_lstm_cell_postgemm.hpp"
#include "cpu/x64/rnn/jit_uni_rnn_common_postgemm.hpp"
namespace dnnl {
namespace impl {
namespace cpu {
namespace x64 {
template <cpu_isa_t isa, impl::data_type_t src_data_t,
impl::data_type_t scratch_data_t>
struct jit_uni_lstm_cell_postgemm_bwd
: public jit_uni_rnn_postgemm,
public jit_uni_lstm_cell_postgemm_t<isa> {
DECLARE_CPU_JIT_AUX_FUNCTIONS(jit_uni_lstm_cell_postgemm_bwd)
jit_uni_lstm_cell_postgemm_bwd(
const rnn_utils::rnn_conf_t &rnn, const rnn_pd_t *pd)
: jit_uni_rnn_postgemm(rnn, pd, jit_name())
, jit_uni_lstm_cell_postgemm_t<isa>(
this, 11 /*tmp_id_begin*/, static_cast<bool>(bf16_emu_)) {}
~jit_uni_lstm_cell_postgemm_bwd() = default;
status_t init(data_type_t sdt) override {
jit_uni_rnn_postgemm::init(src_data_t);
// we use rax for both constant tables as they use the same table
tanh_injector_ = utils::make_unique<injector_t>(
this, alg_kind::eltwise_tanh, 0.0f, 0.0f, 1.0f, true, rax);
return create_kernel();
}
protected:
using injector_t = typename jit_uni_lstm_cell_postgemm_t<isa>::injector_t;
using Vmm = typename jit_uni_lstm_cell_postgemm_t<isa>::Vmm;
std::unique_ptr<injector_t> tanh_injector_;
// register size in bytes
static constexpr size_t vlen_ = cpu_isa_traits<isa>::vlen;
const size_t vlen_c_states_ = vlen_ / (sizeof(float) / cstate_dt_size_);
static constexpr size_t diff_cstate_dt_size_ = sizeof(float);
static constexpr size_t hstate_dt_size_ = sizeof(float);
static constexpr size_t weights_peephole_dt_size_ = sizeof(float);
const size_t vlen_scratch_
= vlen_ / (sizeof(float) / types::data_type_size(scratch_data_t));
const size_t gate_dt_size_ = types::data_type_size(scratch_data_t);
const size_t scratch_dt_size_ = types::data_type_size(scratch_data_t);
void generate() override {
using namespace Xbyak;
// Labels declaration
Label vector_loop_start_label, vector_loop_end_label;
Label rem_loop_start_label, rem_loop_end_label;
Label table_label;
// Register map
const Reg64 table_reg(rbx); // used to load ones before the loop
const Reg64 loop_cnt(
rbx); // loop counter, can be aliased with table_reg
// We skip vmm0 as it can be used by the injector for masks on sse4.1
const int dG0_idx = 1, dG1_idx = 2, dG2_idx = 3, dG3_idx = 4,
tanhCt_idx = 5, dHt_idx = 6, dCt_idx = 7, G0_idx = 8,
G1_idx = 9, one_idx = 10;
const Vmm one_vmm(one_idx);
const Xmm one_xmm(one_idx);
// Adress maping
const Address one_addr = ptr[table_reg];
// We start code generations here
preamble();
// extract addresses passed as parameter
const auto addr_ws_gates_reg = abi_param1;
const auto addr_scratch_gates_reg = abi_param2;
const auto addr_diff_states_t_lp1_reg = abi_param3;
const auto addr_diff_states_tp1_l_reg = abi_param4;
const auto addr_weights_peephole_reg = r12;
#ifdef _WIN32
const auto addr_diff_c_states_t_l_reg = r10;
const auto addr_diff_c_states_tp1_l_reg = r11;
const auto addr_c_states_tm1_l_reg = rdi;
const auto addr_c_states_t_l_reg = rsi;
const auto base_args = get_stack_params_address();
mov(addr_diff_c_states_t_l_reg, ptr[base_args]);
mov(addr_diff_c_states_tp1_l_reg, ptr[base_args + 8]);
mov(addr_c_states_tm1_l_reg, ptr[base_args + 16]);
mov(addr_c_states_t_l_reg, ptr[base_args + 24]);
mov(addr_weights_peephole_reg, ptr[base_args + 32]);
#else
const auto addr_diff_c_states_t_l_reg = abi_param5;
const auto addr_diff_c_states_tp1_l_reg = abi_param6;
const auto addr_c_states_tm1_l_reg = r10;
const auto addr_c_states_t_l_reg = r11;
const auto base_args = get_stack_params_address();
mov(addr_c_states_tm1_l_reg, ptr[base_args]);
mov(addr_c_states_t_l_reg, ptr[base_args + 8]);
mov(addr_weights_peephole_reg, ptr[base_args + 16]);
#endif
// helper lambda to address the gates and biases
const auto sg_addr = [&](int i) {
return ptr[addr_scratch_gates_reg
+ i * rnn_.dhc * scratch_dt_size_];
};
const auto weights_peephole_addr = [&](int i) {
return ptr[addr_weights_peephole_reg
+ i * rnn_.dhc * weights_peephole_dt_size_];
};
const auto wg_addr = [&](int i) {
return ptr[addr_ws_gates_reg + i * rnn_.dhc * gate_dt_size_];
};
// initialize registers with addresses and constants
mov(table_reg, table_label);
init_regs(vlen_);
uni_vmovups(one_vmm, one_addr);
tanh_injector_->load_table_addr();
mov(loop_cnt, rnn_.dhc * scratch_dt_size_);
cmp(loop_cnt, vlen_scratch_);
jl(vector_loop_end_label, Xbyak::CodeGenerator::T_NEAR);
L(vector_loop_start_label);
{
const Vmm dG0(dG0_idx), dG1(dG1_idx), dG2(dG2_idx), dG3(dG3_idx),
tanhCt(tanhCt_idx), dHt(dHt_idx), dCt(dCt_idx), G0(G0_idx),
G1(G1_idx);
// TODO: if w_gates are bfloat, we have to convert them to float
// datatypes summary:
// - c states are all float
// - h states are all src_data_t
// - diff_* are all float
// - scratch is src_data_t
// - ws_gates is src_data_t
// compute tanhCt
to_float(tanhCt, ptr[addr_c_states_t_l_reg], rnn_.src_iter_c_dt,
vlen_);
tanh_injector_->compute_vector(tanhCt.getIdx());
// compute dHt
// assumption: the diff_states_t_lp1 address is already offset by rnn.n_states
uni_vmovups(dHt, ptr[addr_diff_states_t_lp1_reg]);
if (!rnn_.is_lstm_projection) {
this->vaddps_rhs_op_mem(
dHt, dHt, ptr[addr_diff_states_tp1_l_reg]);
}
// compute dCt
const auto tmp_dCt1 = this->get_next_tmp_vmm();
const auto tmp_dCt2 = this->get_next_tmp_vmm();
uni_vmovups(tmp_dCt1, one_vmm);
uni_vmovups(tmp_dCt2, tanhCt);
uni_vfnmadd231ps(tmp_dCt1, tmp_dCt2, tmp_dCt2);
uni_vmulps(tmp_dCt1, tmp_dCt1, dHt);
to_float(dG3, wg_addr(3), src_data_t, vlen_);
uni_vmulps(tmp_dCt1, tmp_dCt1, dG3);
uni_vmovups(dCt, ptr[addr_diff_c_states_tp1_l_reg]);
uni_vaddps(dCt, dCt, tmp_dCt1);
// compute dG3
const auto tmp_dG3 = this->get_next_tmp_vmm();
uni_vmovups(tmp_dG3, dG3);
uni_vfnmadd231ps(dG3, tmp_dG3, tmp_dG3);
uni_vmulps(dG3, dG3, dHt);
uni_vmulps(dG3, dG3, tanhCt);
// update dCt if lstm_peephole
if (rnn_.is_lstm_peephole)
this->vfmadd231ps_rhs_op_mem(
dCt, dG3, weights_peephole_addr(2));
// compute dG0
// we will reuse G0 and G2 later for dG2
to_float(G0, wg_addr(0), src_data_t, vlen_);
to_float(dG2, wg_addr(2), src_data_t, vlen_);
uni_vmovups(dG0, G0);
const auto tmp_g0 = this->vmm_backup(G0);
uni_vfnmadd231ps(dG0, tmp_g0, tmp_g0);
uni_vmulps(dG0, dG0, dCt);
uni_vmulps(dG0, dG0, dG2);
// compute dG1
to_float(G1, wg_addr(1), src_data_t, vlen_);
uni_vmovups(dG1, G1);
const auto tmp_g1 = this->vmm_backup(G1);
uni_vfnmadd231ps(dG1, tmp_g1, tmp_g1);
uni_vmulps(dG1, dG1, dCt);
const auto tmp_c_states_tm1 = this->get_next_tmp_vmm();
to_float(tmp_c_states_tm1, ptr[addr_c_states_tm1_l_reg],
rnn_.src_iter_c_dt, vlen_);
this->uni_vmulps(dG1, dG1, tmp_c_states_tm1);
// compute dG2
const auto tmp_dg2 = this->get_next_tmp_vmm();
uni_vmovups(tmp_dg2, one_vmm);
const auto tmp_g2 = this->vmm_backup(dG2);
uni_vfnmadd231ps(tmp_dg2, tmp_g2, tmp_g2);
uni_vmulps(G0, G0, dCt);
uni_vmulps(tmp_dg2, tmp_dg2, G0);
uni_vmovups(dG2, tmp_dg2);
// compute diff_state_t_l
uni_vmulps(dCt, dCt, G1);
if (rnn_.is_lstm_peephole) {
this->vfmadd231ps_rhs_op_mem(
dCt, dG0, weights_peephole_addr(0));
this->vfmadd231ps_rhs_op_mem(
dCt, dG1, weights_peephole_addr(1));
}
uni_vmovups(ptr[addr_diff_c_states_t_l_reg], dCt);
to_src(sg_addr(0), dG0, scratch_data_t, vlen_);
to_src(sg_addr(1), dG1, scratch_data_t, vlen_);
to_src(sg_addr(2), dG2, scratch_data_t, vlen_);
to_src(sg_addr(3), dG3, scratch_data_t, vlen_);
// increment address pointers
add(addr_ws_gates_reg, vlen_scratch_);
add(addr_scratch_gates_reg, vlen_scratch_);
add(addr_diff_states_t_lp1_reg, vlen_);
add(addr_diff_states_tp1_l_reg, vlen_);
add(addr_diff_c_states_t_l_reg, vlen_);
add(addr_diff_c_states_tp1_l_reg, vlen_);
add(addr_c_states_tm1_l_reg, vlen_c_states_);
add(addr_c_states_t_l_reg, vlen_c_states_);
if (rnn_.is_lstm_peephole) add(addr_weights_peephole_reg, vlen_);
inc_regs(vlen_);
// increment loop counter
sub(loop_cnt, vlen_scratch_);
cmp(loop_cnt, vlen_scratch_);
jge(vector_loop_start_label);
}
L(vector_loop_end_label);
cmp(loop_cnt, 0);
je(rem_loop_end_label, Xbyak::CodeGenerator::T_NEAR);
// Same code as above, we just use vmovss for accessing inputs
this->reset_vmm_cnt();
L(rem_loop_start_label);
{
const Xmm dG0(dG0_idx), dG1(dG1_idx), dG2(dG2_idx), dG3(dG3_idx),
tanhCt(tanhCt_idx), dHt(dHt_idx), dCt(dCt_idx), G0(G0_idx),
G1(G1_idx);
// compute tanhCt
to_float(tanhCt, ptr[addr_c_states_t_l_reg], rnn_.src_iter_c_dt,
sizeof(float));
tanh_injector_->compute_vector(tanhCt.getIdx());
// compute dHt
// assumption: the diff_states_t_lp1 address is already offset by rnn.n_states
uni_vmovss(dHt, ptr[addr_diff_states_t_lp1_reg]);
if (!rnn_.is_lstm_projection)
this->vaddss_rhs_op_mem(
dHt, dHt, ptr[addr_diff_states_tp1_l_reg]);
// compute dCt
const auto tmp_dCt1 = this->get_next_tmp_xmm();
const auto tmp_dCt2 = this->get_next_tmp_xmm();
uni_vmovss(tmp_dCt1, one_xmm);
// This overrides tanhCt when using Xmm
uni_vmovss(tmp_dCt2, tanhCt);
uni_vfnmadd231ss(tmp_dCt1, tmp_dCt2, tmp_dCt2);
uni_vmulss(tmp_dCt1, tmp_dCt1, dHt);
to_float(dG3, wg_addr(3), src_data_t, hstate_dt_size_);
uni_vmulss(tmp_dCt1, tmp_dCt1, dG3);
uni_vmovss(dCt, ptr[addr_diff_c_states_tp1_l_reg]);
uni_vaddss(dCt, dCt, tmp_dCt1);
// compute dG3
const auto tmp_dG3 = this->get_next_tmp_xmm();
uni_vmovss(tmp_dG3, dG3);
uni_vfnmadd231ss(dG3, tmp_dG3, tmp_dG3);
uni_vmulss(dG3, dG3, dHt);
uni_vmulss(dG3, dG3, tanhCt);
// update dCt if lstm_peephole
if (rnn_.is_lstm_peephole) {
this->vfmadd231ss_rhs_op_mem(
dCt, dG3, weights_peephole_addr(2));
}
// compute dG0
// we will reuse G0 and G2 later for dG2
to_float(G0, wg_addr(0), src_data_t, hstate_dt_size_);
to_float(dG2, wg_addr(2), src_data_t, hstate_dt_size_);
uni_vmovss(dG0, G0);
const auto tmp_g0 = this->xmm_backup(G0);
uni_vfnmadd231ss(dG0, tmp_g0, tmp_g0);
uni_vmulss(dG0, dG0, dCt);
uni_vmulss(dG0, dG0, dG2);
// compute dG1
to_float(G1, wg_addr(1), src_data_t, hstate_dt_size_);
const auto tmp_g1 = this->xmm_backup(G1);
uni_vmovss(dG1, G1);
uni_vfnmadd231ss(dG1, tmp_g1, tmp_g1);
uni_vmulss(dG1, dG1, dCt);
const auto tmp_c_states_tm1 = this->get_next_tmp_xmm();
to_float(tmp_c_states_tm1, ptr[addr_c_states_tm1_l_reg],
rnn_.src_iter_c_dt, sizeof(float));
this->uni_vmulss(dG1, dG1, tmp_c_states_tm1);
// compute dG2
const auto tmp_dG2 = this->get_next_tmp_xmm();
uni_vmovss(tmp_dG2, one_xmm);
const auto tmp_g2 = this->xmm_backup(dG2);
uni_vfnmadd231ss(tmp_dG2, tmp_g2, tmp_g2);
uni_vmulss(G0, G0, dCt);
uni_vmulss(tmp_dG2, tmp_dG2, G0);
uni_vmovss(dG2, tmp_dG2);
// compute diff_state_t_l
uni_vmulss(dCt, dCt, G1);
if (rnn_.is_lstm_peephole) {
this->vfmadd231ss_rhs_op_mem(
dCt, dG1, weights_peephole_addr(1));
this->vfmadd231ss_rhs_op_mem(
dCt, dG0, weights_peephole_addr(0));
}
uni_vmovss(ptr[addr_diff_c_states_t_l_reg], dCt);
to_src(sg_addr(0), dG0, scratch_data_t, hstate_dt_size_);
to_src(sg_addr(1), dG1, scratch_data_t, hstate_dt_size_);
to_src(sg_addr(2), dG2, scratch_data_t, hstate_dt_size_);
to_src(sg_addr(3), dG3, scratch_data_t, hstate_dt_size_);
// increment address pointers
add(addr_ws_gates_reg, scratch_dt_size_);
add(addr_scratch_gates_reg, scratch_dt_size_);
add(addr_diff_states_t_lp1_reg, hstate_dt_size_);
add(addr_diff_states_tp1_l_reg, hstate_dt_size_);
add(addr_diff_c_states_t_l_reg, diff_cstate_dt_size_);
add(addr_diff_c_states_tp1_l_reg, diff_cstate_dt_size_);
add(addr_c_states_tm1_l_reg, cstate_dt_size_);
add(addr_c_states_t_l_reg, cstate_dt_size_);
if (rnn_.is_lstm_peephole)
add(addr_weights_peephole_reg, weights_peephole_dt_size_);
inc_regs(hstate_dt_size_);
// increment loop counter
sub(loop_cnt, scratch_dt_size_);
cmp(loop_cnt, 0);
jg(rem_loop_start_label);
}
L(rem_loop_end_label);
postamble();
tanh_injector_->prepare_table();
init_table(vlen_);
L(table_label);
{
for (size_t i = 0; i < vlen_ / sizeof(float); ++i)
dd(float2int(1.0f));
}
}
};
} // namespace x64
} // namespace cpu
} // namespace impl
} // namespace dnnl
#endif
| 40.408521 | 90 | 0.610246 |
10189d34c9a286171a3ab06b8801ce7fa17eae4c | 8,977 | hpp | C++ | src/include/sweet/TimesteppingRK.hpp | pedrospeixoto/sweet | 224248181e92615467c94b4e163596017811b5eb | [
"MIT"
] | null | null | null | src/include/sweet/TimesteppingRK.hpp | pedrospeixoto/sweet | 224248181e92615467c94b4e163596017811b5eb | [
"MIT"
] | null | null | null | src/include/sweet/TimesteppingRK.hpp | pedrospeixoto/sweet | 224248181e92615467c94b4e163596017811b5eb | [
"MIT"
] | 1 | 2019-03-27T01:17:59.000Z | 2019-03-27T01:17:59.000Z |
#ifndef TIMESTEPPING_RK_HPP
#define TIMESTEPPING_RK_HPP
class TimesteppingRK
{
// runge kutta data storages
DataArray<2>** RK_h_t;
DataArray<2>** RK_u_t;
DataArray<2>** RK_v_t;
int runge_kutta_order;
public:
TimesteppingRK() :
RK_h_t(nullptr),
RK_u_t(nullptr),
RK_v_t(nullptr),
runge_kutta_order(-1)
{
}
void setupBuffers(
const DataArray<2> &i_test_buffer, ///< array of example data to know dimensions of buffers
int i_rk_order ///< Order of Runge-Kutta method
)
{
if (RK_h_t != nullptr) ///< already allocated?
return;
runge_kutta_order = i_rk_order;
int N = i_rk_order;
RK_h_t = new DataArray<2>*[N];
RK_u_t = new DataArray<2>*[N];
RK_v_t = new DataArray<2>*[N];
for (int i = 0; i < N; i++)
{
RK_h_t[i] = new DataArray<2>(i_test_buffer.resolution);
RK_u_t[i] = new DataArray<2>(i_test_buffer.resolution);
RK_v_t[i] = new DataArray<2>(i_test_buffer.resolution);
}
}
~TimesteppingRK()
{
int N = runge_kutta_order;
if (RK_h_t != nullptr)
{
for (int i = 0; i < N; i++)
{
delete RK_h_t[i];
delete RK_u_t[i];
delete RK_v_t[i];
}
delete [] RK_h_t;
delete [] RK_u_t;
delete [] RK_v_t;
RK_h_t = nullptr;
RK_u_t = nullptr;
RK_v_t = nullptr;
}
}
/**
* execute a Runge-Kutta timestep with the order
* specified in the simulation variables.
*/
template <class BaseClass>
void run_rk_timestep(
BaseClass *i_baseClass,
void (BaseClass::*i_compute_euler_timestep_update)(
const DataArray<2> &i_P, ///< prognostic variables
const DataArray<2> &i_u, ///< prognostic variables
const DataArray<2> &i_v, ///< prognostic variables
DataArray<2> &o_P_t, ///< time updates
DataArray<2> &o_u_t, ///< time updates
DataArray<2> &o_v_t, ///< time updates
double &o_dt, ///< time step restriction
double i_use_fixed_dt, ///< if this value is not equal to 0,
///< use this time step size instead of computing one
double i_simulation_time ///< simulation time, e.g. for tidal waves
),
DataArray<2> &io_h,
DataArray<2> &io_u,
DataArray<2> &io_v,
double &o_dt, ///< return time step size for the computed time step
double i_use_fixed_dt = 0, ///< If this value is not equal to 0,
///< Use this time step size instead of computing one
///< This also sets o_dt = i_use_fixed_dt
int i_runge_kutta_order = 1, ///< Order of RK time stepping
double i_simulation_time = -1, ///< Current simulation time.
///< This gets e.g. important for tidal waves
double i_max_simulation_time = std::numeric_limits<double>::infinity() ///< limit the maximum simulation time
)
{
setupBuffers(io_h, i_runge_kutta_order);
double &dt = o_dt;
if (i_runge_kutta_order == 1)
{
(i_baseClass->*i_compute_euler_timestep_update)(
io_h, // input
io_u,
io_v,
*RK_h_t[0], // output
*RK_u_t[0],
*RK_v_t[0],
dt,
i_use_fixed_dt,
i_simulation_time
);
// padding to max simulation time if exceeding the maximum
if (i_max_simulation_time >= 0)
if (dt+i_simulation_time > i_max_simulation_time)
dt = i_max_simulation_time-i_simulation_time;
io_h += dt**RK_h_t[0];
io_u += dt**RK_u_t[0];
io_v += dt**RK_v_t[0];
}
else if (i_runge_kutta_order == 2)
{
// See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Explicit_Runge.E2.80.93Kutta_methods
// See https://de.wikipedia.org/wiki/Runge-Kutta-Verfahren
/*
* c a
* 0 |
* 1/2 | 1/2
* --------------
* | 0 1 b
*/
double a2[1] = {0.5};
double b[2] = {0.0, 1.0};
double c[1] = {0.5};
double dummy_dt = -1;
// STAGE 1
(i_baseClass->*i_compute_euler_timestep_update)(
io_h,
io_u,
io_v,
*RK_h_t[0],
*RK_u_t[0],
*RK_v_t[0],
dt,
i_use_fixed_dt,
i_simulation_time
);
// padding to max simulation time if exceeding the maximum
if (i_max_simulation_time >= 0)
if (dt+i_simulation_time > i_max_simulation_time)
dt = i_max_simulation_time-i_simulation_time;
// STAGE 2
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + ( dt*a2[0]*(*RK_h_t[0]) ),
io_u + ( dt*a2[0]*(*RK_u_t[0]) ),
io_v + ( dt*a2[0]*(*RK_v_t[0]) ),
*RK_h_t[1],
*RK_u_t[1],
*RK_v_t[1],
dummy_dt,
dt,
i_simulation_time + c[0]*dt
);
io_h += dt*(/* b[0]*(*RK_h_t[0]) +*/ b[1]*(*RK_h_t[1]) );
io_u += dt*(/* b[0]*(*RK_u_t[0]) +*/ b[1]*(*RK_u_t[1]) );
io_v += dt*(/* b[0]*(*RK_v_t[0]) +*/ b[1]*(*RK_v_t[1]) );
}
else if (i_runge_kutta_order == 3)
{
// See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Explicit_Runge.E2.80.93Kutta_methods
// See https://de.wikipedia.org/wiki/Runge-Kutta-Verfahren
/*
* c a
* 0 |
* 1/3 | 1/3
* 2/3 | 0 2/3
* --------------
* | 1/4 0 3/4
*/
double a2[1] = {1.0/3.0};
double a3[2] = {0.0, 2.0/3.0};
double b[3] = {1.0/4.0, 0.0, 3.0/4.0};
double c[2] = {1.0/3.0, 2.0/3.0};
double dummy_dt;
// STAGE 1
(i_baseClass->*i_compute_euler_timestep_update)(
io_h,
io_u,
io_v,
*RK_h_t[0],
*RK_u_t[0],
*RK_v_t[0],
dt,
i_use_fixed_dt,
i_simulation_time
);
// padding to max simulation time if exceeding the maximum
if (i_max_simulation_time >= 0)
if (dt+i_simulation_time > i_max_simulation_time)
dt = i_max_simulation_time-i_simulation_time;
// STAGE 2
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + dt*( a2[0]*(*RK_h_t[0]) ),
io_u + dt*( a2[0]*(*RK_u_t[0]) ),
io_v + dt*( a2[0]*(*RK_v_t[0]) ),
*RK_h_t[1],
*RK_u_t[1],
*RK_v_t[1],
dummy_dt,
dt,
i_simulation_time + c[0]*dt
);
// STAGE 3
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + dt*( a3[0]*(*RK_h_t[0]) + a3[1]*(*RK_h_t[1]) ),
io_u + dt*( a3[0]*(*RK_u_t[0]) + a3[1]*(*RK_u_t[1]) ),
io_v + dt*( a3[0]*(*RK_v_t[0]) + a3[1]*(*RK_v_t[1]) ),
*RK_h_t[2],
*RK_u_t[2],
*RK_v_t[2],
dummy_dt,
dt,
i_simulation_time + c[1]*dt
);
io_h += dt*( (b[0]*(*RK_h_t[0])) + (b[1]*(*RK_h_t[1])) + (b[2]*(*RK_h_t[2])) );
io_u += dt*( (b[0]*(*RK_u_t[0])) + (b[1]*(*RK_u_t[1])) + (b[2]*(*RK_u_t[2])) );
io_v += dt*( (b[0]*(*RK_v_t[0])) + (b[1]*(*RK_v_t[1])) + (b[2]*(*RK_v_t[2])) );
}
else if (i_runge_kutta_order == 4)
{
// See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Explicit_Runge.E2.80.93Kutta_methods
// See https://de.wikipedia.org/wiki/Runge-Kutta-Verfahren
/*
* c a
* 0 |
* 1/2 | 1/2
* 1/2 | 0 1/2
* 1 | 0 0 1
* --------------
* | 1/6 1/3 1/3 1/6
*/
double a2[1] = {0.5};
double a3[2] = {0.0, 0.5};
double a4[3] = {0.0, 0.0, 1.0};
double b[4] = {1.0/6.0, 1.0/3.0, 1.0/3.0, 1.0/6.0};
double c[3] = {0.5, 0.5, 1.0};
double dummy_dt;
// STAGE 1
(i_baseClass->*i_compute_euler_timestep_update)(
io_h,
io_u,
io_v,
*RK_h_t[0],
*RK_u_t[0],
*RK_v_t[0],
dt,
i_use_fixed_dt,
i_simulation_time
);
// padding to max simulation time if exceeding the maximum
if (i_max_simulation_time >= 0)
if (dt+i_simulation_time > i_max_simulation_time)
dt = i_max_simulation_time-i_simulation_time;
// STAGE 2
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + dt*( a2[0]*(*RK_h_t[0]) ),
io_u + dt*( a2[0]*(*RK_u_t[0]) ),
io_v + dt*( a2[0]*(*RK_v_t[0]) ),
*RK_h_t[1],
*RK_u_t[1],
*RK_v_t[1],
dummy_dt,
dt,
i_simulation_time + c[0]*dt
);
// STAGE 3
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + dt*( /*a3[0]*(*RK_P_t[0]) +*/ a3[1]*(*RK_h_t[1]) ),
io_u + dt*( /*a3[0]*(*RK_u_t[0]) +*/ a3[1]*(*RK_u_t[1]) ),
io_v + dt*( /*a3[0]*(*RK_v_t[0]) +*/ a3[1]*(*RK_v_t[1]) ),
*RK_h_t[2],
*RK_u_t[2],
*RK_v_t[2],
dummy_dt,
dt,
i_simulation_time + c[1]*dt
);
// STAGE 4
(i_baseClass->*i_compute_euler_timestep_update)(
io_h + dt*( /*a4[0]*(*RK_P_t[0]) + a4[1]*(*RK_P_t[1]) +*/ a4[2]*(*RK_h_t[2]) ),
io_u + dt*( /*a4[0]*(*RK_u_t[0]) + a4[1]*(*RK_u_t[1]) +*/ a4[2]*(*RK_u_t[2]) ),
io_v + dt*( /*a4[0]*(*RK_v_t[0]) + a4[1]*(*RK_v_t[1]) +*/ a4[2]*(*RK_v_t[2]) ),
*RK_h_t[3],
*RK_u_t[3],
*RK_v_t[3],
dummy_dt,
dt,
i_simulation_time + c[2]*dt
);
io_h += dt*( (b[0]*(*RK_h_t[0])) + (b[1]*(*RK_h_t[1])) + (b[2]*(*RK_h_t[2])) + (b[3]*(*RK_h_t[3])) );
io_u += dt*( (b[0]*(*RK_u_t[0])) + (b[1]*(*RK_u_t[1])) + (b[2]*(*RK_u_t[2])) + (b[3]*(*RK_u_t[3])) );
io_v += dt*( (b[0]*(*RK_v_t[0])) + (b[1]*(*RK_v_t[1])) + (b[2]*(*RK_v_t[2])) + (b[3]*(*RK_v_t[3])) );
}
else
{
std::cerr << "This order of the Runge-Kutta time stepping is not supported!" << std::endl;
exit(-1);
}
}
};
#endif
| 25.358757 | 112 | 0.562437 |
1018f930528afb32bef85acec4ae6ebf39b42956 | 68,643 | cxx | C++ | Modules/IO/IOGDAL/src/otbGDALImageIO.cxx | yyxgiser/OTB | 2782a5838a55890769cdc6bc3bd900b2e9f6c5cb | [
"Apache-2.0"
] | null | null | null | Modules/IO/IOGDAL/src/otbGDALImageIO.cxx | yyxgiser/OTB | 2782a5838a55890769cdc6bc3bd900b2e9f6c5cb | [
"Apache-2.0"
] | null | null | null | Modules/IO/IOGDAL/src/otbGDALImageIO.cxx | yyxgiser/OTB | 2782a5838a55890769cdc6bc3bd900b2e9f6c5cb | [
"Apache-2.0"
] | 1 | 2020-10-15T09:37:30.000Z | 2020-10-15T09:37:30.000Z | /*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
* Copyright (C) 2018-2020 CS Systemes d'Information (CS SI)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#include <fstream>
#include <vector>
#include "otbGDALImageIO.h"
#include "otbMacro.h"
#include "otbSystem.h"
#include "otbStopwatch.h"
#include "itksys/SystemTools.hxx"
#include "otbImage.h"
#include "otb_tinyxml.h"
#include "otbImageKeywordlist.h"
#include "itkMetaDataObject.h"
#include "otbMetaDataKey.h"
#include "itkRGBPixel.h"
#include "itkRGBAPixel.h"
#include "cpl_conv.h"
#include "ogr_spatialref.h"
#include "ogr_srs_api.h"
#include "itksys/RegularExpression.hxx"
#include "otbGDALDriverManagerWrapper.h"
#include "otb_boost_string_header.h"
#include "otbOGRHelpers.h"
#include "otbGeometryMetadata.h"
#include "otbConfigure.h"
#include "stdint.h" //needed for uintptr_t
inline unsigned int uint_ceildivpow2(unsigned int a, unsigned int b)
{
return (a + (1 << b) - 1) >> b;
}
namespace otb
{
class GDALDataTypeWrapper
{
public:
GDALDataTypeWrapper() : pixType(GDT_Byte)
{
}
~GDALDataTypeWrapper()
{
}
GDALDataTypeWrapper(const GDALDataTypeWrapper& w)
{
pixType = w.pixType;
}
GDALDataTypeWrapper& operator=(GDALDataTypeWrapper w)
{
pixType = w.pixType;
return *this;
}
GDALDataType pixType;
}; // end of GDALDataTypeWrapper
GDALImageIO::GDALImageIO()
{
// By default set number of dimensions to two.
this->SetNumberOfDimensions(2);
// By default set pixel type to scalar.
m_PixelType = SCALAR;
// By default set component type to unsigned char
m_ComponentType = UCHAR;
m_UseCompression = false;
m_CompressionLevel = 4; // Range 0-9; 0 = no file compression, 9 = maximum file compression
// Set default spacing to one
m_Spacing[0] = 1.0;
m_Spacing[1] = 1.0;
// Set default origin to half a pixel (centered pixel convention)
m_Origin[0] = 0.5;
m_Origin[1] = 0.5;
m_IsIndexed = false;
m_DatasetNumber = 0;
m_NbBands = 0;
m_FlagWriteImageInformation = true;
m_CanStreamWrite = false;
m_IsComplex = false;
m_IsVectorImage = false;
m_PxType = new GDALDataTypeWrapper;
m_NumberOfOverviews = 0;
m_ResolutionFactor = 0;
m_BytePerPixel = 0;
m_WriteRPCTags = true;
m_epsgCode = 0;
}
GDALImageIO::~GDALImageIO()
{
delete m_PxType;
}
// Tell only if the file can be read with GDAL.
bool GDALImageIO::CanReadFile(const char* file)
{
// First check the extension
if (file == nullptr)
{
return false;
}
m_Dataset = GDALDriverManagerWrapper::GetInstance().Open(file);
return m_Dataset.IsNotNull();
}
// Used to print information about this object
void GDALImageIO::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << "Compression Level : " << m_CompressionLevel << "\n";
os << indent << "IsComplex (otb side) : " << m_IsComplex << "\n";
os << indent << "Byte per pixel : " << m_BytePerPixel << "\n";
}
// Read a 3D image (or event more bands)... not implemented yet
void GDALImageIO::ReadVolume(void*)
{
}
// Read image with GDAL
void GDALImageIO::Read(void* buffer)
{
// Convert buffer from void * to unsigned char *
unsigned char* p = static_cast<unsigned char*>(buffer);
// Check if conversion succeed
if (p == nullptr)
{
itkExceptionMacro(<< "Buffer passed to GDALImageIO for reading is NULL.");
return;
}
// Get the origin of the region to read
int lFirstLineRegion = this->GetIORegion().GetIndex()[1];
int lFirstColumnRegion = this->GetIORegion().GetIndex()[0];
// Get nb. of lines and columns of the region to read
int lNbLinesRegion = this->GetIORegion().GetSize()[1];
int lNbColumnsRegion = this->GetIORegion().GetSize()[0];
// Compute the origin of the image region to read at the initial resolution
int lFirstLine = lFirstLineRegion * (1 << m_ResolutionFactor);
int lFirstColumn = lFirstColumnRegion * (1 << m_ResolutionFactor);
// Compute the size of the image region to read at the initial resolution
int lNbLines = lNbLinesRegion * (1 << m_ResolutionFactor);
int lNbColumns = lNbColumnsRegion * (1 << m_ResolutionFactor);
// Check if the image region is correct
if (lFirstLine + lNbLines > static_cast<int>(m_OriginalDimensions[1]))
lNbLines = static_cast<int>(m_OriginalDimensions[1] - lFirstLine);
if (lFirstColumn + lNbColumns > static_cast<int>(m_OriginalDimensions[0]))
lNbColumns = static_cast<int>(m_OriginalDimensions[0] - lFirstColumn);
GDALDataset* dataset = m_Dataset->GetDataSet();
// In the indexed case, one has to retrieve the index image and the
// color table, and translate p to a 4 components color values buffer
if (m_IsIndexed)
{
// TODO: This is a very special case and seems to be working only
// for unsigned char pixels. There might be a gdal method to do
// the work in a cleaner way
std::streamoff lNbPixels = (static_cast<std::streamoff>(lNbColumnsRegion)) * (static_cast<std::streamoff>(lNbLinesRegion));
std::streamoff lBufferSize = static_cast<std::streamoff>(m_BytePerPixel) * lNbPixels;
itk::VariableLengthVector<unsigned char> value(lBufferSize);
std::streamoff step = static_cast<std::streamoff>(this->GetNumberOfComponents()) * static_cast<std::streamoff>(m_BytePerPixel);
otbLogMacro(Debug, << "GDAL reads [" << lFirstColumn << ", " << lFirstColumn + lNbColumns - 1 << "]x[" << lFirstLine << ", " << lFirstLine + lNbLines - 1
<< "] indexed color image of type " << GDALGetDataTypeName(m_PxType->pixType) << " from file " << m_FileName);
otb::Stopwatch chrono = otb::Stopwatch::StartNew();
CPLErr lCrGdal =
dataset->GetRasterBand(1)->RasterIO(GF_Read, lFirstColumn, lFirstLine, lNbColumns, lNbLines, const_cast<unsigned char*>(value.GetDataPointer()),
lNbColumnsRegion, lNbLinesRegion, m_PxType->pixType, 0, 0);
chrono.Stop();
if (lCrGdal == CE_Failure)
{
itkExceptionMacro(<< "Error while reading image (GDAL format) '" << m_FileName << "' : " << CPLGetLastErrorMsg());
}
otbLogMacro(Debug, << "GDAL read took " << chrono.GetElapsedMilliseconds() << " ms")
// Interpret index as color
std::streamoff cpt(0);
GDALColorTable* colorTable = dataset->GetRasterBand(1)->GetColorTable();
for (std::streamoff i = 0; i < lBufferSize; i = i + static_cast<std::streamoff>(m_BytePerPixel))
{
GDALColorEntry color;
colorTable->GetColorEntryAsRGB(value[i], &color);
p[cpt] = color.c1;
p[cpt + 1] = color.c2;
p[cpt + 2] = color.c3;
p[cpt + 3] = color.c4;
cpt += step;
}
}
else
{
/******** Nominal case ***********/
int pixelOffset = m_BytePerPixel * m_NbBands;
int lineOffset = m_BytePerPixel * m_NbBands * lNbColumnsRegion;
int bandOffset = m_BytePerPixel;
int nbBands = m_NbBands;
// In some cases, we need to change some parameters for RasterIO
if (!GDALDataTypeIsComplex(m_PxType->pixType) && m_IsComplex && m_IsVectorImage && (m_NbBands > 1))
{
pixelOffset = m_BytePerPixel * 2;
lineOffset = pixelOffset * lNbColumnsRegion;
bandOffset = m_BytePerPixel;
}
// keep it for the moment
otbLogMacro(Debug, << "GDAL reads [" << lFirstColumn << ", " << lFirstColumnRegion + lNbColumnsRegion - 1 << "]x[" << lFirstLineRegion << ", "
<< lFirstLineRegion + lNbLinesRegion - 1 << "] x " << nbBands << " bands of type " << GDALGetDataTypeName(m_PxType->pixType)
<< " from file " << m_FileName);
otb::Stopwatch chrono = otb::Stopwatch::StartNew();
CPLErr lCrGdal = m_Dataset->GetDataSet()->RasterIO(GF_Read, lFirstColumn, lFirstLine, lNbColumns, lNbLines, p, lNbColumnsRegion, lNbLinesRegion,
m_PxType->pixType, nbBands,
// We want to read all bands
nullptr, pixelOffset, lineOffset, bandOffset);
chrono.Stop();
// Check if gdal call succeed
if (lCrGdal == CE_Failure)
{
itkExceptionMacro(<< "Error while reading image (GDAL format) '" << m_FileName << "' : " << CPLGetLastErrorMsg());
return;
}
otbLogMacro(Debug, << "GDAL read took " << chrono.GetElapsedMilliseconds() << " ms")
}
}
bool GDALImageIO::GetSubDatasetInfo(std::vector<std::string>& names, std::vector<std::string>& desc)
{
// Note: we assume that the subdatasets are in order : SUBDATASET_ID_NAME, SUBDATASET_ID_DESC, SUBDATASET_ID+1_NAME, SUBDATASET_ID+1_DESC
char** papszMetadata;
papszMetadata = m_Dataset->GetDataSet()->GetMetadata("SUBDATASETS");
// Have we find some dataSet ?
// This feature is supported only for hdf4 and hdf5 file (regards to the bug 270)
if ((CSLCount(papszMetadata) > 0) && ((strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(), "HDF4") == 0) ||
(strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(), "HDF5") == 0) ||
(strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(), "SENTINEL2") == 0)))
{
for (int cpt = 0; papszMetadata[cpt] != nullptr; ++cpt)
{
std::string key, name;
if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name))
{
// check if this is a dataset name
if (key.find("_NAME") != std::string::npos)
names.push_back(name);
// check if this is a dataset descriptor
if (key.find("_DESC") != std::string::npos)
desc.push_back(name);
}
}
}
else
{
return false;
}
if (names.empty() || desc.empty())
return false;
if (names.size() != desc.size())
{
names.clear();
desc.clear();
return false;
}
return true;
}
bool GDALImageIO::GDALPixelTypeIsComplex()
{
return GDALDataTypeIsComplex(m_PxType->pixType);
}
void GDALImageIO::ReadImageInformation()
{
// std::ifstream file;
this->InternalReadImageInformation();
}
unsigned int GDALImageIO::GetOverviewsCount()
{
GDALDataset* dataset = m_Dataset->GetDataSet();
// JPEG2000 case : use the number of overviews actually in the dataset
if (m_Dataset->IsJPEG2000())
{
// Include the full resolution in overviews count
return dataset->GetRasterBand(1)->GetOverviewCount() + 1;
}
if (dataset->GetRasterBand(1)->GetOverviewCount())
// Include the full resolution in overviews count
return dataset->GetRasterBand(1)->GetOverviewCount() + 1;
// default case: compute overviews until one of the dimensions is 1
bool flagStop = false;
unsigned int possibleOverviewCount = 0;
while (!flagStop)
{
unsigned int tDimX = uint_ceildivpow2(dataset->GetRasterXSize(), possibleOverviewCount);
unsigned int tDimY = uint_ceildivpow2(dataset->GetRasterYSize(), possibleOverviewCount);
possibleOverviewCount++;
if ((tDimX == 1) || (tDimY == 1))
{
flagStop = true;
}
}
return possibleOverviewCount;
}
std::vector<std::string> GDALImageIO::GetOverviewsInfo()
{
std::vector<std::string> desc;
// This should never happen, according to implementation of GetOverviewCount()
if (this->GetOverviewsCount() == 0)
return desc;
std::ostringstream oss;
// If gdal exposes actual overviews
unsigned int lOverviewsCount = m_Dataset->GetDataSet()->GetRasterBand(1)->GetOverviewCount();
if (lOverviewsCount)
{
unsigned int x = m_OriginalDimensions[0];
unsigned int y = m_OriginalDimensions[1];
oss.str("");
oss << "Resolution: 0 (Image [w x h]: " << x << "x" << y << ")";
desc.push_back(oss.str());
for (unsigned int iOverview = 0; iOverview < lOverviewsCount; iOverview++)
{
x = m_Dataset->GetDataSet()->GetRasterBand(1)->GetOverview(iOverview)->GetXSize();
y = m_Dataset->GetDataSet()->GetRasterBand(1)->GetOverview(iOverview)->GetYSize();
oss.str("");
oss << "Resolution: " << iOverview + 1 << " (Image [w x h]: " << x << "x" << y << ")";
desc.push_back(oss.str());
}
}
else
{
// Fall back to gdal implicit overviews
lOverviewsCount = this->GetOverviewsCount();
unsigned int originalWidth = m_OriginalDimensions[0];
unsigned int originalHeight = m_OriginalDimensions[1];
// Get the overview sizes
for (unsigned int iOverview = 0; iOverview < lOverviewsCount; iOverview++)
{
// For each resolution we will compute the tile dim and image dim
unsigned int w = uint_ceildivpow2(originalWidth, iOverview);
unsigned int h = uint_ceildivpow2(originalHeight, iOverview);
oss.str("");
oss << "Resolution: " << iOverview << " (Image [w x h]: " << w << "x" << h << ")";
desc.push_back(oss.str());
}
}
return desc;
}
void GDALImageIO::SetEpsgCode(const unsigned int epsgCode)
{
m_epsgCode = epsgCode;
}
void GDALImageIO::InternalReadImageInformation()
{
itk::ExposeMetaData<unsigned int>(this->GetMetaDataDictionary(), MetaDataKey::ResolutionFactor, m_ResolutionFactor);
itk::ExposeMetaData<unsigned int>(this->GetMetaDataDictionary(), MetaDataKey::SubDatasetIndex, m_DatasetNumber);
// Detecting if we are in the case of an image with subdatasets
// example: hdf Modis data
// in this situation, we are going to change the filename to the
// supported gdal format using the m_DatasetNumber value
// HDF4_SDS:UNKNOWN:"myfile.hdf":2
// and make m_Dataset point to it.
if (m_Dataset->GetDataSet()->GetRasterCount() == 0 || m_DatasetNumber > 0)
{
// this happen in the case of a hdf file with SUBDATASETS
// Note: we assume that the datasets are in order
char** papszMetadata;
papszMetadata = m_Dataset->GetDataSet()->GetMetadata("SUBDATASETS");
// TODO: we might want to keep the list of names somewhere, at least the number of datasets
std::vector<std::string> names;
if (CSLCount(papszMetadata) > 0)
{
for (int cpt = 0; papszMetadata[cpt] != nullptr; ++cpt)
{
std::string key, name;
if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name))
{
// check if this is a dataset name
if (key.find("_NAME") != std::string::npos)
names.push_back(name);
}
}
}
if (m_DatasetNumber < names.size())
{
m_Dataset = GDALDriverManagerWrapper::GetInstance().Open(names[m_DatasetNumber]);
}
else
{
itkExceptionMacro(<< "Dataset requested does not exist (" << names.size() << " datasets)");
}
}
GDALDataset* dataset = m_Dataset->GetDataSet();
// Get image dimensions
if (dataset->GetRasterXSize() == 0 || dataset->GetRasterYSize() == 0)
{
itkExceptionMacro(<< "Dimension is undefined.");
}
// Set image dimensions into IO
m_Dimensions[0] = uint_ceildivpow2(dataset->GetRasterXSize(), m_ResolutionFactor);
m_Dimensions[1] = uint_ceildivpow2(dataset->GetRasterYSize(), m_ResolutionFactor);
// Keep the original dimension of the image
m_OriginalDimensions.push_back(dataset->GetRasterXSize());
m_OriginalDimensions.push_back(dataset->GetRasterYSize());
// Get Number of Bands
m_NbBands = dataset->GetRasterCount();
// Get the number of overviews of the file (based on the first band)
m_NumberOfOverviews = dataset->GetRasterBand(1)->GetOverviewCount();
// Get the overview sizes
for (unsigned int iOverview = 0; iOverview < m_NumberOfOverviews; iOverview++)
{
std::pair<unsigned int, unsigned int> tempSize;
tempSize.first = GDALGetRasterBandXSize(dataset->GetRasterBand(1)->GetOverview(iOverview));
tempSize.second = GDALGetRasterBandYSize(dataset->GetRasterBand(1)->GetOverview(iOverview));
m_OverviewsSize.push_back(tempSize);
}
this->SetNumberOfComponents(m_NbBands);
// Set the number of dimensions (verify for the dim )
this->SetNumberOfDimensions(2);
// Automatically set the Type to Binary for GDAL data
this->SetFileTypeToBinary();
// Get Data Type
// Consider only the data type given by the first band
// Maybe be could changed (to check)
m_PxType->pixType = dataset->GetRasterBand(1)->GetRasterDataType();
if (m_PxType->pixType == GDT_Byte)
{
SetComponentType(UCHAR);
}
else if (m_PxType->pixType == GDT_UInt16)
{
SetComponentType(USHORT);
}
else if (m_PxType->pixType == GDT_Int16)
{
SetComponentType(SHORT);
}
else if (m_PxType->pixType == GDT_UInt32)
{
SetComponentType(UINT);
}
else if (m_PxType->pixType == GDT_Int32)
{
SetComponentType(INT);
}
else if (m_PxType->pixType == GDT_Float32)
{
SetComponentType(FLOAT);
}
else if (m_PxType->pixType == GDT_Float64)
{
SetComponentType(DOUBLE);
}
else if (m_PxType->pixType == GDT_CInt16)
{
SetComponentType(CSHORT);
}
else if (m_PxType->pixType == GDT_CInt32)
{
SetComponentType(CINT);
}
else if (m_PxType->pixType == GDT_CFloat32)
{
SetComponentType(CFLOAT);
}
else if (m_PxType->pixType == GDT_CFloat64)
{
SetComponentType(CDOUBLE);
}
else
{
itkExceptionMacro(<< "Pixel type unknown");
}
if (this->GetComponentType() == CHAR)
{
m_BytePerPixel = 1;
}
else if (this->GetComponentType() == UCHAR)
{
m_BytePerPixel = 1;
}
else if (this->GetComponentType() == USHORT)
{
m_BytePerPixel = 2;
}
else if (this->GetComponentType() == SHORT)
{
m_BytePerPixel = 2;
}
else if (this->GetComponentType() == INT)
{
m_BytePerPixel = 4;
}
else if (this->GetComponentType() == UINT)
{
m_BytePerPixel = 4;
}
else if (this->GetComponentType() == LONG)
{
m_BytePerPixel = sizeof(long);
}
else if (this->GetComponentType() == ULONG)
{
m_BytePerPixel = sizeof(unsigned long);
}
else if (this->GetComponentType() == FLOAT)
{
m_BytePerPixel = 4;
}
else if (this->GetComponentType() == DOUBLE)
{
m_BytePerPixel = 8;
}
else if (this->GetComponentType() == CSHORT)
{
m_BytePerPixel = sizeof(std::complex<short>);
}
else if (this->GetComponentType() == CINT)
{
m_BytePerPixel = sizeof(std::complex<int>);
}
else if (this->GetComponentType() == CFLOAT)
{
/*if (m_PxType->pixType == GDT_CInt16)
m_BytePerPixel = sizeof(std::complex<short>);
else if (m_PxType->pixType == GDT_CInt32)
m_BytePerPixel = sizeof(std::complex<int>);
else*/
m_BytePerPixel = sizeof(std::complex<float>);
}
else if (this->GetComponentType() == CDOUBLE)
{
m_BytePerPixel = sizeof(std::complex<double>);
}
else
{
itkExceptionMacro(<< "Component type unknown");
}
/******************************************************************/
// Set the pixel type with some special cases linked to the fact
// we read some data with complex type.
if (GDALDataTypeIsComplex(m_PxType->pixType)) // Try to read data with complex type with GDAL
{
if (!m_IsComplex && m_IsVectorImage)
{
// we are reading a complex data set into an image where the pixel
// type is Vector<real>: we have to double the number of component
// for that to work
otbLogMacro(Warning, << "Encoding of file (" << m_FileName
<< ") is complex but will be read as a VectorImage of scalar type, with twice the number of bands.");
this->SetNumberOfComponents(m_NbBands * 2);
this->SetPixelType(VECTOR);
}
else
{
this->SetPixelType(COMPLEX);
}
}
else // Try to read data with scalar type with GDAL
{
this->SetNumberOfComponents(m_NbBands);
if (this->GetNumberOfComponents() == 1)
{
this->SetPixelType(SCALAR);
}
else
{
this->SetPixelType(VECTOR);
}
}
// get list of other files part of the same dataset
char** datasetFileList = dataset->GetFileList();
m_AttachedFileNames.clear();
if (datasetFileList != nullptr)
{
char** currentFile = datasetFileList;
while (*currentFile != nullptr)
{
if (m_FileName.compare(*currentFile) != 0)
{
m_AttachedFileNames.emplace_back(*currentFile);
otbLogMacro(Debug, << "Found attached file : " << *currentFile);
}
currentFile++;
}
CSLDestroy(datasetFileList);
}
/*----------------------------------------------------------------------*/
/*-------------------------- METADATA ----------------------------------*/
/*----------------------------------------------------------------------*/
// Now initialize the itk dictionary
itk::MetaDataDictionary& dict = this->GetMetaDataDictionary();
// Initialize the ImageMetadata structure
ImageMetadata imd;
m_Imd = imd;
// Report the typical block size if possible
if (dataset->GetRasterCount() > 0)
{
int blockSizeX = 0;
int blockSizeY = 0;
dataset->GetRasterBand(1)->GetBlockSize(&blockSizeX, &blockSizeY);
if (blockSizeX > 0 && blockSizeY > 0)
{
blockSizeX = uint_ceildivpow2(blockSizeX, m_ResolutionFactor);
if (m_Dataset->IsJPEG2000())
{
// Jpeg2000 case : use the real block size Y
blockSizeY = uint_ceildivpow2(blockSizeY, m_ResolutionFactor);
}
else
{
// Try to keep the GDAL block memory constant
blockSizeY = blockSizeY * (1 << m_ResolutionFactor);
}
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::TileHintX, blockSizeX);
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::TileHintY, blockSizeY);
m_Imd.NumericKeys[MDNum::TileHintX] = blockSizeX;
m_Imd.NumericKeys[MDNum::TileHintY] = blockSizeY;
}
}
/* -------------------------------------------------------------------- */
/* Get Pixel type */
/* -------------------------------------------------------------------- */
itk::EncapsulateMetaData<IOComponentType>(dict, MetaDataKey::DataType, this->GetComponentType());
m_Imd.NumericKeys[MDNum::DataType] = this->GetComponentType();
/* -------------------------------------------------------------------- */
/* Get Spacing */
/* -------------------------------------------------------------------- */
// Default Spacing
m_Spacing[0] = 1;
m_Spacing[1] = 1;
// Reset origin to GDAL convention default
m_Origin[0] = 0.0;
m_Origin[1] = 0.0;
// flag to detect images in sensor geometry
bool isSensor = false;
if (m_NumberOfDimensions == 3)
m_Spacing[2] = 1;
char** papszMetadata = dataset->GetMetadata(nullptr);
/* -------------------------------------------------------------------- */
/* Report general info. */
/* -------------------------------------------------------------------- */
GDALDriverH hDriver;
hDriver = dataset->GetDriver();
std::string driverShortName = static_cast<std::string>(GDALGetDriverShortName(hDriver));
std::string driverLongName = static_cast<std::string>(GDALGetDriverLongName(hDriver));
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::DriverShortNameKey, driverShortName);
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::DriverLongNameKey, driverLongName);
if (m_Dataset->IsJPEG2000())
{
// store the cache size used for Jpeg2000 files
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::CacheSizeInBytes, GDALGetCacheMax64());
}
/* -------------------------------------------------------------------- */
/* Get the projection coordinate system of the image : ProjectionRef */
/* -------------------------------------------------------------------- */
const char* pszProjection = dataset->GetProjectionRef();
if (pszProjection != nullptr && !std::string(pszProjection).empty())
{
OGRSpatialReferenceH pSR = OSRNewSpatialReference(nullptr);
if (strncmp(pszProjection, "LOCAL_CS",8) == 0)
{
// skip local coordinate system as they will cause crashed later
// In GDAL 3, they begin to do special processing for Transmercator local
// coordinate system
otbLogMacro(Debug, << "Skipping LOCAL_CS projection")
}
else if (OSRImportFromWkt(pSR, (char**)(&pszProjection)) == OGRERR_NONE)
{
char* pszPrettyWkt = nullptr;
OSRExportToPrettyWkt(pSR, &pszPrettyWkt, FALSE);
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, static_cast<std::string>(pszPrettyWkt));
m_Imd.Add(MDGeom::ProjectionWKT, std::string(pszPrettyWkt));
CPLFree(pszPrettyWkt);
}
else
{
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, static_cast<std::string>(pszProjection));
m_Imd.Add(MDGeom::ProjectionWKT, std::string(pszProjection));
}
if (pSR != nullptr)
{
OSRRelease(pSR);
pSR = nullptr;
}
}
else
{
// Special case for Jpeg2000 files : try to read the origin in the GML box
if (m_Dataset->IsJPEG2000())
{
isSensor = GetOriginFromGMLBox(m_Origin);
}
}
/* -------------------------------------------------------------------- */
/* Get the GCP projection coordinates of the image : GCPProjection */
/* -------------------------------------------------------------------- */
unsigned int gcpCount = 0;
gcpCount = dataset->GetGCPCount();
if (gcpCount > 0)
{
std::string gcpProjectionKey;
Projection::GCPParam gcps;
{
// Declare gcpProj in local scope. So, it won't be available outside.
const char* gcpProj = dataset->GetGCPProjection();
// assert( gcpProj!=NULL );
if (gcpProj != nullptr)
gcpProjectionKey = gcpProj;
}
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::GCPProjectionKey, gcpProjectionKey);
gcps.GCPProjection = gcpProjectionKey;
if (gcpProjectionKey.empty())
{
gcpCount = 0; // fix for uninitialized gcpCount in gdal (when
// reading Palsar image)
}
std::string key;
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::GCPCountKey, gcpCount);
for (unsigned int cpt = 0; cpt < gcpCount; ++cpt)
{
const GDAL_GCP* psGCP;
psGCP = dataset->GetGCPs() + cpt;
GCP pOtbGCP;
pOtbGCP.m_Id = std::string(psGCP->pszId);
pOtbGCP.m_Info = std::string(psGCP->pszInfo);
pOtbGCP.m_GCPRow = psGCP->dfGCPLine;
pOtbGCP.m_GCPCol = psGCP->dfGCPPixel;
pOtbGCP.m_GCPX = psGCP->dfGCPX;
pOtbGCP.m_GCPY = psGCP->dfGCPY;
pOtbGCP.m_GCPZ = psGCP->dfGCPZ;
// Complete the key with the GCP number : GCP_i
std::ostringstream lStream;
lStream << MetaDataKey::GCPParametersKey << cpt;
key = lStream.str();
itk::EncapsulateMetaData<GCP>(dict, key, pOtbGCP);
gcps.GCPs.push_back(pOtbGCP);
}
m_Imd.Add(MDGeom::GCP, gcps);
}
/* -------------------------------------------------------------------- */
/* Get the six coefficients of affine geoTtransform */
/* -------------------------------------------------------------------- */
double adfGeoTransform[6];
MetaDataKey::VectorType VadfGeoTransform;
if (dataset->GetGeoTransform(adfGeoTransform) == CE_None)
{
for (int cpt = 0; cpt < 6; ++cpt)
{
VadfGeoTransform.push_back(adfGeoTransform[cpt]);
//~ m_Imd.GeoTransform[cpt] = adfGeoTransform[cpt];
}
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::GeoTransformKey, VadfGeoTransform);
if (!isSensor)
{
/// retrieve origin and spacing from the geo transform
m_Spacing[0] = VadfGeoTransform[1];
m_Spacing[1] = VadfGeoTransform[5];
if (m_Spacing[0] == 0 || m_Spacing[1] == 0)
{
// Manage case where axis are not standard
if (VadfGeoTransform[2] != 0 && VadfGeoTransform[4] != 0)
{
m_Spacing[0] = VadfGeoTransform[2];
m_Spacing[1] = VadfGeoTransform[4];
}
else
{
otbLogMacro(Warning, << "Geotransform reported by GDAL is invalid (spacing = 0)");
m_Spacing[0] = 1;
m_Spacing[1] = 1;
}
}
// Geotransforms with a non-null rotation are not supported
// Beware : GDAL origin is at the corner of the top-left pixel
// whereas OTB/ITK origin is at the centre of the top-left pixel
// The origin computed here is in GDAL convention for now
m_Origin[0] = VadfGeoTransform[0];
m_Origin[1] = VadfGeoTransform[3];
}
}
// Compute final spacing with the resolution factor
m_Spacing[0] *= std::pow(2.0, static_cast<double>(m_ResolutionFactor));
m_Spacing[1] *= std::pow(2.0, static_cast<double>(m_ResolutionFactor));
// Now that the spacing is known, apply the half-pixel shift
m_Origin[0] += 0.5 * m_Spacing[0];
m_Origin[1] += 0.5 * m_Spacing[1];
/* -------------------------------------------------------------------- */
/* Report metadata. */
/* -------------------------------------------------------------------- */
papszMetadata = dataset->GetMetadata(nullptr);
if (CSLCount(papszMetadata) > 0)
{
std::string key;
for (int cpt = 0; papszMetadata[cpt] != nullptr; ++cpt)
{
std::ostringstream lStream;
lStream << MetaDataKey::MetadataKey << cpt;
key = lStream.str();
itk::EncapsulateMetaData<std::string>(dict, key, static_cast<std::string>(papszMetadata[cpt]));
}
}
/* Special case for JPEG2000, also look in the GML boxes */
if (m_Dataset->IsJPEG2000())
{
char** gmlMetadata = nullptr;
GDALJP2Metadata jp2Metadata;
if (jp2Metadata.ReadAndParse(m_FileName.c_str()))
{
gmlMetadata = jp2Metadata.papszGMLMetadata;
}
if (gmlMetadata)
{
if (CSLCount(gmlMetadata) > 0)
{
std::string key;
int cptOffset = CSLCount(papszMetadata);
for (int cpt = 0; gmlMetadata[cpt] != nullptr; ++cpt)
{
std::ostringstream lStream;
lStream << MetaDataKey::MetadataKey << (cpt + cptOffset);
key = lStream.str();
itk::EncapsulateMetaData<std::string>(dict, key, static_cast<std::string>(gmlMetadata[cpt]));
}
}
}
}
/* -------------------------------------------------------------------- */
/* Report subdatasets. */
/* -------------------------------------------------------------------- */
papszMetadata = dataset->GetMetadata("SUBDATASETS");
if (CSLCount(papszMetadata) > 0)
{
std::string key;
for (int cpt = 0; papszMetadata[cpt] != nullptr; ++cpt)
{
std::ostringstream lStream;
lStream << MetaDataKey::SubMetadataKey << cpt;
key = lStream.str();
itk::EncapsulateMetaData<std::string>(dict, key, static_cast<std::string>(papszMetadata[cpt]));
}
}
/* -------------------------------------------------------------------- */
/* Report corners */
/* -------------------------------------------------------------------- */
double GeoX(0), GeoY(0);
MetaDataKey::VectorType VGeo;
GDALInfoReportCorner("Upper Left", 0.0, 0.0, GeoX, GeoY);
VGeo.push_back(GeoX);
VGeo.push_back(GeoY);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::UpperLeftCornerKey, VGeo);
//~ m_Imd.ULX = GeoX;
//~ m_Imd.ULY = GeoY;
VGeo.clear();
GDALInfoReportCorner("Upper Right", m_Dimensions[0], 0.0, GeoX, GeoY);
VGeo.push_back(GeoX);
VGeo.push_back(GeoY);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::UpperRightCornerKey, VGeo);
//~ m_Imd.URX = GeoX;
//~ m_Imd.URY = GeoY;
VGeo.clear();
GDALInfoReportCorner("Lower Left", 0.0, m_Dimensions[1], GeoX, GeoY);
VGeo.push_back(GeoX);
VGeo.push_back(GeoY);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::LowerLeftCornerKey, VGeo);
//~ m_Imd.LLX = GeoX;
//~ m_Imd.LLY = GeoY;
VGeo.clear();
GDALInfoReportCorner("Lower Right", m_Dimensions[0], m_Dimensions[1], GeoX, GeoY);
VGeo.push_back(GeoX);
VGeo.push_back(GeoY);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::LowerRightCornerKey, VGeo);
//~ m_Imd.LRX = GeoX;
//~ m_Imd.LRY = GeoY;
VGeo.clear();
/* -------------------------------------------------------------------- */
/* Color Table */
/* -------------------------------------------------------------------- */
for (int iBand = 0; iBand < dataset->GetRasterCount(); iBand++)
{
GDALColorTableH hTable;
GDALRasterBandH hBand;
hBand = GDALGetRasterBand(dataset, iBand + 1);
if ((GDALGetRasterColorInterpretation(hBand) == GCI_PaletteIndex) && (hTable = GDALGetRasterColorTable(hBand)) != nullptr)
{
// Mantis: 1049 : OTB does not handle tif with NBITS=1 properly
// When a palette is available and pixel type is Byte, the image is
// automatically read as a color image (using the palette). Perhaps this
// behaviour should be restricted. Comment color table interpretation in
// gdalimageio
// FIXME: Better support of color table in OTB
// - disable palette conversion in GDALImageIO (the comments in this part
// of the code are rather careful)
// - GDALImageIO should report the palette to ImageFileReader (as a metadata ?
// a kind of LUT ?).
// - ImageFileReader should use a kind of adapter filter to convert the mono
// image into color.
// Do not set indexed image attribute to true
// m_IsIndexed = true;
unsigned int ColorEntryCount = GDALGetColorEntryCount(hTable);
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ColorTableNameKey,
static_cast<std::string>(GDALGetPaletteInterpretationName(GDALGetPaletteInterpretation(hTable))));
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::ColorEntryCountKey, ColorEntryCount);
for (int i = 0; i < GDALGetColorEntryCount(hTable); ++i)
{
GDALColorEntry sEntry;
MetaDataKey::VectorType VColorEntry;
GDALGetColorEntryAsRGB(hTable, i, &sEntry);
VColorEntry.push_back(sEntry.c1);
VColorEntry.push_back(sEntry.c2);
VColorEntry.push_back(sEntry.c3);
VColorEntry.push_back(sEntry.c4);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::ColorEntryAsRGBKey, VColorEntry);
}
}
}
if (m_IsIndexed)
{
m_NbBands *= 4;
this->SetNumberOfComponents(m_NbBands);
this->SetPixelType(VECTOR);
}
// Read no data value if present
std::vector<bool> isNoDataAvailable(dataset->GetRasterCount(), false);
std::vector<double> noDataValues(dataset->GetRasterCount(), 0);
bool noDataFound = false;
ImageMetadataBase bmd;
for (int iBand = 0; iBand < dataset->GetRasterCount(); iBand++)
{
GDALRasterBandH hBand = GDALGetRasterBand(dataset, iBand + 1);
int success;
double ndv = GDALGetRasterNoDataValue(hBand, &success);
if (success)
{
noDataFound = true;
isNoDataAvailable[iBand] = true;
noDataValues[iBand] = ndv;
bmd.Add(MDNum::NoData, ndv);
}
m_Imd.Bands.push_back(bmd);
}
if (noDataFound)
{
itk::EncapsulateMetaData<MetaDataKey::BoolVectorType>(dict, MetaDataKey::NoDataValueAvailable, isNoDataAvailable);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::NoDataValue, noDataValues);
}
}
bool GDALImageIO::CanWriteFile(const char* name)
{
// First check the filename
if (name == nullptr)
{
return false;
}
m_FileName = name;
// Get the GDAL format ID from the name
std::string gdalDriverShortName = FilenameToGdalDriverShortName(name);
if (gdalDriverShortName == "NOT-FOUND")
{
return false;
}
// Check the driver for support of Create or at least CreateCopy
GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName);
if (GDALGetMetadataItem(driver, GDAL_DCAP_CREATE, nullptr) == nullptr && GDALGetMetadataItem(driver, GDAL_DCAP_CREATECOPY, nullptr) == nullptr)
{
otbLogMacro(Warning, << "GDAL driver " << GDALGetDriverShortName(driver) << " does not support writing");
return false;
}
return true;
}
bool GDALImageIO::CanStreamWrite()
{
// Get the GDAL format ID from the name
std::string gdalDriverShortName = FilenameToGdalDriverShortName(m_FileName);
GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName);
if (driver == nullptr)
{
m_CanStreamWrite = false;
}
if (GDALGetMetadataItem(driver, GDAL_DCAP_CREATE, nullptr) != nullptr)
{
m_CanStreamWrite = true;
}
else
{
m_CanStreamWrite = false;
}
return m_CanStreamWrite;
}
void GDALImageIO::Write(const void* buffer)
{
// Check if we have to write the image information
if (m_FlagWriteImageInformation == true)
{
this->InternalWriteImageInformation(buffer);
m_FlagWriteImageInformation = false;
}
// Check if conversion succeed
if (buffer == nullptr)
{
itkExceptionMacro(<< "Null buffer passed to GDALImageIO for writing.");
return;
}
// Compute offset and size
unsigned int lNbLines = this->GetIORegion().GetSize()[1];
unsigned int lNbColumns = this->GetIORegion().GetSize()[0];
int lFirstLine = this->GetIORegion().GetIndex()[1]; // [1... ]
int lFirstColumn = this->GetIORegion().GetIndex()[0]; // [1... ]
// Particular case: checking that the written region is the same size
// of the entire image
// starting at offset 0 (when no streaming)
if ((lNbLines == m_Dimensions[1]) && (lNbColumns == m_Dimensions[0]))
{
lFirstLine = 0;
lFirstColumn = 0;
}
// If needed, set the coordinate reference
if (m_epsgCode != 0)
{
auto spatialReference = SpatialReference::FromEPSG(m_epsgCode);
m_Dataset->GetDataSet()->SetProjection(spatialReference.ToWkt().c_str());
}
// Convert buffer from void * to unsigned char *
// unsigned char *p = static_cast<unsigned char*>( const_cast<void *>(buffer));
// printDataBuffer(p, m_PxType->pixType, m_NbBands, 10*2); // Buffer incorrect
// If driver supports streaming
if (m_CanStreamWrite)
{
otbLogMacro(Debug, << "GDAL writes [" << lFirstColumn << ", " << lFirstColumn + lNbColumns - 1 << "]x[" << lFirstLine << ", " << lFirstLine + lNbLines - 1
<< "] x " << m_NbBands << " bands of type " << GDALGetDataTypeName(m_PxType->pixType) << " to file " << m_FileName);
otb::Stopwatch chrono = otb::Stopwatch::StartNew();
CPLErr lCrGdal = m_Dataset->GetDataSet()->RasterIO(GF_Write, lFirstColumn, lFirstLine, lNbColumns, lNbLines, const_cast<void*>(buffer), lNbColumns,
lNbLines, m_PxType->pixType, m_NbBands,
// We want to write all bands
nullptr,
// Pixel offset
// is nbComp * BytePerPixel
m_BytePerPixel * m_NbBands,
// Line offset
// is pixelOffset * nbColumns
m_BytePerPixel * m_NbBands * lNbColumns,
// Band offset is BytePerPixel
m_BytePerPixel);
chrono.Stop();
// Check if writing succeed
if (lCrGdal == CE_Failure)
{
itkExceptionMacro(<< "Error while writing image (GDAL format) '" << m_FileName << "' : " << CPLGetLastErrorMsg());
}
otbLogMacro(Debug, << "GDAL write took " << chrono.GetElapsedMilliseconds() << " ms")
// Flush dataset cache
m_Dataset->GetDataSet()
->FlushCache();
}
else
{
// We only wrote data to the memory dataset
// Now write it to the real file with CreateCopy()
std::string gdalDriverShortName = FilenameToGdalDriverShortName(m_FileName);
std::string realFileName = GetGdalWriteImageFileName(gdalDriverShortName, m_FileName);
GDALDriver* driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName(gdalDriverShortName);
if (driver == nullptr)
{
itkExceptionMacro(<< "Unable to instantiate driver " << gdalDriverShortName << " to write " << m_FileName);
}
GDALCreationOptionsType creationOptions = m_CreationOptions;
GDALDataset* hOutputDS =
driver->CreateCopy(realFileName.c_str(), m_Dataset->GetDataSet(), FALSE, otb::ogr::StringListConverter(creationOptions).to_ogr(), nullptr, nullptr);
if (!hOutputDS)
{
itkExceptionMacro(<< "Error while writing image (GDAL format) '" << m_FileName << "' : " << CPLGetLastErrorMsg());
}
else
{
GDALClose(hOutputDS);
}
}
if (lFirstLine + lNbLines == m_Dimensions[1] && lFirstColumn + lNbColumns == m_Dimensions[0])
{
// Last pixel written
// Reinitialize to close the file
m_Dataset = GDALDatasetWrapperPointer();
}
}
/** TODO : Methode WriteImageInformation non implementee */
void GDALImageIO::WriteImageInformation()
{
}
void GDALImageIO::InternalWriteImageInformation(const void* buffer)
{
// char ** papszOptions = NULL;
std::string driverShortName;
m_NbBands = this->GetNumberOfComponents();
// If the band mapping is different from the one of the input (e.g. because an extended filename
// has been set, the bands in the imageMetadata object needs to be reorganized.
if (!m_BandList.empty())
{
ImageMetadata::ImageMetadataBandsType bandRangeMetadata;
for (auto elem: m_BandList)
{
bandRangeMetadata.push_back(m_Imd.Bands[elem]);
}
m_Imd.Bands = bandRangeMetadata;
}
// TODO : this should be a warning instead of an exception
// For complex pixels the number of bands is twice the number of compnents (in GDAL sense)
if ( !m_Imd.Bands.empty()
&& static_cast<std::size_t>(m_NbBands) != m_Imd.Bands.size()
&& !((m_Imd.Bands.size() == static_cast<std::size_t>(2 * m_NbBands)) && this->GetPixelType() == COMPLEX))
{
itkExceptionMacro(<< "Number of bands in metadata inconsistent with actual image.");
}
if ((m_Dimensions[0] == 0) && (m_Dimensions[1] == 0))
{
itkExceptionMacro(<< "Dimensions are not defined.");
}
if ((this->GetPixelType() == COMPLEX) /*&& (m_NbBands / 2 > 0)*/)
{
// m_NbBands /= 2;
if (this->GetComponentType() == CSHORT)
{
m_BytePerPixel = 4;
m_PxType->pixType = GDT_CInt16;
}
else if (this->GetComponentType() == CINT)
{
m_BytePerPixel = 8;
m_PxType->pixType = GDT_CInt32;
}
else if (this->GetComponentType() == CFLOAT)
{
m_BytePerPixel = 8;
m_PxType->pixType = GDT_CFloat32;
}
else if (this->GetComponentType() == CDOUBLE)
{
m_BytePerPixel = 16;
m_PxType->pixType = GDT_CFloat64;
}
else
{
itkExceptionMacro(<< "This complex type is not defined :" << ImageIOBase::GetPixelTypeAsString(this->GetPixelType()));
}
}
else
{
if (this->GetComponentType() == CHAR)
{
m_BytePerPixel = 1;
m_PxType->pixType = GDT_Byte;
}
else if (this->GetComponentType() == UCHAR)
{
m_BytePerPixel = 1;
m_PxType->pixType = GDT_Byte;
}
else if (this->GetComponentType() == USHORT)
{
m_BytePerPixel = 2;
m_PxType->pixType = GDT_UInt16;
}
else if (this->GetComponentType() == SHORT)
{
m_BytePerPixel = 2;
m_PxType->pixType = GDT_Int16;
}
else if (this->GetComponentType() == INT)
{
m_BytePerPixel = 4;
m_PxType->pixType = GDT_Int32;
}
else if (this->GetComponentType() == UINT)
{
m_BytePerPixel = 4;
m_PxType->pixType = GDT_UInt32;
}
else if (this->GetComponentType() == LONG)
{
m_BytePerPixel = sizeof(long);
if (m_BytePerPixel == 8)
{
itkWarningMacro(<< "Cast a long (64 bits) image into an int (32 bits) one.")
}
m_PxType->pixType = GDT_Int32;
}
else if (this->GetComponentType() == ULONG)
{
m_BytePerPixel = sizeof(unsigned long);
if (m_BytePerPixel == 8)
{
itkWarningMacro(<< "Cast an unsigned long (64 bits) image into an unsigned int (32 bits) one.")
}
m_PxType->pixType = GDT_UInt32;
}
else if (this->GetComponentType() == FLOAT)
{
m_BytePerPixel = 4;
m_PxType->pixType = GDT_Float32;
}
else if (this->GetComponentType() == DOUBLE)
{
m_BytePerPixel = 8;
m_PxType->pixType = GDT_Float64;
}
else
{
m_BytePerPixel = 1;
m_PxType->pixType = GDT_Byte;
}
}
// Automatically set the Type to Binary for GDAL data
this->SetFileTypeToBinary();
driverShortName = FilenameToGdalDriverShortName(m_FileName);
if (driverShortName == "NOT-FOUND")
{
itkExceptionMacro(<< "GDAL Writing failed: the image file name '" << m_FileName << "' is not recognized by GDAL.");
}
if (m_CanStreamWrite)
{
GDALCreationOptionsType creationOptions = m_CreationOptions;
m_Dataset =
GDALDriverManagerWrapper::GetInstance().Create(driverShortName, GetGdalWriteImageFileName(driverShortName, m_FileName), m_Dimensions[0],
m_Dimensions[1], m_NbBands, m_PxType->pixType, otb::ogr::StringListConverter(creationOptions).to_ogr());
}
else
{
// buffer casted in unsigned long cause under Win32 the address
// doesn't begin with 0x, the address in not interpreted as
// hexadecimal but alpha numeric value, then the conversion to
// integer make us pointing to an non allowed memory block => Crash.
// use intptr_t to cast void* to unsigned long. included stdint.h for
// uintptr_t typedef.
std::ostringstream stream;
stream << "MEM:::"
<< "DATAPOINTER=" << (uintptr_t)(buffer) << ","
<< "PIXELS=" << m_Dimensions[0] << ","
<< "LINES=" << m_Dimensions[1] << ","
<< "BANDS=" << m_NbBands << ","
<< "DATATYPE=" << GDALGetDataTypeName(m_PxType->pixType) << ","
<< "PIXELOFFSET=" << m_BytePerPixel * m_NbBands << ","
<< "LINEOFFSET=" << m_BytePerPixel * m_NbBands * m_Dimensions[0] << ","
<< "BANDOFFSET=" << m_BytePerPixel;
m_Dataset = GDALDriverManagerWrapper::GetInstance().Open(stream.str());
}
if (m_Dataset.IsNull())
{
itkExceptionMacro(<< CPLGetLastErrorMsg());
}
/*----------------------------------------------------------------------*/
/*-------------------------- METADATA ----------------------------------*/
/*----------------------------------------------------------------------*/
std::ostringstream oss;
GDALDataset* dataset = m_Dataset->GetDataSet();
// In OTB we can have simultaneously projection ref, sensor keywordlist, GCPs
// but GDAL can't handle both geotransform and GCP (see issue #303). Here is the priority
// order we will be using in OTB:
// [ProjRef+geotransform] > [SensorKeywordlist+geotransform] > [GCPs]
/* -------------------------------------------------------------------- */
/* Pre-compute geotransform */
/* -------------------------------------------------------------------- */
const double Epsilon = 1E-10;
double geoTransform[6];
geoTransform[0] = m_Origin[0] - 0.5 * m_Spacing[0] * m_Direction[0][0];
geoTransform[3] = m_Origin[1] - 0.5 * m_Spacing[1] * m_Direction[1][1];
geoTransform[1] = m_Spacing[0] * m_Direction[0][0];
geoTransform[5] = m_Spacing[1] * m_Direction[1][1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters
geoTransform[2] = 0.;
geoTransform[4] = 0.;
// only write geotransform if it has non-default values
bool writeGeotransform =
std::abs(geoTransform[0]) > Epsilon ||
std::abs(geoTransform[1] - 1.0) > Epsilon ||
std::abs(geoTransform[2]) > Epsilon ||
std::abs(geoTransform[3]) > Epsilon ||
std::abs(geoTransform[4]) > Epsilon ||
std::abs(geoTransform[5] - 1.0) > Epsilon;
itk::MetaDataDictionary& dict = this->GetMetaDataDictionary();
ImageKeywordlist otb_kwl;
itk::ExposeMetaData<ImageKeywordlist>(dict, MetaDataKey::OSSIMKeywordlistKey, otb_kwl);
/* -------------------------------------------------------------------- */
/* Case 1: Set the projection coordinate system of the image */
/* -------------------------------------------------------------------- */
if (m_Imd.Has(MDGeom::ProjectionWKT))
{
std::string projectionRef( m_Imd.GetProjectionWKT() );
dataset->SetProjection(projectionRef.c_str());
}
/* -------------------------------------------------------------------- */
/* Case 2: Sensor geometry */
/* -------------------------------------------------------------------- */
else if (m_Imd.HasSensorGeometry())
{
/* -------------------------------------------------------------------- */
/* Set the RPC coeffs (since GDAL 1.10.0) */
/* -------------------------------------------------------------------- */
if (m_WriteRPCTags && m_Imd.Has(MDGeom::RPC))
{
const Projection::RPCParam & rpc = boost::any_cast<const Projection::RPCParam&>(m_Imd[MDGeom::RPC]);
otbLogMacro(Debug, << "Saving RPC to file (" << m_FileName << ")")
GDALRPCInfo gdalRpcStruct;
gdalRpcStruct.dfSAMP_OFF = rpc.SampleOffset;
gdalRpcStruct.dfLINE_OFF = rpc.LineOffset;
gdalRpcStruct.dfSAMP_SCALE = rpc.SampleScale;
gdalRpcStruct.dfLINE_SCALE = rpc.LineScale;
gdalRpcStruct.dfLAT_OFF = rpc.LatOffset;
gdalRpcStruct.dfLONG_OFF = rpc.LonOffset;
gdalRpcStruct.dfHEIGHT_OFF = rpc.HeightOffset;
gdalRpcStruct.dfLAT_SCALE = rpc.LatScale;
gdalRpcStruct.dfLONG_SCALE = rpc.LonScale;
gdalRpcStruct.dfHEIGHT_SCALE = rpc.HeightScale;
memcpy(gdalRpcStruct.adfLINE_NUM_COEFF, rpc.LineNum, sizeof(double) * 20);
memcpy(gdalRpcStruct.adfLINE_DEN_COEFF, rpc.LineDen, sizeof(double) * 20);
memcpy(gdalRpcStruct.adfSAMP_NUM_COEFF, rpc.SampleNum, sizeof(double) * 20);
memcpy(gdalRpcStruct.adfSAMP_DEN_COEFF, rpc.SampleDen, sizeof(double) * 20);
char** rpcMetadata = RPCInfoToMD(&gdalRpcStruct);
dataset->SetMetadata(rpcMetadata, "RPC");
CSLDestroy(rpcMetadata);
}
}
// ToDo : remove this part. This case is here for compatibility for images
// that still use Ossim for managing the sensor model (with OSSIMKeywordList).
else if (otb_kwl.GetSize())
{
/* -------------------------------------------------------------------- */
/* Set the RPC coeffs (since GDAL 1.10.0) */
/* -------------------------------------------------------------------- */
if (m_WriteRPCTags)
{
GDALRPCInfo gdalRpcStruct;
if (otb_kwl.convertToGDALRPC(gdalRpcStruct))
{
otbLogMacro(Debug, << "Saving RPC to file (" << m_FileName << ")")
char** rpcMetadata = RPCInfoToMD(&gdalRpcStruct);
dataset->SetMetadata(rpcMetadata, "RPC");
CSLDestroy(rpcMetadata);
}
}
}
/* -------------------------------------------------------------------- */
/* Case 3: Set the GCPs */
/* -------------------------------------------------------------------- */
else if (m_Imd.Has(MDGeom::GCP))
{
otbLogMacro(Debug, << "Saving GCPs to file (" << m_FileName << ")")
const Projection::GCPParam & gcpPrm =
boost::any_cast<const Projection::GCPParam&>(m_Imd[MDGeom::GCP]);
std::vector<GDAL_GCP> gdalGcps(gcpPrm.GCPs.size());
for (unsigned int gcpIndex = 0; gcpIndex < gdalGcps.size(); ++gcpIndex)
{
const GCP &gcp = gcpPrm.GCPs[gcpIndex];
gdalGcps[gcpIndex].pszId = const_cast<char*>(gcp.m_Id.c_str());
gdalGcps[gcpIndex].pszInfo = const_cast<char*>(gcp.m_Info.c_str());
gdalGcps[gcpIndex].dfGCPPixel = gcp.m_GCPCol;
gdalGcps[gcpIndex].dfGCPLine = gcp.m_GCPRow;
gdalGcps[gcpIndex].dfGCPX = gcp.m_GCPX;
gdalGcps[gcpIndex].dfGCPY = gcp.m_GCPY;
gdalGcps[gcpIndex].dfGCPZ = gcp.m_GCPZ;
if (writeGeotransform)
{
// we need to transform GCP col and row accordingly
// WARNING: assume no rotation is there
gdalGcps[gcpIndex].dfGCPPixel = (gcp.m_GCPCol - geoTransform[0]) / geoTransform[1];
gdalGcps[gcpIndex].dfGCPLine = (gcp.m_GCPRow - geoTransform[3]) / geoTransform[5];
}
}
const std::string & gcpProjectionRef = gcpPrm.GCPProjection;
dataset->SetGCPs(gdalGcps.size(), gdalGcps.data(), gcpProjectionRef.c_str());
// disable geotransform with GCP
writeGeotransform = false;
}
/* -------------------------------------------------------------------- */
/* Save geotransform if needed. */
/* -------------------------------------------------------------------- */
if (writeGeotransform)
{
if ( driverShortName == "ENVI" && geoTransform[5] > 0.)
{
// Error if writing to a ENVI file with a positive Y spacing
itkExceptionMacro(<< "Can not write to ENVI file format with a positive Y spacing (" << m_FileName << ")");
}
dataset->SetGeoTransform(geoTransform);
}
/* -------------------------------------------------------------------- */
/* Report metadata. */
/* -------------------------------------------------------------------- */
ExportMetadata();
/* -------------------------------------------------------------------- */
/* No Data. */
/* -------------------------------------------------------------------- */
// Write no-data flags from ImageMetadata
int iBand = 0;
for (auto const& bandMD : m_Imd.Bands)
{
if (bandMD.Has(MDNum::NoData))
{
dataset->GetRasterBand(iBand + 1)->SetNoDataValue(bandMD[MDNum::NoData]);
}
++iBand;
}
// Write no-data flags from extended filenames
for (auto const& noData : m_NoDataList)
dataset->GetRasterBand(noData.first)->SetNoDataValue(noData.second);
}
std::string GDALImageIO::FilenameToGdalDriverShortName(const std::string& name) const
{
std::string extension;
std::string gdalDriverShortName;
// Get extension in lowercase
extension = itksys::SystemTools::LowerCase(itksys::SystemTools::GetFilenameLastExtension(name));
if (extension == ".tif" || extension == ".tiff")
gdalDriverShortName = "GTiff";
else if (extension == ".hdr")
gdalDriverShortName = "ENVI";
else if (extension == ".img")
gdalDriverShortName = "HFA";
else if (extension == ".ntf")
gdalDriverShortName = "NITF";
else if (extension == ".png")
gdalDriverShortName = "PNG";
else if (extension == ".jpg" || extension == ".jpeg")
gdalDriverShortName = "JPEG";
else if (extension == ".pix")
gdalDriverShortName = "PCIDSK";
else if (extension == ".lbl" || extension == ".pds")
gdalDriverShortName = "ISIS2";
else if (extension == ".j2k" || extension == ".jp2" || extension == ".jpx")
{
// Try different JPEG2000 drivers
GDALDriver* driver = nullptr;
driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName("JP2OpenJPEG");
if (driver)
{
gdalDriverShortName = "JP2OpenJPEG";
}
if (!driver)
{
driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName("JP2KAK");
if (driver)
{
gdalDriverShortName = "JP2KAK";
}
}
if (!driver)
{
driver = GDALDriverManagerWrapper::GetInstance().GetDriverByName("JP2ECW");
if (driver)
{
gdalDriverShortName = "JP2ECW";
}
}
if (!driver)
{
gdalDriverShortName = "NOT-FOUND";
}
}
else
gdalDriverShortName = "NOT-FOUND";
return gdalDriverShortName;
}
bool GDALImageIO::GetOriginFromGMLBox(std::vector<double>& origin)
{
GDALJP2Metadata jp2Metadata;
if (!jp2Metadata.ReadAndParse(m_FileName.c_str()))
{
return false;
}
if (!jp2Metadata.papszGMLMetadata)
{
return false;
}
std::string gmlString = static_cast<std::string>(jp2Metadata.papszGMLMetadata[0]);
gmlString.erase(0, 18); // We need to remove first part to create a true xml stream
TiXmlDocument doc;
doc.Parse(gmlString.c_str()); // Create xml doc from a string
TiXmlHandle docHandle(&doc);
TiXmlElement* originTag = docHandle.FirstChild("gml:FeatureCollection")
.FirstChild("gml:featureMember")
.FirstChild("gml:FeatureCollection")
.FirstChild("gml:featureMember")
.FirstChild("gml:GridCoverage")
.FirstChild("gml:gridDomain")
.FirstChild("gml:Grid")
.FirstChild("gml:limits")
.FirstChild("gml:GridEnvelope")
.FirstChild("gml:low")
.ToElement();
if (!originTag)
{
return false;
}
std::vector<itksys::String> originValues;
originValues = itksys::SystemTools::SplitString(originTag->GetText(), ' ', false);
// Compute origin in GDAL convention (the half-pixel shift is applied later)
std::istringstream ss0(originValues[0]);
std::istringstream ss1(originValues[1]);
ss0 >> origin[1];
ss1 >> origin[0];
origin[0] += -1.0;
origin[1] += -1.0;
return true;
}
std::string GDALImageIO::GetGdalWriteImageFileName(const std::string& gdalDriverShortName, const std::string& filename) const
{
std::string gdalFileName;
gdalFileName = filename;
// Suppress hdr extension for ENVI format
if (gdalDriverShortName == "ENVI")
{
gdalFileName = System::GetRootName(filename);
}
return gdalFileName;
}
bool GDALImageIO::GDALInfoReportCorner(const char* /*corner_name*/, double x, double y, double& GeoX, double& GeoY) const
{
double adfGeoTransform[6];
bool IsTrue;
/* -------------------------------------------------------------------- */
/* Transform the point into georeferenced coordinates. */
/* -------------------------------------------------------------------- */
if (m_Dataset->GetDataSet()->GetGeoTransform(adfGeoTransform) == CE_None)
{
GeoX = adfGeoTransform[0] + adfGeoTransform[1] * x + adfGeoTransform[2] * y;
GeoY = adfGeoTransform[3] + adfGeoTransform[4] * x + adfGeoTransform[5] * y;
IsTrue = true;
}
else
{
GeoX = x;
GeoY = y;
IsTrue = false;
}
return IsTrue;
}
bool GDALImageIO::CreationOptionContains(std::string partialOption) const
{
size_t i;
for (i = 0; i < m_CreationOptions.size(); ++i)
{
if (boost::algorithm::starts_with(m_CreationOptions[i], partialOption))
{
break;
}
}
return (i != m_CreationOptions.size());
}
std::string GDALImageIO::GetGdalPixelTypeAsString() const
{
std::string name = GDALGetDataTypeName(m_PxType->pixType);
return name;
}
int GDALImageIO::GetNbBands() const
{
return m_Dataset->GetDataSet()->GetRasterCount();
}
std::string GDALImageIO::GetResourceFile(std::string str) const
{
if (str.empty())
return m_FileName;
itksys::RegularExpression reg;
reg.compile(str);
for (auto & filename : GetResourceFiles())
if (reg.find(filename))
return filename;
return std::string("");
}
std::vector<std::string> GDALImageIO::GetResourceFiles() const
{
std::vector<std::string> result;
for (char ** file = this->m_Dataset->GetDataSet()->GetFileList() ; *file != nullptr ; ++ file)
result.push_back(*file);
return result;
}
std::string GDALImageIO::GetMetadataValue(const std::string path, bool& hasValue, int band) const
{
// detect namespace if any
std::string domain("");
std::string key(path);
std::size_t found = path.find_first_of("/");
if (found != std::string::npos)
{
domain = path.substr(0, found);
key = path.substr(found + 1);
}
const char* ret;
if (band >= 0)
ret = m_Dataset->GetDataSet()->GetRasterBand(band+1)->GetMetadataItem(key.c_str(), domain.c_str());
else
ret = m_Dataset->GetDataSet()->GetMetadataItem(key.c_str(), domain.c_str());
if (ret)
hasValue = true;
else
{
hasValue = false;
ret = "";
}
return std::string(ret);
}
void GDALImageIO::SetMetadataValue(const char * path, const char * value, int band)
{
// detect namespace if any
const char *slash = strchr(path,'/');
std::string domain("");
const char *domain_c = nullptr;
std::string key(path);
if (slash)
{
domain = std::string(path, (slash-path));
domain_c = domain.c_str();
key = std::string(slash+1);
}
if (band >= 0)
{
m_Dataset->GetDataSet()->GetRasterBand(band+1)->SetMetadataItem(key.c_str(), value, domain_c);
}
else
{
m_Dataset->GetDataSet()->SetMetadataItem(key.c_str(), value, domain_c);
}
}
void GDALImageIO::ExportMetadata()
{
SetMetadataValue("METADATATYPE", "OTB");
SetMetadataValue("OTB_VERSION", OTB_VERSION_STRING );
// TODO: finish implementation: filter the keys MDGeom::SensorGeometry that
// will be exported as '<typename>' (boost::any). The (future) SensorModelFactory should
// be used to detect and export properly the field MDGeom::SensorGeometry into a string
// keywordlist. Note that the keys generated for this sensor geometry should
// be prefixed by: MDGeomNames[MDGeom::SensorGeometry] + '.'
ImageMetadataBase::Keywordlist kwl;
m_Imd.ToKeywordlist(kwl);
KeywordlistToMetadata(kwl);
int bIdx = 0;
for (const auto& band : m_Imd.Bands)
{
band.ToKeywordlist(kwl);
KeywordlistToMetadata(kwl, bIdx);
++bIdx;
}
}
void GDALImageIO::ImportMetadata()
{
// TODO
// Check special value METADATATYPE=OTB before continue processing
// Keys Starting with: MDGeomNames[MDGeom::SensorGeometry] + '.' should
// be decoded by the (future) SensorModelFactory.
// Use ImageMetadataBase::FromKeywordlist to ingest the metadata
bool hasValue;
if (std::string(GetMetadataValue("METADATATYPE", hasValue)) != "OTB")
return;
ImageMetadataBase::Keywordlist kwl;
GDALMetadataToKeywordlist(m_Dataset->GetDataSet()->GetMetadata(), kwl);
m_Imd.FromKeywordlist(kwl);
// GCPs are imported directly in the ImageMetadata.
m_Imd.Add(MDGeom::GCP, m_Dataset->GetGCPParam());
// Parsing the bands
for (int band = 0 ; band < m_NbBands ; ++band)
{
kwl.clear();
GDALMetadataToKeywordlist(m_Dataset->GetDataSet()->GetRasterBand(band+1)->GetMetadata(), kwl);
m_Imd.Bands[band].FromKeywordlist(kwl);
}
}
void GDALImageIO::KeywordlistToMetadata(ImageMetadataBase::Keywordlist kwl, int band)
{
for (const auto& kv : kwl)
{
if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::SensorGeometry))
{
SetMetadataValue("MDGeomNames[MDGeom::SensorGeometry].", kv.second.c_str(), band);
}
else if (kv.first == MetaData::MDGeomNames.left.at(MDGeom::RPC))
{
// RPC Models are exported directly from the ImageMetadata.
Projection::RPCParam rpcStruct = boost::any_cast<Projection::RPCParam>(m_Imd[MDGeom::RPC]);
this->SetAs("RPC/LINE_OFF", rpcStruct.LineOffset);
this->SetAs("RPC/SAMP_OFF", rpcStruct.SampleOffset);
this->SetAs("RPC/LAT_OFF", rpcStruct.LatOffset);
this->SetAs("RPC/LONG_OFF", rpcStruct.LonOffset);
this->SetAs("RPC/HEIGHT_OFF", rpcStruct.HeightOffset);
this->SetAs("RPC/LINE_SCALE", rpcStruct.LineScale);
this->SetAs("RPC/SAMP_SCALE", rpcStruct.SampleScale);
this->SetAs("RPC/LAT_SCALE", rpcStruct.LatScale);
this->SetAs("RPC/LONG_SCALE", rpcStruct.LonScale);
this->SetAs("RPC/HEIGHT_SCALE", rpcStruct.HeightScale);
this->SetAsVector("RPC/LINE_NUM_COEFF", std::vector<double> (rpcStruct.LineNum, rpcStruct.LineNum + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/LINE_DEN_COEFF", std::vector<double> (rpcStruct.LineDen, rpcStruct.LineDen + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/SAMP_NUM_COEFF", std::vector<double> (rpcStruct.SampleNum, rpcStruct.SampleNum + 20 / sizeof(double)), ' ');
this->SetAsVector("RPC/SAMP_DEN_COEFF", std::vector<double> (rpcStruct.SampleDen, rpcStruct.SampleDen + 20 / sizeof(double)), ' ');
}
// Note that GCPs have already been exported
SetMetadataValue(kv.first.c_str(), kv.second.c_str(), band);
}
}
void GDALImageIO::GDALMetadataToKeywordlist(const char* const* metadataList, ImageMetadataBase::Keywordlist &kwl)
{
// The GDAL metadata string list is formatted as a “Name=value” list with the last pointer value being NULL.
for ( ; *metadataList != nullptr ; ++metadataList )
{
std::string metadataLine = std::string(*metadataList);
// The key and the value are separated by the '=' symbol
std::string::size_type pos = metadataLine.find('=');
std::string fieldName = metadataLine.substr(0, pos);
std::string fieldValue = metadataLine.substr(pos+1);
if((fieldName.size() > 36) && (fieldName.substr(0, 36) == "MDGeomNames[MDGeom::SensorGeometry]."))
{
// Sensor Geometry is imported directly in the ImageMetadata.
// TODO: Keys Starting with: MDGeomNames[MDGeom::SensorGeometry] + '.' should
// be decoded by the (future) SensorModelFactory.
}
else if (fieldName == MetaData::MDGeomNames.left.at(MDGeom::RPC))
{
// RPC Models are imported directly in the ImageMetadata.
Projection::RPCParam rpcStruct;
rpcStruct.LineOffset = this->GetAs<double>("RPC/LINE_OFF");
rpcStruct.SampleOffset = this->GetAs<double>("RPC/SAMP_OFF");
rpcStruct.LatOffset = this->GetAs<double>("RPC/LAT_OFF");
rpcStruct.LonOffset = this->GetAs<double>("RPC/LONG_OFF");
rpcStruct.HeightOffset = this->GetAs<double>("RPC/HEIGHT_OFF");
rpcStruct.LineScale = this->GetAs<double>("RPC/LINE_SCALE");
rpcStruct.SampleScale = this->GetAs<double>("RPC/SAMP_SCALE");
rpcStruct.LatScale = this->GetAs<double>("RPC/LAT_SCALE");
rpcStruct.LonScale = this->GetAs<double>("RPC/LONG_SCALE");
rpcStruct.HeightScale = this->GetAs<double>("RPC/HEIGHT_SCALE");
std::vector<double> coeffs(20);
coeffs = this->GetAsVector<double>("RPC/LINE_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineNum);
coeffs = this->GetAsVector<double>("RPC/LINE_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineDen);
coeffs = this->GetAsVector<double>("RPC/SAMP_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleNum);
coeffs = this->GetAsVector<double>("RPC/SAMP_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleDen);
m_Imd.Add(MDGeom::RPC, rpcStruct);
}
else
kwl.emplace(fieldName, fieldValue);
}
}
} // end namespace otb
| 33.93129 | 159 | 0.60685 |
10199b36c9396fda4869b2998fbe8f691af2a4bb | 2,817 | cpp | C++ | Sem2/C++/Assignment 1/bank.cpp | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | null | null | null | Sem2/C++/Assignment 1/bank.cpp | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | null | null | null | Sem2/C++/Assignment 1/bank.cpp | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | 2 | 2018-10-12T06:38:14.000Z | 2019-01-30T04:38:03.000Z | #include <iostream>
#include <cstring>
using namespace std;
class Bank{
public:
char name[20];
char account_no[20];
char type[10];
float bal;
Bank()
{
bal = 0;
}
void deposit();
void withdraw();
void balance();
};
void Bank::deposit()
{
float amount;
cout << "Enter the amount to deposit: " << endl;
cin >> amount;
bal = bal + amount;
cout << "Amount " << amount << " deposited" << endl;
}
void Bank::withdraw()
{
float amount;
cout << "Enter the amount to withdraw: " << endl;
cin >> amount;
if(bal < amount){
cout << "Insufficient Balance.." << endl;
}
else{
bal = bal - amount;
cout << "Amount " << amount << " withdrawn" << endl;
}
}
void Bank::balance()
{
cout << "Balance = " << bal << endl;
}
int main()
{
Bank customers[20];
int n;
cout << "Enter no of customers: " << endl;
cin >> n;
for (int i = 0; i < n; i++)
{
cout << "Enter customer " << i + 1 << " details: " << endl;
cout << "Enter name: " << endl;
cin >> customers[i].name;
cout << "Enter account number: " << endl;
cin >> customers[i].account_no;
cout << "Enter account type: " << endl;
cin >> customers[i].type;
}
int choice;
char acc_num[20];
while(1){
cout << "Enter what operation to be performed: " << endl;
cout << "1. Deposit" << endl;
cout << "2. Withdraw" << endl;
cout << "3. Balance" << endl;
cin >> choice;
if(choice == 0){
break;
}
cout << "Enter account no: " << endl;
cin >> acc_num;
switch(choice)
{
case 1:
for (int i = 0; i < n; i++)
{
if (!strcmp(acc_num, customers[i].account_no))
{
customers[i].deposit();
break;
}
}
break;
case 2:
for (int i = 0; i < n; i++)
{
if (!strcmp(acc_num, customers[i].account_no))
{
customers[i].withdraw();
break;
}
}
break;
case 3:
for (int i = 0; i < n; i++)
{
if (!strcmp(acc_num, customers[i].account_no))
{
customers[i].balance();
break;
}
}
break;
default:
cout << "Invalid option.." << endl;
}
}
} | 22.357143 | 67 | 0.392261 |
101a6a2ecf7b509437247786d83a1ea6b1b78fe2 | 992,789 | cxx | C++ | src/tpetra/src/fortpetraFORTRAN_wrap.cxx | sethrj/ForTrilinos | f25352a6910297ddb97369288b51734cde0ab1b5 | [
"BSD-3-Clause"
] | null | null | null | src/tpetra/src/fortpetraFORTRAN_wrap.cxx | sethrj/ForTrilinos | f25352a6910297ddb97369288b51734cde0ab1b5 | [
"BSD-3-Clause"
] | null | null | null | src/tpetra/src/fortpetraFORTRAN_wrap.cxx | sethrj/ForTrilinos | f25352a6910297ddb97369288b51734cde0ab1b5 | [
"BSD-3-Clause"
] | null | null | null | /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.0
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
/*
* Copyright 2017, UT-Battelle, LLC
*
* SPDX-License-Identifier: BSD-3-Clause
* License-Filename: LICENSE
*/
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
struct SwigMovePointer {
T *ptr;
SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointer() { delete ptr; }
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
} pointer;
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
SwigValueWrapper() : pointer(0) { }
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const { return *pointer.ptr; }
T *operator&() { return pointer.ptr; }
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if defined(__GNUC__)
# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif
/* Intel's compiler complains if a variable which was never initialised is
* cast to void, which is a common idiom which we use to indicate that we
* are aware a variable isn't used. So we just silence that warning.
* See: https://github.com/swig/swig/issues/192 for more discussion.
*/
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif
#ifndef SWIGEXTERN
#ifdef __cplusplus
#define SWIGEXTERN extern
#else
#define SWIGEXTERN
#endif
#endif
/* Errors in SWIG */
#define SWIG_UnknownError -1
#define SWIG_IOError -2
#define SWIG_RuntimeError -3
#define SWIG_IndexError -4
#define SWIG_TypeError -5
#define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7
#define SWIG_SyntaxError -8
#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
// Default exception handler
#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \
throw std::logic_error("In " DECL ": " MSG); RETURNNULL;
/* Contract support */
#define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \
if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); }
#undef SWIG_exception_impl
#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \
SWIG_store_exception(DECL, CODE, MSG); RETURNNULL;
void SWIG_check_unhandled_exception_impl(const char* decl);
void SWIG_store_exception(const char* decl, int errcode, const char *msg);
#define SWIG_check_sp_nonnull(INPUT, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \
if (!(INPUT)) { \
SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \
"Cannot pass null " TYPENAME " (class " FNAME ") " \
"as a reference", RETURNNULL); \
}
#if __cplusplus >= 201103L
#define SWIG_assign(LEFTTYPE, LEFT, RIGHTTYPE, RIGHT, FLAGS) \
SWIG_assign_impl<LEFTTYPE , RIGHTTYPE, swig::assignment_flags<LEFTTYPE >() >( \
LEFT, RIGHT);
#else
#define SWIG_assign(LEFTTYPE, LEFT, RIGHTTYPE, RIGHT, FLAGS) \
SWIG_assign_impl<LEFTTYPE , RIGHTTYPE, FLAGS >(LEFT, RIGHT);
#endif
#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \
if ((SWIG_CLASS_WRAPPER).mem == SWIG_NULL) { \
SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \
"Cannot pass null " TYPENAME " (class " FNAME ") " \
"as a reference", RETURNNULL); \
}
#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \
if ((SWIG_CLASS_WRAPPER).mem == SWIG_CREF) { \
SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \
"Cannot pass const " TYPENAME " (class " FNAME ") " \
"as a mutable reference", \
RETURNNULL); \
}
#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \
SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \
SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL);
#define SWIGVERSION 0x040000
#define SWIG_VERSION SWIGVERSION
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#include <stdexcept>
#include <utility>
#include <string>
#include "Tpetra_ConfigDefs.hpp"
typedef double SC;
typedef int LO;
typedef long long GO;
typedef Kokkos::Compat::KokkosSerialWrapperNode NO;
typedef char Packet;
enum SwigMemState {
SWIG_NULL = 0,
SWIG_OWN,
SWIG_MOVE,
SWIG_REF,
SWIG_CREF
};
struct SwigClassWrapper
{
void* ptr;
SwigMemState mem;
};
SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized()
{
SwigClassWrapper result;
result.ptr = NULL;
result.mem = SWIG_NULL;
return result;
}
struct SwigArrayWrapper
{
void* data;
std::size_t size;
};
SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized()
{
SwigArrayWrapper result;
result.data = NULL;
result.size = 0;
return result;
}
#include "Teuchos_RCP.hpp"
#include "Tpetra_Map.hpp"
#define SWIG_NO_NULL_DELETER_0 , Teuchos::RCP_WEAK_NO_DEALLOC
#define SWIG_NO_NULL_DELETER_1
#define SWIG_NO_NULL_DELETER_SWIG_POINTER_NEW
#define SWIG_NO_NULL_DELETER_SWIG_POINTER_OWN
SWIGINTERN SwigArrayWrapper SWIG_store_string(const std::string& str)
{
static std::string* temp = NULL;
SwigArrayWrapper result;
if (str.empty())
{
// Result is empty
result.data = NULL;
result.size = 0;
}
else
{
if (!temp)
{
// Allocate a new temporary string
temp = new std::string(str);
}
else
{
// Assign the string
*temp = str;
}
result.data = &(*(temp->begin()));
result.size = temp->size();
}
return result;
}
SWIGINTERN Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_1(Tpetra::global_size_t numGlobalElements,Teuchos::RCP< Teuchos::Comm< int > const > const &comm,Tpetra::LocalGlobal lg=Tpetra::GloballyDistributed){
return new Tpetra::Map<LO,GO,NO>(numGlobalElements, 1/*indexBase*/, comm, lg);
}
SWIGINTERN Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_3(Tpetra::global_size_t numGlobalElements,size_t numLocalElements,Teuchos::RCP< Teuchos::Comm< int > const > const &comm){
return new Tpetra::Map<LO,GO,NO>(numGlobalElements, numLocalElements, 1/*indexBase*/, comm);
}
SWIGINTERN Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_4(Tpetra::global_size_t const numGlobalElements,std::pair< GO const *,std::size_t > indexList,Teuchos::RCP< Teuchos::Comm< int > const > const &comm){
Teuchos::ArrayView<const GO> indexListView = Teuchos::arrayView(indexList.first, indexList.second);
return new Tpetra::Map<LO,GO,NO>(numGlobalElements, indexListView, 1/*indexBase*/, comm);
}
SWIGINTERN Tpetra::LookupStatus Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getRemoteIndexList__SWIG_0(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *self,std::pair< GO const *,std::size_t > GIDList,std::pair< int *,std::size_t > nodeIDList,std::pair< LO *,std::size_t > LIDList){
Teuchos::ArrayView<const GO> GIDListView = Teuchos::arrayView(GIDList.first, GIDList.second);
Teuchos::ArrayView<int> nodeIDListView = Teuchos::arrayView(nodeIDList.first, nodeIDList.second);
Teuchos::ArrayView<LO> LIDListView = Teuchos::arrayView(LIDList.first, LIDList.second);
return self->getRemoteIndexList(GIDListView, nodeIDListView, LIDListView);
}
SWIGINTERN Tpetra::LookupStatus Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getRemoteIndexList__SWIG_1(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *self,std::pair< GO const *,std::size_t > GIDList,std::pair< int *,std::size_t > nodeIDList){
Teuchos::ArrayView<const GO> GIDListView = Teuchos::arrayView(GIDList.first, GIDList.second);
Teuchos::ArrayView<int> nodeIDListView = Teuchos::arrayView(nodeIDList.first, nodeIDList.second);
return self->getRemoteIndexList(GIDListView, nodeIDListView);
}
SWIGINTERN std::pair< GO const *,std::size_t > Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getNodeElementList(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *self){
auto view = self->getNodeElementList();
return std::make_pair<const GO*,size_t>(view.getRawPtr(), view.size());
}
namespace swig {
enum AssignmentFlags {
IS_DESTR = 0x01,
IS_COPY_CONSTR = 0x02,
IS_COPY_ASSIGN = 0x04,
IS_MOVE_CONSTR = 0x08,
IS_MOVE_ASSIGN = 0x10
};
// Define our own switching struct to support pre-c++11 builds
template<bool Val>
struct bool_constant {};
typedef bool_constant<true> true_type;
typedef bool_constant<false> false_type;
// Deletion
template<class T>
SWIGINTERN void destruct_impl(T* self, true_type) {
delete self;
}
template<class T>
SWIGINTERN T* destruct_impl(T* , false_type) {
SWIG_exception_impl("assignment", SWIG_TypeError,
"Invalid assignment: class type has no destructor",
return NULL);
}
// Copy construction and assignment
template<class T, class U>
SWIGINTERN T* copy_construct_impl(const U* other, true_type) {
return new T(*other);
}
template<class T, class U>
SWIGINTERN void copy_assign_impl(T* self, const U* other, true_type) {
*self = *other;
}
// Disabled construction and assignment
template<class T, class U>
SWIGINTERN T* copy_construct_impl(const U* , false_type) {
SWIG_exception_impl("assignment", SWIG_TypeError,
"Invalid assignment: class type has no copy constructor",
return NULL);
}
template<class T, class U>
SWIGINTERN void copy_assign_impl(T* , const U* , false_type) {
SWIG_exception_impl("assignment", SWIG_TypeError,
"Invalid assignment: class type has no copy assignment",
return);
}
#if __cplusplus >= 201103L
#include <utility>
#include <type_traits>
// Move construction and assignment
template<class T, class U>
SWIGINTERN T* move_construct_impl(U* other, true_type) {
return new T(std::move(*other));
}
template<class T, class U>
SWIGINTERN void move_assign_impl(T* self, U* other, true_type) {
*self = std::move(*other);
}
// Disabled move construction and assignment
template<class T, class U>
SWIGINTERN T* move_construct_impl(U*, false_type) {
SWIG_exception_impl("assignment", SWIG_TypeError,
"Invalid assignment: class type has no move constructor",
return NULL);
}
template<class T, class U>
SWIGINTERN void move_assign_impl(T*, U*, false_type) {
SWIG_exception_impl("assignment", SWIG_TypeError,
"Invalid assignment: class type has no move assignment",
return);
}
template<class T>
constexpr int assignment_flags() {
return (std::is_destructible<T>::value ? IS_DESTR : 0)
| (std::is_copy_constructible<T>::value ? IS_COPY_CONSTR : 0)
| (std::is_copy_assignable<T>::value ? IS_COPY_ASSIGN : 0)
| (std::is_move_constructible<T>::value ? IS_MOVE_CONSTR : 0)
| (std::is_move_assignable<T>::value ? IS_MOVE_ASSIGN : 0);
}
#endif
template<class T, int Flags>
struct AssignmentTraits
{
static void destruct(T* self)
{
destruct_impl<T>(self, bool_constant<Flags & IS_DESTR>());
}
template<class U>
static T* copy_construct(const U* other)
{
return copy_construct_impl<T,U>(other, bool_constant<bool(Flags & IS_COPY_CONSTR)>());
}
template<class U>
static void copy_assign(T* self, const U* other)
{
copy_assign_impl<T,U>(self, other, bool_constant<bool(Flags & IS_COPY_ASSIGN)>());
}
#if __cplusplus >= 201103L
template<class U>
static T* move_construct(U* other)
{
return move_construct_impl<T,U>(other, bool_constant<bool(Flags & IS_MOVE_CONSTR)>());
}
template<class U>
static void move_assign(T* self, U* other)
{
move_assign_impl<T,U>(self, other, bool_constant<bool(Flags & IS_MOVE_ASSIGN)>());
}
#else
template<class U>
static T* move_construct(U* other)
{
return copy_construct_impl<T,U>(other, bool_constant<bool(Flags & IS_COPY_CONSTR)>());
}
template<class U>
static void move_assign(T* self, U* other)
{
copy_assign_impl<T,U>(self, other, bool_constant<bool(Flags & IS_COPY_ASSIGN)>());
}
#endif
};
} // end namespace swig
template<class T1, class T2, int AFlags>
SWIGINTERN void SWIG_assign_impl(SwigClassWrapper* self, SwigClassWrapper* other) {
typedef swig::AssignmentTraits<T1, AFlags> Traits_t;
T1* pself = static_cast<T1*>(self->ptr);
T2* pother = static_cast<T2*>(other->ptr);
switch (self->mem) {
case SWIG_NULL:
/* LHS is unassigned */
switch (other->mem) {
case SWIG_NULL: /* null op */ break;
case SWIG_MOVE: /* capture pointer from RHS */
self->ptr = other->ptr;
other->ptr = NULL;
self->mem = SWIG_OWN;
other->mem = SWIG_NULL;
break;
case SWIG_OWN: /* copy from RHS */
self->ptr = Traits_t::copy_construct(pother);
self->mem = SWIG_OWN;
break;
case SWIG_REF: /* pointer to RHS */
case SWIG_CREF:
self->ptr = other->ptr;
self->mem = other->mem;
break;
}
break;
case SWIG_OWN:
/* LHS owns memory */
switch (other->mem) {
case SWIG_NULL:
/* Delete LHS */
Traits_t::destruct(pself);
self->ptr = NULL;
self->mem = SWIG_NULL;
break;
case SWIG_MOVE:
/* Move RHS into LHS; delete RHS */
Traits_t::move_assign(pself, pother);
Traits_t::destruct(pother);
other->ptr = NULL;
other->mem = SWIG_NULL;
break;
case SWIG_OWN:
case SWIG_REF:
case SWIG_CREF:
/* Copy RHS to LHS */
Traits_t::copy_assign(pself, pother);
break;
}
break;
case SWIG_MOVE:
SWIG_exception_impl("assignment", SWIG_RuntimeError,
"Left-hand side of assignment should never be in a 'MOVE' state",
return);
break;
case SWIG_REF:
/* LHS is a reference */
switch (other->mem) {
case SWIG_NULL:
/* Remove LHS reference */
self->ptr = NULL;
self->mem = SWIG_NULL;
break;
case SWIG_MOVE:
/* Move RHS into LHS; delete RHS. The original ownership stays the
* same. */
Traits_t::move_assign(pself, pother);
Traits_t::destruct(pother);
other->ptr = NULL;
other->mem = SWIG_NULL;
break;
case SWIG_OWN:
case SWIG_REF:
case SWIG_CREF:
/* Copy RHS to LHS */
Traits_t::copy_assign(pself, pother);
break;
}
case SWIG_CREF:
switch (other->mem) {
case SWIG_NULL:
/* Remove LHS reference */
self->ptr = NULL;
self->mem = SWIG_NULL;
default:
SWIG_exception_impl("assignment", SWIG_RuntimeError,
"Cannot assign to a const reference", return);
break;
}
}
}
#include "Tpetra_Export.hpp"
#include "Tpetra_Import.hpp"
#include "Tpetra_MultiVector.hpp"
SWIGINTERN Tpetra::MultiVector< SC,LO,GO,NO > *new_Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_7(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &map,std::pair< SC const *,std::size_t > A,size_t const LDA,size_t const NumVectors){
Teuchos::ArrayView<const SC> AView = Teuchos::arrayView(A.first, A.second);
return new Tpetra::MultiVector<SC,LO,GO,NO>(map, AView, LDA, NumVectors);
}
SWIGINTERN std::pair< SC const *,std::size_t > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getData(Tpetra::MultiVector< SC,LO,GO,NO > const *self,size_t j){
Teuchos::ArrayRCP<const SC> a = self->getData(j);
return std::make_pair<const SC*,size_t>(a.get(), a.size());
}
SWIGINTERN std::pair< SC *,std::size_t > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getDataNonConst(Tpetra::MultiVector< SC,LO,GO,NO > *self,size_t j){
Teuchos::ArrayRCP<SC> a = self->getDataNonConst(j);
return std::make_pair<SC*,size_t>(a.get(), a.size());
}
SWIGINTERN Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subCopy(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< std::size_t const *,std::size_t > cols){
Teuchos::Array<size_t> colsArray(cols.second);
for (int i = 0; i < colsArray.size(); i++)
colsArray[i] = cols.first[i]-1;
return self->subCopy(colsArray);
}
SWIGINTERN Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subView(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< std::size_t const *,std::size_t > cols){
Teuchos::Array<size_t> colsArray(cols.second);
for (int i = 0; i < colsArray.size(); i++)
colsArray[i] = cols.first[i]-1;
return self->subView(colsArray);
}
SWIGINTERN Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subViewNonConst(Tpetra::MultiVector< SC,LO,GO,NO > *self,std::pair< std::size_t const *,std::size_t > cols){
Teuchos::Array<size_t> colsArray(cols.second);
for (int i = 0; i < colsArray.size(); i++)
colsArray[i] = cols.first[i]-1;
return self->subViewNonConst(colsArray);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__dot(Tpetra::MultiVector< SC,LO,GO,NO > const *self,Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &A,std::pair< SC *,std::size_t > dots){
Teuchos::ArrayView<SC> dotsView = Teuchos::arrayView(dots.first, dots.second);
return self->dot(A, dotsView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__norm1(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< SC *,std::size_t > norms){
Teuchos::ArrayView<SC> normsView = Teuchos::arrayView(norms.first, norms.second);
return self->norm1(normsView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__norm2(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< SC *,std::size_t > norms){
Teuchos::ArrayView<SC> normsView = Teuchos::arrayView(norms.first, norms.second);
return self->norm2(normsView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__normInf(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< SC *,std::size_t > norms){
Teuchos::ArrayView<SC> normsView = Teuchos::arrayView(norms.first, norms.second);
return self->normInf(normsView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__scale__SWIG_2(Tpetra::MultiVector< SC,LO,GO,NO > *self,std::pair< SC const *,std::size_t > alpha){
Teuchos::ArrayView<const SC> alphaView = Teuchos::arrayView(alpha.first, alpha.second);
self->scale(alphaView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__meanValue(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< SC *,std::size_t > means){
Teuchos::ArrayView<SC> meansView = Teuchos::arrayView(means.first, means.second);
self->meanValue(meansView);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dCopy(Tpetra::MultiVector< SC,LO,GO,NO > const *self,std::pair< SC *,std::size_t > A,size_t const LDA){
Teuchos::ArrayView<SC> AView = Teuchos::arrayView(A.first, A.second);
self->get1dCopy(AView, LDA);
}
SWIGINTERN std::pair< SC const *,std::size_t > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dView(Tpetra::MultiVector< SC,LO,GO,NO > const *self){
auto a = self->get1dView();
return std::make_pair<const SC*,size_t>(a.getRawPtr(), a.size());
}
SWIGINTERN std::pair< SC *,std::size_t > Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dViewNonConst(Tpetra::MultiVector< SC,LO,GO,NO > *self){
auto a = self->get1dViewNonConst();
return std::make_pair<SC*,size_t>(a.getRawPtr(), a.size());
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(Tpetra::MultiVector< SC,LO,GO,NO > *self,Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doImport(source, importer, CM);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(Tpetra::MultiVector< SC,LO,GO,NO > *self,Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doImport(source, exporter, CM);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(Tpetra::MultiVector< SC,LO,GO,NO > *self,Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doExport(source, exporter, CM);
}
SWIGINTERN void Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(Tpetra::MultiVector< SC,LO,GO,NO > *self,Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doExport(source, importer, CM);
}
#include "Tpetra_CrsGraph.hpp"
SWIGINTERN Tpetra::CrsGraph< LO,GO,NO > *new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_6(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,std::pair< std::size_t const *,std::size_t > numEntPerRow,Tpetra::ProfileType const pftype=Tpetra::DynamicProfile,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::ArrayRCP<const size_t> numEntPerRowRCP(numEntPerRow.first, 0, numEntPerRow.second, false/*has_ownership*/);
return new Tpetra::CrsGraph<LO,GO,NO>(rowMap, numEntPerRowRCP, pftype, params);
}
SWIGINTERN Tpetra::CrsGraph< LO,GO,NO > *new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_9(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &colMap,std::pair< std::size_t const *,std::size_t > numEntPerRow,Tpetra::ProfileType const pftype=Tpetra::DynamicProfile,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::ArrayRCP<const size_t> numEntPerRowRCP(numEntPerRow.first, 0, numEntPerRow.second, false/*has_ownership*/);
return new Tpetra::CrsGraph<LO,GO,NO>(rowMap, colMap, numEntPerRowRCP, pftype, params);
}
SWIGINTERN Tpetra::CrsGraph< LO,GO,NO > *new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_12(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &colMap,std::pair< std::size_t *,std::size_t > rowPointers,std::pair< LO *,std::size_t > columnIndices,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::Array<size_t> rowPointersArray(rowPointers.second);
for (size_t i = 0; i < rowPointers.second; i++)
rowPointersArray[i] = rowPointers.first[i]-1;
Teuchos::Array<LO> columnIndicesArray(columnIndices.second);
for (size_t i = 0; i < columnIndices.second; i++)
columnIndicesArray[i] = columnIndices.first[i]-1;
return new Tpetra::CrsGraph<LO,GO,NO>(rowMap, colMap,
Teuchos::arcpFromArray(rowPointersArray), Teuchos::arcpFromArray(columnIndicesArray), params);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__insertGlobalIndices__SWIG_1(Tpetra::CrsGraph< LO,GO,NO > *self,GO const globalRow,std::pair< GO const *,std::size_t > indices){
Teuchos::ArrayView<const GO> indicesView = Teuchos::arrayView(indices.first, indices.second);
self->insertGlobalIndices(globalRow, indicesView);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__insertLocalIndices(Tpetra::CrsGraph< LO,GO,NO > *self,LO const localRow,std::pair< LO const *,std::size_t > indices){
Teuchos::Array<LO> indicesArray(indices.second);
for (size_t i = 0; i < indicesArray.size(); i++)
indicesArray[i] = indices.first[i]-1;
self->insertLocalIndices(localRow, indicesArray);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getGlobalRowCopy(Tpetra::CrsGraph< LO,GO,NO > const *self,GO GlobalRow,std::pair< GO *,std::size_t > Indices,size_t &NumIndices){
Teuchos::ArrayView<GO> IndicesView = Teuchos::arrayView(Indices.first, Indices.second);
self->getGlobalRowCopy(GlobalRow, IndicesView, NumIndices);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getLocalRowCopy(Tpetra::CrsGraph< LO,GO,NO > const *self,LO localRow,std::pair< LO *,std::size_t > indices,size_t &NumIndices){
Teuchos::ArrayView<LO> indicesView = Teuchos::arrayView(indices.first, indices.second);
self->getLocalRowCopy(localRow, indicesView, NumIndices);
for (int i = 0; i < indicesView.size(); i++)
indicesView[i]++;
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getgblRowView(Tpetra::CrsGraph< LO,GO,NO > const *self,GO const gblRow,std::pair< GO const *,std::size_t > lclColInds){
Teuchos::ArrayView<const GO> lclColIndsView = Teuchos::arrayView(lclColInds.first, lclColInds.second);
self->getGlobalRowView(gblRow, lclColIndsView);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__setAllIndices(Tpetra::CrsGraph< LO,GO,NO > *self,std::pair< std::size_t *,std::size_t > rowPointers,std::pair< LO *,std::size_t > columnIndices,std::pair< SC *,std::size_t > val){
Teuchos::ArrayRCP<size_t> rowPointersArrayRCP(rowPointers.second);
for (int i = 0; i < rowPointersArrayRCP.size(); i++)
rowPointersArrayRCP[i] = rowPointers.first[i]-1;
Teuchos::ArrayRCP<LO> columnIndicesArrayRCP(columnIndices.second);
for (int i = 0; i < columnIndicesArrayRCP.size(); i++)
columnIndicesArrayRCP[i] = columnIndices.first[i]-1;
self->setAllIndices(rowPointersArrayRCP, columnIndicesArrayRCP);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodeRowPtrs(Tpetra::CrsGraph< LO,GO,NO > const *self,std::pair< std::size_t *,std::size_t > rowPointers){
auto rowPointersArrayRCP = self->getNodeRowPtrs();
TEUCHOS_TEST_FOR_EXCEPTION(rowPointersArrayRCP.size() != rowPointers.second, std::runtime_error, "Wrong rowPointers size");
auto n = rowPointers.second;
for (int i = 0; i < n; i++)
rowPointers.first[i] = rowPointersArrayRCP[i]+1;
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodePackedIndices(Tpetra::CrsGraph< LO,GO,NO > const *self,std::pair< std::size_t *,std::size_t > columnIndices){
auto columnIndicesArrayRCP = self->getNodeRowPtrs();
TEUCHOS_TEST_FOR_EXCEPTION(columnIndicesArrayRCP.size() != columnIndices.second, std::runtime_error, "Wrong columnIndices size");
auto nnz = columnIndices.second;
for (int i = 0; i < nnz; i++)
columnIndices.first[i] = columnIndicesArrayRCP[i]+1;
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getLocalDiagOffsets(Tpetra::CrsGraph< LO,GO,NO > const *self,std::pair< std::size_t *,std::size_t > offsets){
TEUCHOS_TEST_FOR_EXCEPTION(self->getNodeNumRows() != offsets.second, std::runtime_error, "Wrong offsets size");
Teuchos::ArrayRCP<size_t> offsetsArrayRCP(offsets.first, 0, offsets.second, false/*has_ownership*/);
self->getLocalDiagOffsets(offsetsArrayRCP);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(Tpetra::CrsGraph< LO,GO,NO > *self,Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doImport(source, importer, CM);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(Tpetra::CrsGraph< LO,GO,NO > *self,Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doImport(source, exporter, CM);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(Tpetra::CrsGraph< LO,GO,NO > *self,Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doExport(source, exporter, CM);
}
SWIGINTERN void Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(Tpetra::CrsGraph< LO,GO,NO > *self,Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doExport(source, importer, CM);
}
#include "Tpetra_CrsMatrix.hpp"
SWIGINTERN Tpetra::CrsMatrix< SC,LO,GO,NO > *new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_8(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,std::pair< std::size_t const *,std::size_t > NumEntriesPerRowToAlloc,Tpetra::ProfileType pftype=Tpetra::DynamicProfile,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::ArrayRCP<const size_t> NumEntriesPerRowToAllocArrayRCP(NumEntriesPerRowToAlloc.first, 0, NumEntriesPerRowToAlloc.second, false/*has_ownership*/);
return new Tpetra::CrsMatrix<SC,LO,GO,NO>(rowMap, NumEntriesPerRowToAllocArrayRCP, pftype, params);
}
SWIGINTERN Tpetra::CrsMatrix< SC,LO,GO,NO > *new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_11(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &colMap,std::pair< std::size_t const *,std::size_t > NumEntriesPerRowToAlloc,Tpetra::ProfileType pftype=Tpetra::DynamicProfile,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::ArrayRCP<const size_t> NumEntriesPerRowToAllocArrayRCP(NumEntriesPerRowToAlloc.first, 0, NumEntriesPerRowToAlloc.second, false/*has_ownership*/);
return new Tpetra::CrsMatrix<SC,LO,GO,NO>(rowMap, colMap, NumEntriesPerRowToAllocArrayRCP, pftype, params);
}
SWIGINTERN Tpetra::CrsMatrix< SC,LO,GO,NO > *new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_14(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &colMap,std::pair< std::size_t *,std::size_t > rowPointers,std::pair< LO *,std::size_t > columnIndices,std::pair< SC *,std::size_t > values,Teuchos::RCP< Teuchos::ParameterList > const ¶ms=Teuchos::null){
Teuchos::ArrayRCP<size_t> rowPointersArrayRCP(rowPointers.second);
for (int i = 0; i < rowPointersArrayRCP.size(); i++)
rowPointersArrayRCP[i] = rowPointers.first[i]-1;
Teuchos::ArrayRCP<LO> columnIndicesArrayRCP(columnIndices.second);
for (int i = 0; i < columnIndicesArrayRCP.size(); i++)
columnIndicesArrayRCP[i] = columnIndices.first[i]-1;
Teuchos::ArrayRCP<SC> valuesArrayRCP(values.first, 0, values.second, false/*has_ownership*/);
return new Tpetra::CrsMatrix<SC,LO,GO,NO>(rowMap, colMap, rowPointersArrayRCP, columnIndicesArrayRCP, valuesArrayRCP, params);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__insertGlobalValues(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,GO const globalRow,std::pair< GO const *,std::size_t > cols,std::pair< SC const *,std::size_t > vals){
Teuchos::ArrayView<const GO> colsView = Teuchos::arrayView(cols.first, cols.second);
Teuchos::ArrayView<const SC> valsView = Teuchos::arrayView(vals.first, vals.second);
self->insertGlobalValues(globalRow, colsView, valsView);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__insertLocalValues(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,LO const localRow,std::pair< LO const *,std::size_t > cols,std::pair< SC const *,std::size_t > vals){
Teuchos::Array<LO> colsArray(cols.second);
for (int i = 0; i < colsArray.size(); i++)
colsArray[i] = cols.first[i] - 1;
Teuchos::ArrayView<const SC> valsView = Teuchos::arrayView(vals.first, vals.second);
self->insertLocalValues(localRow, colsArray, valsView);
}
SWIGINTERN LO Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__replaceGlobalValues(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,GO const globalRow,std::pair< GO const *,std::size_t > cols,std::pair< SC const *,std::size_t > vals){
Teuchos::ArrayView<const GO> colsView = Teuchos::arrayView(cols.first, cols.second);
Teuchos::ArrayView<const SC> valsView = Teuchos::arrayView(vals.first, vals.second);
return self->replaceGlobalValues(globalRow, colsView, valsView);
}
SWIGINTERN LO Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__sumIntoGlobalValues(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,GO const globalRow,std::pair< GO const *,std::size_t > cols,std::pair< SC const *,std::size_t > vals){
Teuchos::ArrayView<const GO> colsView = Teuchos::arrayView(cols.first, cols.second);
Teuchos::ArrayView<const SC> valsView = Teuchos::arrayView(vals.first, vals.second);
return self->sumIntoGlobalValues(globalRow, colsView, valsView, false); // TODO: for now, we only run in serial, no atomics necessary
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__setAllValues(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,std::pair< std::size_t *,std::size_t > ptr,std::pair< LO *,std::size_t > ind,std::pair< SC *,std::size_t > val){
Teuchos::ArrayRCP<size_t> ptrArrayRCP(ptr.second);
for (int i = 0; i < ptrArrayRCP.size(); i++)
ptrArrayRCP[i] = ptr.first[i]-1;
Teuchos::ArrayRCP<LO> indArrayRCP(ind.second);
for (int i = 0; i < indArrayRCP.size(); i++)
indArrayRCP[i] = ind.first[i]-1;
Teuchos::ArrayRCP<SC> valArrayRCP(val.first, 0, val.second, false/*has_ownership*/);
self->setAllValues(ptrArrayRCP, indArrayRCP, valArrayRCP);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getAllValues(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,std::pair< std::size_t *,std::size_t > rowPointers,std::pair< LO *,std::size_t > columnIndices,std::pair< SC *,std::size_t > values){
Teuchos::ArrayRCP<const size_t> rowPointersArrayRCP;
Teuchos::ArrayRCP<const LO> columnIndicesArrayRCP;
Teuchos::ArrayRCP<const SC> valuesArrayRCP;
self->getAllValues(rowPointersArrayRCP, columnIndicesArrayRCP, valuesArrayRCP);
TEUCHOS_TEST_FOR_EXCEPTION(rowPointersArrayRCP.size() != rowPointers.second, std::runtime_error, "Wrong rowPointers size");
TEUCHOS_TEST_FOR_EXCEPTION(columnIndicesArrayRCP.size() != columnIndices.second, std::runtime_error, "Wrong columnIndices size");
TEUCHOS_TEST_FOR_EXCEPTION(valuesArrayRCP.size() != values.second, std::runtime_error, "Wrong values size");
auto n = rowPointers.second;
for (int i = 0; i < n; i++)
rowPointers.first[i] = rowPointersArrayRCP[i]+1;
auto nnz = columnIndices.second;
for (int i = 0; i < nnz; i++) {
columnIndices.first[i] = columnIndicesArrayRCP[i]+1;
values .first[i] = valuesArrayRCP[i];
}
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getGlobalRowCopy(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,GO GlobalRow,std::pair< GO *,std::size_t > Indices,std::pair< SC *,std::size_t > Values,size_t &NumIndices){
Teuchos::ArrayView<GO> IndicesView = Teuchos::arrayView(Indices.first, Indices.second);
Teuchos::ArrayView<SC> ValuesView = Teuchos::arrayView(Values.first, Values.second);
self->getGlobalRowCopy(GlobalRow, IndicesView, ValuesView, NumIndices);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getLocalRowCopy(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,LO localRow,std::pair< LO *,std::size_t > colInds,std::pair< SC *,std::size_t > vals,size_t &NumIndices){
Teuchos::ArrayView<LO> colIndsView = Teuchos::arrayView(colInds.first, colInds.second);
Teuchos::ArrayView<SC> valsView = Teuchos::arrayView(vals.first, vals.second);
self->getLocalRowCopy(localRow, colIndsView, valsView, NumIndices);
for (int i = 0; i < colIndsView.size(); i++)
colIndsView[i]++;
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getGlobalRowView(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,GO GlobalRow,std::pair< GO const *,std::size_t > Indices,std::pair< SC const *,std::size_t > values){
Teuchos::ArrayView<const GO> IndicesView = Teuchos::arrayView(Indices.first, Indices.second);
Teuchos::ArrayView<const SC> valuesView = Teuchos::arrayView(values.first, values.second);
self->getGlobalRowView(GlobalRow, IndicesView, valuesView);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getLocalDiagOffsets(Tpetra::CrsMatrix< SC,LO,GO,NO > const *self,std::pair< std::size_t *,std::size_t > offsets){
TEUCHOS_TEST_FOR_EXCEPTION(self->getNodeNumRows() != offsets.second, std::runtime_error, "Wrong offsets size");
Teuchos::ArrayRCP<size_t> offsetsArrayRCP(offsets.first, 0, offsets.second, false/*has_ownership*/);
self->getLocalDiagOffsets(offsetsArrayRCP);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doImport(source, importer, CM);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doImport(source, exporter, CM);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Export< LO,GO,NO > const &exporter,Tpetra::CombineMode CM){
self->doExport(source, exporter, CM);
}
SWIGINTERN void Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(Tpetra::CrsMatrix< SC,LO,GO,NO > *self,Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &source,Tpetra::Import< LO,GO,NO > const &importer,Tpetra::CombineMode CM){
self->doExport(source, importer, CM);
}
#include "Teuchos_RCP.hpp"
#include "MatrixMarket_Tpetra.hpp"
typedef Tpetra::CrsMatrix<SC,LO,GO,NO> CMT;
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &filename,Teuchos::RCP< Teuchos::Comm< int > const > const &pComm,bool const callFillComplete=true,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseGraphFile(filename, pComm, callFillComplete, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &filename,Teuchos::RCP< Teuchos::Comm< int > const > const &pComm,Teuchos::RCP< Teuchos::ParameterList > const &constructorParams,Teuchos::RCP< Teuchos::ParameterList > const &fillCompleteParams,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseGraphFile(filename, pComm, constructorParams, fillCompleteParams, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &colMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &domainMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &rangeMap,bool const callFillComplete=true,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseGraphFile(filename, rowMap, colMap, domainMap, rangeMap, callFillComplete, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &filename,Teuchos::RCP< Teuchos::Comm< int > const > const &pComm,bool const callFillComplete=true,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseFile(filename, pComm, callFillComplete, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &filename,Teuchos::RCP< Teuchos::Comm< int > const > const &pComm,Teuchos::RCP< Teuchos::ParameterList > const &constructorParams,Teuchos::RCP< Teuchos::ParameterList > const &fillCompleteParams,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseFile(filename, pComm, constructorParams, fillCompleteParams, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &rowMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &colMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &domainMap,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &rangeMap,bool const callFillComplete=true,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readSparseFile(filename, rowMap, colMap, domainMap, rangeMap, callFillComplete, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::multivector_type > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &comm,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &map,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readDenseFile(filename, comm, map, tolerant, debug);
}
SWIGINTERN Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &comm,bool const tolerant=false,bool const debug=false){
return Tpetra::MatrixMarket::Reader<CMT>::readMapFile(filename, comm, tolerant, debug);
}
SWIGINTERN void Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &pMatrix,std::string const &matrixName,std::string const &matrixDescription,bool const debug=false){
Tpetra::MatrixMarket::Writer<CMT>::writeSparseFile(filename, pMatrix, matrixName, matrixDescription, debug);
}
SWIGINTERN void Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &pMatrix,bool const debug=false){
Tpetra::MatrixMarket::Writer<CMT>::writeSparseFile(filename, pMatrix, debug);
}
SWIGINTERN void Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &pGraph,std::string const &graphName,std::string const &graphDescription,bool const debug=false){
Tpetra::MatrixMarket::Writer<CMT>::writeSparseGraphFile(filename, pGraph, graphName, graphDescription, debug);
}
SWIGINTERN void Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &filename,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &pGraph,bool const debug=false){
Tpetra::MatrixMarket::Writer<CMT>::writeSparseGraphFile(filename, pGraph, debug);
}
SWIGINTERN void Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &filename,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &map){
Tpetra::MatrixMarket::Writer<CMT>::writeMapFile(filename, map);
}
#include "Teuchos_RCP.hpp"
#include "TpetraExt_MatrixMatrix.hpp"
#ifdef __cplusplus
extern "C" {
#endif
SWIGEXPORT void swigc_setCombineModeParameter(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Teuchos::ParameterList *arg1 = 0 ;
std::string *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *smartarg1 ;
std::string tempstr2 ;
SWIG_check_sp_nonnull(farg1,
"Teuchos::ParameterList *", "ParameterList", "Tpetra::setCombineModeParameter(Teuchos::ParameterList &,std::string const &)", return )
smartarg1 = static_cast< Teuchos::RCP< Teuchos::ParameterList >* >(farg1->ptr);
arg1 = smartarg1->get();
tempstr2 = std::string(static_cast<const char*>(farg2->data), farg2->size);
arg2 = &tempstr2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::setCombineModeParameter(Teuchos::ParameterList &,std::string const &)");;
try
{
// Attempt the wrapped function call
Tpetra::setCombineModeParameter(*arg1,(std::string const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::setCombineModeParameter(Teuchos::ParameterList &,std::string const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::setCombineModeParameter(Teuchos::ParameterList &,std::string const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::setCombineModeParameter(Teuchos::ParameterList &,std::string const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMap__SWIG_0() {
SwigClassWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *result = 0 ;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map()");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *)new Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map()", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map()", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map()", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraMap(SwigClassWrapper const *farg1) {
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::~Map()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::~Map()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::~Map()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::~Map()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT bool swigc_TpetraMap_isOneToOne(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isOneToOne() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isOneToOne();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isOneToOne() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isOneToOne() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isOneToOne() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraMap_getGlobalNumElements(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalNumElements() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getGlobalNumElements();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalNumElements() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalNumElements() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalNumElements() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraMap_getNodeNumElements(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeNumElements() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getNodeNumElements();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeNumElements() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeNumElements() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeNumElements() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT int swigc_TpetraMap_getMinLocalIndex(SwigClassWrapper const *farg1) {
int fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
int result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinLocalIndex() const");;
try
{
// Attempt the wrapped function call
result = (int)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMinLocalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinLocalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinLocalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinLocalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result + 1;
return fresult;
}
SWIGEXPORT int swigc_TpetraMap_getMaxLocalIndex(SwigClassWrapper const *farg1) {
int fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
int result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxLocalIndex() const");;
try
{
// Attempt the wrapped function call
result = (int)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMaxLocalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxLocalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxLocalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxLocalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result + 1;
return fresult;
}
SWIGEXPORT long long swigc_TpetraMap_getMinGlobalIndex(SwigClassWrapper const *farg1) {
long long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
long long result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinGlobalIndex() const");;
try
{
// Attempt the wrapped function call
result = (long long)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMinGlobalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinGlobalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinGlobalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinGlobalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT long long swigc_TpetraMap_getMaxGlobalIndex(SwigClassWrapper const *farg1) {
long long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
long long result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxGlobalIndex() const");;
try
{
// Attempt the wrapped function call
result = (long long)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMaxGlobalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxGlobalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxGlobalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxGlobalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT long long swigc_TpetraMap_getMinAllGlobalIndex(SwigClassWrapper const *farg1) {
long long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
long long result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinAllGlobalIndex() const");;
try
{
// Attempt the wrapped function call
result = (long long)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMinAllGlobalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinAllGlobalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinAllGlobalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMinAllGlobalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT long long swigc_TpetraMap_getMaxAllGlobalIndex(SwigClassWrapper const *farg1) {
long long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
long long result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxAllGlobalIndex() const");;
try
{
// Attempt the wrapped function call
result = (long long)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getMaxAllGlobalIndex();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxAllGlobalIndex() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxAllGlobalIndex() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getMaxAllGlobalIndex() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT int swigc_TpetraMap_getLocalElement(SwigClassWrapper const *farg1, long long const *farg2) {
int fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
long long arg2 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
int result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getLocalElement(long long) const");;
try
{
// Attempt the wrapped function call
result = (int)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getLocalElement(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getLocalElement(long long) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getLocalElement(long long) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getLocalElement(long long) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result + 1;
return fresult;
}
SWIGEXPORT long long swigc_TpetraMap_getGlobalElement(SwigClassWrapper const *farg1, int const *farg2) {
long long fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
long long result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalElement(int) const");;
try
{
// Attempt the wrapped function call
result = (long long)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getGlobalElement(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalElement(int) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalElement(int) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getGlobalElement(int) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isNodeLocalElement(SwigClassWrapper const *farg1, int const *farg2) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeLocalElement(int) const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isNodeLocalElement(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeLocalElement(int) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeLocalElement(int) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeLocalElement(int) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isNodeGlobalElement(SwigClassWrapper const *farg1, long long const *farg2) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
long long arg2 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeGlobalElement(long long) const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isNodeGlobalElement(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeGlobalElement(long long) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeGlobalElement(long long) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isNodeGlobalElement(long long) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isUniform(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isUniform() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isUniform();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isUniform() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isUniform() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isUniform() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isContiguous(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isContiguous() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isContiguous();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isContiguous() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isContiguous() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isContiguous() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isDistributed(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isDistributed() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isDistributed();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isDistributed() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isDistributed() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isDistributed() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isCompatible(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraMap", "Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isCompatible(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", return 0)
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isCompatible(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isCompatible((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isCompatible(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isCompatible(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isCompatible(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_isSameAs(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraMap", "Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isSameAs(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", return 0)
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isSameAs(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->isSameAs((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isSameAs(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isSameAs(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::isSameAs(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMap_locallySameAs(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
bool fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > *", "TpetraMap", "Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::locallySameAs(Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &) const", return 0)
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::locallySameAs(Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &) const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->locallySameAs((Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::locallySameAs(Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::locallySameAs(Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::locallySameAs(Tpetra::Map< int,long long,Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::node_type > const &) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMap_getComm(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getComm() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->getComm();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getComm() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getComm() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getComm() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Teuchos::Comm<int> >(static_cast< const Teuchos::RCP<const Teuchos::Comm<int> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMap_description(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
std::string result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::description() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->description();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::description() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::description() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::description() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult = SWIG_store_string(result);
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMap_removeEmptyProcesses(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::removeEmptyProcesses() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->removeEmptyProcesses();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::removeEmptyProcesses() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::removeEmptyProcesses() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::removeEmptyProcesses() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMap_replaceCommWithSubset(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::replaceCommWithSubset(Teuchos::RCP< Teuchos::Comm< int > const > const &) const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1)->replaceCommWithSubset((Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::replaceCommWithSubset(Teuchos::RCP< Teuchos::Comm< int > const > const &) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::replaceCommWithSubset(Teuchos::RCP< Teuchos::Comm< int > const > const &) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::replaceCommWithSubset(Teuchos::RCP< Teuchos::Comm< int > const > const &) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMap__SWIG_1(unsigned long const *farg1, SwigClassWrapper const *farg2, int const *farg3) {
SwigClassWrapper fresult ;
Tpetra::global_size_t arg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Tpetra::LocalGlobal arg3 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *result = 0 ;
arg1 = *farg1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = static_cast< Tpetra::LocalGlobal >(*farg3);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &,Tpetra::LocalGlobal)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *)new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_1(arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &,Tpetra::LocalGlobal)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &,Tpetra::LocalGlobal)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &,Tpetra::LocalGlobal)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMap__SWIG_2(unsigned long const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Tpetra::global_size_t arg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *result = 0 ;
arg1 = *farg1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *)new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_1(arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMap__SWIG_3(unsigned long const *farg1, unsigned long const *farg2, SwigClassWrapper const *farg3) {
SwigClassWrapper fresult ;
Tpetra::global_size_t arg1 ;
size_t arg2 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg3 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull3 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *result = 0 ;
arg1 = *farg1;
arg2 = *farg2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *)new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_3(arg1,arg2,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t,size_t,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMap__SWIG_4(unsigned long const *farg1, SwigArrayWrapper *farg2, SwigClassWrapper const *farg3) {
SwigClassWrapper fresult ;
Tpetra::global_size_t arg1 ;
std::pair< GO const *,std::size_t > arg2 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg3 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull3 ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *result = 0 ;
arg1 = *farg1;
(&arg2)->first = static_cast<const long long*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t const,std::pair< GO const *,std::size_t >,Teuchos::RCP< Teuchos::Comm< int > const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *)new_Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg___SWIG_4(arg1,arg2,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t const,std::pair< GO const *,std::size_t >,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t const,std::pair< GO const *,std::size_t >,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::Map(Tpetra::global_size_t const,std::pair< GO const *,std::size_t >,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT int swigc_TpetraMap_getRemoteIndexList__SWIG_0(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
int fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
std::pair< GO const *,std::size_t > arg2 ;
std::pair< int *,std::size_t > arg3 ;
std::pair< LO *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Tpetra::LookupStatus result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<const long long*>(farg2->data);
(&arg2)->second = farg2->size;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<int*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >,std::pair< LO *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::LookupStatus)Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getRemoteIndexList__SWIG_0((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >,std::pair< LO *,std::size_t >) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >,std::pair< LO *,std::size_t >) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >,std::pair< LO *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = static_cast< int >(result);
return fresult;
}
SWIGEXPORT int swigc_TpetraMap_getRemoteIndexList__SWIG_1(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3) {
int fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
std::pair< GO const *,std::size_t > arg2 ;
std::pair< int *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
Tpetra::LookupStatus result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<const long long*>(farg2->data);
(&arg2)->second = farg2->size;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::LookupStatus)Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getRemoteIndexList__SWIG_1((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getRemoteIndexList(std::pair< GO const *,std::size_t >,std::pair< int *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = static_cast< int >(result);
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMap_getNodeElementList(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = (Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *) 0 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg1 ;
std::pair< GO const *,std::size_t > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeElementList() const");;
try
{
// Attempt the wrapped function call
result = Tpetra_Map_Sl_int_Sc_long_SS_long_Sc_Kokkos_Compat_KokkosSerialWrapperNode_Sg__getNodeElementList((Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeElementList() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeElementList() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::getNodeElementList() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult.data = const_cast<long long*>((&result)->first);
fresult.size = (&result)->second;
return fresult;
}
SWIGEXPORT void swigc_assignment_TpetraMap(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR);
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraExport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::Export< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Export< LO,GO,NO > *)new Tpetra::Export< LO,GO,NO >((Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Export<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraExport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Tpetra::Export< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Export< LO,GO,NO > *)new Tpetra::Export< LO,GO,NO >((Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Export<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraExport__SWIG_2(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
Tpetra::Export< LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraExport", "Tpetra::Export< LO,GO,NO >::Export(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Export< LO,GO,NO > *)new Tpetra::Export< LO,GO,NO >((Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Export<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraExport__SWIG_3(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
Tpetra::Export< LO,GO,NO > *result = 0 ;
SWIG_check_nonnull(*farg1, "Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &", "TpetraImport", "Tpetra::Export< LO,GO,NO >::Export(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", return SwigClassWrapper_uninitialized());
arg1 = static_cast< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > * >(farg1->ptr);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Export< LO,GO,NO > *)new Tpetra::Export< LO,GO,NO >((Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::Export(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Export<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraExport(SwigClassWrapper const *farg1) {
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::~Export()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::~Export()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::~Export()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::~Export()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraExport_setParameterList(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->setParameterList((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT unsigned long swigc_TpetraExport_getNumSameIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getNumSameIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Export< LO,GO,NO > const *)arg1)->getNumSameIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumSameIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumSameIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumSameIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraExport_getNumPermuteIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getNumPermuteIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Export< LO,GO,NO > const *)arg1)->getNumPermuteIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumPermuteIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumPermuteIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumPermuteIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraExport_getNumRemoteIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getNumRemoteIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Export< LO,GO,NO > const *)arg1)->getNumRemoteIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumRemoteIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumRemoteIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumRemoteIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraExport_getNumExportIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getNumExportIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Export< LO,GO,NO > const *)arg1)->getNumExportIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumExportIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumExportIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getNumExportIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraExport_getSourceMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getSourceMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Export< LO,GO,NO > const *)arg1)->getSourceMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getSourceMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getSourceMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getSourceMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraExport_getTargetMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::getTargetMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Export< LO,GO,NO > const *)arg1)->getTargetMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getTargetMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getTargetMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::getTargetMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT bool swigc_TpetraExport_isLocallyComplete(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Export< LO,GO,NO > *arg1 = (Tpetra::Export< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Export< LO,GO,NO >::isLocallyComplete() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Export< LO,GO,NO > const *)arg1)->isLocallyComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::isLocallyComplete() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::isLocallyComplete() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Export< LO,GO,NO >::isLocallyComplete() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_assignment_TpetraExport(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::Export<LO,GO,NO> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR | swig::IS_COPY_ASSIGN);
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraImport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::Import< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Import< LO,GO,NO > *)new Tpetra::Import< LO,GO,NO >((Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Import<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraImport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Tpetra::Import< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Import< LO,GO,NO > *)new Tpetra::Import< LO,GO,NO >((Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Import<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraImport__SWIG_2(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Tpetra::Import< LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraImport", "Tpetra::Import< LO,GO,NO >::Import(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Import< LO,GO,NO > *)new Tpetra::Import< LO,GO,NO >((Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Import<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraImport__SWIG_3(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg1 ;
Tpetra::Import< LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraExport", "Tpetra::Import< LO,GO,NO >::Import(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg1->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::Import< LO,GO,NO > *)new Tpetra::Import< LO,GO,NO >((Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::Import(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::Import<LO,GO,NO> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraImport(SwigClassWrapper const *farg1) {
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::~Import()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::~Import()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::~Import()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::~Import()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraImport_setParameterList(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->setParameterList((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT unsigned long swigc_TpetraImport_getNumSameIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getNumSameIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Import< LO,GO,NO > const *)arg1)->getNumSameIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumSameIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumSameIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumSameIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraImport_getNumPermuteIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getNumPermuteIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Import< LO,GO,NO > const *)arg1)->getNumPermuteIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumPermuteIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumPermuteIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumPermuteIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraImport_getNumRemoteIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getNumRemoteIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Import< LO,GO,NO > const *)arg1)->getNumRemoteIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumRemoteIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumRemoteIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumRemoteIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraImport_getNumExportIDs(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getNumExportIDs() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::Import< LO,GO,NO > const *)arg1)->getNumExportIDs();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumExportIDs() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumExportIDs() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getNumExportIDs() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraImport_getSourceMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getSourceMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Import< LO,GO,NO > const *)arg1)->getSourceMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getSourceMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getSourceMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getSourceMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraImport_getTargetMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::getTargetMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Import< LO,GO,NO > const *)arg1)->getTargetMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getTargetMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getTargetMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::getTargetMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT bool swigc_TpetraImport_isLocallyComplete(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::isLocallyComplete() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::Import< LO,GO,NO > const *)arg1)->isLocallyComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::isLocallyComplete() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::isLocallyComplete() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::isLocallyComplete() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraImport_setUnion__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraImport", "Tpetra::Import< LO,GO,NO >::setUnion(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", return SwigClassWrapper_uninitialized())
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Import< LO,GO,NO > const *)arg1)->setUnion((Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >(static_cast< const Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraImport_setUnion__SWIG_1(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Import< LO,GO,NO > const *)arg1)->setUnion();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::setUnion() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >(static_cast< const Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraImport_createRemoteOnlyImport(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Tpetra::Import< LO,GO,NO > *arg1 = (Tpetra::Import< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::Import< LO,GO,NO >::createRemoteOnlyImport(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &) const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::Import< LO,GO,NO > const *)arg1)->createRemoteOnlyImport((Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::createRemoteOnlyImport(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::createRemoteOnlyImport(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::Import< LO,GO,NO >::createRemoteOnlyImport(Teuchos::RCP< Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >(static_cast< const Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_assignment_TpetraImport(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::Import<LO,GO,NO> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR | swig::IS_COPY_ASSIGN);
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_0() {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector()");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector()", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector()", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector()", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_1(SwigClassWrapper const *farg1, unsigned long const *farg2, bool const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
bool arg3 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,bool const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_2(SwigClassWrapper const *farg1, unsigned long const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_3(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg1 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_4(SwigClassWrapper const *farg1, int const *farg2) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg1 = 0 ;
Teuchos::DataAccess arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Teuchos::DataAccess const)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = static_cast< Teuchos::DataAccess >(*farg2);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Teuchos::DataAccess const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Teuchos::DataAccess const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Teuchos::DataAccess const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Teuchos::DataAccess const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_5(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg1 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type *arg2 = 0 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type *", "TpetraMap", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)", return SwigClassWrapper_uninitialized())
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &,size_t const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_6(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg1 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)", return SwigClassWrapper_uninitialized())
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type *", "TpetraMap", "Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)", return SwigClassWrapper_uninitialized())
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new Tpetra::MultiVector< SC,LO,GO,NO >((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraMultiVector(SwigClassWrapper const *farg1) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::~MultiVector()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::~MultiVector()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::~MultiVector()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::~MultiVector()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_replaceGlobalValue(SwigClassWrapper const *farg1, long long const *farg2, unsigned long const *farg3, double const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
long long arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->replaceGlobalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_sumIntoGlobalValue__SWIG_0(SwigClassWrapper const *farg1, long long const *farg2, unsigned long const *farg3, double const *farg4, bool const *farg5) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
long long arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
bool arg5 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->sumIntoGlobalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_sumIntoGlobalValue__SWIG_1(SwigClassWrapper const *farg1, long long const *farg2, unsigned long const *farg3, double const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
long long arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->sumIntoGlobalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoGlobalValue(long long const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_replaceLocalValue(SwigClassWrapper const *farg1, int const *farg2, unsigned long const *farg3, double const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
int arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->replaceLocalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_sumIntoLocalValue__SWIG_0(SwigClassWrapper const *farg1, int const *farg2, unsigned long const *farg3, double const *farg4, bool const *farg5) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
int arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
bool arg5 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->sumIntoLocalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &,bool const) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_sumIntoLocalValue__SWIG_1(SwigClassWrapper const *farg1, int const *farg2, unsigned long const *farg3, double const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
int arg2 ;
size_t arg3 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
arg3 = *farg3 - 1;
arg4 = reinterpret_cast< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type * >(const_cast< double* >(farg4));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->sumIntoLocalValue(arg2,arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::sumIntoLocalValue(int const,size_t const,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::impl_scalar_type const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_putScalar(SwigClassWrapper const *farg1, double const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::putScalar(double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->putScalar((double const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::putScalar(double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::putScalar(double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::putScalar(double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_randomize__SWIG_0(SwigClassWrapper const *farg1) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize()");;
try
{
// Attempt the wrapped function call
(arg1)->randomize();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_randomize__SWIG_1(SwigClassWrapper const *farg1, double const *farg2, double const *farg3) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
double *arg3 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
arg3 = reinterpret_cast< double * >(const_cast< double* >(farg3));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize(double const &,double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->randomize((double const &)*arg2,(double const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize(double const &,double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize(double const &,double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::randomize(double const &,double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_replaceMap(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceMap(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->replaceMap((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceMap(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceMap(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::replaceMap(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_reduce(SwigClassWrapper const *farg1) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reduce()");;
try
{
// Attempt the wrapped function call
(arg1)->reduce();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reduce()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reduce()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reduce()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMultiVector_offsetView(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetView(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const) const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->offsetView((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetView(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetView(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetView(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMultiVector_offsetViewNonConst(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > result;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetViewNonConst(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const)");;
try
{
// Attempt the wrapped function call
result = (arg1)->offsetViewNonConst((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetViewNonConst(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetViewNonConst(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::offsetViewNonConst(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,size_t const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraMultiVector_abs(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::abs(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::abs(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->abs((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::abs(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::abs(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::abs(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_reciprocal(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::reciprocal(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reciprocal(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->reciprocal((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reciprocal(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reciprocal(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::reciprocal(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_scale__SWIG_0(SwigClassWrapper const *farg1, double const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->scale((double const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_scale__SWIG_1(SwigClassWrapper const *farg1, double const *farg2, SwigClassWrapper const *farg3) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->scale((double const &)*arg2,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_update__SWIG_0(SwigClassWrapper const *farg1, double const *farg2, SwigClassWrapper const *farg3, double const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
double *arg4 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = reinterpret_cast< double * >(const_cast< double* >(farg4));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->update((double const &)*arg2,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg3,(double const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_update__SWIG_1(SwigClassWrapper const *farg1, double const *farg2, SwigClassWrapper const *farg3, double const *farg4, SwigClassWrapper const *farg5, double const *farg6) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
double *arg4 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg5 = 0 ;
double *arg6 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg5 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = reinterpret_cast< double * >(const_cast< double* >(farg4));
SWIG_check_sp_nonnull(farg5,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", return )
smartarg5 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg5->get());
arg6 = reinterpret_cast< double * >(const_cast< double* >(farg6));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->update((double const &)*arg2,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg3,(double const &)*arg4,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg5,(double const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::update(double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_multiply(SwigClassWrapper const *farg1, int const *farg2, int const *farg3, double const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6, double const *farg7) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::ETransp arg2 ;
Teuchos::ETransp arg3 ;
double *arg4 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg5 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg6 = 0 ;
double *arg7 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg5 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg6 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = static_cast< Teuchos::ETransp >(*farg2);
arg3 = static_cast< Teuchos::ETransp >(*farg3);
arg4 = reinterpret_cast< double * >(const_cast< double* >(farg4));
SWIG_check_sp_nonnull(farg5,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", return )
smartarg5 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg5->get());
SWIG_check_sp_nonnull(farg6,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", return )
smartarg6 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg6->ptr);
arg6 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg6->get());
arg7 = reinterpret_cast< double * >(const_cast< double* >(farg7));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->multiply(arg2,arg3,(double const &)*arg4,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg5,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg6,(double const &)*arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::multiply(Teuchos::ETransp,Teuchos::ETransp,double const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT unsigned long swigc_TpetraMultiVector_getNumVectors(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getNumVectors() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->getNumVectors();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getNumVectors() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getNumVectors() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getNumVectors() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraMultiVector_getLocalLength(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getLocalLength() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->getLocalLength();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getLocalLength() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getLocalLength() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getLocalLength() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraMultiVector_getGlobalLength(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getGlobalLength() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->getGlobalLength();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getGlobalLength() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getGlobalLength() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getGlobalLength() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraMultiVector_getStride(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getStride() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->getStride();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getStride() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getStride() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getStride() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraMultiVector_isConstantStride(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::isConstantStride() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->isConstantStride();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::isConstantStride() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::isConstantStride() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::isConstantStride() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMultiVector_description(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
std::string result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::description() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->description();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::description() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::description() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::description() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult = SWIG_store_string(result);
return fresult;
}
SWIGEXPORT void swigc_TpetraMultiVector_removeEmptyProcessesInPlace(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->removeEmptyProcessesInPlace((Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_setCopyOrView(SwigClassWrapper const *farg1, int const *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::DataAccess arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = static_cast< Teuchos::DataAccess >(*farg2);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::setCopyOrView(Teuchos::DataAccess const)");;
try
{
// Attempt the wrapped function call
(arg1)->setCopyOrView(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::setCopyOrView(Teuchos::DataAccess const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::setCopyOrView(Teuchos::DataAccess const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::setCopyOrView(Teuchos::DataAccess const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT int swigc_TpetraMultiVector_getCopyOrView(SwigClassWrapper const *farg1) {
int fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::DataAccess result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getCopyOrView() const");;
try
{
// Attempt the wrapped function call
result = (Teuchos::DataAccess)((Tpetra::MultiVector< SC,LO,GO,NO > const *)arg1)->getCopyOrView();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getCopyOrView() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getCopyOrView() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getCopyOrView() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = static_cast< int >(result);
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraMultiVector__SWIG_7(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, unsigned long const *farg3, unsigned long const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< SC const *,std::size_t > arg2 ;
size_t arg3 ;
size_t arg4 ;
Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Tpetra::MultiVector< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const double*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = *farg3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< SC const *,std::size_t >,size_t const,size_t const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MultiVector< SC,LO,GO,NO > *)new_Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_7((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< SC const *,std::size_t >,size_t const,size_t const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< SC const *,std::size_t >,size_t const,size_t const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::MultiVector(Teuchos::RCP< Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< SC const *,std::size_t >,size_t const,size_t const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMultiVector_getData(SwigClassWrapper const *farg1, unsigned long const *farg2) {
SwigArrayWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
size_t arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
std::pair< SC const *,std::size_t > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getData(size_t) const");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getData((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getData(size_t) const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getData(size_t) const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getData(size_t) const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult.data = const_cast<double*>((&result)->first);
fresult.size = (&result)->second;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMultiVector_getDataNonConst(SwigClassWrapper const *farg1, unsigned long const *farg2) {
SwigArrayWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
size_t arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
std::pair< SC *,std::size_t > result;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getDataNonConst(size_t)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getDataNonConst(arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getDataNonConst(size_t)", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getDataNonConst(size_t)", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::getDataNonConst(size_t)", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult.data = (&result)->first;
fresult.size = (&result)->second;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMultiVector_subCopy(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subCopy(std::pair< std::size_t const *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subCopy((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subCopy(std::pair< std::size_t const *,std::size_t >) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subCopy(std::pair< std::size_t const *,std::size_t >) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subCopy(std::pair< std::size_t const *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMultiVector_subView(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subView(std::pair< std::size_t const *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subView((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subView(std::pair< std::size_t const *,std::size_t >) const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subView(std::pair< std::size_t const *,std::size_t >) const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subView(std::pair< std::size_t const *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraMultiVector_subViewNonConst(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
SwigClassWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > result;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subViewNonConst(std::pair< std::size_t const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__subViewNonConst(arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subViewNonConst(std::pair< std::size_t const *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subViewNonConst(std::pair< std::size_t const *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::subViewNonConst(std::pair< std::size_t const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraMultiVector_dot(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
std::pair< SC *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::dot(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,std::pair< SC *,std::size_t >) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
(&arg3)->first = static_cast<double*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::dot(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__dot((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::dot(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::dot(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::dot(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_norm1(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<double*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm1(std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__norm1((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm1(std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm1(std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm1(std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_norm2(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<double*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm2(std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__norm2((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm2(std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm2(std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::norm2(std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_normInf(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<double*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::normInf(std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__normInf((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::normInf(std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::normInf(std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::normInf(std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_scale__SWIG_2(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
(&arg2)->first = static_cast<const double*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(std::pair< SC const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__scale__SWIG_2(arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(std::pair< SC const *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(std::pair< SC const *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::scale(std::pair< SC const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_meanValue(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<double*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::meanValue(std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__meanValue((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::meanValue(std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::meanValue(std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::meanValue(std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_get1dCopy(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, unsigned long const *farg3) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
std::pair< SC *,std::size_t > arg2 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<double*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dCopy(std::pair< SC *,std::size_t >,size_t const) const");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dCopy((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dCopy(std::pair< SC *,std::size_t >,size_t const) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dCopy(std::pair< SC *,std::size_t >,size_t const) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dCopy(std::pair< SC *,std::size_t >,size_t const) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMultiVector_get1dView(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
std::pair< SC const *,std::size_t > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dView() const");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dView((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dView() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dView() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dView() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult.data = const_cast<double*>((&result)->first);
fresult.size = (&result)->second;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraMultiVector_get1dViewNonConst(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
std::pair< SC *,std::size_t > result;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dViewNonConst()");;
try
{
// Attempt the wrapped function call
result = Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__get1dViewNonConst(arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dViewNonConst()", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dViewNonConst()", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::get1dViewNonConst()", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult.data = (&result)->first;
fresult.size = (&result)->second;
return fresult;
}
SWIGEXPORT void swigc_TpetraMultiVector_doImport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_doImport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doImport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_doExport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMultiVector_doExport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::MultiVector< SC,LO,GO,NO > *arg1 = (Tpetra::MultiVector< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > *", "TpetraMultiVector", "Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_MultiVector_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(arg1,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MultiVector< SC,LO,GO,NO >::doExport(Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_TpetraMultiVector(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Tpetra::MultiVector< SC,LO,GO,NO > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR | swig::IS_COPY_ASSIGN);
}
SWIGEXPORT void swigc_set_RowInfo_localRow(SwigClassWrapper const *farg1, unsigned long const *farg2) {
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t arg2 ;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::localRow", return );
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
arg2 = *farg2;
if (arg1) (arg1)->localRow = arg2;
}
SWIGEXPORT unsigned long swigc_get_RowInfo_localRow(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t result;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::localRow", return 0);
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
result = (size_t) ((arg1)->localRow);
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_set_RowInfo_allocSize(SwigClassWrapper const *farg1, unsigned long const *farg2) {
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t arg2 ;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::allocSize", return );
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
arg2 = *farg2;
if (arg1) (arg1)->allocSize = arg2;
}
SWIGEXPORT unsigned long swigc_get_RowInfo_allocSize(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t result;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::allocSize", return 0);
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
result = (size_t) ((arg1)->allocSize);
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_set_RowInfo_numEntries(SwigClassWrapper const *farg1, unsigned long const *farg2) {
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t arg2 ;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::numEntries", return );
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
arg2 = *farg2;
if (arg1) (arg1)->numEntries = arg2;
}
SWIGEXPORT unsigned long swigc_get_RowInfo_numEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t result;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::numEntries", return 0);
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
result = (size_t) ((arg1)->numEntries);
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_set_RowInfo_offset1D(SwigClassWrapper const *farg1, unsigned long const *farg2) {
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t arg2 ;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::offset1D", return );
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
arg2 = *farg2;
if (arg1) (arg1)->offset1D = arg2;
}
SWIGEXPORT unsigned long swigc_get_RowInfo_offset1D(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
size_t result;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::offset1D", return 0);
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
result = (size_t) ((arg1)->offset1D);
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_RowInfo() {
SwigClassWrapper fresult ;
Tpetra::RowInfo *result = 0 ;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::RowInfo::RowInfo()");;
try
{
// Attempt the wrapped function call
result = (Tpetra::RowInfo *)new Tpetra::RowInfo();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::RowInfo::RowInfo()", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::RowInfo::RowInfo()", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::RowInfo::RowInfo()", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result;
fresult.mem = (1 ? SWIG_MOVE : SWIG_REF);
return fresult;
}
SWIGEXPORT void swigc_delete_RowInfo(SwigClassWrapper const *farg1) {
Tpetra::RowInfo *arg1 = (Tpetra::RowInfo *) 0 ;
SWIG_check_mutable_nonnull(*farg1, "Tpetra::RowInfo *", "RowInfo", "Tpetra::RowInfo::~RowInfo()", return );
arg1 = static_cast< Tpetra::RowInfo * >(farg1->ptr);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::RowInfo::~RowInfo()");;
try
{
// Attempt the wrapped function call
delete arg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::RowInfo::~RowInfo()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::RowInfo::~RowInfo()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::RowInfo::~RowInfo()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_RowInfo(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Tpetra::RowInfo swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR);
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_0(SwigClassWrapper const *farg1, unsigned long const *farg2, int const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2,arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_1(SwigClassWrapper const *farg1, unsigned long const *farg2, int const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_2(SwigClassWrapper const *farg1, unsigned long const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3, int const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Teuchos::ParameterList > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull5 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3,arg4,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_4(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3, int const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const,Tpetra::ProfileType const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_5(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new Tpetra::CrsGraph< LO,GO,NO >((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraCrsGraph(SwigClassWrapper const *farg1) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::~CrsGraph()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::~CrsGraph()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::~CrsGraph()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::~CrsGraph()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_setParameterList(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->setParameterList((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getValidParameters(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getValidParameters() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getValidParameters();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getValidParameters() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getValidParameters() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getValidParameters() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Teuchos::ParameterList >(static_cast< const Teuchos::RCP<const Teuchos::ParameterList >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsGraph_insertGlobalIndices__SWIG_0(SwigClassWrapper const *farg1, long long const *farg2, int const *farg3, long long *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
long long arg2 ;
int arg3 ;
long long *arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2;
arg3 = *farg3;
arg4 = reinterpret_cast< long long * >(farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(long long const,int const,long long const [])");;
try
{
// Attempt the wrapped function call
(arg1)->insertGlobalIndices(arg2,arg3,(long long const (*))arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(long long const,int const,long long const [])", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(long long const,int const,long long const [])", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(long long const,int const,long long const [])", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_removeLocalIndices(SwigClassWrapper const *farg1, int const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeLocalIndices(int)");;
try
{
// Attempt the wrapped function call
(arg1)->removeLocalIndices(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeLocalIndices(int)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeLocalIndices(int)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeLocalIndices(int)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_globalAssemble(SwigClassWrapper const *farg1) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::globalAssemble()");;
try
{
// Attempt the wrapped function call
(arg1)->globalAssemble();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::globalAssemble()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::globalAssemble()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::globalAssemble()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_resumeFill__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->resumeFill((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_resumeFill__SWIG_1(SwigClassWrapper const *farg1) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill()");;
try
{
// Attempt the wrapped function call
(arg1)->resumeFill();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::resumeFill()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_fillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_fillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_fillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_fillComplete__SWIG_3(SwigClassWrapper const *farg1) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete()");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::fillComplete()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_expertStaticFillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > *arg5 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg6 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > tempnull5 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull6 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg6->ptr) : &tempnull6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)*arg5,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_expertStaticFillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > tempnull5 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_expertStaticFillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_expertStaticFillComplete__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getComm(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getComm() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getComm();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getComm() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getComm() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getComm() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Teuchos::Comm<int> >(static_cast< const Teuchos::RCP<const Teuchos::Comm<int> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getRowMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRowMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getRowMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRowMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRowMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRowMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getColMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getColMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getColMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getColMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getColMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getColMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getDomainMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getDomainMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getDomainMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getDomainMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getDomainMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getDomainMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getRangeMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRangeMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getRangeMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRangeMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRangeMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getRangeMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getImporter(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getImporter() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getImporter();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getImporter() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getImporter() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getImporter() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >(static_cast< const Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsGraph_getExporter(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::export_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getExporter() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getExporter();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getExporter() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getExporter() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getExporter() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >(static_cast< const Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getGlobalNumRows(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumRows() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getGlobalNumRows();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumRows() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumRows() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumRows() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getGlobalNumCols(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumCols() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getGlobalNumCols();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumCols() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumCols() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumCols() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeNumRows(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumRows() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeNumRows();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumRows() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumRows() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumRows() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeNumCols(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumCols() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeNumCols();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumCols() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumCols() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumCols() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getGlobalNumEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumEntries() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getGlobalNumEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeNumEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeNumEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNumEntriesInGlobalRow(SwigClassWrapper const *farg1, long long const *farg2) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
long long arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInGlobalRow(long long) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNumEntriesInGlobalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNumEntriesInLocalRow(SwigClassWrapper const *farg1, int const *farg2) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInLocalRow(int) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNumEntriesInLocalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeAllocationSize(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeAllocationSize() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeAllocationSize();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeAllocationSize() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeAllocationSize() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeAllocationSize() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNumAllocatedEntriesInGlobalRow(SwigClassWrapper const *farg1, long long const *farg2) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
long long arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInGlobalRow(long long) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNumAllocatedEntriesInGlobalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInGlobalRow(long long) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInGlobalRow(long long) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInGlobalRow(long long) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNumAllocatedEntriesInLocalRow(SwigClassWrapper const *farg1, int const *farg2) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInLocalRow(int) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNumAllocatedEntriesInLocalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInLocalRow(int) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInLocalRow(int) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNumAllocatedEntriesInLocalRow(int) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getGlobalNumDiags(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumDiags() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getGlobalNumDiags();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumDiags() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumDiags() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalNumDiags() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeNumDiags(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumDiags() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeNumDiags();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumDiags() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumDiags() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeNumDiags() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getGlobalMaxNumRowEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalMaxNumRowEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getGlobalMaxNumRowEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsGraph_getNodeMaxNumRowEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeMaxNumRowEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getNodeMaxNumRowEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_hasColMap(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::hasColMap() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->hasColMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::hasColMap() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::hasColMap() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::hasColMap() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isLowerTriangular(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLowerTriangular() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isLowerTriangular();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLowerTriangular() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLowerTriangular() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLowerTriangular() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isUpperTriangular(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isUpperTriangular() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isUpperTriangular();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isUpperTriangular() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isUpperTriangular() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isUpperTriangular() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isLocallyIndexed(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLocallyIndexed() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isLocallyIndexed();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLocallyIndexed() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLocallyIndexed() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isLocallyIndexed() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isGloballyIndexed(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isGloballyIndexed() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isGloballyIndexed();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isGloballyIndexed() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isGloballyIndexed() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isGloballyIndexed() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isFillComplete(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillComplete() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isFillComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillComplete() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillComplete() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillComplete() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isFillActive(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillActive() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isFillActive();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillActive() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillActive() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isFillActive() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isSorted(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isSorted() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isSorted();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isSorted() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isSorted() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isSorted() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_isStorageOptimized(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isStorageOptimized() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->isStorageOptimized();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isStorageOptimized() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isStorageOptimized() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::isStorageOptimized() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT int swigc_TpetraCrsGraph_getProfileType(SwigClassWrapper const *farg1) {
int fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::ProfileType result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getProfileType() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::ProfileType)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->getProfileType();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getProfileType() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getProfileType() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getProfileType() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = static_cast< int >(result);
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsGraph_supportsRowViews(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::supportsRowViews() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->supportsRowViews();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::supportsRowViews() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::supportsRowViews() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::supportsRowViews() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraCrsGraph_description(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
std::string result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::description() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->description();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::description() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::description() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::description() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult = SWIG_store_string(result);
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsGraph_replaceColMap(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->replaceColMap((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_reindexColumns__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, bool const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg3 = 0 ;
bool arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg3->ptr) : &tempnull3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_reindexColumns__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_reindexColumns__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::reindexColumns(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_replaceDomainMapAndImporter(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->replaceDomainMapAndImporter((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_removeEmptyProcessesInPlace(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->removeEmptyProcessesInPlace((Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT bool swigc_TpetraCrsGraph_haveGlobalConstants(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::haveGlobalConstants() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsGraph< LO,GO,NO > const *)arg1)->haveGlobalConstants();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::haveGlobalConstants() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::haveGlobalConstants() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::haveGlobalConstants() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsGraph_computeGlobalConstants(SwigClassWrapper const *farg1) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::computeGlobalConstants()");;
try
{
// Attempt the wrapped function call
(arg1)->computeGlobalConstants();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::computeGlobalConstants()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::computeGlobalConstants()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::computeGlobalConstants()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_6(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, int const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_6((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2,arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_7(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, int const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_6((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_8(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_6((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_9(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, int const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Teuchos::ParameterList > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull5 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_9((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_10(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, int const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_9((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_11(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_9((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_12(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t *,std::size_t > arg3 ;
std::pair< LO *,std::size_t > arg4 ;
Teuchos::RCP< Teuchos::ParameterList > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull5 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<size_t*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<int*>(farg4->data);
(&arg4)->second = farg4->size;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_12((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsGraph__SWIG_13(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t *,std::size_t > arg3 ;
std::pair< LO *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsGraph< LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<size_t*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<int*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsGraph< LO,GO,NO > *)new_Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg___SWIG_12((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::CrsGraph(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsGraph_insertGlobalIndices__SWIG_1(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(GO const,std::pair< GO const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__insertGlobalIndices__SWIG_1(arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(GO const,std::pair< GO const *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(GO const,std::pair< GO const *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertGlobalIndices(GO const,std::pair< GO const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_insertLocalIndices(SwigClassWrapper const *farg1, int const *farg2, SwigArrayWrapper *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
LO arg2 ;
std::pair< LO const *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2 - 1;
(&arg3)->first = static_cast<const int*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertLocalIndices(LO const,std::pair< LO const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__insertLocalIndices(arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertLocalIndices(LO const,std::pair< LO const *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertLocalIndices(LO const,std::pair< LO const *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::insertLocalIndices(LO const,std::pair< LO const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getGlobalRowCopy(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, unsigned long *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO *,std::size_t > arg3 ;
size_t *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<long long*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = reinterpret_cast< size_t * >(farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,size_t &) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getGlobalRowCopy((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,size_t &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,size_t &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,size_t &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getLocalRowCopy(SwigClassWrapper const *farg1, int const *farg2, SwigArrayWrapper *farg3, unsigned long *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
LO arg2 ;
std::pair< LO *,std::size_t > arg3 ;
size_t *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = reinterpret_cast< size_t * >(farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,size_t &) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getLocalRowCopy((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,size_t &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,size_t &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,size_t &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getgblRowView(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getgblRowView(GO const,std::pair< GO const *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getgblRowView((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getgblRowView(GO const,std::pair< GO const *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getgblRowView(GO const,std::pair< GO const *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getgblRowView(GO const,std::pair< GO const *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_setAllIndices(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
std::pair< LO *,std::size_t > arg3 ;
std::pair< SC *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setAllIndices(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__setAllIndices(arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setAllIndices(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setAllIndices(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::setAllIndices(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getNodeRowPtrs(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeRowPtrs(std::pair< std::size_t *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodeRowPtrs((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeRowPtrs(std::pair< std::size_t *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeRowPtrs(std::pair< std::size_t *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodeRowPtrs(std::pair< std::size_t *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getNodePackedIndices(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodePackedIndices(std::pair< std::size_t *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getNodePackedIndices((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodePackedIndices(std::pair< std::size_t *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodePackedIndices(std::pair< std::size_t *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getNodePackedIndices(std::pair< std::size_t *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_getLocalDiagOffsets(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__getLocalDiagOffsets((Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_doImport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Tpetra::CrsGraph< LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsGraph< LO,GO,NO,NO::classic > *", "TpetraCrsGraph", "Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(arg1,(Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_doImport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Tpetra::CrsGraph< LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsGraph< LO,GO,NO,NO::classic > *", "TpetraCrsGraph", "Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(arg1,(Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doImport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_doExport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Tpetra::CrsGraph< LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsGraph< LO,GO,NO,NO::classic > *", "TpetraCrsGraph", "Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(arg1,(Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsGraph_doExport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsGraph< LO,GO,NO > *arg1 = (Tpetra::CrsGraph< LO,GO,NO > *) 0 ;
Tpetra::CrsGraph< LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsGraph< LO,GO,NO,NO::classic > *", "TpetraCrsGraph", "Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsGraph<LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsGraph_Sl_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(arg1,(Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsGraph< LO,GO,NO >::doExport(Tpetra::CrsGraph< LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_TpetraCrsGraph(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR);
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_0(SwigClassWrapper const *farg1, unsigned long const *farg2, int const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2,arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_1(SwigClassWrapper const *farg1, unsigned long const *farg2, int const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_2(SwigClassWrapper const *farg1, unsigned long const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
size_t arg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3, int const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Teuchos::ParameterList > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull5 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3,arg4,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_4(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3, int const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t,Tpetra::ProfileType)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_5(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, unsigned long const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > *arg2 = 0 ;
size_t arg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::map_type const > const &,size_t)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_6(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > *arg1 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > tempnull1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)*arg1,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_7(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > tempnull1 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > * >(farg1->ptr) : &tempnull1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new Tpetra::CrsMatrix< SC,LO,GO,NO >((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)*arg1);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraCrsMatrix(SwigClassWrapper const *farg1) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::~CrsMatrix()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::~CrsMatrix()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::~CrsMatrix()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::~CrsMatrix()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_setAllToScalar(SwigClassWrapper const *farg1, double const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllToScalar(double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->setAllToScalar((double const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllToScalar(double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllToScalar(double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllToScalar(double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_scale(SwigClassWrapper const *farg1, double const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
double *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = reinterpret_cast< double * >(const_cast< double* >(farg2));
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::scale(double const &)");;
try
{
// Attempt the wrapped function call
(arg1)->scale((double const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::scale(double const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::scale(double const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::scale(double const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_globalAssemble(SwigClassWrapper const *farg1) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::globalAssemble()");;
try
{
// Attempt the wrapped function call
(arg1)->globalAssemble();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::globalAssemble()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::globalAssemble()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::globalAssemble()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_resumeFill__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->resumeFill((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_resumeFill__SWIG_1(SwigClassWrapper const *farg1) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill()");;
try
{
// Attempt the wrapped function call
(arg1)->resumeFill();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::resumeFill()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_fillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_fillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_fillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete((Teuchos::RCP< Teuchos::ParameterList > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete(Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_fillComplete__SWIG_3(SwigClassWrapper const *farg1) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete()");;
try
{
// Attempt the wrapped function call
(arg1)->fillComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::fillComplete()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_expertStaticFillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > *arg5 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg6 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > tempnull5 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull6 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg6->ptr) : &tempnull6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)*arg5,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_expertStaticFillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > tempnull5 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_expertStaticFillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_expertStaticFillComplete__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->expertStaticFillComplete((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::expertStaticFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_replaceColMap(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->replaceColMap((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceColMap(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_reindexColumns__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, bool const *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *arg2 = (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *) (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *)0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
bool arg5 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
smartarg2 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = smartarg2 ? smartarg2->get() : NULL;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns(arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_reindexColumns__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *arg2 = (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *) (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *)0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
smartarg2 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = smartarg2 ? smartarg2->get() : NULL;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns(arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_reindexColumns__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *arg2 = (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *) (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *)0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsGraph< LO,GO,NO,NO::classic > > *smartarg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
smartarg2 = static_cast< Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = smartarg2 ? smartarg2->get() : NULL;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->reindexColumns(arg2,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::reindexColumns(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::crs_graph_type *const,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_replaceDomainMapAndImporter(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > tempnull3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > &)");;
try
{
// Attempt the wrapped function call
(arg1)->replaceDomainMapAndImporter((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2,*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceDomainMapAndImporter(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::import_type const > &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_removeEmptyProcessesInPlace(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
(arg1)->removeEmptyProcessesInPlace((Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::removeEmptyProcessesInPlace(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getComm(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Teuchos::Comm< int > const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getComm() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getComm();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getComm() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getComm() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getComm() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Teuchos::Comm<int> >(static_cast< const Teuchos::RCP<const Teuchos::Comm<int> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getRowMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRowMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getRowMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRowMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRowMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRowMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getColMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getColMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getColMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getColMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getColMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getColMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getCrsGraph(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::crs_graph_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getCrsGraph() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getCrsGraph();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getCrsGraph() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getCrsGraph() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getCrsGraph() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP<const Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getGlobalNumRows(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumRows() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getGlobalNumRows();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumRows() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumRows() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumRows() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getGlobalNumCols(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumCols() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getGlobalNumCols();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumCols() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumCols() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumCols() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNodeNumRows(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumRows() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNodeNumRows();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumRows() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumRows() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumRows() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNodeNumCols(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumCols() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNodeNumCols();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumCols() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumCols() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumCols() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getGlobalNumEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumEntries() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getGlobalNumEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNodeNumEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNodeNumEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNumEntriesInGlobalRow(SwigClassWrapper const *farg1, long long const *farg2) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
long long arg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInGlobalRow(long long) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNumEntriesInGlobalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInGlobalRow(long long) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNumEntriesInLocalRow(SwigClassWrapper const *farg1, int const *farg2) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
int arg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInLocalRow(int) const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNumEntriesInLocalRow(arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNumEntriesInLocalRow(int) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getGlobalNumDiags(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::global_size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumDiags() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::global_size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getGlobalNumDiags();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumDiags() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumDiags() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalNumDiags() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNodeNumDiags(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumDiags() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNodeNumDiags();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumDiags() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumDiags() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeNumDiags() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getGlobalMaxNumRowEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalMaxNumRowEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getGlobalMaxNumRowEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalMaxNumRowEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT unsigned long swigc_TpetraCrsMatrix_getNodeMaxNumRowEntries(SwigClassWrapper const *farg1) {
unsigned long fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
size_t result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeMaxNumRowEntries() const");;
try
{
// Attempt the wrapped function call
result = (size_t)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getNodeMaxNumRowEntries();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getNodeMaxNumRowEntries() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_hasColMap(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasColMap() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->hasColMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasColMap() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasColMap() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasColMap() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isLowerTriangular(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLowerTriangular() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isLowerTriangular();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLowerTriangular() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLowerTriangular() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLowerTriangular() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isUpperTriangular(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isUpperTriangular() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isUpperTriangular();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isUpperTriangular() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isUpperTriangular() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isUpperTriangular() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isLocallyIndexed(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLocallyIndexed() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isLocallyIndexed();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLocallyIndexed() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLocallyIndexed() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isLocallyIndexed() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isGloballyIndexed(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isGloballyIndexed() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isGloballyIndexed();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isGloballyIndexed() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isGloballyIndexed() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isGloballyIndexed() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isFillComplete(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillComplete() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isFillComplete();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillComplete() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillComplete() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillComplete() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isFillActive(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillActive() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isFillActive();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillActive() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillActive() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isFillActive() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isStorageOptimized(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStorageOptimized() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isStorageOptimized();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStorageOptimized() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStorageOptimized() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStorageOptimized() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT int swigc_TpetraCrsMatrix_getProfileType(SwigClassWrapper const *farg1) {
int fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::ProfileType result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getProfileType() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::ProfileType)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getProfileType();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getProfileType() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getProfileType() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getProfileType() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = static_cast< int >(result);
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_isStaticGraph(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStaticGraph() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->isStaticGraph();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStaticGraph() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStaticGraph() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::isStaticGraph() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT double swigc_TpetraCrsMatrix_getFrobeniusNorm(SwigClassWrapper const *farg1) {
double fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::mag_type result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getFrobeniusNorm() const");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::mag_type)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getFrobeniusNorm();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getFrobeniusNorm() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getFrobeniusNorm() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getFrobeniusNorm() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_supportsRowViews(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::supportsRowViews() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->supportsRowViews();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::supportsRowViews() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::supportsRowViews() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::supportsRowViews() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsMatrix_apply__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4, double const *farg5, double const *farg6) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Teuchos::ETransp arg4 ;
double arg5 ;
double arg6 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const", return )
smartarg3 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = smartarg3->get();
arg4 = static_cast< Teuchos::ETransp >(*farg4);
arg5 = *farg5;
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->apply((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2,*arg3,arg4,arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double,double) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_apply__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4, double const *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Teuchos::ETransp arg4 ;
double arg5 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const", return )
smartarg3 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = smartarg3->get();
arg4 = static_cast< Teuchos::ETransp >(*farg4);
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->apply((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2,*arg3,arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp,double) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_apply__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Teuchos::ETransp arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const", return )
smartarg3 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = smartarg3->get();
arg4 = static_cast< Teuchos::ETransp >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->apply((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2,*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Teuchos::ETransp) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_apply__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const", return )
smartarg3 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = smartarg3->get();
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->apply((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2,*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::apply(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_hasTransposeApply(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasTransposeApply() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->hasTransposeApply();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasTransposeApply() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasTransposeApply() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::hasTransposeApply() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getDomainMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getDomainMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getDomainMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getDomainMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getDomainMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getDomainMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraCrsMatrix_getRangeMap(SwigClassWrapper const *farg1) {
SwigClassWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRangeMap() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->getRangeMap();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRangeMap() const", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRangeMap() const", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getRangeMap() const", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsMatrix_gaussSeidel(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, double const *farg5, int const *farg6, int const *farg7) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg4 = 0 ;
double *arg5 = 0 ;
Tpetra::ESweepDirection arg6 ;
int arg7 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg4 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", return )
smartarg3 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = smartarg3->get();
SWIG_check_sp_nonnull(farg4,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", return )
smartarg4 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg4->ptr);
arg4 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg4->get());
arg5 = reinterpret_cast< double * >(const_cast< double* >(farg5));
arg6 = static_cast< Tpetra::ESweepDirection >(*farg6);
arg7 = *farg7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->gaussSeidel((Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg2,*arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg4,(double const &)*arg5,arg6,arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidel(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_gaussSeidelCopy(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, double const *farg5, int const *farg6, int const *farg7, bool const *farg8) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg2 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg3 = 0 ;
Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *arg4 = 0 ;
double *arg5 = 0 ;
Tpetra::ESweepDirection arg6 ;
int arg7 ;
bool arg8 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > > *smartarg2 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::MultiVector< SC,LO,GO,NO,NO::classic > const > *smartarg4 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", return )
smartarg2 = static_cast< Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = smartarg2->get();
SWIG_check_sp_nonnull(farg3,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
SWIG_check_sp_nonnull(farg4,
"Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > *", "TpetraMultiVector", "Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", return )
smartarg4 = static_cast< Teuchos::RCP<const Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >* >(farg4->ptr);
arg4 = const_cast<Tpetra::MultiVector<SC,LO,GO,NO,NO::classic>*>(smartarg4->get());
arg5 = reinterpret_cast< double * >(const_cast< double* >(farg5));
arg6 = static_cast< Tpetra::ESweepDirection >(*farg6);
arg7 = *farg7;
arg8 = *farg8;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->gaussSeidelCopy(*arg2,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg3,(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &)*arg4,(double const &)*arg5,arg6,arg7,arg8);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::gaussSeidelCopy(Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,Tpetra::MultiVector< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > const &,double const &,Tpetra::ESweepDirection const,int const,bool const) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigArrayWrapper swigc_TpetraCrsMatrix_description(SwigClassWrapper const *farg1) {
SwigArrayWrapper fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
std::string result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::description() const");;
try
{
// Attempt the wrapped function call
result = ((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->description();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::description() const", SWIG_IndexError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::description() const", SWIG_RuntimeError, e.what(), return SwigArrayWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::description() const", SWIG_UnknownError, "An unknown exception occurred", return SwigArrayWrapper_uninitialized());
}
}
fresult = SWIG_store_string(result);
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsMatrix_importAndFillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg6 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull6 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg6->ptr) : &tempnull6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->importAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_importAndFillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->importAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_importAndFillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6, SwigClassWrapper const *farg7) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *arg3 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg6 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg7 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull6 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull7 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
SWIG_check_sp_nonnull(farg4,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg4 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg4->ptr);
arg4 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg4->get());
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg6->ptr) : &tempnull6;
arg7 = farg7->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg7->ptr) : &tempnull7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->importAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &)*arg3,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg6,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::importAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::import_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_exportAndFillComplete__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg6 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull6 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg6->ptr) : &tempnull6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->exportAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_exportAndFillComplete__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->exportAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_exportAndFillComplete__SWIG_2(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull4 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->exportAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg3,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_exportAndFillComplete__SWIG_3(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg3 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->exportAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_exportAndFillComplete__SWIG_4(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, SwigClassWrapper const *farg6, SwigClassWrapper const *farg7) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > *arg2 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg3 = 0 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg6 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg7 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > tempnull2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull6 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull7 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > * >(farg2->ptr) : &tempnull2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
SWIG_check_sp_nonnull(farg4,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", return )
smartarg4 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg4->ptr);
arg4 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg4->get());
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg6->ptr) : &tempnull6;
arg7 = farg7->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg7->ptr) : &tempnull7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const");;
try
{
// Attempt the wrapped function call
((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->exportAndFillComplete(*arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg3,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &)*arg4,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg5,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &)*arg6,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::exportAndFillComplete(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,NO::classic > > &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode >::export_type const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Teuchos::ParameterList > const &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT bool swigc_TpetraCrsMatrix_haveGlobalConstants(SwigClassWrapper const *farg1) {
bool fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
bool result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::haveGlobalConstants() const");;
try
{
// Attempt the wrapped function call
result = (bool)((Tpetra::CrsMatrix< SC,LO,GO,NO > const *)arg1)->haveGlobalConstants();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::haveGlobalConstants() const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::haveGlobalConstants() const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::haveGlobalConstants() const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_8(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, int const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_8((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2,arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_9(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, int const *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Tpetra::ProfileType arg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
arg3 = static_cast< Tpetra::ProfileType >(*farg3);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_8((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_10(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
std::pair< std::size_t const *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
(&arg2)->first = static_cast<const size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_8((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_11(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, int const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Teuchos::ParameterList > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull5 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_11((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_12(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, int const *farg4) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Tpetra::ProfileType arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
arg4 = static_cast< Tpetra::ProfileType >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_11((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >,Tpetra::ProfileType)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_13(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t const *,std::size_t > arg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<const size_t*>(farg3->data);
(&arg3)->second = farg3->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_11((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_14(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, SwigArrayWrapper *farg5, SwigClassWrapper const *farg6) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t *,std::size_t > arg3 ;
std::pair< LO *,std::size_t > arg4 ;
std::pair< SC *,std::size_t > arg5 ;
Teuchos::RCP< Teuchos::ParameterList > *arg6 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull6 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<size_t*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<int*>(farg4->data);
(&arg4)->second = farg4->size;
(&arg5)->first = static_cast<double*>(farg5->data);
(&arg5)->second = farg5->size;
arg6 = farg6->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg6->ptr) : &tempnull6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_14((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4,arg5,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraCrsMatrix__SWIG_15(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, SwigArrayWrapper *farg5) {
SwigClassWrapper fresult ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg1 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > *arg2 = 0 ;
std::pair< std::size_t *,std::size_t > arg3 ;
std::pair< LO *,std::size_t > arg4 ;
std::pair< SC *,std::size_t > arg5 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull1 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > tempnull2 ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *result = 0 ;
arg1 = farg1->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg1->ptr) : &tempnull1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > * >(farg2->ptr) : &tempnull2;
(&arg3)->first = static_cast<size_t*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<int*>(farg4->data);
(&arg4)->second = farg4->size;
(&arg5)->first = static_cast<double*>(farg5->data);
(&arg5)->second = farg5->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (Tpetra::CrsMatrix< SC,LO,GO,NO > *)new_Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg___SWIG_14((Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3,arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::CrsMatrix(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic >::map_type const > const &,std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsMatrix_insertGlobalValues(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
std::pair< SC const *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<const double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__insertGlobalValues(arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_insertLocalValues(SwigClassWrapper const *farg1, int const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
LO arg2 ;
std::pair< LO const *,std::size_t > arg3 ;
std::pair< SC const *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2 - 1;
(&arg3)->first = static_cast<const int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<const double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertLocalValues(LO const,std::pair< LO const *,std::size_t >,std::pair< SC const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__insertLocalValues(arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertLocalValues(LO const,std::pair< LO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertLocalValues(LO const,std::pair< LO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::insertLocalValues(LO const,std::pair< LO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT int swigc_TpetraCrsMatrix_replaceGlobalValues(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
int fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
std::pair< SC const *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
LO result;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<const double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
result = (LO)Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__replaceGlobalValues((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::replaceGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT int swigc_TpetraCrsMatrix_sumIntoGlobalValues(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
int fresult ;
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
std::pair< SC const *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
LO result;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<const double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::sumIntoGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)");;
try
{
// Attempt the wrapped function call
result = (LO)Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__sumIntoGlobalValues(arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::sumIntoGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_IndexError, e.what(), return 0);
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::sumIntoGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_RuntimeError, e.what(), return 0);
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::sumIntoGlobalValues(GO const,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return 0);
}
}
fresult = result;
return fresult;
}
SWIGEXPORT void swigc_TpetraCrsMatrix_setAllValues(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
std::pair< LO *,std::size_t > arg3 ;
std::pair< SC *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__setAllValues(arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::setAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_getAllValues(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
std::pair< LO *,std::size_t > arg3 ;
std::pair< SC *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getAllValues((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getAllValues(std::pair< std::size_t *,std::size_t >,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_getGlobalRowCopy(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, unsigned long *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO *,std::size_t > arg3 ;
std::pair< SC *,std::size_t > arg4 ;
size_t *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<long long*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<double*>(farg4->data);
(&arg4)->second = farg4->size;
arg5 = reinterpret_cast< size_t * >(farg5);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getGlobalRowCopy((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4,*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowCopy(GO,std::pair< GO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_getLocalRowCopy(SwigClassWrapper const *farg1, int const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, unsigned long *farg5) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
LO arg2 ;
std::pair< LO *,std::size_t > arg3 ;
std::pair< SC *,std::size_t > arg4 ;
size_t *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2 - 1;
(&arg3)->first = static_cast<int*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<double*>(farg4->data);
(&arg4)->second = farg4->size;
arg5 = reinterpret_cast< size_t * >(farg5);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getLocalRowCopy((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4,*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalRowCopy(LO,std::pair< LO *,std::size_t >,std::pair< SC *,std::size_t >,size_t &) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_getGlobalRowView(SwigClassWrapper const *farg1, long long const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
GO arg2 ;
std::pair< GO const *,std::size_t > arg3 ;
std::pair< SC const *,std::size_t > arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
arg2 = *farg2;
(&arg3)->first = static_cast<const long long*>(farg3->data);
(&arg3)->second = farg3->size;
(&arg4)->first = static_cast<const double*>(farg4->data);
(&arg4)->second = farg4->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowView(GO,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getGlobalRowView((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowView(GO,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowView(GO,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getGlobalRowView(GO,std::pair< GO const *,std::size_t >,std::pair< SC const *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_getLocalDiagOffsets(SwigClassWrapper const *farg1, SwigArrayWrapper *farg2) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
std::pair< std::size_t *,std::size_t > arg2 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get()) : NULL;
(&arg2)->first = static_cast<size_t*>(farg2->data);
(&arg2)->second = farg2->size;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__getLocalDiagOffsets((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const *)arg1,arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::getLocalDiagOffsets(std::pair< std::size_t *,std::size_t >) const", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_doImport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *", "TpetraCrsMatrix", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_0(arg1,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_doImport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *", "TpetraCrsMatrix", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doImport__SWIG_1(arg1,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doImport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_doExport__SWIG_0(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Export< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Export< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *", "TpetraCrsMatrix", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Export< LO,GO,NO > *", "TpetraExport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Export<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Export<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_0(arg1,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Export< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Export< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraCrsMatrix_doExport__SWIG_1(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, int const *farg4) {
Tpetra::CrsMatrix< SC,LO,GO,NO > *arg1 = (Tpetra::CrsMatrix< SC,LO,GO,NO > *) 0 ;
Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *arg2 = 0 ;
Tpetra::Import< LO,GO,NO > *arg3 = 0 ;
Tpetra::CombineMode arg4 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg2 ;
Teuchos::RCP< Tpetra::Import< LO,GO,NO > const > *smartarg3 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
SWIG_check_sp_nonnull(farg2,
"Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > *", "TpetraCrsMatrix", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg2->get());
SWIG_check_sp_nonnull(farg3,
"Tpetra::Import< LO,GO,NO > *", "TpetraImport", "Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::Import<LO,GO,NO> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::Import<LO,GO,NO>*>(smartarg3->get());
arg4 = static_cast< Tpetra::CombineMode >(*farg4);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)");;
try
{
// Attempt the wrapped function call
Tpetra_CrsMatrix_Sl_SC_Sc_LO_Sc_GO_Sc_NO_Sg__doExport__SWIG_1(arg1,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const &)*arg2,(Tpetra::Import< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::CrsMatrix< SC,LO,GO,NO >::doExport(Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const &,Tpetra::Import< LO,GO,NO > const &,Tpetra::CombineMode)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_TpetraCrsMatrix(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0);
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3, bool const *farg4, bool const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
bool arg4 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = *farg4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3,arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3, bool const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
bool arg4 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_3(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_4(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, bool const *farg5, bool const *farg6) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
bool arg5 ;
bool arg6 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
arg5 = *farg5;
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4,arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_5(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, bool const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_6(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_7(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6, bool const *farg7, bool const *farg8) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
bool arg7 ;
bool arg8 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
arg7 = *farg7;
arg8 = *farg8;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6,arg7,arg8);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_8(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6, bool const *farg7) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
bool arg7 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
arg7 = *farg7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6,arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_9(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseGraphFile__SWIG_10(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_graph_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseGraphFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsGraph<LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3, bool const *farg4, bool const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
bool arg4 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = *farg4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3,arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3, bool const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
bool arg4 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
bool arg3 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_3(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_4(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, bool const *farg5, bool const *farg6) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
bool arg5 ;
bool arg6 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
arg5 = *farg5;
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4,arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_5(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, bool const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_6(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Teuchos::Comm< int > const > *arg2 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg3 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg4 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Teuchos::Comm< int > const > tempnull2 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull3 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Teuchos::Comm< int > const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg4->ptr) : &tempnull4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg3,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_4(std::string const &,Teuchos::RCP< Teuchos::Comm< int > const > const &,Teuchos::RCP< Teuchos::ParameterList > const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_7(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6, bool const *farg7, bool const *farg8) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
bool arg7 ;
bool arg8 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
arg7 = *farg7;
arg8 = *farg8;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6,arg7,arg8);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_8(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6, bool const *farg7) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
bool arg7 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
arg7 = *farg7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6,arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_9(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5, bool const *farg6) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
bool arg6 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readSparseFile__SWIG_10(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, SwigClassWrapper const *farg4, SwigClassWrapper const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg4 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg5 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull4 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull5 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::sparse_matrix_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = farg4->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg4->ptr) : &tempnull4;
arg5 = farg5->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg5->ptr) : &tempnull5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7((std::string const &)*arg1,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,*arg3,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg4,(Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readSparseFile__SWIG_7(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readDenseFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, bool const *farg4, bool const *farg5) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
bool arg4 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::multivector_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = *farg4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,*arg3,arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readDenseFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3, bool const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
bool arg4 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::multivector_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,*arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readDenseFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigClassWrapper const *farg3) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > *arg3 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > tempnull3 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::multivector_type > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
arg3 = farg3->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > * >(farg3->ptr) : &tempnull3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,*arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readDenseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >(static_cast< const Teuchos::RCP< Tpetra::MultiVector<SC,LO,GO,NO,NO::classic> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readMapFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3, bool const *farg4) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
bool arg3 ;
bool arg4 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
arg4 = *farg4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3,arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readMapFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
bool arg3 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_TpetraReader_readMapFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
SwigClassWrapper fresult ;
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > tempnull2 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::map_type const > result;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &)");;
try
{
// Attempt the wrapped function call
result = Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Teuchos::Comm< int > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &)", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &)", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Tpetra_MatrixMarket_Reader_Sl_CMT_Sg__readMapFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Reader< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > >::comm_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = (new Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >(static_cast< const Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >& >(result)));
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraReader() {
SwigClassWrapper fresult ;
Tpetra::MatrixMarket::Reader< CMT > *result = 0 ;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Reader()");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MatrixMarket::Reader< CMT > *)new Tpetra::MatrixMarket::Reader< CMT >();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Reader()", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Reader()", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::Reader()", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MatrixMarket::Reader<CMT> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraReader(SwigClassWrapper const *farg1) {
Tpetra::MatrixMarket::Reader< CMT > *arg1 = (Tpetra::MatrixMarket::Reader< CMT > *) 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Reader< CMT > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Reader<CMT> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::~Reader()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::~Reader()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::~Reader()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Reader< CMT >::~Reader()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_TpetraReader(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::MatrixMarket::Reader<CMT> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR);
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, bool const *farg5) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > *arg2 = 0 ;
std::string *arg3 = 0 ;
std::string *arg4 = 0 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > tempnull2 ;
std::string tempstr3 ;
std::string tempstr4 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > * >(farg2->ptr) : &tempnull2;
tempstr3 = std::string(static_cast<const char*>(farg3->data), farg3->size);
arg3 = &tempstr3;
tempstr4 = std::string(static_cast<const char*>(farg4->data), farg4->size);
arg4 = &tempstr4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &,bool const)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const > const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > *arg2 = 0 ;
std::string *arg3 = 0 ;
std::string *arg4 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > tempnull2 ;
std::string tempstr3 ;
std::string tempstr4 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > * >(farg2->ptr) : &tempnull2;
tempstr3 = std::string(static_cast<const char*>(farg3->data), farg3->size);
arg3 = &tempstr3;
tempstr4 = std::string(static_cast<const char*>(farg4->data), farg4->size);
arg4 = &tempstr4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const > const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,std::string const &,std::string const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > *arg2 = 0 ;
bool arg3 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > tempnull2 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseFile__SWIG_3(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > tempnull2 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::sparse_matrix_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseGraphFile__SWIG_0(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, bool const *farg5) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > *arg2 = 0 ;
std::string *arg3 = 0 ;
std::string *arg4 = 0 ;
bool arg5 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > tempnull2 ;
std::string tempstr3 ;
std::string tempstr4 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > * >(farg2->ptr) : &tempnull2;
tempstr3 = std::string(static_cast<const char*>(farg3->data), farg3->size);
arg3 = &tempstr3;
tempstr4 = std::string(static_cast<const char*>(farg4->data), farg4->size);
arg4 = &tempstr4;
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &,bool const)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseGraphFile__SWIG_1(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > *arg2 = 0 ;
std::string *arg3 = 0 ;
std::string *arg4 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > tempnull2 ;
std::string tempstr3 ;
std::string tempstr4 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > * >(farg2->ptr) : &tempnull2;
tempstr3 = std::string(static_cast<const char*>(farg3->data), farg3->size);
arg3 = &tempstr3;
tempstr4 = std::string(static_cast<const char*>(farg4->data), farg4->size);
arg4 = &tempstr4;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_0(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,std::string const &,std::string const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseGraphFile__SWIG_2(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2, bool const *farg3) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > *arg2 = 0 ;
bool arg3 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > tempnull2 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > * >(farg2->ptr) : &tempnull2;
arg3 = *farg3;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,bool const)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2,arg3);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,bool const)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,bool const)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &,bool const)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeSparseGraphFile__SWIG_3(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
std::string *arg1 = 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > tempnull2 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
arg2 = farg2->ptr ? static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > * >(farg2->ptr) : &tempnull2;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2((std::string const &)*arg1,(Teuchos::RCP< Tpetra::CrsGraph< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeSparseGraphFile__SWIG_2(std::string const &,Teuchos::RCP< Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::crs_graph_type const > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraWriter_writeMapFile(SwigArrayWrapper *farg1, SwigClassWrapper const *farg2) {
std::string *arg1 = 0 ;
Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type *arg2 = 0 ;
std::string tempstr1 ;
Teuchos::RCP< Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const > *smartarg2 ;
tempstr1 = std::string(static_cast<const char*>(farg1->data), farg1->size);
arg1 = &tempstr1;
SWIG_check_sp_nonnull(farg2,
"Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type *", "TpetraMap", "Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &)", return )
smartarg2 = static_cast< Teuchos::RCP<const Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode> >* >(farg2->ptr);
arg2 = const_cast<Tpetra::Map<int,long long,Kokkos::Compat::KokkosSerialWrapperNode>*>(smartarg2->get());
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &)");;
try
{
// Attempt the wrapped function call
Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile((std::string const &)*arg1,(Tpetra::Map< int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg2);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Tpetra_MatrixMarket_Writer_Sl_CMT_Sg__writeMapFile(std::string const &,Tpetra::MatrixMarket::Writer< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode,Kokkos::Compat::KokkosSerialWrapperNode::classic > >::map_type const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT SwigClassWrapper swigc_new_TpetraWriter() {
SwigClassWrapper fresult ;
Tpetra::MatrixMarket::Writer< CMT > *result = 0 ;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Writer()");;
try
{
// Attempt the wrapped function call
result = (Tpetra::MatrixMarket::Writer< CMT > *)new Tpetra::MatrixMarket::Writer< CMT >();
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Writer()", SWIG_IndexError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Writer()", SWIG_RuntimeError, e.what(), return SwigClassWrapper_uninitialized());
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::Writer()", SWIG_UnknownError, "An unknown exception occurred", return SwigClassWrapper_uninitialized());
}
}
fresult.ptr = result ? new Teuchos::RCP< Tpetra::MatrixMarket::Writer<CMT> >(result SWIG_NO_NULL_DELETER_1) : NULL;
fresult.mem = SWIG_MOVE;
return fresult;
}
SWIGEXPORT void swigc_delete_TpetraWriter(SwigClassWrapper const *farg1) {
Tpetra::MatrixMarket::Writer< CMT > *arg1 = (Tpetra::MatrixMarket::Writer< CMT > *) 0 ;
Teuchos::RCP< Tpetra::MatrixMarket::Writer< CMT > > *smartarg1 ;
smartarg1 = static_cast< Teuchos::RCP< Tpetra::MatrixMarket::Writer<CMT> >* >(farg1->ptr);
arg1 = smartarg1 ? smartarg1->get() : NULL;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::~Writer()");;
try
{
// Attempt the wrapped function call
(void)arg1; delete smartarg1;
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::~Writer()", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::~Writer()", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMarket::Writer< CMT >::~Writer()", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_assignment_TpetraWriter(SwigClassWrapper * self, SwigClassWrapper const * other) {
typedef Teuchos::RCP< Tpetra::MatrixMarket::Writer<CMT> > swig_lhs_classtype;
SWIG_assign(swig_lhs_classtype, self,
swig_lhs_classtype, const_cast<SwigClassWrapper*>(other),
0 | swig::IS_COPY_CONSTR);
}
SWIGEXPORT void swigc_TpetraMatrixMatrixMultiply__SWIG_0(SwigClassWrapper const *farg1, bool const *farg2, SwigClassWrapper const *farg3, bool const *farg4, SwigClassWrapper const *farg5, bool const *farg6, SwigArrayWrapper *farg7, SwigClassWrapper const *farg8) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg3 = 0 ;
bool arg4 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg5 = 0 ;
bool arg6 ;
std::string *arg7 = 0 ;
Teuchos::RCP< Teuchos::ParameterList > *arg8 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg5 ;
std::string tempstr7 ;
Teuchos::RCP< Teuchos::ParameterList > tempnull8 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = *farg4;
SWIG_check_sp_nonnull(farg5,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", return )
smartarg5 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = smartarg5->get();
arg6 = *farg6;
tempstr7 = std::string(static_cast<const char*>(farg7->data), farg7->size);
arg7 = &tempstr7;
arg8 = farg8->ptr ? static_cast< Teuchos::RCP< Teuchos::ParameterList > * >(farg8->ptr) : &tempnull8;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Multiply< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4,*arg5,arg6,(std::string const &)*arg7,(Teuchos::RCP< Teuchos::ParameterList > const &)*arg8);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &,Teuchos::RCP< Teuchos::ParameterList > const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMatrixMatrixMultiply__SWIG_1(SwigClassWrapper const *farg1, bool const *farg2, SwigClassWrapper const *farg3, bool const *farg4, SwigClassWrapper const *farg5, bool const *farg6, SwigArrayWrapper *farg7) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg3 = 0 ;
bool arg4 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg5 = 0 ;
bool arg6 ;
std::string *arg7 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg5 ;
std::string tempstr7 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = *farg4;
SWIG_check_sp_nonnull(farg5,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", return )
smartarg5 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = smartarg5->get();
arg6 = *farg6;
tempstr7 = std::string(static_cast<const char*>(farg7->data), farg7->size);
arg7 = &tempstr7;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Multiply< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4,*arg5,arg6,(std::string const &)*arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool,std::string const &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMatrixMatrixMultiply__SWIG_2(SwigClassWrapper const *farg1, bool const *farg2, SwigClassWrapper const *farg3, bool const *farg4, SwigClassWrapper const *farg5, bool const *farg6) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg3 = 0 ;
bool arg4 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg5 = 0 ;
bool arg6 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg5 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = *farg4;
SWIG_check_sp_nonnull(farg5,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", return )
smartarg5 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = smartarg5->get();
arg6 = *farg6;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Multiply< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4,*arg5,arg6);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,bool)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMatrixMatrixMultiply__SWIG_3(SwigClassWrapper const *farg1, bool const *farg2, SwigClassWrapper const *farg3, bool const *farg4, SwigClassWrapper const *farg5) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg3 = 0 ;
bool arg4 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg5 = 0 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg3 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg5 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
SWIG_check_sp_nonnull(farg3,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", return )
smartarg3 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg3->ptr);
arg3 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg3->get());
arg4 = *farg4;
SWIG_check_sp_nonnull(farg5,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", return )
smartarg5 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg5->ptr);
arg5 = smartarg5->get();
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Multiply< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg3,arg4,*arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Multiply< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMatrixMatrixAdd__SWIG_0(SwigClassWrapper const *farg1, bool const *farg2, double const *farg3, SwigClassWrapper const *farg4, double const *farg5) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
double arg3 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg4 = 0 ;
double arg5 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > > *smartarg4 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
arg3 = *farg3;
SWIG_check_sp_nonnull(farg4,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)", return )
smartarg4 = static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg4->ptr);
arg4 = smartarg4->get();
arg5 = *farg5;
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Add< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,arg3,*arg4,arg5);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > &,double)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
SWIGEXPORT void swigc_TpetraMatrixMatrixAdd__SWIG_1(SwigClassWrapper const *farg1, bool const *farg2, double const *farg3, SwigClassWrapper const *farg4, bool const *farg5, double const *farg6, SwigClassWrapper const *farg7) {
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg1 = 0 ;
bool arg2 ;
double arg3 ;
Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *arg4 = 0 ;
bool arg5 ;
double arg6 ;
Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > > arg7 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg1 ;
Teuchos::RCP< Tpetra::CrsMatrix< SC,LO,GO,NO,NO::classic > const > *smartarg4 ;
SWIG_check_sp_nonnull(farg1,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)", return )
smartarg1 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg1->ptr);
arg1 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg1->get());
arg2 = *farg2;
arg3 = *farg3;
SWIG_check_sp_nonnull(farg4,
"Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > *", "TpetraCrsMatrix", "Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)", return )
smartarg4 = static_cast< Teuchos::RCP<const Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg4->ptr);
arg4 = const_cast<Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic>*>(smartarg4->get());
arg5 = *farg5;
arg6 = *farg6;
if (farg7->ptr) arg7 = *static_cast< Teuchos::RCP< Tpetra::CrsMatrix<SC,LO,GO,NO,NO::classic> >* >(farg7->ptr);
{
// Make sure no unhandled exceptions exist before performing a new action
SWIG_check_unhandled_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)");;
try
{
// Attempt the wrapped function call
Tpetra::MatrixMatrix::SWIGTEMPLATEDISAMBIGUATOR Add< SC,LO,GO,NO >((Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg1,arg2,arg3,(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &)*arg4,arg5,arg6,arg7);
}
catch (const std::range_error& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)", SWIG_IndexError, e.what(), return );
}
catch (const std::exception& e)
{
// Store a C++ exception
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)", SWIG_RuntimeError, e.what(), return );
}
catch (...)
{
SWIG_exception_impl("Tpetra::MatrixMatrix::Add< SC,LO,GO,NO >(Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > const &,bool,double,Teuchos::RCP< Tpetra::CrsMatrix< double,int,long long,Kokkos::Compat::KokkosSerialWrapperNode > >)", SWIG_UnknownError, "An unknown exception occurred", return );
}
}
}
#ifdef __cplusplus
}
#endif
| 65.57391 | 901 | 0.715788 |
101a7a297c6a1cf8e3b2907fa469ff6d5a23cf8b | 178 | cpp | C++ | src/Hooks.cpp | colinswrath/BladeAndBlunt- | 624aaf42fc8d1ac4eebd7766905caddd1109144d | [
"MIT"
] | 1 | 2022-01-13T00:23:10.000Z | 2022-01-13T00:23:10.000Z | src/Hooks.cpp | colinswrath/BladeAndBlunt- | 624aaf42fc8d1ac4eebd7766905caddd1109144d | [
"MIT"
] | 1 | 2021-12-03T05:17:10.000Z | 2022-02-09T21:33:45.000Z | src/Hooks.cpp | colinswrath/BladeAndBlunt- | 624aaf42fc8d1ac4eebd7766905caddd1109144d | [
"MIT"
] | 1 | 2022-01-13T00:23:13.000Z | 2022-01-13T00:23:13.000Z | #include "UpdateManager.h"
namespace Hooks
{
void Install()
{
UpdateManager::Install();
UpdateManager::InstallScalePatch();
logger::info("Update hook installed.");
}
}
| 14.833333 | 41 | 0.702247 |
101ca5a3c4e75bf9bf317303735beee47e741c38 | 6,432 | cpp | C++ | dev/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.cpp | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 2 | 2020-12-22T01:02:01.000Z | 2020-12-22T01:02:05.000Z | dev/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.cpp | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | null | null | null | dev/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.cpp | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | null | null | null | /*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include "precompiled.h"
#include "ScriptEventsSystemComponent.h"
#include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Component/EntityId.h>
#include <AzCore/EBus/EBus.h>
#include <AzCore/Math/Color.h>
#include <AzCore/RTTI/TypeInfo.h>
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzCore/std/string/string.h>
#include <AzCore/std/sort.h>
#include <AzCore/IO/Device.h>
#include <AzFramework/Asset/GenericAssetHandler.h>
#include <ScriptEvents/ScriptEventsAsset.h>
#include <ScriptEvents/ScriptEventsAssetRef.h>
#include <ScriptEvents/ScriptEventDefinition.h>
#include <ScriptEvents/ScriptEventFundamentalTypes.h>
namespace ScriptEvents
{
void SystemComponent::Reflect(AZ::ReflectContext* context)
{
using namespace ScriptEvents;
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
{
serialize->Class<SystemComponent, AZ::Component>()
->Version(1)
// ScriptEvents avoids a use dependency on the AssetBuilderSDK. Therefore the Crc is used directly to register this component with the Gem builder
->Attribute(AZ::Edit::Attributes::SystemComponentTags, AZStd::vector<AZ::Crc32>({ AZ_CRC("AssetBuilder", 0xc739c7d7) }));
;
}
ScriptEventData::VersionedProperty::Reflect(context);
Parameter::Reflect(context);
Method::Reflect(context);
ScriptEvent::Reflect(context);
ScriptEvents::ScriptEventsAsset::Reflect(context);
ScriptEvents::ScriptEventsAssetRef::Reflect(context);
}
void SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC("ScriptEventsService", 0x6897c23b));
}
void SystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
{
incompatible.push_back(AZ_CRC("ScriptEventsService", 0x6897c23b));
}
void SystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
AZ_UNUSED(required);
}
void SystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
{
AZ_UNUSED(dependent);
}
void SystemComponent::Init()
{
}
void SystemComponent::Activate()
{
ScriptEvents::ScriptEventBus::Handler::BusConnect();
if (AZ::Data::AssetManager::IsReady())
{
RegisterAssetHandler();
}
}
void SystemComponent::Deactivate()
{
ScriptEvents::ScriptEventBus::Handler::BusDisconnect();
UnregisterAssetHandler();
}
AZStd::intrusive_ptr<Internal::ScriptEvent> SystemComponent::RegisterScriptEvent(const AZ::Data::AssetId& assetId, AZ::u32 version)
{
AZ_Assert(assetId.IsValid(), "Unable to register Script Event with invalid asset Id");
ScriptEventKey key(assetId, 0);
if (m_scriptEvents.find(key) == m_scriptEvents.end())
{
m_scriptEvents[key] = AZStd::intrusive_ptr<ScriptEvents::Internal::ScriptEvent>(aznew ScriptEvents::Internal::ScriptEvent(assetId));
}
return m_scriptEvents[key];
}
void SystemComponent::RegisterScriptEventFromDefinition(const ScriptEvents::ScriptEvent& definition)
{
AZ::BehaviorContext* behaviorContext = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationBus::Events::GetBehaviorContext);
const AZStd::string& busName = definition.GetName();
const auto& ebusIterator = behaviorContext->m_ebuses.find(busName);
if (ebusIterator != behaviorContext->m_ebuses.end())
{
AZ_Warning("Script Events", false, "A Script Event by the name of %s already exists, this definition will be ignored. Do not call Register for Script Events referenced by asset.", busName.c_str());
return;
}
const AZ::Uuid& assetId = AZ::Uuid::CreateName(busName.c_str());
ScriptEventKey key(assetId, 0);
if (m_scriptEvents.find(key) == m_scriptEvents.end())
{
AZ::Data::Asset<ScriptEvents::ScriptEventsAsset> assetData = AZ::Data::AssetManager::Instance().CreateAsset<ScriptEvents::ScriptEventsAsset>(assetId);
// Install the definition that's coming from Lua
ScriptEvents::ScriptEventsAsset* scriptAsset = assetData.Get();
scriptAsset->m_definition = definition;
m_scriptEvents[key] = AZStd::intrusive_ptr<ScriptEvents::Internal::ScriptEvent>(aznew ScriptEvents::Internal::ScriptEvent(assetId));
m_scriptEvents[key]->CompleteRegistration(assetData);
}
}
void SystemComponent::UnregisterScriptEventFromDefinition(const ScriptEvents::ScriptEvent& definition)
{
const AZStd::string& busName = definition.GetName();
const AZ::Uuid& assetId = AZ::Uuid::CreateName(busName.c_str());
AZ::Data::Asset<ScriptEvents::ScriptEventsAsset> assetData = AZ::Data::AssetManager::Instance().FindAsset<ScriptEvents::ScriptEventsAsset>(assetId);
if (assetData)
{
assetData.Release();
}
}
AZStd::intrusive_ptr<ScriptEvents::Internal::ScriptEvent> SystemComponent::GetScriptEvent(const AZ::Data::AssetId& assetId, AZ::u32 version)
{
ScriptEventKey key(assetId, 0);
if (m_scriptEvents.find(key) != m_scriptEvents.end())
{
return m_scriptEvents[key];
}
AZ_Warning("Script Events", false, "Script event with asset Id %s was not found (version %d)", assetId.ToString<AZStd::string>().c_str(), version);
return nullptr;
}
} | 38.059172 | 209 | 0.691231 |
101dfff37a7ac85a5de077fd0cb8e69851045194 | 4,171 | hpp | C++ | airesources/C++/hlt/map.hpp | snaar/Halite-II-pre-launch | 14bafe38bfa2e3062f3daceb29049098a0744b30 | [
"MIT"
] | null | null | null | airesources/C++/hlt/map.hpp | snaar/Halite-II-pre-launch | 14bafe38bfa2e3062f3daceb29049098a0744b30 | [
"MIT"
] | 14 | 2021-01-28T21:06:14.000Z | 2022-02-26T08:01:15.000Z | airesources/C++/hlt/map.hpp | xinnosuke/Halite-II-pre-launch | 1091f85d5e02de29e16980302771ea1f0e0376a5 | [
"MIT"
] | 1 | 2019-07-01T04:46:47.000Z | 2019-07-01T04:46:47.000Z | #ifndef HLT_H
#define HLT_H
#ifdef _WIN32
#define _USE_MATH_DEFINES
#endif
#include <list>
#include <cmath>
#include <vector>
#include <random>
#include <algorithm>
#include <functional>
#include <iostream>
#include <fstream>
#include <sstream>
#include <assert.h>
#include <array>
#include <unordered_map>
#include "constants.hpp"
#include "log.hpp"
#include "entity.hpp"
#include "move.hpp"
namespace hlt {
template<typename T>
using entity_map = std::unordered_map<EntityIndex, T>;
class Map {
public:
std::unordered_map<PlayerId, entity_map<Ship>> ships;
entity_map<Planet> planets;
unsigned short map_width, map_height;
Map();
Map(const Map& other_map);
Map(unsigned short width, unsigned short height);
auto is_valid(EntityId entity_id) -> bool;
auto within_bounds(const Location& location) const -> bool;
auto get_ship(PlayerId player, EntityIndex entity) -> Ship&;
auto get_ship(PlayerId player, EntityIndex entity) const -> const Ship&;
auto get_ship(EntityId entity_id) -> Ship&;
auto get_planet(EntityId entity_id) -> Planet&;
auto get_entity(EntityId entity_id) -> Entity&;
auto get_distance(Location l1, Location l2) const -> double;
/**
* Create a location with an offset applied, checking if the location
* is within bounds. If not, the second member of the pair will be
* false.
* @param location
* @param dx
* @param dy
* @return
*/
auto location_with_delta(const Location& location, double dx, double dy) -> possibly<Location>;
auto test(const Location& location, double radius) -> std::vector<EntityId>;
constexpr static auto FORECAST_STEPS = 64;
constexpr static auto FORECAST_DELTA = 1.0 / FORECAST_STEPS;
/**
* Checks if there is a valid straight-line path between the two
* locations. Does not account for collisions with ships, but does
* account for planets.
* @param start
* @param target
* @param fudge How much distance to leave between planets and the path
* @return
*/
auto pathable(const Location& start, const Location& target, double fudge) const -> bool;
/**
* Check if a collision might occur if a ship at the given location
* were to move to the target position.
*
* Does not account for the ship's current velocity, so it is only
* useful for sub-inertial speeds. Does not account for the movements
* of other ships.
*/
auto forecast_collision(const Location& start, const Location& target) -> bool;
/**
* Try to avoid forecasted collisions (as predicted by
* forecast_collision()) by adjusting the direction of travel.
*
* All caveats of forecast_collision() apply. Additionally, it does
* not try and predict the movements of other ships, and it may not
* be able to avert a collision. In such cases, it will still try and
* move, though it may move in a particularly suboptimal direction.
* @param start
* @param angle
* @param thrust
* @param tries
* @return
*/
auto adjust_for_collision(
const Location& start, double angle, unsigned short thrust,
int tries=25) -> std::pair<double, unsigned short>;
/**
* Find the closest point at the minimum given distance (radius) to the
* given target point from the given start point.
* @param start
* @param target
* @param radius
* @return
*/
auto closest_point(const Location& start, const Location& target,
double radius)
-> std::pair<Location, bool> {
auto angle = start.angle_to(target) + M_PI;
auto dx = radius * std::cos(angle);
auto dy = radius * std::sin(angle);
return this->location_with_delta(target, dx, dy);
}
};
}
#endif
| 33.637097 | 103 | 0.614721 |
101e017628bccea963b9aee80d88beee4a5adf68 | 18,303 | cpp | C++ | test/homework_test/tic_tac_toe_test/tic_tac_toe_test.cpp | acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-Joshua-18 | 9c0733afa337f35b2e067d2f7c3c83204700c225 | [
"MIT"
] | null | null | null | test/homework_test/tic_tac_toe_test/tic_tac_toe_test.cpp | acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-Joshua-18 | 9c0733afa337f35b2e067d2f7c3c83204700c225 | [
"MIT"
] | null | null | null | test/homework_test/tic_tac_toe_test/tic_tac_toe_test.cpp | acc-cosc-1337-spring-2021/acc-cosc-1337-spring-2021-Joshua-18 | 9c0733afa337f35b2e067d2f7c3c83204700c225 | [
"MIT"
] | null | null | null | #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
#include "tic_tac_toe.h"
#include "tic_tac_toe_manager.h"
#include "tic_tac_toe_3.h"
#include "tic_tac_toe_4.h"
TEST_CASE("Verify Test Configuration", "verification") {
REQUIRE(true == true);
}
TEST_CASE("Test game over if 9 slots are selected")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("X");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "C");
}
TEST_CASE("Test first player set to X")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
REQUIRE(game->get_player() == "x");
}
TEST_CASE("Test first player set to O")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("o");
REQUIRE(game->get_player() == "o");
}
TEST_CASE("Test win by first column", "set positions for first player X to 1,4,7.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("Test win by second column", "set positions for first player X to 2,5,8.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("Test win by third column", "set positions for first player O to 3,6,9.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("o");
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("Test win by first row", "set positions for first player X to 1,2,3.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("Test win by second row", "set positions for first player X to 4,5,6.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("Test win by third row", "set positions for first player O to 7,8,9.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("o");
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("Test win diagonally from top left", "set positions for first player X to 1,5,9.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("Test win diagonally from bottom left", "set positions for first player O to 7,5,3.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_3>();
game->start_game("o");
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("Test the get_winner class function")
{
int o = 0;
int x = 0;
int ties = 0;
TicTacToeManager manager;
unique_ptr<tic_tac_toe> game1 = make_unique<tic_tac_toe_3>();
//x wins
game1->start_game("x");
game1->mark_board(7);
REQUIRE(game1->game_over() == false);
game1->mark_board(5);
REQUIRE(game1->game_over() == false);
game1->mark_board(8);
REQUIRE(game1->game_over() == false);
game1->mark_board(1);
REQUIRE(game1->game_over() == false);
game1->mark_board(9);
REQUIRE(game1->game_over() == true);
REQUIRE(game1->get_winner() == "x");
manager.save_game(game1);
manager.get_winner_total(o, x, ties);
//o wins
unique_ptr<tic_tac_toe> game2 = make_unique<tic_tac_toe_3>();
game2->start_game("o");
game2->mark_board(1);
REQUIRE(game2->game_over() == false);
game2->mark_board(9);
REQUIRE(game2->game_over() == false);
game2->mark_board(2);
REQUIRE(game2->game_over() == false);
game2->mark_board(7);
REQUIRE(game2->game_over() == false);
game2->mark_board(3);
REQUIRE(game2->game_over() == true);
REQUIRE(game2->get_winner() == "o");
manager.save_game(game2);
manager.get_winner_total(o, x, ties);
//tie
unique_ptr<tic_tac_toe> game3 = make_unique<tic_tac_toe_3>();
game3->mark_board(1);
REQUIRE(game3->game_over() == false);
game3->mark_board(2);
REQUIRE(game3->game_over() == false);
game3->mark_board(3);
REQUIRE(game3->game_over() == false);
game3->mark_board(4);
REQUIRE(game3->game_over() == false);
game3->mark_board(5);
REQUIRE(game3->game_over() == false);
game3->mark_board(7);
REQUIRE(game3->game_over() == false);
game3->mark_board(6);
REQUIRE(game3->game_over() == false);
game3->mark_board(9);
REQUIRE(game3->game_over() == false);
game3->mark_board(8);
REQUIRE(game3->game_over() == true);
REQUIRE(game3->get_winner() == "C");
manager.save_game(game3);
manager.get_winner_total(o, x, ties);
REQUIRE(x == 1);
REQUIRE(o == 1);
REQUIRE(ties == 1);
}
/**********************************************************************************************
* *
* TEST TIC TAC TOE4! *
* *
**********************************************************************************************/
TEST_CASE("4 Test game over if 9 slots are selected")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("X");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(10);
REQUIRE(game->game_over() == false);
game->mark_board(11);
REQUIRE(game->game_over() == false);
game->mark_board(12);
REQUIRE(game->game_over() == false);
game->mark_board(14);
REQUIRE(game->game_over() == false);
game->mark_board(13);
REQUIRE(game->game_over() == false);
game->mark_board(16);
REQUIRE(game->game_over() == false);
game->mark_board(15);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "C");
}
TEST_CASE("4 Test first player set to X")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
REQUIRE(game->get_player() == "x");
}
TEST_CASE("4 Test first player set to O")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("o");
REQUIRE(game->get_player() == "o");
}
TEST_CASE("4 Test win by first column", "set positions for first player X to 0 , 4 , 8, 12.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(13);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win by second column", "set positions for first player X to 1, 5, 9, 13.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(10);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(14);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win by third column", "set positions for first player O to 2, 6, 10, 14")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("o");
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(11);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(15);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("4 Test win by fourth column", "set positions for first player X to 3, 7, 11, 15.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(12);
REQUIRE(game->game_over() == false);
game->mark_board(10);
REQUIRE(game->game_over() == false);
game->mark_board(16);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win by first row", "set positions for first player X to 0, 1, 2, 3.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win by second row", "set positions for first player O to 4, 5, 6, 7.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("o");
game->mark_board(5);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(8);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("4 Test win by third row", "set positions for first player x to 8, 9, 10, 11.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(9);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(10);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(11);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(12);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win by forth row", "set positions for first player O to 12, 13, 14, 15.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(13);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(14);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(15);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(16);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win diagonally from top left", "set positions for first player X to 0, 5, 10, 15.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("x");
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(6);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(11);
REQUIRE(game->game_over() == false);
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(16);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "x");
}
TEST_CASE("4 Test win diagonally from bottom left", "set positions for first player O to 3, 6, 9, 12.")
{
unique_ptr<tic_tac_toe> game = make_unique<tic_tac_toe_4>();
game->start_game("o");
game->mark_board(4);
REQUIRE(game->game_over() == false);
game->mark_board(1);
REQUIRE(game->game_over() == false);
game->mark_board(7);
REQUIRE(game->game_over() == false);
game->mark_board(2);
REQUIRE(game->game_over() == false);
game->mark_board(10);
REQUIRE(game->game_over() == false);
game->mark_board(3);
REQUIRE(game->game_over() == false);
game->mark_board(13);
REQUIRE(game->game_over() == true);
REQUIRE(game->get_winner() == "o");
}
TEST_CASE("4 Test the get_winner class function")
{
int o = 0;
int x = 0;
int ties = 0;
TicTacToeManager manager;
unique_ptr<tic_tac_toe> game1 = make_unique<tic_tac_toe_4>();
//x wins
game1->start_game("x");
game1->mark_board(1);
REQUIRE(game1->game_over() == false);
game1->mark_board(9);
REQUIRE(game1->game_over() == false);
game1->mark_board(6);
REQUIRE(game1->game_over() == false);
game1->mark_board(2);
REQUIRE(game1->game_over() == false);
game1->mark_board(11);
REQUIRE(game1->game_over() == false);
game1->mark_board(3);
REQUIRE(game1->game_over() == false);
game1->mark_board(16);
REQUIRE(game1->game_over() == true);
REQUIRE(game1->get_winner() == "x");
manager.save_game(game1);
manager.get_winner_total(o, x, ties);
//o wins
unique_ptr<tic_tac_toe> game2 = make_unique<tic_tac_toe_4>();
game2->start_game("o");
game2->mark_board(4);
REQUIRE(game2->game_over() == false);
game2->mark_board(1);
REQUIRE(game2->game_over() == false);
game2->mark_board(7);
REQUIRE(game2->game_over() == false);
game2->mark_board(2);
REQUIRE(game2->game_over() == false);
game2->mark_board(10);
REQUIRE(game2->game_over() == false);
game2->mark_board(3);
REQUIRE(game2->game_over() == false);
game2->mark_board(13);
REQUIRE(game2->game_over() == true);
REQUIRE(game2->get_winner() == "o");
manager.save_game(game2);
manager.get_winner_total(o, x, ties);
//tie
unique_ptr<tic_tac_toe> game3 = make_unique<tic_tac_toe_4>();
game3->mark_board(1);
REQUIRE(game3->game_over() == false);
game3->mark_board(2);
REQUIRE(game3->game_over() == false);
game3->mark_board(3);
REQUIRE(game3->game_over() == false);
game3->mark_board(4);
REQUIRE(game3->game_over() == false);
game3->mark_board(5);
REQUIRE(game3->game_over() == false);
game3->mark_board(6);
REQUIRE(game3->game_over() == false);
game3->mark_board(7);
REQUIRE(game3->game_over() == false);
game3->mark_board(8);
REQUIRE(game3->game_over() == false);
game3->mark_board(9);
REQUIRE(game3->game_over() == false);
game3->mark_board(10);
REQUIRE(game3->game_over() == false);
game3->mark_board(11);
REQUIRE(game3->game_over() == false);
game3->mark_board(12);
REQUIRE(game3->game_over() == false);
game3->mark_board(14);
REQUIRE(game3->game_over() == false);
game3->mark_board(15);
REQUIRE(game3->game_over() == false);
game3->mark_board(16);
REQUIRE(game3->game_over() == false);
game3->mark_board(13);
REQUIRE(game3->game_over() == true);
REQUIRE(game3->get_winner() == "C");
manager.save_game(game3);
manager.get_winner_total(o, x, ties);
REQUIRE(x == 1);
REQUIRE(o == 1);
REQUIRE(ties == 1);
} | 27.399701 | 103 | 0.665956 |
101ff64d0585f68bb033ae455ed9e2d5f60bae56 | 901 | hh | C++ | elements/tcpudp/settcpchecksum.hh | BorisPis/asplos22-nicmem-fastclick | ab4df08ee056ed48a4c534ec5f8536a958f756b5 | [
"BSD-3-Clause-Clear"
] | 129 | 2015-10-08T14:38:35.000Z | 2022-03-06T14:54:44.000Z | elements/tcpudp/settcpchecksum.hh | BorisPis/asplos22-nicmem-fastclick | ab4df08ee056ed48a4c534ec5f8536a958f756b5 | [
"BSD-3-Clause-Clear"
] | 241 | 2016-02-17T16:17:58.000Z | 2022-03-15T09:08:33.000Z | elements/tcpudp/settcpchecksum.hh | BorisPis/asplos22-nicmem-fastclick | ab4df08ee056ed48a4c534ec5f8536a958f756b5 | [
"BSD-3-Clause-Clear"
] | 61 | 2015-12-17T01:46:58.000Z | 2022-02-07T22:25:19.000Z | #ifndef CLICK_SETTCPCHECKSUM_HH
#define CLICK_SETTCPCHECKSUM_HH
#include <click/batchelement.hh>
#include <click/glue.hh>
CLICK_DECLS
/*
* =c
* SetTCPChecksum([FIXOFF])
* =s tcp
* sets TCP packets' checksums
* =d
* Input packets should be TCP in IP.
*
* Calculates the TCP header's checksum and sets the checksum header field.
* Uses the IP header fields to generate the pseudo-header.
*
* =a CheckTCPHeader, SetIPChecksum, CheckIPHeader, SetUDPChecksum
*/
class SetTCPChecksum : public SimpleElement<SetTCPChecksum> { public:
SetTCPChecksum() CLICK_COLD;
~SetTCPChecksum() CLICK_COLD;
const char *class_name() const override { return "SetTCPChecksum"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &conf, ErrorHandler *errh) CLICK_COLD;
Packet *simple_action(Packet *);
private:
bool _fixoff;
};
CLICK_ENDDECLS
#endif
| 23.710526 | 75 | 0.744728 |
102217186aed80fbda1811f8df254351e73c26c5 | 836 | cpp | C++ | c++ practice projects/arathimatic.cpp | adityamuley29/c-plus-plus-exercise-projects | 034ab4b9f0a853bacb37e2ad7683c27bc2cc0dac | [
"MIT"
] | null | null | null | c++ practice projects/arathimatic.cpp | adityamuley29/c-plus-plus-exercise-projects | 034ab4b9f0a853bacb37e2ad7683c27bc2cc0dac | [
"MIT"
] | null | null | null | c++ practice projects/arathimatic.cpp | adityamuley29/c-plus-plus-exercise-projects | 034ab4b9f0a853bacb37e2ad7683c27bc2cc0dac | [
"MIT"
] | null | null | null | #include<iostream.h>
class arith
{
private: int a,b,r;
char op;
public: void getdata();
void operate();
void display();
};
void arith::getdata()
{
cout<<"Enter Values of a & b"<<endl;
cin>>a>>b;
}
void arith::operate()
{
do
{
cout<<"Enter your choice + or - or * or / or Exit:"<<endl;
cin>>op;
switch(op)
{
case '+':r=a+b;
display();
break;
case '-':r=a-b;
display();
break;
case '*':r=a*b;
display();
break;
case '/':r=a/b;
display();
break;
default :
cout<<"Wrong Choice"<<endl;
break;
}
}while(op!='x');
}
void arith::display()
{
cout<<"Result ="<<r<<endl;
}
int main()
{
arith ar;
ar.getdata();
ar.operate();
return 0;
}
| 11.942857 | 60 | 0.453349 |
10247715cd1c79d42150a0c9948738e4cde51c23 | 27,938 | cc | C++ | net/socket/tcp_socket_posix.cc | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 1 | 2020-09-15T08:43:34.000Z | 2020-09-15T08:43:34.000Z | net/socket/tcp_socket_posix.cc | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | net/socket/tcp_socket_posix.cc | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/socket/tcp_socket.h"
#include <errno.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/posix/eintr_wrapper.h"
#include "base/profiler/scoped_tracker.h"
#include "base/task_runner_util.h"
#include "base/threading/worker_pool.h"
#include "base/time/default_tick_clock.h"
#include "net/base/address_list.h"
#include "net/base/connection_type_histograms.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/network_activity_monitor.h"
#include "net/base/network_change_notifier.h"
#include "net/base/sockaddr_storage.h"
#include "net/socket/socket_net_log_params.h"
#include "net/socket/socket_posix.h"
// If we don't have a definition for TCPI_OPT_SYN_DATA, create one.
#ifndef TCPI_OPT_SYN_DATA
#define TCPI_OPT_SYN_DATA 32
#endif
namespace net {
namespace {
// True if OS supports TCP FastOpen.
bool g_tcp_fastopen_supported = false;
// True if TCP FastOpen is user-enabled for all connections.
// TODO(jri): Change global variable to param in HttpNetworkSession::Params.
bool g_tcp_fastopen_user_enabled = false;
// True if TCP FastOpen connect-with-write has failed at least once.
bool g_tcp_fastopen_has_failed = false;
// SetTCPKeepAlive sets SO_KEEPALIVE.
bool SetTCPKeepAlive(int fd, bool enable, int delay) {
// Enabling TCP keepalives is the same on all platforms.
int on = enable ? 1 : 0;
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on))) {
PLOG(ERROR) << "Failed to set SO_KEEPALIVE on fd: " << fd;
return false;
}
// If we disabled TCP keep alive, our work is done here.
if (!enable)
return true;
#if defined(OS_LINUX) || defined(OS_ANDROID)
// Setting the keepalive interval varies by platform.
// Set seconds until first TCP keep alive.
if (setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) {
PLOG(ERROR) << "Failed to set TCP_KEEPIDLE on fd: " << fd;
return false;
}
// Set seconds between TCP keep alives.
if (setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &delay, sizeof(delay))) {
PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd;
return false;
}
#elif defined(OS_MACOSX) || defined(OS_IOS)
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay))) {
PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd;
return false;
}
#endif
return true;
}
#if defined(OS_LINUX) || defined(OS_ANDROID)
// Checks if the kernel supports TCP FastOpen.
bool SystemSupportsTCPFastOpen() {
const base::FilePath::CharType kTCPFastOpenProcFilePath[] =
"/proc/sys/net/ipv4/tcp_fastopen";
std::string system_supports_tcp_fastopen;
if (!base::ReadFileToString(base::FilePath(kTCPFastOpenProcFilePath),
&system_supports_tcp_fastopen)) {
return false;
}
// The read from /proc should return '1' if TCP FastOpen is enabled in the OS.
if (system_supports_tcp_fastopen.empty() ||
(system_supports_tcp_fastopen[0] != '1')) {
return false;
}
return true;
}
void RegisterTCPFastOpenIntentAndSupport(bool user_enabled,
bool system_supported) {
g_tcp_fastopen_supported = system_supported;
g_tcp_fastopen_user_enabled = user_enabled;
}
#endif
#if defined(TCP_INFO)
bool GetTcpInfo(SocketDescriptor fd, tcp_info* info) {
socklen_t info_len = sizeof(tcp_info);
return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &info_len) == 0 &&
info_len == sizeof(tcp_info);
}
#endif // defined(TCP_INFO)
} // namespace
//-----------------------------------------------------------------------------
bool IsTCPFastOpenSupported() {
return g_tcp_fastopen_supported;
}
bool IsTCPFastOpenUserEnabled() {
return g_tcp_fastopen_user_enabled;
}
// This is asynchronous because it needs to do file IO, and it isn't allowed to
// do that on the IO thread.
void CheckSupportAndMaybeEnableTCPFastOpen(bool user_enabled) {
#if defined(OS_LINUX) || defined(OS_ANDROID)
base::PostTaskAndReplyWithResult(
base::WorkerPool::GetTaskRunner(/*task_is_slow=*/false).get(),
FROM_HERE,
base::Bind(SystemSupportsTCPFastOpen),
base::Bind(RegisterTCPFastOpenIntentAndSupport, user_enabled));
#endif
}
TCPSocketPosix::TCPSocketPosix(
std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher,
NetLog* net_log,
const NetLog::Source& source)
: socket_performance_watcher_(std::move(socket_performance_watcher)),
tick_clock_(new base::DefaultTickClock()),
rtt_notifications_minimum_interval_(base::TimeDelta::FromSeconds(1)),
use_tcp_fastopen_(false),
tcp_fastopen_write_attempted_(false),
tcp_fastopen_connected_(false),
tcp_fastopen_status_(TCP_FASTOPEN_STATUS_UNKNOWN),
logging_multiple_connect_attempts_(false),
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)) {
net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE,
source.ToEventParametersCallback());
}
TCPSocketPosix::~TCPSocketPosix() {
net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE);
Close();
}
int TCPSocketPosix::Open(AddressFamily family) {
DCHECK(!socket_);
socket_.reset(new SocketPosix);
int rv = socket_->Open(ConvertAddressFamily(family));
if (rv != OK)
socket_.reset();
return rv;
}
int TCPSocketPosix::AdoptConnectedSocket(int socket_fd,
const IPEndPoint& peer_address) {
DCHECK(!socket_);
SockaddrStorage storage;
if (!peer_address.ToSockAddr(storage.addr, &storage.addr_len) &&
// For backward compatibility, allows the empty address.
!(peer_address == IPEndPoint())) {
return ERR_ADDRESS_INVALID;
}
socket_.reset(new SocketPosix);
int rv = socket_->AdoptConnectedSocket(socket_fd, storage);
if (rv != OK)
socket_.reset();
return rv;
}
int TCPSocketPosix::Bind(const IPEndPoint& address) {
DCHECK(socket_);
SockaddrStorage storage;
if (!address.ToSockAddr(storage.addr, &storage.addr_len))
return ERR_ADDRESS_INVALID;
return socket_->Bind(storage);
}
int TCPSocketPosix::Listen(int backlog) {
DCHECK(socket_);
return socket_->Listen(backlog);
}
int TCPSocketPosix::Accept(std::unique_ptr<TCPSocketPosix>* tcp_socket,
IPEndPoint* address,
const CompletionCallback& callback) {
DCHECK(tcp_socket);
DCHECK(!callback.is_null());
DCHECK(socket_);
DCHECK(!accept_socket_);
net_log_.BeginEvent(NetLog::TYPE_TCP_ACCEPT);
int rv = socket_->Accept(
&accept_socket_,
base::Bind(&TCPSocketPosix::AcceptCompleted, base::Unretained(this),
tcp_socket, address, callback));
if (rv != ERR_IO_PENDING)
rv = HandleAcceptCompleted(tcp_socket, address, rv);
return rv;
}
int TCPSocketPosix::Connect(const IPEndPoint& address,
const CompletionCallback& callback) {
DCHECK(socket_);
if (!logging_multiple_connect_attempts_)
LogConnectBegin(AddressList(address));
net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
CreateNetLogIPEndPointCallback(&address));
SockaddrStorage storage;
if (!address.ToSockAddr(storage.addr, &storage.addr_len))
return ERR_ADDRESS_INVALID;
if (use_tcp_fastopen_) {
// With TCP FastOpen, we pretend that the socket is connected.
DCHECK(!tcp_fastopen_write_attempted_);
socket_->SetPeerAddress(storage);
return OK;
}
int rv =
socket_->Connect(storage, base::Bind(&TCPSocketPosix::ConnectCompleted,
base::Unretained(this), callback));
if (rv != ERR_IO_PENDING)
rv = HandleConnectCompleted(rv);
return rv;
}
bool TCPSocketPosix::IsConnected() const {
if (!socket_)
return false;
if (use_tcp_fastopen_ && !tcp_fastopen_write_attempted_ &&
socket_->HasPeerAddress()) {
// With TCP FastOpen, we pretend that the socket is connected.
// This allows GetPeerAddress() to return peer_address_.
return true;
}
return socket_->IsConnected();
}
bool TCPSocketPosix::IsConnectedAndIdle() const {
// TODO(wtc): should we also handle the TCP FastOpen case here,
// as we do in IsConnected()?
return socket_ && socket_->IsConnectedAndIdle();
}
int TCPSocketPosix::Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
DCHECK(socket_);
DCHECK(!callback.is_null());
int rv = socket_->Read(
buf, buf_len,
base::Bind(&TCPSocketPosix::ReadCompleted,
// Grab a reference to |buf| so that ReadCompleted() can still
// use it when Read() completes, as otherwise, this transfers
// ownership of buf to socket.
base::Unretained(this), make_scoped_refptr(buf), callback));
if (rv != ERR_IO_PENDING)
rv = HandleReadCompleted(buf, rv);
return rv;
}
int TCPSocketPosix::Write(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
DCHECK(socket_);
DCHECK(!callback.is_null());
CompletionCallback write_callback =
base::Bind(&TCPSocketPosix::WriteCompleted,
// Grab a reference to |buf| so that WriteCompleted() can still
// use it when Write() completes, as otherwise, this transfers
// ownership of buf to socket.
base::Unretained(this), make_scoped_refptr(buf), callback);
int rv;
if (use_tcp_fastopen_ && !tcp_fastopen_write_attempted_) {
rv = TcpFastOpenWrite(buf, buf_len, write_callback);
} else {
rv = socket_->Write(buf, buf_len, write_callback);
}
if (rv != ERR_IO_PENDING)
rv = HandleWriteCompleted(buf, rv);
return rv;
}
int TCPSocketPosix::GetLocalAddress(IPEndPoint* address) const {
DCHECK(address);
if (!socket_)
return ERR_SOCKET_NOT_CONNECTED;
SockaddrStorage storage;
int rv = socket_->GetLocalAddress(&storage);
if (rv != OK)
return rv;
if (!address->FromSockAddr(storage.addr, storage.addr_len))
return ERR_ADDRESS_INVALID;
return OK;
}
int TCPSocketPosix::GetPeerAddress(IPEndPoint* address) const {
DCHECK(address);
if (!IsConnected())
return ERR_SOCKET_NOT_CONNECTED;
SockaddrStorage storage;
int rv = socket_->GetPeerAddress(&storage);
if (rv != OK)
return rv;
if (!address->FromSockAddr(storage.addr, storage.addr_len))
return ERR_ADDRESS_INVALID;
return OK;
}
int TCPSocketPosix::SetDefaultOptionsForServer() {
DCHECK(socket_);
return SetAddressReuse(true);
}
void TCPSocketPosix::SetDefaultOptionsForClient() {
DCHECK(socket_);
// This mirrors the behaviour on Windows. See the comment in
// tcp_socket_win.cc after searching for "NODELAY".
// If SetTCPNoDelay fails, we don't care.
SetTCPNoDelay(socket_->socket_fd(), true);
// TCP keep alive wakes up the radio, which is expensive on mobile. Do not
// enable it there. It's useful to prevent TCP middleboxes from timing out
// connection mappings. Packets for timed out connection mappings at
// middleboxes will either lead to:
// a) Middleboxes sending TCP RSTs. It's up to higher layers to check for this
// and retry. The HTTP network transaction code does this.
// b) Middleboxes just drop the unrecognized TCP packet. This leads to the TCP
// stack retransmitting packets per TCP stack retransmission timeouts, which
// are very high (on the order of seconds). Given the number of
// retransmissions required before killing the connection, this can lead to
// tens of seconds or even minutes of delay, depending on OS.
#if !defined(OS_ANDROID) && !defined(OS_IOS)
const int kTCPKeepAliveSeconds = 45;
SetTCPKeepAlive(socket_->socket_fd(), true, kTCPKeepAliveSeconds);
#endif
}
int TCPSocketPosix::SetAddressReuse(bool allow) {
DCHECK(socket_);
// SO_REUSEADDR is useful for server sockets to bind to a recently unbound
// port. When a socket is closed, the end point changes its state to TIME_WAIT
// and wait for 2 MSL (maximum segment lifetime) to ensure the remote peer
// acknowledges its closure. For server sockets, it is usually safe to
// bind to a TIME_WAIT end point immediately, which is a widely adopted
// behavior.
//
// Note that on *nix, SO_REUSEADDR does not enable the TCP socket to bind to
// an end point that is already bound by another socket. To do that one must
// set SO_REUSEPORT instead. This option is not provided on Linux prior
// to 3.9.
//
// SO_REUSEPORT is provided in MacOS X and iOS.
int boolean_value = allow ? 1 : 0;
int rv = setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_REUSEADDR,
&boolean_value, sizeof(boolean_value));
if (rv < 0)
return MapSystemError(errno);
return OK;
}
int TCPSocketPosix::SetReceiveBufferSize(int32_t size) {
DCHECK(socket_);
int rv = setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_RCVBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
return (rv == 0) ? OK : MapSystemError(errno);
}
int TCPSocketPosix::SetSendBufferSize(int32_t size) {
DCHECK(socket_);
int rv = setsockopt(socket_->socket_fd(), SOL_SOCKET, SO_SNDBUF,
reinterpret_cast<const char*>(&size), sizeof(size));
return (rv == 0) ? OK : MapSystemError(errno);
}
bool TCPSocketPosix::SetKeepAlive(bool enable, int delay) {
DCHECK(socket_);
return SetTCPKeepAlive(socket_->socket_fd(), enable, delay);
}
bool TCPSocketPosix::SetNoDelay(bool no_delay) {
DCHECK(socket_);
return SetTCPNoDelay(socket_->socket_fd(), no_delay);
}
void TCPSocketPosix::Close() {
socket_.reset();
// Record and reset TCP FastOpen state.
if (tcp_fastopen_write_attempted_ ||
tcp_fastopen_status_ == TCP_FASTOPEN_PREVIOUSLY_FAILED) {
UMA_HISTOGRAM_ENUMERATION("Net.TcpFastOpenSocketConnection",
tcp_fastopen_status_, TCP_FASTOPEN_MAX_VALUE);
}
use_tcp_fastopen_ = false;
tcp_fastopen_connected_ = false;
tcp_fastopen_write_attempted_ = false;
tcp_fastopen_status_ = TCP_FASTOPEN_STATUS_UNKNOWN;
}
void TCPSocketPosix::EnableTCPFastOpenIfSupported() {
if (!IsTCPFastOpenSupported())
return;
// Do not enable TCP FastOpen if it had previously failed.
// This check conservatively avoids middleboxes that may blackhole
// TCP FastOpen SYN+Data packets; on such a failure, subsequent sockets
// should not use TCP FastOpen.
if (!g_tcp_fastopen_has_failed)
use_tcp_fastopen_ = true;
else
tcp_fastopen_status_ = TCP_FASTOPEN_PREVIOUSLY_FAILED;
}
bool TCPSocketPosix::IsValid() const {
return socket_ != NULL && socket_->socket_fd() != kInvalidSocket;
}
void TCPSocketPosix::DetachFromThread() {
socket_->DetachFromThread();
}
void TCPSocketPosix::StartLoggingMultipleConnectAttempts(
const AddressList& addresses) {
if (!logging_multiple_connect_attempts_) {
logging_multiple_connect_attempts_ = true;
LogConnectBegin(addresses);
} else {
NOTREACHED();
}
}
void TCPSocketPosix::EndLoggingMultipleConnectAttempts(int net_error) {
if (logging_multiple_connect_attempts_) {
LogConnectEnd(net_error);
logging_multiple_connect_attempts_ = false;
} else {
NOTREACHED();
}
}
void TCPSocketPosix::SetTickClockForTesting(
std::unique_ptr<base::TickClock> tick_clock) {
tick_clock_ = std::move(tick_clock);
}
void TCPSocketPosix::AcceptCompleted(
std::unique_ptr<TCPSocketPosix>* tcp_socket,
IPEndPoint* address,
const CompletionCallback& callback,
int rv) {
DCHECK_NE(ERR_IO_PENDING, rv);
callback.Run(HandleAcceptCompleted(tcp_socket, address, rv));
}
int TCPSocketPosix::HandleAcceptCompleted(
std::unique_ptr<TCPSocketPosix>* tcp_socket,
IPEndPoint* address,
int rv) {
if (rv == OK)
rv = BuildTcpSocketPosix(tcp_socket, address);
if (rv == OK) {
net_log_.EndEvent(NetLog::TYPE_TCP_ACCEPT,
CreateNetLogIPEndPointCallback(address));
} else {
net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_ACCEPT, rv);
}
return rv;
}
int TCPSocketPosix::BuildTcpSocketPosix(
std::unique_ptr<TCPSocketPosix>* tcp_socket,
IPEndPoint* address) {
DCHECK(accept_socket_);
SockaddrStorage storage;
if (accept_socket_->GetPeerAddress(&storage) != OK ||
!address->FromSockAddr(storage.addr, storage.addr_len)) {
accept_socket_.reset();
return ERR_ADDRESS_INVALID;
}
tcp_socket->reset(
new TCPSocketPosix(nullptr, net_log_.net_log(), net_log_.source()));
(*tcp_socket)->socket_.reset(accept_socket_.release());
return OK;
}
void TCPSocketPosix::ConnectCompleted(const CompletionCallback& callback,
int rv) {
DCHECK_NE(ERR_IO_PENDING, rv);
callback.Run(HandleConnectCompleted(rv));
}
int TCPSocketPosix::HandleConnectCompleted(int rv) {
// Log the end of this attempt (and any OS error it threw).
if (rv != OK) {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
NetLog::IntCallback("os_error", errno));
} else {
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT);
NotifySocketPerformanceWatcher();
}
// Give a more specific error when the user is offline.
if (rv == ERR_ADDRESS_UNREACHABLE && NetworkChangeNotifier::IsOffline())
rv = ERR_INTERNET_DISCONNECTED;
if (!logging_multiple_connect_attempts_)
LogConnectEnd(rv);
return rv;
}
void TCPSocketPosix::LogConnectBegin(const AddressList& addresses) const {
net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT,
addresses.CreateNetLogCallback());
}
void TCPSocketPosix::LogConnectEnd(int net_error) const {
if (net_error != OK) {
net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_CONNECT, net_error);
return;
}
UpdateConnectionTypeHistograms(CONNECTION_ANY);
SockaddrStorage storage;
int rv = socket_->GetLocalAddress(&storage);
if (rv != OK) {
PLOG(ERROR) << "GetLocalAddress() [rv: " << rv << "] error: ";
NOTREACHED();
net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_CONNECT, rv);
return;
}
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT,
CreateNetLogSourceAddressCallback(storage.addr,
storage.addr_len));
}
void TCPSocketPosix::ReadCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
int rv) {
DCHECK_NE(ERR_IO_PENDING, rv);
callback.Run(HandleReadCompleted(buf.get(), rv));
}
int TCPSocketPosix::HandleReadCompleted(IOBuffer* buf, int rv) {
if (tcp_fastopen_write_attempted_ && !tcp_fastopen_connected_) {
// A TCP FastOpen connect-with-write was attempted. This read was a
// subsequent read, which either succeeded or failed. If the read
// succeeded, the socket is considered connected via TCP FastOpen.
// If the read failed, TCP FastOpen is (conservatively) turned off for all
// subsequent connections. TCP FastOpen status is recorded in both cases.
// TODO (jri): This currently results in conservative behavior, where TCP
// FastOpen is turned off on _any_ error. Implement optimizations,
// such as turning off TCP FastOpen on more specific errors, and
// re-attempting TCP FastOpen after a certain amount of time has passed.
if (rv >= 0)
tcp_fastopen_connected_ = true;
else
g_tcp_fastopen_has_failed = true;
UpdateTCPFastOpenStatusAfterRead();
}
if (rv < 0) {
net_log_.AddEvent(NetLog::TYPE_SOCKET_READ_ERROR,
CreateNetLogSocketErrorCallback(rv, errno));
return rv;
}
// Notify the watcher only if at least 1 byte was read.
if (rv > 0)
NotifySocketPerformanceWatcher();
net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, rv,
buf->data());
NetworkActivityMonitor::GetInstance()->IncrementBytesReceived(rv);
return rv;
}
void TCPSocketPosix::WriteCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
int rv) {
DCHECK_NE(ERR_IO_PENDING, rv);
callback.Run(HandleWriteCompleted(buf.get(), rv));
}
int TCPSocketPosix::HandleWriteCompleted(IOBuffer* buf, int rv) {
if (rv < 0) {
if (tcp_fastopen_write_attempted_ && !tcp_fastopen_connected_) {
// TCP FastOpen connect-with-write was attempted, and the write failed
// for unknown reasons. Record status and (conservatively) turn off
// TCP FastOpen for all subsequent connections.
// TODO (jri): This currently results in conservative behavior, where TCP
// FastOpen is turned off on _any_ error. Implement optimizations,
// such as turning off TCP FastOpen on more specific errors, and
// re-attempting TCP FastOpen after a certain amount of time has passed.
tcp_fastopen_status_ = TCP_FASTOPEN_ERROR;
g_tcp_fastopen_has_failed = true;
}
net_log_.AddEvent(NetLog::TYPE_SOCKET_WRITE_ERROR,
CreateNetLogSocketErrorCallback(rv, errno));
return rv;
}
// Notify the watcher only if at least 1 byte was written.
if (rv > 0)
NotifySocketPerformanceWatcher();
net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, rv,
buf->data());
NetworkActivityMonitor::GetInstance()->IncrementBytesSent(rv);
return rv;
}
int TCPSocketPosix::TcpFastOpenWrite(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
SockaddrStorage storage;
int rv = socket_->GetPeerAddress(&storage);
if (rv != OK)
return rv;
int flags = 0x20000000; // Magic flag to enable TCP_FASTOPEN.
#if defined(OS_LINUX) || defined(OS_ANDROID)
// sendto() will fail with EPIPE when the system doesn't implement TCP
// FastOpen, and with EOPNOTSUPP when the system implements TCP FastOpen
// but it is disabled. Theoretically these shouldn't happen
// since the caller should check for system support on startup, but
// users may dynamically disable TCP FastOpen via sysctl.
flags |= MSG_NOSIGNAL;
#endif // defined(OS_LINUX) || defined(OS_ANDROID)
rv = HANDLE_EINTR(sendto(socket_->socket_fd(),
buf->data(),
buf_len,
flags,
storage.addr,
storage.addr_len));
tcp_fastopen_write_attempted_ = true;
if (rv >= 0) {
tcp_fastopen_status_ = TCP_FASTOPEN_FAST_CONNECT_RETURN;
return rv;
}
DCHECK_NE(EPIPE, errno);
// If errno == EINPROGRESS, that means the kernel didn't have a cookie
// and would block. The kernel is internally doing a connect() though.
// Remap EINPROGRESS to EAGAIN so we treat this the same as our other
// asynchronous cases. Note that the user buffer has not been copied to
// kernel space.
if (errno == EINPROGRESS) {
rv = ERR_IO_PENDING;
} else {
rv = MapSystemError(errno);
}
if (rv != ERR_IO_PENDING) {
// TCP FastOpen connect-with-write was attempted, and the write failed
// since TCP FastOpen was not implemented or disabled in the OS.
// Record status and turn off TCP FastOpen for all subsequent connections.
// TODO (jri): This is almost certainly too conservative, since it blanket
// turns off TCP FastOpen on any write error. Two things need to be done
// here: (i) record a histogram of write errors; in particular, record
// occurrences of EOPNOTSUPP and EPIPE, and (ii) afterwards, consider
// turning off TCP FastOpen on more specific errors.
tcp_fastopen_status_ = TCP_FASTOPEN_ERROR;
g_tcp_fastopen_has_failed = true;
return rv;
}
tcp_fastopen_status_ = TCP_FASTOPEN_SLOW_CONNECT_RETURN;
return socket_->WaitForWrite(buf, buf_len, callback);
}
void TCPSocketPosix::NotifySocketPerformanceWatcher() {
#if defined(TCP_INFO)
// TODO(tbansal): Remove ScopedTracker once crbug.com/590254 is fixed.
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"590254 TCPSocketPosix::NotifySocketPerformanceWatcher"));
const base::TimeTicks now_ticks = tick_clock_->NowTicks();
// Do not notify |socket_performance_watcher_| if the last notification was
// recent than |rtt_notifications_minimum_interval_| ago. This helps in
// reducing the overall overhead of the tcp_info syscalls.
if (now_ticks - last_rtt_notification_ < rtt_notifications_minimum_interval_)
return;
// Check if |socket_performance_watcher_| is interested in receiving a RTT
// update notification.
if (!socket_performance_watcher_ ||
!socket_performance_watcher_->ShouldNotifyUpdatedRTT()) {
return;
}
tcp_info info;
if (!GetTcpInfo(socket_->socket_fd(), &info))
return;
// Only notify the |socket_performance_watcher_| if the RTT in |tcp_info|
// struct was populated. A value of 0 may be valid in certain cases
// (on very fast networks), but it is discarded. This means that
// some of the RTT values may be missed, but the values that are kept are
// guaranteed to be correct.
if (info.tcpi_rtt == 0 && info.tcpi_rttvar == 0)
return;
socket_performance_watcher_->OnUpdatedRTTAvailable(
base::TimeDelta::FromMicroseconds(info.tcpi_rtt));
last_rtt_notification_ = now_ticks;
#endif // defined(TCP_INFO)
}
void TCPSocketPosix::UpdateTCPFastOpenStatusAfterRead() {
DCHECK(tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN ||
tcp_fastopen_status_ == TCP_FASTOPEN_SLOW_CONNECT_RETURN);
if (tcp_fastopen_write_attempted_ && !tcp_fastopen_connected_) {
// TCP FastOpen connect-with-write was attempted, and failed.
tcp_fastopen_status_ =
(tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN ?
TCP_FASTOPEN_FAST_CONNECT_READ_FAILED :
TCP_FASTOPEN_SLOW_CONNECT_READ_FAILED);
return;
}
bool getsockopt_success = false;
bool server_acked_data = false;
#if defined(TCP_INFO)
// Probe to see the if the socket used TCP FastOpen.
tcp_info info;
getsockopt_success = GetTcpInfo(socket_->socket_fd(), &info);
server_acked_data =
getsockopt_success && (info.tcpi_options & TCPI_OPT_SYN_DATA);
#endif // defined(TCP_INFO)
if (getsockopt_success) {
if (tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN) {
tcp_fastopen_status_ = (server_acked_data ?
TCP_FASTOPEN_SYN_DATA_ACK :
TCP_FASTOPEN_SYN_DATA_NACK);
} else {
tcp_fastopen_status_ = (server_acked_data ?
TCP_FASTOPEN_NO_SYN_DATA_ACK :
TCP_FASTOPEN_NO_SYN_DATA_NACK);
}
} else {
tcp_fastopen_status_ =
(tcp_fastopen_status_ == TCP_FASTOPEN_FAST_CONNECT_RETURN ?
TCP_FASTOPEN_SYN_DATA_GETSOCKOPT_FAILED :
TCP_FASTOPEN_NO_SYN_DATA_GETSOCKOPT_FAILED);
}
}
bool TCPSocketPosix::GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const {
DCHECK(out_rtt);
if (!socket_)
return false;
#if defined(TCP_INFO)
tcp_info info;
if (GetTcpInfo(socket_->socket_fd(), &info)) {
// tcpi_rtt is zero when the kernel doesn't have an RTT estimate,
// and possibly in other cases such as connections to localhost.
if (info.tcpi_rtt > 0) {
*out_rtt = base::TimeDelta::FromMicroseconds(info.tcpi_rtt);
return true;
}
}
#endif // defined(TCP_INFO)
return false;
}
} // namespace net
| 33.864242 | 80 | 0.697724 |
10255145601a2b44a40a2adeeea522971a0f5e8d | 2,634 | cpp | C++ | src/Solution.cpp | rugleb/finite-element-method | 3bd97c9ede76a7cd27e633a2d1b74d1c3c44615e | [
"MIT"
] | 1 | 2019-12-10T00:11:06.000Z | 2019-12-10T00:11:06.000Z | src/Solution.cpp | rugleb/finite-element-method | 3bd97c9ede76a7cd27e633a2d1b74d1c3c44615e | [
"MIT"
] | 2 | 2018-12-14T18:23:01.000Z | 2019-05-02T17:20:45.000Z | src/Solution.cpp | rugleb/finite-element-method | 3bd97c9ede76a7cd27e633a2d1b74d1c3c44615e | [
"MIT"
] | null | null | null | #include "Solution.h"
#include <cmath>
#include <fstream>
Solution::Solution(const std::string& n, Element* e, std::size_t elements)
{
name = n;
element = e;
elementsCount = elements;
auto size = elementsCount * (e->getDimension() - 1) + 1;
solution = Vector(size, 0.);
load_vector = Vector(size, 0.);
stiffness_matrix = Matrix(size, Vector(size, 0.));
}
double Solution::getAnalyticalSolution(double x)
{
return -1.11 * pow(10., -9.) * exp(5. * x / 4.) + x - 6.;
}
void Solution::calculate()
{
assembling();
setConditions();
solve();
}
void Solution::assembling()
{
Vector local_load_vector = element->getLoadVector();
Matrix local_stiffness_matrix = element->getStiffnessMatrix();
std::size_t local_dimension = element->getDimension();
for (std::size_t i = 0, j = 0; i < elementsCount; i++, j += local_dimension - 1) {
for (std::size_t ii = 0; ii < local_dimension; ii++) {
for (std::size_t jj = 0; jj < local_dimension; jj++) {
// fill global stiffness matrix
stiffness_matrix[j + ii][j + jj] += local_stiffness_matrix[ii][jj];
}
// fill global load vector
load_vector[j + ii] += local_load_vector[ii];
}
}
}
void Solution::setConditions()
{
// set border condition on the right end: u(19) = -10
for (std::size_t i = 0; i < load_vector.size(); i++) {
load_vector[i] -= -10 * stiffness_matrix[i].back();
stiffness_matrix[i].back() = 0.;
}
stiffness_matrix.back().back() = 4.;
// Set border condition on the left end: u(1) = -5
for (std::size_t i = 0; i < load_vector.size(); i++) {
load_vector[i] -= -5 * stiffness_matrix[i][0];
stiffness_matrix[i][0] = 0.;
}
stiffness_matrix[0][0] = -4.;
}
void Solution::solve()
{
Vector system = gauss(stiffness_matrix, load_vector);
for (std::size_t i = 0, j = 0; i < system.size(); i += element->getDimension() - 1, j++) {
solution[j] = system[i];
}
}
void Solution::report(double x)
{
double max_error = 0.;
std::ofstream file(name + ".txt");
for (std::size_t i = 0; i < elementsCount; i++) {
auto analytic = getAnalyticalSolution(x);
auto error = fabs((solution[i] - analytic) / analytic);
max_error = fmax(error, max_error);
file << x << "\t" << analytic << "\t" << solution[i] << std::endl;
x += element->getLength();
}
file.close();
std::cout << name << " solution:" << std::endl;
std::cout << "---- Max error: " << max_error << "%" << std::endl;
}
| 25.326923 | 94 | 0.569856 |
1025a518d141c22180ff9b29c7090ba5ae769117 | 10,479 | cpp | C++ | arduino/libraries/HMC5883L/HMC5883LCalibratable.cpp | nowireless/ros_nav6 | 49c0f485afeb656df20008144fc618d29b4937bb | [
"MIT"
] | null | null | null | arduino/libraries/HMC5883L/HMC5883LCalibratable.cpp | nowireless/ros_nav6 | 49c0f485afeb656df20008144fc618d29b4937bb | [
"MIT"
] | null | null | null | arduino/libraries/HMC5883L/HMC5883LCalibratable.cpp | nowireless/ros_nav6 | 49c0f485afeb656df20008144fc618d29b4937bb | [
"MIT"
] | null | null | null | /* =============================================================================
Nav6 source code is placed under the MIT license
Copyright (c) 2013 Kauai Labs
Portions of this work are based upon the FreeIMU Library by Fabio Varesano.
(www.freeimu.com) which is open-source licensed under the GPL v3
License. This work is also based upon the Arduino software
library which is licensed under a Creative Commons license.
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 "HMC5883LCalibratable.h"
#define DEBUG_PRINT(s) Serial.println(s)
const int counts_per_milligauss[8]={
1370,
1090,
820,
660,
440,
390,
330,
230
};
/** Default constructor
*/
HMC5883LCalibratable::HMC5883LCalibratable() : HMC5883L() {
x_scale=1.0F;
y_scale=1.0F;
z_scale=1.0F;
}
// gain is a value from 0-7, corresponding to counts_per_milligaus
void HMC5883LCalibratable::calibrate(unsigned char gain) {
x_scale=1; // get actual values
y_scale=1;
z_scale=1;
I2Cdev::writeByte(devAddr,HMC5883L_RA_CONFIG_A, 0x010 + HMC5883L_BIAS_POSITIVE); // Reg A DOR=0x010 + MS1,MS0 set to pos bias
setGain(gain);
float x, y, z, mx=0, my=0, mz=0, t=10;
for (int i=0; i<(int)t; i++) {
setMode(1);
getValues(&x,&y,&z);
if (x>mx) mx=x;
if (y>my) my=y;
if (z>mz) mz=z;
}
float max=0;
if (mx>max) max=mx;
if (my>max) max=my;
if (mz>max) max=mz;
x_max=mx;
y_max=my;
z_max=mz;
x_scale=max/mx; // calc scales
y_scale=max/my;
z_scale=max/mz;
I2Cdev::writeByte(devAddr,HMC5883L_RA_CONFIG_A, 0x010); // set RegA/DOR back to default
} // calibrate().
/*!
\brief Calibrate using the self test operation.
Average the values using bias mode to obtain the scale factors.
\param gain [in] Gain setting for the sensor. See data sheet.
\param n_samples [in] Number of samples to average together while applying the positive and negative bias.
\return Returns false if any of the following occurs:
# Invalid input parameters. (gain>7 or n_samples=0).
# Id registers are wrong for the compiled device. Unfortunately, we can't distinguish between HMC5843 and HMC5883L.
# Calibration saturates during the positive or negative bias on any of the readings.
# Readings are outside of the expected range for bias current.
*/
bool HMC5883LCalibratable::calibrate(unsigned char gain,unsigned int n_samples)
{
int xyz[3]; // 16 bit integer values for each axis.
long int xyz_total[3]={0,0,0}; // 32 bit totals so they won't overflow.
bool bret=true; // Function return value. Will return false if the wrong identifier is returned, saturation is detected or response is out of range to self test bias.
char id[3]; // Three identification registers should return 'H43'.
long int low_limit, high_limit;
/*
Make sure we are talking to the correct device.
Hard to believe Honeywell didn't change the identifier.
*/
if ((8>gain) && (0<n_samples)) // Notice this allows gain setting of 7 which the data sheet warns against.
{
id[0] = getIDA();
id[1] = getIDB();
id[2] = getIDC();
if (('H' == id[0]) && ('4' == id[1]) && ('3' == id[2]))
{ /*
Use the positive bias current to impose a known field on each axis.
This field depends on the device and the axis.
*/
I2Cdev::writeByte(devAddr,HMC5883L_RA_CONFIG_A, 0x010 + HMC5883L_BIAS_POSITIVE); // Reg A DOR=0x010 + MS1,MS0 set to pos bias
/*
Note that the very first measurement after a gain change maintains the same gain as the previous setting.
The new gain setting is effective from the second measurement and on.
*/
setGain(gain);
setMode(HMC5883L_MODE_SINGLE); // Change to single measurement mode.
getHeading(&xyz[0],&xyz[1],&xyz[2]); // Get the raw values and ignore since this reading may use previous gain.
for (unsigned int i=0; i<n_samples; i++)
{
setMode(1);
getHeading(&xyz[0],&xyz[1],&xyz[2]); // Get the raw values in case the scales have already been changed.
/*
Since the measurements are noisy, they should be averaged rather than taking the max.
*/
xyz_total[0]+=xyz[0];
xyz_total[1]+=xyz[1];
xyz_total[2]+=xyz[2];
/*
Detect saturation.
*/
if (-(1<<12) >= min(xyz[0],min(xyz[1],xyz[2])))
{
DEBUG_PRINT("HMC58x3 Self test saturated. Increase range.");
bret=false;
break; // Breaks out of the for loop. No sense in continuing if we saturated.
}
}
/*
Apply the negative bias. (Same gain)
*/
I2Cdev::writeByte(devAddr,HMC5883L_RA_CONFIG_A, 0x010 + HMC5883L_BIAS_NEGATIVE); // Reg A DOR=0x010 + MS1,MS0 set to negative bias.
for (unsigned int i=0; i<n_samples; i++)
{
setMode(1);
getHeading(&xyz[0],&xyz[1],&xyz[2]); // Get the raw values in case the scales have already been changed.
/*
Since the measurements are noisy, they should be averaged.
*/
xyz_total[0]-=xyz[0];
xyz_total[1]-=xyz[1];
xyz_total[2]-=xyz[2];
/*
Detect saturation.
*/
if (-(1<<12) >= min(xyz[0],min(xyz[1],xyz[2])))
{
DEBUG_PRINT("HMC58x3 Self test saturated. Increase range.");
bret=false;
break; // Breaks out of the for loop. No sense in continuing if we saturated.
}
}
/*
Compare the values against the expected self test bias gauss.
Notice, the same limits are applied to all axis.
*/
low_limit =SELF_TEST_LOW_LIMIT *counts_per_milligauss[gain]*2*n_samples;
high_limit=SELF_TEST_HIGH_LIMIT*counts_per_milligauss[gain]*2*n_samples;
if ((true==bret) &&
(low_limit <= xyz_total[0]) && (high_limit >= xyz_total[0]) &&
(low_limit <= xyz_total[1]) && (high_limit >= xyz_total[1]) &&
(low_limit <= xyz_total[2]) && (high_limit >= xyz_total[2]) )
{ /*
Successful calibration.
Normalize the scale factors so all axis return the same range of values for the bias field.
Factor of 2 is from summation of total of n_samples from both positive and negative bias.
*/
x_scale=(counts_per_milligauss[gain]*(HMC58X3_X_SELF_TEST_GAUSS*2))/(xyz_total[0]/n_samples);
y_scale=(counts_per_milligauss[gain]*(HMC58X3_Y_SELF_TEST_GAUSS*2))/(xyz_total[1]/n_samples);
z_scale=(counts_per_milligauss[gain]*(HMC58X3_Z_SELF_TEST_GAUSS*2))/(xyz_total[2]/n_samples);
}else
{
DEBUG_PRINT("HMC58x3 Self test out of range.");
bret=false;
}
I2Cdev::writeByte(devAddr,HMC5883L_RA_CONFIG_A, 0x010); // set RegA/DOR back to default.
}else
{
DEBUG_PRINT("HMC5883L failed id check.");
bret=false;
}
}else
{ /*
Bad input parameters.
*/
DEBUG_PRINT("HMC5883 Bad parameters.");
bret=false;
}
return(bret);
} // calibrate().
void HMC5883LCalibratable::getValues(int *x,int *y,int *z) {
float fx,fy,fz;
getValues(&fx,&fy,&fz);
*x= (int) (fx + 0.5);
*y= (int) (fy + 0.5);
*z= (int) (fz + 0.5);
}
void HMC5883LCalibratable::getValues(float *x,float *y,float *z) {
int xr,yr,zr;
getHeading(&xr,&yr,&zr);
*x= ((float) xr) / x_scale;
*y = ((float) yr) / y_scale;
*z = ((float) zr) / z_scale;
}
float HMC5883LCalibratable::compassHeadingRadians() {
float xr, yr, zr;
getValues(&xr,&yr,&zr);
float heading_radians = atan2(yr, xr);
// Correct for when signs are reversed.
if(heading_radians < 0)
heading_radians += 2*PI;
return heading_radians;
}
float HMC5883LCalibratable::compassHeadingTiltCompensatedRadians(float pitch_radians, float roll_radians) {
float tilt_compensated_heading;
float MAG_X;
float MAG_Y;
float cos_roll;
float sin_roll;
float cos_pitch;
float sin_pitch;
cos_roll = cos(roll_radians);
sin_roll = sin(roll_radians);
cos_pitch = cos(pitch_radians);
sin_pitch = sin(pitch_radians);
float xr, yr, zr;
getValues(&xr,&yr,&zr);
/*
// Tilt compensated Magnetic field X:
MAG_X = xr*cos_pitch+yr*sin_roll*sin_pitch+zr*cos_roll*sin_pitch;
// Tilt compensated Magnetic field Y:
MAG_Y = yr*cos_roll-zr*sin_roll;
// Magnetic Heading
tilt_compensated_heading = atan2(MAG_Y,MAG_X); // TODO: Review - why negative Y?
*/
MAG_X = xr * cos_pitch + zr * sin_pitch;
MAG_Y = xr * sin_roll * sin_pitch + yr * cos_roll - zr * sin_roll * cos_pitch;
tilt_compensated_heading = atan2(MAG_Y,MAG_X);
return tilt_compensated_heading;
}
| 38.525735 | 187 | 0.604065 |
10279da7ea0269d9f41217d0738c5959abb44075 | 13,724 | cpp | C++ | tcp.cpp | foragony/calculation_acceleration | 147619d640cc29d4de93caec295e0984cf7f4281 | [
"ECL-2.0"
] | null | null | null | tcp.cpp | foragony/calculation_acceleration | 147619d640cc29d4de93caec295e0984cf7f4281 | [
"ECL-2.0"
] | null | null | null | tcp.cpp | foragony/calculation_acceleration | 147619d640cc29d4de93caec295e0984cf7f4281 | [
"ECL-2.0"
] | null | null | null | // client.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include<iostream>
#include<winsock.h>
#include<windows.h>
#include <mmintrin.h> //MMX
#include <xmmintrin.h> //SSE(include mmintrin.h)
#include <emmintrin.h> //SSE2(include xmmintrin.h)
#include <pmmintrin.h> //SSE3(include emmintrin.h)
#include <tmmintrin.h>//SSSE3(include pmmintrin.h)
#include <smmintrin.h>//SSE4.1(include tmmintrin.h)
#include <nmmintrin.h>//SSE4.2(include smmintrin.h)
#include <wmmintrin.h>//AES(include nmmintrin.h)
#include <immintrin.h>//AVX(include wmmintrin.h)
#include <intrin.h>//(include immintrin.h)
#define MAX_THREADS 64
#define SUBDATANUM 200000
#define DATANUM (SUBDATANUM * MAX_THREADS) /*这个数值是总数据量*/
#define TREAD 8 //实际线程数(排序)
#define DATANUM1 ((DATANUM/TREAD)/2) //每线程数据数
/***********全局变量定义***********/
double rawdoubleData[DATANUM];//生成初始随机数
double rawdoubleData1[DATANUM];//计算出全部数的log(sqrt())结果,等待单机排序算法调用
double rawFloatData[DATANUM/2]; //排序输入数据
double rawFloatData_result[DATANUM/2]; //输出结果
int ThreadID[TREAD]; //线程
double floatResults1[TREAD][DATANUM1];//每个线程的中间结果
double tdata[TREAD][DATANUM1];//每个线程的中间结果,数据临时存储,便于调用函数
double finalsort_result[DATANUM];//最终排序结果
double finalsort_result1[DATANUM];//最终排序结果
double sendsort[DATANUM/2];//服务端排序结果
int counte = 0;//计算传输错误数
/****************IP地址在此输入****************/
char IP[] = "127.0.0.1";
using namespace std;
#pragma comment(lib,"ws2_32.lib")
using namespace std;
/*********函数声明********/
void initialization();//套接字库初始化
/**SUM**/
double sum(const double data[], const int len);//不加速计算
double sumSpeedUp(const double data[], const int len); //sum使用avx和openmp
double sumSpeedUp1(const double data[], const int len);//sum单独使用openmp,实际使用算法
/**MAX**/
double mymax(const double data[], const int len);//不加速计算,data是原始数据,len为长度。结果通过函数返回
double maxSpeedUp1(const double data[], const int len);//单独使用openmp
double maxSpeedUp(const double data[], const int len);//单独使用sse,为实际使用算法,也可将注释部分消去注释以实现openmp+sse但速度会变慢
/**SORT**/
void init_sortdata(const double data[], const int len, double result[]);//排序数据使用SSE预处理
double sort(const double data[], const int len, double result[]);//慢排;data是原始数据,len为长度。排序结果在result中。
double sortSpeedUp(const double data[], const int len, double result[]);//快速排序;data是原始数据,len为长度。排序结果在result中。
void tQsort(double arr[], int low, int high); //快速排序算法
int tmin(const double data[], const int len); //返回最小值位置
void tMerge(double arr[][DATANUM1], double result[]); //归并有序数列
void MemeryArray(double a[], int n, double b[], int m, double c[]); //归并两个有序数列
/***********************/
/*******线程函数********/
DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
//while (1)
{
int who = *(int*)lpParameter;
int startIndex = who * DATANUM1;
int endIndex = startIndex + DATANUM1;
//调用函数复制数据
memcpy(tdata[who], rawFloatData + startIndex, DATANUM1 * sizeof(double));
sort(tdata[who], DATANUM1, floatResults1[who]);
}
return 0;
}
/*************************/
int main() {
/**************重现时修改数据****************/
//初始化数据
for (size_t i = 0; i < DATANUM; i++)//数据初始化
{
rawdoubleData[i] = double((rand() + rand() + rand() + rand()));//rand返回short数据类型,增加随机性
rawdoubleData1[i] = log(sqrt(rawdoubleData[i]/4));
}
init_sortdata(rawdoubleData, DATANUM, rawFloatData);
/*******************************************/
double time1, time2, time3, time4, time5, time6;//记录消耗时间
LARGE_INTEGER start, end;
LARGE_INTEGER start1, end1;
double sumresult2, maxresult2;
double sumresult, maxresult;
double r_c=0.0f, r_s=0.0f;
int send_len = 0;
int recv_len = 0;
//定义发送缓冲区和接受缓冲区
char send_buf[100];
char recv_buf[100];
//定义服务端套接字,接受请求套接字
SOCKET s_server;
//服务端地址客户端地址
SOCKADDR_IN server_addr;
initialization();
//填充服务端信息
server_addr.sin_family = AF_INET;
server_addr.sin_addr.S_un.S_addr = inet_addr(IP);
server_addr.sin_port = htons(5010);
//创建套接字
s_server = socket(AF_INET, SOCK_STREAM, 0);
if (connect(s_server, (SOCKADDR*)&server_addr, sizeof(SOCKADDR)) == SOCKET_ERROR) {
cout << "服务器连接失败!" << endl;
WSACleanup();
}
else {
cout << "服务器连接成功!" << endl;
/**********************SUM**********************/
cout << "输入1以开始sum:";
cin >> send_buf;
QueryPerformanceCounter(&start);//start
send_len = send(s_server, send_buf, 100, 0);
if (send_len < 0) {
cout << "发送失败!" << endl;
}
else
{
cout << "正在计算..." << endl;
r_c = sumSpeedUp1(rawdoubleData, DATANUM);
cout << "cilent端结果为" << r_c << endl;
}
//接收服务端结果
char sever_result[sizeof(double) + 1];
recv(s_server, sever_result, 9, 0);
r_s = atof(sever_result);
if (recv_len < 0) {
cout << "接受失败!" << endl;
}
else {
cout << "服务端结果:" << r_s << endl;
}
QueryPerformanceCounter(&end);//end
time1 = (end.QuadPart - start.QuadPart);
sumresult2 = r_s + r_c;
/*******************MAX********************/
cout << "输入2以开始max:";
cin >> send_buf;
QueryPerformanceCounter(&start);//start
send_len = send(s_server, send_buf, 100, 0);
if (send_len < 0) {
cout << "发送失败!" << endl;
}
else
{
cout << "正在计算..." << endl;
r_c = maxSpeedUp(rawdoubleData, DATANUM);
cout << "cilent端结果为" << r_c << endl;
}
//接收服务端结果
recv(s_server, sever_result, 9, 0);
r_s = atof(sever_result);
if (recv_len < 0) {
cout << "接受失败!" << endl;
}
else {
cout << "服务端结果:" << r_s << endl;
}
maxresult2 = r_c > r_s ? r_c : r_s;
QueryPerformanceCounter(&end);//end
time3 = (end.QuadPart - start.QuadPart);
/***********************SORT*************************/
cout << "输入3以开始sort:";
cin >> send_buf;
QueryPerformanceCounter(&start);//start
send_len = send(s_server, send_buf, 100, 0);
if (send_len < 0) {
cout << "发送失败!" << endl;
}
else
{
cout << "正在计算..." << endl;
sortSpeedUp(rawFloatData, DATANUM/2, rawFloatData_result);
}
QueryPerformanceCounter(&start1);//start
//接收服务端结果
char* prenv;
prenv = (char*)&sendsort[0];
recv(s_server, prenv, sizeof(double)*DATANUM/2, 0);
if (recv_len < 0) {
cout << "接受失败!" << endl;
}
//监测是否有传输错误的数据
//for (size_t i = 0; i < DATANUM/2; i++)
//{
// if (sendsort[i] > 6 || sendsort[i] < 1)
// {
// //cout << "ERROR! 传输数据监测错误" << endl;
// sendsort[i] = 4.5;
// counte += 1;
// }
//}
QueryPerformanceCounter(&end1);//end
MemeryArray(rawFloatData_result, DATANUM, sendsort, DATANUM, finalsort_result);
QueryPerformanceCounter(&end);//end
time5 = (end.QuadPart - start.QuadPart);
}
//单机程序SUM
QueryPerformanceCounter(&start);//start
sumresult = sum(rawdoubleData, DATANUM);
QueryPerformanceCounter(&end);//end
time2 = (end.QuadPart - start.QuadPart);
cout << "////////////////////////////SUM/////////////////////////" << endl;
cout << "双机加速结果为:" << sumresult2 <<" ";
cout << "双机用时" << time1 << endl;
cout << "单机结果为:" << sumresult << " ";
cout << "单机用时" << time2 << endl;
cout << "加速比为" << time2 / time1 << endl;
//单机程序MAX
QueryPerformanceCounter(&start);//start
maxresult = mymax(rawdoubleData, DATANUM);//你的函数(...);//包括任务启动,结果回传,收集和综合
QueryPerformanceCounter(&end);//end
time4 = (end.QuadPart - start.QuadPart);
cout << "////////////////////////////MAX/////////////////////////" << endl;
cout << "双机加速结果为:" << maxresult2 << " ";
cout << "双机用时" << time3 << endl;
cout << "单机结果为:" << maxresult << " ";
cout << "单机用时" << time4 << endl;
cout << "加速比为" << time4 / time3 << endl;
//单机程序SORT
QueryPerformanceCounter(&start);//start
sort(rawdoubleData1, DATANUM, finalsort_result1);
QueryPerformanceCounter(&end);//end
time6 = (end.QuadPart - start.QuadPart);
cout << "////////////////////////////SORT/////////////////////////" << endl;
cout << "双机加速结果为:" << finalsort_result[DATANUM-1] << " ";
cout << "双机用时" << time5 << endl;
cout << "双机数据传输时间 " << (end1.QuadPart - start1.QuadPart) << endl;
cout << "单机结果为:" << finalsort_result1[DATANUM - 1] << " ";
cout << "单机用时" << time6 << endl;
cout << "加速比为" << time6 / time5 << endl;
cout << "除去传输时间加速比" << time6 / (time5- (end1.QuadPart - start1.QuadPart)) << endl;
cout << counte << endl;
//关闭套接字
closesocket(s_server);
//释放DLL资源
WSACleanup();
return 0;
}
void initialization() {
//初始化套接字库
WORD w_req = MAKEWORD(2, 2);//版本号
WSADATA wsadata;
int err;
err = WSAStartup(w_req, &wsadata);
if (err != 0) {
cout << "初始化套接字库失败!" << endl;
}
else {
cout << "初始化套接字库成功!" << endl;
}
//检测版本号
if (LOBYTE(wsadata.wVersion) != 2 || HIBYTE(wsadata.wHighVersion) != 2) {
cout << "套接字库版本号不符!" << endl;
WSACleanup();
}
else {
cout << "套接字库版本正确!" << endl;
}
//填充服务端地址信息
}
double sum(const double data[], const int len)
{
double result = 0.0f;
for (int i = 0; i < len; i++)
{
result += log(sqrt(data[i] / 4.0));
}
//cout << result << endl;
return result;
}
//加速 openmp&SSE
double sumSpeedUp(const double data[], const int len) //sum使用avx和openmp
{
double s[4] = { 0.25,0.25,0.25,0.25 };
__m256d s_256 = _mm256_load_pd(&s[0]);
double temp[4];
double result = 0;
__m256d sum = _mm256_set1_pd(0.0f); // init partial sums
#pragma omp parallel for reduction (+:result)
for (int i = 0; i < len; i = i + 4)
{
__m256d va = _mm256_load_pd(&data[i]);
_mm256_store_pd(temp, _mm256_log_pd(_mm256_sqrt_pd(_mm256_mul_pd(va, s_256))));
double resulttemp = temp[0] + temp[1] + temp[2] + temp[3];
result += resulttemp;
}
return result;
}
double sumSpeedUp1(const double data[], const int len) //sum单独使用openmp
{
double result = 0.0f;
#pragma omp parallel for reduction(+:result)
for (int i = 0; i < len / 2; i++)
{
result += log(sqrt(data[i] / 4.0));
}
return result;
}
double mymax(const double data[], const int len) //data是原始数据,len为长度。结果通过函数返回
{
double result = 0.0f;
for (int i = 0; i < len; i++)
{
double a = log(sqrt(data[i] / 4.0));
if (result < a)
result = a;
}
return result;
}
double maxSpeedUp1(const double data[], const int len) //单独使用openmp
{
double result = 0.0f;
#pragma omp parallel for
for (int i = 0; i < len; i++)
{
int a = log(sqrt(data[i] / 4.0));
#pragma omp critical
{if (result < a)
result = a; }
}
//cout << result << endl;
return result;
}
double maxSpeedUp(const double data[], const int len) //使用openmp会使速度极度变慢
{
double s[4] = { 0.25,0.25,0.25,0.25 };
__m256d s_256 = _mm256_load_pd(&s[0]);
double result1 = 0.0f, result2 = 0.0f, result = 0.0f;
int i;
double temp[4];
__m256d max = _mm256_set1_pd(0.0f); // init partial sums
//#pragma omp parallel for
for (i = 0; i < len / 2; i = i + 4)
{
__m256d va = _mm256_load_pd(&data[i]);
//#pragma omp critical
max = _mm256_max_pd(_mm256_log_pd(_mm256_sqrt_pd(_mm256_mul_pd(va, s_256))), max);
}
_mm256_store_pd(temp, max);
result1 = temp[0] > temp[1] ? temp[0] : temp[1];
result2 = temp[2] > temp[3] ? temp[2] : temp[3];
result = result1 > result2 ? result1 : result2;
return result;
}
/************排序*************/
void init_sortdata(const double data[], const int len, double result[])//sort数据初始化SSE
{
double s[4] = { 0.25,0.25,0.25,0.25 };
__m256d s_256 = _mm256_load_pd(&s[0]);
for (size_t i = 0; i < len/2; i = i + 4)
{
__m256d va = _mm256_load_pd(&data[i]);
_mm256_store_pd(&result[i], _mm256_log_pd(_mm256_sqrt_pd(_mm256_mul_pd(va, s_256))));
}
}
double sort(const double data[], const int len, double result[])
{
memcpy(result, data, len * sizeof(double));
tQsort(result, 0, len - 1);
return 1;
}
double sortSpeedUp(const double data[], const int len, double result[])
{
HANDLE hThreads[TREAD];
//多线程
for (int i = 0; i < TREAD; i++)
{
ThreadID[i] = i;
hThreads[i] = CreateThread(
NULL,// default security attributes
0,// use default stack size
ThreadProc,// thread function
&ThreadID[i],// argument to thread function
CREATE_SUSPENDED, // use default creation flags.0 means the thread will be run at once CREATE_SUSPENDED
NULL);
}
//多线程
for (int i = 0; i < TREAD; i++)
{
ResumeThread(hThreads[i]);
}
WaitForMultipleObjects(TREAD, hThreads, TRUE, INFINITE); //这样传给回调函数的参数不用定位static或者new出来的了
//收割
tMerge(floatResults1, rawFloatData_result);
// Close all thread handles upon completion.
for (int i = 0; i < TREAD; i++)
{
CloseHandle(hThreads[i]);
}
return 1;
}
void tQsort(double arr[], int low, int high) {
if (high <= low) return;
int i = low;
int j = high + 1;
double key = arr[low];
while (true)
{
/*从左向右找比key大的值*/
while (arr[++i] < key)
{
if (i == high) {
break;
}
}
/*从右向左找比key小的值*/
while (arr[--j] > key)
{
if (j == low) {
break;
}
}
if (i >= j) break;
/*交换i,j对应的值*/
double temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
/*中枢值与j对应值交换*/
double temp = arr[low];
arr[low] = arr[j];
arr[j] = temp;
tQsort(arr, low, j - 1);
tQsort(arr, j + 1, high);
}
//合并有序数列
//堆排序思想
void tMerge(double arr[][DATANUM1], double result[])
{
double temp[TREAD];
int min_index;
int tnum[TREAD] = { 0 };
for (size_t i = 0; i < TREAD; i++)
{
temp[i] = arr[i][tnum[i]];
}
for (size_t i = 0; i < DATANUM/2; i++)
{
min_index = tmin(temp, TREAD);
result[i] = temp[min_index];
if (tnum[min_index] == (DATANUM1 - 1) || tnum[min_index] > (DATANUM1 - 1))
{
temp[min_index] = INT_MAX;
}
else
temp[min_index] = arr[min_index][(++tnum[min_index])];
}
}
int tmin(const double data[], const int len)
{
double min = data[0];
int min_index = 0;
for (size_t i = 0; i < len; i++)
{
if (min > data[i])
{
min = data[i];
min_index = i;
}
}
return min_index;
}
void MemeryArray(double a[], int n, double b[], int m, double c[])
{
int i, j, k;
i = j = k = 0;
while (i < n/2 && j < m/2)
{
if (a[i] < b[j])
c[k++] = a[i++];
else
c[k++] = b[j++];
}
while (i < n/2)
c[k++] = a[i++];
while (j < m/2)
c[k++] = b[j++];
}
| 25.748593 | 109 | 0.610755 |
10290a4aeff6b6a023fb28961d12728aff891e83 | 7,385 | cc | C++ | paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc | ZongwuYang/Paddle | 6224e61fd94e6ad87f18c2808a76256b516fa3f3 | [
"Apache-2.0"
] | null | null | null | paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc | ZongwuYang/Paddle | 6224e61fd94e6ad87f18c2808a76256b516fa3f3 | [
"Apache-2.0"
] | null | null | null | paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc | ZongwuYang/Paddle | 6224e61fd94e6ad87f18c2808a76256b516fa3f3 | [
"Apache-2.0"
] | null | null | null | /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include <mkldnn/include/mkldnn.hpp>
#include "paddle/fluid/operators/elementwise/elementwise_op.h"
#include "paddle/fluid/operators/elementwise/elementwise_op_function.h"
#include "paddle/fluid/platform/mkldnn_helper.h"
#include "paddle/fluid/operators/math/jit_kernel.h"
#include "xbyak.h"
#include "xbyak_util.h"
namespace paddle {
namespace operators {
using framework::DataLayout;
using mkldnn::memory;
static mkldnn::memory::format StringToMKLDNNFormat(std::string& format) {
std::transform(format.begin(), format.end(), format.begin(), ::tolower);
if (!format.compare("nchw")) {
return memory::format::nchw;
} else if (!format.compare("nchw16c")) {
return memory::format::nChw16c;
} else if (!format.compare("nchw8c")) {
return memory::format::nChw8c;
} else if (!format.compare("nhwc")) {
return memory::format::nhwc;
} else {
return memory::format::any;
}
}
static void UpdateDataFormat(const framework::ExecutionContext& ctx,
framework::Tensor* tensor, const char* attribute) {
if (ctx.op().HasAttr(attribute)) {
auto format_as_string = ctx.Attr<std::string>(attribute);
auto format = StringToMKLDNNFormat(format_as_string);
if (format != memory::format::any) {
tensor->set_format(format);
}
}
}
template <typename T>
static void ReorderInput(framework::Tensor* tensor,
const platform::Place& place,
const mkldnn::engine& engine, bool isFourDim) {
using platform::to_void_cast;
auto dims = paddle::framework::vectorize2int(tensor->dims());
framework::Tensor out_tensor;
out_tensor.Resize(tensor->dims());
out_tensor.set_format(isFourDim ? memory::format::nchw : memory::format::nc);
out_tensor.set_layout(tensor->layout());
mkldnn::memory input_memory = {
{{dims, platform::MKLDNNGetDataType<T>(), tensor->format()}, engine},
to_void_cast<T>(tensor->data<T>())};
mkldnn::memory output_memory = {
{{dims, platform::MKLDNNGetDataType<T>(), out_tensor.format()}, engine},
to_void_cast<T>(out_tensor.mutable_data<T>(place))};
platform::Reorder(input_memory, output_memory);
tensor->ShareDataWith(out_tensor);
}
template <typename T>
class ElementwiseMulMKLDNNKernel : public framework::OpKernel<T> {
public:
void Compute(const framework::ExecutionContext& ctx) const override {
using Tensor = framework::Tensor;
int axis = ctx.Attr<int>("axis");
auto* x = ctx.Input<Tensor>("X");
auto* y = ctx.Input<Tensor>("Y");
auto* z = ctx.Output<Tensor>("Out");
const T* x_data = x->data<T>();
const T* y_data = y->data<T>();
T* z_data = z->mutable_data<T>(ctx.GetPlace());
auto x_dims = x->dims();
auto y_dims_untrimmed = y->dims();
auto x_int_dims = paddle::framework::vectorize2int(x_dims);
UpdateDataFormat(ctx, (Tensor*)x, "x_data_format");
UpdateDataFormat(ctx, (Tensor*)y, "y_data_format");
Xbyak::util::Cpu cpu;
const bool is_avx512_enabled = cpu.has(Xbyak::util::Cpu::tAVX512F);
const bool are_dims_divisable = !(x_int_dims[1] % 16);
const bool is_x_format_correct = x->format() == memory::format::nChw16c;
const bool is_y_format_correct = y->format() == memory::format::nc;
if (is_x_format_correct && is_y_format_correct && are_dims_divisable &&
is_avx512_enabled) {
int pre, n, post;
get_mid_dims(x_dims, y_dims_untrimmed, axis, &pre, &n, &post);
if (post == 1) {
PADDLE_THROW("Not implemented when post is 1");
} else {
// Just check whether it works for RE-Resnext.
PADDLE_ENFORCE_EQ(x_dims.size(), 4, "X should have 4 dimensions");
int n = x_dims[0];
int c = x_dims[1];
int h = x_dims[2];
int w = x_dims[3];
PADDLE_ENFORCE(y_dims_untrimmed[0] == n && y_dims_untrimmed[1] == c,
"Y should be in nc format");
constexpr int simd_width = 16;
int C = c / simd_width;
const auto& multiply =
math::jitkernel::KernelPool::Instance()
.template Get<math::jitkernel::EltwiseMulnChw16cNCKernel<T>>(n);
#pragma omp parallel for collapse(2)
for (int ni = 0; ni < n; ni++) {
for (int ci = 0; ci < C; ci++) {
auto ptr_x =
x_data + ni * C * h * w * simd_width + ci * h * w * simd_width;
auto ptr_y = y_data + ni * C * simd_width + ci * simd_width;
auto ptr_z =
z_data + ni * C * h * w * simd_width + ci * h * w * simd_width;
multiply->Compute(ptr_x, ptr_y, ptr_z, h, w);
}
}
}
z->set_layout(DataLayout::kMKLDNN);
z->set_format(x->format());
} else {
// Fallback to naive version:
const bool are_inputs_in_same_format = x->format() == y->format();
const bool is_x_nchw = x->format() == memory::format::nchw;
const bool is_x_nc = x->format() == memory::format::nc;
const bool is_y_nchw = y->format() == memory::format::nchw;
const bool is_y_nc = y->format() == memory::format::nc;
if (!are_inputs_in_same_format) {
using platform::MKLDNNDeviceContext;
auto& dev_ctx = ctx.template device_context<MKLDNNDeviceContext>();
const auto& mkldnn_engine = dev_ctx.GetEngine();
if (!(is_x_nchw || is_x_nc))
ReorderInput<T>((Tensor*)x, ctx.GetPlace(), mkldnn_engine,
x->dims().size() == 4);
if (!(is_y_nchw || is_y_nc))
ReorderInput<T>((Tensor*)y, ctx.GetPlace(), mkldnn_engine,
y->dims().size() == 4);
}
auto mul_func = [](T a, T b) -> T { return a * b; };
TransformFunctor<decltype(mul_func), T,
paddle::platform::CPUDeviceContext, T>
functor(
x, y, z,
ctx.template device_context<paddle::platform::CPUDeviceContext>(),
mul_func);
axis = (axis == -1 ? x_dims.size() - y_dims_untrimmed.size() : axis);
PADDLE_ENFORCE(axis >= 0 && axis < x_dims.size(),
"Axis should be in range [0, x_dims)");
auto y_dims = trim_trailing_singular_dims(y_dims_untrimmed);
axis = (y_dims.size() == 0) ? x_dims.size() : axis;
int pre, n, post;
get_mid_dims(x_dims, y_dims, axis, &pre, &n, &post);
if (post == 1) {
functor.RunRowWise(n, pre);
} else {
functor.RunMidWise(n, pre, post);
}
z->set_layout(DataLayout::kMKLDNN);
z->set_format(x->format());
}
}
};
} // namespace operators
} // namespace paddle
namespace ops = paddle::operators;
REGISTER_OP_KERNEL(elementwise_mul, MKLDNN, ::paddle::platform::CPUPlace,
ops::ElementwiseMulMKLDNNKernel<float>)
| 36.559406 | 80 | 0.627488 |
10297cf494588e60c748fbcbed6ba06dd5535cb3 | 3,069 | cc | C++ | src/ops/split.cc | aj7tesh/CTranslate2 | 8e424efdbcf40c89dca7e237a249464a95eeaf74 | [
"MIT"
] | null | null | null | src/ops/split.cc | aj7tesh/CTranslate2 | 8e424efdbcf40c89dca7e237a249464a95eeaf74 | [
"MIT"
] | null | null | null | src/ops/split.cc | aj7tesh/CTranslate2 | 8e424efdbcf40c89dca7e237a249464a95eeaf74 | [
"MIT"
] | null | null | null | #include "ctranslate2/ops/split.h"
#include <numeric>
#include "device_dispatch.h"
#include "type_dispatch.h"
namespace ctranslate2 {
namespace ops {
Split::Split(dim_t axis, bool no_copy)
: _axis(axis)
, _total_size(0)
, _no_copy(no_copy) {
check_arguments();
}
Split::Split(dim_t axis, const std::vector<dim_t>& split, bool no_copy)
: _axis(axis)
, _split(split)
, _total_size(std::accumulate(split.begin(), split.end(), 0))
, _no_copy(no_copy) {
check_arguments();
}
void Split::operator()(const StorageView& input,
StorageView& output1,
StorageView& output2) const {
std::vector<StorageView*> outputs{&output1, &output2};
operator()(input, outputs);
}
void Split::operator()(const StorageView& input,
StorageView& output1,
StorageView& output2,
StorageView& output3) const {
std::vector<StorageView*> outputs{&output1, &output2, &output3};
operator()(input, outputs);
}
void Split::operator()(const StorageView& input, std::vector<StorageView*>& outputs) const {
PROFILE("Split");
const dim_t axis = _axis < 0 ? input.rank() + _axis : _axis;
const dim_t dim = input.dim(axis);
if (!_split.empty()) {
if (_split.size() != outputs.size())
throw std::invalid_argument(std::to_string(outputs.size())
+ " outputs are passed but "
+ std::to_string(_split.size())
+ " split sizes were configured");
if (dim != _total_size)
throw std::invalid_argument("axis " + std::to_string(axis) + " has dimension "
+ std::to_string(dim) + " but expected "
+ std::to_string(_total_size));
} else if (dim % outputs.size() != 0)
throw std::invalid_argument("axis " + std::to_string(axis) + " is not divisble by "
+ std::to_string(outputs.size()));
dim_t offset = 0;
for (size_t j = 0; j < outputs.size(); ++j) {
auto& x = *outputs[j];
auto shape = input.shape();
const dim_t split_size = _split.empty() ? dim / outputs.size() : _split[j];
shape[axis] = split_size;
if (_no_copy) {
TYPE_DISPATCH(input.dtype(),
x.view(const_cast<T*>(input.data<T>() + offset), shape));
} else {
x.resize(shape);
}
offset += input.stride(0) * split_size;
}
if (!_no_copy) {
DEVICE_DISPATCH(input.device(),
TYPE_DISPATCH(input.dtype(), (compute<D, T>(input, outputs))));
}
}
void Split::check_arguments() const {
if (_no_copy && _axis != 0)
throw std::invalid_argument("no_copy is only defined when splitting across the first dimension");
}
}
}
| 34.483146 | 105 | 0.529814 |
102a019012876dfc0442c1e70182198f86b0cf7c | 1,488 | cpp | C++ | cpp-pthread/demo22b-blocking-queue.cpp | thanhit95/multi-threading | 30e745b6a6c52e56a8d8e3826ce7a97b51944caa | [
"BSD-3-Clause"
] | 15 | 2021-06-15T09:27:35.000Z | 2022-03-25T02:01:45.000Z | cpp-pthread/demo22b-blocking-queue.cpp | thanhit95/multi-threads | 30e745b6a6c52e56a8d8e3826ce7a97b51944caa | [
"BSD-3-Clause"
] | null | null | null | cpp-pthread/demo22b-blocking-queue.cpp | thanhit95/multi-threads | 30e745b6a6c52e56a8d8e3826ce7a97b51944caa | [
"BSD-3-Clause"
] | 5 | 2021-07-15T14:31:33.000Z | 2022-03-29T06:19:34.000Z | /*
BLOCKING QUEUES
Version B: A fast producer and a slow consumer
Blocking queues in C++ POSIX threading are not supported by default.
So, I use mylib::BlockingQueue for this demonstration.
*/
#include <iostream>
#include <string>
#include <unistd.h>
#include <pthread.h>
#include "../cpp-std/mylib-blockingqueue.hpp"
using namespace std;
using namespace mylib;
void* producer(void* arg) {
auto blkQueue = (BlockingQueue<string>*) arg;
blkQueue->put("Alice");
blkQueue->put("likes");
/*
Due to reaching the maximum capacity = 2, when executing blkQueue->put("singing"),
this thread is going to sleep until the queue removes an element.
*/
blkQueue->put("singing");
pthread_exit(nullptr);
return nullptr;
}
void* consumer(void* arg) {
auto blkQueue = (BlockingQueue<string>*) arg;
string data;
sleep(2);
for (int i = 0; i < 3; ++i) {
cout << "\nWaiting for data..." << endl;
data = blkQueue->take();
cout << " " << data << endl;
}
pthread_exit(nullptr);
return nullptr;
}
int main() {
pthread_t tidProducer, tidConsumer;
auto blkQueue = BlockingQueue<string>(); // blocking queue with capacity = 2
int ret = 0;
ret = pthread_create(&tidProducer, nullptr, producer, &blkQueue);
ret = pthread_create(&tidConsumer, nullptr, consumer, &blkQueue);
ret = pthread_join(tidProducer, nullptr);
ret = pthread_join(tidConsumer, nullptr);
return 0;
}
| 20.957746 | 86 | 0.650538 |
102b1bc4f3e7f3e809f2fa584f523352af088133 | 267 | cpp | C++ | cpp/ql/src/Critical/MissingNegativityTest.cpp | calumgrant/ql | 3c0f04ac96da17456a2085ef11e05aca4632b986 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-05T13:02:34.000Z | 2021-07-05T13:02:34.000Z | cpp/ql/src/Critical/MissingNegativityTest.cpp | calumgrant/ql | 3c0f04ac96da17456a2085ef11e05aca4632b986 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cpp/ql/src/Critical/MissingNegativityTest.cpp | calumgrant/ql | 3c0f04ac96da17456a2085ef11e05aca4632b986 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Record records[SIZE] = ...;
int f() {
int recordIdx = 0;
recordIdx = readUserInput(); //recordIdx is returned from a function
// there is no check so it could be negative
doFoo(&(records[recordIdx])); //but is not checked before use as an array offset
}
| 26.7 | 81 | 0.677903 |
102c5231149876d8d1e956f496a4e518cd4d2700 | 2,191 | cpp | C++ | lunarlady/File.cpp | madeso/infection-survivors | 654fc5405dcecccaa7e54f1fdbfec379e0c185da | [
"Zlib"
] | null | null | null | lunarlady/File.cpp | madeso/infection-survivors | 654fc5405dcecccaa7e54f1fdbfec379e0c185da | [
"Zlib"
] | null | null | null | lunarlady/File.cpp | madeso/infection-survivors | 654fc5405dcecccaa7e54f1fdbfec379e0c185da | [
"Zlib"
] | null | null | null | #include "lunarlady/File.hpp"
#include "lunarlady/FileSystem.hpp"
#include "lunarlady/StringUtils.hpp"
#include "lunarlady/Error.hpp"
#include <sstream>
namespace lunarlady {
void WriteFile(const std::string iFileName, const char* iBuffer, std::size_t iSize) {
PHYSFS_file* file = PHYSFS_openWrite(iFileName.c_str());
if( file == NULL ) {
std::ostringstream str;
str << "Failed to write file, " << iFileName << ", reason: " << PHYSFS_getLastError();
throw PhysFSError(str.str());
}
const PHYSFS_uint32 size = iSize;
const PHYSFS_sint64 written = PHYSFS_write(file, iBuffer, sizeof(char), size );
if( written < size ) {
std::ostringstream str;
str << "Failed to write enough bytes to file " << iFileName << ", " << written << " bytes written, reason: " << PHYSFS_getLastError();
throw PhysFSError(str.str());
}
HandlePhysfsInitError( PHYSFS_close(file), "Failed to close file" + iFileName );
}
ReadFile::ReadFile(const std::string& iFileName) : mSize(0) {
PHYSFS_file* file = PHYSFS_openRead( iFileName.c_str() );
if( file == NULL ) {
std::ostringstream str;
str << "Failed to load file, " << iFileName << ", reason: " << PHYSFS_getLastError();
throw PhysFSError(str.str());
}
mSize = PHYSFS_fileLength(file);
mFile.reset( new char[mSize] );
PHYSFS_sint64 lengthRead = PHYSFS_read (file, mFile.get(), 1, mSize);
HandlePhysfsInitError( PHYSFS_close(file), "Failed to close file" + iFileName );
}
bool FileExist(const std::string iFileName) {
return 0 != PHYSFS_exists(iFileName.c_str());
}
std::size_t ReadFile::getSize() const {
return mSize;
}
char* ReadFile::getBuffer() const {
return mFile.get();
}
void GetFileListing(const std::string& iDirectory, std::vector<std::string>* oFiles) {
char **rc = PHYSFS_enumerateFiles( iDirectory.c_str() );
const std::string SEPERATOR = "/";
const bool shouldAddSeperator = !EndsWith(iDirectory, SEPERATOR);
for (char **i = rc; *i != NULL; i++) {
std::ostringstream str;
if( shouldAddSeperator ) {
str << iDirectory << SEPERATOR << *i;
}
else {
str << iDirectory << *i;
}
oFiles->push_back( str.str() );
}
PHYSFS_freeList(rc);
}
} | 32.701493 | 137 | 0.671383 |
102e7aa7aef0a4eade2a35d2a5b59df6c9ba0ac3 | 1,867 | hpp | C++ | include/fibio/http/server/templates/mustache_template.hpp | qicosmos/fibio | 9242be982a62d82eefdc489d88ccbdda180d861f | [
"BSD-2-Clause"
] | 8 | 2015-03-29T16:37:47.000Z | 2021-11-18T23:53:56.000Z | include/fibio/http/server/templates/mustache_template.hpp | qicosmos/fibio | 9242be982a62d82eefdc489d88ccbdda180d861f | [
"BSD-2-Clause"
] | null | null | null | include/fibio/http/server/templates/mustache_template.hpp | qicosmos/fibio | 9242be982a62d82eefdc489d88ccbdda180d861f | [
"BSD-2-Clause"
] | 2 | 2015-08-31T02:51:04.000Z | 2021-06-02T09:41:04.000Z | //
// mustache_template.hpp
// fibio
//
// Created by Chen Xu on 14/12/1.
// Copyright (c) 2014 0d0a.com. All rights reserved.
//
#ifndef fibio_http_server_template_hpp
#define fibio_http_server_template_hpp
#include <fibio/http/common/json.hpp>
#include <fibio/http/server/templates/mustache.hpp>
#include <fibio/http/server/routing.hpp>
namespace fibio { namespace http {
namespace detail {
template<typename Ret, typename ...Args>
struct mustache_controller;
template<typename Ret, typename ...Args>
struct mustache_controller<std::function<Ret(Args...)>> {
typedef std::function<Ret(Args...)> model_type;
mustache_controller(const std::string &tmpl, model_type &&func)
: view_(mustache::compile(tmpl))
, model_(std::forward<model_type>(func))
{
static_assert(std::is_constructible<json::wvalue, Ret>::value,
"Return value of model function must be compatible with json::wvalue");
}
std::string operator()(Args&&... args) {
json::wvalue ctx(model_(std::forward<Args>(args)...));
return view_.render(ctx);
}
mustache::template_t view_;
model_type model_;
};
}
template<typename Fn>
server::request_handler mustache_(const std::string &tmpl,
Fn &&fn,
const std::string content_type="text/html")
{
typedef typename utility::make_function_type<Fn> model_type;
detail::mustache_controller<model_type> controller(tmpl, model_type(std::forward<Fn>(fn)));
return with_content_type(content_type, controller);
}
}} // End of namespace fibio::http
#endif
| 35.226415 | 101 | 0.589716 |
102f29874a2774a962ba491d442677954761b1ac | 7,059 | cpp | C++ | 3rdparty/opencv-3.4.2/modules/dnn/src/layers/reorg_layer.cpp | shrflaans/cppPlayground | 29fc98271df2f1f2503d7c768a7622db1be80c29 | [
"MIT"
] | 3 | 2018-09-17T04:46:36.000Z | 2019-08-01T07:33:28.000Z | 3rdparty/opencv-3.4.2/modules/dnn/src/layers/reorg_layer.cpp | shrflaans/cppPlayground | 29fc98271df2f1f2503d7c768a7622db1be80c29 | [
"MIT"
] | null | null | null | 3rdparty/opencv-3.4.2/modules/dnn/src/layers/reorg_layer.cpp | shrflaans/cppPlayground | 29fc98271df2f1f2503d7c768a7622db1be80c29 | [
"MIT"
] | 1 | 2018-07-29T05:15:20.000Z | 2018-07-29T05:15:20.000Z | /*M ///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2017, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "../precomp.hpp"
#include <opencv2/dnn/shape_utils.hpp>
#include <opencv2/dnn/all_layers.hpp>
#include <iostream>
#ifdef HAVE_OPENCL
#include "opencl_kernels_dnn.hpp"
#endif
namespace cv
{
namespace dnn
{
class ReorgLayerImpl CV_FINAL : public ReorgLayer
{
int reorgStride;
public:
ReorgLayerImpl(const LayerParams& params)
{
setParamsFrom(params);
reorgStride = params.get<int>("reorg_stride", 2);
CV_Assert(reorgStride > 0);
}
bool getMemoryShapes(const std::vector<MatShape> &inputs,
const int requiredOutputs,
std::vector<MatShape> &outputs,
std::vector<MatShape> &internals) const CV_OVERRIDE
{
CV_Assert(inputs.size() > 0);
outputs = std::vector<MatShape>(inputs.size(), shape(
inputs[0][0],
inputs[0][1] * reorgStride * reorgStride,
inputs[0][2] / reorgStride,
inputs[0][3] / reorgStride));
CV_Assert(outputs[0][0] > 0 && outputs[0][1] > 0 && outputs[0][2] > 0 && outputs[0][3] > 0);
CV_Assert(total(outputs[0]) == total(inputs[0]));
return false;
}
#ifdef HAVE_OPENCL
bool forward_ocl(InputArrayOfArrays inps, OutputArrayOfArrays outs, OutputArrayOfArrays internals)
{
std::vector<UMat> inputs;
std::vector<UMat> outputs;
bool use_half = (inps.depth() == CV_16S);
inps.getUMatVector(inputs);
outs.getUMatVector(outputs);
String buildopt= format("-DDtype=%s ", use_half ? "half" : "float");
for (size_t i = 0; i < inputs.size(); i++)
{
ocl::Kernel kernel("reorg", ocl::dnn::reorg_oclsrc, buildopt);
if (kernel.empty())
return false;
UMat& srcBlob = inputs[i];
UMat& dstBlob = outputs[0];
int channels = srcBlob.size[1];
int height = srcBlob.size[2];
int width = srcBlob.size[3];
size_t nthreads = channels * height * width;
kernel.set(0, (int)nthreads);
kernel.set(1, ocl::KernelArg::PtrReadOnly(srcBlob));
kernel.set(2, (int)channels);
kernel.set(3, (int)height);
kernel.set(4, (int)width);
kernel.set(5, (int)reorgStride);
kernel.set(6, ocl::KernelArg::PtrWriteOnly(dstBlob));
if (!kernel.run(1, &nthreads, NULL, false))
return false;
}
return true;
}
#endif
void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE
{
CV_TRACE_FUNCTION();
CV_TRACE_ARG_VALUE(name, "name", name.c_str());
CV_OCL_RUN(IS_DNN_OPENCL_TARGET(preferableTarget) &&
OCL_PERFORMANCE_CHECK(ocl::Device::getDefault().isIntel()),
forward_ocl(inputs_arr, outputs_arr, internals_arr))
Layer::forward_fallback(inputs_arr, outputs_arr, internals_arr);
}
void forward(std::vector<Mat*> &inputs, std::vector<Mat> &outputs, std::vector<Mat> &internals) CV_OVERRIDE
{
CV_TRACE_FUNCTION();
CV_TRACE_ARG_VALUE(name, "name", name.c_str());
for (size_t i = 0; i < inputs.size(); i++)
{
Mat srcBlob = *inputs[i];
MatShape inputShape = shape(srcBlob), outShape = shape(outputs[i]);
float *dstData = outputs[0].ptr<float>();
const float *srcData = srcBlob.ptr<float>();
int channels = inputShape[1], height = inputShape[2], width = inputShape[3];
int out_c = channels / (reorgStride*reorgStride);
for (int k = 0; k < channels; ++k) {
for (int j = 0; j < height; ++j) {
for (int i = 0; i < width; ++i) {
int out_index = i + width*(j + height*k);
int c2 = k % out_c;
int offset = k / out_c;
int w2 = i*reorgStride + offset % reorgStride;
int h2 = j*reorgStride + offset / reorgStride;
int in_index = w2 + width*reorgStride*(h2 + height*reorgStride*c2);
dstData[out_index] = srcData[in_index];
}
}
}
}
}
virtual int64 getFLOPS(const std::vector<MatShape> &inputs,
const std::vector<MatShape> &outputs) const CV_OVERRIDE
{
(void)outputs; // suppress unused variable warning
int64 flops = 0;
for(int i = 0; i < inputs.size(); i++)
{
flops += 21*total(inputs[i]);
}
return flops;
}
};
Ptr<ReorgLayer> ReorgLayer::create(const LayerParams& params)
{
return Ptr<ReorgLayer>(new ReorgLayerImpl(params));
}
} // namespace dnn
} // namespace cv
| 36.57513 | 127 | 0.602493 |
102f6b6f4cdb7acf913d48a7d886bdd1480e9328 | 2,531 | cpp | C++ | Trees/InPlaceConvertToDoublyLinkedList/InPlaceConvertToDoublyLinkedList03.cpp | XoDeR/AlgoTrain2018 | 04b96af8dd16d57cb31b70d268262b51ed559551 | [
"MIT"
] | null | null | null | Trees/InPlaceConvertToDoublyLinkedList/InPlaceConvertToDoublyLinkedList03.cpp | XoDeR/AlgoTrain2018 | 04b96af8dd16d57cb31b70d268262b51ed559551 | [
"MIT"
] | null | null | null | Trees/InPlaceConvertToDoublyLinkedList/InPlaceConvertToDoublyLinkedList03.cpp | XoDeR/AlgoTrain2018 | 04b96af8dd16d57cb31b70d268262b51ed559551 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
// Data structure to store a Binary Tree node
struct Node
{
int data;
Node *left, *right;
};
// Function to create a new binary tree node having given key
Node* newNode(int key)
{
Node* node = new Node;
node->data = key;
node->left = node->right = nullptr;
return node;
}
// Function to insert given key into the tree
void insert(Node*& root, string level, int key)
{
// tree is empty
if (level.length() == 0)
{
root = newNode(key);
return;
}
int i = 0;
Node* ptr = root;
while (i < level.length() - 1)
{
if (level[i++] == 'L')
ptr = ptr->left;
else
ptr = ptr->right;
}
if (level[i] == 'L')
ptr->left = newNode(key);
else
ptr->right = newNode(key);
}
// Helper function to print given doubly linked list
void printDLL(Node* &head)
{
Node* curr = head;
while (curr != nullptr)
{
cout << curr->data << " ";
curr = curr->right;
}
}
// Function to in-place convert given Binary Tree to a Doubly Linked List
// root -> current node
// head -> head of the doubly linked list (Passed by reference)
// prev -> previous processed node (Passed by reference)
void convert(Node* curr, Node*& head, Node* &prev)
{
// base case: tree is empty
if (curr == nullptr)
return;
// recursively convert left subtree first
convert(curr->left, head, prev);
// adjust pointers
if (prev != nullptr)
{
// set current node's left child to prev
curr->left = prev;
// make prev's right child as curr
prev->right = curr;
}
// if prev is null, then update head of DLL as this is first node in inorder
else
head = curr;
// after current node is visited, update previous pointer to current node
prev = curr;
// recursively convert right subtree
convert(curr->right, head, prev);
}
// in-place convert given Binary Tree to a Doubly Linked List
void convert(Node* root)
{
// to keep track of previous processed node in inorder traversal
Node* prev = nullptr;
// convert above binary tree to DLL (using inorder traversal)
convert(root, root, prev);
// root is now head of doubly linked list
// print list
printDLL(root);
}
// main function
int main()
{
/* Construct below tree
1
/ \
/ \
2 3
/ \ / \
4 5 6 7
*/
vector<pair<string, int>> keys =
{
{"", 1}, {"L", 2}, {"R", 3}, {"LL", 4}, {"LR", 5},
{"RL", 6}, {"RR", 7}
};
Node* root = nullptr;
for (auto pair: keys)
insert(root, pair.first, pair.second);
convert(root);
return 0;
}
| 18.88806 | 80 | 0.620703 |
10300000046defcb6a0af6e7479b2cdc723f2420 | 49,535 | cpp | C++ | SQLComponents/SQLVariantOperatorMod.cpp | edwig/Kwatta | ce1ca2907608e65ed62d7dbafa9ab1d030caccfe | [
"MIT"
] | 1 | 2021-12-31T17:20:01.000Z | 2021-12-31T17:20:01.000Z | SQLComponents/SQLVariantOperatorMod.cpp | edwig/Kwatta | ce1ca2907608e65ed62d7dbafa9ab1d030caccfe | [
"MIT"
] | 10 | 2022-01-14T13:28:32.000Z | 2022-02-13T12:46:34.000Z | SQLComponents/SQLVariantOperatorMod.cpp | edwig/Kwatta | ce1ca2907608e65ed62d7dbafa9ab1d030caccfe | [
"MIT"
] | null | null | null | ////////////////////////////////////////////////////////////////////////
//
// File: SQLVariantOperatorMod.cpp
//
// Copyright (c) 1998-2022 ir. W.E. Huisman
// All rights reserved
//
// 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.
//
// Version number: See SQLComponents.h
//
#include "stdafx.h"
#include "SQLComponents.h"
#include "SQLVariant.h"
#include "SQLVariantOperator.h"
#include "SQLDate.h"
#include "bcd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
namespace SQLComponents
{
SQLVariant
static SQL_OperSShortModChar(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModChar(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModChar(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModChar(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModChar(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModChar(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModChar(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModChar(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModChar(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModChar(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModChar(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt() % p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModChar(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsChar());
SQLVariant var(&num);
return var;
}
// TYPE == SSHORT
SQLVariant
static SQL_OperCharModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant static SQL_OperSLongModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsSShort());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModSShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == USHORT
SQLVariant
static SQL_OperCharModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUlongModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd((int)p_right.GetAsUShort());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModUShort(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == SLONG
SQLVariant
static SQL_OperCharModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsSLong());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModSLong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == ULONG
SQLVariant
static SQL_OperCharModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModULong(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModULong(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModULong(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModULong(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModULong(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModULong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModULong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModULong(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd((int64)p_right.GetAsUShort());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModULong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModULong(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == FLOAT
SQLVariant
static SQL_OperCharModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd((double)p_right.GetAsFloat());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModFloat(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
// TYPE == DOUBLE
SQLVariant
static SQL_OperCharModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsUShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsDouble());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModDouble(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
// TYPE == BIT
SQLVariant
static SQL_OperCharModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
bool result = p_left.GetAsBit() != 0;
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
short result = p_left.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
unsigned short result = p_left.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
int result = p_left.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
unsigned int result = p_left.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
float result = p_left.GetAsFloat();
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
double result = p_left.GetAsDouble();
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
bool result = p_left.GetAsBit() != 0;
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
char result = p_left.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
unsigned char result = p_left.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLBIGINT result = p_left.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLVariant result(p_left);
return result;
}
SQLVariant
static SQL_OperIntYMModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLInterval result = p_left.GetAsSQLInterval();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModBit(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLInterval result = p_left.GetAsSQLInterval();
return SQLVariant(&result);
}
// TYPE == STINYINT
SQLVariant
static SQL_OperCharModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsSTinyInt());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModSTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE = UTINYINT
SQLVariant
static SQL_OperCharModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd((int)p_right.GetAsUTinyInt());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModUTiny(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == SBIGINT
SQLVariant
static SQL_OperCharModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsSBigInt());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModSBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == UBIGINT
SQLVariant
static SQL_OperCharModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSShortModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
short result = p_left.GetAsSShort();
result %= p_right.GetAsSShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUShortModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short result = p_left.GetAsUShort();
result %= p_right.GetAsUShort();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSLongModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
int result = p_left.GetAsSLong();
result %= p_right.GetAsSLong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperULongModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int result = p_left.GetAsULong();
result %= p_right.GetAsULong();
return SQLVariant(result);
}
SQLVariant
static SQL_OperFloatModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
float result = ::fmod(p_left.GetAsFloat(),p_right.GetAsFloat());
return SQLVariant(result);
}
SQLVariant
static SQL_OperDoubleModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
double result = ::fmod(p_left.GetAsDouble(),p_right.GetAsDouble());
return SQLVariant(result);
}
SQLVariant
static SQL_OperBitModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
bool result = false;
if(p_left.GetAsBit() && p_right.GetAsBit())
{
result = true;
}
return SQLVariant(result);
}
SQLVariant
static SQL_OperSTinyModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
char result = p_left.GetAsSTinyInt();
result %= p_right.GetAsSTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUTinyModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char result = p_left.GetAsUTinyInt();
result %= p_right.GetAsUTinyInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperSBigModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLBIGINT result = p_left.GetAsSBigInt();
result %= p_right.GetAsSBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperUBigModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLUBIGINT result = p_left.GetAsUBigInt();
result %= p_right.GetAsUBigInt();
return SQLVariant(result);
}
SQLVariant
static SQL_OperNumModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % bcd(p_right.GetAsUBigInt());
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModUBig(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsSLong();
return SQLVariant(&result);
}
// TYPE == NUMERIC
SQLVariant
static SQL_OperCharModNum(SQLVariant& p_left,SQLVariant& p_right)
{
double num = ::fmod(p_left.GetAsDouble(),p_right.GetAsBCD().AsDouble());
XString str;
str.Format("%lf",num);
SQLVariant var(str);
return var;
}
SQLVariant
static SQL_OperSShortModNum(SQLVariant& p_left,SQLVariant& p_right)
{
short num = p_left.GetAsSShort() % p_right.GetAsBCD().AsLong();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperUShortModNum(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned short num = p_left.GetAsUShort() % p_right.GetAsBCD().AsLong();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperSLongModNum(SQLVariant& p_left,SQLVariant& p_right)
{
int num = p_left.GetAsSLong() % p_right.GetAsBCD().AsLong();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperULongModNum(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned int num = p_left.GetAsULong() % p_right.GetAsBCD().AsInt64();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperFloatModNum(SQLVariant& p_left,SQLVariant& p_right)
{
float num = (float) ::fmod(p_left.GetAsFloat(),p_right.GetAsBCD().AsDouble());
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperDoubleModNum(SQLVariant& p_left,SQLVariant& p_right)
{
double num = ::fmod(p_left.GetAsDouble(),p_right.GetAsBCD().AsDouble());
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperBitModNum(SQLVariant& p_left,SQLVariant& /*p_right*/)
{
SQLVariant var(p_left.GetAsBit());
return var;
}
SQLVariant
static SQL_OperSTinyModNum(SQLVariant& p_left,SQLVariant& p_right)
{
char num = p_left.GetAsSTinyInt() % (char) p_right.GetAsBCD().AsLong();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperUTinyModNum(SQLVariant& p_left,SQLVariant& p_right)
{
unsigned char num = p_left.GetAsUTinyInt() % (unsigned char)p_right.GetAsBCD().AsLong();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperSBigModNum(SQLVariant& p_left,SQLVariant& p_right)
{
int64 num = p_left.GetAsSBigInt() % p_right.GetAsBCD().AsInt64();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperUBigModNum(SQLVariant& p_left,SQLVariant& p_right)
{
uint64 num = p_left.GetAsUBigInt() % p_right.GetAsBCD().AsUInt64();
SQLVariant var(num);
return var;
}
SQLVariant
static SQL_OperNumModNum(SQLVariant& p_left,SQLVariant& p_right)
{
bcd num = p_left.GetAsBCD() % p_right.GetAsBCD();
SQLVariant var(&num);
return var;
}
SQLVariant
static SQL_OperIntYMModNum(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
SQLVariant
static SQL_OperIntDSModNum(SQLVariant& p_left,SQLVariant& p_right)
{
SQLInterval result = p_left.GetAsSQLInterval() % p_right.GetAsDouble();
return SQLVariant(&result);
}
// OPERATOR ARRAY
static CalculateFunctionArray OperatorMod[CT_LAST][CT_LAST] =
{
// CT_CHAR CT_SSHORT CT_USHORT CT_SLONG CT_ULONG CT_FLOAT CT_DOUBLE CT_BIT CT_STINYINT CT_UTINYINT CT_SBIGINT CT_UBIGINT CT_NUMERIC CT_GUID CT_BINARY CT_DATE CT_TIME CT_TIMESTAMP CT_INTERVAL_YM CT_INTERVAL_DS
// ---------------------- ------------------------ ------------------------ ----------------------- ----------------------- ----------------------- ------------------------ --------------------- ----------------------- ----------------------- ---------------------- ---------------------- --------------------- -------- --------- -------- -------- ------------ -------------- --------------
/* CT_CHAR */ { nullptr ,&SQL_OperCharModSShort ,&SQL_OperCharModUShort ,&SQL_OperCharModSLong ,&SQL_OperCharModULong ,&SQL_OperCharModFloat ,&SQL_OperCharModDouble ,&SQL_OperCharModBit ,&SQL_OperCharModSTiny ,&SQL_OperCharModUTiny ,&SQL_OperCharModSBig ,&SQL_OperCharModUBig ,&SQL_OperCharModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_SSHORT */ ,{ &SQL_OperSShortModChar,&SQL_OperSShortModSShort,&SQL_OperSShortModUShort,&SQL_OperSShortModSLong,&SQL_OperSShortModULong,&SQL_OperSShortModFloat,&SQL_OperSShortModDouble,&SQL_OperSShortModBit,&SQL_OperSShortModSTiny,&SQL_OperSShortModUTiny,&SQL_OperSShortModSBig,&SQL_OperSShortModUBig,&SQL_OperSShortModNum,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_USHORT */ ,{ &SQL_OperUShortModChar,&SQL_OperUShortModSShort,&SQL_OperUShortModUShort,&SQL_OperUShortModSLong,&SQL_OperUShortModULong,&SQL_OperUShortModFloat,&SQL_OperUShortModDouble,&SQL_OperUShortModBit,&SQL_OperUShortModSTiny,&SQL_OperUShortModUTiny,&SQL_OperUShortModSBig,&SQL_OperUShortModUBig,&SQL_OperUShortModNum,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_SLONG */ ,{ &SQL_OperSLongModChar ,&SQL_OperSLongModSShort ,&SQL_OperSLongModUShort ,&SQL_OperSLongModSLong ,&SQL_OperSLongModULong ,&SQL_OperSLongModFloat ,&SQL_OperSLongModDouble ,&SQL_OperSLongModBit ,&SQL_OperSLongModSTiny ,&SQL_OperSLongModUTiny ,&SQL_OperSLongModSBig ,&SQL_OperSLongModUBig ,&SQL_OperSLongModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_ULONG */ ,{ &SQL_OperULongModChar ,&SQL_OperULongModSShort ,&SQL_OperUlongModUShort ,&SQL_OperULongModSLong ,&SQL_OperULongModULong ,&SQL_OperULongModFloat ,&SQL_OperULongModDouble ,&SQL_OperULongModBit ,&SQL_OperULongModSTiny ,&SQL_OperULongModUTiny ,&SQL_OperULongModSBig ,&SQL_OperULongModUBig ,&SQL_OperULongModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_FLOAT */ ,{ &SQL_OperFloatModChar ,&SQL_OperFloatModSShort ,&SQL_OperFloatModUShort ,&SQL_OperFloatModSLong ,&SQL_OperFloatModULong ,&SQL_OperFloatModFloat ,&SQL_OperFloatModDouble ,&SQL_OperFloatModBit ,&SQL_OperFloatModSTiny ,&SQL_OperFloatModUTiny ,&SQL_OperFloatModSBig ,&SQL_OperFloatModUBig ,&SQL_OperFloatModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_DOUBLE */ ,{ &SQL_OperDoubleModChar,&SQL_OperDoubleModSShort,&SQL_OperDoubleModUShort,&SQL_OperDoubleModSLong,&SQL_OperDoubleModULong,&SQL_OperDoubleModFloat,&SQL_OperDoubleModDouble,&SQL_OperDoubleModBit,&SQL_OperDoubleModSTiny,&SQL_OperDoubleModUTiny,&SQL_OperDoubleModSBig,&SQL_OperDoubleModUBig,&SQL_OperDoubleModNum,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_BIT */ ,{ &SQL_OperBitModChar ,&SQL_OperBitModSShort ,&SQL_OperBitModUShort ,&SQL_OperBitModSLong ,&SQL_OperBitModULong ,&SQL_OperBitModFloat ,&SQL_OperBitModDouble ,&SQL_OperBitModBit ,&SQL_OperBitModSTiny ,&SQL_OperBitModUTiny ,&SQL_OperBitModSBig ,&SQL_OperBitModUBig ,&SQL_OperBitModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_STINYINT */ ,{ &SQL_OperSTinyModChar ,&SQL_OperSTinyModSShort ,&SQL_OperSTinyModUShort ,&SQL_OperSTinyModSLong ,&SQL_OperSTinyModULong ,&SQL_OperSTinyModFloat ,&SQL_OperSTinyModDouble ,&SQL_OperSTinyModBit ,&SQL_OperSTinyModSTiny ,&SQL_OperSTinyModUTiny ,&SQL_OperSTinyModSBig ,&SQL_OperSTinyModUBig ,&SQL_OperSTinyModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_UTINYINT */ ,{ &SQL_OperUTinyModChar ,&SQL_OperUTinyModSShort ,&SQL_OperUTinyModUShort ,&SQL_OperUTinyModSLong ,&SQL_OperUTinyModULong ,&SQL_OperUTinyModFloat ,&SQL_OperUTinyModDouble ,&SQL_OperUTinyModBit ,&SQL_OperUTinyModSTiny ,&SQL_OperUTinyModUTiny ,&SQL_OperUTinyModSBig ,&SQL_OperUTinyModUBig ,&SQL_OperUTinyModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_SBIGINT */ ,{ &SQL_OperSBigModChar ,&SQL_OperSBigModSShort ,&SQL_OperSBigModUShort ,&SQL_OperSBigModSLong ,&SQL_OperSBigModULong ,&SQL_OperSBigModFloat ,&SQL_OperSBigModDouble ,&SQL_OperSBigModBit ,&SQL_OperSBigModSTiny ,&SQL_OperSBigModUTiny ,&SQL_OperSBigModSBig ,&SQL_OperSBigModUBig ,&SQL_OperSBigModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_UBIGINT */ ,{ &SQL_OperUBigModChar ,&SQL_OperUBigModSShort ,&SQL_OperUBigModUShort ,&SQL_OperUBigModSLong ,&SQL_OperUBigModULong ,&SQL_OperUBigModFloat ,&SQL_OperUBigModDouble ,&SQL_OperUBigModBit ,&SQL_OperUBigModSTiny ,&SQL_OperUBigModUTiny ,&SQL_OperUBigModSBig ,&SQL_OperUBigModUBig ,&SQL_OperUBigModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_NUMERIC */ ,{ &SQL_OperNumModChar ,&SQL_OperNumModSShort ,&SQL_OperNumModUShort ,&SQL_OperNumModSLong ,&SQL_OperNumModULong ,&SQL_OperNumModFloat ,&SQL_OperNumModDouble ,&SQL_OperNumModBit ,&SQL_OperNumModSTiny ,&SQL_OperNumModUTiny ,&SQL_OperNumModSBig ,&SQL_OperNumModUBig ,&SQL_OperNumModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_GUID */ ,{ nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_BINARY */ ,{ nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_DATE */ ,{ nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_TIME */ ,{ nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_TIMESTAMP */ ,{ nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_INTERVAL_YM */ ,{ nullptr ,&SQL_OperIntYMModSShort ,&SQL_OperIntYMModUShort ,&SQL_OperIntYMModSLong ,&SQL_OperIntYMModULong ,&SQL_OperIntYMModFloat ,&SQL_OperIntYMModDouble ,&SQL_OperIntYMModBit ,&SQL_OperIntYMModSTiny ,&SQL_OperIntYMModUTiny ,&SQL_OperIntYMModSBig ,&SQL_OperIntYMModUBig ,&SQL_OperIntYMModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
/* CT_INTERVAL_DS */ ,{ nullptr ,&SQL_OperIntDSModSShort ,&SQL_OperIntDSModUShort ,&SQL_OperIntDSModSLong ,&SQL_OperIntDSModULong ,&SQL_OperIntDSModFloat ,&SQL_OperIntDSModDouble ,&SQL_OperIntDSModBit ,&SQL_OperIntDSModSTiny ,&SQL_OperIntDSModUTiny ,&SQL_OperIntDSModSBig ,&SQL_OperIntDSModUBig ,&SQL_OperIntDSModNum ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr ,nullptr }
};
// Modulo operator for SQLVariant
SQLVariant
SQLVariant::operator%(SQLVariant& p_right)
{
// If one of both is NULL, the result is false
if(IsNULL() || p_right.IsNULL())
{
return SQLVariant();
}
// Getting the concise type
SQLConciseType left = SQLTypeToConciseType(m_datatype);
SQLConciseType right = SQLTypeToConciseType(p_right.m_datatype);
// Check whether both datatypes are valid
if(left == CT_LAST || right == CT_LAST)
{
return SQLVariant();
}
// Check whether there is something to modulo by!
if(p_right.IsEmpty())
{
throw StdException("Cannot do a modulo by zero/empty");
}
// Find our comparison function
OperatorCalculate function = OperatorMod[left][right].function;
if(function)
{
return (*function)(*this,p_right);
}
// No compare function found
// Data types are not comparable
XString leftType = FindDatatype(m_datatype);
XString rightType = FindDatatype(p_right.m_datatype);
XString error;
error.Format("Cannot do the modulo operator on (%s % %s)",leftType.GetString(),rightType.GetString());
throw StdException(error);
}
SQLVariant&
SQLVariant::operator%=(SQLVariant& p_right)
{
// If one of both is NULL, the result is false
if(IsNULL() || p_right.IsNULL())
{
SetNULL();
return *this;
}
// Getting the concise type
SQLConciseType left = SQLTypeToConciseType(m_datatype);
SQLConciseType right = SQLTypeToConciseType(p_right.m_datatype);
// Check whether both datatypes are valid
if(left == CT_LAST || right == CT_LAST)
{
ThrowErrorOperator(SVO_AssignModulo);
}
// Find our comparison function
OperatorCalculate function = OperatorMod[left][right].function;
if(function)
{
*this = (*function)(*this,p_right);
return *this;
}
// No compare function found
// Data types are not comparable
XString leftType = FindDatatype(m_datatype);
XString rightType = FindDatatype(p_right.m_datatype);
XString error;
error.Format("Cannot do the %= operator on (%s + %s)",leftType.GetString(),rightType.GetString());
throw StdException(error);
}
// End of namespace
}
| 29.432561 | 415 | 0.731362 |
10338051e56fdd2c9a3ebe74e911bb9f3e9a0b7b | 40,813 | hpp | C++ | modules/cudaarithm/include/opencv2/cudaarithm.hpp | kim-ninh/opencv_contrib | 508c8db05e438635c84825629c069252bb53771a | [
"Apache-2.0"
] | null | null | null | modules/cudaarithm/include/opencv2/cudaarithm.hpp | kim-ninh/opencv_contrib | 508c8db05e438635c84825629c069252bb53771a | [
"Apache-2.0"
] | null | null | null | modules/cudaarithm/include/opencv2/cudaarithm.hpp | kim-ninh/opencv_contrib | 508c8db05e438635c84825629c069252bb53771a | [
"Apache-2.0"
] | null | null | null | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_CUDAARITHM_HPP
#define OPENCV_CUDAARITHM_HPP
#ifndef __cplusplus
# error cudaarithm.hpp header must be compiled as C++
#endif
#include "opencv2/core/cuda.hpp"
/**
@addtogroup cuda
@{
@defgroup cudaarithm Operations on Matrices
@{
@defgroup cudaarithm_core Core Operations on Matrices
@defgroup cudaarithm_elem Per-element Operations
@defgroup cudaarithm_reduce Matrix Reductions
@defgroup cudaarithm_arithm Arithm Operations on Matrices
@}
@}
*/
namespace cv { namespace cuda {
//! @addtogroup cudaarithm
//! @{
//! @addtogroup cudaarithm_elem
//! @{
/** @brief Computes a matrix-matrix or matrix-scalar sum.
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar. Matrix should have the same size and type as src1 .
@param dst Destination matrix that has the same size and number of channels as the input array(s).
The depth is defined by dtype or src1 depth.
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param dtype Optional depth of the output array.
@param stream Stream for the asynchronous version.
@sa add
*/
CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = noArray(), int dtype = -1, Stream& stream = Stream::Null());
/** @brief Computes a matrix-matrix or matrix-scalar difference.
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar. Matrix should have the same size and type as src1 .
@param dst Destination matrix that has the same size and number of channels as the input array(s).
The depth is defined by dtype or src1 depth.
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param dtype Optional depth of the output array.
@param stream Stream for the asynchronous version.
@sa subtract
*/
CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = noArray(), int dtype = -1, Stream& stream = Stream::Null());
/** @brief Computes a matrix-matrix or matrix-scalar per-element product.
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and number of channels as the input array(s).
The depth is defined by dtype or src1 depth.
@param scale Optional scale factor.
@param dtype Optional depth of the output array.
@param stream Stream for the asynchronous version.
@sa multiply
*/
CV_EXPORTS_W void multiply(InputArray src1, InputArray src2, OutputArray dst, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());
/** @brief Computes a matrix-matrix or matrix-scalar division.
@param src1 First source matrix or a scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and number of channels as the input array(s).
The depth is defined by dtype or src1 depth.
@param scale Optional scale factor.
@param dtype Optional depth of the output array.
@param stream Stream for the asynchronous version.
This function, in contrast to divide, uses a round-down rounding mode.
@sa divide
*/
CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());
/** @brief Computes per-element absolute difference of two matrices (or of a matrix and scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param stream Stream for the asynchronous version.
@sa absdiff
*/
CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes an absolute value of each matrix element.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
@sa abs
*/
CV_EXPORTS_W void abs(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes a square value of each matrix element.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void sqr(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes a square root of each matrix element.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
@sa sqrt
*/
CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes an exponent of each matrix element.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
@sa exp
*/
CV_EXPORTS_W void exp(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes a natural logarithm of absolute value of each matrix element.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
@sa log
*/
CV_EXPORTS_W void log(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Raises every matrix element to a power.
@param src Source matrix.
@param power Exponent of power.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
The function pow raises every element of the input matrix to power :
\f[\texttt{dst} (I) = \fork{\texttt{src}(I)^power}{if \texttt{power} is integer}{|\texttt{src}(I)|^power}{otherwise}\f]
@sa pow
*/
CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Compares elements of two matrices (or of a matrix and scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size as the input array(s) and type CV_8U.
@param cmpop Flag specifying the relation between the elements to be checked:
- **CMP_EQ:** a(.) == b(.)
- **CMP_GT:** a(.) \> b(.)
- **CMP_GE:** a(.) \>= b(.)
- **CMP_LT:** a(.) \< b(.)
- **CMP_LE:** a(.) \<= b(.)
- **CMP_NE:** a(.) != b(.)
@param stream Stream for the asynchronous version.
@sa compare
*/
CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop, Stream& stream = Stream::Null());
/** @brief Performs a per-element bitwise inversion.
@param src Source matrix.
@param dst Destination matrix with the same size and type as src .
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Performs a per-element bitwise disjunction of two matrices (or of matrix and scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Performs a per-element bitwise conjunction of two matrices (or of matrix and scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Performs a per-element bitwise exclusive or operation of two matrices (or of matrix and scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param mask Optional operation mask, 8-bit single channel array, that specifies elements of the
destination array to be changed. The mask can be used only with single channel images.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Performs pixel by pixel right shift of an image by a constant value.
@param src Source matrix. Supports 1, 3 and 4 channels images with integers elements.
@param val Constant values, one per channel.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS void rshift(InputArray src, Scalar_<int> val, OutputArray dst, Stream& stream = Stream::Null());
CV_WRAP inline void rshift(InputArray src, Scalar val, OutputArray dst, Stream& stream = Stream::Null()) {
rshift(src, Scalar_<int>(val), dst, stream);
}
/** @brief Performs pixel by pixel right left of an image by a constant value.
@param src Source matrix. Supports 1, 3 and 4 channels images with CV_8U , CV_16U or CV_32S
depth.
@param val Constant values, one per channel.
@param dst Destination matrix with the same size and type as src .
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS void lshift(InputArray src, Scalar_<int> val, OutputArray dst, Stream& stream = Stream::Null());
CV_WRAP inline void lshift(InputArray src, Scalar val, OutputArray dst, Stream& stream = Stream::Null()) {
lshift(src, Scalar_<int>(val), dst, stream);
}
/** @brief Computes the per-element minimum of two matrices (or a matrix and a scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param stream Stream for the asynchronous version.
@sa min
*/
CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes the per-element maximum of two matrices (or a matrix and a scalar).
@param src1 First source matrix or scalar.
@param src2 Second source matrix or scalar.
@param dst Destination matrix that has the same size and type as the input array(s).
@param stream Stream for the asynchronous version.
@sa max
*/
CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes the weighted sum of two arrays.
@param src1 First source array.
@param alpha Weight for the first array elements.
@param src2 Second source array of the same size and channel number as src1 .
@param beta Weight for the second array elements.
@param dst Destination array that has the same size and number of channels as the input arrays.
@param gamma Scalar added to each sum.
@param dtype Optional depth of the destination array. When both input arrays have the same depth,
dtype can be set to -1, which will be equivalent to src1.depth().
@param stream Stream for the asynchronous version.
The function addWeighted calculates the weighted sum of two arrays as follows:
\f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I)* \texttt{alpha} + \texttt{src2} (I)* \texttt{beta} + \texttt{gamma} )\f]
where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each
channel is processed independently.
@sa addWeighted
*/
CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst,
int dtype = -1, Stream& stream = Stream::Null());
//! adds scaled array to another one (dst = alpha*src1 + src2)
static inline void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst, Stream& stream = Stream::Null())
{
addWeighted(src1, alpha, src2, 1.0, 0.0, dst, -1, stream);
}
/** @brief Applies a fixed-level threshold to each array element.
@param src Source array (single-channel).
@param dst Destination array with the same size and type as src .
@param thresh Threshold value.
@param maxval Maximum value to use with THRESH_BINARY and THRESH_BINARY_INV threshold types.
@param type Threshold type. For details, see threshold . The THRESH_OTSU and THRESH_TRIANGLE
threshold types are not supported.
@param stream Stream for the asynchronous version.
@sa threshold
*/
CV_EXPORTS_W double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type, Stream& stream = Stream::Null());
/** @brief Checks if array elements lie between two scalars.
The function checks the range as follows:
- For every element of a single-channel input array:
\f[\texttt{dst} (I)= \texttt{lowerb}_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb}_0\f]
- For two-channel arrays:
\f[\texttt{dst} (I)= \texttt{lowerb}_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb}_0 \land \texttt{lowerb}_1 \leq \texttt{src} (I)_1 \leq \texttt{upperb}_1\f]
- and so forth.
That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the
specified 1D, 2D, 3D, ... box and 0 otherwise.
Note that unlike the CPU inRange, this does NOT accept an array for lowerb or
upperb, only a cv::Scalar.
@param src first input array.
@param lowerb inclusive lower boundary cv::Scalar.
@param upperb inclusive upper boundary cv::Scalar.
@param dst output array of the same size as src and CV_8U type.
@param stream Stream for the asynchronous version.
@sa cv::inRange
*/
CV_EXPORTS_W void inRange(InputArray src, const Scalar& lowerb, const Scalar& upperb, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Computes magnitudes of complex matrix elements.
@param xy Source complex matrix in the interleaved format ( CV_32FC2 ).
@param magnitude Destination matrix of float magnitudes ( CV_32FC1 ).
@param stream Stream for the asynchronous version.
@sa magnitude
*/
CV_EXPORTS_W void magnitude(InputArray xy, OutputArray magnitude, Stream& stream = Stream::Null());
/** @brief Computes squared magnitudes of complex matrix elements.
@param xy Source complex matrix in the interleaved format ( CV_32FC2 ).
@param magnitude Destination matrix of float magnitude squares ( CV_32FC1 ).
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void magnitudeSqr(InputArray xy, OutputArray magnitude, Stream& stream = Stream::Null());
/** @overload
computes magnitude of each (x(i), y(i)) vector
supports only floating-point source
@param x Source matrix containing real components ( CV_32FC1 ).
@param y Source matrix containing imaginary components ( CV_32FC1 ).
@param magnitude Destination matrix of float magnitudes ( CV_32FC1 ).
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude, Stream& stream = Stream::Null());
/** @overload
computes squared magnitude of each (x(i), y(i)) vector
supports only floating-point source
@param x Source matrix containing real components ( CV_32FC1 ).
@param y Source matrix containing imaginary components ( CV_32FC1 ).
@param magnitude Destination matrix of float magnitude squares ( CV_32FC1 ).
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void magnitudeSqr(InputArray x, InputArray y, OutputArray magnitude, Stream& stream = Stream::Null());
/** @brief Computes polar angles of complex matrix elements.
@param x Source matrix containing real components ( CV_32FC1 ).
@param y Source matrix containing imaginary components ( CV_32FC1 ).
@param angle Destination matrix of angles ( CV_32FC1 ).
@param angleInDegrees Flag for angles that must be evaluated in degrees.
@param stream Stream for the asynchronous version.
@sa phase
*/
CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees = false, Stream& stream = Stream::Null());
/** @brief Converts Cartesian coordinates into polar.
@param x Source matrix containing real components ( CV_32FC1 ).
@param y Source matrix containing imaginary components ( CV_32FC1 ).
@param magnitude Destination matrix of float magnitudes ( CV_32FC1 ).
@param angle Destination matrix of angles ( CV_32FC1 ).
@param angleInDegrees Flag for angles that must be evaluated in degrees.
@param stream Stream for the asynchronous version.
@sa cartToPolar
*/
CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees = false, Stream& stream = Stream::Null());
/** @brief Converts polar coordinates into Cartesian.
@param magnitude Source matrix containing magnitudes ( CV_32FC1 or CV_64FC1 ).
@param angle Source matrix containing angles ( same type as magnitude ).
@param x Destination matrix of real components ( same type as magnitude ).
@param y Destination matrix of imaginary components ( same type as magnitude ).
@param angleInDegrees Flag that indicates angles in degrees.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees = false, Stream& stream = Stream::Null());
//! @} cudaarithm_elem
//! @addtogroup cudaarithm_core
//! @{
/** @brief Makes a multi-channel matrix out of several single-channel matrices.
@param src Array/vector of source matrices.
@param n Number of source matrices.
@param dst Destination matrix.
@param stream Stream for the asynchronous version.
@sa merge
*/
CV_EXPORTS void merge(const GpuMat* src, size_t n, OutputArray dst, Stream& stream = Stream::Null());
/** @overload */
CV_EXPORTS_W void merge(const std::vector<GpuMat>& src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Copies each plane of a multi-channel matrix into an array.
@param src Source matrix.
@param dst Destination array/vector of single-channel matrices.
@param stream Stream for the asynchronous version.
@sa split
*/
CV_EXPORTS void split(InputArray src, GpuMat* dst, Stream& stream = Stream::Null());
/** @overload */
CV_EXPORTS_W void split(InputArray src, CV_OUT std::vector<GpuMat>& dst, Stream& stream = Stream::Null());
/** @brief Transposes a matrix.
@param src1 Source matrix. 1-, 4-, 8-byte element sizes are supported for now.
@param dst Destination matrix.
@param stream Stream for the asynchronous version.
@sa transpose
*/
CV_EXPORTS_W void transpose(InputArray src1, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Flips a 2D matrix around vertical, horizontal, or both axes.
@param src Source matrix. Supports 1, 3 and 4 channels images with CV_8U, CV_16U, CV_32S or
CV_32F depth.
@param dst Destination matrix.
@param flipCode Flip mode for the source:
- 0 Flips around x-axis.
- \> 0 Flips around y-axis.
- \< 0 Flips around both axes.
@param stream Stream for the asynchronous version.
@sa flip
*/
CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode, Stream& stream = Stream::Null());
/** @brief Base class for transform using lookup table.
*/
class CV_EXPORTS_W LookUpTable : public Algorithm
{
public:
/** @brief Transforms the source matrix into the destination matrix using the given look-up table:
dst(I) = lut(src(I)) .
@param src Source matrix. CV_8UC1 and CV_8UC3 matrices are supported for now.
@param dst Destination matrix.
@param stream Stream for the asynchronous version.
*/
CV_WRAP virtual void transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) = 0;
};
/** @brief Creates implementation for cuda::LookUpTable .
@param lut Look-up table of 256 elements. It is a continuous CV_8U matrix.
*/
CV_EXPORTS_W Ptr<LookUpTable> createLookUpTable(InputArray lut);
/** @brief Forms a border around an image.
@param src Source image. CV_8UC1 , CV_8UC4 , CV_32SC1 , and CV_32FC1 types are supported.
@param dst Destination image with the same type as src. The size is
Size(src.cols+left+right, src.rows+top+bottom) .
@param top Number of top pixels
@param bottom Number of bottom pixels
@param left Number of left pixels
@param right Number of pixels in each direction from the source image rectangle to extrapolate.
For example: top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs to be built.
@param borderType Border type. See borderInterpolate for details. BORDER_REFLECT101 ,
BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now.
@param value Border value.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void copyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType,
Scalar value = Scalar(), Stream& stream = Stream::Null());
//! @} cudaarithm_core
//! @addtogroup cudaarithm_reduce
//! @{
/** @brief Returns the norm of a matrix (or difference of two matrices).
@param src1 Source matrix. Any matrices except 64F are supported.
@param normType Norm type. NORM_L1 , NORM_L2 , and NORM_INF are supported for now.
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
@sa norm
*/
CV_EXPORTS_W double norm(InputArray src1, int normType, InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void calcNorm(InputArray src, OutputArray dst, int normType, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Returns the difference of two matrices.
@param src1 Source matrix. Any matrices except 64F are supported.
@param src2 Second source matrix (if any) with the same size and type as src1.
@param normType Norm type. NORM_L1 , NORM_L2 , and NORM_INF are supported for now.
@sa norm
*/
CV_EXPORTS_W double norm(InputArray src1, InputArray src2, int normType=NORM_L2);
/** @overload */
CV_EXPORTS_W void calcNormDiff(InputArray src1, InputArray src2, OutputArray dst, int normType=NORM_L2, Stream& stream = Stream::Null());
/** @brief Returns the sum of matrix elements.
@param src Source image of any depth except for CV_64F .
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
@sa sum
*/
CV_EXPORTS_W Scalar sum(InputArray src, InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void calcSum(InputArray src, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Returns the sum of absolute values for matrix elements.
@param src Source image of any depth except for CV_64F .
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
*/
CV_EXPORTS_W Scalar absSum(InputArray src, InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void calcAbsSum(InputArray src, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Returns the squared sum of matrix elements.
@param src Source image of any depth except for CV_64F .
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
*/
CV_EXPORTS_W Scalar sqrSum(InputArray src, InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void calcSqrSum(InputArray src, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Finds global minimum and maximum matrix elements and returns their values.
@param src Single-channel source image.
@param minVal Pointer to the returned minimum value. Use NULL if not required.
@param maxVal Pointer to the returned maximum value. Use NULL if not required.
@param mask Optional mask to select a sub-matrix.
The function does not work with CV_64F images on GPUs with the compute capability \< 1.3.
@sa minMaxLoc
*/
CV_EXPORTS_W void minMax(InputArray src, double* minVal, double* maxVal, InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void findMinMax(InputArray src, OutputArray dst, InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Finds global minimum and maximum matrix elements and returns their values with locations.
@param src Single-channel source image.
@param minVal Pointer to the returned minimum value. Use NULL if not required.
@param maxVal Pointer to the returned maximum value. Use NULL if not required.
@param minLoc Pointer to the returned minimum location. Use NULL if not required.
@param maxLoc Pointer to the returned maximum location. Use NULL if not required.
@param mask Optional mask to select a sub-matrix.
The function does not work with CV_64F images on GPU with the compute capability \< 1.3.
@sa minMaxLoc
*/
CV_EXPORTS_W void minMaxLoc(InputArray src, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc,
InputArray mask = noArray());
/** @overload */
CV_EXPORTS_W void findMinMaxLoc(InputArray src, OutputArray minMaxVals, OutputArray loc,
InputArray mask = noArray(), Stream& stream = Stream::Null());
/** @brief Counts non-zero matrix elements.
@param src Single-channel source image.
The function does not work with CV_64F images on GPUs with the compute capability \< 1.3.
@sa countNonZero
*/
CV_EXPORTS_W int countNonZero(InputArray src);
/** @overload */
CV_EXPORTS_W void countNonZero(InputArray src, OutputArray dst, Stream& stream = Stream::Null());
/** @brief Reduces a matrix to a vector.
@param mtx Source 2D matrix.
@param vec Destination vector. Its size and type is defined by dim and dtype parameters.
@param dim Dimension index along which the matrix is reduced. 0 means that the matrix is reduced
to a single row. 1 means that the matrix is reduced to a single column.
@param reduceOp Reduction operation that could be one of the following:
- **REDUCE_SUM** The output is the sum of all rows/columns of the matrix.
- **REDUCE_AVG** The output is the mean vector of all rows/columns of the matrix.
- **REDUCE_MAX** The output is the maximum (column/row-wise) of all rows/columns of the
matrix.
- **REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the
matrix.
@param dtype When it is negative, the destination vector will have the same type as the source
matrix. Otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels()) .
@param stream Stream for the asynchronous version.
The function reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
1D vectors and performing the specified operation on the vectors until a single row/column is
obtained. For example, the function can be used to compute horizontal and vertical projections of a
raster image. In case of REDUCE_SUM and REDUCE_AVG , the output may have a larger element
bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction
modes.
@sa reduce
*/
CV_EXPORTS_W void reduce(InputArray mtx, OutputArray vec, int dim, int reduceOp, int dtype = -1, Stream& stream = Stream::Null());
/** @brief Computes a mean value and a standard deviation of matrix elements.
@param src Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
@param dst Target GpuMat with size 1x2 and type CV_64FC1. The first value is mean, the second - stddev.
@param mask Operation mask.
@param stream Stream for the asynchronous version.
@sa meanStdDev
*/
CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray dst, InputArray mask, Stream& stream = Stream::Null());
/** @overload
@param mtx Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
@param dst Target GpuMat with size 1x2 and type CV_64FC1. The first value is mean, the second - stddev.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void meanStdDev(InputArray mtx, OutputArray dst, Stream& stream = Stream::Null());
/** @overload
@param src Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
@param mean Mean value.
@param stddev Standard deviation value.
@param mask Operation mask.
*/
CV_EXPORTS_W void meanStdDev(InputArray src, CV_OUT Scalar& mean, CV_OUT Scalar& stddev, InputArray mask);
/** @overload
@param mtx Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
@param mean Mean value.
@param stddev Standard deviation value.
*/
CV_EXPORTS_W void meanStdDev(InputArray mtx, CV_OUT Scalar& mean, CV_OUT Scalar& stddev);
/** @brief Computes a standard deviation of integral images.
@param src Source image. Only the CV_32SC1 type is supported.
@param sqr Squared source image. Only the CV_32FC1 type is supported.
@param dst Destination image with the same type and size as src.
@param rect Rectangular window.
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void rectStdDev(InputArray src, InputArray sqr, OutputArray dst, Rect rect, Stream& stream = Stream::Null());
/** @brief Normalizes the norm or value range of an array.
@param src Input array.
@param dst Output array of the same size as src .
@param alpha Norm value to normalize to or the lower range boundary in case of the range
normalization.
@param beta Upper range boundary in case of the range normalization; it is not used for the norm
normalization.
@param norm_type Normalization type ( NORM_MINMAX , NORM_L2 , NORM_L1 or NORM_INF ).
@param dtype When negative, the output array has the same type as src; otherwise, it has the same
number of channels as src and the depth =CV_MAT_DEPTH(dtype).
@param mask Optional operation mask.
@param stream Stream for the asynchronous version.
@sa normalize
*/
CV_EXPORTS_W void normalize(InputArray src, OutputArray dst, double alpha, double beta,
int norm_type, int dtype, InputArray mask = noArray(),
Stream& stream = Stream::Null());
/** @brief Computes an integral image.
@param src Source image. Only CV_8UC1 images are supported for now.
@param sum Integral image containing 32-bit unsigned integer values packed into CV_32SC1 .
@param stream Stream for the asynchronous version.
@sa integral
*/
CV_EXPORTS_W void integral(InputArray src, OutputArray sum, Stream& stream = Stream::Null());
/** @brief Computes a squared integral image.
@param src Source image. Only CV_8UC1 images are supported for now.
@param sqsum Squared integral image containing 64-bit unsigned integer values packed into
CV_64FC1 .
@param stream Stream for the asynchronous version.
*/
CV_EXPORTS_W void sqrIntegral(InputArray src, OutputArray sqsum, Stream& stream = Stream::Null());
//! @} cudaarithm_reduce
//! @addtogroup cudaarithm_arithm
//! @{
/** @brief Performs generalized matrix multiplication.
@param src1 First multiplied input matrix that should have CV_32FC1 , CV_64FC1 , CV_32FC2 , or
CV_64FC2 type.
@param src2 Second multiplied input matrix of the same type as src1 .
@param alpha Weight of the matrix product.
@param src3 Third optional delta matrix added to the matrix product. It should have the same type
as src1 and src2 .
@param beta Weight of src3 .
@param dst Destination matrix. It has the proper size and the same type as input matrices.
@param flags Operation flags:
- **GEMM_1_T** transpose src1
- **GEMM_2_T** transpose src2
- **GEMM_3_T** transpose src3
@param stream Stream for the asynchronous version.
The function performs generalized matrix multiplication similar to the gemm functions in BLAS level
3. For example, gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T) corresponds to
\f[\texttt{dst} = \texttt{alpha} \cdot \texttt{src1} ^T \cdot \texttt{src2} + \texttt{beta} \cdot \texttt{src3} ^T\f]
@note Transposition operation doesn't support CV_64FC2 input type.
@sa gemm
*/
CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
InputArray src3, double beta, OutputArray dst, int flags = 0, Stream& stream = Stream::Null());
/** @brief Performs a per-element multiplication of two Fourier spectrums.
@param src1 First spectrum.
@param src2 Second spectrum with the same size and type as a .
@param dst Destination spectrum.
@param flags Mock parameter used for CPU/CUDA interfaces similarity.
@param conjB Optional flag to specify if the second spectrum needs to be conjugated before the
multiplication.
@param stream Stream for the asynchronous version.
Only full (not packed) CV_32FC2 complex spectrums in the interleaved format are supported for now.
@sa mulSpectrums
*/
CV_EXPORTS_W void mulSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, bool conjB=false, Stream& stream = Stream::Null());
/** @brief Performs a per-element multiplication of two Fourier spectrums and scales the result.
@param src1 First spectrum.
@param src2 Second spectrum with the same size and type as a .
@param dst Destination spectrum.
@param flags Mock parameter used for CPU/CUDA interfaces similarity, simply add a `0` value.
@param scale Scale constant.
@param conjB Optional flag to specify if the second spectrum needs to be conjugated before the
multiplication.
@param stream Stream for the asynchronous version.
Only full (not packed) CV_32FC2 complex spectrums in the interleaved format are supported for now.
@sa mulSpectrums
*/
CV_EXPORTS_W void mulAndScaleSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, float scale, bool conjB=false, Stream& stream = Stream::Null());
/** @brief Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.
@param src Source matrix (real or complex).
@param dst Destination matrix (real or complex).
@param dft_size Size of a discrete Fourier transform.
@param flags Optional flags:
- **DFT_ROWS** transforms each individual row of the source matrix.
- **DFT_SCALE** scales the result: divide it by the number of elements in the transform
(obtained from dft_size ).
- **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real
cases are always forward and inverse, respectively).
- **DFT_COMPLEX_INPUT** Specifies that input is complex input with 2 channels.
- **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of
real-complex transform, so the destination matrix must be real.
@param stream Stream for the asynchronous version.
Use to handle real matrices ( CV32FC1 ) and complex matrices in the interleaved format ( CV32FC2 ).
The source matrix should be continuous, otherwise reallocation and data copying is performed. The
function chooses an operation mode depending on the flags, size, and channel count of the source
matrix:
- If the source matrix is complex and the output is not specified as real, the destination
matrix is complex and has the dft_size size and CV_32FC2 type. The destination matrix
contains a full result of the DFT (forward or inverse).
- If the source matrix is complex and the output is specified as real, the function assumes that
its input is the result of the forward transform (see the next item). The destination matrix
has the dft_size size and CV_32FC1 type. It contains the result of the inverse DFT.
- If the source matrix is real (its type is CV_32FC1 ), forward DFT is performed. The result of
the DFT is packed into complex ( CV_32FC2 ) matrix. So, the width of the destination matrix
is dft_size.width / 2 + 1 . But if the source is a single column, the height is reduced
instead of the width.
@sa dft
*/
CV_EXPORTS_W void dft(InputArray src, OutputArray dst, Size dft_size, int flags=0, Stream& stream = Stream::Null());
/** @brief Base class for DFT operator as a cv::Algorithm. :
*/
class CV_EXPORTS_W DFT : public Algorithm
{
public:
/** @brief Computes an FFT of a given image.
@param image Source image. Only CV_32FC1 images are supported for now.
@param result Result image.
@param stream Stream for the asynchronous version.
*/
CV_WRAP virtual void compute(InputArray image, OutputArray result, Stream& stream = Stream::Null()) = 0;
};
/** @brief Creates implementation for cuda::DFT.
@param dft_size The image size.
@param flags Optional flags:
- **DFT_ROWS** transforms each individual row of the source matrix.
- **DFT_SCALE** scales the result: divide it by the number of elements in the transform
(obtained from dft_size ).
- **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real
cases are always forward and inverse, respectively).
- **DFT_COMPLEX_INPUT** Specifies that inputs will be complex with 2 channels.
- **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of
real-complex transform, so the destination matrix must be real.
*/
CV_EXPORTS_W Ptr<DFT> createDFT(Size dft_size, int flags);
/** @brief Base class for convolution (or cross-correlation) operator. :
*/
class CV_EXPORTS_W Convolution : public Algorithm
{
public:
/** @brief Computes a convolution (or cross-correlation) of two images.
@param image Source image. Only CV_32FC1 images are supported for now.
@param templ Template image. The size is not greater than the image size. The type is the same as
image .
@param result Result image. If image is *W x H* and templ is *w x h*, then result must be *W-w+1 x
H-h+1*.
@param ccorr Flags to evaluate cross-correlation instead of convolution.
@param stream Stream for the asynchronous version.
*/
CV_WRAP virtual void convolve(InputArray image, InputArray templ, OutputArray result, bool ccorr = false, Stream& stream = Stream::Null()) = 0;
};
/** @brief Creates implementation for cuda::Convolution .
@param user_block_size Block size. If you leave default value Size(0,0) then automatic
estimation of block size will be used (which is optimized for speed). By varying user_block_size
you can reduce memory requirements at the cost of speed.
*/
CV_EXPORTS_W Ptr<Convolution> createConvolution(Size user_block_size = Size());
//! @} cudaarithm_arithm
//! @} cudaarithm
}} // namespace cv { namespace cuda {
#endif /* OPENCV_CUDAARITHM_HPP */
| 43.884946 | 168 | 0.754613 |
103490c319bee3ecb7ef0edf99657bc3c4c01e69 | 4,807 | cpp | C++ | 03_Tutorial/T02_XMCocos2D/Source/Test/TestChipmunk/DemoQuery.cpp | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2017-08-03T07:15:00.000Z | 2018-06-18T10:32:53.000Z | 03_Tutorial/T02_XMCocos2D/Source/Test/TestChipmunk/DemoQuery.cpp | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | null | null | null | 03_Tutorial/T02_XMCocos2D/Source/Test/TestChipmunk/DemoQuery.cpp | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2019-03-04T22:57:42.000Z | 2020-03-06T01:32:26.000Z | /* --------------------------------------------------------------------------
*
* File DemoQuery.cpp
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft.
* Copyright (c) 2010-2013 cocos2d-x.org
* Copyright (c) 2007 Scott Lembcke. All rights reserved.
*
* http://www.cocos2d-x.org
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or ( at your option ) any later version.
*
* This 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 along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#include "Precompiled.h"
#include "../TestChipmunk2.h"
#include "XMChipmunk/chipmunk_unsafe.h"
static cpSpace* space;
static cpVect mousePoint;
cpShape* querySeg = KD_NULL;
static KDvoid update ( KDint ticks )
{
messageString[0] = '\0';
cpVect start = cpvzero;
cpVect end = /*cpv ( 0, 85 );//*/mousePoint;
cpVect lineEnd = end;
{
KDchar infoString[1024];
kdSprintfKHR ( infoString, "Query: Dist ( %f ) Point%s, ", cpvdist ( start, end ), cpvstr ( end ) );
kdStrcat ( messageString, infoString );
}
cpSegmentQueryInfo info = { };
if ( cpSpaceSegmentQueryFirst ( space, start, end, CP_ALL_LAYERS, CP_NO_GROUP, &info ) )
{
cpVect point = cpSegmentQueryHitPoint ( start, end, info );
lineEnd = cpvadd ( point, cpvzero );//cpvmult ( info.n, 4.0f ) );
KDchar infoString[1024];
kdSprintfKHR ( infoString, "Segment Query: Dist ( %f ) Normal%s", cpSegmentQueryHitDist ( start, end, info ), cpvstr ( info.n ) );
kdStrcat ( messageString, infoString );
} else
{
kdStrcat ( messageString, "Segment Query ( None )" );
}
cpSegmentShapeSetEndpoints ( querySeg, cpvzero, lineEnd );
// force it to update it's collision detection data so it will draw
cpShapeUpdate ( querySeg, cpvzero, cpv ( 1.0f, 0.0f ) );
// normal other stuff.
KDint steps = 1;
cpFloat dt = 1.0f / 60.0f / (cpFloat) steps;
for ( KDint i = 0; i < steps; i++ )
{
cpSpaceStep ( space, dt );
}
}
static cpSpace* init ( KDvoid )
{
cpResetShapeIdCounter ( );
space = cpSpaceNew ( );
space->iterations = 5;
cpBody* staticBody = space->staticBody;
cpShape* shape;
// add a non-collidable segment as a quick and dirty way to draw the query line
shape = cpSpaceAddShape ( space, cpSegmentShapeNew ( staticBody, cpvzero, cpv ( 100.0f, 0.0f ), 4.0f ) );
shape->layers = 0;
querySeg = shape;
{ // add a fat segment
cpFloat mass = 1.0f;
cpFloat length = 100.0f;
cpVect a = cpv ( -length / 2.0f, 0.0f ), b = cpv ( length / 2.0f, 0.0f );
cpBody *body = cpSpaceAddBody ( space, cpBodyNew ( mass, cpMomentForSegment ( mass, a, b ) ) );
body->p = cpv ( 0.0f, 100.0f );
cpSpaceAddShape ( space, cpSegmentShapeNew ( body, a, b, 20.0f ) );
}
{ // add a static segment
cpSpaceAddShape ( space, cpSegmentShapeNew ( staticBody, cpv ( 0, 300 ), cpv ( 300, 0 ), 0.0f ) );
}
{ // add a pentagon
cpFloat mass = 1.0f;
const KDint NUM_VERTS = 5;
cpVect verts[NUM_VERTS];
for ( KDint i=0; i<NUM_VERTS; i++ )
{
cpFloat angle = -2 * KD_PI_F * i / ( NUM_VERTS );
verts[i] = cpv ( 30.f * cpfcos ( angle ), 30.f * cpfsin ( angle ) );
}
cpBody* body = cpSpaceAddBody ( space, cpBodyNew ( mass, cpMomentForPoly ( mass, NUM_VERTS, verts, cpvzero ) ) );
body->p = cpv ( 50.0f, 50.0f );
cpSpaceAddShape ( space, cpPolyShapeNew ( body, NUM_VERTS, verts, cpvzero ) );
}
{ // add a circle
cpFloat mass = 1.0f;
cpFloat r = 20.0f;
cpBody *body = cpSpaceAddBody ( space, cpBodyNew ( mass, cpMomentForCircle ( mass, 0.0f, r, cpvzero ) ) );
body->p = cpv ( 100.0f, 100.0f );
cpSpaceAddShape ( space, cpCircleShapeNew ( body, r, cpvzero ) );
}
return space;
}
static KDvoid destroy ( KDvoid )
{
ChipmunkDemoFreeSpaceChildren ( space );
cpSpaceFree ( space );
}
chipmunkDemo Query =
{
"Segment Query",
KD_NULL,
init,
update,
destroy,
};
| 30.424051 | 132 | 0.59871 |
10355833527765e13469d60529d98fa361566338 | 7,667 | cc | C++ | test/utils/test_type_list.cc | devbrain/neutrino | 5e7cd7c93b5c264a5f1da6ae88312e14253de10d | [
"Apache-2.0"
] | null | null | null | test/utils/test_type_list.cc | devbrain/neutrino | 5e7cd7c93b5c264a5f1da6ae88312e14253de10d | [
"Apache-2.0"
] | null | null | null | test/utils/test_type_list.cc | devbrain/neutrino | 5e7cd7c93b5c264a5f1da6ae88312e14253de10d | [
"Apache-2.0"
] | null | null | null | #include <string>
#include <vector>
#include <type_traits>
#include <neutrino/utils/mp/typelist.hh>
#include <doctest/doctest.h>
using namespace neutrino::mp;
TEST_CASE("Test typelist size")
{
using t0 = type_list<>;
using t1 = type_list<int>;
using t2 = type_list<int, float>;
using t3 = type_list<int, int>;
REQUIRE((t0::size() == 0));
REQUIRE((t1::size() == 1));
REQUIRE((t2::size() == 2));
REQUIRE((t3::size() == 2));
}
TEST_CASE("Test type_at")
{
using t = type_list<int, float, bool>;
REQUIRE(std::is_same_v<int, type_list_at_t<0, t>>);
REQUIRE(std::is_same_v<float, type_list_at_t<1, t>>);
REQUIRE(std::is_same_v<bool, type_list_at_t<2, t>>);
}
TEST_CASE("Test append")
{
using t0 = type_list<>;
using t0_1 = type_list_append_t <int, t0>;
using t1 = type_list_append_t <float, t0_1>;
using t2 = type_list_append_t <bool, t1>;
REQUIRE(t0_1::size() == 1);
REQUIRE(std::is_same_v<int, type_list_at_t<0, t0_1>>);
REQUIRE(t1::size() == 2);
REQUIRE(std::is_same_v<float, type_list_at_t<1, t1>>);
REQUIRE(t2::size() == 3);
REQUIRE(std::is_same_v<bool, type_list_at_t<2, t2>>);
}
TEST_CASE("Test prepend")
{
using t0 = type_list<>;
using t0_1 = type_list_prepend_t <int, t0>;
using t1 = type_list_prepend_t <float, t0_1>;
using t2 = type_list_prepend_t <bool, t1>;
REQUIRE(t0_1::size() == 1);
REQUIRE(std::is_same_v<int, type_list_at_t<0, t0_1>>);
REQUIRE((t1::size() == 2));
REQUIRE(std::is_same_v<float, type_list_at_t<0, t1>>);
REQUIRE(std::is_same_v<int, type_list_at_t<1, t1>>);
REQUIRE((t2::size() == 3));
REQUIRE(std::is_same_v<bool, type_list_at_t<0, t2>>);
REQUIRE(std::is_same_v<float, type_list_at_t<1, t2>>);
REQUIRE(std::is_same_v<int, type_list_at_t<2, t2>>);
}
TEST_CASE("Test merge")
{
using t0 = type_list<>;
using t1 = type_list<int>;
using t10 = type_list_merge_t<t0, t1>;
REQUIRE((t10::size() == 1));
REQUIRE(std::is_same_v<int, type_list_at_t<0, t10>>);
using t2 = type_list<bool, float>;
using t102 = type_list_merge_t<t10, t2>;
REQUIRE((t102::size() == 3));
REQUIRE(std::is_same_v<int, type_list_at_t<0, t102>>);
REQUIRE(std::is_same_v<bool, type_list_at_t<1, t102>>);
REQUIRE(std::is_same_v<float, type_list_at_t<2, t102>>);
}
template <typename T>
struct is_integral
{
static constexpr bool value() noexcept
{
return std::is_integral <T>::value;
}
};
TEST_CASE("Test filter")
{
using t1 = type_list <int, bool, float, std::string, std::vector <int>>;
using t2 = type_list_filter_t<is_integral, t1>;
REQUIRE((t2::size() == 2));
REQUIRE(std::is_same_v<int, type_list_at_t<0, t2>>);
REQUIRE(std::is_same_v<bool, type_list_at_t<1, t2>>);
using t0 = type_list <float, std::string, std::vector <int>>;
using t01 = type_list_filter_t<is_integral, t0>;
REQUIRE((t01::empty()));
using t00 = type_list <>;
using t001 = type_list_filter_t<is_integral, t00>;
REQUIRE((t001::empty()));
}
template <typename X>
struct map
{
using type = std::vector<X>;
};
TEST_CASE("Test mapper")
{
using t1 = type_list <int, bool, float>;
using t2 = type_list_map_t<map, t1>;
REQUIRE((t2::size() == 3));
REQUIRE(std::is_same_v<std::vector<int>, type_list_at_t<0, t2>>);
REQUIRE(std::is_same_v<std::vector<bool>, type_list_at_t<1, t2>>);
REQUIRE(std::is_same_v<std::vector<float>, type_list_at_t<2, t2>>);
using t0 = type_list <>;
using t01 = type_list_map_t<map, t0>;
REQUIRE((t01::empty()));
}
TEST_CASE("Test to_tuple")
{
using t1 = type_list <int, bool, float>;
using t = type_list_to_tuple_t<t1>;
REQUIRE(std::is_same_v<typename std::tuple_element<0, t>::type, int>);
REQUIRE(std::is_same_v<typename std::tuple_element<1, t>::type, bool>);
REQUIRE(std::is_same_v<typename std::tuple_element<2, t>::type, float>);
}
TEST_CASE("Test from_tuple")
{
using t1 = std::tuple <int, bool, float>;
using t = tuple_to_type_list_t<t1>;
REQUIRE(std::is_same_v<type_list_at_t<0, t>, int>);
REQUIRE(std::is_same_v<type_list_at_t<1, t>, bool>);
REQUIRE(std::is_same_v<type_list_at_t<2, t>, float>);
}
TEST_CASE("Test find_first")
{
using t = type_list <int, bool, float>;
constexpr auto idx = type_list_find_first_v<bool, t>;
constexpr auto idx0 = type_list_find_first_v<char, t>;
REQUIRE(idx == 1);
REQUIRE(idx0 == t::npos);
using t1 = type_list <int, bool, bool, float>;
constexpr auto idx1 = type_list_find_first_v<bool, t1>;
constexpr auto idx01 = type_list_find_first_v<char, t1>;
REQUIRE(idx1 == 1);
REQUIRE(idx01 == t::npos);
}
TEST_CASE("Test find_last")
{
using t = type_list <int, bool, float>;
constexpr auto idx = type_list_find_last_v<bool, t>;
constexpr auto idx0 = type_list_find_last_v<char, t>;
REQUIRE(idx == 1);
REQUIRE(idx0 == t::npos);
using t1 = type_list <int, bool, bool, float>;
constexpr auto idx1 = type_list_find_last_v<bool, t1>;
constexpr auto idx01 = type_list_find_last_v<char, t1>;
REQUIRE(idx1 == 2);
REQUIRE(idx01 == t::npos);
}
TEST_CASE("Test repeat")
{
using t = type_list_repeat_t<int, 10>;
REQUIRE((t::size () == 10));
REQUIRE(std::is_same_v<int, type_list_at_t<0, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<1, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<2, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<3, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<4, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<5, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<6, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<7, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<8, t>>);
REQUIRE(std::is_same_v<int, type_list_at_t<9, t>>);
}
TEST_CASE("Test flatten")
{
using Types = type_list<int, type_list<float, type_list<double, type_list<char>>>>;
using Flat = type_list_flatten_t<Types>;
static_assert(std::is_same_v<Flat, type_list<int, float, double, char>>, "Not the same");
}
TEST_CASE("contains type")
{
using A = type_list<int, float, char>;
using B = type_list<float>;
using C = type_list<double>;
static_assert(type_list_contains_types_v<A, B>);
static_assert(type_list_contains_types_v<A, A>);
static_assert(!type_list_contains_types_v<A, C>);
}
TEST_CASE("is_subset1")
{
using t1 = std::tuple<int, double>;
using t2 = std::tuple<double, int>;
using t3 = std::tuple<int, double, char>;
static_assert(is_subset_of_v<t1, t1>, "err");
static_assert(is_subset_of_v<t1, t2>, "err");
static_assert(is_subset_of_v<t2, t1>, "err");
static_assert(is_subset_of_v<t2, t3>, "err");
static_assert(!is_subset_of_v<t3, t2>, "err");
}
TEST_CASE("is_subset2")
{
using t1 = std::index_sequence <0, 1>;
using t2 = std::index_sequence <1, 0>;
using t3 = std::index_sequence <0, 1, 2>;
static_assert(is_subset_of_v<t1, t1>, "err");
static_assert(is_subset_of_v<t1, t2>, "err");
static_assert(is_subset_of_v<t2, t1>, "err");
static_assert(is_subset_of_v<t2, t3>, "err");
static_assert(!is_subset_of_v<t3, t2>, "err");
}
TEST_CASE("is_subset3")
{
using t1 = type_list<int, double>;
using t2 = type_list<double, int>;
using t3 = type_list<int, double, char>;
static_assert(is_subset_of_v<t1, t1>, "err");
static_assert(is_subset_of_v<t1, t2>, "err");
static_assert(is_subset_of_v<t2, t1>, "err");
static_assert(is_subset_of_v<t2, t3>, "err");
static_assert(!is_subset_of_v<t3, t2>, "err");
}
| 29.375479 | 93 | 0.651885 |
1035ac7a03bacc05c2ec548c27f17140a9314a98 | 6,057 | inl | C++ | iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl | xiao6768/iceoryx | f99e0c3b5168dcde7f0d7bb99226c7faca01db69 | [
"Apache-2.0"
] | 1 | 2021-03-04T12:47:12.000Z | 2021-03-04T12:47:12.000Z | iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl | xiao6768/iceoryx | f99e0c3b5168dcde7f0d7bb99226c7faca01db69 | [
"Apache-2.0"
] | 1 | 2021-06-14T12:07:47.000Z | 2021-06-17T13:43:41.000Z | iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl | boschglobal/iceoryx | eb0256407e3cf0baed1efdee6f8eeacf4d3514da | [
"Apache-2.0"
] | null | null | null | // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI 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.
//
// SPDX-License-Identifier: Apache-2.0
#ifndef IOX_POSH_MEPOO_MEPOO_SEGMENT_INL
#define IOX_POSH_MEPOO_MEPOO_SEGMENT_INL
#include "iceoryx_hoofs/error_handling/error_handling.hpp"
#include "iceoryx_hoofs/internal/relocatable_pointer/relative_pointer.hpp"
#include "iceoryx_posh/internal/log/posh_logging.hpp"
#include "iceoryx_posh/mepoo/memory_info.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
namespace iox
{
namespace mepoo
{
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline MePooSegment<SharedMemoryObjectType, MemoryManagerType>::MePooSegment(
const MePooConfig& mempoolConfig,
posix::Allocator& managementAllocator,
const posix::PosixGroup& readerGroup,
const posix::PosixGroup& writerGroup,
const iox::mepoo::MemoryInfo& memoryInfo) noexcept
: m_sharedMemoryObject(std::move(createSharedMemoryObject(mempoolConfig, writerGroup)))
, m_readerGroup(readerGroup)
, m_writerGroup(writerGroup)
, m_memoryInfo(memoryInfo)
{
using namespace posix;
AccessController accessController;
if (!(readerGroup == writerGroup))
{
accessController.addPermissionEntry(
AccessController::Category::SPECIFIC_GROUP, AccessController::Permission::READ, readerGroup.getName());
}
accessController.addPermissionEntry(
AccessController::Category::SPECIFIC_GROUP, AccessController::Permission::READWRITE, writerGroup.getName());
accessController.addPermissionEntry(AccessController::Category::USER, AccessController::Permission::READWRITE);
accessController.addPermissionEntry(AccessController::Category::GROUP, AccessController::Permission::READWRITE);
accessController.addPermissionEntry(AccessController::Category::OTHERS, AccessController::Permission::NONE);
if (!accessController.writePermissionsToFile(m_sharedMemoryObject.getFileHandle()))
{
errorHandler(Error::kMEPOO__SEGMENT_COULD_NOT_APPLY_POSIX_RIGHTS_TO_SHARED_MEMORY);
}
m_memoryManager.configureMemoryManager(mempoolConfig, managementAllocator, *m_sharedMemoryObject.getAllocator());
m_sharedMemoryObject.finalizeAllocation();
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline SharedMemoryObjectType MePooSegment<SharedMemoryObjectType, MemoryManagerType>::createSharedMemoryObject(
const MePooConfig& mempoolConfig, const posix::PosixGroup& writerGroup) noexcept
{
// we let the OS decide where to map the shm segments
constexpr void* BASE_ADDRESS_HINT{nullptr};
// on qnx the current working directory will be added to the /dev/shmem path if the leading slash is missing
constexpr char SHARED_MEMORY_NAME_PREFIX[] = "/";
posix::SharedMemory::Name_t shmName = SHARED_MEMORY_NAME_PREFIX + writerGroup.getName();
return std::move(
SharedMemoryObjectType::create(shmName,
MemoryManager::requiredChunkMemorySize(mempoolConfig),
posix::AccessMode::READ_WRITE,
posix::OwnerShip::MINE,
BASE_ADDRESS_HINT,
static_cast<mode_t>(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP))
.and_then([this](auto& sharedMemoryObject) {
this->setSegmentId(iox::rp::BaseRelativePointer::registerPtr(sharedMemoryObject.getBaseAddress(),
sharedMemoryObject.getSizeInBytes()));
LogDebug() << "Roudi registered payload data segment "
<< iox::log::HexFormat(reinterpret_cast<uint64_t>(sharedMemoryObject.getBaseAddress()))
<< " with size " << sharedMemoryObject.getSizeInBytes() << " to id " << m_segmentId;
})
.or_else([](auto&) { errorHandler(Error::kMEPOO__SEGMENT_UNABLE_TO_CREATE_SHARED_MEMORY_OBJECT); })
.value());
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline posix::PosixGroup MePooSegment<SharedMemoryObjectType, MemoryManagerType>::getWriterGroup() const noexcept
{
return m_writerGroup;
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline posix::PosixGroup MePooSegment<SharedMemoryObjectType, MemoryManagerType>::getReaderGroup() const noexcept
{
return m_readerGroup;
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline MemoryManagerType& MePooSegment<SharedMemoryObjectType, MemoryManagerType>::getMemoryManager() noexcept
{
return m_memoryManager;
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline const SharedMemoryObjectType&
MePooSegment<SharedMemoryObjectType, MemoryManagerType>::getSharedMemoryObject() const noexcept
{
return m_sharedMemoryObject;
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline uint64_t MePooSegment<SharedMemoryObjectType, MemoryManagerType>::getSegmentId() const noexcept
{
return m_segmentId;
}
template <typename SharedMemoryObjectType, typename MemoryManagerType>
inline void MePooSegment<SharedMemoryObjectType, MemoryManagerType>::setSegmentId(const uint64_t segmentId) noexcept
{
m_segmentId = segmentId;
}
} // namespace mepoo
} // namespace iox
#endif // IOX_POSH_MEPOO_MEPOO_SEGMENT_INL
| 44.866667 | 117 | 0.742612 |
1035b23f5013e09b3b54ff5c26a7957de97ce48e | 1,630 | cpp | C++ | src/Basic/CastKind.cpp | jonaszell97/cdotc | 089b1161155118a0b78637883f0a6a04c6e9b436 | [
"MIT"
] | 1 | 2020-05-29T12:34:33.000Z | 2020-05-29T12:34:33.000Z | src/Basic/CastKind.cpp | jonaszell97/cdotc | 089b1161155118a0b78637883f0a6a04c6e9b436 | [
"MIT"
] | null | null | null | src/Basic/CastKind.cpp | jonaszell97/cdotc | 089b1161155118a0b78637883f0a6a04c6e9b436 | [
"MIT"
] | null | null | null |
namespace cdot {
const char* CastNames[] = {"<noop>",
"<lvalue_to_rvalue>",
"inttofp",
"fptoint",
"ext",
"trunc",
"ptrtoint",
"inttoptr",
"sign_cast",
"is_null",
"fpext",
"fptrunc",
"dyn_cast",
"upcast",
"<conv_op>",
"bitcast",
"proto_wrap",
"proto_unwrap",
"existential_cast",
"try_existential_cast",
"existential_unwrap",
"try_existential_unwrap",
"existential_ref",
"nothrow_to_throw",
"thin_to_thick",
"<meta_type_cast>",
"<forward>",
"<move>",
"<copy>",
"mut_ref_to_ref",
"mut_ptr_to_ptr",
"<rvalue_to_const_ref>",
"int_to_enum",
"enum_to_int",
"<to_void>",
"<to_()>",
"<to_meta_type>",
"<clang_conv>"};
} // namespace cdot | 37.906977 | 52 | 0.263804 |
10365b22e3bd41148d0f40ca25e38b55cf81651c | 1,517 | hpp | C++ | node_modules/grad-listbuymenu/cfgFunctions.hpp | gruppe-adler/TvT_HoldingPoint.Altis | 685a25e1cab315c877dcc0bbc41cf7d181fdd3f8 | [
"CC-BY-3.0"
] | 1 | 2020-08-31T15:48:28.000Z | 2020-08-31T15:48:28.000Z | node_modules/grad-listbuymenu/cfgFunctions.hpp | AdlerSalbei/TvT_HoldingPoint.Altis | 685a25e1cab315c877dcc0bbc41cf7d181fdd3f8 | [
"CC-BY-3.0"
] | 3 | 2017-01-16T09:25:39.000Z | 2017-02-15T08:35:16.000Z | node_modules/grad-listbuymenu/cfgFunctions.hpp | gruppe-adler/TvT_HoldingPoint.Altis | 685a25e1cab315c877dcc0bbc41cf7d181fdd3f8 | [
"CC-BY-3.0"
] | null | null | null | #ifndef MODULES_DIRECTORY
#define MODULES_DIRECTORY modules
#endif
class GRAD_lbm {
class common {
file = MODULES_DIRECTORY\grad-listBuymenu\functions\common;
class addFunds {};
class addInteraction {};
class checkCargoSpace {};
class getModuleRoot {};
class getPermissionLevel {};
class getPicturePath {};
class getStock {};
class isVehicle {};
class loadBuymenu {};
class rotateModel {};
class setPermissionLevel {};
};
class buy {
file = MODULES_DIRECTORY\grad-listBuymenu\functions\buy;
class buyClient {};
class buyItem {};
class buyServer {};
class buyUnit {};
class buyVehicle {};
class buyWeapon {};
class buyWearable {};
class callCodeClient {};
class callCodeServer {};
class reimburse {};
class vehicleMarker {};
};
class init {
file = MODULES_DIRECTORY\grad-listBuymenu\functions\init;
class initClient {
postInit = 1;
};
class initStocks {
postInit = 1;
};
class initVehicles {
postInit = 1;
};
};
class update {
file = MODULES_DIRECTORY\grad-listBuymenu\functions\update;
class updateBuyButton {};
class updateCategories {};
class updateFunds {};
class updateItemData {};
class updateList {};
class updatePicture {};
};
};
| 25.711864 | 67 | 0.562294 |
1036cc1288d0d727ffd0b5d1dd780f6643df1948 | 2,121 | cpp | C++ | goals/GetWeaponGoal_Evaluator.cpp | Sundragon1993/AI-Game-Pratices | 7549b23f71c3b2b5145388f0d8d4900bdb307a7a | [
"MIT"
] | null | null | null | goals/GetWeaponGoal_Evaluator.cpp | Sundragon1993/AI-Game-Pratices | 7549b23f71c3b2b5145388f0d8d4900bdb307a7a | [
"MIT"
] | null | null | null | goals/GetWeaponGoal_Evaluator.cpp | Sundragon1993/AI-Game-Pratices | 7549b23f71c3b2b5145388f0d8d4900bdb307a7a | [
"MIT"
] | null | null | null | #include "GetWeaponGoal_Evaluator.h"
#include "../Raven_ObjectEnumerations.h"
#include "misc/Stream_Utility_Functions.h"
#include "../Raven_Game.h"
#include "../Raven_Map.h"
#include "Goal_Think.h"
#include "Raven_Goal_Types.h"
#include "Raven_Feature.h"
#include <string>
//------------------- CalculateDesirability ---------------------------------
//-----------------------------------------------------------------------------
double GetWeaponGoal_Evaluator::CalculateDesirability(Raven_Bot* pBot)
{
//grab the distance to the closest instance of the weapon type
double Distance = Raven_Feature::DistanceToItem(pBot, m_iWeaponType);
//if the distance feature is rated with a value of 1 it means that the
//item is either not present on the map or too far away to be worth
//considering, therefore the desirability is zero
if (Distance == 1)
{
return 0;
}
else
{
//value used to tweak the desirability
const double Tweaker = 0.15;
double Health, WeaponStrength;
Health = Raven_Feature::Health(pBot);
WeaponStrength = Raven_Feature::IndividualWeaponStrength(pBot,
m_iWeaponType);
double Desirability = (Tweaker * Health * (1-WeaponStrength)) / Distance;
//ensure the value is in the range 0 to 1
Clamp(Desirability, 0, 1);
Desirability *= m_dCharacterBias;
return Desirability;
}
}
//------------------------------ SetGoal --------------------------------------
void GetWeaponGoal_Evaluator::SetGoal(Raven_Bot* pBot)
{
pBot->GetBrain()->AddGoal_GetItem(m_iWeaponType);
}
//-------------------------- RenderInfo ---------------------------------------
//-----------------------------------------------------------------------------
void GetWeaponGoal_Evaluator::RenderInfo(Vector2D Position, Raven_Bot* pBot)
{
std::string s;
switch(m_iWeaponType)
{
case type_rail_gun:
s="RG: ";break;
case type_rocket_launcher:
s="RL: "; break;
case type_shotgun:
s="SG: "; break;
}
gdi->TextAtPos(Position, s + ttos(CalculateDesirability(pBot), 2));
} | 27.907895 | 79 | 0.577558 |
10377f4601e1190527cb32fa954e6b643ee279df | 36 | hpp | C++ | lib/include/drivers/adc.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | lib/include/drivers/adc.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | lib/include/drivers/adc.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | #pragma once
#include "adc/make.hpp" | 18 | 23 | 0.75 |
103807b73b45150d29886c8b26abc609000a59bf | 9,356 | cpp | C++ | frameworks/render/modules/osg/dmzRenderModuleIsectOSG.cpp | dmzgroup/dmz | fc2d9ddcb04ed71f4106b8d33539529807b3dea6 | [
"MIT"
] | 2 | 2015-11-05T03:03:43.000Z | 2017-05-15T12:55:39.000Z | frameworks/render/modules/osg/dmzRenderModuleIsectOSG.cpp | dmzgroup/dmz | fc2d9ddcb04ed71f4106b8d33539529807b3dea6 | [
"MIT"
] | null | null | null | frameworks/render/modules/osg/dmzRenderModuleIsectOSG.cpp | dmzgroup/dmz | fc2d9ddcb04ed71f4106b8d33539529807b3dea6 | [
"MIT"
] | null | null | null | #include <dmzRenderConsts.h>
#include "dmzRenderModuleIsectOSG.h"
#include <dmzRenderUtilOSG.h>
#include <dmzRenderObjectDataOSG.h>
#include <dmzRuntimePluginFactoryLinkSymbol.h>
#include <dmzTypesHandleContainer.h>
#include <dmzTypesVector.h>
#include <dmzTypesString.h>
#include <osg/CullFace>
#include <osg/Drawable>
#include <osg/Group>
#include <osg/LineSegment>
#include <osg/Node>
#include <osgUtil/IntersectVisitor>
dmz::RenderModuleIsectOSG::RenderModuleIsectOSG (
const PluginInfo &Info,
const Config &Local) :
Plugin (Info),
RenderModuleIsect (Info),
_log (Info),
_core (0),
_defaultIsectMask (0) {
_init (Local);
}
dmz::RenderModuleIsectOSG::~RenderModuleIsectOSG () {
}
void
dmz::RenderModuleIsectOSG::discover_plugin (
const PluginDiscoverEnum Mode,
const Plugin *PluginPtr) {
if (Mode == PluginDiscoverAdd) {
if (!_core) {
_core = RenderModuleCoreOSG::cast (PluginPtr);
if (_core) {
_defaultIsectMask = _core->lookup_isect_mask (RenderIsectStaticName);
_defaultIsectMask |= _core->lookup_isect_mask (RenderIsectEntityName);
}
}
}
else if (Mode == PluginDiscoverRemove) {
if (_core && (_core == RenderModuleCoreOSG::cast (PluginPtr))) {
_core = 0;
_defaultIsectMask = 0;
}
}
}
dmz::Boolean
dmz::RenderModuleIsectOSG::do_isect (
const IsectParameters &Parameters,
const IsectTestContainer &TestValues,
IsectResultContainer &resultContainer) {
if (_core) {
osg::ref_ptr<osg::Group> scene = _core->get_isect ();
// osg::ref_ptr<osg::Group> scene = _core->get_static_objects ();
osg::BoundingSphere bs = scene->getBound();
std::vector<osg::LineSegment*> lsList;// = new osg::LineSegment[TestValues];
UInt32 mask (_defaultIsectMask);
HandleContainer attrList;
if (Parameters.get_isect_attributes (attrList)) {
mask = 0;
HandleContainerIterator it;
Handle attr (0);
while (attrList.get_next (it, attr)) { mask |= _core->lookup_isect_mask (attr); }
}
osgUtil::IntersectVisitor visitor;
visitor.setTraversalMask (mask);
UInt32 testHandle;
IsectTestTypeEnum testType;
Vector vec1, vec2;
std::vector<UInt32> handleArray;
std::vector<Vector> sourceArray;
TestValues.get_first_test (testHandle, testType, vec1, vec2);
do {
if (testType == IsectRayTest) {
vec2 = (vec1 + (vec2 * (bs.radius () * 2)));
}
osg::LineSegment *ls = new osg::LineSegment;
ls->set (to_osg_vector (vec1), to_osg_vector (vec2));
visitor.addLineSegment (ls);
lsList.push_back (ls);
handleArray.push_back (testHandle);
sourceArray.push_back (vec1);
} while (TestValues.get_next_test (testHandle, testType, vec1, vec2));
scene->accept (visitor);
IsectTestResultTypeEnum param = Parameters.get_test_result_type ();
bool closestPoint = (param == IsectClosestPoint);
bool firstPoint = (param == IsectFirstPoint);
if (closestPoint && !Parameters.get_calculate_distance ()) {
firstPoint = true;
closestPoint = false;
}
Boolean result (False);
for (unsigned int ix = 0; ix < lsList.size () && !result; ix++) {
osgUtil::IntersectVisitor::HitList resultHits;
resultHits = visitor.getHitList (lsList[ix]);
if (!resultHits.empty ()) {
for (unsigned int jy = 0; jy < resultHits.size (); jy++) {
Handle objHandle (0);
osgUtil::Hit currentHit = resultHits[jy];
Boolean disabled (False);
osg::CullFace *cf (0);
osg::NodePath path = currentHit.getNodePath ();
for (
osg::NodePath::iterator it = path.begin ();
(it != path.end ()) && !disabled;
it++) {
osg::Node *node (*it);
if (node) {
osg::StateSet *sSet = (node->getStateSet ());
if (sSet) {
osg::CullFace *cfTmp (
(osg::CullFace*)(sSet->getAttribute (
osg::StateAttribute::CULLFACE)));
if (cfTmp) { cf = cfTmp; }
}
osg::Referenced *r (node->getUserData ());
if (r) {
RenderObjectDataOSG *data (
dynamic_cast<RenderObjectDataOSG *> (r));
if (data) {
if (!data->do_isect ()) {
// Should never reach here now
disabled = True;
}
else { objHandle = data->get_handle (); }
}
}
}
}
if (!disabled) {
Vector lsPoint = to_dmz_vector (currentHit.getWorldIntersectPoint ());
IsectResult lsResult;
lsResult.set_isect_test_id (handleArray[ix]);
lsResult.set_point (lsPoint);
if (Parameters.get_calculate_object_handle ()) {
lsResult.set_object_handle (objHandle);
}
if (Parameters.get_calculate_normal ()) {
lsResult.set_normal (
to_dmz_vector (currentHit.getWorldIntersectNormal ()));
}
if (Parameters.get_calculate_distance ()) {
lsResult.set_distance ((lsPoint - sourceArray[ix]).magnitude ());
}
if (Parameters.get_calculate_cull_mode ()) {
UInt32 cullMask = 0;
if (cf) {
if (cf->getMode () == osg::CullFace::FRONT ||
cf->getMode () == osg::CullFace::FRONT_AND_BACK) {
cullMask |= IsectPolygonFrontCulledMask;
}
if (cf->getMode () == osg::CullFace::BACK ||
cf->getMode () == osg::CullFace::FRONT_AND_BACK) {
cullMask |= IsectPolygonBackCulledMask;
}
}
else { cullMask |= IsectPolygonBackCulledMask; }
lsResult.set_cull_mode (cullMask);
}
if (Parameters.get_calculate_object_handle ()) {
osg::Geode *hitObject = currentHit.getGeode ();
}
resultContainer.add_result (lsResult);
if (firstPoint) {
result = true;
}
}
}
}
}
if (closestPoint && resultContainer.get_result_count () > 1) {
IsectResult current;
resultContainer.get_first (current);
IsectResult closest (current);
double closestDist;
current.get_distance (closestDist);
while (resultContainer.get_next (current)) {
double testDist;
if (current.get_distance (testDist)) {
if (testDist < closestDist) {
closest = current;
}
}
}
IsectResultContainer closestContainer;
closestContainer.add_result (closest);
resultContainer = closestContainer;
}
}
return resultContainer.get_result_count () > 0;
}
dmz::UInt32
dmz::RenderModuleIsectOSG::enable_isect (const Handle ObjectHandle) {
UInt32 result (0);
if (_core) {
osg::Group *g (_core->lookup_dynamic_object (ObjectHandle));
if (g) {
RenderObjectDataOSG *data (
dynamic_cast<RenderObjectDataOSG *> (g->getUserData ()));
if (data) {
result = UInt32 (data->enable_isect ());
if (0 == result) {
UInt32 mask = g->getNodeMask ();
mask |= data->get_mask ();
g->setNodeMask (mask);
}
}
}
}
return result;
}
dmz::UInt32
dmz::RenderModuleIsectOSG::disable_isect (const Handle ObjectHandle) {
UInt32 result (0);
if (_core) {
osg::Group *g (_core->lookup_dynamic_object (ObjectHandle));
if (g) {
RenderObjectDataOSG *data (
dynamic_cast<RenderObjectDataOSG *> (g->getUserData ()));
if (data) {
result = UInt32 (data->disable_isect ());
if (1 == result) {
UInt32 mask = g->getNodeMask ();
data->set_mask (mask & _defaultIsectMask);
mask &= (~_defaultIsectMask);
g->setNodeMask (mask);
}
}
}
}
return result;
}
void
dmz::RenderModuleIsectOSG::_init (const Config &Local) {
}
extern "C" {
DMZ_PLUGIN_FACTORY_LINK_SYMBOL dmz::Plugin *
create_dmzRenderModuleIsectOSG (
const dmz::PluginInfo &Info,
dmz::Config &local,
dmz::Config &global) {
return new dmz::RenderModuleIsectOSG (Info, local);
}
};
| 25.016043 | 90 | 0.525973 |
103902cac236f8a988d05f01197ad080a846cfd2 | 1,180 | cpp | C++ | CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab Final/main(3).cpp | diptu/Teaching | 20655bb2c688ae29566b0a914df4a3e5936a2f61 | [
"MIT"
] | null | null | null | CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab Final/main(3).cpp | diptu/Teaching | 20655bb2c688ae29566b0a914df4a3e5936a2f61 | [
"MIT"
] | null | null | null | CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab Final/main(3).cpp | diptu/Teaching | 20655bb2c688ae29566b0a914df4a3e5936a2f61 | [
"MIT"
] | null | null | null | #include <iostream>
#include "binarysearchtree.h"
#include "binarysearchtree.cpp"
using namespace std;
struct Node {
int data;
Node *left, *right;
};
Node* newNode(int key)
{
Node* node = new Node;
node->data = key;
node->left = node->right = nullptr;
return node;
}
void inorder(Node* root)
{
if (root == nullptr)
return;
inorder(root->left);
cout << root->data << " ";
inorder(root->right);
}
Node* insert(Node* root, int key)
{
if (root == nullptr)
return newNode(key);
if (key < root->data)
root->left = insert(root->left, key);
else
root->right = insert(root->right, key);
return root;
}
int findSum(Node* root)
{
if (root == nullptr)
return 0;
return root->data + findSum(root->left) + findSum(root->right);
}
void update(Node* root, int &sum)
{
if (root == nullptr)
return;
update(root->left, sum);
sum = sum - root->data;
root->data += sum;
update(root->right, sum);
}
int main()
{
Node* root = nullptr;
int keys[] = { 5, 3, 2, 4, 6, 8, 10 };
int n = sizeof(keys)/sizeof(keys[0]);
for (int key : keys)
root = insert(root, key);
int sum = findSum(root);
update(root, sum);
inorder(root);
return 0;
}
| 12.967033 | 64 | 0.616949 |
103a03280340da22c8ed3fca32af62c5570dc6cb | 1,923 | cpp | C++ | inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_split.cpp | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 2 | 2020-11-18T14:14:06.000Z | 2020-11-28T04:55:57.000Z | inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_split.cpp | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 30 | 2020-11-13T11:44:07.000Z | 2022-02-21T13:03:16.000Z | inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_split.cpp | mmakridi/openvino | 769bb7709597c14debdaa356dd60c5a78bdfa97e | [
"Apache-2.0"
] | 1 | 2020-12-18T15:47:45.000Z | 2020-12-18T15:47:45.000Z | // Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "dsr_tests_common.hpp"
namespace {
using namespace LayerTestsUtils::vpu;
struct SplitTestCase {
DataShapeWithUpperBound dataShapes;
int64_t axis, numSplits;
};
const auto combinations = testing::Combine(
testing::Values(
ngraph::element::f16),
testing::Values(
ngraph::element::i32),
testing::Values(
SplitTestCase{{{6, 12, 10}, {6, 12, 15}}, 1, 3},
SplitTestCase{{{6, 12, 10}, {9, 12, 10}}, 1, 3},
SplitTestCase{{{6, 12}, {10, 12}}, 1, 4},
SplitTestCase{{{6, 12, 10, 24}, {6, 12, 10, 50}}, 0, 6},
SplitTestCase{{{6, 12, 10, 24}, {6, 12, 10, 50}}, -3, 2},
SplitTestCase{{{1, 128, 4}, {1, 256, 4}}, 2, 4}),
testing::Values(CommonTestUtils::DEVICE_MYRIAD));
using Parameters = std::tuple<
DataType,
DataType,
SplitTestCase,
LayerTestsUtils::TargetDevice
>;
class DSR_Split : public testing::WithParamInterface<Parameters>, public DSR_TestsCommon {
protected:
std::shared_ptr<ngraph::Node> createTestedOp() override {
const auto& parameters = GetParam();
const auto& dataType = std::get<0>(parameters);
const auto& idxType = std::get<1>(parameters);
const auto& splitSetup = std::get<2>(parameters);
targetDevice = std::get<3>(parameters);
const auto inputSubgraph = createInputSubgraphWithDSR(dataType, splitSetup.dataShapes);
const auto axis = ngraph::opset5::Constant::create(idxType, {}, {splitSetup.axis});
return std::make_shared<ngraph::opset5::Split>(inputSubgraph, axis, splitSetup.numSplits);
}
};
TEST_P(DSR_Split, CompareWithReference) {
Run();
}
INSTANTIATE_TEST_CASE_P(smoke_DynamicSplit, DSR_Split, combinations);
} // namespace
| 31.016129 | 98 | 0.616745 |
103a5165c7c2ac742043f1a5153f39633e5eee24 | 329 | cpp | C++ | libFileArbTests/libFileArbTestsMain.cpp | NeilJustice/FileArb | 4104c64170177a0b5d8d52ed7af7968970f0ecfd | [
"MIT"
] | 1 | 2021-12-09T22:49:01.000Z | 2021-12-09T22:49:01.000Z | libFileArbTests/libFileArbTestsMain.cpp | NeilJustice/FileArb | 4104c64170177a0b5d8d52ed7af7968970f0ecfd | [
"MIT"
] | 8 | 2020-03-04T01:43:04.000Z | 2020-04-11T22:27:41.000Z | libFileArbTests/libFileArbTestsMain.cpp | NeilJustice/FileArb | 4104c64170177a0b5d8d52ed7af7968970f0ecfd | [
"MIT"
] | null | null | null | #include "pch.h"
#if defined _WIN32
#if defined _DEBUG
#pragma comment(lib, "libboost_regex-vc142-mt-gd-x64-1_75.lib")
#else
#pragma comment(lib, "libboost_regex-vc142-mt-x64-1_75.lib")
#endif
#endif
int main(int argc, char* argv[])
{
const int exitCode = ZenUnit::RunTests(argc, argv);
return exitCode;
}
| 20.5625 | 64 | 0.68693 |
103b0498197dc6af29c8f5c84777ee4bf2f3e02e | 1,022 | cpp | C++ | test/std/utilities/variant/variant.get/holds_alternative.pass.cpp | AOSiP/platform_external_libcxx | eb2115113f10274c0d25523ba44c3c7373ea3209 | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | test/std/utilities/variant/variant.get/holds_alternative.pass.cpp | AOSiP/platform_external_libcxx | eb2115113f10274c0d25523ba44c3c7373ea3209 | [
"MIT"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | test/std/utilities/variant/variant.get/holds_alternative.pass.cpp | AOSiP/platform_external_libcxx | eb2115113f10274c0d25523ba44c3c7373ea3209 | [
"MIT"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | // -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
// <variant>
// template <class T, class... Types>
// constexpr bool holds_alternative(const variant<Types...>& v) noexcept;
#include "test_macros.h"
#include <variant>
int main() {
{
using V = std::variant<int>;
constexpr V v;
static_assert(std::holds_alternative<int>(v), "");
}
{
using V = std::variant<int, long>;
constexpr V v;
static_assert(std::holds_alternative<int>(v), "");
static_assert(!std::holds_alternative<long>(v), "");
}
{ // noexcept test
using V = std::variant<int>;
const V v;
ASSERT_NOEXCEPT(std::holds_alternative<int>(v));
}
}
| 26.205128 | 80 | 0.521526 |
103bba595724b6413cd8334d43d429aa9c5f1a98 | 1,410 | hpp | C++ | libs/dmlf/include/dmlf/collective_learning/client_params.hpp | devjsc/ledger | 5681480faf6e2aeee577f149c17745d6ab4d4ab3 | [
"Apache-2.0"
] | null | null | null | libs/dmlf/include/dmlf/collective_learning/client_params.hpp | devjsc/ledger | 5681480faf6e2aeee577f149c17745d6ab4d4ab3 | [
"Apache-2.0"
] | null | null | null | libs/dmlf/include/dmlf/collective_learning/client_params.hpp | devjsc/ledger | 5681480faf6e2aeee577f149c17745d6ab4d4ab3 | [
"Apache-2.0"
] | null | null | null | #pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018-2019 Fetch.AI Limited
//
// 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 "math/base_types.hpp"
namespace fetch {
namespace dmlf {
namespace collective_learning {
template <typename DataType>
struct ClientParams
{
using SizeType = fetch::math::SizeType;
SizeType n_algorithms_per_client = 1;
SizeType batch_size{};
SizeType max_updates;
DataType learning_rate;
bool print_loss = false;
std::vector<std::string> input_names = {"Input"};
std::string label_name = "Label";
std::string error_name = "Error";
std::string results_dir = ".";
};
} // namespace collective_learning
} // namespace dmlf
} // namespace fetch
| 30 | 80 | 0.619858 |
103c81feea8781325ba84e138b234bfbcf5721c1 | 598 | cc | C++ | erizoAPI/addon.cc | winlinvip/licode | ee4f012147264c29cc6d8282f2a573b801a2454b | [
"MIT"
] | 1 | 2018-08-21T03:59:44.000Z | 2018-08-21T03:59:44.000Z | erizoAPI/addon.cc | winlinvip/licode | ee4f012147264c29cc6d8282f2a573b801a2454b | [
"MIT"
] | null | null | null | erizoAPI/addon.cc | winlinvip/licode | ee4f012147264c29cc6d8282f2a573b801a2454b | [
"MIT"
] | 1 | 2018-08-21T03:59:47.000Z | 2018-08-21T03:59:47.000Z | #ifndef BUILDING_NODE_EXTENSION
#define BUILDING_NODE_EXTENSION
#endif
#include <nan.h>
#include "WebRtcConnection.h"
#include "OneToManyProcessor.h"
#include "OneToManyTranscoder.h"
#include "SyntheticInput.h"
#include "ExternalInput.h"
#include "ExternalOutput.h"
#include "ThreadPool.h"
#include "IOThreadPool.h"
NAN_MODULE_INIT(InitAll) {
WebRtcConnection::Init(target);
OneToManyProcessor::Init(target);
ExternalInput::Init(target);
ExternalOutput::Init(target);
SyntheticInput::Init(target);
ThreadPool::Init(target);
IOThreadPool::Init(target);
}
NODE_MODULE(addon, InitAll)
| 23.92 | 35 | 0.779264 |
103ca24d6f03bd2def6c7cb404e11020d3be086b | 22,248 | cpp | C++ | ngraph/test/backend/detection_output.in.cpp | MikhailPedus/openvino | 5f9ef0cf26543b3dde80b3b2bfc7e996e7c55d5b | [
"Apache-2.0"
] | null | null | null | ngraph/test/backend/detection_output.in.cpp | MikhailPedus/openvino | 5f9ef0cf26543b3dde80b3b2bfc7e996e7c55d5b | [
"Apache-2.0"
] | 27 | 2020-12-29T14:38:34.000Z | 2022-02-21T13:04:03.000Z | ngraph/test/backend/detection_output.in.cpp | dorloff/openvino | 1c3848a96fdd325b044babe6d5cd26db341cf85b | [
"Apache-2.0"
] | null | null | null | //*****************************************************************************
// Copyright 2020 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
// clang-format off
#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#endif
#ifdef ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#define DEFAULT_DOUBLE_TOLERANCE_BITS ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#endif
// clang-format on
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "util/engine/test_engines.hpp"
#include "util/test_case.hpp"
#include "util/test_control.hpp"
using namespace std;
using namespace ngraph;
static string s_manifest = "${MANIFEST}";
using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
NGRAPH_TEST(${BACKEND_NAME}, detection_output_3_inputs)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 3;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = true;
attrs.keep_top_k = {2};
attrs.code_type = "caffe.PriorBoxParameter.CORNER";
attrs.share_location = false;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 2;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
1, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto f = make_shared<Function>(make_shared<op::DetectionOutput>(loc, conf, prior_boxes, attrs),
ParameterVector{loc, conf, prior_boxes});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0, class 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 0, class 1
0.3,
0.2,
0.5,
0.3,
0.2,
0.1,
0.42,
0.66,
// batch 0, class 2
0.05,
0.1,
0.2,
0.3,
0.2,
0.1,
0.33,
0.44,
// batch 1, class 0
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
// batch 1, class 1
0.1,
0.2,
0.5,
0.3,
0.1,
0.1,
0.12,
0.34,
// batch 1, class 2
0.25,
0.11,
0.4,
0.32,
0.2,
0.12,
0.38,
0.24,
});
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
0,
0.2,
// batch 1
0.7,
0.8,
0.42,
0.33,
0.81,
0.2,
});
test_case.add_input<float>({
// prior box 0
0.0,
0.5,
0.1,
0.2,
// prior box 1
0.0,
0.3,
0.1,
0.35,
});
Shape output_shape{1, 1, num_images * static_cast<size_t>(attrs.keep_top_k[0]), 7};
test_case.add_expected_output<float>(
output_shape, {0, 0, 0.7, 0.2, 0.4, 0.52, 1, 0, 1, 0.9, 0, 0.6, 0.3, 0.35,
1, 1, 0.81, 0.25, 0.41, 0.5, 0.67, 1, 1, 0.8, 0.1, 0.55, 0.3, 0.45});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, detection_output_3_inputs_share_location)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 3;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = true;
attrs.keep_top_k = {2};
attrs.code_type = "caffe.PriorBoxParameter.CORNER";
attrs.share_location = true;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 2;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
num_images, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto f = make_shared<Function>(make_shared<op::DetectionOutput>(loc, conf, prior_boxes, attrs),
ParameterVector{loc, conf, prior_boxes});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 1
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
});
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
0,
0.2,
// batch 1
0.7,
0.8,
0.42,
0.33,
0.81,
0.2,
});
test_case.add_input<float>({
// batch 0
0.0,
0.5,
0.1,
0.2,
0.0,
0.3,
0.1,
0.35,
// batch 1
0.33,
0.2,
0.52,
0.37,
0.22,
0.1,
0.32,
0.36,
});
Shape output_shape{1, 1, num_images * static_cast<size_t>(attrs.keep_top_k[0]), 7};
test_case.add_expected_output<float>(output_shape,
{
0, 0, 0.7, 0, 0.4, 0.3, 0.5, 0, 1, 0.9,
0.1, 0.6, 0.3, 0.4, 1, 1, 0.81, 0.32, 0.15, 0.52,
0.61, 1, 1, 0.8, 0.53, 0.3, 0.92, 0.57,
});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, detection_output_3_inputs_normalized)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 3;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = true;
attrs.keep_top_k = {2};
attrs.code_type = "caffe.PriorBoxParameter.CORNER";
attrs.share_location = true;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 2;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
num_images, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto f = make_shared<Function>(make_shared<op::DetectionOutput>(loc, conf, prior_boxes, attrs),
ParameterVector{loc, conf, prior_boxes});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 1
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
});
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
0,
0.2,
// batch 1
0.7,
0.8,
0.42,
0.33,
0.81,
0.2,
});
test_case.add_input<float>({
// batch 0
0.0,
0.5,
0.1,
0.2,
0.0,
0.3,
0.1,
0.35,
// batch 1
0.33,
0.2,
0.52,
0.37,
0.22,
0.1,
0.32,
0.36,
});
Shape output_shape{1, 1, num_images * static_cast<size_t>(attrs.keep_top_k[0]), 7};
test_case.add_expected_output<float>(output_shape,
{
0, 0, 0.7, 0, 0.4, 0.3, 0.5, 0, 1, 0.9,
0.1, 0.6, 0.3, 0.4, 1, 1, 0.81, 0.32, 0.15, 0.52,
0.61, 1, 1, 0.8, 0.53, 0.3, 0.92, 0.57,
});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, detection_output_3_inputs_keep_all_bboxes)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 2;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = false;
attrs.keep_top_k = {-1};
attrs.code_type = "caffe.PriorBoxParameter.CORNER";
attrs.share_location = false;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 3;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
num_images, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto f = make_shared<Function>(make_shared<op::DetectionOutput>(loc, conf, prior_boxes, attrs),
ParameterVector{loc, conf, prior_boxes});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0, class 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 0, class 1
0.3,
0.2,
0.5,
0.3,
0.2,
0.1,
0.42,
0.66,
// batch 1, class 0
0.05,
0.1,
0.2,
0.3,
0.2,
0.1,
0.33,
0.44,
// batch 1, class 1
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
// batch 2, class 0
0.1,
0.2,
0.5,
0.3,
0.1,
0.1,
0.12,
0.34,
// batch 2, class 1
0.25,
0.11,
0.4,
0.32,
0.2,
0.12,
0.38,
0.24,
});
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
// batch 1
0.7,
0.8,
0.42,
0.33,
// batch 1
0.1,
0.2,
0.32,
0.43,
});
test_case.add_input<float>({
// batch 0 priors
0.0,
0.5,
0.1,
0.2,
0.0,
0.3,
0.1,
0.35,
// batch 0 variances
0.12,
0.11,
0.32,
0.02,
0.02,
0.20,
0.09,
0.71,
// batch 1 priors
0.33,
0.2,
0.52,
0.37,
0.22,
0.1,
0.32,
0.36,
// batch 1 variances
0.01,
0.07,
0.12,
0.13,
0.41,
0.33,
0.2,
0.1,
// batch 2 priors
0.0,
0.3,
0.1,
0.35,
0.22,
0.1,
0.32,
0.36,
// batch 2 variances
0.32,
0.02,
0.13,
0.41,
0.33,
0.2,
0.02,
0.20,
});
Shape output_shape{1, 1, num_images * attrs.num_classes * num_prior_boxes, 7};
test_case.add_expected_output<float>(
output_shape,
{
0, 0, 0.4, 0.006, 0.34, 0.145, 0.563, 0, 1, 0.9, 0, 0.511, 0.164, 0.203,
0, 1, 0.7, 0.004, 0.32, 0.1378, 0.8186, 1, 0, 0.7, 0.3305, 0.207, 0.544, 0.409,
1, 0, 0.42, 0.302, 0.133, 0.4, 0.38, 1, 1, 0.8, 0.332, 0.207, 0.5596, 0.4272,
1, 1, 0.33, 0.261, 0.1165, 0.36, 0.385, 2, 0, 0.32, 0.3025, 0.122, 0.328, 0.424,
2, 1, 0.43, 0.286, 0.124, 0.3276, 0.408, -1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, detection_output_3_inputs_center_size)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 3;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = true;
attrs.keep_top_k = {2};
attrs.code_type = "caffe.PriorBoxParameter.CENTER_SIZE";
attrs.share_location = false;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 2;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
num_images, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto f = make_shared<Function>(make_shared<op::DetectionOutput>(loc, conf, prior_boxes, attrs),
ParameterVector{loc, conf, prior_boxes});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0, class 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 0, class 1
0.3,
0.2,
0.5,
0.3,
0.2,
0.1,
0.42,
0.66,
// batch 0, class 2
0.05,
0.1,
0.2,
0.3,
0.2,
0.1,
0.33,
0.44,
// batch 1, class 0
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
// batch 1, class 1
0.1,
0.2,
0.5,
0.3,
0.1,
0.1,
0.12,
0.34,
// batch 1, class 2
0.25,
0.11,
0.4,
0.32,
0.2,
0.12,
0.38,
0.24,
});
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
0,
0.2,
// batch 1
0.7,
0.8,
0.42,
0.33,
0.81,
0.2,
});
test_case.add_input<float>({
// batch 0
0.0,
0.5,
0.1,
0.2,
0.0,
0.3,
0.1,
0.35,
// batch 1
0.33,
0.2,
0.52,
0.37,
0.22,
0.1,
0.32,
0.36,
});
Shape output_shape{1, 1, num_images * static_cast<size_t>(attrs.keep_top_k[0]), 7};
test_case.add_expected_output<float>(
output_shape,
{
0, 0, 0.7, 0, 0.28163019, 0.14609808, 0.37836978,
0, 1, 0.9, 0, 0.49427515, 0.11107014, 0.14572485,
1, 1, 0.81, 0.22040875, 0.079573378, 0.36959124, 0.4376266,
1, 1, 0.8, 0.32796675, 0.18435785, 0.56003326, 0.40264216,
});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, detection_output_5_inputs)
{
op::DetectionOutputAttrs attrs;
attrs.num_classes = 2;
attrs.background_label_id = -1;
attrs.top_k = -1;
attrs.variance_encoded_in_target = true;
attrs.keep_top_k = {2};
attrs.code_type = "caffe.PriorBoxParameter.CORNER";
attrs.share_location = false;
attrs.nms_threshold = 0.5;
attrs.confidence_threshold = 0.3;
attrs.clip_after_nms = false;
attrs.clip_before_nms = true;
attrs.decrease_label_id = false;
attrs.normalized = true;
attrs.input_height = 0;
attrs.input_width = 0;
attrs.objectness_score = 0.6;
size_t num_prior_boxes = 2;
size_t num_loc_classes = attrs.share_location ? 1 : attrs.num_classes;
size_t prior_box_size = attrs.normalized ? 4 : 5;
size_t num_images = 2;
Shape loc_shape{num_images, num_prior_boxes * num_loc_classes * prior_box_size};
Shape conf_shape{num_images, num_prior_boxes * attrs.num_classes};
Shape prior_boxes_shape{
num_images, attrs.variance_encoded_in_target ? 1UL : 2UL, num_prior_boxes * prior_box_size};
auto loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto prior_boxes = make_shared<op::Parameter>(element::f32, prior_boxes_shape);
auto aux_loc = make_shared<op::Parameter>(element::f32, loc_shape);
auto aux_conf = make_shared<op::Parameter>(element::f32, conf_shape);
auto f = make_shared<Function>(
make_shared<op::DetectionOutput>(loc, conf, prior_boxes, aux_conf, aux_loc, attrs),
ParameterVector{loc, conf, prior_boxes, aux_conf, aux_loc});
auto test_case = test::TestCase<TestEngine>(f);
// locations
test_case.add_input<float>({
// batch 0, class 0
0.1,
0.1,
0.2,
0.2,
0.0,
0.1,
0.2,
0.15,
// batch 0, class 1
0.3,
0.2,
0.5,
0.3,
0.2,
0.1,
0.42,
0.66,
// batch 1, class 0
0.2,
0.1,
0.4,
0.2,
0.1,
0.05,
0.2,
0.25,
// batch 1, class 1
0.1,
0.2,
0.5,
0.3,
0.1,
0.1,
0.12,
0.34,
});
// confidence
test_case.add_input<float>({
// batch 0
0.1,
0.9,
0.4,
0.7,
// batch 1
0.42,
0.33,
0.81,
0.2,
});
// prior boxes
test_case.add_input<float>({
// batch 0
0.0,
0.5,
0.1,
0.2,
0.0,
0.3,
0.1,
0.35,
// batch 1
0.33,
0.2,
0.52,
0.37,
0.22,
0.1,
0.32,
0.36,
});
// aux conf
test_case.add_input<float>({
// batch 0
0.1,
0.3,
0.5,
0.8,
// batch 1
0.5,
0.8,
0.01,
0.1,
});
// aux locations
test_case.add_input<float>({
// batch 0, class 0
0.1,
0.2,
0.5,
0.3,
0.1,
0.1,
0.12,
0.34,
// batch 0, class 1
0.25,
0.11,
0.4,
0.32,
0.2,
0.12,
0.38,
0.24,
// batch 1, class 0
0.3,
0.2,
0.5,
0.3,
0.2,
0.1,
0.42,
0.66,
// batch 1, class 1
0.05,
0.1,
0.2,
0.3,
0.2,
0.1,
0.33,
0.44,
});
Shape output_shape{1, 1, num_images * static_cast<size_t>(attrs.keep_top_k[0]), 7};
test_case.add_expected_output<float>(
output_shape,
{
0, 0, 0.4, 0.55, 0.61, 1, 0.97, 0, 1, 0.7, 0.4, 0.52, 0.9, 1,
1, 0, 0.42, 0.83, 0.5, 1, 0.87, 1, 1, 0.33, 0.63, 0.35, 1, 1,
});
test_case.run();
}
| 25.484536 | 100 | 0.502247 |
103cd6311a5b2270ba19ff696c286cc96cffd054 | 19,920 | cpp | C++ | Libraries/RobsJuceModules/rosic/_third_party/angelscript/as_module.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 34 | 2017-04-19T18:26:02.000Z | 2022-02-15T17:47:26.000Z | Libraries/RobsJuceModules/rosic/_third_party/angelscript/as_module.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 307 | 2017-05-04T21:45:01.000Z | 2022-02-03T00:59:01.000Z | Libraries/RobsJuceModules/rosic/_third_party/angelscript/as_module.cpp | RobinSchmidt/RS-MET-Preliminary | 6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe | [
"FTL"
] | 4 | 2017-09-05T17:04:31.000Z | 2021-12-15T21:24:28.000Z | /*
AngelCode Scripting Library
Copyright (c) 2003-2007 Andreas Jonsson
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
The original version of this library can be located at:
http://www.angelcode.com/angelscript/
Andreas Jonsson
andreas@angelcode.com
*/
//
// as_module.cpp
//
// A class that holds a script module
//
#include "as_config.h"
#include "as_module.h"
#include "as_builder.h"
#include "as_context.h"
BEGIN_AS_NAMESPACE
asCModule::asCModule(const char *name, int id, asCScriptEngine *engine)
{
this->name = name;
this->engine = engine;
this->moduleID = id;
builder = 0;
isDiscarded = false;
isBuildWithoutErrors = false;
contextCount = 0;
moduleCount = 0;
isGlobalVarInitialized = false;
initFunction = 0;
}
asCModule::~asCModule()
{
Reset();
if( builder )
{
DELETE(builder,asCBuilder);
builder = 0;
}
// Remove the module from the engine
if( engine )
{
if( engine->lastModule == this )
engine->lastModule = 0;
int index = (moduleID >> 16);
engine->scriptModules[index] = 0;
}
}
int asCModule::AddScriptSection(const char *name, const char *code, int codeLength, int lineOffset, bool makeCopy)
{
if( !builder )
builder = NEW(asCBuilder)(engine, this);
builder->AddCode(name, code, codeLength, lineOffset, (int)builder->scripts.GetLength(), makeCopy);
return asSUCCESS;
}
int asCModule::Build()
{
assert( contextCount == 0 );
Reset();
if( !builder )
return asSUCCESS;
// Store the section names
for( size_t n = 0; n < builder->scripts.GetLength(); n++ )
{
asCString *sectionName = NEW(asCString)(builder->scripts[n]->name);
scriptSections.PushLast(sectionName);
}
// Compile the script
int r = builder->Build();
DELETE(builder,asCBuilder);
builder = 0;
if( r < 0 )
{
// Reset module again
Reset();
isBuildWithoutErrors = false;
return r;
}
isBuildWithoutErrors = true;
engine->PrepareEngine();
CallInit();
return r;
}
int asCModule::ResetGlobalVars()
{
if( !isGlobalVarInitialized ) return asERROR;
CallExit();
CallInit();
return 0;
}
void asCModule::CallInit()
{
if( isGlobalVarInitialized ) return;
memset(globalMem.AddressOf(), 0, globalMem.GetLength()*sizeof(asDWORD));
if( initFunction && initFunction->byteCode.GetLength() == 0 ) return;
int id = asFUNC_INIT;
asIScriptContext *ctx = 0;
int r = engine->CreateContext(&ctx, true);
if( r >= 0 && ctx )
{
// TODO: Add error handling
((asCContext*)ctx)->PrepareSpecial(id, this);
ctx->Execute();
ctx->Release();
ctx = 0;
}
isGlobalVarInitialized = true;
}
void asCModule::CallExit()
{
if( !isGlobalVarInitialized ) return;
for( size_t n = 0; n < scriptGlobals.GetLength(); n++ )
{
if( scriptGlobals[n]->type.IsObject() )
{
void *obj = *(void**)(globalMem.AddressOf() + scriptGlobals[n]->index);
if( obj )
{
asCObjectType *ot = scriptGlobals[n]->type.GetObjectType();
if( ot->beh.release )
engine->CallObjectMethod(obj, ot->beh.release);
else
{
if( ot->beh.destruct )
engine->CallObjectMethod(obj, ot->beh.destruct);
engine->CallFree(ot, obj);
}
}
}
}
isGlobalVarInitialized = false;
}
void asCModule::Discard()
{
isDiscarded = true;
}
void asCModule::Reset()
{
assert( !IsUsed() );
CallExit();
// Free global variables
globalMem.SetLength(0);
globalVarPointers.SetLength(0);
isBuildWithoutErrors = true;
isDiscarded = false;
if( initFunction )
{
engine->DeleteScriptFunction(initFunction->id);
initFunction = 0;
}
size_t n;
for( n = 0; n < scriptFunctions.GetLength(); n++ )
engine->DeleteScriptFunction(scriptFunctions[n]->id);
scriptFunctions.SetLength(0);
for( n = 0; n < importedFunctions.GetLength(); n++ )
{
DELETE(importedFunctions[n],asCScriptFunction);
}
importedFunctions.SetLength(0);
// Release bound functions
for( n = 0; n < bindInformations.GetLength(); n++ )
{
int oldFuncID = bindInformations[n].importedFunction;
if( oldFuncID != -1 )
{
asCModule *oldModule = engine->GetModuleFromFuncId(oldFuncID);
if( oldModule != 0 )
{
// Release reference to the module
oldModule->ReleaseModuleRef();
}
}
}
bindInformations.SetLength(0);
for( n = 0; n < stringConstants.GetLength(); n++ )
{
DELETE(stringConstants[n],asCString);
}
stringConstants.SetLength(0);
for( n = 0; n < scriptGlobals.GetLength(); n++ )
{
DELETE(scriptGlobals[n],asCProperty);
}
scriptGlobals.SetLength(0);
for( n = 0; n < scriptSections.GetLength(); n++ )
{
DELETE(scriptSections[n],asCString);
}
scriptSections.SetLength(0);
for( n = 0; n < classTypes.GetLength(); n++ )
classTypes[n]->refCount--;
classTypes.SetLength(0);
// Release all used object types
for( n = 0; n < usedTypes.GetLength(); n++ )
usedTypes[n]->refCount--;
usedTypes.SetLength(0);
// Release all config groups
for( n = 0; n < configGroups.GetLength(); n++ )
configGroups[n]->Release();
configGroups.SetLength(0);
}
int asCModule::GetFunctionIDByName(const char *name)
{
if( isBuildWithoutErrors == false )
return asERROR;
// TODO: Improve linear search
// Find the function id
int id = -1;
for( size_t n = 0; n < scriptFunctions.GetLength(); n++ )
{
if( scriptFunctions[n]->name == name )
{
if( id == -1 )
id = scriptFunctions[n]->id;
else
return asMULTIPLE_FUNCTIONS;
}
}
if( id == -1 ) return asNO_FUNCTION;
return id;
}
int asCModule::GetMethodIDByDecl(asCObjectType *ot, const char *decl)
{
if( isBuildWithoutErrors == false )
return asERROR;
return engine->GetMethodIDByDecl(ot, decl, this);
}
int asCModule::GetImportedFunctionCount()
{
if( isBuildWithoutErrors == false )
return asERROR;
return (int)importedFunctions.GetLength();
}
int asCModule::GetImportedFunctionIndexByDecl(const char *decl)
{
if( isBuildWithoutErrors == false )
return asERROR;
asCBuilder bld(engine, this);
asCScriptFunction func(this);
bld.ParseFunctionDeclaration(decl, &func);
// TODO: Improve linear search
// Search script functions for matching interface
int id = -1;
for( asUINT n = 0; n < importedFunctions.GetLength(); ++n )
{
if( func.name == importedFunctions[n]->name &&
func.returnType == importedFunctions[n]->returnType &&
func.parameterTypes.GetLength() == importedFunctions[n]->parameterTypes.GetLength() )
{
bool match = true;
for( asUINT p = 0; p < func.parameterTypes.GetLength(); ++p )
{
if( func.parameterTypes[p] != importedFunctions[n]->parameterTypes[p] )
{
match = false;
break;
}
}
if( match )
{
if( id == -1 )
id = n;
else
return asMULTIPLE_FUNCTIONS;
}
}
}
if( id == -1 ) return asNO_FUNCTION;
return id;
}
int asCModule::GetFunctionCount()
{
if( isBuildWithoutErrors == false )
return asERROR;
return (int)scriptFunctions.GetLength();
}
int asCModule::GetFunctionIDByDecl(const char *decl)
{
if( isBuildWithoutErrors == false )
return asERROR;
asCBuilder bld(engine, this);
asCScriptFunction func(this);
int r = bld.ParseFunctionDeclaration(decl, &func);
if( r < 0 )
return asINVALID_DECLARATION;
// TODO: Improve linear search
// Search script functions for matching interface
int id = -1;
for( size_t n = 0; n < scriptFunctions.GetLength(); ++n )
{
if( scriptFunctions[n]->objectType == 0 &&
func.name == scriptFunctions[n]->name &&
func.returnType == scriptFunctions[n]->returnType &&
func.parameterTypes.GetLength() == scriptFunctions[n]->parameterTypes.GetLength() )
{
bool match = true;
for( size_t p = 0; p < func.parameterTypes.GetLength(); ++p )
{
if( func.parameterTypes[p] != scriptFunctions[n]->parameterTypes[p] )
{
match = false;
break;
}
}
if( match )
{
if( id == -1 )
id = scriptFunctions[n]->id;
else
return asMULTIPLE_FUNCTIONS;
}
}
}
if( id == -1 ) return asNO_FUNCTION;
return id;
}
int asCModule::GetGlobalVarCount()
{
if( isBuildWithoutErrors == false )
return asERROR;
return (int)scriptGlobals.GetLength();
}
int asCModule::GetGlobalVarIDByName(const char *name)
{
if( isBuildWithoutErrors == false )
return asERROR;
// Find the global var id
int id = -1;
for( size_t n = 0; n < scriptGlobals.GetLength(); n++ )
{
if( scriptGlobals[n]->name == name )
{
id = (int)n;
break;
}
}
if( id == -1 ) return asNO_GLOBAL_VAR;
return moduleID | id;
}
int asCModule::GetGlobalVarIDByDecl(const char *decl)
{
if( isBuildWithoutErrors == false )
return asERROR;
asCBuilder bld(engine, this);
asCProperty gvar;
bld.ParseVariableDeclaration(decl, &gvar);
// TODO: Improve linear search
// Search script functions for matching interface
int id = -1;
for( size_t n = 0; n < scriptGlobals.GetLength(); ++n )
{
if( gvar.name == scriptGlobals[n]->name &&
gvar.type == scriptGlobals[n]->type )
{
id = (int)n;
break;
}
}
if( id == -1 ) return asNO_GLOBAL_VAR;
return moduleID | id;
}
int asCModule::AddConstantString(const char *str, size_t len)
{
// The str may contain null chars, so we cannot use strlen, or strcmp, or strcpy
asCString *cstr = NEW(asCString)(str, len);
// TODO: Improve linear search
// Has the string been registered before?
for( size_t n = 0; n < stringConstants.GetLength(); n++ )
{
if( *stringConstants[n] == *cstr )
{
DELETE(cstr,asCString);
return (int)n;
}
}
// No match was found, add the string
stringConstants.PushLast(cstr);
return (int)stringConstants.GetLength() - 1;
}
const asCString &asCModule::GetConstantString(int id)
{
return *stringConstants[id];
}
int asCModule::GetNextFunctionId()
{
return engine->GetNextScriptFunctionId();
}
int asCModule::GetNextImportedFunctionId()
{
return FUNC_IMPORTED | (asUINT)importedFunctions.GetLength();
}
int asCModule::AddScriptFunction(int sectionIdx, int id, const char *name, const asCDataType &returnType, asCDataType *params, int *inOutFlags, int paramCount, bool isInterface, asCObjectType *objType)
{
assert(id >= 0);
// Store the function information
asCScriptFunction *func = NEW(asCScriptFunction)(this);
func->funcType = isInterface ? asFUNC_INTERFACE : asFUNC_SCRIPT;
func->name = name;
func->id = id;
func->returnType = returnType;
func->scriptSectionIdx = sectionIdx;
for( int n = 0; n < paramCount; n++ )
{
func->parameterTypes.PushLast(params[n]);
func->inOutFlags.PushLast(inOutFlags[n]);
}
func->objectType = objType;
scriptFunctions.PushLast(func);
engine->SetScriptFunction(func);
// Compute the signature id
if( objType )
func->ComputeSignatureId(engine);
return 0;
}
int asCModule::AddImportedFunction(int id, const char *name, const asCDataType &returnType, asCDataType *params, int *inOutFlags, int paramCount, int moduleNameStringID)
{
assert(id >= 0);
// Store the function information
asCScriptFunction *func = NEW(asCScriptFunction)(this);
func->funcType = asFUNC_IMPORTED;
func->name = name;
func->id = id;
func->returnType = returnType;
for( int n = 0; n < paramCount; n++ )
{
func->parameterTypes.PushLast(params[n]);
func->inOutFlags.PushLast(inOutFlags[n]);
}
func->objectType = 0;
importedFunctions.PushLast(func);
sBindInfo info;
info.importedFunction = -1;
info.importFrom = moduleNameStringID;
bindInformations.PushLast(info);
return 0;
}
asCScriptFunction *asCModule::GetScriptFunction(int funcID)
{
return engine->scriptFunctions[funcID & 0xFFFF];
}
asCScriptFunction *asCModule::GetImportedFunction(int funcID)
{
return importedFunctions[funcID & 0xFFFF];
}
asCScriptFunction *asCModule::GetSpecialFunction(int funcID)
{
if( funcID & FUNC_IMPORTED )
return importedFunctions[funcID & 0xFFFF];
else
{
if( (funcID & 0xFFFF) == asFUNC_INIT )
return initFunction;
else if( (funcID & 0xFFFF) == asFUNC_STRING )
{
assert(false);
}
return engine->scriptFunctions[funcID & 0xFFFF];
}
}
int asCModule::AllocGlobalMemory(int size)
{
int index = (int)globalMem.GetLength();
size_t *start = globalMem.AddressOf();
globalMem.SetLength(index + size);
// Update the addresses in the globalVarPointers
for( size_t n = 0; n < globalVarPointers.GetLength(); n++ )
{
if( globalVarPointers[n] >= start && globalVarPointers[n] < (start+index) )
globalVarPointers[n] = &globalMem[0] + (size_t(globalVarPointers[n]) - size_t(start))/sizeof(void*);
}
return index;
}
int asCModule::AddContextRef()
{
ENTERCRITICALSECTION(criticalSection);
int r = ++contextCount;
LEAVECRITICALSECTION(criticalSection);
return r;
}
int asCModule::ReleaseContextRef()
{
ENTERCRITICALSECTION(criticalSection);
int r = --contextCount;
LEAVECRITICALSECTION(criticalSection);
return r;
}
int asCModule::AddModuleRef()
{
ENTERCRITICALSECTION(criticalSection);
int r = ++moduleCount;
LEAVECRITICALSECTION(criticalSection);
return r;
}
int asCModule::ReleaseModuleRef()
{
ENTERCRITICALSECTION(criticalSection);
int r = --moduleCount;
LEAVECRITICALSECTION(criticalSection);
return r;
}
bool asCModule::CanDelete()
{
// Don't delete if not discarded
if( !isDiscarded ) return false;
// Are there any contexts still referencing the module?
if( contextCount ) return false;
// If there are modules referencing this one we need to check for circular referencing
if( moduleCount )
{
// Check if all the modules are without external reference
asCArray<asCModule*> modules;
if( CanDeleteAllReferences(modules) )
{
// Unbind all functions. This will break any circular references
for( size_t n = 0; n < bindInformations.GetLength(); n++ )
{
int oldFuncID = bindInformations[n].importedFunction;
if( oldFuncID != -1 )
{
asCModule *oldModule = engine->GetModuleFromFuncId(oldFuncID);
if( oldModule != 0 )
{
// Release reference to the module
oldModule->ReleaseModuleRef();
}
}
}
}
// Can't delete the module yet because the
// other modules haven't released this one
return false;
}
return true;
}
bool asCModule::CanDeleteAllReferences(asCArray<asCModule*> &modules)
{
if( !isDiscarded ) return false;
if( contextCount ) return false;
modules.PushLast(this);
// Check all bound functions for referenced modules
for( size_t n = 0; n < bindInformations.GetLength(); n++ )
{
int funcID = bindInformations[n].importedFunction;
asCModule *module = engine->GetModuleFromFuncId(funcID);
// If the module is already in the list don't check it again
bool inList = false;
for( size_t m = 0; m < modules.GetLength(); m++ )
{
if( modules[m] == module )
{
inList = true;
break;
}
}
if( !inList )
{
bool ret = module->CanDeleteAllReferences(modules);
if( ret == false ) return false;
}
}
// If no module has external references then all can be deleted
return true;
}
int asCModule::BindImportedFunction(int index, int sourceID)
{
// Remove reference to old module
int oldFuncID = bindInformations[index].importedFunction;
if( oldFuncID != -1 )
{
asCModule *oldModule = engine->GetModuleFromFuncId(oldFuncID);
if( oldModule != 0 )
{
// Release reference to the module
oldModule->ReleaseModuleRef();
}
}
if( sourceID == -1 )
{
bindInformations[index].importedFunction = -1;
return asSUCCESS;
}
// Must verify that the interfaces are equal
asCModule *srcModule = engine->GetModuleFromFuncId(sourceID);
if( srcModule == 0 ) return asNO_MODULE;
asCScriptFunction *dst = GetImportedFunction(index);
if( dst == 0 ) return asNO_FUNCTION;
asCScriptFunction *src = srcModule->GetScriptFunction(sourceID);
if( src == 0 ) return asNO_FUNCTION;
// Verify return type
if( dst->returnType != src->returnType )
return asINVALID_INTERFACE;
if( dst->parameterTypes.GetLength() != src->parameterTypes.GetLength() )
return asINVALID_INTERFACE;
for( size_t n = 0; n < dst->parameterTypes.GetLength(); ++n )
{
if( dst->parameterTypes[n] != src->parameterTypes[n] )
return asINVALID_INTERFACE;
}
// Add reference to new module
srcModule->AddModuleRef();
bindInformations[index].importedFunction = sourceID;
return asSUCCESS;
}
const char *asCModule::GetImportedFunctionSourceModule(int index)
{
if( index >= (int)bindInformations.GetLength() )
return 0;
index = bindInformations[index].importFrom;
return stringConstants[index]->AddressOf();
}
bool asCModule::IsUsed()
{
if( contextCount ) return true;
if( moduleCount ) return true;
return false;
}
asCObjectType *asCModule::GetObjectType(const char *type)
{
// TODO: Improve linear search
for( size_t n = 0; n < classTypes.GetLength(); n++ )
if( classTypes[n]->name == type )
return classTypes[n];
return 0;
}
asCObjectType *asCModule::RefObjectType(asCObjectType *type)
{
if( !type ) return 0;
// Determine the index local to the module
for( size_t n = 0; n < usedTypes.GetLength(); n++ )
if( usedTypes[n] == type ) return type;
usedTypes.PushLast(type);
type->refCount++;
RefConfigGroupForObjectType(type);
return type;
}
void asCModule::RefConfigGroupForFunction(int funcId)
{
// Find the config group where the function was registered
asCConfigGroup *group = engine->FindConfigGroupForFunction(funcId);
if( group == 0 )
return;
// Verify if the module is already referencing the config group
for( size_t n = 0; n < configGroups.GetLength(); n++ )
{
if( configGroups[n] == group )
return;
}
// Add reference to the group
configGroups.PushLast(group);
group->AddRef();
}
void asCModule::RefConfigGroupForGlobalVar(int gvarId)
{
// Find the config group where the function was registered
asCConfigGroup *group = engine->FindConfigGroupForGlobalVar(gvarId);
if( group == 0 )
return;
// Verify if the module is already referencing the config group
for( size_t n = 0; n < configGroups.GetLength(); n++ )
{
if( configGroups[n] == group )
return;
}
// Add reference to the group
configGroups.PushLast(group);
group->AddRef();
}
void asCModule::RefConfigGroupForObjectType(asCObjectType *type)
{
if( type == 0 ) return;
// Find the config group where the function was registered
asCConfigGroup *group = engine->FindConfigGroupForObjectType(type);
if( group == 0 )
return;
// Verify if the module is already referencing the config group
for( size_t n = 0; n < configGroups.GetLength(); n++ )
{
if( configGroups[n] == group )
return;
}
// Add reference to the group
configGroups.PushLast(group);
group->AddRef();
}
int asCModule::GetGlobalVarIndex(int propIdx)
{
void *ptr = 0;
if( propIdx < 0 )
ptr = engine->globalPropAddresses[-int(propIdx) - 1];
else
ptr = globalMem.AddressOf() + (propIdx & 0xFFFF);
for( int n = 0; n < (signed)globalVarPointers.GetLength(); n++ )
if( globalVarPointers[n] == ptr )
return n;
globalVarPointers.PushLast(ptr);
return (int)globalVarPointers.GetLength()-1;
}
void asCModule::UpdateGlobalVarPointer(void *pold, void *pnew)
{
for( asUINT n = 0; n < globalVarPointers.GetLength(); n++ )
if( globalVarPointers[n] == pold )
{
globalVarPointers[n] = pnew;
return;
}
}
END_AS_NAMESPACE
| 22.035398 | 201 | 0.689809 |
103ff94c3f3d0fd8945df53e14902601760d9e72 | 5,287 | cpp | C++ | options/posix/generic/sys-socket-stubs.cpp | 64/mlibc | 81d17ab95b5b8a0bd7bf67cec8c7f773c6d762da | [
"MIT"
] | 1 | 2021-07-05T04:19:56.000Z | 2021-07-05T04:19:56.000Z | options/posix/generic/sys-socket-stubs.cpp | 64/mlibc | 81d17ab95b5b8a0bd7bf67cec8c7f773c6d762da | [
"MIT"
] | null | null | null | options/posix/generic/sys-socket-stubs.cpp | 64/mlibc | 81d17ab95b5b8a0bd7bf67cec8c7f773c6d762da | [
"MIT"
] | null | null | null |
#include <errno.h>
#include <sys/socket.h>
#include <bits/ensure.h>
#include <mlibc/debug.hpp>
#include <mlibc/posix-sysdeps.hpp>
int accept(int fd, struct sockaddr *__restrict addr_ptr, socklen_t *__restrict addr_length) {
if(addr_ptr || addr_length)
mlibc::infoLogger() << "\e[35mmlibc: accept() does not fill struct sockaddr\e[39m"
<< frg::endlog;
int newfd;
if(!mlibc::sys_accept) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_accept(fd, &newfd); e) {
errno = e;
return -1;
}
return newfd;
}
int bind(int fd, const struct sockaddr *addr_ptr, socklen_t addr_len) {
if(!mlibc::sys_bind) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_bind(fd, addr_ptr, addr_len); e) {
errno = e;
return -1;
}
return 0;
}
int connect(int fd, const struct sockaddr *addr_ptr, socklen_t addr_len) {
if(!mlibc::sys_connect) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_connect(fd, addr_ptr, addr_len); e) {
errno = e;
return -1;
}
return 0;
}
int getpeername(int fd, struct sockaddr *addr_ptr, socklen_t *__restrict addr_length) {
socklen_t actual_length;
if(!mlibc::sys_peername) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_peername(fd, addr_ptr, *addr_length, &actual_length); e) {
errno = e;
return -1;
}
*addr_length = actual_length;
return 0;
}
int getsockname(int fd, struct sockaddr *__restrict addr_ptr, socklen_t *__restrict addr_length) {
socklen_t actual_length;
if(!mlibc::sys_sockname) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_sockname(fd, addr_ptr, *addr_length, &actual_length); e) {
errno = e;
return -1;
}
*addr_length = actual_length;
return 0;
}
int getsockopt(int fd, int layer, int number,
void *__restrict buffer, socklen_t *__restrict size) {
if(!mlibc::sys_getsockopt) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
return mlibc::sys_getsockopt(fd, layer, number, buffer, size);
}
int listen(int fd, int backlog) {
if(!mlibc::sys_listen) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_listen(fd, backlog); e) {
errno = e;
return -1;
}
return 0;
}
ssize_t recv(int sockfd, void *__restrict buf, size_t len, int flags) {
return recvfrom(sockfd, buf, len, flags, NULL, NULL);
}
ssize_t recvfrom(int sockfd, void *__restrict buf, size_t len, int flags,
struct sockaddr *__restrict src_addr, socklen_t *__restrict addrlen) {
struct iovec iov = {};
iov.iov_base = buf;
iov.iov_len = len;
struct msghdr hdr = {};
hdr.msg_name = src_addr;
if (addrlen) {
hdr.msg_namelen = *addrlen;
}
hdr.msg_iov = &iov;
hdr.msg_iovlen = 1;
int ret = recvmsg(sockfd, &hdr, flags);
if (ret < 0)
return ret;
if(addrlen)
*addrlen = hdr.msg_namelen;
return ret;
}
ssize_t recvmsg(int fd, struct msghdr *hdr, int flags) {
ssize_t length;
if(!mlibc::sys_msg_recv) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_msg_recv(fd, hdr, flags, &length); e) {
errno = e;
return -1;
}
return length;
}
int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags, struct timespec *timeout) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
ssize_t send(int fd, const void *buffer, size_t size, int flags) {
return sendto(fd, buffer, size, flags, nullptr, 0);
}
ssize_t sendto(int fd, const void *buffer, size_t size, int flags,
const struct sockaddr *sock_addr, socklen_t addr_length) {
struct iovec iov = {};
iov.iov_base = const_cast<void *>(buffer);
iov.iov_len = size;
struct msghdr hdr = {};
hdr.msg_name = const_cast<struct sockaddr *>(sock_addr);
hdr.msg_namelen = addr_length;
hdr.msg_iov = &iov;
hdr.msg_iovlen = 1;
return sendmsg(fd, &hdr, flags);
}
ssize_t sendmsg(int fd, const struct msghdr *hdr, int flags) {
ssize_t length;
if(!mlibc::sys_msg_send) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_msg_send(fd, hdr, flags, &length); e) {
errno = e;
return -1;
}
return length;
}
int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
int setsockopt(int fd, int layer, int number,
const void *buffer, socklen_t size) {
if(!mlibc::sys_setsockopt) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
return mlibc::sys_setsockopt(fd, layer, number, buffer, size);
}
int shutdown(int, int) {
mlibc::infoLogger() << "mlibc: shutdown() is a no-op!" << frg::endlog;
return 0;
}
int sockatmark(int) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
int socket(int family, int type, int protocol) {
int fd;
if(!mlibc::sys_socket) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_socket(family, type, protocol, &fd); e) {
errno = e;
return -1;
}
return fd;
}
int socketpair(int domain, int type, int protocol, int sv[2]) {
if(!mlibc::sys_socketpair) {
MLIBC_MISSING_SYSDEP();
errno = ENOSYS;
return -1;
}
if(int e = mlibc::sys_socketpair(domain, type, protocol, sv); e) {
errno = e;
return -1;
}
return 0;
}
// connectpair() is provided by the platform
| 22.214286 | 106 | 0.680726 |
104117324ffaae6d14a0b89bcd166764fd676047 | 7,989 | cpp | C++ | src/file.cpp | sreedishps/scribe | 033b701f665b195229b8b93505ccb4cd2f8ac0f7 | [
"Apache-2.0"
] | 7 | 2015-01-29T14:41:28.000Z | 2021-03-09T01:29:58.000Z | src/file.cpp | sreedishps/scribe | 033b701f665b195229b8b93505ccb4cd2f8ac0f7 | [
"Apache-2.0"
] | 2 | 2015-03-23T03:59:12.000Z | 2015-03-27T07:12:41.000Z | src/file.cpp | sreedishps/scribe | 033b701f665b195229b8b93505ccb4cd2f8ac0f7 | [
"Apache-2.0"
] | 5 | 2015-03-03T06:54:00.000Z | 2018-10-16T21:08:02.000Z | // Copyright (c) 2007-2008 Facebook
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// See accompanying file LICENSE or visit the Scribe site at:
// http://developers.facebook.com/scribe/
//
// @author Bobby Johnson
// @author Jason Sobel
// @author Avinash Lakshman
#include "common.h"
#include "file.h"
#include "HdfsFile.h"
#define INITIAL_BUFFER_SIZE (64 * 1024)
#define LARGE_BUFFER_SIZE (16 * INITIAL_BUFFER_SIZE) /* arbitrarily chosen */
#define UINT_SIZE 4
using namespace std;
using boost::shared_ptr;
boost::shared_ptr<FileInterface> FileInterface::createFileInterface(const std::string& type,
const std::string& name,
bool framed) {
if (0 == type.compare("std")) {
return shared_ptr<FileInterface>(new StdFile(name, framed));
} else if (0 == type.compare("hdfs")) {
return shared_ptr<FileInterface>(new HdfsFile(name));
} else {
return shared_ptr<FileInterface>();
}
}
std::vector<std::string> FileInterface::list(const std::string& path, const std::string &fsType) {
std::vector<std::string> files;
shared_ptr<FileInterface> concrete_file = createFileInterface(fsType, path);
if (concrete_file) {
concrete_file->listImpl(path, files);
}
return files;
}
FileInterface::FileInterface(const std::string& name, bool frame)
: framed(frame), filename(name) {
}
FileInterface::~FileInterface() {
}
StdFile::StdFile(const std::string& name, bool frame)
: FileInterface(name, frame), inputBuffer(NULL), bufferSize(0) {
}
StdFile::~StdFile() {
if (inputBuffer) {
delete[] inputBuffer;
inputBuffer = NULL;
}
}
bool StdFile::openRead() {
return open(fstream::in);
}
bool StdFile::openWrite() {
// open file for write in append mode
ios_base::openmode mode = fstream::out | fstream::app;
return open(mode);
}
bool StdFile::openTruncate() {
// open an existing file for write and truncate its contents
ios_base::openmode mode = fstream::out | fstream::app | fstream::trunc;
return open(mode);
}
bool StdFile::open(ios_base::openmode mode) {
if (file.is_open()) {
return false;
}
file.open(filename.c_str(), mode);
return file.good();
}
bool StdFile::isOpen() {
return file.is_open();
}
bool StdFile::exists() {
struct stat buf;
return (stat(filename.c_str(), &buf) == 0);
}
void StdFile::close() {
if (file.is_open()) {
file.close();
}
}
string StdFile::getFrame(unsigned data_length) {
if (framed) {
char buf[UINT_SIZE];
serializeUInt(data_length, buf);
return string(buf, UINT_SIZE);
} else {
return string();
}
}
bool StdFile::write(const std::string& data) {
if (!file.is_open()) {
return false;
}
file << data;
if (file.bad()) {
return false;
}
return true;
}
void StdFile::flush() {
if (file.is_open()) {
file.flush();
}
}
/*
* read the next frame in the file that is currently open. returns the
* body of the frame in _return.
*
* returns a negative number if it
* encounters any problem when reading from the file. The negative
* number is the number of bytes in the file that will not be read
* becuase of this problem (most likely corruption of file).
*
* returns 0 on end of file or when it encounters a frame of size 0
*
* On success it returns the number of bytes in the frame's body
*
* This function assumes that the file it is reading is framed.
*/
long
StdFile::readNext(std::string& _return) {
long size;
#define CALC_LOSS() do { \
int offset = file.tellg(); \
if (offset != -1) { \
size = -(fileSize() - offset); \
} else { \
size = -fileSize(); \
} \
if (size > 0) { \
/* loss size can't be positive \
* choose a arbitrary but reasonable
* value for loss
*/ \
size = -(1000 * 1000 * 1000); \
} \
/* loss size can be 0 */ \
} while (0)
if (!inputBuffer) {
bufferSize = INITIAL_BUFFER_SIZE;
inputBuffer = (char *) malloc(bufferSize);
if (inputBuffer == NULL) {
CALC_LOSS();
LOG_OPER("WARNING: nomem Data Loss loss %ld bytes in %s", size,
filename.c_str());
return (size);
}
}
file.read(inputBuffer, UINT_SIZE);
if (!file.good() || (size = unserializeUInt(inputBuffer)) == 0) {
/* end of file */
return (0);
}
// check if most signiifcant bit set - should never be set
if (size >= INT_MAX) {
/* Definitely corrupted. Stop reading any further */
CALC_LOSS();
LOG_OPER("WARNING: Corruption Data Loss %ld bytes in %s", size,
filename.c_str());
return (size);
}
if (size > bufferSize) {
bufferSize = ((size + INITIAL_BUFFER_SIZE - 1) / INITIAL_BUFFER_SIZE) *
INITIAL_BUFFER_SIZE;
free(inputBuffer);
inputBuffer = (char *) malloc(bufferSize);
if (bufferSize > LARGE_BUFFER_SIZE) {
LOG_OPER("WARNING: allocating large buffer Corruption? %d", bufferSize);
}
}
if (inputBuffer == NULL) {
CALC_LOSS();
LOG_OPER("WARNING: nomem Corruption? Data Loss %ld bytes in %s", size,
filename.c_str());
return (size);
}
file.read(inputBuffer, size);
if (file.good()) {
_return.assign(inputBuffer, size);
} else {
CALC_LOSS();
LOG_OPER("WARNING: Data Loss %ld bytes in %s", size, filename.c_str());
}
if (bufferSize > LARGE_BUFFER_SIZE) {
free(inputBuffer);
inputBuffer = NULL;
}
return (size);
#undef CALC_LOSS
}
unsigned long StdFile::fileSize() {
unsigned long size = 0;
try {
size = boost::filesystem::file_size(filename.c_str());
} catch(const std::exception& e) {
LOG_OPER("Failed to get size for file <%s> error <%s>", filename.c_str(), e.what());
size = 0;
}
return size;
}
void StdFile::listImpl(const std::string& path, std::vector<std::string>& _return) {
try {
if (boost::filesystem::exists(path)) {
boost::filesystem::directory_iterator dir_iter(path), end_iter;
for ( ; dir_iter != end_iter; ++dir_iter) {
_return.push_back(dir_iter->filename());
}
}
} catch (const std::exception& e) {
LOG_OPER("exception <%s> listing files in <%s>",
e.what(), path.c_str());
}
}
void StdFile::deleteFile() {
boost::filesystem::remove(filename);
}
bool StdFile::createDirectory(std::string path) {
try {
boost::filesystem::create_directories(path);
} catch(const std::exception& e) {
LOG_OPER("Exception < %s > in StdFile::createDirectory for path %s ",
e.what(),path.c_str());
return false;
}
return true;
}
bool StdFile::createSymlink(std::string oldpath, std::string newpath) {
if (symlink(oldpath.c_str(), newpath.c_str()) == 0) {
return true;
}
return false;
}
// Buffer had better be at least UINT_SIZE long!
unsigned FileInterface::unserializeUInt(const char* buffer) {
unsigned retval = 0;
int i;
for (i = 0; i < UINT_SIZE; ++i) {
retval |= (unsigned char)buffer[i] << (8 * i);
}
return retval;
}
void FileInterface::serializeUInt(unsigned data, char* buffer) {
int i;
for (i = 0; i < UINT_SIZE; ++i) {
buffer[i] = (unsigned char)((data >> (8 * i)) & 0xFF);
}
}
| 26.453642 | 98 | 0.615847 |
1041737a1c37d31376a2aba5941dc7aeeb4c8aaa | 1,179 | cc | C++ | chromium/ios/public/provider/chrome/browser/browser_state/chrome_browser_state.cc | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | chromium/ios/public/provider/chrome/browser/browser_state/chrome_browser_state.cc | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | chromium/ios/public/provider/chrome/browser/browser_state/chrome_browser_state.cc | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
#include "base/files/file_path.h"
#include "ios/public/provider/web/web_ui_ios.h"
#include "ios/web/public/web_state/web_state.h"
namespace ios {
// static
ChromeBrowserState* ChromeBrowserState::FromBrowserState(
web::BrowserState* browser_state) {
// This is safe; this is the only implementation of BrowserState.
return static_cast<ChromeBrowserState*>(browser_state);
}
// static
ChromeBrowserState* ChromeBrowserState::FromWebUIIOS(web::WebUIIOS* web_ui) {
return FromBrowserState(web_ui->GetWebState()->GetBrowserState());
}
std::string ChromeBrowserState::GetDebugName() {
// The debug name is based on the state path of the original browser state
// to keep in sync with the meaning on other platforms.
std::string name =
GetOriginalChromeBrowserState()->GetStatePath().BaseName().MaybeAsASCII();
if (name.empty()) {
name = "UnknownBrowserState";
}
return name;
}
} // namespace ios
| 31.864865 | 82 | 0.754029 |
10424238b789e0e4c362d208e9ed08984fdf4ba9 | 2,690 | cc | C++ | CondFormats/CSCObjects/src/CSCTriggerMapping.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondFormats/CSCObjects/src/CSCTriggerMapping.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondFormats/CSCObjects/src/CSCTriggerMapping.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #include <CondFormats/CSCObjects/interface/CSCTriggerMapping.h>
#include <DataFormats/MuonDetId/interface/CSCTriggerNumbering.h>
#include <iostream>
CSCTriggerMapping::CSCTriggerMapping() : myName_("CSCTriggerMapping"), debugV_(false) {}
CSCTriggerMapping::~CSCTriggerMapping() {}
int CSCTriggerMapping::chamber(int endcap, int station, int sector, int subsector, int cscid) const {
// Build hw id from input, find sw id to match
int cid = 0;
int hid = hwId(endcap, station, sector, subsector, cscid);
// Search for that hw id in mapping
std::map<int, int>::const_iterator it = hw2sw_.find(hid);
if (it != hw2sw_.end()) {
cid = it->second;
if (debugV())
std::cout << myName_ << ": for requested hw id = " << hid << ", found sw id = " << cid << std::endl;
} else {
std::cout << myName_ << ": ERROR, cannot find requested hw id = " << hid << " in mapping." << std::endl;
}
return cid;
}
CSCDetId CSCTriggerMapping::detId(int endcap, int station, int sector, int subsector, int cscid, int layer) const {
int cid = chamber(endcap, station, sector, subsector, cscid);
int lid = cid + layer;
return CSCDetId(lid);
}
void CSCTriggerMapping::addRecord(int rendcap,
int rstation,
int rsector,
int rsubsector,
int rcscid,
int cendcap,
int cstation,
int csector,
int csubsector,
int ccscid) {
Connection newRecord(rendcap, rstation, rsector, rsubsector, rcscid, cendcap, cstation, csector, csubsector, ccscid);
mapping_.push_back(newRecord);
int hid = hwId(rendcap, rstation, rsector, rsubsector, rcscid);
int sid = swId(cendcap, cstation, csector, csubsector, ccscid);
if (debugV())
std::cout << myName_ << ": map hw " << hid << " to sw " << sid << std::endl;
if (hw2sw_.insert(std::make_pair(hid, sid)).second) {
if (debugV())
std::cout << myName_ << ": insert pair succeeded." << std::endl;
} else {
std::cout << myName_ << ": ERROR, already have key = " << hid << std::endl;
}
}
int CSCTriggerMapping::swId(int endcap, int station, int sector, int subsector, int cscid) const {
// Software id is just CSCDetId for the chamber
int ring = CSCTriggerNumbering::ringFromTriggerLabels(station, cscid);
int chamber = CSCTriggerNumbering::chamberFromTriggerLabels(sector, subsector, station, cscid);
return CSCDetId::rawIdMaker(endcap, station, ring, chamber, 0); // usual detid for chamber, i.e. layer=0
}
| 44.098361 | 119 | 0.611896 |
1048a8427c1fbbe3fff05c3c1363549ab33cc288 | 15,584 | cpp | C++ | Source/core/rendering/RenderQuote.cpp | Fusion-Rom/android_external_chromium_org_third_party_WebKit | 8865f83aaf400ef5f7c234a70da404d3fc5e1272 | [
"BSD-3-Clause"
] | 2 | 2016-05-19T10:37:25.000Z | 2019-09-18T04:37:14.000Z | Source/core/rendering/RenderQuote.cpp | Fusion-Rom/android_external_chromium_org_third_party_WebKit | 8865f83aaf400ef5f7c234a70da404d3fc5e1272 | [
"BSD-3-Clause"
] | null | null | null | Source/core/rendering/RenderQuote.cpp | Fusion-Rom/android_external_chromium_org_third_party_WebKit | 8865f83aaf400ef5f7c234a70da404d3fc5e1272 | [
"BSD-3-Clause"
] | 7 | 2015-09-23T09:56:29.000Z | 2022-01-20T10:36:06.000Z | /**
* Copyright (C) 2011 Nokia Inc. All rights reserved.
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "core/rendering/RenderQuote.h"
#include "core/rendering/RenderTextFragment.h"
#include "core/rendering/RenderView.h"
#include "wtf/StdLibExtras.h"
#include "wtf/text/AtomicString.h"
#include <algorithm>
namespace blink {
RenderQuote::RenderQuote(Document* node, QuoteType quote)
: RenderInline(0)
, m_type(quote)
, m_depth(0)
, m_next(nullptr)
, m_previous(nullptr)
, m_attached(false)
{
setDocumentForAnonymous(node);
}
RenderQuote::~RenderQuote()
{
ASSERT(!m_attached);
ASSERT(!m_next && !m_previous);
}
void RenderQuote::trace(Visitor* visitor)
{
visitor->trace(m_next);
visitor->trace(m_previous);
RenderInline::trace(visitor);
}
void RenderQuote::willBeDestroyed()
{
detachQuote();
RenderInline::willBeDestroyed();
}
void RenderQuote::willBeRemovedFromTree()
{
RenderInline::willBeRemovedFromTree();
detachQuote();
}
void RenderQuote::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderInline::styleDidChange(diff, oldStyle);
updateText();
}
struct Language {
const char* lang;
UChar open1;
UChar close1;
UChar open2;
UChar close2;
QuotesData* data;
bool operator<(const Language& b) const { return strcmp(lang, b.lang) < 0; }
};
// Table of quotes from http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#quote
Language languages[] = {
{ "af", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "agq", 0x201e, 0x201d, 0x201a, 0x2019, 0 },
{ "ak", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "am", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "ar", 0x201d, 0x201c, 0x2019, 0x2018, 0 },
{ "asa", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "az-cyrl", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "bas", 0x00ab, 0x00bb, 0x201e, 0x201c, 0 },
{ "bem", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "bez", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "bg", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "bm", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "bn", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "br", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "brx", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "bs-cyrl" , 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "ca", 0x201c, 0x201d, 0x00ab, 0x00bb, 0 },
{ "cgg", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "chr", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "cs", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "da", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "dav", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "de", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "de-ch", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "dje", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "dua", 0x00ab, 0x00bb, 0x2018, 0x2019, 0 },
{ "dyo", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "dz", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ebu", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ee", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "el", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "en", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "en-gb", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "es", 0x201c, 0x201d, 0x00ab, 0x00bb, 0 },
{ "et", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "eu", 0x201c, 0x201d, 0x00ab, 0x00bb, 0 },
{ "ewo", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "fa", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "ff", 0x201e, 0x201d, 0x201a, 0x2019, 0 },
{ "fi", 0x201d, 0x201d, 0x2019, 0x2019, 0 },
{ "fr", 0x00ab, 0x00bb, 0x00ab, 0x00bb, 0 },
{ "fr-ca", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "fr-ch", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "gsw", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "gu", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "guz", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ha", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "he", 0x0022, 0x0022, 0x0027, 0x0027, 0 },
{ "hi", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "hr", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "hu", 0x201e, 0x201d, 0x00bb, 0x00ab, 0 },
{ "id", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ig", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "it", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "ja", 0x300c, 0x300d, 0x300e, 0x300f, 0 },
{ "jgo", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "jmc", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "kab", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "kam", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "kde", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "kea", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "khq", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ki", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "kkj", 0x00ab, 0x00bb, 0x2039, 0x203a, 0 },
{ "kln", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "km", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "kn", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ko", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ksb", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ksf", 0x00ab, 0x00bb, 0x2018, 0x2019, 0 },
{ "lag", 0x201d, 0x201d, 0x2019, 0x2019, 0 },
{ "lg", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ln", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "lo", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "lt", 0x201e, 0x201c, 0x201e, 0x201c, 0 },
{ "lu", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "luo", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "luy", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "lv", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mas", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mer", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mfe", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mg", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "mgo", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mk", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "ml", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mr", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ms", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "mua", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "my", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "naq", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "nb", 0x00ab, 0x00bb, 0x2018, 0x2019, 0 },
{ "nd", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "nl", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "nmg", 0x201e, 0x201d, 0x00ab, 0x00bb, 0 },
{ "nn", 0x00ab, 0x00bb, 0x2018, 0x2019, 0 },
{ "nnh", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "nus", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "nyn", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "pl", 0x201e, 0x201d, 0x00ab, 0x00bb, 0 },
{ "pt", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "pt-pt", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "rn", 0x201d, 0x201d, 0x2019, 0x2019, 0 },
{ "ro", 0x201e, 0x201d, 0x00ab, 0x00bb, 0 },
{ "rof", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ru", 0x00ab, 0x00bb, 0x201e, 0x201c, 0 },
{ "rw", 0x00ab, 0x00bb, 0x2018, 0x2019, 0 },
{ "rwk", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "saq", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "sbp", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "seh", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ses", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "sg", 0x00ab, 0x00bb, 0x201c, 0x201d, 0 },
{ "shi", 0x00ab, 0x00bb, 0x201e, 0x201d, 0 },
{ "shi-tfng", 0x00ab, 0x00bb, 0x201e, 0x201d, 0 },
{ "si", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "sk", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "sl", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "sn", 0x201d, 0x201d, 0x2019, 0x2019, 0 },
{ "so", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "sq", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "sr", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "sr-latn", 0x201e, 0x201c, 0x201a, 0x2018, 0 },
{ "sv", 0x201d, 0x201d, 0x2019, 0x2019, 0 },
{ "sw", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "swc", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ta", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "te", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "teo", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "th", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "ti-er", 0x2018, 0x2019, 0x201c, 0x201d, 0 },
{ "to", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "tr", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "twq", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "tzm", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "uk", 0x00ab, 0x00bb, 0x201e, 0x201c, 0 },
{ "ur", 0x201d, 0x201c, 0x2019, 0x2018, 0 },
{ "vai", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "vai-latn", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "vi", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "vun", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "xh", 0x2018, 0x2019, 0x201c, 0x201d, 0 },
{ "xog", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "yav", 0x00ab, 0x00bb, 0x00ab, 0x00bb, 0 },
{ "yo", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "zh", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
{ "zh-hant", 0x300c, 0x300d, 0x300e, 0x300f, 0 },
{ "zu", 0x201c, 0x201d, 0x2018, 0x2019, 0 },
};
const QuotesData* quotesDataForLanguage(const AtomicString& lang)
{
if (lang.isNull())
return 0;
// This could be just a hash table, but doing that adds 200k to RenderQuote.o
Language* languagesEnd = languages + WTF_ARRAY_LENGTH(languages);
CString lowercaseLang = lang.lower().utf8();
Language key = { lowercaseLang.data(), 0, 0, 0, 0, 0 };
Language* match = std::lower_bound(languages, languagesEnd, key);
if (match == languagesEnd || strcmp(match->lang, key.lang))
return 0;
if (!match->data)
match->data = QuotesData::create(match->open1, match->close1, match->open2, match->close2).leakRef();
return match->data;
}
static const QuotesData* basicQuotesData()
{
// FIXME: The default quotes should be the fancy quotes for "en".
DEFINE_STATIC_REF(QuotesData, staticBasicQuotes, (QuotesData::create('"', '"', '\'', '\'')));
return staticBasicQuotes;
}
void RenderQuote::updateText()
{
String text = computeText();
if (m_text == text)
return;
m_text = text;
while (RenderObject* child = lastChild())
child->destroy();
RenderTextFragment* fragment = new RenderTextFragment(&document(), m_text.impl());
fragment->setStyle(style());
addChild(fragment);
}
String RenderQuote::computeText() const
{
switch (m_type) {
case NO_OPEN_QUOTE:
case NO_CLOSE_QUOTE:
return emptyString();
case CLOSE_QUOTE:
return quotesData()->getCloseQuote(m_depth - 1).impl();
case OPEN_QUOTE:
return quotesData()->getOpenQuote(m_depth).impl();
}
ASSERT_NOT_REACHED();
return emptyString();
}
const QuotesData* RenderQuote::quotesData() const
{
if (const QuotesData* customQuotes = style()->quotes())
return customQuotes;
if (const QuotesData* quotes = quotesDataForLanguage(style()->locale()))
return quotes;
return basicQuotesData();
}
void RenderQuote::attachQuote()
{
ASSERT(view());
ASSERT(!m_attached);
ASSERT(!m_next && !m_previous);
ASSERT(isRooted());
if (!view()->renderQuoteHead()) {
view()->setRenderQuoteHead(this);
m_attached = true;
return;
}
for (RenderObject* predecessor = previousInPreOrder(); predecessor; predecessor = predecessor->previousInPreOrder()) {
// Skip unattached predecessors to avoid having stale m_previous pointers
// if the previous node is never attached and is then destroyed.
if (!predecessor->isQuote() || !toRenderQuote(predecessor)->isAttached())
continue;
m_previous = toRenderQuote(predecessor);
m_next = m_previous->m_next;
m_previous->m_next = this;
if (m_next)
m_next->m_previous = this;
break;
}
if (!m_previous) {
m_next = view()->renderQuoteHead();
view()->setRenderQuoteHead(this);
if (m_next)
m_next->m_previous = this;
}
m_attached = true;
for (RenderQuote* quote = this; quote; quote = quote->m_next)
quote->updateDepth();
ASSERT(!m_next || m_next->m_attached);
ASSERT(!m_next || m_next->m_previous == this);
ASSERT(!m_previous || m_previous->m_attached);
ASSERT(!m_previous || m_previous->m_next == this);
}
void RenderQuote::detachQuote()
{
ASSERT(!m_next || m_next->m_attached);
ASSERT(!m_previous || m_previous->m_attached);
if (!m_attached)
return;
if (m_previous)
m_previous->m_next = m_next;
else if (view())
view()->setRenderQuoteHead(m_next);
if (m_next)
m_next->m_previous = m_previous;
if (!documentBeingDestroyed()) {
for (RenderQuote* quote = m_next; quote; quote = quote->m_next)
quote->updateDepth();
}
m_attached = false;
m_next = nullptr;
m_previous = nullptr;
m_depth = 0;
}
void RenderQuote::updateDepth()
{
ASSERT(m_attached);
int oldDepth = m_depth;
m_depth = 0;
if (m_previous) {
m_depth = m_previous->m_depth;
switch (m_previous->m_type) {
case OPEN_QUOTE:
case NO_OPEN_QUOTE:
m_depth++;
break;
case CLOSE_QUOTE:
case NO_CLOSE_QUOTE:
if (m_depth)
m_depth--;
break;
}
}
if (oldDepth != m_depth)
updateText();
}
} // namespace blink
| 39.353535 | 122 | 0.543955 |
1048b0075f582a12c750afb1ee8b455f25793961 | 3,207 | hpp | C++ | source/thewizardplusplus/wizard_parser/vendor/range/v3/algorithm/partition_copy.hpp | thewizardplusplus/wizard-parser | a2aafcc087e6f5b96afee636831a0c6d67836218 | [
"MIT"
] | 1 | 2020-04-17T06:55:35.000Z | 2020-04-17T06:55:35.000Z | example/source/vendor/range/v3/algorithm/partition_copy.hpp | thewizardplusplus/wizard-parser | a2aafcc087e6f5b96afee636831a0c6d67836218 | [
"MIT"
] | 29 | 2017-02-24T04:36:16.000Z | 2019-03-13T00:29:39.000Z | source/thewizardplusplus/wizard_parser/vendor/range/v3/algorithm/partition_copy.hpp | thewizardplusplus/wizard-parser | a2aafcc087e6f5b96afee636831a0c6d67836218 | [
"MIT"
] | null | null | null | /// \file
// Range v3 library
//
// Copyright Eric Niebler 2014-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//
#ifndef RANGES_V3_ALGORITHM_PARTITION_COPY_HPP
#define RANGES_V3_ALGORITHM_PARTITION_COPY_HPP
#include <tuple>
#include "../../../meta/meta.hpp"
#include "../range_fwd.hpp"
#include "../begin_end.hpp"
#include "../distance.hpp"
#include "../range_concepts.hpp"
#include "../range_traits.hpp"
#include "../utility/iterator.hpp"
#include "../utility/iterator_concepts.hpp"
#include "../utility/iterator_traits.hpp"
#include "../utility/functional.hpp"
#include "../utility/static_const.hpp"
#include "../utility/tagged_tuple.hpp"
#include "../algorithm/tagspec.hpp"
namespace ranges
{
inline namespace v3
{
/// \ingroup group-concepts
template<typename I, typename O0, typename O1, typename C, typename P = ident>
using PartitionCopyable = meta::strict_and<
InputIterator<I>,
WeaklyIncrementable<O0>,
WeaklyIncrementable<O1>,
IndirectlyCopyable<I, O0>,
IndirectlyCopyable<I, O1>,
IndirectPredicate<C, projected<I, P>>>;
/// \addtogroup group-algorithms
/// @{
struct partition_copy_fn
{
template<typename I, typename S, typename O0, typename O1, typename C, typename P = ident,
CONCEPT_REQUIRES_(PartitionCopyable<I, O0, O1, C, P>() && Sentinel<S, I>())>
tagged_tuple<tag::in(I), tag::out1(O0), tag::out2(O1)>
operator()(I begin, S end, O0 o0, O1 o1, C pred, P proj = P{}) const
{
for(; begin != end; ++begin)
{
auto &&x = *begin;
if(invoke(pred, invoke(proj, x)))
{
*o0 = (decltype(x) &&) x;
++o0;
}
else
{
*o1 = (decltype(x) &&) x;
++o1;
}
}
return make_tagged_tuple<tag::in, tag::out1, tag::out2>(begin, o0, o1);
}
template<typename Rng, typename O0, typename O1, typename C, typename P = ident,
typename I = iterator_t<Rng>,
CONCEPT_REQUIRES_(PartitionCopyable<I, O0, O1, C, P>() && Range<Rng>())>
tagged_tuple<tag::in(safe_iterator_t<Rng>), tag::out1(O0), tag::out2(O1)>
operator()(Rng &&rng, O0 o0, O1 o1, C pred, P proj = P{}) const
{
return (*this)(begin(rng), end(rng), std::move(o0), std::move(o1), std::move(pred),
std::move(proj));
}
};
/// \sa `partition_copy_fn`
/// \ingroup group-algorithms
RANGES_INLINE_VARIABLE(with_braced_init_args<partition_copy_fn>,
partition_copy)
/// @}
} // namespace v3
} // namespace ranges
#endif // include guard
| 35.241758 | 102 | 0.546305 |
104a0298563a23bc7f2925dfc8fa780d9ddb9e93 | 4,885 | cc | C++ | tensorflow/lite/micro/examples/hello_world/main_functions.cc | nothinn/tensorflow | 1b0c67288dd8a2659ae2b64315b648a68789412a | [
"Apache-2.0"
] | null | null | null | tensorflow/lite/micro/examples/hello_world/main_functions.cc | nothinn/tensorflow | 1b0c67288dd8a2659ae2b64315b648a68789412a | [
"Apache-2.0"
] | 2 | 2021-08-25T16:05:43.000Z | 2022-02-10T02:04:11.000Z | tensorflow/lite/micro/examples/hello_world/main_functions.cc | nothinn/tensorflow | 1b0c67288dd8a2659ae2b64315b648a68789412a | [
"Apache-2.0"
] | null | null | null | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/micro/examples/hello_world/main_functions.h"
#include "tensorflow/lite/micro/examples/hello_world/constants.h"
#include "tensorflow/lite/micro/examples/hello_world/output_handler.h"
#include "tensorflow/lite/micro/examples/hello_world/sine_model_data.h"
#include "tensorflow/lite/micro/kernels/all_ops_resolver.h"
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Globals, used for compatibility with Arduino-style sketches.
namespace {
tflite::ErrorReporter* error_reporter = nullptr;
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;
TfLiteTensor* output = nullptr;
int inference_count = 0;
// Create an area of memory to use for input, output, and intermediate arrays.
// Finding the minimum value for your model may require some trial and error.
constexpr int kTensorArenaSize = 2 * 1024;
uint8_t tensor_arena[kTensorArenaSize];
} // namespace
// The name of this function is important for Arduino compatibility.
void setup() {
// Set up logging. Google style is to avoid globals or statics because of
// lifetime uncertainty, but since this has a trivial destructor it's okay.
// NOLINTNEXTLINE(runtime-global-variables)
static tflite::MicroErrorReporter micro_error_reporter;
error_reporter = µ_error_reporter;
TF_LITE_REPORT_ERROR(error_reporter, "This is the setup part\n");
// Map the model into a usable data structure. This doesn't involve any
// copying or parsing, it's a very lightweight operation.
model = tflite::GetModel(g_sine_model_data);
if (model->version() != TFLITE_SCHEMA_VERSION) {
TF_LITE_REPORT_ERROR(error_reporter,
"Model provided is schema version %d not equal "
"to supported version %d.",
model->version(), TFLITE_SCHEMA_VERSION);
return;
}
// This pulls in all the operation implementations we need.
// NOLINTNEXTLINE(runtime-global-variables)
static tflite::ops::micro::AllOpsResolver resolver;
// Build an interpreter to run the model with.
static tflite::MicroInterpreter static_interpreter(
model, resolver, tensor_arena, kTensorArenaSize, error_reporter);
interpreter = &static_interpreter;
// Allocate memory from the tensor_arena for the model's tensors.
TfLiteStatus allocate_status = interpreter->AllocateTensors();
if (allocate_status != kTfLiteOk) {
TF_LITE_REPORT_ERROR(error_reporter, "AllocateTensors() failed");
return;
}
// Obtain pointers to the model's input and output tensors.
input = interpreter->input(0);
output = interpreter->output(0);
// Keep track of how many inferences we have performed.
inference_count = 0;
}
// The name of this function is important for Arduino compatibility.
void loop() {
// Calculate an x value to feed into the model. We compare the current
// inference_count to the number of inferences per cycle to determine
// our position within the range of possible x values the model was
// trained on, and use this to calculate a value.
float position = static_cast<float>(inference_count) /
static_cast<float>(kInferencesPerCycle);
float x_val = position * kXrange;
// Place our calculated x value in the model's input tensor
input->data.f[0] = x_val;
// Run inference, and report any error
TfLiteStatus invoke_status = interpreter->Invoke();
if (invoke_status != kTfLiteOk) {
TF_LITE_REPORT_ERROR(error_reporter, "Invoke failed on x_val: %f\n",
static_cast<double>(x_val));
return;
}
// Read the predicted y value from the model's output tensor
float y_val = output->data.f[0];
// Output the results. A custom HandleOutput function can be implemented
// for each supported hardware target.
HandleOutput(error_reporter, x_val, y_val);
// Increment the inference_counter, and reset it if we have reached
// the total number per cycle
inference_count += 1;
if (inference_count >= kInferencesPerCycle) inference_count = 0;
}
| 40.371901 | 80 | 0.732856 |
104a22b0f1934b314928702965216b76141ca16f | 2,975 | cpp | C++ | src/third_party/mozjs-45/extract/js/src/jit/x86/Assembler-x86.cpp | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | src/third_party/mozjs-45/extract/js/src/jit/x86/Assembler-x86.cpp | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | src/third_party/mozjs-45/extract/js/src/jit/x86/Assembler-x86.cpp | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jit/x86/Assembler-x86.h"
#include "gc/Marking.h"
using namespace js;
using namespace js::jit;
ABIArgGenerator::ABIArgGenerator()
: stackOffset_(0),
current_()
{}
ABIArg
ABIArgGenerator::next(MIRType type)
{
switch (type) {
case MIRType_Int32:
case MIRType_Pointer:
current_ = ABIArg(stackOffset_);
stackOffset_ += sizeof(uint32_t);
break;
case MIRType_Float32: // Float32 moves are actually double moves
case MIRType_Double:
current_ = ABIArg(stackOffset_);
stackOffset_ += sizeof(uint64_t);
break;
case MIRType_Int32x4:
case MIRType_Float32x4:
// SIMD values aren't passed in or out of C++, so we can make up
// whatever internal ABI we like. visitAsmJSPassArg assumes
// SimdMemoryAlignment.
stackOffset_ = AlignBytes(stackOffset_, SimdMemoryAlignment);
current_ = ABIArg(stackOffset_);
stackOffset_ += Simd128DataSize;
break;
default:
MOZ_CRASH("Unexpected argument type");
}
return current_;
}
const Register ABIArgGenerator::NonArgReturnReg0 = ecx;
const Register ABIArgGenerator::NonArgReturnReg1 = edx;
const Register ABIArgGenerator::NonVolatileReg = ebx;
const Register ABIArgGenerator::NonArg_VolatileReg = eax;
const Register ABIArgGenerator::NonReturn_VolatileReg0 = ecx;
void
Assembler::executableCopy(uint8_t* buffer)
{
AssemblerX86Shared::executableCopy(buffer);
for (size_t i = 0; i < jumps_.length(); i++) {
RelativePatch& rp = jumps_[i];
X86Encoding::SetRel32(buffer + rp.offset, rp.target);
}
}
class RelocationIterator
{
CompactBufferReader reader_;
uint32_t offset_;
public:
RelocationIterator(CompactBufferReader& reader)
: reader_(reader)
{ }
bool read() {
if (!reader_.more())
return false;
offset_ = reader_.readUnsigned();
return true;
}
uint32_t offset() const {
return offset_;
}
};
static inline JitCode*
CodeFromJump(uint8_t* jump)
{
uint8_t* target = (uint8_t*)X86Encoding::GetRel32Target(jump);
return JitCode::FromExecutable(target);
}
void
Assembler::TraceJumpRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader)
{
RelocationIterator iter(reader);
while (iter.read()) {
JitCode* child = CodeFromJump(code->raw() + iter.offset());
TraceManuallyBarrieredEdge(trc, &child, "rel32");
MOZ_ASSERT(child == CodeFromJump(code->raw() + iter.offset()));
}
}
| 28.605769 | 91 | 0.646723 |
104a327f80da397e5fb8c252289e938fc8389797 | 8,166 | cpp | C++ | hardware/test/cpu_instruction_set_test.cpp | vinders/pandora_toolbox | f32e301ebaa2b281a1ffc3d6d0c556091420520a | [
"MIT"
] | 2 | 2020-11-19T03:23:35.000Z | 2021-02-25T03:34:40.000Z | hardware/test/cpu_instruction_set_test.cpp | vinders/pandora_toolbox | f32e301ebaa2b281a1ffc3d6d0c556091420520a | [
"MIT"
] | null | null | null | hardware/test/cpu_instruction_set_test.cpp | vinders/pandora_toolbox | f32e301ebaa2b281a1ffc3d6d0c556091420520a | [
"MIT"
] | null | null | null | /*******************************************************************************
MIT License
Copyright (c) 2021 Romain Vinders
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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO 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 <gtest/gtest.h>
#include <hardware/cpu_instruction_set.h>
using namespace pandora::hardware;
class CpuInstructionSetTest : public testing::Test {
public:
protected:
//static void SetUpTestCase() {}
//static void TearDownTestCase() {}
void SetUp() override {}
void TearDown() override {}
};
// -- enumerations --
TEST_F(CpuInstructionSetTest, instructionFamilySerializer) {
EXPECT_TRUE(*toString(CpuInstructionFamily::assembly));
EXPECT_TRUE(*toString(CpuInstructionFamily::mmx));
EXPECT_TRUE(*toString(CpuInstructionFamily::sse));
EXPECT_TRUE(*toString(CpuInstructionFamily::avx));
EXPECT_TRUE(*toString(CpuInstructionFamily::neon));
EXPECT_TRUE(CpuInstructionFamily_size() > 0);
CpuInstructionFamily converted = CpuInstructionFamily::assembly;
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::assembly), converted));
EXPECT_EQ(CpuInstructionFamily::assembly, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::mmx), converted));
EXPECT_EQ(CpuInstructionFamily::mmx, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::sse), converted));
EXPECT_EQ(CpuInstructionFamily::sse, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::avx), converted));
EXPECT_EQ(CpuInstructionFamily::avx, converted);
EXPECT_TRUE(fromString(toString(CpuInstructionFamily::neon), converted));
EXPECT_EQ(CpuInstructionFamily::neon, converted);
}
TEST_F(CpuInstructionSetTest, instructionFamilyFlagOps) {
CpuInstructionFamily flag1 = CpuInstructionFamily::sse;
CpuInstructionFamily flag2 = CpuInstructionFamily::sse;
EXPECT_TRUE(flag1 == flag2);
EXPECT_FALSE(flag1 != flag2);
EXPECT_FALSE(flag1 < flag2);
EXPECT_TRUE(flag1 <= flag2);
EXPECT_FALSE(flag1 > flag2);
EXPECT_TRUE(flag1 >= flag2);
flag2 = CpuInstructionFamily::avx;
EXPECT_FALSE(flag1 == flag2);
EXPECT_TRUE(flag1 != flag2);
EXPECT_EQ((static_cast<uint32_t>(flag1) < static_cast<uint32_t>(flag2)), (flag1 < flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) <= static_cast<uint32_t>(flag2)), (flag1 <= flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) > static_cast<uint32_t>(flag2)), (flag1 > flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) >= static_cast<uint32_t>(flag2)), (flag1 >= flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) & static_cast<uint32_t>(flag2)), (flag1 & flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) | static_cast<uint32_t>(flag2)), (flag1 | flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(static_cast<uint32_t>(flag1) ^ static_cast<uint32_t>(flag2)), (flag1 ^ flag2));
EXPECT_EQ(static_cast<CpuInstructionFamily>(~static_cast<uint32_t>(flag1)), (~flag1));
EXPECT_EQ((CpuInstructionFamily::sse | CpuInstructionFamily::avx), addFlag(flag1, flag2));
EXPECT_EQ((CpuInstructionFamily::sse | CpuInstructionFamily::avx), flag1);
EXPECT_EQ((CpuInstructionFamily::avx), removeFlag(flag1, CpuInstructionFamily::sse));
EXPECT_EQ((CpuInstructionFamily::avx), flag1);
}
TEST_F(CpuInstructionSetTest, instructionSetSerializer) {
CpuInstructionSet converted = CpuInstructionSet::cpp;
EXPECT_TRUE(*toString(CpuInstructionSet::cpp));
EXPECT_TRUE(fromString(toString(CpuInstructionSet::cpp), converted));
EXPECT_EQ(CpuInstructionSet::cpp, converted);
EXPECT_TRUE(CpuInstructionSet_size() > 0);
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_TRUE(*toString(instSet));
EXPECT_TRUE(fromString(toString(instSet), converted));
EXPECT_EQ(instSet, converted);
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_TRUE(*toString(instSet));
EXPECT_TRUE(fromString(toString(instSet), converted));
EXPECT_EQ(instSet, converted);
}
}
TEST_F(CpuInstructionSetTest, instructionSetFlagOps) {
CpuInstructionSet flag1 = CpuInstructionSet::sse;
CpuInstructionSet flag2 = CpuInstructionSet::sse;
EXPECT_TRUE(flag1 == flag2);
EXPECT_FALSE(flag1 != flag2);
EXPECT_FALSE(flag1 < flag2);
EXPECT_TRUE(flag1 <= flag2);
EXPECT_FALSE(flag1 > flag2);
EXPECT_TRUE(flag1 >= flag2);
flag2 = CpuInstructionSet::avx;
EXPECT_FALSE(flag1 == flag2);
EXPECT_TRUE(flag1 != flag2);
EXPECT_EQ((static_cast<uint32_t>(flag1) < static_cast<uint32_t>(flag2)), (flag1 < flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) <= static_cast<uint32_t>(flag2)), (flag1 <= flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) > static_cast<uint32_t>(flag2)), (flag1 > flag2));
EXPECT_EQ((static_cast<uint32_t>(flag1) >= static_cast<uint32_t>(flag2)), (flag1 >= flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) & static_cast<uint32_t>(flag2)), (flag1 & flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) | static_cast<uint32_t>(flag2)), (flag1 | flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(static_cast<uint32_t>(flag1) ^ static_cast<uint32_t>(flag2)), (flag1 ^ flag2));
EXPECT_EQ(static_cast<CpuInstructionSet>(~static_cast<uint32_t>(flag1)), (~flag1));
EXPECT_EQ((CpuInstructionSet::sse | CpuInstructionSet::avx), addFlag(flag1, flag2));
EXPECT_EQ((CpuInstructionSet::sse | CpuInstructionSet::avx), flag1);
}
TEST_F(CpuInstructionSetTest, instructionSetSubEnumValues) {
EXPECT_TRUE(CpuInstructionSet_size() > 0);
EXPECT_FALSE(CpuInstructionSet_x86_values().empty());
EXPECT_FALSE(CpuInstructionSet_x86_rvalues().empty());
EXPECT_FALSE(CpuInstructionSet_arm_values().empty());
EXPECT_FALSE(CpuInstructionSet_arm_rvalues().empty());
EXPECT_EQ(CpuInstructionSet_x86_values().size(), CpuInstructionSet_x86_rvalues().size());
EXPECT_EQ(CpuInstructionSet_arm_values().size(), CpuInstructionSet_arm_rvalues().size());
EXPECT_TRUE(CpuInstructionSet_x86_values().size() + CpuInstructionSet_arm_values().size() <= CpuInstructionSet_size());
}
// -- builder / extractors --
TEST_F(CpuInstructionSetTest, buildInstructionSet) {
EXPECT_EQ(CpuInstructionSet::sse, toCpuInstructionSet(pandora::system::CpuArchitecture::x86, CpuInstructionFamily::sse, 0x2));
}
TEST_F(CpuInstructionSetTest, extractInstructionFamily) {
EXPECT_EQ(CpuInstructionFamily::assembly, toCpuInstructionFamily(CpuInstructionSet::cpp));
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_TRUE(toCpuInstructionFamily(instSet) == CpuInstructionFamily::mmx
|| toCpuInstructionFamily(instSet) == CpuInstructionFamily::sse
|| toCpuInstructionFamily(instSet) == CpuInstructionFamily::avx);
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_EQ(CpuInstructionFamily::neon, toCpuInstructionFamily(instSet));
}
}
TEST_F(CpuInstructionSetTest, extractCpuArch) {
EXPECT_EQ(pandora::system::CpuArchitecture::all, toCpuArchitecture(CpuInstructionSet::cpp));
for (auto instSet : CpuInstructionSet_x86_values()) {
EXPECT_EQ(pandora::system::CpuArchitecture::x86, toCpuArchitecture(instSet));
}
for (auto instSet : CpuInstructionSet_arm_values()) {
EXPECT_EQ(pandora::system::CpuArchitecture::arm, toCpuArchitecture(instSet));
}
}
| 48.035294 | 128 | 0.75447 |
104b88ded841f8ea686069bd5c9fc4a560c0315a | 1,156 | cpp | C++ | huawei/binarysearch/binarysearch/main.cpp | RainChang/My_ACM_Exercises | 36872bdcb49cbb3eebde4bb9c7d154d057775b72 | [
"Apache-2.0"
] | 1 | 2017-03-16T09:38:48.000Z | 2017-03-16T09:38:48.000Z | huawei/binarysearch/binarysearch/main.cpp | RainChang/My_ACM_Exercises | 36872bdcb49cbb3eebde4bb9c7d154d057775b72 | [
"Apache-2.0"
] | null | null | null | huawei/binarysearch/binarysearch/main.cpp | RainChang/My_ACM_Exercises | 36872bdcb49cbb3eebde4bb9c7d154d057775b72 | [
"Apache-2.0"
] | null | null | null | //
// main.cpp
// binarysearch
//
// Created by Rain on 12/04/2017.
// Copyright © 2017 Rain. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
int getPos(vector<int> A, int n, int val) {
// write code here
vector<int>count(10000,0);
for(int i=0;i<n;i++)
{
count[A[i]]++;
}
int low=0;
int high=n-1;
int result=0,mid=0;
while(low<=high)
{
mid=(high-low)/2+low;
if(A[mid]==val)
{
result=A[mid];
break;
}
if(A[mid]<val)
{
low=mid+1;
}
else{
high=mid-1;
}
}
if(count[A[mid]]==1)
return mid;
else
{
for(int i=mid;i>=0;i--)
{
if(A[i]!=A[mid])
return i;
}
}
return 0;
}
int main(int argc, const char * argv[]) {
// insert code here...
vector<int> A={9,13,21,31};
cout<<getPos(A, 4, 9)<<endl;
return 0;
}
| 20.280702 | 47 | 0.390138 |
104c4a39144277fd702a673cd41acae54291cf78 | 426 | cpp | C++ | level1/p02_isPrime/_isPrime.cpp | KenNN99/c2019 | a668b7aa67187c8ef44bdefe5e7813d665084ff3 | [
"MIT"
] | null | null | null | level1/p02_isPrime/_isPrime.cpp | KenNN99/c2019 | a668b7aa67187c8ef44bdefe5e7813d665084ff3 | [
"MIT"
] | null | null | null | level1/p02_isPrime/_isPrime.cpp | KenNN99/c2019 | a668b7aa67187c8ef44bdefe5e7813d665084ff3 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
void NotPrime();
int main()
{
int i;
scanf("%d", &i);
if (i == 1)
{
NotPrime();
}
for (int n = 2; n*n <= i; n++)
{
if (i%n == 0)
{
NotPrime();
return 0;
}
}
printf("This is a Prime.");
system("pause");
return 0;
}
void NotPrime()
{
printf("This is not a Prime!!!");
system("pause");
<<<<<<< HEAD
}
=======
}
>>>>>>> 2b6d759c8e10cfe17d315e90703734d5f6ddb2ff
| 11.833333 | 48 | 0.528169 |
104c691c27d95e1ba124b9aec6463c2cd4d733d0 | 430 | hpp | C++ | NWNXLib/API/Mac/API/Schema.hpp | Qowyn/unified | 149d0b7670a9d156e64555fe0bd7715423db4c2a | [
"MIT"
] | null | null | null | NWNXLib/API/Mac/API/Schema.hpp | Qowyn/unified | 149d0b7670a9d156e64555fe0bd7715423db4c2a | [
"MIT"
] | null | null | null | NWNXLib/API/Mac/API/Schema.hpp | Qowyn/unified | 149d0b7670a9d156e64555fe0bd7715423db4c2a | [
"MIT"
] | null | null | null | #pragma once
#include <cstdint>
#include "Hash.hpp"
namespace NWNXLib {
namespace API {
// Forward class declarations (defined in the source file)
struct Table;
struct Schema
{
int32_t schema_cookie;
int32_t iGeneration;
Hash tblHash;
Hash idxHash;
Hash trigHash;
Hash fkeyHash;
Table* pSeqTab;
uint8_t file_format;
uint8_t enc;
uint16_t schemaFlags;
int32_t cache_size;
};
}
}
| 13.4375 | 58 | 0.686047 |
104d77282d146d7a6193a61bb24274bc0bd3ca6b | 5,540 | cpp | C++ | test/test_pex.cpp | svn2github/libtorrent-rasterbar-RC_0_16 | c2c8dc24c82816c336d7c45c3ae7a3ab3821077a | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | test/test_pex.cpp | svn2github/libtorrent-rasterbar-RC_0_16 | c2c8dc24c82816c336d7c45c3ae7a3ab3821077a | [
"BSL-1.0",
"BSD-3-Clause"
] | 1 | 2019-02-03T09:54:54.000Z | 2019-02-03T09:54:54.000Z | test/test_pex.cpp | svn2github/libtorrent-rasterbar-RC_0_16 | c2c8dc24c82816c336d7c45c3ae7a3ab3821077a | [
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | /*
Copyright (c) 2008, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/session.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/extensions/ut_pex.hpp"
#include "libtorrent/thread.hpp"
#include <boost/tuple/tuple.hpp>
#include "test.hpp"
#include "setup_transfer.hpp"
#include <iostream>
void test_pex()
{
using namespace libtorrent;
session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48200, 49000), "0.0.0.0", 0);
session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49200, 50000), "0.0.0.0", 0);
session ses3(fingerprint("LT", 0, 1, 0, 0), std::make_pair(50200, 51000), "0.0.0.0", 0);
ses1.add_extension(create_ut_pex_plugin);
ses2.add_extension(create_ut_pex_plugin);
torrent_handle tor1;
torrent_handle tor2;
torrent_handle tor3;
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, false, "_pex");
int mask = alert::all_categories
& ~(alert::progress_notification
| alert::performance_warning
| alert::stats_notification);
ses1.set_alert_mask(mask);
ses2.set_alert_mask(mask);
ses3.set_alert_mask(mask);
// this is to avoid everything finish from a single peer
// immediately. To make the swarm actually connect all
// three peers before finishing.
session_settings set = ses1.settings();
set.download_rate_limit = 0;
set.upload_rate_limit = 0;
ses1.set_settings(set);
// make the peer connecting the two worthless to transfer
// data, to force peer 3 to connect directly to peer 1 through pex
set = ses2.settings();
set.download_rate_limit = 2000;
set.upload_rate_limit = 2000;
set.ignore_limits_on_local_network = false;
set.rate_limit_utp = true;
ses2.set_settings(set);
set = ses3.settings();
set.download_rate_limit = 0;
set.upload_rate_limit = 0;
ses3.set_settings(set);
#ifndef TORRENT_DISABLE_ENCRYPTION
pe_settings pes;
pes.out_enc_policy = pe_settings::forced;
pes.in_enc_policy = pe_settings::forced;
ses1.set_pe_settings(pes);
ses2.set_pe_settings(pes);
ses3.set_pe_settings(pes);
#endif
test_sleep(100);
// in this test, ses1 is a seed, ses2 is connected to ses1 and ses3.
// the expected behavior is that ses2 will introduce ses1 and ses3 to each other
error_code ec;
tor2.connect_peer(tcp::endpoint(address::from_string("127.0.0.1", ec), ses1.listen_port()));
tor2.connect_peer(tcp::endpoint(address::from_string("127.0.0.1", ec), ses3.listen_port()));
torrent_status st1;
torrent_status st2;
torrent_status st3;
for (int i = 0; i < 15; ++i)
{
print_alerts(ses1, "ses1");
print_alerts(ses2, "ses2");
print_alerts(ses3, "ses3");
st1 = tor1.status();
st2 = tor2.status();
st3 = tor3.status();
std::cerr
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
<< st1.num_peers << ": "
<< "\033[32m" << int(st2.download_payload_rate / 1000.f) << "kB/s "
<< "\033[31m" << int(st2.upload_payload_rate / 1000.f) << "kB/s "
<< "\033[0m" << int(st2.progress * 100) << "% "
<< st2.num_peers << " - "
<< "\033[32m" << int(st3.download_payload_rate / 1000.f) << "kB/s "
<< "\033[31m" << int(st3.upload_payload_rate / 1000.f) << "kB/s "
<< "\033[0m" << int(st3.progress * 100) << "% "
<< st3.num_peers
<< std::endl;
// this is the success condition
if (st1.num_peers == 2 && st2.num_peers == 2 && st3.num_peers == 2)
break;
// this suggests that we failed. If session 3 completes without
// actually connecting to session 1, everything was transferred
// through session 2
if (st3.state == torrent_status::seeding) break;
test_sleep(1000);
}
TEST_CHECK(st1.num_peers == 2 && st2.num_peers == 2 && st3.num_peers == 2)
if (!tor2.status().is_seeding && tor3.status().is_seeding) std::cerr << "done\n";
}
int test_main()
{
using namespace libtorrent;
// in case the previous run was terminated
error_code ec;
remove_all("tmp1_pex", ec);
remove_all("tmp2_pex", ec);
remove_all("tmp3_pex", ec);
test_pex();
remove_all("tmp1_pex", ec);
remove_all("tmp2_pex", ec);
remove_all("tmp3_pex", ec);
return 0;
}
| 32.588235 | 96 | 0.718412 |
104dd44c38c2bb09a043d6c92870c7c210012d1f | 29,388 | cpp | C++ | Engine/source/Alux3D/shotgunprojectile.cpp | fr1tz/alux3d | 249a3b51751ce3184d52879b481f83eabe89e7e3 | [
"MIT"
] | null | null | null | Engine/source/Alux3D/shotgunprojectile.cpp | fr1tz/alux3d | 249a3b51751ce3184d52879b481f83eabe89e7e3 | [
"MIT"
] | null | null | null | Engine/source/Alux3D/shotgunprojectile.cpp | fr1tz/alux3d | 249a3b51751ce3184d52879b481f83eabe89e7e3 | [
"MIT"
] | 1 | 2018-10-26T03:18:22.000Z | 2018-10-26T03:18:22.000Z | // Copyright information can be found in the file named COPYING
// located in the root directory of this distribution.
#include "platform/platform.h"
#include "Alux3D/shotgunprojectile.h"
#include "scene/sceneRenderState.h"
#include "scene/sceneManager.h"
#include "lighting/lightInfo.h"
#include "lighting/lightManager.h"
#include "console/consoleTypes.h"
#include "console/typeValidators.h"
#include "core/resourceManager.h"
#include "core/stream/bitStream.h"
#include "T3D/fx/explosion.h"
#include "T3D/shapeBase.h"
#include "ts/tsShapeInstance.h"
#include "sfx/sfxTrack.h"
#include "sfx/sfxSource.h"
#include "sfx/sfxSystem.h"
#include "sfx/sfxTypes.h"
#include "math/mathUtils.h"
#include "math/mathIO.h"
#include "sim/netConnection.h"
#include "T3D/fx/particleEmitter.h"
#include "T3D/fx/splash.h"
#include "T3D/physics/physicsPlugin.h"
#include "T3D/physics/physicsWorld.h"
#include "gfx/gfxTransformSaver.h"
#include "T3D/containerQuery.h"
#include "T3D/decal/decalManager.h"
#include "T3D/decal/decalData.h"
#include "T3D/lightDescription.h"
#include "console/engineAPI.h"
#include "T3D/gameBase/gameConnection.h"
static MRandomLCG sRandom(0x1);
//--------------------------------------------------------------------------
IMPLEMENT_CO_CLIENTEVENT_V1(CreateExplosionEvent);
CreateExplosionEvent::CreateExplosionEvent()
{
//mGuaranteeType = Guaranteed;
mData = NULL;
}
CreateExplosionEvent::CreateExplosionEvent(ExplosionData* data,
const Point3F& p, const Point3F &n)
{
mData = data;
mPos = p;
mNorm = n;
}
void CreateExplosionEvent::pack(NetConnection* conn, BitStream* bstream)
{
if(bstream->writeFlag(mData))
{
bstream->writeRangedU32(mData->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast);
mathWrite(*bstream, mPos);
mathWrite(*bstream, mNorm);
}
}
void CreateExplosionEvent::unpack(NetConnection* conn, BitStream* bstream)
{
if(bstream->readFlag())
{
SimObject* ptr = NULL;
U32 id = bstream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
if(id != 0 && (ptr = Sim::findObject(id)))
mData = dynamic_cast<ExplosionData*>(ptr);
mathRead(*bstream, &mPos);
mathRead(*bstream, &mNorm);
}
}
void CreateExplosionEvent::write(NetConnection* conn, BitStream* bstream)
{
this->pack(conn,bstream);
}
void CreateExplosionEvent::process(NetConnection* conn)
{
if(!mData)
return;
Explosion* pExplosion = new Explosion;
pExplosion->onNewDataBlock(mData, false);
if( pExplosion )
{
MatrixF xform(true);
xform.setPosition(mPos);
pExplosion->setTransform(xform);
pExplosion->setInitialState(mPos, mNorm);
if (pExplosion->registerObject() == false)
{
Con::errorf(ConsoleLogEntry::General, "CreateExplosionEvent(): couldn't register explosion (%s)",
mData->getName() );
delete pExplosion;
pExplosion = NULL;
}
}
}
ConsoleFunction( createExplosionOnClient, bool, 5, 5, "(NetConnection conn, DataBlock datablock, Point3F pos, Point3F norm)")
{
NetConnection* nc = NULL;
if(Sim::findObject(argv[1], nc) == false)
{
Con::warnf(ConsoleLogEntry::General, "createExplosionOnClient: couldn't find object: %s", argv[1]);
return false;
}
ExplosionData* datablock = NULL;
if(Sim::findObject(argv[2], datablock) == false)
{
Con::warnf(ConsoleLogEntry::General, "createExplosionOnClient: couldn't find object: %s", argv[2]);
return false;
}
Point3F pos, norm;
dSscanf(argv[3], "%f %f %f", &pos.x, &pos.y, &pos.z);
dSscanf(argv[4], "%f %f %f", &norm.x, &norm.y, &norm.z);
if(datablock)
{
CreateExplosionEvent* event = new CreateExplosionEvent(datablock,pos,norm);
nc->postNetEvent(event);
}
return true;
}
//--------------------------------------------------------------------------
//
IMPLEMENT_CO_DATABLOCK_V1(ShotgunProjectileData);
ShotgunProjectileData::ShotgunProjectileData()
{
noFake = false;
energyDrain = 0;
numBullets = 10;
bulletDistMode = 0;
range = 1000.0f;
muzzleSpreadRadius = 0.0f;
referenceSpreadRadius = 0.0f;
referenceSpreadDistance = 0.0f;
}
//--------------------------------------------------------------------------
void ShotgunProjectileData::initPersistFields()
{
Parent::initPersistFields();
addField("noFake", TypeBool, Offset(noFake, ShotgunProjectileData));
addField("energyDrain", TypeS32, Offset(energyDrain, ShotgunProjectileData));
addField("numBullets", TypeS32, Offset(numBullets, ShotgunProjectileData));
addField("bulletDistMode", TypeS32, Offset(bulletDistMode, ShotgunProjectileData));
addField("range", TypeF32, Offset(range, ShotgunProjectileData));
addField("muzzleSpreadRadius", TypeF32, Offset(muzzleSpreadRadius, ShotgunProjectileData));
addField("referenceSpreadRadius", TypeF32, Offset(referenceSpreadRadius, ShotgunProjectileData));
addField("referenceSpreadDistance", TypeF32, Offset(referenceSpreadDistance, ShotgunProjectileData));
}
//--------------------------------------------------------------------------
bool ShotgunProjectileData::onAdd()
{
if(!Parent::onAdd())
return false;
return true;
}
bool ShotgunProjectileData::preload(bool server, String &errorStr)
{
if (Parent::preload(server, errorStr) == false)
return false;
return true;
}
//--------------------------------------------------------------------------
void ShotgunProjectileData::packData(BitStream* stream)
{
Parent::packData(stream);
stream->writeFlag(noFake);
stream->write(energyDrain);
stream->write(numBullets);
stream->write(bulletDistMode);
stream->write(range);
stream->write(muzzleSpreadRadius);
stream->write(referenceSpreadRadius);
stream->write(referenceSpreadDistance);
}
void ShotgunProjectileData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
noFake = stream->readFlag();
stream->read(&energyDrain);
stream->read(&numBullets);
stream->read(&bulletDistMode);
stream->read(&range);
stream->read(&muzzleSpreadRadius);
stream->read(&referenceSpreadRadius);
stream->read(&referenceSpreadDistance);
}
//--------------------------------------------------------------------------
IMPLEMENT_CO_NETOBJECT_V1(ShotgunProjectileTracer);
ShotgunProjectileTracer::ShotgunProjectileTracer(const Point3F* impactPos)
{
mNetFlags.clear();
mNetFlags.set(IsGhost);
if(impactPos)
mImpactPos.set(*impactPos);
mAtImpactPos = false;
}
ShotgunProjectileTracer::~ShotgunProjectileTracer()
{
}
bool ShotgunProjectileTracer::onAdd()
{
AssertFatal(isClientObject(), "ShotgunProjectileTracer on the server? - Someone fucked up!");
if(mDataBlock->muzzleVelocity <= 10)
{
mCurrVelocity = (mImpactPos - mCurrPosition) / mDataBlock->muzzleVelocity;
mCurrVelocity *= TickMs;
}
mInitialPosition = mCurrPosition;
mInitialVelocity = mCurrVelocity;
mCurrDeltaBase = mCurrPosition;
mCurrBackDelta = -mCurrVelocity;
if(!Parent::onAdd())
return false;
return true;
}
bool ShotgunProjectileTracer::onNewDataBlock(GameBaseData* dptr, bool reload)
{
mDataBlock = dynamic_cast<ShotgunProjectileData*>(dptr);
if(!mDataBlock || !Parent::onNewDataBlock(dptr, reload))
return false;
return true;
}
void ShotgunProjectileTracer::processTick(const Move* move)
{
AssertFatal(isClientObject(), "ShotgunProjectileTracer on the server? - Someone fucked up!");
#if 0
mNumTicks++;
#endif
mCurrTick++;
if(mAtImpactPos)
this->deleteObject();
return;
// HACK HACK HACK
if(mDataBlock->muzzleVelocity > 9000)
{
#if 0
this->missedEnemiesCheck(mInitialPosition, mImpactPos);
if(mDataBlock->laserTail != NULL)
{
LaserBeam* beam = new LaserBeam();
beam->setSceneObjectColorization(this->getSceneObjectColorization());
beam->onNewDataBlock(mDataBlock->laserTail);
if(!beam->registerObject())
{
Con::warnf( ConsoleLogEntry::General, "Could not register laserTail for class: %s", mDataBlock->getName() );
delete beam;
}
else
{
beam->setRender(true);
F32 r = sRandom.randF();
Point3F v = (mImpactPos - mInitialPosition)*r;
Point3F vel = v; vel.normalize(); vel *= mDataBlock->muzzleVelocity;
beam->makeDisappear(mInitialPosition, mInitialPosition + v,
vel, mDataBlock->laserTailLen);
}
}
addLaserTrailNode(mInitialPosition, false);
addLaserTrailNode(mImpactPos, false);
for(S32 i = 0; i < NUM_LASERTRAILS; i++)
{
if( mLaserTrailList[i] != NULL )
{
mLaserTrailList[i]->setSceneObjectColorization(this->getSceneObjectColorization());
if(mDataBlock->smoothLaserTrail)
mLaserTrailList[i]->smooth();
if(mDataBlock->laserTrailFlagsList[i] & 1)
mLaserTrailList[i]->smoothReverseDist(mDataBlock->range);
if(mDataBlock->laserTrailFlagsList[i] & 2)
mLaserTrailList[i]->smooth();
if(mDataBlock->laserTrailFlagsList[i] & 4)
mLaserTrailList[i]->smoothDist(2);
}
}
#endif
this->deleteObject();
return;
}
if(mCurrTick >= mDataBlock->lifetime)
{
deleteObject();
return;
}
F32 timeLeft;
RayInfo rInfo;
Point3F oldPosition;
Point3F newPosition;
oldPosition = mCurrPosition;
newPosition = oldPosition + mCurrVelocity * TickSec;
F32 oldDist = (oldPosition-mImpactPos).len();
F32 newDist = (newPosition-mImpactPos).len();
if(newDist > oldDist) // going away from target?
newPosition = mImpactPos;
mCurrDeltaBase = newPosition;
mCurrBackDelta = mCurrPosition - newPosition;
this->emitParticles(oldPosition, newPosition, mCurrVelocity, TickMs);
#if 0
this->missedEnemiesCheck(oldPosition, newPosition);
//emitParticles(mCurrPosition, newPosition, mCurrVelocity, TickMs);
// update laser trail...
if( mEmissionCount == 0 )
{
addLaserTrailNode(mInitialPosition,false);
for( U8 i = 0; i < mNumBouncePoints; i++ )
{
//Con::printf("processTick(): (client) adding bouncePoint %u: %f %f %f",i,mBouncePoint[i].x,mBouncePoint[i].y,mBouncePoint[i].z);
addLaserTrailNode(mBouncePoint[i].pos, false);
createBounceExplosion(mBouncePoint[i].pos, mBouncePoint[i].norm, mBouncePoint[i].decal);
}
}
if( mFxLight != NULL )
mFxLight->setPosition(mCurrDeltaBase);
addLaserTrailNode(newPosition,false);
mEmissionCount++;
#endif
if(newPosition == mImpactPos)
{
this->deleteObject();
return;
}
mCurrPosition = newPosition;
MatrixF xform(true);
xform.setColumn(3, mCurrPosition);
setTransform(xform);
}
void ShotgunProjectileTracer::advanceTime(F32 dt)
{
Parent::advanceTime(dt);
if(mAtImpactPos)
return;
this->simulate(dt);
this->updateSound();
}
void ShotgunProjectileTracer::interpolateTick(F32 delta)
{
// ShotgunProjectileTracers use advanceTime() to
// advance their simulation (instead of ticks).
}
void ShotgunProjectileTracer::simulate(F32 dt)
{
F32 timeLeft;
RayInfo rInfo;
Point3F oldPosition;
Point3F newPosition;
oldPosition = mCurrPosition;
newPosition = oldPosition + mCurrVelocity * dt;
F32 oldDist = (oldPosition-mImpactPos).len();
F32 newDist = (newPosition-mImpactPos).len();
if(newDist > oldDist) // going away from target?
{
newPosition = mImpactPos;
mAtImpactPos = true;
}
mCurrDeltaBase = newPosition;
mCurrBackDelta = mCurrPosition - newPosition;
this->emitParticles(oldPosition, newPosition, mCurrVelocity, dt*1000);
mCurrPosition = newPosition;
Point3F dir = mCurrVelocity;
if(dir.isZero())
dir.set(0,0,1);
else
dir.normalize();
MatrixF xform(true);
xform = MathUtils::createOrientFromDir(dir);
xform.setPosition(mCurrPosition);
setTransform(xform);
}
//--------------------------------------------------------------------------
ShotgunHit::ShotgunHit()
{
object = NULL;
numImpacts = 0;
}
ShotgunHit::ShotgunHit(const ShotgunHit& hit)
{
object = hit.object;
objectPos = hit.objectPos;
numImpacts = hit.numImpacts;
impactCenterVec = hit.impactCenterVec;
impactVecs = hit.impactVecs;
impactNormals = hit.impactNormals;
}
ShotgunHit::~ShotgunHit()
{
}
void ShotgunHit::pack(NetConnection* con, BitStream* stream)
{
// send object id or object pos if the object does not exist anymore
if(stream->writeFlag(object.isNull()))
{
mathWrite(*stream, objectPos);
}
else
{
S32 ghostIndex = -1;
if(stream->writeFlag(object->isClientObject()))
ghostIndex = object->getNetIndex();
else
ghostIndex = con->getGhostIndex(object);
if(stream->writeFlag(ghostIndex != -1))
stream->writeRangedU32(U32(ghostIndex), 0, NetConnection::MaxGhostCount);
else
mathWrite(*stream, objectPos);
}
stream->write(numImpacts);
mathWrite(*stream, impactCenterVec);
for(U32 i = 0; i < numImpacts; i ++)
{
mathWrite(*stream, impactVecs[i]);
mathWrite(*stream, impactNormals[i]);
}
}
void ShotgunHit::unpack(NetConnection* con, BitStream* stream)
{
if(stream->readFlag())
{
mathRead(*stream, &objectPos);
}
else
{
bool onServer = stream->readFlag();
if(stream->readFlag())
{
U32 objectId = stream->readRangedU32(0, NetConnection::MaxGhostCount);
if(onServer)
{
NetObject* pObj = con->resolveObjectFromGhostIndex(objectId);
object = dynamic_cast<SceneObject*>(pObj);
}
else
{
NetObject* pObj = con->resolveGhost(objectId);
object = dynamic_cast<SceneObject*>(pObj);
}
if(object)
objectPos = object->getPosition();
}
else
mathRead(*stream, &objectPos);
}
stream->read(&numImpacts);
mathRead(*stream, &impactCenterVec);
for(U32 i = 0; i < numImpacts; i ++)
{
Point3F impactVec, impactNormal;
mathRead(*stream, &impactVec);
mathRead(*stream, &impactNormal);
impactVecs.push_back(impactVec);
impactNormals.push_back(impactNormal);
}
}
//--------------------------------------------------------------------------
IMPLEMENT_CO_NETOBJECT_V1(ShotgunProjectile);
ShotgunProjectile::ShotgunProjectile(bool onClient, bool findHits)
{
mFindHits = findHits;
mHitsSource = NULL;
mNetFlags.clear();
if(onClient)
{
mNetFlags.set(IsGhost);
}
else
{
mNetFlags.set(Ghostable);
}
}
ShotgunProjectile::~ShotgunProjectile()
{
U32 n = mHits.size();
while(n--)
delete mHits[n];
}
void ShotgunProjectile::onDeleteNotify(SimObject* obj)
{
Parent::onDeleteNotify(obj);
}
//--------------------------------------------------------------------------
void ShotgunProjectile::initPersistFields()
{
Parent::initPersistFields();
}
void ShotgunProjectile::consoleInit()
{
Parent::consoleInit();
}
//--------------------------------------------------------------------------
class ObjectDeleteEvent : public SimEvent
{
public:
void process(SimObject *object)
{
object->deleteObject();
}
};
bool ShotgunProjectile::onAdd()
{
if(!Parent::onAdd())
return false;
setProcessTick(false); // no need to process ticks
if(mFindHits)
{
this->findHits();
if(this->isClientObject())
this->transmitHitsToServer();
}
this->processHits();
if(isClientObject())
{
if(mFindHits)
{
this->deleteObject();
return true;
}
else
{
mHasExploded = true;
}
}
else
{
// Need valid transform for scoping.
Point3F dir = mCurrVelocity; dir.normalize();
MatrixF mat = MathUtils::createOrientFromDir(dir);
mat.setPosition(mCurrPosition);
this->setTransform(mat);
// Delete us after we've had some time to ghost.
Sim::postEvent(this, new ObjectDeleteEvent, Sim::getCurrentTime() + DeleteWaitTime);
}
return true;
}
void ShotgunProjectile::onRemove()
{
Parent::onRemove();
}
bool ShotgunProjectile::onNewDataBlock(GameBaseData* dptr, bool reload)
{
mDataBlock = dynamic_cast<ShotgunProjectileData*>( dptr );
if(!mDataBlock || !Parent::onNewDataBlock(dptr, reload))
return false;
return true;
}
//----------------------------------------------------------------------------
void ShotgunProjectile::processTick(const Move* move)
{
AssertFatal(isClientObject(), "ShotgunProjectile::processTick() being called? - Someone fucked up!");
//mNumTicks++;
//mCurrTick++;
//if(isServerObject() && mCurrTick >= mDataBlock->lifetime)
// deleteObject();
}
void ShotgunProjectile::advanceTime(F32 dt)
{
Parent::advanceTime(dt);
}
void ShotgunProjectile::interpolateTick(F32 delta)
{
Parent::interpolateTick(delta);
}
//--------------------------------------------------------------------------
U32 ShotgunProjectile::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
{
U32 retMask = Parent::packUpdate(con, mask, stream);
// Transmit hits...
// Note: Don't send hits back to their source.
if(stream->writeFlag((mask & GameBase::InitialUpdateMask) && con != mHitsSource))
{
U32 n = mHits.size();
stream->write(n);
while(n--)
mHits[n]->pack(con, stream);
}
return retMask;
}
void ShotgunProjectile::unpackUpdate(NetConnection* con, BitStream* stream)
{
Parent::unpackUpdate(con, stream);
// Read hits?
if(stream->readFlag())
{
U32 n; stream->read(&n);
while(n--)
{
ShotgunHit* newHit = new ShotgunHit();
newHit->unpack(con, stream);
mHits.push_back(newHit);
}
}
}
//--------------------------------------------------------------------------
void ShotgunProjectile::addHits(NetConnection* client, const ShotgunHits& hits)
{
mHitsSource = client;
U32 n = hits.size();
while(n--)
mHits.push_back(new ShotgunHit(*hits[n]));
}
void ShotgunProjectile::findHits()
{
mSourceObject->disableCollision();
Point3F muzzlePoint = mCurrPosition;
Point3F dir = mCurrVelocity; dir.normalize();
MatrixF transform = MathUtils::createOrientFromDir(dir);
Point3F zv; transform.getColumn(2, &zv);
zv.normalize();
Point3F startEdge = muzzlePoint
+ zv * mDataBlock->muzzleSpreadRadius;
Point3F refEdge = muzzlePoint + dir * mDataBlock->referenceSpreadDistance
+ zv * mDataBlock->referenceSpreadRadius;
Point3F vec = refEdge - startEdge; vec.normalize();
Point3F endEdge = startEdge + vec * mDataBlock->range;
Point3F startCenter = muzzlePoint;
Point3F endCenter = muzzlePoint + dir * mDataBlock->range;
//
// collect hits...
//
int totalImpacts = 0;
Vector<Point3F> misses;
if(mDataBlock->bulletDistMode == 0)
{
for(int i=0; i < mDataBlock->numBullets; i++)
{
Point3F startClockVec = startEdge - startCenter;
Point3F endClockVec = endEdge - endCenter;
MatrixF rotmat(EulerF(0, 6.28 * sRandom.randF(), 0));
rotmat.mulV(startClockVec);
rotmat.mulV(endClockVec);
Point3F startVec = startClockVec;
transform.mulV(startVec);
Point3F endVec = endClockVec;
transform.mulV(endVec);
F32 r = sRandom.randF();
Point3F start = startCenter + startVec * r;
Point3F end = endCenter + endVec * r;
RayInfo rInfo;
bool collision = getContainer()->castRay(start, end, csmDynamicCollisionMask | csmStaticCollisionMask, &rInfo);
if(collision)
{
ShotgunHit* hit = NULL;
for(int k=0; k<mHits.size(); k++)
{
if(mHits[k]->object == rInfo.object)
{
hit = mHits[k];
break;
}
}
if(hit == NULL)
{
hit = new ShotgunHit();
hit->object = rInfo.object;
hit->objectPos = hit->object->getPosition();
hit->numImpacts = 0;
mHits.push_back(hit);
}
hit->numImpacts++;
Point3F impactVec = rInfo.point - hit->objectPos;
hit->impactCenterVec += impactVec;
hit->impactCenterVec /= 2;
hit->impactVecs.push_back(impactVec);
hit->impactNormals.push_back(rInfo.normal);
totalImpacts++;
}
else
{
misses.push_back(end);
}
}
}
else
{
int numEdges = 40;
int numSegments = 20;
Point3F startClockVec = startEdge - startCenter;
Point3F endClockVec = endEdge - endCenter;
MatrixF rotmat(EulerF(0, 6.28 / numEdges, 0));
for(int i=0; i < numEdges; i++)
{
rotmat.mulV(startClockVec);
rotmat.mulV(endClockVec);
Point3F startVec = startClockVec;
transform.mulV(startVec);
Point3F endVec = endClockVec;
transform.mulV(endVec);
Point3F startVecSeg = startVec / numSegments;
Point3F endVecSeg = endVec / numSegments;
startVec = startVecSeg;
endVec = endVecSeg;
for(int j = 0; j < numSegments; j++)
{
Point3F start = startCenter + startVec;
Point3F end = endCenter + endVec;
RayInfo rInfo;
bool collision = getContainer()->castRay(start, end, csmDynamicCollisionMask | csmStaticCollisionMask, &rInfo);
if(collision)
{
ShotgunHit* hit = NULL;
for(int k=0; k<mHits.size(); k++)
{
if(mHits[k]->object == rInfo.object)
{
hit = mHits[k];
break;
}
}
if(hit == NULL)
{
hit = new ShotgunHit();
hit->object = rInfo.object;
hit->objectPos = hit->object->getPosition();
hit->numImpacts = 0;
mHits.push_back(hit);
}
hit->numImpacts++;
Point3F impactVec = rInfo.point - hit->objectPos;
hit->impactCenterVec += impactVec;
hit->impactCenterVec /= 2;
hit->impactVecs.push_back(impactVec);
hit->impactNormals.push_back(rInfo.normal);
}
else
{
misses.push_back(end);
}
startVec += startVecSeg;
endVec += endVecSeg;
}
}
// reduce number of impacts per hit according to the number
// of bullets that the shotgun is supposed to fire...
int totalBullets = numEdges * numSegments;
int n = mHits.size();
while(n--)
{
ShotgunHit* hit = mHits[n];
//Con::printf("Number of actual impacts: %i of %i", hit->numImpacts, totalBullets);
hit->numImpacts = F32(hit->numImpacts) / (totalBullets / mDataBlock->numBullets);
hit->numImpacts = mClamp(hit->numImpacts + 1, 1, mDataBlock->numBullets);
totalImpacts += hit->numImpacts;
//Con::printf("Number of bullet impacts: %i of %i", hit->numImpacts, mDataBlock->numBullets);
Vector<Point3F> newImpactVecs, newImpactNormals;
for(int i = 0; i < hit->numImpacts; i++)
{
U32 idx = sRandom.randI(0, hit->impactVecs.size()-1);
newImpactVecs.push_back(hit->impactVecs[idx]);
newImpactNormals.push_back(hit->impactNormals[idx]);
}
hit->impactVecs = newImpactVecs;
hit->impactNormals = newImpactNormals;
}
}
// create a hit for the bullets that didn't hit anything
int numMisses = mDataBlock->numBullets - totalImpacts;
if(numMisses > 0)
{
ShotgunHit* newHit = new ShotgunHit();
newHit->object = NULL;
newHit->objectPos.set(0, 0, 0);
newHit->impactCenterVec.set(0, 0, 0);
newHit->numImpacts = numMisses;
while(numMisses--)
{
Point3F impactVec;
if(mDataBlock->bulletDistMode == 0)
impactVec = misses[numMisses];
else
impactVec = misses[sRandom.randI(0, misses.size()-1)];
newHit->impactCenterVec += impactVec;
newHit->impactCenterVec /= 2;
newHit->impactVecs.push_back(impactVec);
newHit->impactNormals.push_back(Point3F(0, 0, 1));
}
mHits.push_back(newHit);
}
mSourceObject->enableCollision();
}
void ShotgunProjectile::processHits()
{
if(isServerObject())
this->serverProcessHits();
else
this->clientProcessHits();
}
void ShotgunProjectile::serverProcessHits()
{
Point3F muzzlePoint = mCurrPosition;
int n = mHits.size();
while(n--)
{
ShotgunHit* hit = mHits[n];
Point3F objectPos;
if(hit->object.isNull())
objectPos = hit->objectPos;
else
objectPos = hit->object->getPosition();
for(int i = 0; i < hit->numImpacts; i++)
{
Point3F impactVec = hit->impactVecs[i];
Point3F impactNormal = hit->impactNormals[i];
Point3F impactPos = objectPos + impactVec;
#if 0
mTraveledDistance = (impactPos-mCurrPosition).len();
#endif
Parent::onCollision(impactPos, impactNormal, hit->object);
}
}
}
void ShotgunProjectile::clientProcessHits()
{
Point3F muzzlePoint = mCurrPosition;
int n = mHits.size();
while(n--)
{
ShotgunHit* hit = mHits[n];
Point3F objectPos;
if(hit->object.isNull())
objectPos = hit->objectPos;
else
objectPos = hit->object->getPosition();
// eyecandy stuff...
for(int i = 0; i < hit->numImpacts; i++)
{
Point3F impactVec = hit->impactVecs[i];
Point3F impactNormal = hit->impactNormals[i];
Point3F impactPos = objectPos + impactVec;
Point3F velocity = impactPos - muzzlePoint;
F32 dist = velocity.len();
velocity.normalize();
//if(mDataBlock->spread == 0.0 && !hit->object.isNull())
// velocity *= dist / (mDataBlock->lifetime * (F32(TickMs) / 1000.0f));
//else
velocity *= mDataBlock->muzzleVelocity;
ShotgunProjectileTracer* prj = new ShotgunProjectileTracer(&impactPos);
prj->mCurrPosition = muzzlePoint;
prj->mCurrVelocity = velocity;
prj->mSourceObject = mSourceObject;
prj->mSourceObjectSlot = mSourceObjectSlot;
#if 0
prj->setSceneObjectColorization(this->getSceneObjectColorization());
#endif
prj->onNewDataBlock(mDataBlock, false);
if(!prj->registerObject())
{
Con::warnf(ConsoleLogEntry::General, "Could not register shotgun tracer projectile for image: %s", mDataBlock->getName());
delete prj;
prj = NULL;
}
if(hit->object.isNull())
{
#if 0
prj->disableLaserTrail(1);
#endif
continue;
}
SceneObject* sObj = hit->object.operator->();
#if 0
if( sObj->getType() & Projectile::csmDynamicCollisionMask )
{
if( ((ShapeBase*)sObj)->getTeamId() == mTeamId )
{
mExplosionType = Projectile::HitTeammateExplosion;
prj->disableLaserTrail(1);
}
else
{
mExplosionType = Projectile::HitEnemyExplosion;
prj->disableLaserTrail(0);
}
}
else
{
mExplosionType = Projectile::StandardExplosion;
prj->disableLaserTrail(1);
}
#endif
ExplosionData* datablock = mDataBlock->explosion;
#if 0
if( mExplosionType == HitEnemyExplosion && mDataBlock->hitEnemyExplosion != NULL )
datablock = mDataBlock->hitEnemyExplosion;
else if( mExplosionType == HitTeammateExplosion && mDataBlock->hitTeammateExplosion != NULL )
datablock = mDataBlock->hitTeammateExplosion;
#endif
if(datablock != NULL)
{
Explosion* pExplosion = new Explosion;
pExplosion->onNewDataBlock(datablock, false);
Point3F expPos = impactPos + impactNormal*0.1;
MatrixF xform(true);
xform.setPosition(expPos);
pExplosion->setTransform(xform);
pExplosion->setInitialState(expPos, impactNormal);
pExplosion->setCollideType(hit->object->getTypeMask());
if (pExplosion->registerObject() == false)
{
Con::errorf(ConsoleLogEntry::General, "ShotgunProjectile(%s)::explode: couldn't register explosion",
mDataBlock->getName() );
delete pExplosion;
pExplosion = NULL;
}
if(mDataBlock->decal
&& !(sObj->getTypeMask() & Projectile::csmDynamicCollisionMask)
&& (hit->object->getTypeMask() & Projectile::csmStaticCollisionMask))
gDecalManager->addDecal(impactPos, impactNormal, 0.0f, mDataBlock->decal );
}
}
}
}
void ShotgunProjectile::transmitHitsToServer()
{
ShotgunFireEvent* event = new ShotgunFireEvent();
event->datablock = mDataBlock;
event->source = mSourceObject;
event->sourceId = mSourceObject->getNetIndex();
event->sourceSlot = mSourceObjectSlot;
event->muzzlePoint = mCurrPosition;
event->muzzleVector = mCurrVelocity;
U32 n = mHits.size();
while(n--)
event->hits.push_back(new ShotgunHit(*mHits[n]));
GameConnection::getConnectionToServer()->postNetEvent(event);
}
//--------------------------------------------------------------------------
IMPLEMENT_CO_SERVEREVENT_V1(ShotgunFireEvent);
ShotgunFireEvent::ShotgunFireEvent()
{
//mGuaranteeType = NetEvent::Guaranteed; // FIXME
datablock = NULL;
source = NULL;
sourceId = -1;
sourceSlot = -1;
}
ShotgunFireEvent::~ShotgunFireEvent()
{
U32 n = hits.size();
while(n--)
delete hits[n];
}
void ShotgunFireEvent::pack(NetConnection* conn, BitStream* bstream)
{
if(!bstream->writeFlag(datablock))
return;
// datablock
bstream->writeRangedU32(datablock->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast);
// source
if(bstream->writeFlag(sourceId != -1))
bstream->writeRangedU32(U32(sourceId), 0, NetConnection::MaxGhostCount);
// source slot
bstream->writeSignedInt(sourceSlot,4);
// muzzle point & vector
mathWrite(*bstream, muzzlePoint);
mathWrite(*bstream, muzzleVector);
// hits
U32 n = hits.size();
bstream->write(n);
while(n--)
hits[n]->pack(conn, bstream);
}
void ShotgunFireEvent::unpack(NetConnection* conn, BitStream* bstream)
{
if(!bstream->readFlag())
return;
// datablock
SimObject* ptr = NULL;
U32 id = bstream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
if(id != 0 && (ptr = Sim::findObject(id)))
datablock = dynamic_cast<ShotgunProjectileData*>(ptr);
// source
if(bstream->readFlag())
{
sourceId = bstream->readRangedU32(0, NetConnection::MaxGhostCount);
if(sourceId != -1)
{
NetObject* pObj = conn->resolveObjectFromGhostIndex(sourceId);
source = dynamic_cast<ShapeBase*>(pObj);
}
}
// source slot
sourceSlot = bstream->readSignedInt(4);
// muzzle point & vector
mathRead(*bstream, &muzzlePoint);
mathRead(*bstream, &muzzleVector);
// hits
U32 n; bstream->read(&n);
while(n--)
{
ShotgunHit* newHit = new ShotgunHit();
newHit->unpack(conn, bstream);
hits.push_back(newHit);
}
}
void ShotgunFireEvent::write(NetConnection* conn, BitStream* bstream)
{
this->pack(conn, bstream);
}
void ShotgunFireEvent::process(NetConnection* conn)
{
if(!datablock)
return;
if(!source)
return;
source->clientFiredShotgun(
conn,
sourceSlot,
hits,
datablock,
muzzlePoint,
muzzleVector
);
}
| 23.757478 | 132 | 0.671124 |
104f273a3cd6bfc289799d35170c6753a04d80e8 | 2,026 | hpp | C++ | src/ME136/SensorCalibration.hpp | lassepe/ME292B-UserCode-Group14 | a6a637340439ca75b129dc9dd6c560558c22e2ff | [
"BSD-3-Clause"
] | null | null | null | src/ME136/SensorCalibration.hpp | lassepe/ME292B-UserCode-Group14 | a6a637340439ca75b129dc9dd6c560558c22e2ff | [
"BSD-3-Clause"
] | null | null | null | src/ME136/SensorCalibration.hpp | lassepe/ME292B-UserCode-Group14 | a6a637340439ca75b129dc9dd6c560558c22e2ff | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include "MainLoopTypes.hpp"
#include "Vec3f.hpp"
class SensorCalibration {
public:
/**
* @brief SensorCalibration the constructor for this class. This class wraps away
* the calibration routine. The user can specify over how many iterations he
* wants to calibrate;
* @param measurementsToRecord the number of measurements that should be used
* for calibration.
*/
SensorCalibration(const int measurementsToRecord)
: finished_(false),
numMeasurements_(0),
measurementsToRecord_(measurementsToRecord),
rateGyroOffset_(0, 0, 0) {}
/// getters to savely access the internal state
bool isFinished() const { return finished_; }
int getNumMeasurements() const { return numMeasurements_; }
const Vec3f& getRateGyroOffset() const { return rateGyroOffset_; }
/// reset the calibration state back to 0
void reset() {
rateGyroOffset_ = Vec3f(0, 0, 0);
finished_ = false;
numMeasurements_ = 0;
}
/**
* @brief run runs the calibration routine until we recorded enough
* measurements
* @param in the input of the main loop (containing the measurements)
* @return returns true if this method is still running
*/
bool run(const MainLoopInput& in) {
// check if we still need to collect measurements
if (!finished_) {
// accumulate the rateGyroMeasurements
rateGyroOffset_ =
(rateGyroOffset_ * numMeasurements_ + in.imuMeasurement.rateGyro) /
(numMeasurements_ + 1);
numMeasurements_++;
}
// update the finished state
finished_ = !(numMeasurements_ < measurementsToRecord_);
// return if we are still running
return !finished_;
}
private:
/// true if the calibration phase is fished
bool finished_ = false;
/// the number of measurements recorded
int numMeasurements_;
/// the maximum number of measurements that we need to record
const int measurementsToRecord_ = 500;
/// the calibrated values
Vec3f rateGyroOffset_ = Vec3f(0, 0, 0);
};
| 31.169231 | 83 | 0.698914 |
10506bb2f6449ce70be8d9cd41f032a088a927da | 1,129 | hpp | C++ | include/dtc/cell/cell.hpp | tsung-wei-huang/DtCraft | 80cc9e1195adc0026107814243401a1fc47b5be2 | [
"MIT"
] | 69 | 2019-03-16T20:13:26.000Z | 2022-03-24T14:12:19.000Z | include/dtc/cell/cell.hpp | Tsung-Wei/DtCraft | 80cc9e1195adc0026107814243401a1fc47b5be2 | [
"MIT"
] | 12 | 2017-12-02T05:38:30.000Z | 2019-02-08T11:16:12.000Z | include/dtc/cell/cell.hpp | Tsung-Wei/DtCraft | 80cc9e1195adc0026107814243401a1fc47b5be2 | [
"MIT"
] | 12 | 2019-04-13T16:27:29.000Z | 2022-01-07T14:42:46.000Z | /******************************************************************************
* *
* Copyright (c) 2018, Tsung-Wei Huang, Chun-Xun Lin, and Martin D. F. Wong, *
* University of Illinois at Urbana-Champaign (UIUC), IL, USA. *
* *
* All Rights Reserved. *
* *
* This program is free software. You can redistribute and/or modify *
* it in accordance with the terms of the accompanying license agreement. *
* See LICENSE in the top-level directory for details. *
* *
******************************************************************************/
#ifndef DTC_CELL_CELL_HPP_
#define DTC_CELL_CELL_HPP_
#include <dtc/cell/visitor.hpp>
#include <dtc/cell/operator.hpp>
#include <dtc/cell/feeder/feeder.hpp>
#endif
| 49.086957 | 80 | 0.355182 |
10520c36a175ae4aceb9a500270a9bbd45dfafbb | 170,457 | cc | C++ | third_party/blink/renderer/core/html/media/html_media_element.cc | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-10-18T02:33:40.000Z | 2020-10-18T02:33:40.000Z | third_party/blink/renderer/core/html/media/html_media_element.cc | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2021-05-17T16:28:52.000Z | 2021-05-21T22:42:22.000Z | third_party/blink/renderer/core/html/media/html_media_element.cc | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include <algorithm>
#include <limits>
#include "base/auto_reset.h"
#include "base/debug/crash_logging.h"
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "media/base/logging_override_if_enabled.h"
#include "media/base/media_content_type.h"
#include "media/base/media_switches.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
#include "third_party/blink/public/common/widget/screen_info.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-shared.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream.h"
#include "third_party/blink/public/platform/modules/remoteplayback/web_remote_playback_client.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_audio_source_provider.h"
#include "third_party/blink/public/platform/web_content_decryption_module.h"
#include "third_party/blink/public/platform/web_inband_text_track.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/core_probes_inl.h"
#include "third_party/blink/renderer/core/css/media_list.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/attribute.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/event_queue.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/fileapi/url_file_api.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/picture_in_picture_controller.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/html_source_element.h"
#include "third_party/blink/renderer/core/html/media/audio_output_device_controller.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
#include "third_party/blink/renderer/core/html/media/html_media_element_controls_list.h"
#include "third_party/blink/renderer/core/html/media/media_controls.h"
#include "third_party/blink/renderer/core/html/media/media_error.h"
#include "third_party/blink/renderer/core/html/media/media_fragment_uri_parser.h"
#include "third_party/blink/renderer/core/html/media/media_source_attachment.h"
#include "third_party/blink/renderer/core/html/media/media_source_tracer.h"
#include "third_party/blink/renderer/core/html/time_ranges.h"
#include "third_party/blink/renderer/core/html/track/audio_track.h"
#include "third_party/blink/renderer/core/html/track/audio_track_list.h"
#include "third_party/blink/renderer/core/html/track/automatic_track_selection.h"
#include "third_party/blink/renderer/core/html/track/cue_timeline.h"
#include "third_party/blink/renderer/core/html/track/html_track_element.h"
#include "third_party/blink/renderer/core/html/track/inband_text_track.h"
#include "third_party/blink/renderer/core/html/track/loadable_text_track.h"
#include "third_party/blink/renderer/core/html/track/text_track_container.h"
#include "third_party/blink/renderer/core/html/track/text_track_list.h"
#include "third_party/blink/renderer/core/html/track/video_track.h"
#include "third_party/blink/renderer/core/html/track/video_track_list.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h"
#include "third_party/blink/renderer/core/layout/layout_media.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/loader/mixed_content_checker.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
#include "third_party/blink/renderer/platform/audio/audio_source_provider_client.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/microtask.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_descriptor.h"
#include "third_party/blink/renderer/platform/network/mime/content_type.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_from_url.h"
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
#include "third_party/blink/renderer/platform/network/parsed_content_type.h"
#include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#ifndef LOG_MEDIA_EVENTS
// Default to not logging events because so many are generated they can
// overwhelm the rest of the logging.
#define LOG_MEDIA_EVENTS 0
#endif
#ifndef LOG_OFFICIAL_TIME_STATUS
// Default to not logging status of official time because it adds a fair amount
// of overhead and logging.
#define LOG_OFFICIAL_TIME_STATUS 0
#endif
namespace blink {
using WeakMediaElementSet = HeapHashSet<WeakMember<HTMLMediaElement>>;
using DocumentElementSetMap =
HeapHashMap<WeakMember<Document>, Member<WeakMediaElementSet>>;
namespace {
// This enum is used to record histograms. Do not reorder.
enum class MediaControlsShow {
kAttribute = 0,
kFullscreen,
kNoScript,
kNotShown,
kDisabledSettings,
kUserExplicitlyEnabled,
kUserExplicitlyDisabled,
kMaxValue = kUserExplicitlyDisabled,
};
// These values are used for the Media.MediaElement.ContentTypeResult histogram.
// Do not reorder.
enum class ContentTypeParseableResult {
kIsSupportedParseable = 0,
kMayBeSupportedParseable,
kIsNotSupportedParseable,
kIsSupportedNotParseable,
kMayBeSupportedNotParseable,
kIsNotSupportedNotParseable,
kMaxValue = kIsNotSupportedNotParseable,
};
// This enum is used to record histograms. Do not reorder.
enum class PlayPromiseRejectReason {
kFailedAutoplayPolicy = 0,
kNoSupportedSources,
kInterruptedByPause,
kInterruptedByLoad,
kMaxValue = kInterruptedByLoad,
};
// The state of the HTMLMediaElement when ProgressEventTimerFired is invoked.
// These values are histogrammed, so please only add values to the end.
enum class ProgressEventTimerState {
// networkState is not NETWORK_LOADING.
kNotLoading,
// MediaShouldBeOpaque() is true.
kMediaShouldBeOpaque,
// "progress" event was scheduled.
kProgress,
// No progress. The "stalled" event was scheduled.
kStalled,
// No progress. No "stalled" event scheduled because a Media Source Attachment
// is used.
kHasMediaSourceAttachment,
// No progress. No "stalled" event scheduled because there was recent
// progress.
kRecentProgress,
// No progress. No "stalled" event scheduled because it was already scheduled.
kStalledEventAlreadyScheduled,
kMaxValue = kStalledEventAlreadyScheduled
};
// Records the state of the HTMLMediaElement when its "progress event" timer
// fires.
// TODO(crbug.com/1143317): Remove once the bug is fixed.
void RecordProgressEventTimerState(ProgressEventTimerState state) {
UMA_HISTOGRAM_ENUMERATION("Media.ProgressEventTimerState", state);
}
static const base::TimeDelta kStalledNotificationInterval =
base::TimeDelta::FromSeconds(3);
void ReportContentTypeResultToUMA(String content_type,
MIMETypeRegistry::SupportsType result) {
ParsedContentType parsed_content_type(content_type);
ContentTypeParseableResult uma_result =
ContentTypeParseableResult::kIsNotSupportedNotParseable;
switch (result) {
case MIMETypeRegistry::kIsSupported:
uma_result = parsed_content_type.IsValid()
? ContentTypeParseableResult::kIsSupportedParseable
: ContentTypeParseableResult::kIsSupportedNotParseable;
break;
case MIMETypeRegistry::kMayBeSupported:
uma_result =
parsed_content_type.IsValid()
? ContentTypeParseableResult::kMayBeSupportedParseable
: ContentTypeParseableResult::kMayBeSupportedNotParseable;
break;
case MIMETypeRegistry::kIsNotSupported:
uma_result =
parsed_content_type.IsValid()
? ContentTypeParseableResult::kIsNotSupportedParseable
: ContentTypeParseableResult::kIsNotSupportedNotParseable;
break;
}
base::UmaHistogramEnumeration("Media.MediaElement.ContentTypeParseable",
uma_result);
}
String UrlForLoggingMedia(const KURL& url) {
static const unsigned kMaximumURLLengthForLogging = 128;
if (url.GetString().length() < kMaximumURLLengthForLogging)
return url.GetString();
return url.GetString().Substring(0, kMaximumURLLengthForLogging) + "...";
}
const char* BoolString(bool val) {
return val ? "true" : "false";
}
DocumentElementSetMap& DocumentToElementSetMap() {
DEFINE_STATIC_LOCAL(Persistent<DocumentElementSetMap>, map,
(MakeGarbageCollected<DocumentElementSetMap>()));
return *map;
}
void AddElementToDocumentMap(HTMLMediaElement* element, Document* document) {
DocumentElementSetMap& map = DocumentToElementSetMap();
WeakMediaElementSet* set = nullptr;
auto it = map.find(document);
if (it == map.end()) {
set = MakeGarbageCollected<WeakMediaElementSet>();
map.insert(document, set);
} else {
set = it->value;
}
set->insert(element);
}
void RemoveElementFromDocumentMap(HTMLMediaElement* element,
Document* document) {
DocumentElementSetMap& map = DocumentToElementSetMap();
auto it = map.find(document);
DCHECK(it != map.end());
WeakMediaElementSet* set = it->value;
set->erase(element);
if (set->IsEmpty())
map.erase(it);
}
String BuildElementErrorMessage(const String& error) {
// Prepend a UA-specific-error code before the first ':', to enable better
// collection and aggregation of UA-specific-error codes from
// MediaError.message by web apps. WebMediaPlayer::GetErrorMessage() should
// similarly conform to this format.
DEFINE_STATIC_LOCAL(const String, element_error_prefix,
("MEDIA_ELEMENT_ERROR: "));
StringBuilder builder;
builder.Append(element_error_prefix);
builder.Append(error);
return builder.ToString();
}
class AudioSourceProviderClientLockScope {
STACK_ALLOCATED();
public:
explicit AudioSourceProviderClientLockScope(HTMLMediaElement& element)
: client_(element.AudioSourceNode()) {
if (client_)
client_->lock();
}
~AudioSourceProviderClientLockScope() {
if (client_)
client_->unlock();
}
private:
AudioSourceProviderClient* client_;
};
const AtomicString& AudioKindToString(
WebMediaPlayerClient::AudioTrackKind kind) {
switch (kind) {
case WebMediaPlayerClient::kAudioTrackKindNone:
return g_empty_atom;
case WebMediaPlayerClient::kAudioTrackKindAlternative:
return AudioTrack::AlternativeKeyword();
case WebMediaPlayerClient::kAudioTrackKindDescriptions:
return AudioTrack::DescriptionsKeyword();
case WebMediaPlayerClient::kAudioTrackKindMain:
return AudioTrack::MainKeyword();
case WebMediaPlayerClient::kAudioTrackKindMainDescriptions:
return AudioTrack::MainDescriptionsKeyword();
case WebMediaPlayerClient::kAudioTrackKindTranslation:
return AudioTrack::TranslationKeyword();
case WebMediaPlayerClient::kAudioTrackKindCommentary:
return AudioTrack::CommentaryKeyword();
}
NOTREACHED();
return g_empty_atom;
}
const AtomicString& VideoKindToString(
WebMediaPlayerClient::VideoTrackKind kind) {
switch (kind) {
case WebMediaPlayerClient::kVideoTrackKindNone:
return g_empty_atom;
case WebMediaPlayerClient::kVideoTrackKindAlternative:
return VideoTrack::AlternativeKeyword();
case WebMediaPlayerClient::kVideoTrackKindCaptions:
return VideoTrack::CaptionsKeyword();
case WebMediaPlayerClient::kVideoTrackKindMain:
return VideoTrack::MainKeyword();
case WebMediaPlayerClient::kVideoTrackKindSign:
return VideoTrack::SignKeyword();
case WebMediaPlayerClient::kVideoTrackKindSubtitles:
return VideoTrack::SubtitlesKeyword();
case WebMediaPlayerClient::kVideoTrackKindCommentary:
return VideoTrack::CommentaryKeyword();
}
NOTREACHED();
return g_empty_atom;
}
bool CanLoadURL(const KURL& url, const String& content_type_str) {
DEFINE_STATIC_LOCAL(const String, codecs, ("codecs"));
ContentType content_type(content_type_str);
String content_mime_type = content_type.GetType().DeprecatedLower();
String content_type_codecs = content_type.Parameter(codecs);
// If the MIME type is missing or is not meaningful, try to figure it out from
// the URL.
if (content_mime_type.IsEmpty() ||
content_mime_type == "application/octet-stream" ||
content_mime_type == "text/plain") {
if (url.ProtocolIsData())
content_mime_type = MimeTypeFromDataURL(url.GetString());
}
// If no MIME type is specified, always attempt to load.
if (content_mime_type.IsEmpty())
return true;
// 4.8.12.3 MIME types - In the absence of a specification to the contrary,
// the MIME type "application/octet-stream" when used with parameters, e.g.
// "application/octet-stream;codecs=theora", is a type that the user agent
// knows it cannot render.
if (content_mime_type != "application/octet-stream" ||
content_type_codecs.IsEmpty()) {
return MIMETypeRegistry::SupportsMediaMIMEType(content_mime_type,
content_type_codecs) !=
MIMETypeRegistry::kIsNotSupported;
}
return false;
}
String PreloadTypeToString(WebMediaPlayer::Preload preload_type) {
switch (preload_type) {
case WebMediaPlayer::kPreloadNone:
return "none";
case WebMediaPlayer::kPreloadMetaData:
return "metadata";
case WebMediaPlayer::kPreloadAuto:
return "auto";
}
NOTREACHED();
return String();
}
void RecordPlayPromiseRejected(PlayPromiseRejectReason reason) {
base::UmaHistogramEnumeration("Media.MediaElement.PlayPromiseReject", reason);
}
void RecordShowControlsUsage(const HTMLMediaElement* element,
MediaControlsShow value) {
if (element->IsHTMLVideoElement()) {
base::UmaHistogramEnumeration("Media.Controls.Show.Video", value);
return;
}
base::UmaHistogramEnumeration("Media.Controls.Show.Audio", value);
}
bool IsValidPlaybackRate(double rate) {
return rate == 0.0 || (rate >= HTMLMediaElement::kMinPlaybackRate &&
rate <= HTMLMediaElement::kMaxPlaybackRate);
}
std::ostream& operator<<(std::ostream& stream,
HTMLMediaElement const& media_element) {
return stream << static_cast<void const*>(&media_element);
}
} // anonymous namespace
// TODO(https://crbug.com/752720): Remove this once C++17 is adopted (and hence,
// `inline constexpr` is supported).
constexpr double HTMLMediaElement::kMinPlaybackRate;
constexpr double HTMLMediaElement::kMaxPlaybackRate;
// static
MIMETypeRegistry::SupportsType HTMLMediaElement::GetSupportsType(
const ContentType& content_type) {
// TODO(https://crbug.com/809912): Finding source of mime parsing crash.
static base::debug::CrashKeyString* content_type_crash_key =
base::debug::AllocateCrashKeyString("media_content_type",
base::debug::CrashKeySize::Size256);
base::debug::ScopedCrashKeyString scoped_crash_key(
content_type_crash_key, content_type.Raw().Utf8().c_str());
String type = content_type.GetType().DeprecatedLower();
// The codecs string is not lower-cased because MP4 values are case sensitive
// per http://tools.ietf.org/html/rfc4281#page-7.
String type_codecs = content_type.Parameter("codecs");
if (type.IsEmpty())
return MIMETypeRegistry::kIsNotSupported;
// 4.8.12.3 MIME types - The canPlayType(type) method must return the empty
// string if type is a type that the user agent knows it cannot render or is
// the type "application/octet-stream"
if (type == "application/octet-stream")
return MIMETypeRegistry::kIsNotSupported;
// Check if stricter parsing of |contentType| will cause problems.
// TODO(jrummell): Either switch to ParsedContentType or remove this UMA,
// depending on the results reported.
MIMETypeRegistry::SupportsType result =
MIMETypeRegistry::SupportsMediaMIMEType(type, type_codecs);
ReportContentTypeResultToUMA(content_type.Raw(), result);
return result;
}
bool HTMLMediaElement::IsHLSURL(const KURL& url) {
// Keep the same logic as in media_codec_util.h.
if (url.IsNull() || url.IsEmpty())
return false;
if (!url.IsLocalFile() && !url.ProtocolIs("http") && !url.ProtocolIs("https"))
return false;
return url.GetString().Contains("m3u8");
}
bool HTMLMediaElement::MediaTracksEnabledInternally() {
return RuntimeEnabledFeatures::AudioVideoTracksEnabled() ||
RuntimeEnabledFeatures::BackgroundVideoTrackOptimizationEnabled();
}
// static
void HTMLMediaElement::OnMediaControlsEnabledChange(Document* document) {
auto it = DocumentToElementSetMap().find(document);
if (it == DocumentToElementSetMap().end())
return;
DCHECK(it->value);
WeakMediaElementSet& elements = *it->value;
for (const auto& element : elements) {
element->UpdateControlsVisibility();
if (element->GetMediaControls())
element->GetMediaControls()->OnMediaControlsEnabledChange();
}
}
HTMLMediaElement::HTMLMediaElement(const QualifiedName& tag_name,
Document& document)
: HTMLElement(tag_name, document),
ExecutionContextLifecycleStateObserver(GetExecutionContext()),
load_timer_(document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::LoadTimerFired),
progress_event_timer_(
document.GetTaskRunner(TaskType::kMediaElementEvent),
this,
&HTMLMediaElement::ProgressEventTimerFired),
playback_progress_timer_(document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::PlaybackProgressTimerFired),
audio_tracks_timer_(document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::AudioTracksTimerFired),
removed_from_document_timer_(
document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::OnRemovedFromDocumentTimerFired),
played_time_ranges_(),
async_event_queue_(
MakeGarbageCollected<EventQueue>(GetExecutionContext(),
TaskType::kMediaElementEvent)),
playback_rate_(1.0f),
default_playback_rate_(1.0f),
network_state_(kNetworkEmpty),
ready_state_(kHaveNothing),
ready_state_maximum_(kHaveNothing),
volume_(1.0f),
last_seek_time_(0),
duration_(std::numeric_limits<double>::quiet_NaN()),
last_time_update_event_media_time_(
std::numeric_limits<double>::quiet_NaN()),
default_playback_start_position_(0),
load_state_(kWaitingForSource),
deferred_load_state_(kNotDeferred),
deferred_load_timer_(document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::DeferredLoadTimerFired),
cc_layer_(nullptr),
official_playback_position_(0),
official_playback_position_needs_update_(true),
fragment_end_time_(std::numeric_limits<double>::quiet_NaN()),
pending_action_flags_(0),
playing_(false),
should_delay_load_event_(false),
have_fired_loaded_data_(false),
can_autoplay_(true),
muted_(false),
paused_(true),
seeking_(false),
paused_by_context_paused_(false),
show_poster_flag_(true),
sent_stalled_event_(false),
ignore_preload_none_(false),
text_tracks_visible_(false),
should_perform_automatic_track_selection_(true),
tracks_are_ready_(true),
processing_preference_change_(false),
was_always_muted_(true),
audio_tracks_(MakeGarbageCollected<AudioTrackList>(*this)),
video_tracks_(MakeGarbageCollected<VideoTrackList>(*this)),
audio_source_node_(nullptr),
autoplay_policy_(MakeGarbageCollected<AutoplayPolicy>(this)),
remote_playback_client_(nullptr),
media_controls_(nullptr),
controls_list_(MakeGarbageCollected<HTMLMediaElementControlsList>(this)),
lazy_load_intersection_observer_(nullptr),
media_player_host_remote_(
MakeGarbageCollected<DisallowNewWrapper<
HeapMojoAssociatedRemote<media::mojom::blink::MediaPlayerHost>>>(
GetExecutionContext())),
media_player_observer_remote_set_(
MakeGarbageCollected<DisallowNewWrapper<HeapMojoAssociatedRemoteSet<
media::mojom::blink::MediaPlayerObserver>>>(
GetExecutionContext())),
media_player_receiver_set_(
MakeGarbageCollected<DisallowNewWrapper<
HeapMojoAssociatedReceiverSet<media::mojom::blink::MediaPlayer,
HTMLMediaElement>>>(
this,
GetExecutionContext())) {
DVLOG(1) << "HTMLMediaElement(" << *this << ")";
LocalFrame* frame = document.GetFrame();
if (frame) {
remote_playback_client_ =
frame->Client()->CreateWebRemotePlaybackClient(*this);
}
SetHasCustomStyleCallbacks();
AddElementToDocumentMap(this, &document);
UseCounter::Count(document, WebFeature::kHTMLMediaElement);
}
HTMLMediaElement::~HTMLMediaElement() {
DVLOG(1) << "~HTMLMediaElement(" << *this << ")";
}
void HTMLMediaElement::Dispose() {
// Destroying the player may cause a resource load to be canceled,
// which could result in LocalDOMWindow::dispatchWindowLoadEvent() being
// called via ResourceFetch::didLoadResource(), then
// FrameLoader::checkCompleted(). But it's guaranteed that the load event
// doesn't get dispatched during the object destruction.
// See Document::isDelayingLoadEvent().
// Also see http://crbug.com/275223 for more details.
ClearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
}
void HTMLMediaElement::DidMoveToNewDocument(Document& old_document) {
DVLOG(3) << "didMoveToNewDocument(" << *this << ")";
load_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
progress_event_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
playback_progress_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
audio_tracks_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
deferred_load_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
removed_from_document_timer_.MoveToNewTaskRunner(
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
autoplay_policy_->DidMoveToNewDocument(old_document);
if (cue_timeline_) {
cue_timeline_->DidMoveToNewDocument(old_document);
}
if (should_delay_load_event_) {
GetDocument().IncrementLoadEventDelayCount();
// Note: Keeping the load event delay count increment on oldDocument that
// was added when should_delay_load_event_ was set so that destruction of
// web_media_player_ can not cause load event dispatching in oldDocument.
} else {
// Incrementing the load event delay count so that destruction of
// web_media_player_ can not cause load event dispatching in oldDocument.
old_document.IncrementLoadEventDelayCount();
}
RemoveElementFromDocumentMap(this, &old_document);
AddElementToDocumentMap(this, &GetDocument());
SetExecutionContext(GetExecutionContext());
// Reset mojo state that is coupled to |old_document|'s execution context.
// NOTE: |media_player_host_remote_| is also coupled to |old_document|'s frame
media_player_host_remote_ = MakeGarbageCollected<DisallowNewWrapper<
HeapMojoAssociatedRemote<media::mojom::blink::MediaPlayerHost>>>(
GetExecutionContext());
media_player_observer_remote_set_->Value().Clear();
media_player_observer_remote_set_ = MakeGarbageCollected<DisallowNewWrapper<
HeapMojoAssociatedRemoteSet<media::mojom::blink::MediaPlayerObserver>>>(
GetExecutionContext());
media_player_receiver_set_->Value().Clear();
media_player_receiver_set_ =
MakeGarbageCollected<DisallowNewWrapper<HeapMojoAssociatedReceiverSet<
media::mojom::blink::MediaPlayer, HTMLMediaElement>>>(
this, GetExecutionContext());
// FIXME: This is a temporary fix to prevent this object from causing the
// MediaPlayer to dereference LocalFrame and FrameLoader pointers from the
// previous document. This restarts the load, as if the src attribute had been
// set. A proper fix would provide a mechanism to allow this object to
// refresh the MediaPlayer's LocalFrame and FrameLoader references on document
// changes so that playback can be resumed properly.
ignore_preload_none_ = false;
InvokeLoadAlgorithm();
// Decrement the load event delay count on oldDocument now that
// web_media_player_ has been destroyed and there is no risk of dispatching a
// load event from within the destructor.
old_document.DecrementLoadEventDelayCount();
HTMLElement::DidMoveToNewDocument(old_document);
}
bool HTMLMediaElement::SupportsFocus() const {
// TODO(https://crbug.com/911882): Depending on result of discussion, remove.
if (ownerDocument()->IsMediaDocument())
return false;
// If no controls specified, we should still be able to focus the element if
// it has tabIndex.
return ShouldShowControls() || HTMLElement::SupportsFocus();
}
bool HTMLMediaElement::IsMouseFocusable() const {
return !IsFullscreen() && SupportsFocus();
}
void HTMLMediaElement::ParseAttribute(
const AttributeModificationParams& params) {
const QualifiedName& name = params.name;
if (name == html_names::kSrcAttr) {
DVLOG(2) << "parseAttribute(" << *this
<< ", kSrcAttr, old=" << params.old_value
<< ", new=" << params.new_value << ")";
// A change to the src attribute can affect intrinsic size, which in turn
// requires a style recalc.
SetNeedsStyleRecalc(kLocalStyleChange,
StyleChangeReasonForTracing::FromAttribute(name));
// Trigger a reload, as long as the 'src' attribute is present.
if (!params.new_value.IsNull()) {
ignore_preload_none_ = false;
InvokeLoadAlgorithm();
}
} else if (name == html_names::kControlsAttr) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementControlsAttribute);
UpdateControlsVisibility();
} else if (name == html_names::kControlslistAttr) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementControlsListAttribute);
if (params.old_value != params.new_value) {
controls_list_->DidUpdateAttributeValue(params.old_value,
params.new_value);
if (GetMediaControls())
GetMediaControls()->OnControlsListUpdated();
}
} else if (name == html_names::kPreloadAttr) {
SetPlayerPreload();
} else if (name == html_names::kDisableremoteplaybackAttr) {
// This attribute is an extension described in the Remote Playback API spec.
// Please see: https://w3c.github.io/remote-playback
UseCounter::Count(GetDocument(),
WebFeature::kDisableRemotePlaybackAttribute);
if (params.old_value != params.new_value) {
if (web_media_player_) {
web_media_player_->RequestRemotePlaybackDisabled(
!params.new_value.IsNull());
}
}
} else if (name == html_names::kLatencyhintAttr &&
RuntimeEnabledFeatures::MediaLatencyHintEnabled()) {
if (GetWebMediaPlayer())
GetWebMediaPlayer()->SetLatencyHint(latencyHint());
} else {
HTMLElement::ParseAttribute(params);
}
}
void HTMLMediaElement::ParserDidSetAttributes() {
HTMLElement::ParserDidSetAttributes();
if (FastHasAttribute(html_names::kMutedAttr))
muted_ = true;
}
// This method is being used as a way to know that cloneNode finished cloning
// attribute as there is no callback notifying about the end of a cloning
// operation. Indeed, it is required per spec to set the muted state based on
// the content attribute when the object is created.
void HTMLMediaElement::CloneNonAttributePropertiesFrom(const Element& other,
CloneChildrenFlag flag) {
HTMLElement::CloneNonAttributePropertiesFrom(other, flag);
if (FastHasAttribute(html_names::kMutedAttr))
muted_ = true;
}
void HTMLMediaElement::FinishParsingChildren() {
HTMLElement::FinishParsingChildren();
if (Traversal<HTMLTrackElement>::FirstChild(*this))
ScheduleTextTrackResourceLoad();
}
bool HTMLMediaElement::LayoutObjectIsNeeded(const ComputedStyle& style) const {
return ShouldShowControls() && HTMLElement::LayoutObjectIsNeeded(style);
}
LayoutObject* HTMLMediaElement::CreateLayoutObject(const ComputedStyle&,
LegacyLayout) {
return new LayoutMedia(this);
}
Node::InsertionNotificationRequest HTMLMediaElement::InsertedInto(
ContainerNode& insertion_point) {
DVLOG(3) << "insertedInto(" << *this << ", " << insertion_point << ")";
HTMLElement::InsertedInto(insertion_point);
if (insertion_point.isConnected()) {
UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementInDocument);
if ((!FastGetAttribute(html_names::kSrcAttr).IsEmpty() || src_object_) &&
network_state_ == kNetworkEmpty) {
ignore_preload_none_ = false;
InvokeLoadAlgorithm();
}
}
return kInsertionShouldCallDidNotifySubtreeInsertions;
}
void HTMLMediaElement::DidNotifySubtreeInsertionsToDocument() {
UpdateControlsVisibility();
}
void HTMLMediaElement::RemovedFrom(ContainerNode& insertion_point) {
DVLOG(3) << "removedFrom(" << *this << ", " << insertion_point << ")";
removed_from_document_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
HTMLElement::RemovedFrom(insertion_point);
}
void HTMLMediaElement::AttachLayoutTree(AttachContext& context) {
HTMLElement::AttachLayoutTree(context);
UpdateLayoutObject();
}
void HTMLMediaElement::DidRecalcStyle(const StyleRecalcChange change) {
if (!change.ReattachLayoutTree())
UpdateLayoutObject();
}
void HTMLMediaElement::ScheduleTextTrackResourceLoad() {
DVLOG(3) << "scheduleTextTrackResourceLoad(" << *this << ")";
pending_action_flags_ |= kLoadTextTrackResource;
if (!load_timer_.IsActive())
load_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
}
void HTMLMediaElement::ScheduleNextSourceChild() {
// Schedule the timer to try the next <source> element WITHOUT resetting state
// ala invokeLoadAlgorithm.
pending_action_flags_ |= kLoadMediaResource;
load_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
}
void HTMLMediaElement::ScheduleEvent(const AtomicString& event_name) {
Event* event = Event::CreateCancelable(event_name);
event->SetTarget(this);
ScheduleEvent(event);
}
void HTMLMediaElement::ScheduleEvent(Event* event) {
#if LOG_MEDIA_EVENTS
DVLOG(3) << "ScheduleEvent(" << (void*)this << ")"
<< " - scheduling '" << event->type() << "'";
#endif
async_event_queue_->EnqueueEvent(FROM_HERE, *event);
}
void HTMLMediaElement::LoadTimerFired(TimerBase*) {
if (pending_action_flags_ & kLoadTextTrackResource)
HonorUserPreferencesForAutomaticTextTrackSelection();
if (pending_action_flags_ & kLoadMediaResource) {
if (load_state_ == kLoadingFromSourceElement)
LoadNextSourceChild();
else
LoadInternal();
}
pending_action_flags_ = 0;
}
MediaError* HTMLMediaElement::error() const {
return error_;
}
void HTMLMediaElement::SetSrc(const AtomicString& url) {
setAttribute(html_names::kSrcAttr, url);
}
void HTMLMediaElement::SetSrcObject(MediaStreamDescriptor* src_object) {
DVLOG(1) << "setSrcObject(" << *this << ")";
src_object_ = src_object;
InvokeLoadAlgorithm();
}
HTMLMediaElement::NetworkState HTMLMediaElement::getNetworkState() const {
return network_state_;
}
String HTMLMediaElement::canPlayType(ExecutionContext* context,
const String& mime_type) const {
MIMETypeRegistry::SupportsType support =
GetSupportsType(ContentType(mime_type));
if (IdentifiabilityStudySettings::Get()->ShouldSample(
blink::IdentifiableSurface::Type::kHTMLMediaElement_CanPlayType)) {
blink::IdentifiabilityMetricBuilder(context->UkmSourceID())
.Set(
blink::IdentifiableSurface::FromTypeAndToken(
blink::IdentifiableSurface::Type::kHTMLMediaElement_CanPlayType,
IdentifiabilityBenignStringToken(mime_type)),
static_cast<uint64_t>(support))
.Record(context->UkmRecorder());
}
String can_play;
// 4.8.12.3
switch (support) {
case MIMETypeRegistry::kIsNotSupported:
can_play = g_empty_string;
break;
case MIMETypeRegistry::kMayBeSupported:
can_play = "maybe";
break;
case MIMETypeRegistry::kIsSupported:
can_play = "probably";
break;
}
DVLOG(2) << "canPlayType(" << *this << ", " << mime_type << ") -> "
<< can_play;
return can_play;
}
void HTMLMediaElement::load() {
DVLOG(1) << "load(" << *this << ")";
autoplay_policy_->TryUnlockingUserGesture();
ignore_preload_none_ = true;
InvokeLoadAlgorithm();
}
// Implements the "media element load algorithm" as defined by
// https://html.spec.whatwg.org/multipage/media.html#media-element-load-algorithm
// TODO(srirama.m): Currently ignore_preload_none_ is reset before calling
// invokeLoadAlgorithm() in all places except load(). Move it inside here
// once microtask is implemented for "Await a stable state" step
// in resource selection algorithm.
void HTMLMediaElement::InvokeLoadAlgorithm() {
DVLOG(3) << "invokeLoadAlgorithm(" << *this << ")";
// Perform the cleanup required for the resource load algorithm to run.
StopPeriodicTimers();
load_timer_.Stop();
CancelDeferredLoad();
// FIXME: Figure out appropriate place to reset LoadTextTrackResource if
// necessary and set pending_action_flags_ to 0 here.
pending_action_flags_ &= ~kLoadMediaResource;
sent_stalled_event_ = false;
have_fired_loaded_data_ = false;
autoplay_policy_->StopAutoplayMutedWhenVisible();
// 1 - Abort any already-running instance of the resource selection algorithm
// for this element.
load_state_ = kWaitingForSource;
current_source_node_ = nullptr;
// 2 - Let pending tasks be a list of tasks from the media element's media
// element task source in one of the task queues.
//
// 3 - For each task in the pending tasks that would run resolve pending
// play promises or project pending play prmoises algorithms, immediately
// resolve or reject those promises in the order the corresponding tasks
// were queued.
//
// TODO(mlamouri): the promises are first resolved then rejected but the
// order between resolved/rejected promises isn't respected. This could be
// improved when the same task is used for both cases.
//
// TODO(mlamouri): don't run the callback synchronously if we are not allowed
// to run scripts. It can happen in some edge cases. https://crbug.com/660382
if (play_promise_resolve_task_handle_.IsActive() &&
!ScriptForbiddenScope::IsScriptForbidden()) {
play_promise_resolve_task_handle_.Cancel();
ResolveScheduledPlayPromises();
}
if (play_promise_reject_task_handle_.IsActive() &&
!ScriptForbiddenScope::IsScriptForbidden()) {
play_promise_reject_task_handle_.Cancel();
RejectScheduledPlayPromises();
}
// 4 - Remove each task in pending tasks from its task queue.
CancelPendingEventsAndCallbacks();
// 5 - If the media element's networkState is set to NETWORK_LOADING or
// NETWORK_IDLE, queue a task to fire a simple event named abort at the media
// element.
if (network_state_ == kNetworkLoading || network_state_ == kNetworkIdle)
ScheduleEvent(event_type_names::kAbort);
ResetMediaPlayerAndMediaSource();
// 6 - If the media element's networkState is not set to NETWORK_EMPTY, then
// run these substeps
if (network_state_ != kNetworkEmpty) {
// 4.1 - Queue a task to fire a simple event named emptied at the media
// element.
ScheduleEvent(event_type_names::kEmptied);
// 4.2 - If a fetching process is in progress for the media element, the
// user agent should stop it.
SetNetworkState(kNetworkEmpty);
// 4.4 - Forget the media element's media-resource-specific tracks.
ForgetResourceSpecificTracks();
// 4.5 - If readyState is not set to kHaveNothing, then set it to that
// state.
ready_state_ = kHaveNothing;
ready_state_maximum_ = kHaveNothing;
DCHECK(!paused_ || play_promise_resolvers_.IsEmpty());
// 4.6 - If the paused attribute is false, then run these substeps
if (!paused_) {
// 4.6.1 - Set the paused attribute to true.
paused_ = true;
// 4.6.2 - Take pending play promises and reject pending play promises
// with the result and an "AbortError" DOMException.
RecordPlayPromiseRejected(PlayPromiseRejectReason::kInterruptedByLoad);
RejectPlayPromises(DOMExceptionCode::kAbortError,
"The play() request was interrupted by a new load "
"request. https://goo.gl/LdLk22");
}
// 4.7 - If seeking is true, set it to false.
seeking_ = false;
// 4.8 - Set the current playback position to 0.
// Set the official playback position to 0.
// If this changed the official playback position, then queue a task
// to fire a simple event named timeupdate at the media element.
// 4.9 - Set the initial playback position to 0.
SetOfficialPlaybackPosition(0);
ScheduleTimeupdateEvent(false);
GetCueTimeline().OnReadyStateReset();
// 4.10 - Set the timeline offset to Not-a-Number (NaN).
// 4.11 - Update the duration attribute to Not-a-Number (NaN).
} else if (!paused_) {
// TODO(foolip): There is a proposal to always reset the paused state
// in the media element load algorithm, to avoid a bogus play() promise
// rejection: https://github.com/whatwg/html/issues/869
// This is where that change would have an effect, and it is measured to
// verify the assumption that it's a very rare situation.
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementLoadNetworkEmptyNotPaused);
}
// 7 - Set the playbackRate attribute to the value of the defaultPlaybackRate
// attribute.
setPlaybackRate(defaultPlaybackRate());
// 8 - Set the error attribute to null and the can autoplay flag to true.
SetError(nullptr);
can_autoplay_ = true;
// 9 - Invoke the media element's resource selection algorithm.
InvokeResourceSelectionAlgorithm();
// 10 - Note: Playback of any previously playing media resource for this
// element stops.
}
void HTMLMediaElement::InvokeResourceSelectionAlgorithm() {
DVLOG(3) << "invokeResourceSelectionAlgorithm(" << *this << ")";
// The resource selection algorithm
// 1 - Set the networkState to NETWORK_NO_SOURCE
SetNetworkState(kNetworkNoSource);
// 2 - Set the element's show poster flag to true
SetShowPosterFlag(true);
played_time_ranges_ = MakeGarbageCollected<TimeRanges>();
// FIXME: Investigate whether these can be moved into network_state_ !=
// kNetworkEmpty block above
// so they are closer to the relevant spec steps.
last_seek_time_ = 0;
duration_ = std::numeric_limits<double>::quiet_NaN();
// 3 - Set the media element's delaying-the-load-event flag to true (this
// delays the load event)
SetShouldDelayLoadEvent(true);
if (GetMediaControls() && isConnected())
GetMediaControls()->Reset();
// 4 - Await a stable state, allowing the task that invoked this algorithm to
// continue
// TODO(srirama.m): Remove scheduleNextSourceChild() and post a microtask
// instead. See http://crbug.com/593289 for more details.
ScheduleNextSourceChild();
}
void HTMLMediaElement::LoadInternal() {
// HTMLMediaElement::textTracksAreReady will need "... the text tracks whose
// mode was not in the disabled state when the element's resource selection
// algorithm last started".
text_tracks_when_resource_selection_began_.clear();
if (text_tracks_) {
for (unsigned i = 0; i < text_tracks_->length(); ++i) {
TextTrack* track = text_tracks_->AnonymousIndexedGetter(i);
if (track->mode() != TextTrack::DisabledKeyword())
text_tracks_when_resource_selection_began_.push_back(track);
}
}
SelectMediaResource();
}
void HTMLMediaElement::SelectMediaResource() {
DVLOG(3) << "selectMediaResource(" << *this << ")";
enum Mode { kObject, kAttribute, kChildren, kNothing };
Mode mode = kNothing;
// 6 - If the media element has an assigned media provider object, then let
// mode be object.
if (src_object_) {
mode = kObject;
} else if (FastHasAttribute(html_names::kSrcAttr)) {
// Otherwise, if the media element has no assigned media provider object
// but has a src attribute, then let mode be attribute.
mode = kAttribute;
} else if (HTMLSourceElement* element =
Traversal<HTMLSourceElement>::FirstChild(*this)) {
// Otherwise, if the media element does not have an assigned media
// provider object and does not have a src attribute, but does have a
// source element child, then let mode be children and let candidate be
// the first such source element child in tree order.
mode = kChildren;
next_child_node_to_consider_ = element;
current_source_node_ = nullptr;
} else {
// Otherwise the media element has no assigned media provider object and
// has neither a src attribute nor a source element child: set the
// networkState to kNetworkEmpty, and abort these steps; the synchronous
// section ends.
// TODO(mlamouri): Setting the network state to empty implies that there
// should be no |web_media_player_|. However, if a previous playback ended
// due to an error, we can get here and still have one. Decide on a plan
// to deal with this properly. https://crbug.com/789737
load_state_ = kWaitingForSource;
SetShouldDelayLoadEvent(false);
if (!GetWebMediaPlayer() || (ready_state_ < kHaveFutureData &&
ready_state_maximum_ < kHaveFutureData)) {
SetNetworkState(kNetworkEmpty);
} else {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementEmptyLoadWithFutureData);
}
UpdateLayoutObject();
DVLOG(3) << "selectMediaResource(" << *this << "), nothing to load";
return;
}
// 7 - Set the media element's networkState to NETWORK_LOADING.
SetNetworkState(kNetworkLoading);
// 8 - Queue a task to fire a simple event named loadstart at the media
// element.
ScheduleEvent(event_type_names::kLoadstart);
// 9 - Run the appropriate steps...
switch (mode) {
case kObject:
LoadSourceFromObject();
DVLOG(3) << "selectMediaResource(" << *this
<< ", using 'srcObject' attribute";
break;
case kAttribute:
LoadSourceFromAttribute();
DVLOG(3) << "selectMediaResource(" << *this
<< "), using 'src' attribute url";
break;
case kChildren:
LoadNextSourceChild();
DVLOG(3) << "selectMediaResource(" << *this << "), using source element";
break;
default:
NOTREACHED();
}
}
void HTMLMediaElement::LoadSourceFromObject() {
DCHECK(src_object_);
load_state_ = kLoadingFromSrcObject;
// No type is available when the resource comes from the 'srcObject'
// attribute.
LoadResource(WebMediaPlayerSource(WebMediaStream(src_object_)), String());
}
void HTMLMediaElement::LoadSourceFromAttribute() {
load_state_ = kLoadingFromSrcAttr;
const AtomicString& src_value = FastGetAttribute(html_names::kSrcAttr);
// If the src attribute's value is the empty string ... jump down to the
// failed step below
if (src_value.IsEmpty()) {
DVLOG(3) << "LoadSourceFromAttribute(" << *this << "), empty 'src'";
MediaLoadingFailed(WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage("Empty src attribute"));
return;
}
KURL media_url = GetDocument().CompleteURL(src_value);
if (!IsSafeToLoadURL(media_url, kComplain)) {
MediaLoadingFailed(
WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage("Media load rejected by URL safety check"));
return;
}
// No type is available when the url comes from the 'src' attribute so
// MediaPlayer will have to pick a media engine based on the file extension.
LoadResource(WebMediaPlayerSource(WebURL(media_url)), String());
}
void HTMLMediaElement::LoadNextSourceChild() {
String content_type;
KURL media_url = SelectNextSourceChild(&content_type, kComplain);
if (!media_url.IsValid()) {
WaitForSourceChange();
return;
}
// Reset the MediaPlayer and MediaSource if any
ResetMediaPlayerAndMediaSource();
load_state_ = kLoadingFromSourceElement;
LoadResource(WebMediaPlayerSource(WebURL(media_url)), content_type);
}
void HTMLMediaElement::LoadResource(const WebMediaPlayerSource& source,
const String& content_type) {
DCHECK(IsMainThread());
KURL url;
if (source.IsURL()) {
url = source.GetAsURL();
DCHECK(IsSafeToLoadURL(url, kComplain));
DVLOG(3) << "loadResource(" << *this << ", " << UrlForLoggingMedia(url)
<< ", " << content_type << ")";
}
LocalFrame* frame = GetDocument().GetFrame();
if (!frame) {
MediaLoadingFailed(WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage(
"Resource load failure: document has no frame"));
return;
}
// The resource fetch algorithm
SetNetworkState(kNetworkLoading);
// Set current_src_ *before* changing to the cache url, the fact that we are
// loading from the app cache is an internal detail not exposed through the
// media element API.
current_src_ = url;
// Default this to empty, so that we use |current_src_| unless the player
// provides one later.
current_src_after_redirects_ = KURL();
if (audio_source_node_)
audio_source_node_->OnCurrentSrcChanged(current_src_);
// Update remote playback client with the new src and consider it incompatible
// until proved otherwise.
RemotePlaybackCompatibilityChanged(current_src_, false);
DVLOG(3) << "loadResource(" << *this << ") - current_src_ -> "
<< UrlForLoggingMedia(current_src_);
StartProgressEventTimer();
SetPlayerPreload();
DCHECK(!media_source_attachment_);
DCHECK(!media_source_tracer_);
DCHECK(!error_);
bool attempt_load = true;
media_source_attachment_ =
MediaSourceAttachment::LookupMediaSource(url.GetString());
if (media_source_attachment_) {
bool start_result = false;
media_source_tracer_ =
media_source_attachment_->StartAttachingToMediaElement(this,
&start_result);
if (start_result) {
// If the associated feature is enabled, auto-revoke the MediaSource
// object URL that was used for attachment on successful (start of)
// attachment. This can help reduce memory bloat later if the app does not
// revoke the object URL explicitly and the object URL was the only
// remaining strong reference to an attached HTMLMediaElement+MediaSource
// cycle of objects that could otherwise be garbage-collectable.
if (base::FeatureList::IsEnabled(
media::kRevokeMediaSourceObjectURLOnAttach)) {
URLFileAPI::revokeObjectURL(GetExecutionContext(), url.GetString());
}
} else {
// Forget our reference to the MediaSourceAttachment, so we leave it alone
// while processing remainder of load failure.
media_source_attachment_.reset();
media_source_tracer_ = nullptr;
attempt_load = false;
}
}
bool can_load_resource =
source.IsMediaStream() || CanLoadURL(url, content_type);
if (attempt_load && can_load_resource) {
DCHECK(!GetWebMediaPlayer());
// Conditionally defer the load if effective preload is 'none'.
// Skip this optional deferral for MediaStream sources or any blob URL,
// including MediaSource blob URLs.
if (!source.IsMediaStream() && !url.ProtocolIs("blob") &&
EffectivePreloadType() == WebMediaPlayer::kPreloadNone) {
DVLOG(3) << "loadResource(" << *this
<< ") : Delaying load because preload == 'none'";
DeferLoad();
} else {
StartPlayerLoad();
}
} else {
MediaLoadingFailed(
WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage(attempt_load
? "Unable to load URL due to content type"
: "Unable to attach MediaSource"));
}
}
void HTMLMediaElement::StartPlayerLoad() {
DCHECK(!web_media_player_);
WebMediaPlayerSource source;
if (src_object_) {
source = WebMediaPlayerSource(WebMediaStream(src_object_));
} else {
// Filter out user:pass as those two URL components aren't
// considered for media resource fetches (including for the CORS
// use-credentials mode.) That behavior aligns with Gecko, with IE
// being more restrictive and not allowing fetches to such URLs.
//
// Spec reference: http://whatwg.org/c/#concept-media-load-resource
//
// FIXME: when the HTML spec switches to specifying resource
// fetches in terms of Fetch (http://fetch.spec.whatwg.org), and
// along with that potentially also specifying a setting for its
// 'authentication flag' to control how user:pass embedded in a
// media resource URL should be treated, then update the handling
// here to match.
KURL request_url = current_src_;
if (!request_url.User().IsEmpty())
request_url.SetUser(String());
if (!request_url.Pass().IsEmpty())
request_url.SetPass(String());
KURL kurl(request_url);
source = WebMediaPlayerSource(WebURL(kurl));
}
LocalFrame* frame = GetDocument().GetFrame();
// TODO(srirama.m): Figure out how frame can be null when
// coming from executeDeferredLoad()
if (!frame) {
MediaLoadingFailed(
WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage("Player load failure: document has no frame"));
return;
}
web_media_player_ =
frame->Client()->CreateWebMediaPlayer(*this, source, this);
if (!web_media_player_) {
MediaLoadingFailed(WebMediaPlayer::kNetworkStateFormatError,
BuildElementErrorMessage(
"Player load failure: error creating media player"));
return;
}
OnWebMediaPlayerCreated();
// Setup the communication channels between the renderer and browser processes
// via the MediaPlayer and MediaPlayerObserver mojo interfaces.
DCHECK(media_player_receiver_set_->Value().empty());
mojo::PendingAssociatedRemote<media::mojom::blink::MediaPlayer>
media_player_remote;
BindMediaPlayerReceiver(
media_player_remote.InitWithNewEndpointAndPassReceiver());
GetMediaPlayerHostRemote().OnMediaPlayerAdded(
std::move(media_player_remote), AddMediaPlayerObserverAndPassReceiver(),
web_media_player_->GetDelegateId());
if (GetLayoutObject())
GetLayoutObject()->SetShouldDoFullPaintInvalidation();
// Make sure if we create/re-create the WebMediaPlayer that we update our
// wrapper.
audio_source_provider_.Wrap(web_media_player_->GetAudioSourceProvider());
web_media_player_->SetVolume(EffectiveMediaVolume());
web_media_player_->SetPoster(PosterImageURL());
const auto preload = EffectivePreloadType();
web_media_player_->SetPreload(preload);
web_media_player_->RequestRemotePlaybackDisabled(
FastHasAttribute(html_names::kDisableremoteplaybackAttr));
bool is_cache_disabled = false;
probe::IsCacheDisabled(GetDocument().GetExecutionContext(),
&is_cache_disabled);
auto load_timing = web_media_player_->Load(GetLoadType(), source, CorsMode(),
is_cache_disabled);
if (load_timing == WebMediaPlayer::LoadTiming::kDeferred) {
// Deferred media loading is not part of the spec, but intuition is that
// this should not hold up the Window's "load" event (similar to user
// gesture requirements).
SetShouldDelayLoadEvent(false);
}
if (IsFullscreen())
web_media_player_->EnteredFullscreen();
web_media_player_->SetLatencyHint(latencyHint());
web_media_player_->SetPreservesPitch(preservesPitch());
OnLoadStarted();
}
void HTMLMediaElement::SetPlayerPreload() {
if (web_media_player_)
web_media_player_->SetPreload(EffectivePreloadType());
if (LoadIsDeferred() &&
EffectivePreloadType() != WebMediaPlayer::kPreloadNone)
StartDeferredLoad();
}
bool HTMLMediaElement::LoadIsDeferred() const {
return deferred_load_state_ != kNotDeferred;
}
void HTMLMediaElement::DeferLoad() {
// This implements the "optional" step 4 from the resource fetch algorithm
// "If mode is remote".
DCHECK(!deferred_load_timer_.IsActive());
DCHECK_EQ(deferred_load_state_, kNotDeferred);
// 1. Set the networkState to NETWORK_IDLE.
// 2. Queue a task to fire a simple event named suspend at the element.
ChangeNetworkStateFromLoadingToIdle();
// 3. Queue a task to set the element's delaying-the-load-event
// flag to false. This stops delaying the load event.
deferred_load_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
// 4. Wait for the task to be run.
deferred_load_state_ = kWaitingForStopDelayingLoadEventTask;
// Continued in executeDeferredLoad().
}
void HTMLMediaElement::CancelDeferredLoad() {
deferred_load_timer_.Stop();
deferred_load_state_ = kNotDeferred;
}
void HTMLMediaElement::ExecuteDeferredLoad() {
DCHECK_GE(deferred_load_state_, kWaitingForTrigger);
// resource fetch algorithm step 4 - continued from deferLoad().
// 5. Wait for an implementation-defined event (e.g. the user requesting that
// the media element begin playback). This is assumed to be whatever 'event'
// ended up calling this method.
CancelDeferredLoad();
// 6. Set the element's delaying-the-load-event flag back to true (this
// delays the load event again, in case it hasn't been fired yet).
SetShouldDelayLoadEvent(true);
// 7. Set the networkState to NETWORK_LOADING.
SetNetworkState(kNetworkLoading);
StartProgressEventTimer();
StartPlayerLoad();
}
void HTMLMediaElement::StartDeferredLoad() {
if (deferred_load_state_ == kWaitingForTrigger) {
ExecuteDeferredLoad();
return;
}
if (deferred_load_state_ == kExecuteOnStopDelayingLoadEventTask)
return;
DCHECK_EQ(deferred_load_state_, kWaitingForStopDelayingLoadEventTask);
deferred_load_state_ = kExecuteOnStopDelayingLoadEventTask;
}
void HTMLMediaElement::DeferredLoadTimerFired(TimerBase*) {
SetShouldDelayLoadEvent(false);
if (deferred_load_state_ == kExecuteOnStopDelayingLoadEventTask) {
ExecuteDeferredLoad();
return;
}
DCHECK_EQ(deferred_load_state_, kWaitingForStopDelayingLoadEventTask);
deferred_load_state_ = kWaitingForTrigger;
}
WebMediaPlayer::LoadType HTMLMediaElement::GetLoadType() const {
if (media_source_attachment_)
return WebMediaPlayer::kLoadTypeMediaSource;
if (src_object_)
return WebMediaPlayer::kLoadTypeMediaStream;
return WebMediaPlayer::kLoadTypeURL;
}
bool HTMLMediaElement::PausedWhenVisible() const {
return paused_ && GetWebMediaPlayer() &&
!GetWebMediaPlayer()->PausedWhenHidden();
}
void HTMLMediaElement::DidAudioOutputSinkChanged(
const String& hashed_device_id) {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnAudioOutputSinkChanged(hashed_device_id);
}
void HTMLMediaElement::SetMediaPlayerHostForTesting(
mojo::PendingAssociatedRemote<media::mojom::blink::MediaPlayerHost> host) {
media_player_host_remote_->Value().Bind(
std::move(host), GetDocument().GetTaskRunner(TaskType::kInternalMedia));
}
bool HTMLMediaElement::TextTracksAreReady() const {
// 4.8.12.11.1 Text track model
// ...
// The text tracks of a media element are ready if all the text tracks whose
// mode was not in the disabled state when the element's resource selection
// algorithm last started now have a text track readiness state of loaded or
// failed to load.
for (const auto& text_track : text_tracks_when_resource_selection_began_) {
if (text_track->GetReadinessState() == TextTrack::kLoading ||
text_track->GetReadinessState() == TextTrack::kNotLoaded)
return false;
}
return true;
}
void HTMLMediaElement::TextTrackReadyStateChanged(TextTrack* track) {
if (GetWebMediaPlayer() &&
text_tracks_when_resource_selection_began_.Contains(track)) {
if (track->GetReadinessState() != TextTrack::kLoading) {
SetReadyState(
static_cast<ReadyState>(GetWebMediaPlayer()->GetReadyState()));
}
} else {
// The track readiness state might have changed as a result of the user
// clicking the captions button. In this case, a check whether all the
// resources have failed loading should be done in order to hide the CC
// button.
// TODO(mlamouri): when an HTMLTrackElement fails to load, it is not
// propagated to the TextTrack object in a web exposed fashion. We have to
// keep relying on a custom glue to the controls while this is taken care
// of on the web side. See https://crbug.com/669977
if (GetMediaControls() &&
track->GetReadinessState() == TextTrack::kFailedToLoad) {
GetMediaControls()->OnTrackElementFailedToLoad();
}
}
}
void HTMLMediaElement::TextTrackModeChanged(TextTrack* track) {
// Mark this track as "configured" so configureTextTracks won't change the
// mode again.
if (IsA<LoadableTextTrack>(track))
track->SetHasBeenConfigured(true);
if (track->IsRendered()) {
GetDocument().GetStyleEngine().AddTextTrack(track);
} else {
GetDocument().GetStyleEngine().RemoveTextTrack(track);
}
ConfigureTextTrackDisplay();
DCHECK(textTracks()->Contains(track));
textTracks()->ScheduleChangeEvent();
}
void HTMLMediaElement::DisableAutomaticTextTrackSelection() {
should_perform_automatic_track_selection_ = false;
}
bool HTMLMediaElement::IsSafeToLoadURL(const KURL& url,
InvalidURLAction action_if_invalid) {
if (!url.IsValid()) {
DVLOG(3) << "isSafeToLoadURL(" << *this << ", " << UrlForLoggingMedia(url)
<< ") -> FALSE because url is invalid";
return false;
}
LocalDOMWindow* window = GetDocument().domWindow();
if (!window || !window->GetSecurityOrigin()->CanDisplay(url)) {
if (action_if_invalid == kComplain) {
GetDocument().AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
mojom::ConsoleMessageSource::kSecurity,
mojom::ConsoleMessageLevel::kError,
"Not allowed to load local resource: " + url.ElidedString()));
}
DVLOG(3) << "isSafeToLoadURL(" << *this << ", " << UrlForLoggingMedia(url)
<< ") -> FALSE rejected by SecurityOrigin";
return false;
}
if (!GetExecutionContext()->GetContentSecurityPolicy()->AllowMediaFromSource(
url)) {
DVLOG(3) << "isSafeToLoadURL(" << *this << ", " << UrlForLoggingMedia(url)
<< ") -> rejected by Content Security Policy";
return false;
}
return true;
}
bool HTMLMediaElement::IsMediaDataCorsSameOrigin() const {
if (!GetWebMediaPlayer())
return true;
const auto network_state = GetWebMediaPlayer()->GetNetworkState();
if (network_state == WebMediaPlayer::kNetworkStateNetworkError)
return false;
return !GetWebMediaPlayer()->WouldTaintOrigin();
}
void HTMLMediaElement::StartProgressEventTimer() {
if (progress_event_timer_.IsActive())
return;
previous_progress_time_ = base::ElapsedTimer();
// 350ms is not magic, it is in the spec!
progress_event_timer_.StartRepeating(base::TimeDelta::FromMilliseconds(350),
FROM_HERE);
}
void HTMLMediaElement::WaitForSourceChange() {
DVLOG(3) << "waitForSourceChange(" << *this << ")";
StopPeriodicTimers();
load_state_ = kWaitingForSource;
// 17 - Waiting: Set the element's networkState attribute to the
// NETWORK_NO_SOURCE value
SetNetworkState(kNetworkNoSource);
// 18 - Set the element's show poster flag to true.
SetShowPosterFlag(true);
// 19 - Set the element's delaying-the-load-event flag to false. This stops
// delaying the load event.
SetShouldDelayLoadEvent(false);
UpdateLayoutObject();
}
void HTMLMediaElement::NoneSupported(const String& input_message) {
DVLOG(3) << "NoneSupported(" << *this << ", message='" << input_message
<< "')";
StopPeriodicTimers();
load_state_ = kWaitingForSource;
current_source_node_ = nullptr;
String empty_string;
const String& message = MediaShouldBeOpaque() ? empty_string : input_message;
// 4.8.12.5
// The dedicated media source failure steps are the following steps:
// 1 - Set the error attribute to a new MediaError object whose code attribute
// is set to MEDIA_ERR_SRC_NOT_SUPPORTED.
SetError(MakeGarbageCollected<MediaError>(
MediaError::kMediaErrSrcNotSupported, message));
// 2 - Forget the media element's media-resource-specific text tracks.
ForgetResourceSpecificTracks();
// 3 - Set the element's networkState attribute to the NETWORK_NO_SOURCE
// value.
SetNetworkState(kNetworkNoSource);
// 4 - Set the element's show poster flag to true.
SetShowPosterFlag(true);
// 5 - Fire a simple event named error at the media element.
ScheduleEvent(event_type_names::kError);
// 6 - Reject pending play promises with NotSupportedError.
ScheduleRejectPlayPromises(DOMExceptionCode::kNotSupportedError);
CloseMediaSource();
// 7 - Set the element's delaying-the-load-event flag to false. This stops
// delaying the load event.
SetShouldDelayLoadEvent(false);
UpdateLayoutObject();
}
void HTMLMediaElement::MediaEngineError(MediaError* err) {
DCHECK_GE(ready_state_, kHaveMetadata);
DVLOG(3) << "mediaEngineError(" << *this << ", "
<< static_cast<int>(err->code()) << ")";
// 1 - The user agent should cancel the fetching process.
StopPeriodicTimers();
load_state_ = kWaitingForSource;
// 2 - Set the error attribute to a new MediaError object whose code attribute
// is set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE.
SetError(err);
// 3 - Queue a task to fire a simple event named error at the media element.
ScheduleEvent(event_type_names::kError);
// 4 - Set the element's networkState attribute to the NETWORK_IDLE value.
SetNetworkState(kNetworkIdle);
// 5 - Set the element's delaying-the-load-event flag to false. This stops
// delaying the load event.
SetShouldDelayLoadEvent(false);
// 6 - Abort the overall resource selection algorithm.
current_source_node_ = nullptr;
}
void HTMLMediaElement::CancelPendingEventsAndCallbacks() {
DVLOG(3) << "cancelPendingEventsAndCallbacks(" << *this << ")";
async_event_queue_->CancelAllEvents();
for (HTMLSourceElement* source =
Traversal<HTMLSourceElement>::FirstChild(*this);
source; source = Traversal<HTMLSourceElement>::NextSibling(*source))
source->CancelPendingErrorEvent();
}
void HTMLMediaElement::NetworkStateChanged() {
SetNetworkState(GetWebMediaPlayer()->GetNetworkState());
}
void HTMLMediaElement::MediaLoadingFailed(WebMediaPlayer::NetworkState error,
const String& input_message) {
DVLOG(3) << "MediaLoadingFailed(" << *this << ", " << int{error}
<< ", message='" << input_message << "')";
bool should_be_opaque = MediaShouldBeOpaque();
if (should_be_opaque)
error = WebMediaPlayer::kNetworkStateNetworkError;
String empty_string;
const String& message = should_be_opaque ? empty_string : input_message;
StopPeriodicTimers();
// If we failed while trying to load a <source> element, the movie was never
// parsed, and there are more <source> children, schedule the next one
if (ready_state_ < kHaveMetadata &&
load_state_ == kLoadingFromSourceElement) {
// resource selection algorithm
// Step 9.Otherwise.9 - Failed with elements: Queue a task, using the DOM
// manipulation task source, to fire a simple event named error at the
// candidate element.
if (current_source_node_) {
current_source_node_->ScheduleErrorEvent();
} else {
DVLOG(3) << "mediaLoadingFailed(" << *this
<< ") - error event not sent, <source> was removed";
}
// 9.Otherwise.10 - Asynchronously await a stable state. The synchronous
// section consists of all the remaining steps of this algorithm until the
// algorithm says the synchronous section has ended.
// 9.Otherwise.11 - Forget the media element's media-resource-specific
// tracks.
ForgetResourceSpecificTracks();
if (HavePotentialSourceChild()) {
DVLOG(3) << "mediaLoadingFailed(" << *this
<< ") - scheduling next <source>";
ScheduleNextSourceChild();
} else {
DVLOG(3) << "mediaLoadingFailed(" << *this
<< ") - no more <source> elements, waiting";
WaitForSourceChange();
}
return;
}
if (error == WebMediaPlayer::kNetworkStateNetworkError &&
ready_state_ >= kHaveMetadata) {
MediaEngineError(MakeGarbageCollected<MediaError>(
MediaError::kMediaErrNetwork, message));
} else if (error == WebMediaPlayer::kNetworkStateDecodeError) {
MediaEngineError(
MakeGarbageCollected<MediaError>(MediaError::kMediaErrDecode, message));
} else if ((error == WebMediaPlayer::kNetworkStateFormatError ||
error == WebMediaPlayer::kNetworkStateNetworkError) &&
load_state_ == kLoadingFromSrcAttr) {
if (message.IsEmpty()) {
// Generate a more meaningful error message to differentiate the two types
// of MEDIA_SRC_ERR_NOT_SUPPORTED.
NoneSupported(BuildElementErrorMessage(
error == WebMediaPlayer::kNetworkStateFormatError ? "Format error"
: "Network error"));
} else {
NoneSupported(message);
}
}
UpdateLayoutObject();
}
void HTMLMediaElement::SetNetworkState(WebMediaPlayer::NetworkState state) {
DVLOG(3) << "setNetworkState(" << *this << ", " << static_cast<int>(state)
<< ") - current state is " << int{network_state_};
if (state == WebMediaPlayer::kNetworkStateEmpty) {
// Just update the cached state and leave, we can't do anything.
SetNetworkState(kNetworkEmpty);
return;
}
if (state == WebMediaPlayer::kNetworkStateFormatError ||
state == WebMediaPlayer::kNetworkStateNetworkError ||
state == WebMediaPlayer::kNetworkStateDecodeError) {
MediaLoadingFailed(state, web_media_player_->GetErrorMessage());
return;
}
if (state == WebMediaPlayer::kNetworkStateIdle) {
if (network_state_ > kNetworkIdle) {
ChangeNetworkStateFromLoadingToIdle();
SetShouldDelayLoadEvent(false);
} else {
SetNetworkState(kNetworkIdle);
}
}
if (state == WebMediaPlayer::kNetworkStateLoading) {
if (network_state_ < kNetworkLoading || network_state_ == kNetworkNoSource)
StartProgressEventTimer();
SetNetworkState(kNetworkLoading);
}
if (state == WebMediaPlayer::kNetworkStateLoaded) {
if (network_state_ != kNetworkIdle)
ChangeNetworkStateFromLoadingToIdle();
}
}
void HTMLMediaElement::ChangeNetworkStateFromLoadingToIdle() {
progress_event_timer_.Stop();
if (!MediaShouldBeOpaque()) {
// Schedule one last progress event so we guarantee that at least one is
// fired for files that load very quickly.
if (GetWebMediaPlayer() && GetWebMediaPlayer()->DidLoadingProgress())
ScheduleEvent(event_type_names::kProgress);
ScheduleEvent(event_type_names::kSuspend);
SetNetworkState(kNetworkIdle);
} else {
// TODO(dalecurtis): Replace c-style casts in follow up patch.
DVLOG(1) << __func__ << "(" << *this
<< ") - Deferred network state change to idle for opaque media";
}
}
void HTMLMediaElement::ReadyStateChanged() {
SetReadyState(static_cast<ReadyState>(GetWebMediaPlayer()->GetReadyState()));
}
void HTMLMediaElement::SetReadyState(ReadyState state) {
DVLOG(3) << "setReadyState(" << *this << ", " << int{state}
<< ") - current state is " << int{ready_state_};
// Set "wasPotentiallyPlaying" BEFORE updating ready_state_,
// potentiallyPlaying() uses it
bool was_potentially_playing = PotentiallyPlaying();
ReadyState old_state = ready_state_;
ReadyState new_state = state;
bool tracks_are_ready = TextTracksAreReady();
if (new_state == old_state && tracks_are_ready_ == tracks_are_ready)
return;
tracks_are_ready_ = tracks_are_ready;
if (tracks_are_ready) {
ready_state_ = new_state;
} else {
// If a media file has text tracks the readyState may not progress beyond
// kHaveFutureData until the text tracks are ready, regardless of the state
// of the media file.
if (new_state <= kHaveMetadata)
ready_state_ = new_state;
else
ready_state_ = kHaveCurrentData;
}
// If we're transitioning to / past kHaveMetadata, then cache the final URL.
if (old_state < kHaveMetadata && new_state >= kHaveMetadata &&
web_media_player_) {
current_src_after_redirects_ =
KURL(web_media_player_->GetSrcAfterRedirects());
// Sometimes WebMediaPlayer may load a URL from an in memory cache, which
// skips notification of insecure content. Ensure we always notify the
// MixedContentChecker of what happened, even if the load was skipped.
if (LocalFrame* frame = GetDocument().GetFrame()) {
// We don't care about the return value here. The MixedContentChecker will
// internally notify for insecure content if it needs to regardless of
// what the return value ends up being for this call.
MixedContentChecker::ShouldBlockFetch(
frame,
HasVideo() ? mojom::blink::RequestContextType::VIDEO
: mojom::blink::RequestContextType::AUDIO,
current_src_,
// Strictly speaking, this check is an approximation; a request could
// have have redirected back to its original URL, for example.
// However, the redirect status is only used to prevent leaking
// information cross-origin via CSP reports, so comparing URLs is
// sufficient for that purpose.
current_src_after_redirects_ == current_src_
? ResourceRequest::RedirectStatus::kNoRedirect
: ResourceRequest::RedirectStatus::kFollowedRedirect,
current_src_after_redirects_, /* devtools_id= */ absl::nullopt,
ReportingDisposition::kReport,
GetDocument().Loader()->GetContentSecurityNotifier());
}
// Prior to kHaveMetadata |network_state_| may be inaccurate to avoid side
// channel leaks. This be a no-op if nothing has changed.
NetworkStateChanged();
}
if (new_state > ready_state_maximum_)
ready_state_maximum_ = new_state;
if (network_state_ == kNetworkEmpty)
return;
if (seeking_) {
// 4.8.12.9, step 9 note: If the media element was potentially playing
// immediately before it started seeking, but seeking caused its readyState
// attribute to change to a value lower than kHaveFutureData, then a waiting
// will be fired at the element.
if (was_potentially_playing && ready_state_ < kHaveFutureData)
ScheduleEvent(event_type_names::kWaiting);
// 4.8.12.9 steps 12-14
if (ready_state_ >= kHaveCurrentData)
FinishSeek();
} else {
if (was_potentially_playing && ready_state_ < kHaveFutureData) {
// Force an update to official playback position. Automatic updates from
// currentPlaybackPosition() will be blocked while ready_state_ remains
// < kHaveFutureData. This blocking is desired after 'waiting' has been
// fired, but its good to update it one final time to accurately reflect
// media time at the moment we ran out of data to play.
SetOfficialPlaybackPosition(CurrentPlaybackPosition());
// 4.8.12.8
ScheduleTimeupdateEvent(false);
ScheduleEvent(event_type_names::kWaiting);
}
}
// Once enough of the media data has been fetched to determine the duration of
// the media resource, its dimensions, and other metadata...
if (ready_state_ >= kHaveMetadata && old_state < kHaveMetadata) {
CreatePlaceholderTracksIfNecessary();
MediaFragmentURIParser fragment_parser(current_src_);
fragment_end_time_ = fragment_parser.EndTime();
// Set the current playback position and the official playback position to
// the earliest possible position.
SetOfficialPlaybackPosition(EarliestPossiblePosition());
duration_ = web_media_player_->Duration();
ScheduleEvent(event_type_names::kDurationchange);
if (IsHTMLVideoElement())
ScheduleEvent(event_type_names::kResize);
ScheduleEvent(event_type_names::kLoadedmetadata);
bool jumped = false;
if (default_playback_start_position_ > 0) {
Seek(default_playback_start_position_);
jumped = true;
}
default_playback_start_position_ = 0;
double initial_playback_position = fragment_parser.StartTime();
if (std::isnan(initial_playback_position))
initial_playback_position = 0;
if (!jumped && initial_playback_position > 0) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementSeekToFragmentStart);
Seek(initial_playback_position);
jumped = true;
}
web_media_player_->SetAutoplayInitiated(true);
UpdateLayoutObject();
}
bool is_potentially_playing = PotentiallyPlaying();
if (ready_state_ >= kHaveCurrentData && old_state < kHaveCurrentData &&
!have_fired_loaded_data_) {
// Force an update to official playback position to catch non-zero start
// times that were not known at kHaveMetadata, but are known now that the
// first packets have been demuxed.
SetOfficialPlaybackPosition(CurrentPlaybackPosition());
have_fired_loaded_data_ = true;
ScheduleEvent(event_type_names::kLoadeddata);
SetShouldDelayLoadEvent(false);
OnLoadFinished();
}
if (ready_state_ == kHaveFutureData && old_state <= kHaveCurrentData &&
tracks_are_ready) {
ScheduleEvent(event_type_names::kCanplay);
if (is_potentially_playing)
ScheduleNotifyPlaying();
}
if (ready_state_ == kHaveEnoughData && old_state < kHaveEnoughData &&
tracks_are_ready) {
if (old_state <= kHaveCurrentData) {
ScheduleEvent(event_type_names::kCanplay);
if (is_potentially_playing)
ScheduleNotifyPlaying();
}
if (autoplay_policy_->RequestAutoplayByAttribute()) {
paused_ = false;
SetShowPosterFlag(false);
GetCueTimeline().InvokeTimeMarchesOn();
ScheduleEvent(event_type_names::kPlay);
ScheduleNotifyPlaying();
can_autoplay_ = false;
}
ScheduleEvent(event_type_names::kCanplaythrough);
}
UpdatePlayState();
}
void HTMLMediaElement::SetShowPosterFlag(bool value) {
DVLOG(3) << "SetShowPosterFlag(" << *this << ", " << value
<< ") - current state is " << show_poster_flag_;
if (value == show_poster_flag_)
return;
show_poster_flag_ = value;
UpdateLayoutObject();
}
void HTMLMediaElement::UpdateLayoutObject() {
if (GetLayoutObject())
GetLayoutObject()->UpdateFromElement();
}
void HTMLMediaElement::ProgressEventTimerFired(TimerBase*) {
if (network_state_ != kNetworkLoading) {
RecordProgressEventTimerState(ProgressEventTimerState::kNotLoading);
return;
}
// If this is an cross-origin request, and we haven't discovered whether
// the media is actually playable yet, don't fire any progress events as
// those may let the page know information about the resource that it's
// not supposed to know.
if (MediaShouldBeOpaque()) {
RecordProgressEventTimerState(
ProgressEventTimerState::kMediaShouldBeOpaque);
return;
}
DCHECK(previous_progress_time_);
if (GetWebMediaPlayer() && GetWebMediaPlayer()->DidLoadingProgress()) {
ScheduleEvent(event_type_names::kProgress);
previous_progress_time_ = base::ElapsedTimer();
sent_stalled_event_ = false;
UpdateLayoutObject();
RecordProgressEventTimerState(ProgressEventTimerState::kProgress);
} else if (media_source_attachment_) {
RecordProgressEventTimerState(
ProgressEventTimerState::kHasMediaSourceAttachment);
} else if (previous_progress_time_->Elapsed() <=
kStalledNotificationInterval) {
RecordProgressEventTimerState(ProgressEventTimerState::kRecentProgress);
} else if (sent_stalled_event_) {
RecordProgressEventTimerState(
ProgressEventTimerState::kStalledEventAlreadyScheduled);
} else {
// Note the !media_source_attachment_ condition above. The 'stalled' event
// is not fired when using MSE. MSE's resource is considered 'local' (we
// don't manage the download - the app does), so the HTML5 spec text around
// 'stalled' does not apply. See discussion in https://crbug.com/517240 We
// also don't need to take any action wrt delaying-the-load-event.
// MediaSource disables the delayed load when first attached.
ScheduleEvent(event_type_names::kStalled);
sent_stalled_event_ = true;
SetShouldDelayLoadEvent(false);
RecordProgressEventTimerState(ProgressEventTimerState::kStalled);
}
}
void HTMLMediaElement::AddPlayedRange(double start, double end) {
DVLOG(3) << "addPlayedRange(" << *this << ", " << start << ", " << end << ")";
if (!played_time_ranges_)
played_time_ranges_ = MakeGarbageCollected<TimeRanges>();
played_time_ranges_->Add(start, end);
}
bool HTMLMediaElement::SupportsSave() const {
// Check if download is disabled per settings.
if (GetDocument().GetSettings() &&
GetDocument().GetSettings()->GetHideDownloadUI()) {
return false;
}
// Get the URL that we'll use for downloading.
const KURL url = downloadURL();
// URLs that lead to nowhere are ignored.
if (url.IsNull() || url.IsEmpty())
return false;
// If we have no source, we can't download.
if (network_state_ == kNetworkEmpty || network_state_ == kNetworkNoSource)
return false;
// It is not useful to offer a save feature on local files.
if (url.IsLocalFile())
return false;
// MediaStream can't be downloaded.
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return false;
// MediaSource can't be downloaded.
if (HasMediaSource())
return false;
// HLS stream shouldn't have a download button.
if (IsHLSURL(url))
return false;
// Infinite streams don't have a clear end at which to finish the download.
if (duration() == std::numeric_limits<double>::infinity())
return false;
return true;
}
bool HTMLMediaElement::SupportsLoop() const {
// MediaStream can't be looped.
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return false;
// Infinite streams don't have a clear end at which to loop.
if (duration() == std::numeric_limits<double>::infinity())
return false;
return true;
}
void HTMLMediaElement::SetIgnorePreloadNone() {
DVLOG(3) << "setIgnorePreloadNone(" << *this << ")";
ignore_preload_none_ = true;
SetPlayerPreload();
}
void HTMLMediaElement::Seek(double time) {
DVLOG(2) << "seek(" << *this << ", " << time << ")";
// 1 - Set the media element's show poster flag to false.
SetShowPosterFlag(false);
// 2 - If the media element's readyState is HAVE_NOTHING, abort these steps.
// FIXME: remove web_media_player_ check once we figure out how
// web_media_player_ is going out of sync with readystate.
// web_media_player_ is cleared but readystate is not set to HAVE_NOTHING.
if (!web_media_player_ || ready_state_ == kHaveNothing)
return;
// Ignore preload none and start load if necessary.
SetIgnorePreloadNone();
// Get the current time before setting seeking_, last_seek_time_ is returned
// once it is set.
double now = currentTime();
// 3 - If the element's seeking IDL attribute is true, then another instance
// of this algorithm is already running. Abort that other instance of the
// algorithm without waiting for the step that it is running to complete.
// Nothing specific to be done here.
// 4 - Set the seeking IDL attribute to true.
// The flag will be cleared when the engine tells us the time has actually
// changed.
seeking_ = true;
// 6 - If the new playback position is later than the end of the media
// resource, then let it be the end of the media resource instead.
time = std::min(time, duration());
// 7 - If the new playback position is less than the earliest possible
// position, let it be that position instead.
time = std::max(time, EarliestPossiblePosition());
// Ask the media engine for the time value in the movie's time scale before
// comparing with current time. This is necessary because if the seek time is
// not equal to currentTime but the delta is less than the movie's time scale,
// we will ask the media engine to "seek" to the current movie time, which may
// be a noop and not generate a timechanged callback. This means seeking_
// will never be cleared and we will never fire a 'seeked' event.
double media_time = GetWebMediaPlayer()->MediaTimeForTimeValue(time);
if (time != media_time) {
DVLOG(3) << "seek(" << *this << ", " << time
<< ") - media timeline equivalent is " << media_time;
time = media_time;
}
// 8 - If the (possibly now changed) new playback position is not in one of
// the ranges given in the seekable attribute, then let it be the position in
// one of the ranges given in the seekable attribute that is the nearest to
// the new playback position. ... If there are no ranges given in the seekable
// attribute then set the seeking IDL attribute to false and abort these
// steps.
WebTimeRanges seekable_ranges = SeekableInternal();
if (seekable_ranges.empty()) {
seeking_ = false;
return;
}
time = seekable_ranges.Nearest(time, now);
if (playing_ && last_seek_time_ < now)
AddPlayedRange(last_seek_time_, now);
last_seek_time_ = time;
// 10 - Queue a task to fire a simple event named seeking at the element.
ScheduleEvent(event_type_names::kSeeking);
// 11 - Set the current playback position to the given new playback position.
GetWebMediaPlayer()->Seek(time);
GetWebMediaPlayer()->OnTimeUpdate();
// 14-17 are handled, if necessary, when the engine signals a readystate
// change or otherwise satisfies seek completion and signals a time change.
}
void HTMLMediaElement::FinishSeek() {
DVLOG(3) << "finishSeek(" << *this << ")";
// 14 - Set the seeking IDL attribute to false.
seeking_ = false;
// Force an update to officialPlaybackPosition. Periodic updates generally
// handle this, but may be skipped paused or waiting for data.
SetOfficialPlaybackPosition(CurrentPlaybackPosition());
// 15 - Run the time marches on steps.
GetCueTimeline().InvokeTimeMarchesOn();
// 16 - Queue a task to fire a simple event named timeupdate at the element.
ScheduleTimeupdateEvent(false);
// 17 - Queue a task to fire a simple event named seeked at the element.
ScheduleEvent(event_type_names::kSeeked);
}
HTMLMediaElement::ReadyState HTMLMediaElement::getReadyState() const {
return ready_state_;
}
bool HTMLMediaElement::HasVideo() const {
return GetWebMediaPlayer() && GetWebMediaPlayer()->HasVideo();
}
bool HTMLMediaElement::HasAudio() const {
return GetWebMediaPlayer() && GetWebMediaPlayer()->HasAudio();
}
bool HTMLMediaElement::seeking() const {
return seeking_;
}
// https://www.w3.org/TR/html51/semantics-embedded-content.html#earliest-possible-position
// The earliest possible position is not explicitly exposed in the API; it
// corresponds to the start time of the first range in the seekable attribute’s
// TimeRanges object, if any, or the current playback position otherwise.
double HTMLMediaElement::EarliestPossiblePosition() const {
WebTimeRanges seekable_ranges = SeekableInternal();
if (!seekable_ranges.empty())
return seekable_ranges.front().start;
return CurrentPlaybackPosition();
}
double HTMLMediaElement::CurrentPlaybackPosition() const {
// "Official" playback position won't take updates from "current" playback
// position until ready_state_ > kHaveMetadata, but other callers (e.g.
// pauseInternal) may still request currentPlaybackPosition at any time.
// From spec: "Media elements have a current playback position, which must
// initially (i.e., in the absence of media data) be zero seconds."
if (ready_state_ == kHaveNothing)
return 0;
if (GetWebMediaPlayer())
return GetWebMediaPlayer()->CurrentTime();
if (ready_state_ >= kHaveMetadata) {
DVLOG(3) << __func__ << " readyState = " << ready_state_
<< " but no webMediaPlayer to provide currentPlaybackPosition";
}
return 0;
}
double HTMLMediaElement::OfficialPlaybackPosition() const {
// Hold updates to official playback position while paused or waiting for more
// data. The underlying media player may continue to make small advances in
// currentTime (e.g. as samples in the last rendered audio buffer are played
// played out), but advancing currentTime while paused/waiting sends a mixed
// signal about the state of playback.
bool waiting_for_data = ready_state_ <= kHaveCurrentData;
if (official_playback_position_needs_update_ && !paused_ &&
!waiting_for_data) {
SetOfficialPlaybackPosition(CurrentPlaybackPosition());
}
#if LOG_OFFICIAL_TIME_STATUS
static const double kMinCachedDeltaForWarning = 0.01;
double delta =
std::abs(official_playback_position_ - CurrentPlaybackPosition());
if (delta > kMinCachedDeltaForWarning) {
DVLOG(3) << "CurrentTime(" << (void*)this << ") - WARNING, cached time is "
<< delta << "seconds off of media time when paused/waiting";
}
#endif
return official_playback_position_;
}
void HTMLMediaElement::SetOfficialPlaybackPosition(double position) const {
#if LOG_OFFICIAL_TIME_STATUS
DVLOG(3) << "SetOfficialPlaybackPosition(" << (void*)this
<< ") was:" << official_playback_position_ << " now:" << position;
#endif
// Internal player position may advance slightly beyond duration because
// many files use imprecise duration. Clamp official position to duration when
// known. Duration may be unknown when readyState < HAVE_METADATA.
official_playback_position_ =
std::isnan(duration()) ? position : std::min(duration(), position);
if (official_playback_position_ != position) {
DVLOG(3) << "setOfficialPlaybackPosition(" << *this
<< ") position:" << position
<< " truncated to duration:" << official_playback_position_;
}
// Once set, official playback position should hold steady until the next
// stable state. We approximate this by using a microtask to mark the
// need for an update after the current (micro)task has completed. When
// needed, the update is applied in the next call to
// officialPlaybackPosition().
official_playback_position_needs_update_ = false;
Microtask::EnqueueMicrotask(
WTF::Bind(&HTMLMediaElement::RequireOfficialPlaybackPositionUpdate,
WrapWeakPersistent(this)));
}
void HTMLMediaElement::RequireOfficialPlaybackPositionUpdate() const {
official_playback_position_needs_update_ = true;
}
double HTMLMediaElement::currentTime() const {
if (default_playback_start_position_)
return default_playback_start_position_;
if (seeking_) {
DVLOG(3) << "currentTime(" << *this << ") - seeking, returning "
<< last_seek_time_;
return last_seek_time_;
}
return OfficialPlaybackPosition();
}
void HTMLMediaElement::setCurrentTime(double time) {
// If the media element's readyState is kHaveNothing, then set the default
// playback start position to that time.
if (ready_state_ == kHaveNothing) {
default_playback_start_position_ = time;
} else {
Seek(time);
}
ReportCurrentTimeToMediaSource();
}
double HTMLMediaElement::duration() const {
return duration_;
}
bool HTMLMediaElement::paused() const {
return paused_;
}
double HTMLMediaElement::defaultPlaybackRate() const {
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return 1.0;
return default_playback_rate_;
}
void HTMLMediaElement::setDefaultPlaybackRate(double rate) {
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return;
if (default_playback_rate_ == rate || !IsValidPlaybackRate(rate))
return;
default_playback_rate_ = rate;
ScheduleEvent(event_type_names::kRatechange);
}
double HTMLMediaElement::playbackRate() const {
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return 1.0;
return playback_rate_;
}
void HTMLMediaElement::setPlaybackRate(double rate,
ExceptionState& exception_state) {
DVLOG(3) << "setPlaybackRate(" << *this << ", " << rate << ")";
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return;
if (!IsValidPlaybackRate(rate)) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementMediaPlaybackRateOutOfRange);
// When the proposed playbackRate is unsupported, throw a NotSupportedError
// DOMException and don't update the value.
exception_state.ThrowDOMException(
DOMExceptionCode::kNotSupportedError,
"The provided playback rate (" + String::Number(rate) +
") is not in the " + "supported playback range.");
// Do not update |playback_rate_|.
return;
}
if (playback_rate_ != rate) {
playback_rate_ = rate;
ScheduleEvent(event_type_names::kRatechange);
}
// FIXME: remove web_media_player_ check once we figure out how
// web_media_player_ is going out of sync with readystate.
// web_media_player_ is cleared but readystate is not set to kHaveNothing.
if (web_media_player_) {
if (PotentiallyPlaying())
web_media_player_->SetRate(playbackRate());
web_media_player_->OnTimeUpdate();
}
if (cue_timeline_ && PotentiallyPlaying())
cue_timeline_->OnPlaybackRateUpdated();
}
HTMLMediaElement::DirectionOfPlayback HTMLMediaElement::GetDirectionOfPlayback()
const {
return playback_rate_ >= 0 ? kForward : kBackward;
}
bool HTMLMediaElement::ended() const {
// 4.8.12.8 Playing the media resource
// The ended attribute must return true if the media element has ended
// playback and the direction of playback is forwards, and false otherwise.
return EndedPlayback() && GetDirectionOfPlayback() == kForward;
}
bool HTMLMediaElement::Autoplay() const {
return FastHasAttribute(html_names::kAutoplayAttr);
}
String HTMLMediaElement::preload() const {
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return PreloadTypeToString(WebMediaPlayer::kPreloadNone);
return PreloadTypeToString(PreloadType());
}
void HTMLMediaElement::setPreload(const AtomicString& preload) {
DVLOG(2) << "setPreload(" << *this << ", " << preload << ")";
if (GetLoadType() == WebMediaPlayer::kLoadTypeMediaStream)
return;
setAttribute(html_names::kPreloadAttr, preload);
}
WebMediaPlayer::Preload HTMLMediaElement::PreloadType() const {
const AtomicString& preload = FastGetAttribute(html_names::kPreloadAttr);
if (EqualIgnoringASCIICase(preload, "none")) {
UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadNone);
return WebMediaPlayer::kPreloadNone;
}
if (EqualIgnoringASCIICase(preload, "metadata")) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementPreloadMetadata);
return WebMediaPlayer::kPreloadMetaData;
}
// Force preload to 'metadata' on cellular connections.
if (GetNetworkStateNotifier().IsCellularConnectionType()) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementPreloadForcedMetadata);
return WebMediaPlayer::kPreloadMetaData;
}
// Per HTML spec, "The empty string ... maps to the Automatic state."
// https://html.spec.whatwg.org/C/#attr-media-preload
if (EqualIgnoringASCIICase(preload, "auto") ||
EqualIgnoringASCIICase(preload, "")) {
UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadAuto);
return WebMediaPlayer::kPreloadAuto;
}
// "The attribute's missing value default is user-agent defined, though the
// Metadata state is suggested as a compromise between reducing server load
// and providing an optimal user experience."
// The spec does not define an invalid value default:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=28950
UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadDefault);
return WebMediaPlayer::kPreloadMetaData;
}
String HTMLMediaElement::EffectivePreload() const {
return PreloadTypeToString(EffectivePreloadType());
}
WebMediaPlayer::Preload HTMLMediaElement::EffectivePreloadType() const {
if (Autoplay() && !autoplay_policy_->IsGestureNeededForPlayback())
return WebMediaPlayer::kPreloadAuto;
WebMediaPlayer::Preload preload = PreloadType();
if (ignore_preload_none_ && preload == WebMediaPlayer::kPreloadNone)
return WebMediaPlayer::kPreloadMetaData;
return preload;
}
ScriptPromise HTMLMediaElement::playForBindings(ScriptState* script_state) {
// We have to share the same logic for internal and external callers. The
// internal callers do not want to receive a Promise back but when ::play()
// is called, |play_promise_resolvers_| needs to be populated. What this code
// does is to populate |play_promise_resolvers_| before calling ::play() and
// remove the Promise if ::play() failed.
auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
ScriptPromise promise = resolver->Promise();
play_promise_resolvers_.push_back(resolver);
absl::optional<DOMExceptionCode> code = Play();
if (code) {
DCHECK(!play_promise_resolvers_.IsEmpty());
play_promise_resolvers_.pop_back();
String message;
switch (code.value()) {
case DOMExceptionCode::kNotAllowedError:
message = autoplay_policy_->GetPlayErrorMessage();
RecordPlayPromiseRejected(
PlayPromiseRejectReason::kFailedAutoplayPolicy);
break;
case DOMExceptionCode::kNotSupportedError:
message = "The element has no supported sources.";
RecordPlayPromiseRejected(PlayPromiseRejectReason::kNoSupportedSources);
break;
default:
NOTREACHED();
}
resolver->Reject(MakeGarbageCollected<DOMException>(code.value(), message));
return promise;
}
return promise;
}
absl::optional<DOMExceptionCode> HTMLMediaElement::Play() {
DVLOG(2) << "play(" << *this << ")";
absl::optional<DOMExceptionCode> exception_code =
autoplay_policy_->RequestPlay();
if (exception_code == DOMExceptionCode::kNotAllowedError) {
// If we're already playing, then this play would do nothing anyway.
// Call playInternal to handle scheduling the promise resolution.
if (!paused_) {
PlayInternal();
return absl::nullopt;
}
return exception_code;
}
autoplay_policy_->StopAutoplayMutedWhenVisible();
if (error_ && error_->code() == MediaError::kMediaErrSrcNotSupported)
return DOMExceptionCode::kNotSupportedError;
DCHECK(!exception_code.has_value());
PlayInternal();
return absl::nullopt;
}
void HTMLMediaElement::PlayInternal() {
DVLOG(3) << "playInternal(" << *this << ")";
// Playback aborts any lazy loading.
if (lazy_load_intersection_observer_) {
lazy_load_intersection_observer_->disconnect();
lazy_load_intersection_observer_ = nullptr;
}
// 4.8.12.8. Playing the media resource
if (network_state_ == kNetworkEmpty)
InvokeResourceSelectionAlgorithm();
// Generally "ended" and "looping" are exclusive. Here, the loop attribute
// is ignored to seek back to start in case loop was set after playback
// ended. See http://crbug.com/364442
if (EndedPlayback(LoopCondition::kIgnored))
Seek(0);
if (paused_) {
paused_ = false;
SetShowPosterFlag(false);
GetCueTimeline().InvokeTimeMarchesOn();
ScheduleEvent(event_type_names::kPlay);
if (ready_state_ <= kHaveCurrentData)
ScheduleEvent(event_type_names::kWaiting);
else if (ready_state_ >= kHaveFutureData)
ScheduleNotifyPlaying();
} else if (ready_state_ >= kHaveFutureData) {
ScheduleResolvePlayPromises();
}
can_autoplay_ = false;
OnPlay();
SetIgnorePreloadNone();
UpdatePlayState();
}
void HTMLMediaElement::pause() {
DVLOG(2) << "pause(" << *this << ")";
autoplay_policy_->StopAutoplayMutedWhenVisible();
PauseInternal();
}
void HTMLMediaElement::PauseInternal() {
DVLOG(3) << "pauseInternal(" << *this << ")";
if (network_state_ == kNetworkEmpty)
InvokeResourceSelectionAlgorithm();
can_autoplay_ = false;
if (!paused_) {
paused_ = true;
ScheduleTimeupdateEvent(false);
ScheduleEvent(event_type_names::kPause);
// Force an update to official playback position. Automatic updates from
// currentPlaybackPosition() will be blocked while paused_ = true. This
// blocking is desired while paused, but its good to update it one final
// time to accurately reflect movie time at the moment we paused.
SetOfficialPlaybackPosition(CurrentPlaybackPosition());
ScheduleRejectPlayPromises(DOMExceptionCode::kAbortError);
}
UpdatePlayState();
}
bool HTMLMediaElement::preservesPitch() const {
return preserves_pitch_;
}
void HTMLMediaElement::setPreservesPitch(bool preserves_pitch) {
preserves_pitch_ = preserves_pitch;
if (GetWebMediaPlayer())
GetWebMediaPlayer()->SetPreservesPitch(preserves_pitch_);
}
double HTMLMediaElement::latencyHint() const {
// Parse error will fallback to std::numeric_limits<double>::quiet_NaN()
double seconds = GetFloatingPointAttribute(html_names::kLatencyhintAttr);
// Return NaN for invalid values.
if (!std::isfinite(seconds) || seconds < 0)
return std::numeric_limits<double>::quiet_NaN();
return seconds;
}
void HTMLMediaElement::setLatencyHint(double seconds) {
SetFloatingPointAttribute(html_names::kLatencyhintAttr, seconds);
}
void HTMLMediaElement::FlingingStarted() {
if (GetWebMediaPlayer())
GetWebMediaPlayer()->FlingingStarted();
}
void HTMLMediaElement::FlingingStopped() {
if (GetWebMediaPlayer())
GetWebMediaPlayer()->FlingingStopped();
}
void HTMLMediaElement::CloseMediaSource() {
if (!media_source_attachment_)
return;
media_source_attachment_->Close(media_source_tracer_);
media_source_attachment_.reset();
media_source_tracer_ = nullptr;
}
bool HTMLMediaElement::Loop() const {
return FastHasAttribute(html_names::kLoopAttr);
}
void HTMLMediaElement::SetLoop(bool b) {
DVLOG(3) << "setLoop(" << *this << ", " << BoolString(b) << ")";
SetBooleanAttribute(html_names::kLoopAttr, b);
}
bool HTMLMediaElement::ShouldShowControls(
const RecordMetricsBehavior record_metrics) const {
Settings* settings = GetDocument().GetSettings();
if (settings && !settings->GetMediaControlsEnabled()) {
if (record_metrics == RecordMetricsBehavior::kDoRecord)
RecordShowControlsUsage(this, MediaControlsShow::kDisabledSettings);
return false;
}
// If the user has explicitly shown or hidden the controls, then force that
// choice.
if (user_wants_controls_visible_.has_value()) {
if (record_metrics == RecordMetricsBehavior::kDoRecord) {
RecordShowControlsUsage(this,
*user_wants_controls_visible_
? MediaControlsShow::kUserExplicitlyEnabled
: MediaControlsShow::kUserExplicitlyDisabled);
}
return *user_wants_controls_visible_;
}
if (FastHasAttribute(html_names::kControlsAttr)) {
if (record_metrics == RecordMetricsBehavior::kDoRecord)
RecordShowControlsUsage(this, MediaControlsShow::kAttribute);
return true;
}
if (IsFullscreen()) {
if (record_metrics == RecordMetricsBehavior::kDoRecord)
RecordShowControlsUsage(this, MediaControlsShow::kFullscreen);
return true;
}
ExecutionContext* context = GetExecutionContext();
if (context && !context->CanExecuteScripts(kNotAboutToExecuteScript)) {
if (record_metrics == RecordMetricsBehavior::kDoRecord)
RecordShowControlsUsage(this, MediaControlsShow::kNoScript);
return true;
}
if (record_metrics == RecordMetricsBehavior::kDoRecord)
RecordShowControlsUsage(this, MediaControlsShow::kNotShown);
return false;
}
DOMTokenList* HTMLMediaElement::controlsList() const {
return controls_list_.Get();
}
HTMLMediaElementControlsList* HTMLMediaElement::ControlsListInternal() const {
return controls_list_.Get();
}
double HTMLMediaElement::volume() const {
return volume_;
}
void HTMLMediaElement::setVolume(double vol, ExceptionState& exception_state) {
DVLOG(2) << "setVolume(" << *this << ", " << vol << ")";
if (volume_ == vol)
return;
if (RuntimeEnabledFeatures::MediaElementVolumeGreaterThanOneEnabled()) {
if (vol < 0.0f) {
exception_state.ThrowDOMException(
DOMExceptionCode::kIndexSizeError,
ExceptionMessages::IndexExceedsMinimumBound("volume", vol, 0.0));
return;
}
} else if (vol < 0.0f || vol > 1.0f) {
exception_state.ThrowDOMException(
DOMExceptionCode::kIndexSizeError,
ExceptionMessages::IndexOutsideRange(
"volume", vol, 0.0, ExceptionMessages::kInclusiveBound, 1.0,
ExceptionMessages::kInclusiveBound));
return;
}
volume_ = vol;
ScheduleEvent(event_type_names::kVolumechange);
// If it setting volume to audible and AutoplayPolicy doesn't want the
// playback to continue, pause the playback.
if (EffectiveMediaVolume() && !autoplay_policy_->RequestAutoplayUnmute())
pause();
// If playback was not paused by the autoplay policy and got audible, the
// element is marked as being allowed to play unmuted.
if (EffectiveMediaVolume() && PotentiallyPlaying())
was_always_muted_ = false;
if (GetWebMediaPlayer())
GetWebMediaPlayer()->SetVolume(EffectiveMediaVolume());
autoplay_policy_->StopAutoplayMutedWhenVisible();
}
bool HTMLMediaElement::muted() const {
return muted_;
}
void HTMLMediaElement::setMuted(bool muted) {
DVLOG(2) << "setMuted(" << *this << ", " << BoolString(muted) << ")";
if (muted_ == muted)
return;
muted_ = muted;
ScheduleEvent(event_type_names::kVolumechange);
// If it is unmute and AutoplayPolicy doesn't want the playback to continue,
// pause the playback.
if (EffectiveMediaVolume() && !autoplay_policy_->RequestAutoplayUnmute())
pause();
// If playback was not paused by the autoplay policy and got unmuted, the
// element is marked as being allowed to play unmuted.
if (EffectiveMediaVolume() && PotentiallyPlaying())
was_always_muted_ = false;
// This is called at the end to make sure the WebMediaPlayer has the right
// information.
if (GetWebMediaPlayer())
GetWebMediaPlayer()->SetVolume(EffectiveMediaVolume());
autoplay_policy_->StopAutoplayMutedWhenVisible();
}
void HTMLMediaElement::SetUserWantsControlsVisible(bool visible) {
user_wants_controls_visible_ = visible;
UpdateControlsVisibility();
}
double HTMLMediaElement::EffectiveMediaVolume() const {
if (muted_)
return 0;
return volume_;
}
// The spec says to fire periodic timeupdate events (those sent while playing)
// every "15 to 250ms", we choose the slowest frequency
static const base::TimeDelta kMaxTimeupdateEventFrequency =
base::TimeDelta::FromMilliseconds(250);
void HTMLMediaElement::StartPlaybackProgressTimer() {
if (playback_progress_timer_.IsActive())
return;
previous_progress_time_ = base::ElapsedTimer();
playback_progress_timer_.StartRepeating(kMaxTimeupdateEventFrequency,
FROM_HERE);
}
void HTMLMediaElement::PlaybackProgressTimerFired(TimerBase*) {
if (!std::isnan(fragment_end_time_) && currentTime() >= fragment_end_time_ &&
GetDirectionOfPlayback() == kForward) {
fragment_end_time_ = std::numeric_limits<double>::quiet_NaN();
if (!paused_) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLMediaElementPauseAtFragmentEnd);
// changes paused to true and fires a simple event named pause at the
// media element.
PauseInternal();
}
}
if (!seeking_)
ScheduleTimeupdateEvent(true);
// Playback progress is chosen here for simplicity as a proxy for a good
// periodic time to also update the attached MediaSource, if any, with our
// currentTime so that it can continue to have a "recent media time".
ReportCurrentTimeToMediaSource();
}
void HTMLMediaElement::ScheduleTimeupdateEvent(bool periodic_event) {
if (web_media_player_)
web_media_player_->OnTimeUpdate();
// Per spec, consult current playback position to check for changing time.
double media_time = CurrentPlaybackPosition();
bool media_time_has_progressed =
std::isnan(last_time_update_event_media_time_)
? media_time != 0
: media_time != last_time_update_event_media_time_;
if (periodic_event && !media_time_has_progressed)
return;
ScheduleEvent(event_type_names::kTimeupdate);
last_time_update_event_media_time_ = media_time;
// Ensure periodic event fires 250ms from _this_ event. Restarting the timer
// cancels pending callbacks.
if (!periodic_event && playback_progress_timer_.IsActive()) {
playback_progress_timer_.StartRepeating(kMaxTimeupdateEventFrequency,
FROM_HERE);
}
}
void HTMLMediaElement::TogglePlayState() {
if (paused())
Play();
else
pause();
}
AudioTrackList& HTMLMediaElement::audioTracks() {
return *audio_tracks_;
}
void HTMLMediaElement::AudioTrackChanged(AudioTrack* track) {
DVLOG(3) << "audioTrackChanged(" << *this
<< ") trackId= " << String(track->id())
<< " enabled=" << BoolString(track->enabled());
DCHECK(MediaTracksEnabledInternally());
audioTracks().ScheduleChangeEvent();
if (media_source_attachment_)
media_source_attachment_->OnTrackChanged(media_source_tracer_, track);
if (!audio_tracks_timer_.IsActive())
audio_tracks_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
}
void HTMLMediaElement::AudioTracksTimerFired(TimerBase*) {
Vector<WebMediaPlayer::TrackId> enabled_track_ids;
for (unsigned i = 0; i < audioTracks().length(); ++i) {
AudioTrack* track = audioTracks().AnonymousIndexedGetter(i);
if (track->enabled())
enabled_track_ids.push_back(track->id());
}
GetWebMediaPlayer()->EnabledAudioTracksChanged(enabled_track_ids);
}
WebMediaPlayer::TrackId HTMLMediaElement::AddAudioTrack(
const WebString& id,
WebMediaPlayerClient::AudioTrackKind kind,
const WebString& label,
const WebString& language,
bool enabled) {
AtomicString kind_string = AudioKindToString(kind);
DVLOG(3) << "addAudioTrack(" << *this << ", '" << String(id) << "', ' "
<< kind_string << "', '" << String(label) << "', '"
<< String(language) << "', " << BoolString(enabled) << ")";
auto* audio_track = MakeGarbageCollected<AudioTrack>(id, kind_string, label,
language, enabled);
audioTracks().Add(audio_track);
return audio_track->id();
}
void HTMLMediaElement::RemoveAudioTrack(WebMediaPlayer::TrackId track_id) {
DVLOG(3) << "removeAudioTrack(" << *this << ")";
audioTracks().Remove(track_id);
}
VideoTrackList& HTMLMediaElement::videoTracks() {
return *video_tracks_;
}
void HTMLMediaElement::SelectedVideoTrackChanged(VideoTrack* track) {
DVLOG(3) << "selectedVideoTrackChanged(" << *this << ") selectedTrackId="
<< (track->selected() ? String(track->id()) : "none");
DCHECK(MediaTracksEnabledInternally());
if (track->selected())
videoTracks().TrackSelected(track->id());
videoTracks().ScheduleChangeEvent();
if (media_source_attachment_)
media_source_attachment_->OnTrackChanged(media_source_tracer_, track);
WebMediaPlayer::TrackId id = track->id();
GetWebMediaPlayer()->SelectedVideoTrackChanged(track->selected() ? &id
: nullptr);
}
WebMediaPlayer::TrackId HTMLMediaElement::AddVideoTrack(
const WebString& id,
WebMediaPlayerClient::VideoTrackKind kind,
const WebString& label,
const WebString& language,
bool selected) {
AtomicString kind_string = VideoKindToString(kind);
DVLOG(3) << "addVideoTrack(" << *this << ", '" << String(id) << "', '"
<< kind_string << "', '" << String(label) << "', '"
<< String(language) << "', " << BoolString(selected) << ")";
// If another track was selected (potentially by the user), leave it selected.
if (selected && videoTracks().selectedIndex() != -1)
selected = false;
auto* video_track = MakeGarbageCollected<VideoTrack>(id, kind_string, label,
language, selected);
videoTracks().Add(video_track);
return video_track->id();
}
void HTMLMediaElement::RemoveVideoTrack(WebMediaPlayer::TrackId track_id) {
DVLOG(3) << "removeVideoTrack(" << *this << ")";
videoTracks().Remove(track_id);
}
void HTMLMediaElement::AddTextTrack(WebInbandTextTrack* web_track) {
// 4.8.12.11.2 Sourcing in-band text tracks
// 1. Associate the relevant data with a new text track and its corresponding
// new TextTrack object.
auto* text_track = MakeGarbageCollected<InbandTextTrack>(web_track);
// 2. Set the new text track's kind, label, and language based on the
// semantics of the relevant data, as defined by the relevant specification.
// If there is no label in that data, then the label must be set to the empty
// string.
// 3. Associate the text track list of cues with the rules for updating the
// text track rendering appropriate for the format in question.
// 4. If the new text track's kind is metadata, then set the text track
// in-band metadata track dispatch type as follows, based on the type of the
// media resource:
// 5. Populate the new text track's list of cues with the cues parsed so far,
// folllowing the guidelines for exposing cues, and begin updating it
// dynamically as necessary.
// - Thess are all done by the media engine.
// 6. Set the new text track's readiness state to loaded.
text_track->SetReadinessState(TextTrack::kLoaded);
// 7. Set the new text track's mode to the mode consistent with the user's
// preferences and the requirements of the relevant specification for the
// data.
// - This will happen in honorUserPreferencesForAutomaticTextTrackSelection()
ScheduleTextTrackResourceLoad();
// 8. Add the new text track to the media element's list of text tracks.
// 9. Fire an event with the name addtrack, that does not bubble and is not
// cancelable, and that uses the TrackEvent interface, with the track
// attribute initialized to the text track's TextTrack object, at the media
// element's textTracks attribute's TextTrackList object.
textTracks()->Append(text_track);
}
void HTMLMediaElement::RemoveTextTrack(WebInbandTextTrack* web_track) {
if (!text_tracks_)
return;
// This cast is safe because InbandTextTrack is the only concrete
// implementation of WebInbandTextTrackClient.
auto* text_track = To<InbandTextTrack>(web_track->Client());
if (!text_track)
return;
text_tracks_->Remove(text_track);
}
void HTMLMediaElement::ForgetResourceSpecificTracks() {
// Implements the "forget the media element's media-resource-specific tracks"
// algorithm. The order is explicitly specified as text, then audio, and
// finally video. Also 'removetrack' events should not be fired.
if (text_tracks_) {
auto scope = GetCueTimeline().BeginIgnoreUpdateScope();
text_tracks_->RemoveAllInbandTracks();
}
audio_tracks_->RemoveAll();
video_tracks_->RemoveAll();
audio_tracks_timer_.Stop();
}
TextTrack* HTMLMediaElement::addTextTrack(const AtomicString& kind,
const AtomicString& label,
const AtomicString& language,
ExceptionState& exception_state) {
// https://html.spec.whatwg.org/C/#dom-media-addtexttrack
// The addTextTrack(kind, label, language) method of media elements, when
// invoked, must run the following steps:
// 1. Create a new TextTrack object.
// 2. Create a new text track corresponding to the new object, and set its
// text track kind to kind, its text track label to label, its text
// track language to language, ..., and its text track list of cues to
// an empty list.
auto* text_track = MakeGarbageCollected<TextTrack>(kind, label, language);
// ..., its text track readiness state to the text track loaded state, ...
text_track->SetReadinessState(TextTrack::kLoaded);
// 3. Add the new text track to the media element's list of text tracks.
// 4. Queue a task to fire a trusted event with the name addtrack, that
// does not bubble and is not cancelable, and that uses the TrackEvent
// interface, with the track attribute initialised to the new text
// track's TextTrack object, at the media element's textTracks
// attribute's TextTrackList object.
textTracks()->Append(text_track);
// Note: Due to side effects when changing track parameters, we have to
// first append the track to the text track list.
// FIXME: Since setMode() will cause a 'change' event to be queued on the
// same task source as the 'addtrack' event (see above), the order is
// wrong. (The 'change' event shouldn't be fired at all in this case...)
// ..., its text track mode to the text track hidden mode, ...
text_track->setMode(TextTrack::HiddenKeyword());
// 5. Return the new TextTrack object.
return text_track;
}
std::vector<TextTrackMetadata> HTMLMediaElement::GetTextTrackMetadata() {
TextTrackList* tracks = textTracks();
std::vector<TextTrackMetadata> result;
for (unsigned i = 0; i < tracks->length(); i++) {
TextTrack* track = tracks->AnonymousIndexedGetter(i);
result.emplace_back(track->language().GetString().Utf8(),
track->kind().GetString().Utf8(),
track->label().GetString().Utf8(), track->id().Utf8());
}
return result;
}
TextTrackList* HTMLMediaElement::textTracks() {
if (!text_tracks_) {
UseCounter::Count(GetDocument(), WebFeature::kMediaElementTextTrackList);
text_tracks_ = MakeGarbageCollected<TextTrackList>(this);
}
return text_tracks_.Get();
}
void HTMLMediaElement::DidAddTrackElement(HTMLTrackElement* track_element) {
// 4.8.12.11.3 Sourcing out-of-band text tracks
// When a track element's parent element changes and the new parent is a media
// element, then the user agent must add the track element's corresponding
// text track to the media element's list of text tracks ... [continues in
// TextTrackList::append]
TextTrack* text_track = track_element->track();
if (!text_track)
return;
textTracks()->Append(text_track);
// Do not schedule the track loading until parsing finishes so we don't start
// before all tracks in the markup have been added.
if (IsFinishedParsingChildren())
ScheduleTextTrackResourceLoad();
}
void HTMLMediaElement::DidRemoveTrackElement(HTMLTrackElement* track_element) {
KURL url = track_element->GetNonEmptyURLAttribute(html_names::kSrcAttr);
DVLOG(3) << "didRemoveTrackElement(" << *this << ") - 'src' is "
<< UrlForLoggingMedia(url);
TextTrack* text_track = track_element->track();
if (!text_track)
return;
text_track->SetHasBeenConfigured(false);
if (!text_tracks_)
return;
// 4.8.12.11.3 Sourcing out-of-band text tracks
// When a track element's parent element changes and the old parent was a
// media element, then the user agent must remove the track element's
// corresponding text track from the media element's list of text tracks.
text_tracks_->Remove(text_track);
wtf_size_t index =
text_tracks_when_resource_selection_began_.Find(text_track);
if (index != kNotFound)
text_tracks_when_resource_selection_began_.EraseAt(index);
}
void HTMLMediaElement::HonorUserPreferencesForAutomaticTextTrackSelection() {
if (!text_tracks_ || !text_tracks_->length())
return;
if (!should_perform_automatic_track_selection_)
return;
AutomaticTrackSelection::Configuration configuration;
if (processing_preference_change_)
configuration.disable_currently_enabled_tracks = true;
if (text_tracks_visible_)
configuration.force_enable_subtitle_or_caption_track = true;
Settings* settings = GetDocument().GetSettings();
if (settings) {
configuration.text_track_kind_user_preference =
settings->GetTextTrackKindUserPreference();
}
AutomaticTrackSelection track_selection(configuration);
track_selection.Perform(*text_tracks_);
}
bool HTMLMediaElement::HavePotentialSourceChild() {
// Stash the current <source> node and next nodes so we can restore them after
// checking to see there is another potential.
HTMLSourceElement* current_source_node = current_source_node_;
Node* next_node = next_child_node_to_consider_;
KURL next_url = SelectNextSourceChild(nullptr, kDoNothing);
current_source_node_ = current_source_node;
next_child_node_to_consider_ = next_node;
return next_url.IsValid();
}
KURL HTMLMediaElement::SelectNextSourceChild(
String* content_type,
InvalidURLAction action_if_invalid) {
// Don't log if this was just called to find out if there are any valid
// <source> elements.
bool should_log = action_if_invalid != kDoNothing;
if (should_log)
DVLOG(3) << "selectNextSourceChild(" << *this << ")";
if (!next_child_node_to_consider_) {
if (should_log) {
DVLOG(3) << "selectNextSourceChild(" << *this << ") -> 0x0000, \"\"";
}
return KURL();
}
KURL media_url;
Node* node;
HTMLSourceElement* source = nullptr;
String type;
bool looking_for_start_node = next_child_node_to_consider_;
bool can_use_source_element = false;
NodeVector potential_source_nodes;
GetChildNodes(*this, potential_source_nodes);
for (unsigned i = 0;
!can_use_source_element && i < potential_source_nodes.size(); ++i) {
node = potential_source_nodes[i].Get();
if (looking_for_start_node && next_child_node_to_consider_ != node)
continue;
looking_for_start_node = false;
source = DynamicTo<HTMLSourceElement>(node);
if (!source || node->parentNode() != this)
continue;
// 2. If candidate does not have a src attribute, or if its src
// attribute's value is the empty string ... jump down to the failed
// step below
const AtomicString& src_value =
source->FastGetAttribute(html_names::kSrcAttr);
if (should_log) {
DVLOG(3) << "selectNextSourceChild(" << *this << ") - 'src' is "
<< UrlForLoggingMedia(media_url);
}
if (src_value.IsEmpty())
goto checkAgain;
// 3. Let urlString be the resulting URL string that would have resulted
// from parsing the URL specified by candidate's src attribute's value
// relative to the candidate's node document when the src attribute was
// last changed.
media_url = source->GetDocument().CompleteURL(src_value);
// 4. If urlString was not obtained successfully, then end the
// synchronous section, and jump down to the failed with elements step
// below.
if (!IsSafeToLoadURL(media_url, action_if_invalid))
goto checkAgain;
// 5. If candidate has a type attribute whose value, when parsed as a
// MIME type ...
type = source->type();
if (type.IsEmpty() && media_url.ProtocolIsData())
type = MimeTypeFromDataURL(media_url);
if (!type.IsEmpty()) {
if (should_log) {
DVLOG(3) << "selectNextSourceChild(" << *this << ") - 'type' is '"
<< type << "'";
}
if (!GetSupportsType(ContentType(type)))
goto checkAgain;
}
// Making it this far means the <source> looks reasonable.
can_use_source_element = true;
checkAgain:
if (!can_use_source_element && action_if_invalid == kComplain && source)
source->ScheduleErrorEvent();
}
if (can_use_source_element) {
if (content_type)
*content_type = type;
current_source_node_ = source;
next_child_node_to_consider_ = source->nextSibling();
} else {
current_source_node_ = nullptr;
next_child_node_to_consider_ = nullptr;
}
if (should_log) {
DVLOG(3) << "selectNextSourceChild(" << *this << ") -> "
<< current_source_node_.Get() << ", "
<< (can_use_source_element ? UrlForLoggingMedia(media_url) : "");
}
return can_use_source_element ? media_url : KURL();
}
void HTMLMediaElement::SourceWasAdded(HTMLSourceElement* source) {
DVLOG(3) << "sourceWasAdded(" << *this << ", " << source << ")";
KURL url = source->GetNonEmptyURLAttribute(html_names::kSrcAttr);
DVLOG(3) << "sourceWasAdded(" << *this << ") - 'src' is "
<< UrlForLoggingMedia(url);
// We should only consider a <source> element when there is not src attribute
// at all.
if (FastHasAttribute(html_names::kSrcAttr))
return;
// 4.8.8 - If a source element is inserted as a child of a media element that
// has no src attribute and whose networkState has the value NETWORK_EMPTY,
// the user agent must invoke the media element's resource selection
// algorithm.
if (getNetworkState() == HTMLMediaElement::kNetworkEmpty) {
InvokeResourceSelectionAlgorithm();
// Ignore current |next_child_node_to_consider_| and consider |source|.
next_child_node_to_consider_ = source;
return;
}
if (current_source_node_ && source == current_source_node_->nextSibling()) {
DVLOG(3) << "sourceWasAdded(" << *this
<< ") - <source> inserted immediately after current source";
// Ignore current |next_child_node_to_consider_| and consider |source|.
next_child_node_to_consider_ = source;
return;
}
// Consider current |next_child_node_to_consider_| as it is already in the
// middle of processing.
if (next_child_node_to_consider_)
return;
if (load_state_ != kWaitingForSource)
return;
// 4.8.9.5, resource selection algorithm, source elements section:
// 21. Wait until the node after pointer is a node other than the end of the
// list. (This step might wait forever.)
// 22. Asynchronously await a stable state...
// 23. Set the element's delaying-the-load-event flag back to true (this
// delays the load event again, in case it hasn't been fired yet).
SetShouldDelayLoadEvent(true);
// 24. Set the networkState back to NETWORK_LOADING.
SetNetworkState(kNetworkLoading);
// 25. Jump back to the find next candidate step above.
next_child_node_to_consider_ = source;
ScheduleNextSourceChild();
}
void HTMLMediaElement::SourceWasRemoved(HTMLSourceElement* source) {
DVLOG(3) << "sourceWasRemoved(" << *this << ", " << source << ")";
KURL url = source->GetNonEmptyURLAttribute(html_names::kSrcAttr);
DVLOG(3) << "sourceWasRemoved(" << *this << ") - 'src' is "
<< UrlForLoggingMedia(url);
if (source != current_source_node_ && source != next_child_node_to_consider_)
return;
if (source == next_child_node_to_consider_) {
if (current_source_node_)
next_child_node_to_consider_ = current_source_node_->nextSibling();
DVLOG(3) << "sourceWasRemoved(" << *this
<< ") - next_child_node_to_consider_ set to "
<< next_child_node_to_consider_.Get();
} else if (source == current_source_node_) {
// Clear the current source node pointer, but don't change the movie as the
// spec says:
// 4.8.8 - Dynamically modifying a source element and its attribute when the
// element is already inserted in a video or audio element will have no
// effect.
current_source_node_ = nullptr;
DVLOG(3) << "SourceWasRemoved(" << *this
<< ") - current_source_node_ set to 0";
}
}
void HTMLMediaElement::TimeChanged() {
DVLOG(3) << "timeChanged(" << *this << ")";
// 4.8.12.9 steps 12-14. Needed if no ReadyState change is associated with the
// seek.
if (seeking_ && ready_state_ >= kHaveCurrentData &&
!GetWebMediaPlayer()->Seeking()) {
FinishSeek();
}
// When the current playback position reaches the end of the media resource
// when the direction of playback is forwards, then the user agent must follow
// these steps:
if (EndedPlayback(LoopCondition::kIgnored)) {
// If the media element has a loop attribute specified
if (Loop()) {
// then seek to the earliest possible position of the media resource and
// abort these steps.
Seek(EarliestPossiblePosition());
} else {
// Queue a task to fire a simple event named timeupdate at the media
// element.
ScheduleTimeupdateEvent(false);
// If the media element has still ended playback, and the direction of
// playback is still forwards, and paused is false,
if (!paused_) {
// Trigger an update to `official_playback_position_` (if necessary)
// BEFORE setting `paused_ = false`, to ensure a final sync with
// `WebMediaPlayer()->CurrentPlaybackPosition()`.
OfficialPlaybackPosition();
// changes paused to true and fires a simple event named pause at the
// media element.
paused_ = true;
ScheduleEvent(event_type_names::kPause);
ScheduleRejectPlayPromises(DOMExceptionCode::kAbortError);
}
// Queue a task to fire a simple event named ended at the media element.
ScheduleEvent(event_type_names::kEnded);
}
}
UpdatePlayState();
}
void HTMLMediaElement::DurationChanged() {
DVLOG(3) << "durationChanged(" << *this << ")";
// durationChanged() is triggered by media player.
CHECK(web_media_player_);
double new_duration = web_media_player_->Duration();
// If the duration is changed such that the *current playback position* ends
// up being greater than the time of the end of the media resource, then the
// user agent must also seek to the time of the end of the media resource.
DurationChanged(new_duration, CurrentPlaybackPosition() > new_duration);
}
void HTMLMediaElement::DurationChanged(double duration, bool request_seek) {
DVLOG(3) << "durationChanged(" << *this << ", " << duration << ", "
<< BoolString(request_seek) << ")";
// Abort if duration unchanged.
if (duration_ == duration)
return;
DVLOG(3) << "durationChanged(" << *this << ") : " << duration_ << " -> "
<< duration;
duration_ = duration;
ScheduleEvent(event_type_names::kDurationchange);
if (web_media_player_)
web_media_player_->OnTimeUpdate();
UpdateLayoutObject();
if (request_seek)
Seek(duration);
}
bool HTMLMediaElement::HasRemoteRoutes() const {
// TODO(mlamouri): used by MediaControlsPainter; should be refactored out.
return RemotePlaybackClient() &&
RemotePlaybackClient()->RemotePlaybackAvailable();
}
void HTMLMediaElement::RemotePlaybackCompatibilityChanged(const WebURL& url,
bool is_compatible) {
if (RemotePlaybackClient())
RemotePlaybackClient()->SourceChanged(url, is_compatible);
}
bool HTMLMediaElement::HasSelectedVideoTrack() {
return video_tracks_ && video_tracks_->selectedIndex() != -1;
}
WebMediaPlayer::TrackId HTMLMediaElement::GetSelectedVideoTrackId() {
DCHECK(HasSelectedVideoTrack());
int selected_track_index = video_tracks_->selectedIndex();
VideoTrack* track =
video_tracks_->AnonymousIndexedGetter(selected_track_index);
return track->id();
}
bool HTMLMediaElement::WasAlwaysMuted() {
return was_always_muted_;
}
// MediaPlayerPresentation methods
void HTMLMediaElement::Repaint() {
if (cc_layer_)
cc_layer_->SetNeedsDisplay();
UpdateLayoutObject();
if (GetLayoutObject())
GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
void HTMLMediaElement::SizeChanged() {
DVLOG(3) << "sizeChanged(" << *this << ")";
DCHECK(HasVideo()); // "resize" makes no sense in absence of video.
if (ready_state_ > kHaveNothing && IsHTMLVideoElement())
ScheduleEvent(event_type_names::kResize);
UpdateLayoutObject();
}
WebTimeRanges HTMLMediaElement::BufferedInternal() const {
if (media_source_attachment_)
return media_source_attachment_->BufferedInternal(media_source_tracer_);
if (!GetWebMediaPlayer())
return {};
return GetWebMediaPlayer()->Buffered();
}
TimeRanges* HTMLMediaElement::buffered() const {
return MakeGarbageCollected<TimeRanges>(BufferedInternal());
}
TimeRanges* HTMLMediaElement::played() {
if (playing_) {
double time = currentTime();
if (time > last_seek_time_)
AddPlayedRange(last_seek_time_, time);
}
if (!played_time_ranges_)
played_time_ranges_ = MakeGarbageCollected<TimeRanges>();
return played_time_ranges_->Copy();
}
WebTimeRanges HTMLMediaElement::SeekableInternal() const {
if (!GetWebMediaPlayer())
return {};
if (media_source_attachment_)
return media_source_attachment_->SeekableInternal(media_source_tracer_);
return GetWebMediaPlayer()->Seekable();
}
TimeRanges* HTMLMediaElement::seekable() const {
return MakeGarbageCollected<TimeRanges>(SeekableInternal());
}
bool HTMLMediaElement::PotentiallyPlaying() const {
// Once we've reached the metadata state the WebMediaPlayer is ready to accept
// play state changes.
return ready_state_ >= kHaveMetadata && CouldPlayIfEnoughData();
}
bool HTMLMediaElement::CouldPlayIfEnoughData() const {
return !paused() && !EndedPlayback() && !StoppedDueToErrors();
}
bool HTMLMediaElement::EndedPlayback(LoopCondition loop_condition) const {
// If we have infinite duration, we'll never have played for long enough to
// have ended playback.
const double dur = duration();
if (std::isnan(dur) || dur == std::numeric_limits<double>::infinity())
return false;
// 4.8.12.8 Playing the media resource
// A media element is said to have ended playback when the element's
// readyState attribute is HAVE_METADATA or greater,
if (ready_state_ < kHaveMetadata)
return false;
DCHECK_EQ(GetDirectionOfPlayback(), kForward);
if (auto* wmp = GetWebMediaPlayer()) {
return wmp->IsEnded() &&
(loop_condition == LoopCondition::kIgnored || !Loop());
}
return false;
}
bool HTMLMediaElement::StoppedDueToErrors() const {
if (ready_state_ >= kHaveMetadata && error_) {
WebTimeRanges seekable_ranges = SeekableInternal();
if (!seekable_ranges.Contain(currentTime()))
return true;
}
return false;
}
void HTMLMediaElement::UpdatePlayState() {
bool is_playing = GetWebMediaPlayer() && !GetWebMediaPlayer()->Paused();
bool should_be_playing = PotentiallyPlaying();
DVLOG(3) << "updatePlayState(" << *this
<< ") - shouldBePlaying = " << BoolString(should_be_playing)
<< ", isPlaying = " << BoolString(is_playing);
if (should_be_playing && !muted_)
was_always_muted_ = false;
if (should_be_playing) {
if (!is_playing) {
// Set rate, muted before calling play in case they were set before the
// media engine was setup. The media engine should just stash the rate
// and muted values since it isn't already playing.
GetWebMediaPlayer()->SetRate(playbackRate());
GetWebMediaPlayer()->SetVolume(EffectiveMediaVolume());
GetWebMediaPlayer()->Play();
// These steps should not be necessary, but if `play()` is called before
// a source change, we may get into a state where `paused_ == false` and
// `show_poster_flag_ == true`. My (cassew@google.com) interpretation of
// the spec is that we should not be playing in this scenario.
// https://crbug.com/633591
SetShowPosterFlag(false);
GetCueTimeline().InvokeTimeMarchesOn();
}
StartPlaybackProgressTimer();
playing_ = true;
} else { // Should not be playing right now
if (is_playing) {
GetWebMediaPlayer()->Pause();
}
playback_progress_timer_.Stop();
playing_ = false;
double time = currentTime();
if (time > last_seek_time_)
AddPlayedRange(last_seek_time_, time);
GetCueTimeline().OnPause();
}
UpdateLayoutObject();
if (web_media_player_)
web_media_player_->OnTimeUpdate();
ReportCurrentTimeToMediaSource();
PseudoStateChanged(CSSSelector::kPseudoPaused);
PseudoStateChanged(CSSSelector::kPseudoPlaying);
}
void HTMLMediaElement::StopPeriodicTimers() {
progress_event_timer_.Stop();
playback_progress_timer_.Stop();
if (lazy_load_intersection_observer_) {
lazy_load_intersection_observer_->disconnect();
lazy_load_intersection_observer_ = nullptr;
}
}
void HTMLMediaElement::
ClearMediaPlayerAndAudioSourceProviderClientWithoutLocking() {
GetAudioSourceProvider().SetClient(nullptr);
if (web_media_player_) {
audio_source_provider_.Wrap(nullptr);
web_media_player_.reset();
// The lifetime of the mojo endpoints are tied to the WebMediaPlayer's, so
// we need to reset those as well.
media_player_receiver_set_->Value().Clear();
media_player_observer_remote_set_->Value().Clear();
}
OnWebMediaPlayerCleared();
}
void HTMLMediaElement::ClearMediaPlayer() {
ForgetResourceSpecificTracks();
CloseMediaSource();
CancelDeferredLoad();
{
AudioSourceProviderClientLockScope scope(*this);
ClearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
}
StopPeriodicTimers();
load_timer_.Stop();
pending_action_flags_ = 0;
load_state_ = kWaitingForSource;
if (GetLayoutObject())
GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
void HTMLMediaElement::ContextLifecycleStateChanged(
mojom::FrameLifecycleState state) {
if (state == mojom::FrameLifecycleState::kFrozenAutoResumeMedia && playing_) {
paused_by_context_paused_ = true;
pause();
} else if (state == mojom::FrameLifecycleState::kFrozen && playing_) {
pause();
} else if (state == mojom::FrameLifecycleState::kRunning &&
paused_by_context_paused_) {
paused_by_context_paused_ = false;
Play();
}
}
void HTMLMediaElement::ContextDestroyed() {
DVLOG(3) << "contextDestroyed(" << static_cast<void*>(this) << ")";
// Close the async event queue so that no events are enqueued.
CancelPendingEventsAndCallbacks();
// Clear everything in the Media Element
if (media_source_attachment_)
media_source_attachment_->OnElementContextDestroyed();
ClearMediaPlayer();
ready_state_ = kHaveNothing;
ready_state_maximum_ = kHaveNothing;
SetNetworkState(kNetworkEmpty);
SetShouldDelayLoadEvent(false);
current_source_node_ = nullptr;
official_playback_position_ = 0;
official_playback_position_needs_update_ = true;
playing_ = false;
paused_ = true;
seeking_ = false;
GetCueTimeline().OnReadyStateReset();
UpdateLayoutObject();
StopPeriodicTimers();
removed_from_document_timer_.Stop();
}
bool HTMLMediaElement::HasPendingActivity() const {
const auto result = HasPendingActivityInternal();
// TODO(dalecurtis): Replace c-style casts in followup patch.
DVLOG(3) << "HasPendingActivity(" << *this << ") = " << result;
return result;
}
bool HTMLMediaElement::HasPendingActivityInternal() const {
// The delaying-the-load-event flag is set by resource selection algorithm
// when looking for a resource to load, before networkState has reached to
// kNetworkLoading.
if (should_delay_load_event_)
return true;
// When networkState is kNetworkLoading, progress and stalled events may be
// fired.
//
// When connected to a MediaSource, ignore |network_state_|. The rest
// of this method's logic and the HasPendingActivity() of the various
// MediaSource API objects more precisely indicate whether or not any pending
// activity is expected on the group of connected HTMLMediaElement +
// MediaSource API objects. This lets the group of objects be garbage
// collected if there is no pending activity nor reachability from a GC root,
// even while in kNetworkLoading.
//
// We use the WebMediaPlayer's network state instead of |network_state_| since
// it's value is unreliable prior to ready state kHaveMetadata.
if (!media_source_attachment_) {
const auto* wmp = GetWebMediaPlayer();
if (!wmp) {
if (network_state_ == kNetworkLoading)
return true;
} else if (wmp->GetNetworkState() == WebMediaPlayer::kNetworkStateLoading) {
return true;
}
}
{
// Disable potential updating of playback position, as that will
// require v8 allocations; not allowed while GCing
// (hasPendingActivity() is called during a v8 GC.)
base::AutoReset<bool> scope(&official_playback_position_needs_update_,
false);
// When playing or if playback may continue, timeupdate events may be fired.
if (CouldPlayIfEnoughData())
return true;
}
// When the seek finishes timeupdate and seeked events will be fired.
if (seeking_)
return true;
// Wait for any pending events to be fired.
if (async_event_queue_->HasPendingEvents())
return true;
return false;
}
bool HTMLMediaElement::IsFullscreen() const {
return Fullscreen::IsFullscreenElement(*this);
}
cc::Layer* HTMLMediaElement::CcLayer() const {
return cc_layer_;
}
bool HTMLMediaElement::HasClosedCaptions() const {
if (!text_tracks_)
return false;
for (unsigned i = 0; i < text_tracks_->length(); ++i) {
if (text_tracks_->AnonymousIndexedGetter(i)->CanBeRendered())
return true;
}
return false;
}
bool HTMLMediaElement::TextTracksVisible() const {
return text_tracks_visible_;
}
// static
void HTMLMediaElement::AssertShadowRootChildren(ShadowRoot& shadow_root) {
#if DCHECK_IS_ON()
// There can be up to three children: an interstitial (media remoting or
// picture in picture), text track container, and media controls. The media
// controls has to be the last child if present, and has to be the next
// sibling of the text track container if both present. When present, media
// remoting interstitial has to be the first child.
unsigned number_of_children = shadow_root.CountChildren();
DCHECK_LE(number_of_children, 3u);
Node* first_child = shadow_root.firstChild();
Node* last_child = shadow_root.lastChild();
if (number_of_children == 1) {
DCHECK(first_child->IsTextTrackContainer() ||
first_child->IsMediaControls() ||
first_child->IsMediaRemotingInterstitial() ||
first_child->IsPictureInPictureInterstitial());
} else if (number_of_children == 2) {
DCHECK(first_child->IsTextTrackContainer() ||
first_child->IsMediaRemotingInterstitial() ||
first_child->IsPictureInPictureInterstitial());
DCHECK(last_child->IsTextTrackContainer() || last_child->IsMediaControls());
if (first_child->IsTextTrackContainer())
DCHECK(last_child->IsMediaControls());
} else if (number_of_children == 3) {
Node* second_child = first_child->nextSibling();
DCHECK(first_child->IsMediaRemotingInterstitial() ||
first_child->IsPictureInPictureInterstitial());
DCHECK(second_child->IsTextTrackContainer());
DCHECK(last_child->IsMediaControls());
}
#endif
}
TextTrackContainer& HTMLMediaElement::EnsureTextTrackContainer() {
UseCounter::Count(GetDocument(), WebFeature::kMediaElementTextTrackContainer);
ShadowRoot& shadow_root = EnsureUserAgentShadowRoot();
AssertShadowRootChildren(shadow_root);
Node* first_child = shadow_root.firstChild();
if (auto* first_child_text_track = DynamicTo<TextTrackContainer>(first_child))
return *first_child_text_track;
Node* to_be_inserted = first_child;
if (first_child && (first_child->IsMediaRemotingInterstitial() ||
first_child->IsPictureInPictureInterstitial())) {
Node* second_child = first_child->nextSibling();
if (auto* second_child_text_track =
DynamicTo<TextTrackContainer>(second_child))
return *second_child_text_track;
to_be_inserted = second_child;
}
auto* text_track_container = MakeGarbageCollected<TextTrackContainer>(*this);
// The text track container should be inserted before the media controls,
// so that they are rendered behind them.
shadow_root.InsertBefore(text_track_container, to_be_inserted);
AssertShadowRootChildren(shadow_root);
return *text_track_container;
}
void HTMLMediaElement::UpdateTextTrackDisplay() {
DVLOG(3) << "updateTextTrackDisplay(" << *this << ")";
EnsureTextTrackContainer().UpdateDisplay(
*this, TextTrackContainer::kDidNotStartExposingControls);
}
void HTMLMediaElement::MediaControlsDidBecomeVisible() {
DVLOG(3) << "mediaControlsDidBecomeVisible(" << *this << ")";
// When the user agent starts exposing a user interface for a video element,
// the user agent should run the rules for updating the text track rendering
// of each of the text tracks in the video element's list of text tracks ...
if (IsHTMLVideoElement() && TextTracksVisible()) {
EnsureTextTrackContainer().UpdateDisplay(
*this, TextTrackContainer::kDidStartExposingControls);
}
}
void HTMLMediaElement::SetTextTrackKindUserPreferenceForAllMediaElements(
Document* document) {
auto it = DocumentToElementSetMap().find(document);
if (it == DocumentToElementSetMap().end())
return;
DCHECK(it->value);
WeakMediaElementSet& elements = *it->value;
for (const auto& element : elements)
element->AutomaticTrackSelectionForUpdatedUserPreference();
}
void HTMLMediaElement::AutomaticTrackSelectionForUpdatedUserPreference() {
if (!text_tracks_ || !text_tracks_->length())
return;
MarkCaptionAndSubtitleTracksAsUnconfigured();
processing_preference_change_ = true;
text_tracks_visible_ = false;
HonorUserPreferencesForAutomaticTextTrackSelection();
processing_preference_change_ = false;
// If a track is set to 'showing' post performing automatic track selection,
// set text tracks state to visible to update the CC button and display the
// track.
text_tracks_visible_ = text_tracks_->HasShowingTracks();
UpdateTextTrackDisplay();
}
void HTMLMediaElement::MarkCaptionAndSubtitleTracksAsUnconfigured() {
if (!text_tracks_)
return;
// Mark all tracks as not "configured" so that
// honorUserPreferencesForAutomaticTextTrackSelection() will reconsider
// which tracks to display in light of new user preferences (e.g. default
// tracks should not be displayed if the user has turned off captions and
// non-default tracks should be displayed based on language preferences if
// the user has turned captions on).
for (unsigned i = 0; i < text_tracks_->length(); ++i) {
TextTrack* text_track = text_tracks_->AnonymousIndexedGetter(i);
if (text_track->IsVisualKind())
text_track->SetHasBeenConfigured(false);
}
}
uint64_t HTMLMediaElement::webkitAudioDecodedByteCount() const {
if (!GetWebMediaPlayer())
return 0;
return GetWebMediaPlayer()->AudioDecodedByteCount();
}
uint64_t HTMLMediaElement::webkitVideoDecodedByteCount() const {
if (!GetWebMediaPlayer())
return 0;
return GetWebMediaPlayer()->VideoDecodedByteCount();
}
bool HTMLMediaElement::IsURLAttribute(const Attribute& attribute) const {
return attribute.GetName() == html_names::kSrcAttr ||
HTMLElement::IsURLAttribute(attribute);
}
void HTMLMediaElement::SetShouldDelayLoadEvent(bool should_delay) {
if (should_delay_load_event_ == should_delay)
return;
DVLOG(3) << "setShouldDelayLoadEvent(" << *this << ", "
<< BoolString(should_delay) << ")";
should_delay_load_event_ = should_delay;
if (should_delay)
GetDocument().IncrementLoadEventDelayCount();
else
GetDocument().DecrementLoadEventDelayCount();
}
MediaControls* HTMLMediaElement::GetMediaControls() const {
return media_controls_;
}
void HTMLMediaElement::EnsureMediaControls() {
if (GetMediaControls())
return;
ShadowRoot& shadow_root = EnsureUserAgentShadowRoot();
UseCounterMuteScope scope(*this);
media_controls_ =
CoreInitializer::GetInstance().CreateMediaControls(*this, shadow_root);
// The media controls should be inserted after the text track container,
// so that they are rendered in front of captions and subtitles. This check
// is verifying the contract.
AssertShadowRootChildren(shadow_root);
}
void HTMLMediaElement::UpdateControlsVisibility() {
if (!isConnected())
return;
bool native_controls = ShouldShowControls(RecordMetricsBehavior::kDoRecord);
// When LazyInitializeMediaControls is enabled, initialize the controls only
// if native controls should be used or if using the cast overlay.
if (!RuntimeEnabledFeatures::LazyInitializeMediaControlsEnabled() ||
RuntimeEnabledFeatures::MediaCastOverlayButtonEnabled() ||
native_controls) {
EnsureMediaControls();
// TODO(mlamouri): this doesn't sound needed but the following tests, on
// Android fails when removed:
// fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html
GetMediaControls()->Reset();
}
if (native_controls)
GetMediaControls()->MaybeShow();
else if (GetMediaControls())
GetMediaControls()->Hide();
if (web_media_player_)
web_media_player_->OnHasNativeControlsChanged(native_controls);
}
CueTimeline& HTMLMediaElement::GetCueTimeline() {
if (!cue_timeline_)
cue_timeline_ = MakeGarbageCollected<CueTimeline>(*this);
return *cue_timeline_;
}
void HTMLMediaElement::ConfigureTextTrackDisplay() {
DCHECK(text_tracks_);
DVLOG(3) << "configureTextTrackDisplay(" << *this << ")";
if (processing_preference_change_)
return;
bool have_visible_text_track = text_tracks_->HasShowingTracks();
text_tracks_visible_ = have_visible_text_track;
if (!have_visible_text_track && !GetMediaControls())
return;
// Note: The "time marches on" algorithm |CueTimeline::TimeMarchesOn| runs
// the "rules for updating the text track rendering" (updateTextTrackDisplay)
// only for "affected tracks", i.e. tracks where the the active cues have
// changed. This misses cues in tracks that changed mode between hidden and
// showing. This appears to be a spec bug, which we work around here:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=28236
UpdateTextTrackDisplay();
}
// TODO(srirama.m): Merge it to resetMediaElement if possible and remove it.
void HTMLMediaElement::ResetMediaPlayerAndMediaSource() {
CloseMediaSource();
{
AudioSourceProviderClientLockScope scope(*this);
ClearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
}
if (audio_source_node_)
GetAudioSourceProvider().SetClient(audio_source_node_);
}
void HTMLMediaElement::SetAudioSourceNode(
AudioSourceProviderClient* source_node) {
DCHECK(IsMainThread());
audio_source_node_ = source_node;
// No need to lock the |audio_source_node| because it locks itself when
// setFormat() is invoked.
GetAudioSourceProvider().SetClient(audio_source_node_);
}
WebMediaPlayer::CorsMode HTMLMediaElement::CorsMode() const {
const AtomicString& cross_origin_mode =
FastGetAttribute(html_names::kCrossoriginAttr);
if (cross_origin_mode.IsNull())
return WebMediaPlayer::kCorsModeUnspecified;
if (EqualIgnoringASCIICase(cross_origin_mode, "use-credentials"))
return WebMediaPlayer::kCorsModeUseCredentials;
return WebMediaPlayer::kCorsModeAnonymous;
}
void HTMLMediaElement::SetCcLayer(cc::Layer* cc_layer) {
if (cc_layer == cc_layer_)
return;
// We need to update the GraphicsLayer when the cc layer changes.
SetNeedsCompositingUpdate();
cc_layer_ = cc_layer;
}
void HTMLMediaElement::MediaSourceOpened(WebMediaSource* web_media_source) {
SetShouldDelayLoadEvent(false);
media_source_attachment_->CompleteAttachingToMediaElement(
media_source_tracer_, base::WrapUnique(web_media_source));
}
bool HTMLMediaElement::IsInteractiveContent() const {
return FastHasAttribute(html_names::kControlsAttr);
}
void HTMLMediaElement::BindMediaPlayerReceiver(
mojo::PendingAssociatedReceiver<media::mojom::blink::MediaPlayer>
receiver) {
media_player_receiver_set_->Value().Add(
std::move(receiver),
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
}
void HTMLMediaElement::Trace(Visitor* visitor) const {
visitor->Trace(audio_source_node_);
visitor->Trace(load_timer_);
visitor->Trace(progress_event_timer_);
visitor->Trace(playback_progress_timer_);
visitor->Trace(audio_tracks_timer_);
visitor->Trace(removed_from_document_timer_);
visitor->Trace(played_time_ranges_);
visitor->Trace(async_event_queue_);
visitor->Trace(error_);
visitor->Trace(current_source_node_);
visitor->Trace(next_child_node_to_consider_);
visitor->Trace(deferred_load_timer_);
visitor->Trace(media_source_tracer_);
visitor->Trace(audio_tracks_);
visitor->Trace(video_tracks_);
visitor->Trace(cue_timeline_);
visitor->Trace(text_tracks_);
visitor->Trace(text_tracks_when_resource_selection_began_);
visitor->Trace(play_promise_resolvers_);
visitor->Trace(play_promise_resolve_list_);
visitor->Trace(play_promise_reject_list_);
visitor->Trace(audio_source_provider_);
visitor->Trace(src_object_);
visitor->Trace(autoplay_policy_);
visitor->Trace(media_controls_);
visitor->Trace(controls_list_);
visitor->Trace(lazy_load_intersection_observer_);
visitor->Trace(media_player_host_remote_);
visitor->Trace(media_player_observer_remote_set_);
visitor->Trace(media_player_receiver_set_);
Supplementable<HTMLMediaElement>::Trace(visitor);
HTMLElement::Trace(visitor);
ExecutionContextLifecycleStateObserver::Trace(visitor);
}
void HTMLMediaElement::CreatePlaceholderTracksIfNecessary() {
if (!MediaTracksEnabledInternally())
return;
// Create a placeholder audio track if the player says it has audio but it
// didn't explicitly announce the tracks.
if (HasAudio() && !audioTracks().length()) {
AddAudioTrack("audio", WebMediaPlayerClient::kAudioTrackKindMain,
"Audio Track", "", true);
}
// Create a placeholder video track if the player says it has video but it
// didn't explicitly announce the tracks.
if (HasVideo() && !videoTracks().length()) {
AddVideoTrack("video", WebMediaPlayerClient::kVideoTrackKindMain,
"Video Track", "", true);
}
}
void HTMLMediaElement::SetNetworkState(NetworkState state) {
if (network_state_ == state)
return;
network_state_ = state;
if (GetMediaControls())
GetMediaControls()->NetworkStateChanged();
}
void HTMLMediaElement::VideoWillBeDrawnToCanvas() const {
DCHECK(IsHTMLVideoElement());
UseCounter::Count(GetDocument(), WebFeature::kVideoInCanvas);
autoplay_policy_->VideoWillBeDrawnToCanvas();
}
void HTMLMediaElement::ScheduleResolvePlayPromises() {
// TODO(mlamouri): per spec, we should create a new task but we can't create
// a new cancellable task without cancelling the previous one. There are two
// approaches then: cancel the previous task and create a new one with the
// appended promise list or append the new promise to the current list. The
// latter approach is preferred because it might be the less observable
// change.
DCHECK(play_promise_resolve_list_.IsEmpty() ||
play_promise_resolve_task_handle_.IsActive());
if (play_promise_resolvers_.IsEmpty())
return;
play_promise_resolve_list_.AppendVector(play_promise_resolvers_);
play_promise_resolvers_.clear();
if (play_promise_resolve_task_handle_.IsActive())
return;
play_promise_resolve_task_handle_ = PostCancellableTask(
*GetDocument().GetTaskRunner(TaskType::kMediaElementEvent), FROM_HERE,
WTF::Bind(&HTMLMediaElement::ResolveScheduledPlayPromises,
WrapWeakPersistent(this)));
}
void HTMLMediaElement::ScheduleRejectPlayPromises(DOMExceptionCode code) {
// TODO(mlamouri): per spec, we should create a new task but we can't create
// a new cancellable task without cancelling the previous one. There are two
// approaches then: cancel the previous task and create a new one with the
// appended promise list or append the new promise to the current list. The
// latter approach is preferred because it might be the less observable
// change.
DCHECK(play_promise_reject_list_.IsEmpty() ||
play_promise_reject_task_handle_.IsActive());
if (play_promise_resolvers_.IsEmpty())
return;
play_promise_reject_list_.AppendVector(play_promise_resolvers_);
play_promise_resolvers_.clear();
if (play_promise_reject_task_handle_.IsActive())
return;
// TODO(nhiroki): Bind this error code to a cancellable task instead of a
// member field.
play_promise_error_code_ = code;
play_promise_reject_task_handle_ = PostCancellableTask(
*GetDocument().GetTaskRunner(TaskType::kMediaElementEvent), FROM_HERE,
WTF::Bind(&HTMLMediaElement::RejectScheduledPlayPromises,
WrapWeakPersistent(this)));
}
void HTMLMediaElement::ScheduleNotifyPlaying() {
ScheduleEvent(event_type_names::kPlaying);
ScheduleResolvePlayPromises();
}
void HTMLMediaElement::ResolveScheduledPlayPromises() {
for (auto& resolver : play_promise_resolve_list_)
resolver->Resolve();
play_promise_resolve_list_.clear();
}
void HTMLMediaElement::RejectScheduledPlayPromises() {
// TODO(mlamouri): the message is generated based on the code because
// arguments can't be passed to a cancellable task. In order to save space
// used by the object, the string isn't saved.
DCHECK(play_promise_error_code_ == DOMExceptionCode::kAbortError ||
play_promise_error_code_ == DOMExceptionCode::kNotSupportedError);
if (play_promise_error_code_ == DOMExceptionCode::kAbortError) {
RecordPlayPromiseRejected(PlayPromiseRejectReason::kInterruptedByPause);
RejectPlayPromisesInternal(DOMExceptionCode::kAbortError,
"The play() request was interrupted by a call "
"to pause(). https://goo.gl/LdLk22");
} else {
RecordPlayPromiseRejected(PlayPromiseRejectReason::kNoSupportedSources);
RejectPlayPromisesInternal(
DOMExceptionCode::kNotSupportedError,
"Failed to load because no supported source was found.");
}
}
void HTMLMediaElement::RejectPlayPromises(DOMExceptionCode code,
const String& message) {
play_promise_reject_list_.AppendVector(play_promise_resolvers_);
play_promise_resolvers_.clear();
RejectPlayPromisesInternal(code, message);
}
void HTMLMediaElement::RejectPlayPromisesInternal(DOMExceptionCode code,
const String& message) {
DCHECK(code == DOMExceptionCode::kAbortError ||
code == DOMExceptionCode::kNotSupportedError);
for (auto& resolver : play_promise_reject_list_)
resolver->Reject(MakeGarbageCollected<DOMException>(code, message));
play_promise_reject_list_.clear();
}
void HTMLMediaElement::OnRemovedFromDocumentTimerFired(TimerBase*) {
if (InActiveDocument())
return;
// Video should not pause when playing in Picture-in-Picture and subsequently
// removed from the Document.
if (!PictureInPictureController::IsElementInPictureInPicture(this))
PauseInternal();
}
void HTMLMediaElement::AudioSourceProviderImpl::Wrap(
scoped_refptr<WebAudioSourceProviderImpl> provider) {
MutexLocker locker(provide_input_lock);
if (web_audio_source_provider_ && provider != web_audio_source_provider_)
web_audio_source_provider_->SetClient(nullptr);
web_audio_source_provider_ = std::move(provider);
if (web_audio_source_provider_)
web_audio_source_provider_->SetClient(client_.Get());
}
void HTMLMediaElement::AudioSourceProviderImpl::SetClient(
AudioSourceProviderClient* client) {
MutexLocker locker(provide_input_lock);
if (client)
client_ = MakeGarbageCollected<HTMLMediaElement::AudioClientImpl>(client);
else
client_.Clear();
if (web_audio_source_provider_)
web_audio_source_provider_->SetClient(client_.Get());
}
void HTMLMediaElement::AudioSourceProviderImpl::ProvideInput(
AudioBus* bus,
uint32_t frames_to_process) {
DCHECK(bus);
MutexTryLocker try_locker(provide_input_lock);
if (!try_locker.Locked() || !web_audio_source_provider_ || !client_.Get()) {
bus->Zero();
return;
}
// Wrap the AudioBus channel data using WebVector.
unsigned n = bus->NumberOfChannels();
WebVector<float*> web_audio_data(n);
for (unsigned i = 0; i < n; ++i)
web_audio_data[i] = bus->Channel(i)->MutableData();
web_audio_source_provider_->ProvideInput(web_audio_data, frames_to_process);
}
void HTMLMediaElement::AudioClientImpl::SetFormat(uint32_t number_of_channels,
float sample_rate) {
if (client_)
client_->SetFormat(number_of_channels, sample_rate);
}
void HTMLMediaElement::AudioClientImpl::Trace(Visitor* visitor) const {
visitor->Trace(client_);
}
void HTMLMediaElement::AudioSourceProviderImpl::Trace(Visitor* visitor) const {
visitor->Trace(client_);
}
bool HTMLMediaElement::HasNativeControls() {
return ShouldShowControls(RecordMetricsBehavior::kDoRecord);
}
bool HTMLMediaElement::IsAudioElement() {
return IsHTMLAudioElement();
}
DisplayType HTMLMediaElement::GetDisplayType() const {
return IsFullscreen() ? DisplayType::kFullscreen : DisplayType::kInline;
}
gfx::ColorSpace HTMLMediaElement::TargetColorSpace() {
LocalFrame* frame = GetDocument().GetFrame();
if (!frame)
return gfx::ColorSpace();
return frame->GetPage()
->GetChromeClient()
.GetScreenInfo(*frame)
.display_color_spaces.GetScreenInfoColorSpace();
}
bool HTMLMediaElement::WasAutoplayInitiated() {
return autoplay_policy_->WasAutoplayInitiated();
}
void HTMLMediaElement::ResumePlayback() {
autoplay_policy_->EnsureAutoplayInitiatedSet();
PlayInternal();
}
void HTMLMediaElement::PausePlayback() {
PauseInternal();
}
void HTMLMediaElement::DidPlayerStartPlaying() {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnMediaPlaying();
}
void HTMLMediaElement::DidPlayerPaused(bool stream_ended) {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnMediaPaused(stream_ended);
}
void HTMLMediaElement::DidPlayerMutedStatusChange(bool muted) {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnMutedStatusChanged(muted);
}
void HTMLMediaElement::DidMediaMetadataChange(
bool has_audio,
bool has_video,
media::MediaContentType media_content_type) {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnMediaMetadataChanged(has_audio, has_video, media_content_type);
}
void HTMLMediaElement::DidPlayerMediaPositionStateChange(
double playback_rate,
base::TimeDelta duration,
base::TimeDelta position) {
for (auto& observer : media_player_observer_remote_set_->Value()) {
observer->OnMediaPositionStateChanged(
media_session::mojom::blink::MediaPosition::New(
playback_rate, duration, position, base::TimeTicks::Now()));
}
}
void HTMLMediaElement::DidDisableAudioOutputSinkChanges() {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnAudioOutputSinkChangingDisabled();
}
void HTMLMediaElement::DidPlayerSizeChange(const gfx::Size& size) {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnMediaSizeChanged(size);
}
void HTMLMediaElement::DidBufferUnderflow() {
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnBufferUnderflow();
}
void HTMLMediaElement::DidSeek() {
// Send the seek updates to the browser process only once per second.
if (last_seek_update_time_.is_null() ||
(base::TimeTicks::Now() - last_seek_update_time_ >=
base::TimeDelta::FromSeconds(1))) {
last_seek_update_time_ = base::TimeTicks::Now();
for (auto& observer : media_player_observer_remote_set_->Value())
observer->OnSeek();
}
}
media::mojom::blink::MediaPlayerHost&
HTMLMediaElement::GetMediaPlayerHostRemote() {
// It is an error to call this before having access to the document's frame.
DCHECK(GetDocument().GetFrame());
if (!media_player_host_remote_->Value().is_bound()) {
GetDocument()
.GetFrame()
->GetRemoteNavigationAssociatedInterfaces()
->GetInterface(
media_player_host_remote_->Value().BindNewEndpointAndPassReceiver(
GetDocument().GetTaskRunner(TaskType::kInternalMedia)));
}
return *media_player_host_remote_->Value().get();
}
mojo::PendingAssociatedReceiver<media::mojom::blink::MediaPlayerObserver>
HTMLMediaElement::AddMediaPlayerObserverAndPassReceiver() {
mojo::PendingAssociatedRemote<media::mojom::blink::MediaPlayerObserver>
observer;
auto observer_receiver = observer.InitWithNewEndpointAndPassReceiver();
media_player_observer_remote_set_->Value().Add(
std::move(observer),
GetDocument().GetTaskRunner(TaskType::kInternalMedia));
return observer_receiver;
}
void HTMLMediaElement::RequestPlay() {
LocalFrame* frame = GetDocument().GetFrame();
if (frame) {
LocalFrame::NotifyUserActivation(
frame, mojom::blink::UserActivationNotificationType::kInteraction);
}
autoplay_policy_->EnsureAutoplayInitiatedSet();
PlayInternal();
}
void HTMLMediaElement::RequestPause(bool triggered_by_user) {
if (triggered_by_user) {
LocalFrame* frame = GetDocument().GetFrame();
if (frame) {
LocalFrame::NotifyUserActivation(
frame, mojom::blink::UserActivationNotificationType::kInteraction);
}
}
PauseInternal();
}
void HTMLMediaElement::RequestSeekForward(base::TimeDelta seek_time) {
double seconds = seek_time.InSecondsF();
DCHECK_GE(seconds, 0) << "Attempted to seek by a negative number of seconds";
setCurrentTime(currentTime() + seconds);
}
void HTMLMediaElement::RequestSeekBackward(base::TimeDelta seek_time) {
double seconds = seek_time.InSecondsF();
DCHECK_GE(seconds, 0) << "Attempted to seek by a negative number of seconds";
setCurrentTime(currentTime() - seconds);
}
void HTMLMediaElement::RequestSeekTo(base::TimeDelta seek_time) {
setCurrentTime(seek_time.InSecondsF());
}
void HTMLMediaElement::SetVolumeMultiplier(double multiplier) {
if (web_media_player_)
web_media_player_->SetVolumeMultiplier(multiplier);
}
void HTMLMediaElement::SetPowerExperimentState(bool enabled) {
if (web_media_player_)
web_media_player_->SetPowerExperimentState(enabled);
}
void HTMLMediaElement::SetAudioSinkId(const String& sink_id) {
auto* audio_output_controller = AudioOutputDeviceController::From(*this);
DCHECK(audio_output_controller);
audio_output_controller->SetSinkId(sink_id);
}
void HTMLMediaElement::SuspendForFrameClosed() {
if (web_media_player_)
web_media_player_->SuspendForFrameClosed();
}
bool HTMLMediaElement::MediaShouldBeOpaque() const {
return !IsMediaDataCorsSameOrigin() && ready_state_ < kHaveMetadata &&
EffectivePreloadType() != WebMediaPlayer::kPreloadNone;
}
void HTMLMediaElement::SetError(MediaError* error) {
error_ = error;
if (!error || !media_source_attachment_)
return;
media_source_attachment_->OnElementError();
}
void HTMLMediaElement::ReportCurrentTimeToMediaSource() {
if (!media_source_attachment_)
return;
// See MediaSourceAttachment::OnElementTimeUpdate() for why the attachment
// needs our currentTime.
media_source_attachment_->OnElementTimeUpdate(currentTime());
}
WebMediaPlayerClient::Features HTMLMediaElement::GetFeatures() {
WebMediaPlayerClient::Features features;
features.id = FastGetAttribute(html_names::kIdAttr);
features.width = FastGetAttribute(html_names::kWidthAttr);
if (auto* parent = parentElement())
features.parent_id = parent->FastGetAttribute(html_names::kIdAttr);
features.alt_text = AltText();
features.is_page_visible = GetDocument().IsPageVisible();
features.is_in_main_frame = GetDocument().IsInMainFrame();
const KURL& url = GetDocument().Url();
features.url_host = url.Host();
features.url_path = url.GetPath();
return features;
}
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveNothing,
HTMLMediaElement::kHaveNothing);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveMetadata,
HTMLMediaElement::kHaveMetadata);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveCurrentData,
HTMLMediaElement::kHaveCurrentData);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveFutureData,
HTMLMediaElement::kHaveFutureData);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveEnoughData,
HTMLMediaElement::kHaveEnoughData);
} // namespace blink
| 36.244312 | 96 | 0.722065 |
10523a3eaec88d2cc899f57e981f7d4acd7a9853 | 9,250 | cpp | C++ | zurch_barzer.cpp | barzerman/barzer | 3211507d5ed0294ee77986f58d781a2fa4142e0d | [
"MIT"
] | 1 | 2018-10-22T12:53:13.000Z | 2018-10-22T12:53:13.000Z | zurch_barzer.cpp | barzerman/barzer | 3211507d5ed0294ee77986f58d781a2fa4142e0d | [
"MIT"
] | null | null | null | zurch_barzer.cpp | barzerman/barzer | 3211507d5ed0294ee77986f58d781a2fa4142e0d | [
"MIT"
] | null | null | null | #include <zurch_barzer.h>
#include <zurch_docidx.h>
#include <zurch_settings.h>
/// Copyright Barzer LLC 2012
/// Code is property Barzer for authorized use only
///
////// THIS IS A TEMPLATE forcustomized XML PARSER
///// clone it into a new file and fill out the TAGS (search for XXX)
#include <iostream>
#include <vector>
#include <string>
#include <expat.h>
#include <ay_logger.h>
#include <ay_util_time.h>
#include <barzer_universe.h>
#include <zurch_docidx.h>
/// KEEP IT IN ANONYMOUS NAMESPACE
namespace {
using namespace barzer;
using namespace zurch;
const float WEIGHT_BOOST=2.0;
const float WEIGHT_IDENTITY=1.0;
const float WEIGHT_ZERO=0.0;
struct ay_xml_parser {
/// set by E tag. cleared upon close
BarzerEntity d_curEntity; // the loader is entity centric.
float d_curWeight;
BarzerEntityDocLinkIndex& d_index;
XML_ParserStruct* expat;
std::ostream& d_os;
size_t d_entCount;
// current stack of tags - see .cpp file for tag codes
std::vector< int > tagStack;
void setEntity( const StoredEntityClass& ec , const char* s, float w )
{
d_curEntity = BarzerEntity(ec,d_index.d_zurchLoader.index().storeExternalString(s));
d_curWeight = w;
}
void takeTag( const char* tag, const char** attr, size_t attr_sz, bool open=true );
void takeCData( const char* dta, size_t dta_len );
bool isCurTag( int tid ) const
{ return ( tagStack.back() == tid ); }
bool isParentTag( int tid ) const
{ return ( tagStack.size() > 1 && (*(tagStack.rbegin()+1)) == tid ); }
ay_xml_parser& init();
void parse( std::istream& fp );
~ay_xml_parser();
ay_xml_parser( BarzerEntityDocLinkIndex& idx, std::ostream& os) :
d_index(idx),
expat(0),
d_os(os),
d_entCount(0)
{ }
};
enum {
TAG_ZURCHENT, // top level tag
TAG_E, // entity (parent ZURCHENT) (c,s,i for class, subclass and id - all mandatory)
TAG_D, // doc (parent ENT) (i - mandatory)
/// add new tags above this line
TAG_INVALID, /// invalid tag
TAG_MAX=TAG_INVALID
};
/// OPEN handles
#define DECL_TAGHANDLE(X) inline int xmlth_##X( ay_xml_parser& parser, int tagId, const char* tag, const char**attr, size_t attr_sz, bool open)
/// IS_PARENT_TAG(X) (X1,X2) (X1,X2,X3) - is parent tag one of the ...
#define IS_PARENT_TAG(X) ( parser.tagStack.size() && (parser.tagStack.back()== TAG_##X) )
#define IS_PARENT_TAG2(X,Y) ( parser.tagStack.size() && (parser.tagStack.back()== TAG_##X || parser.tagStack.back()== TAG_##Y) )
#define IS_PARENT_TAG3(X,Y,Z) ( parser.tagStack.size() && (parser.tagStack.back()== TAG_##X || \
parser.tagStack.back()== TAG_##Y || parser.tagStack.back()== TAG_##Z) )
#define ALS_BEGIN {const char** attr_end = attr+ attr_sz;\
for( const char** a=attr; a< attr_end; a+=2 ) {\
const char* n = a[0];\
const char* v = a[1]; \
switch(n[0]) {
#define ALS_END }}}
enum {
TAGHANDLE_ERROR_OK,
TAGHANDLE_ERROR_PARENT, // wrong parent
TAGHANDLE_ERROR_ENTITY, // misplaced entity
};
////////// TAG HANDLES
DECL_TAGHANDLE(ZURCHENT) {
return TAGHANDLE_ERROR_OK;
}
DECL_TAGHANDLE(E) {
if( !IS_PARENT_TAG(ZURCHENT) )
return TAGHANDLE_ERROR_PARENT;
StoredEntityClass eclass;
std::string idStr;
// float weight= WEIGHT_BOOST;
float weight= WEIGHT_IDENTITY;
if( open ) {
/// loops over all atributes
ALS_BEGIN
case 'c': eclass.ec = atoi(v); break;
case 's': eclass.subclass = atoi(v); break;
case 'i': {
idStr.assign(v);
}
break;
case 'w': {
weight = atof(v);
break;
}
ALS_END
if( !idStr.empty() && eclass.isValid() )
parser.setEntity(eclass,idStr.c_str(),weight);
} else { // closing E - time to process
}
return TAGHANDLE_ERROR_OK;
}
DECL_TAGHANDLE(D) {
if( !IS_PARENT_TAG(E) )
return TAGHANDLE_ERROR_PARENT;
std::string docStr;
float weight = WEIGHT_BOOST;
if( open ) {
/// loops over all atributes
ALS_BEGIN
case 'i': {
docStr.assign(v);
}
case 'w': {
weight = atof(v);
break;
}
break;
ALS_END
if( parser.d_curEntity.isValid() )
parser.d_index.addLink( parser.d_curEntity, docStr, weight );
} else { // closing D - time to process
if( ! ((++parser.d_entCount)%100) ) {
std::cerr << ".";
}
}
return TAGHANDLE_ERROR_OK;
}
////////// DEFINE SPECIFIC TAG HANDLES ABOVE (SEE DECL_TAGHANDLE(XXX) )
#define SETTAG(X) (handler=((tagId=TAG_##X),xmlth_##X))
inline void tagRouter( ay_xml_parser& parser, const char* t, const char** attr, size_t attr_sz, bool open)
{
char c0= toupper(t[0]),c1=(c0?toupper(t[1]):0),c2=(c1?toupper(t[2]):0),c3=(c2? toupper(t[3]):0);
typedef int (*TAGHANDLE)( ay_xml_parser& , int , const char* , const char**, size_t, bool );
TAGHANDLE handler = 0;
int tagId = TAG_INVALID;
switch( c0 ) {
case 'D': SETTAG(D); break;
case 'E': SETTAG(E); break;
case 'Z': SETTAG(ZURCHENT); break;
}
if( tagId != TAG_INVALID ) {
if( !open ) { /// closing tag
if( parser.tagStack.size() ) {
parser.tagStack.pop_back();
} else {
// maybe we will report an error (however silent non reporting is safer)
}
}
if( handler )
handler(parser,tagId,t,attr,attr_sz,open);
if( open ) {
parser.tagStack.push_back( tagId );
}
}
}
void ay_xml_parser::takeTag( const char* tag, const char** attr, size_t attr_sz, bool open)
{ tagRouter(*this,tag,attr,attr_sz,open); }
void ay_xml_parser::takeCData( const char* dta, size_t dta_len )
{
/// if it's in your power enforce no CData in the schema
}
extern "C" {
// cast to XML_StartElementHandler
static void startElement(void* ud, const XML_Char *n, const XML_Char **a)
{
const char* name = (const char*)n;
const char** atts = (const char**)a;
ay_xml_parser *parser =(ay_xml_parser *)ud;
int attrCount = XML_GetSpecifiedAttributeCount( parser->expat );
if( attrCount <=0 || (attrCount & 1) )
attrCount = 0; // odd number of attributes is invalid
parser->takeTag( name, atts, attrCount );
}
// cast to XML_EndElementHandler
static void endElement(void *ud, const XML_Char *n)
{
const char *name = (const char*) n;
ay_xml_parser *parser =(ay_xml_parser *)ud;
parser->takeTag(name, 0,0,false);
}
// cast to XML_CharacterDataHandler
static void charDataHandle( void * ud, const XML_Char *str, int len)
{
if( !len )
return;
const char* s = (const char*)str;
ay_xml_parser *parser =(ay_xml_parser *)ud;
if( len>1 || !isspace(*s) )
parser->takeCData( s, len );
}
} // extern "C" ends
ay_xml_parser& ay_xml_parser::init()
{
if( !expat )
expat= XML_ParserCreate(NULL);
else
XML_ParserReset(expat,0);
XML_SetUserData(expat,this);
XML_SetElementHandler(expat, startElement, endElement);
XML_SetCharacterDataHandler(expat, charDataHandle);
return *this;
}
ay_xml_parser::~ay_xml_parser()
{
if(expat)
XML_ParserFree(expat);
}
void ay_xml_parser::parse( std::istream& fp )
{
if(!expat) {
AYLOG(ERROR) << "invalid expat instance\n";
}
char buf[ 1024*1024 ];
bool done = false;
const size_t buf_len = sizeof(buf)-1;
do {
fp.read( buf,buf_len );
size_t len = fp.gcount();
done = len < buf_len;
if (!XML_Parse(expat, buf, len, done)) {
fprintf(stderr, "%s at line %d\n", XML_ErrorString(XML_GetErrorCode(expat)), (int)XML_GetCurrentLineNumber(expat));
return;
}
} while (!done);
}
} // anon
namespace zurch {
void BarzerEntityDocLinkIndex::addLink( const BarzerEntity& ent, uint32_t docId, float w )
{
d_zurchLoader.index().appendOwnedEntity( docId, ent, (w*d_zurchLoader.getCurrentWeight()) );
m_doc2linkedEnts[docId].push_back( { d_zurchLoader.index().getOwnedEntId(ent),w });
}
void BarzerEntityDocLinkIndex::addLink( const BarzerEntity& ent, const std::string& s, float w )
{
uint32_t docId = d_zurchLoader.addDocName( s.c_str() );
addLink(ent, docId, w );
}
const std::vector<BarzerEntityDocLinkIndex::DocIdData>* BarzerEntityDocLinkIndex::getLinkedEnts(uint32_t docId) const
{
const auto pos = m_doc2linkedEnts.find(docId);
return pos == m_doc2linkedEnts.end() ? nullptr : &pos->second;
}
int BarzerEntityDocLinkIndex::loadFromFile( const std::string& fname )
{
ay::stopwatch timer;
std::fstream fp;
std::cerr << "loading zurch entity document links from " << fname << " ";
fp.open( fname.c_str() );
if( !fp.is_open() )
std::cerr << "Cant load " << fname << std::endl;
ay_xml_parser parser( *this, std::cerr );
parser.init().parse( fp );
std::cerr << parser.d_entCount << " links created " << " in " << timer.calcTime() << " seconds " << std::endl;
return 0;
}
} // namepace zurch
| 29.742765 | 143 | 0.617189 |
10535a22ff7c6548667fedb088a3596c5bb22ef7 | 787 | cpp | C++ | windows/advcore/gdiplus/test/functest/chalfpixel.cpp | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | windows/advcore/gdiplus/test/functest/chalfpixel.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | windows/advcore/gdiplus/test/functest/chalfpixel.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /******************************Module*Header*******************************\
* Module Name: CAntialias.cpp
*
* This file contains the code to support the functionality test harness
* for GDI+. This includes menu options and calling the appropriate
* functions for execution.
*
* Created: 05-May-2000 - Jeff Vezina [t-jfvez]
*
* Copyright (c) 2000 Microsoft Corporation
*
\**************************************************************************/
#include "CHalfPixel.h"
CHalfPixel::CHalfPixel(BOOL bRegression)
{
strcpy(m_szName,"Half Pixel Offset");
m_bRegression=bRegression;
}
CHalfPixel::~CHalfPixel()
{
}
void CHalfPixel::Set(Graphics *g)
{
g->SetPixelOffsetMode(
m_bUseSetting ? PixelOffsetModeHalf : PixelOffsetModeNone
);
}
| 25.387097 | 77 | 0.579416 |
105390b9e6ff92441f266aad23094bdf083e5570 | 9,997 | cpp | C++ | winsdkfb-master/samples/SDKCppUnit/SDKCppUnit.Shared/TestRunner.cpp | NestedWorld/NestedWorld-Windows-10 | 96e9e8d8b97199bc1d9ce3f8cd5133e63db513a5 | [
"MIT"
] | null | null | null | winsdkfb-master/samples/SDKCppUnit/SDKCppUnit.Shared/TestRunner.cpp | NestedWorld/NestedWorld-Windows-10 | 96e9e8d8b97199bc1d9ce3f8cd5133e63db513a5 | [
"MIT"
] | null | null | null | winsdkfb-master/samples/SDKCppUnit/SDKCppUnit.Shared/TestRunner.cpp | NestedWorld/NestedWorld-Windows-10 | 96e9e8d8b97199bc1d9ce3f8cd5133e63db513a5 | [
"MIT"
] | null | null | null | //******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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.
//
//******************************************************************************
//
// TestRunner.cpp
// Implementation of the TestRunner class.
//
#include "pch.h"
#include "SDKCppUnitStrings.h"
#include "TestContext.h"
#include "TestPhoto.h"
#include "TestRunner.h"
#include <vector>
using namespace SDKCppUnit;
using namespace concurrency;
using namespace Facebook;
using namespace Facebook::Graph;
using namespace Platform;
using namespace Platform::Collections;
using namespace std;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Storage;
using namespace Windows::Storage::Streams;
using namespace Windows::Web::Http;
using namespace Windows::Web::Http::Filters;
const int FBDeleteOpenGraphUserErrorCode = 2904;
TestRunner::TestRunner()
{
}
void TestRunner::RunAllTests()
{
NotifyTestSuiteStarted(GraphAPISuite);
NotifyTestCaseStarted(CreateAppTokenTest);
create_task(TestCreateAppToken())
.then([=](bool TestResult)
{
NotifyTestCaseCompleted(CreateAppTokenTest, TestResult);
})
.then([=]() -> task<bool>
{
NotifyTestCaseStarted(CreateTestUserTest);
return TestCreateTestUser();
})
.then([=](bool TestResult)
{
NotifyTestCaseCompleted(CreateTestUserTest, TestResult);
})
.then([=]() -> task < bool >
{
NotifyTestCaseStarted(DeleteAllTestUsersTest);
return TestDeleteAllTestUsers();
})
.then([=](bool TestResult)
{
NotifyTestCaseCompleted(DeleteAllTestUsersTest, TestResult);
})
.then([=]() -> task < bool >
{
NotifyTestCaseStarted(UploadPhotoTest);
return TestUploadPhoto();
})
.then([=](bool TestResult)
{
NotifyTestCaseCompleted(UploadPhotoTest, TestResult);
NotifyTestSuiteCompleted(GraphAPISuite);
});
}
task<bool> TestRunner::TestCreateAppToken(
)
{
TestContext* ctx = TestContext::Get();
return ctx->GetAppToken();
}
task<bool> TestRunner::TestCreateTestUser(
)
{
TestContext* ctx = TestContext::Get();
return ctx->GetAppToken()
.then([this, ctx](bool result) -> task<FBResult^>
{
if (!result)
{
throw ref new InvalidArgumentException(TestAppErrorNoToken);
}
return ctx->CreateTestUser(nullptr);
})
.then([=](FBResult^ result) -> bool
{
return (result && result->Succeeded);
});
}
task<bool> TestRunner::TestDeleteAllTestUsers(
)
{
TestContext* ctx = TestContext::Get();
return ctx->GetAppToken()
.then([=](bool gotToken) -> task<FBResult^>
{
if (!gotToken)
{
throw ref new InvalidArgumentException(TestAppErrorNoToken);
}
return ctx->CreateTestUser(nullptr);
})
.then([=](FBResult^ result) -> task<bool>
{
if (result->Succeeded)
{
return ctx->GetTestUsers();
}
else
{
return create_task([]()
{
return false;
});
}
})
.then([=](bool gotTestUsers) -> vector<task<FBResult^>>
{
vector<task<FBResult^>> deleteResults;
if (gotTestUsers)
{
IVector<TestUser^>^ users = ctx->TestUsers();
for (unsigned int i = 0; i < users->Size; i++)
{
deleteResults.push_back(ctx->DeleteTestUser(users->GetAt(i)));
}
}
return deleteResults;
})
.then([=](vector<task<FBResult^>> results) -> bool
{
bool success = true;
if (results.size() == 0)
{
success = false;
}
for (unsigned int i = 0; i < results.size(); i++)
{
FBResult^ deleteResult = results.at(i).get();
if (!deleteResult->Succeeded)
{
if (deleteResult->ErrorInfo->Code !=
FBDeleteOpenGraphUserErrorCode)
{
success = false;
}
}
}
return success;
});
}
IAsyncOperation<IRandomAccessStreamWithContentType^>^
TestRunner::GetStreamOnFileAsync(
String^ path
)
{
return create_async([=]()
{
StorageFolder^ appFolder =
Windows::ApplicationModel::Package::Current->InstalledLocation;
return create_task(appFolder->GetFileAsync(FBTestImagePath))
.then([=](StorageFile^ file) -> IAsyncOperation<IRandomAccessStreamWithContentType^>^
{
if (file)
{
return file->OpenReadAsync();
}
else
{
return create_async([]()
{
return (IRandomAccessStreamWithContentType^)nullptr;
});
}
});
});
}
IAsyncOperation<FBResult^>^ TestRunner::UploadPhotoFromStreamAsync(
String^ Path,
IRandomAccessStreamWithContentType^ Stream,
PropertySet^ Parameters
)
{
if (Stream)
{
FBMediaStream^ streamWrapper = ref new FBMediaStream(FBTestImageName,
Stream);
Parameters->Insert(SourceParameterKey, streamWrapper);
FBSingleValue^ sval = ref new FBSingleValue(Path, Parameters,
ref new FBJsonClassFactory(TestPhoto::FromJson));
return sval->PostAsync();
}
else
{
return create_async([]()
{
return (FBResult^)nullptr;
});
}
}
IAsyncOperation<FBResult^>^ TestRunner::GetExtendedPhotoInfoForAsync(
FBResult^ Result,
PropertySet^ Parameters
)
{
IAsyncOperation<FBResult^>^ op = nullptr;
if (Result->Succeeded)
{
TestPhoto^ photo = static_cast<TestPhoto^>(Result->Object);
String^ path = L"/" + photo->Id;
FBSingleValue^ sval = ref new FBSingleValue(path, Parameters,
ref new FBJsonClassFactory(TestPhoto::FromJson));
op = sval->GetAsync();
}
return op;
}
task<bool> TestRunner::TestUploadPhoto(
)
{
TestContext* ctx = TestContext::Get();
PropertySet^ parameters = ref new PropertySet();
FBSession^ sess = FBSession::ActiveSession;
String^ graphPath = sess->FBAppId + FBSDKTestUsersPath;
return ctx->GetAppToken()
.then([=](bool gotToken) -> task<FBResult^>
{
if (!gotToken)
{
throw ref new InvalidArgumentException(TestAppErrorNoToken);
}
parameters->Insert(L"permissions",
L"public_profile,publish_actions,user_photos");
return ctx->CreateTestUser(parameters);
})
.then([=](FBResult^ result) -> IAsyncOperation<IRandomAccessStreamWithContentType^>^
{
IAsyncOperation<IRandomAccessStreamWithContentType^>^ op = nullptr;
parameters->Clear();
if (result->Succeeded)
{
TestUser^ user = static_cast<TestUser^>(result->Object);
String^ path = "/" + user->Id + "/photos";
parameters->Insert(AccessTokenParameterKey, user->AccessToken);
parameters->Insert(PathParameterKey, path);
StorageFolder^ appFolder =
Windows::ApplicationModel::Package::Current->InstalledLocation;
op = GetStreamOnFileAsync(FBTestImagePath);
}
return op;
})
.then([=](IRandomAccessStreamWithContentType^ stream) -> IAsyncOperation<FBResult^>^
{
String^ path =
static_cast<String^>(parameters->Lookup(PathParameterKey));
parameters->Remove(PathParameterKey);
return UploadPhotoFromStreamAsync(path, stream, parameters);
})
.then([=](FBResult^ result) -> IAsyncOperation<FBResult^>^
{
return GetExtendedPhotoInfoForAsync(result, parameters);
})
.then([=](FBResult^ result) -> bool
{
return result->Succeeded;
});
}
void TestRunner::NotifyTestSuiteStarted(
String^ SuiteName
)
{
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([this, SuiteName]()
{
TestSuiteStarted(SuiteName);
}));
}
void TestRunner::NotifyTestSuiteCompleted(
Platform::String^ SuiteName
)
{
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([this, SuiteName]()
{
TestSuiteCompleted(SuiteName);
}));
}
void TestRunner::NotifyTestCaseStarted(
Platform::String^ CaseName
)
{
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([this, CaseName]()
{
TestCaseStarted(CaseName);
}));
}
void TestRunner::NotifyTestCaseCompleted(
Platform::String^ CaseName,
bool TestResult
)
{
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler(
[this, CaseName, TestResult]()
{
TestCaseCompleted(CaseName, TestResult);
}));
}
| 26.946092 | 93 | 0.607582 |
1054666e5dc6a9be623b69119f9add414b7ad7d6 | 3,498 | cpp | C++ | src/src/fractals/julia/Julia.cpp | migregal/bmstu_iu7_cg_course | 8ec2bb5c319328d9b0de307c1a8236b6b5188136 | [
"MIT"
] | null | null | null | src/src/fractals/julia/Julia.cpp | migregal/bmstu_iu7_cg_course | 8ec2bb5c319328d9b0de307c1a8236b6b5188136 | [
"MIT"
] | null | null | null | src/src/fractals/julia/Julia.cpp | migregal/bmstu_iu7_cg_course | 8ec2bb5c319328d9b0de307c1a8236b6b5188136 | [
"MIT"
] | null | null | null | #include <fractals/julia/Julia.h>
#include <algorithm>
#include <cmath>
#include <math/Vector.h>
#include <QDebug>
#define MAX_RAYCAST_STEP 128
namespace CGCP::fractal {
float JuliaParametrized::raycast(
math::Vector3 const &ro,
math::Vector3 const &rd,
math::Vector4 &rescol,
float fov,
math::Vector3 const &c) {
float res = -1.0;
auto dis = bounder_->intersect(ro, rd);
if (dis.y() < 0.0) return -1.0;
dis.setX(std::max(dis.x(), 0.0f));
// raymarch fractal distance field
math::Vector4 trap;
float fovfactor = 1.0 / sqrt(1.0 + fov * fov);
float t = dis.x();
for (int i = 0; i < MAX_RAYCAST_STEP; i++) {
auto pos = ro + rd * t;
float surface = std::clamp(1e-3f * t * fovfactor, 1e-4f, 0.1f);
float dt = map(pos, c, trap);
if (t > dis.y() || dt < surface) break;
t += std::min(dt, 5e-2f);
}
if (t < dis.y()) {
rescol = trap;
res = t;
}
return res;
}
math::Vector3 JuliaParametrized::calcNormal(math::Vector3 &pos,
float t,
float fovfactor,
const math::Vector3 &c) {
math::Vector4 tmp;
float surface = std::clamp(5e-4f * t * fovfactor, 0.0f, 0.1f);
auto eps = math::Vector2(surface, 0.0);
auto e_xyy = math::Vector3(eps.x(), eps.y(), eps.y()),
e_yyx = math::Vector3(eps.y(), eps.y(), eps.x()),
e_yxy = math::Vector3(eps.y(), eps.x(), eps.y()),
e_xxx = math::Vector3(eps.x(), eps.x(), eps.x());
return math::Vector3(
map(pos + e_xyy, c, tmp) - map(pos - e_xyy, c, tmp),
map(pos + e_yxy, c, tmp) - map(pos - e_yxy, c, tmp),
map(pos + e_yyx, c, tmp) - map(pos - e_yyx, c, tmp))
.normalized();
}
float JuliaParametrized::map(const math::Vector3 &p, const math::Vector3 &c, math::Vector4 &resColor) {
math::Vector3 z = p;
float m = math::Vector3::dotProduct(z, z);
auto trap = math::Vector4(std::abs(z.x()), std::abs(z.y()), std::abs(z.z()), m);
float dz = 1.0;
for (int i = 0; i < 4; i++) {
// dz = 8*z^7*dz
dz = 8.0 * std::pow(m, 3.5) * dz;
// z = z^8+z
float r = z.length();
float b = 8.0 * std::acos(std::clamp(z.y() / r, -1.0f, 1.0f));
float a = 8.0 * std::atan2(z.x(), z.z());
z = c + std::pow(r, 8.0) *
math::Vector3(std::sin(b) * std::sin(a),
std::cos(b),
std::sin(b) * std::cos(a));
trap.setX(std::min(trap.x(), std::abs(z.x())));
trap.setY(std::min(trap.y(), std::abs(z.y())));
trap.setZ(std::min(trap.z(), std::abs(z.z())));
trap.setZ(std::min(trap.w(), m));
m = math::Vector3::dotProduct(z, z);
if (m > 2.0)
break;
}
// resColor = math::Vector4(m, trap.y(), trap.z(), trap.w());
resColor = trap;
// distance estimation (through the Hubbard-Douady potential)
return 0.25 * log(m) * sqrt(m) / dz;
}
}// namespace CGCP::fractal
| 33.314286 | 107 | 0.445969 |
1054d6d9d8f0cb216d372576bf8147d76d19b906 | 3,646 | cpp | C++ | kernel/node/Directory.cpp | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | 2 | 2020-07-14T21:16:54.000Z | 2020-10-08T08:40:47.000Z | kernel/node/Directory.cpp | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | null | null | null | kernel/node/Directory.cpp | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | null | null | null |
#include <libsystem/Logger.h>
#include <libsystem/Result.h>
#include <libsystem/core/CString.h>
#include "kernel/node/Directory.h"
#include "kernel/node/Handle.h"
static Result directory_open(FsDirectory *node, FsHandle *handle)
{
DirectoryListing *listing = (DirectoryListing *)malloc(sizeof(DirectoryListing) + sizeof(DirectoryEntry) * node->childs->count());
listing->count = node->childs->count();
int current_index = 0;
list_foreach(FsDirectoryEntry, entry, node->childs)
{
DirectoryEntry *record = &listing->entries[current_index];
FsNode *node = entry->node;
strcpy(record->name, entry->name);
record->stat.type = node->type;
if (node->size)
{
record->stat.size = node->size(entry->node, nullptr);
}
else
{
record->stat.size = 0;
}
current_index++;
};
handle->attached = listing;
return SUCCESS;
}
static void directory_close(FsDirectory *node, FsHandle *handle)
{
__unused(node);
free(handle->attached);
}
static Result directory_read(FsDirectory *node, FsHandle *handle, void *buffer, uint size, size_t *read)
{
__unused(node);
// FIXME: directories should no be read using read().
if (size == sizeof(DirectoryEntry))
{
size_t index = handle->offset / sizeof(DirectoryEntry);
DirectoryListing *listing = (DirectoryListing *)handle->attached;
if (index < listing->count)
{
*((DirectoryEntry *)buffer) = listing->entries[index];
*read = sizeof(DirectoryEntry);
}
}
return SUCCESS;
}
static FsNode *directory_find(FsDirectory *node, const char *name)
{
list_foreach(FsDirectoryEntry, entry, node->childs)
{
if (strcmp(entry->name, name) == 0)
{
return fsnode_ref(entry->node);
}
};
return nullptr;
}
static Result directory_link(FsDirectory *node, const char *name, FsNode *child)
{
list_foreach(FsDirectoryEntry, entry, node->childs)
{
if (strcmp(entry->name, name) == 0)
{
return ERR_FILE_EXISTS;
}
};
FsDirectoryEntry *new_entry = __create(FsDirectoryEntry);
new_entry->node = fsnode_ref(child);
strcpy(new_entry->name, name);
list_pushback(node->childs, new_entry);
return SUCCESS;
}
static void directory_entry_destroy(FsDirectoryEntry *entry)
{
fsnode_deref(entry->node);
free(entry);
}
static Result directory_unlink(FsDirectory *node, const char *name)
{
list_foreach(FsDirectoryEntry, entry, node->childs)
{
if (strcmp(entry->name, name) == 0)
{
list_remove(node->childs, entry);
directory_entry_destroy(entry);
return SUCCESS;
}
}
return ERR_NO_SUCH_FILE_OR_DIRECTORY;
}
static void directory_destroy(FsDirectory *node)
{
list_destroy_with_callback(node->childs, (ListDestroyElementCallback)directory_entry_destroy);
}
FsNode *directory_create()
{
FsDirectory *directory = __create(FsDirectory);
fsnode_init(directory, FILE_TYPE_DIRECTORY);
directory->open = (FsNodeOpenCallback)directory_open;
directory->close = (FsNodeCloseCallback)directory_close;
directory->read = (FsNodeReadCallback)directory_read;
directory->find = (FsNodeFindCallback)directory_find;
directory->link = (FsNodeLinkCallback)directory_link;
directory->unlink = (FsNodeUnlinkCallback)directory_unlink;
directory->destroy = (FsNodeDestroyCallback)directory_destroy;
directory->childs = list_create();
return (FsNode *)directory;
}
| 24.469799 | 134 | 0.657707 |
10550b46ecac278de7d8e133f356940e447e8b84 | 3,291 | cc | C++ | FWCore/Framework/src/HCTypeTag.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FWCore/Framework/src/HCTypeTag.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FWCore/Framework/src/HCTypeTag.cc | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #ifndef Framework_HCTypeTag_icc
#define Framework_HCTypeTag_icc
// -*- C++ -*-
//
// Package: HeteroContainer
// Module: HCTypeTag
//
// Description: <one line class summary>
//
// Implementation:
// <Notes on implementation>
//
// Author: Chris D. Jones
// Created: Sun Sep 20 15:27:25 EDT 1998
//
// Revision history
//
// $Log: HCTypeTag.cc,v $
// Revision 1.2 2010/01/23 02:03:42 chrjones
// moved type lookup used by EventSetup to FWCore/Utilities to avoid unneeded external dependencies from FWCore/Framework
//
// Revision 1.1 2010/01/15 20:35:49 chrjones
// Changed type identifier for the EventSetup to no longer be a template
//
// Revision 1.6 2005/11/11 20:55:54 chrjones
// use new TypeIDBase for basis of all type comparisons
//
// Revision 1.5 2005/09/01 23:30:48 wmtan
// fix rule violations found by rulechecker
//
// Revision 1.4 2005/09/01 05:20:56 wmtan
// Fix Rules violations found by RuleChecker
//
// Revision 1.3 2005/07/14 22:50:52 wmtan
// Rename packages
//
// Revision 1.2 2005/06/23 19:59:30 wmtan
// fix rules violations found by rulechecker
//
// Revision 1.1 2005/05/29 02:29:53 wmtan
// initial population
//
// Revision 1.2 2005/04/04 20:31:22 chrjones
// added namespace
//
// Revision 1.1 2005/03/28 15:03:30 chrjones
// first submission
//
// Revision 1.2 2000/07/25 13:42:37 cdj
// HCTypeTag can now find a TypeTag from the name of a type
//
// Revision 1.1.1.1 1998/09/23 14:13:12 cdj
// first submission
//
// system include files
#include <map>
#include <cstring>
// user include files
//#include "Logger/interface/report.h"
#include "FWCore/Framework/interface/HCTypeTag.h"
// STL classes
//
// constants, enums and typedefs
//
namespace edm {
namespace eventsetup {
namespace heterocontainer {
//
// static data member definitions
//
//
// constructors and destructor
//
//HCTypeTag::HCTypeTag()
//{
//}
// HCTypeTag::HCTypeTag(const HCTypeTag& rhs)
// {
// // do actual copying here; if you implemented
// // operator= correctly, you may be able to use just say
// *this = rhs;
// }
//HCTypeTag::~HCTypeTag()
//{
//}
//
// assignment operators
//
// const HCTypeTag& HCTypeTag::operator=(const HCTypeTag& rhs)
// {
// if(this != &rhs) {
// // do actual copying here, plus:
// // "SuperClass"::operator=(rhs);
// }
//
// return *this;
// }
//
// member functions
//
//
// const member functions
//
//
// static member functions
//
HCTypeTag HCTypeTag::findType(const std::string& iTypeName) { return HCTypeTag::findType(iTypeName.c_str()); }
HCTypeTag HCTypeTag::findType(const char* iTypeName) {
std::pair<const char*, const std::type_info*> p = typelookup::findType(iTypeName);
if (nullptr == p.second) {
return HCTypeTag();
}
//need to take name from the 'findType' since that address is guaranteed to be long lived
return HCTypeTag(*p.second, p.first);
}
} // namespace heterocontainer
} // namespace eventsetup
} // namespace edm
#endif
| 24.377778 | 121 | 0.613187 |
105534fd5b383840157e9d44a7cda6980e28c6bb | 710 | cpp | C++ | src/tests/profiler/native/nullprofiler/nullprofiler.cpp | tonybaloney/runtime | b43bea8d0c409d3693c172198c6b924eff6731f4 | [
"MIT"
] | null | null | null | src/tests/profiler/native/nullprofiler/nullprofiler.cpp | tonybaloney/runtime | b43bea8d0c409d3693c172198c6b924eff6731f4 | [
"MIT"
] | null | null | null | src/tests/profiler/native/nullprofiler/nullprofiler.cpp | tonybaloney/runtime | b43bea8d0c409d3693c172198c6b924eff6731f4 | [
"MIT"
] | null | null | null | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "nullprofiler.h"
GUID NullProfiler::GetClsid()
{
// {9C1A6E14-2DEC-45CE-9061-F31964D8884D}
GUID clsid = { 0x9C1A6E14, 0x2DEC, 0x45CE,{ 0x90, 0x61, 0xF3, 0x19, 0x64, 0xD8, 0x88, 0x4D } };
return clsid;
}
HRESULT NullProfiler::Initialize(IUnknown* pICorProfilerInfoUnk)
{
Profiler::Initialize(pICorProfilerInfoUnk);
// This profiler does nothing, and passes if it is loaded at all
printf("PROFILER TEST PASSES\n");
return S_OK;
}
HRESULT NullProfiler::Shutdown()
{
Profiler::Shutdown();
fflush(stdout);
return S_OK;
}
| 22.903226 | 99 | 0.702817 |
10563e7a19863fd6b7c1c62240c38c3222a06c1f | 1,488 | cpp | C++ | src/main_collector.cpp | despargy/KukaImplementation-kinetic | 3a9ab106b117acfc6478fbf3e60e49b7e94b2722 | [
"MIT"
] | 1 | 2021-08-21T12:49:27.000Z | 2021-08-21T12:49:27.000Z | src/main_collector.cpp | despargy/KukaImplementation-kinetic | 3a9ab106b117acfc6478fbf3e60e49b7e94b2722 | [
"MIT"
] | null | null | null | src/main_collector.cpp | despargy/KukaImplementation-kinetic | 3a9ab106b117acfc6478fbf3e60e49b7e94b2722 | [
"MIT"
] | null | null | null | #include <ros/ros.h>
#include <thread>
// #include <autharl_core/controller/gravity_compensation.h>
// #include <autharl_core/robot/robot_sim.h>
#include <autharl_core>
#include <lwr_robot/robot.h>
//
// #include <autharl_core/viz/ros_state_publisher.h>
// #include <autharl_core/robot/ros_model.h>
#include <kuka_implementation/collector.h>
int main(int argc, char** argv)
{
// Initialize the ROS node
ros::init(argc, argv, "get_desired_trajectory");
ros::NodeHandle n;
// Create the robot after you have launch the URDF on the parameter server
auto model = std::make_shared<arl::robot::ROSModel>();
// Create a simulated robot, use can use a real robot also
// auto robot = std::make_shared<arl::robot::RobotSim>(model, 1e-3);
auto robot = std::make_shared<arl::lwr::Robot>(model);
// Create a visualizater for see the result in rviz
auto rviz = std::make_shared<arl::viz::RosStatePublisher>(robot);
// Create the joint trajectory controller
// auto gravity_compensation_position = std::make_shared<arl::controller::GravityCompensation>(robot);
auto collector = std::make_shared<Collector>(robot);
std::thread rviz_thread(&arl::viz::RosStatePublisher::run, rviz);
//thread for keyboard inter
// Run the trajectory controller
collector->run();
ros::spin();
rviz_thread.join();
// // thread to collect Data
// robot->getJointPosition();
// store them by GravityX.txt , GravitY.txt GravityZ.txt under /data folder
return 0;
}
| 28.075472 | 104 | 0.719758 |
105733a2cf1f9575daf8c3ca8fe0d4a164591a0b | 2,245 | cc | C++ | net/spdy/spdy_protocol_test.cc | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | net/spdy/spdy_protocol_test.cc | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | net/spdy/spdy_protocol_test.cc | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/spdy/spdy_protocol.h"
#include <limits>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/spdy/spdy_bitmasks.h"
#include "net/spdy/spdy_framer.h"
#include "net/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
enum SpdyProtocolTestTypes {
SPDY2 = 2,
SPDY3 = 3,
};
} // namespace
namespace net {
class SpdyProtocolTest
: public ::testing::TestWithParam<SpdyProtocolTestTypes> {
protected:
virtual void SetUp() {
spdy_version_ = GetParam();
}
// Version of SPDY protocol to be used.
int spdy_version_;
};
// All tests are run with two different SPDY versions: SPDY/2 and SPDY/3.
INSTANTIATE_TEST_CASE_P(SpdyProtocolTests,
SpdyProtocolTest,
::testing::Values(SPDY2, SPDY3));
// Test our protocol constants
TEST_P(SpdyProtocolTest, ProtocolConstants) {
EXPECT_EQ(1, SYN_STREAM);
EXPECT_EQ(2, SYN_REPLY);
EXPECT_EQ(3, RST_STREAM);
EXPECT_EQ(4, SETTINGS);
EXPECT_EQ(5, NOOP);
EXPECT_EQ(6, PING);
EXPECT_EQ(7, GOAWAY);
EXPECT_EQ(8, HEADERS);
EXPECT_EQ(9, WINDOW_UPDATE);
EXPECT_EQ(10, CREDENTIAL);
EXPECT_EQ(11, BLOCKED);
EXPECT_EQ(12, PUSH_PROMISE);
EXPECT_EQ(12, LAST_CONTROL_TYPE);
EXPECT_EQ(std::numeric_limits<int32>::max(), kSpdyMaximumWindowSize);
}
class SpdyProtocolDeathTest : public SpdyProtocolTest {};
// All tests are run with two different SPDY versions: SPDY/2 and SPDY/3.
INSTANTIATE_TEST_CASE_P(SpdyProtocolDeathTests,
SpdyProtocolDeathTest,
::testing::Values(SPDY2, SPDY3));
TEST_P(SpdyProtocolDeathTest, TestSpdySettingsAndIdOutOfBounds) {
scoped_ptr<SettingsFlagsAndId> flags_and_id;
EXPECT_DFATAL(flags_and_id.reset(new SettingsFlagsAndId(1, ~0)),
"SPDY setting ID too large.");
// Make sure that we get expected values in opt mode.
if (flags_and_id.get() != NULL) {
EXPECT_EQ(1, flags_and_id->flags());
EXPECT_EQ(static_cast<SpdyPingId>(0xffffff), flags_and_id->id());
}
}
} // namespace net
| 27.716049 | 73 | 0.703786 |
105793bb3faf489b211eac8900a8075c54b92406 | 1,179 | cpp | C++ | SISASG/Source/genericEntity.cpp | Ristellise/JUMP-Sprint | f664270aebabec60fc527f7e875319885bc43749 | [
"WTFPL"
] | 2 | 2019-02-12T00:34:01.000Z | 2019-02-12T00:36:27.000Z | SISASG/Source/genericEntity.cpp | Ristellise/JUMP-Sprint | f664270aebabec60fc527f7e875319885bc43749 | [
"WTFPL"
] | 22 | 2019-02-11T04:53:50.000Z | 2019-02-27T05:38:06.000Z | SISASG/Source/genericEntity.cpp | Ristellise/JUMP-Sprint | f664270aebabec60fc527f7e875319885bc43749 | [
"WTFPL"
] | null | null | null | #include "genericEntity.h"
#include "Application.h"
genericEntity::genericEntity()
{
}
genericEntity::~genericEntity()
{
}
void genericEntity::Init(const Vector3& pos, const Vector3& target, const Vector3& up)
{
this->position = pos;
this->target = target;
view = (target - position).Normalized();
right = view.Cross(up);
right.y = 0;
right.Normalize();
this->up = right.Cross(view).Normalized();
this->size = Vector3(1.0f, 1.0f, 1.0f);
this->Boxsize = BBoxDimensions::toBBox(this->size);
}
void genericEntity::Init(const Vector3& pos, const Vector3& target, const Vector3& up, const Vector3& size)
{
this->Init(pos, target, up);
this->size = size;
}
void genericEntity::Reset()
{
position.Set(1, 0, 0);
target.Set(0, 0, 0);
up.Set(0, 1, 0);
}
void genericEntity::OnHit(entity * Ent)
{
}
void genericEntity::Update(double dt)
{
static const float ENTITY_SPEED = 20.f;
position = position + view * (float)(velocity * dt);
if (this->velocity > 0)
{
this->velocity -= (float)(1.0f * dt);
}
if (this->SoundSrc != nullptr)
{
this->SoundSrc->updatePos(&this->position);
}
} | 21.436364 | 107 | 0.626802 |
10584bac766b71c8bedf792af1ae53c0665fe320 | 612 | cpp | C++ | src/RE/TESContainer.cpp | FruitsBerriesMelons123/CommonLibSSE | 7ae21d11b9e9c86b0596fc1cfa58b6993a568125 | [
"MIT"
] | 1 | 2020-09-25T18:18:09.000Z | 2020-09-25T18:18:09.000Z | src/RE/TESContainer.cpp | FruitsBerriesMelons123/CommonLibSSE | 7ae21d11b9e9c86b0596fc1cfa58b6993a568125 | [
"MIT"
] | null | null | null | src/RE/TESContainer.cpp | FruitsBerriesMelons123/CommonLibSSE | 7ae21d11b9e9c86b0596fc1cfa58b6993a568125 | [
"MIT"
] | 1 | 2020-10-26T19:05:05.000Z | 2020-10-26T19:05:05.000Z | #include "RE/TESContainer.h"
#include "RE/FormTypes.h"
#include "RE/TESForm.h"
namespace RE
{
auto TESContainer::GetContainerObjectAt(UInt32 a_idx) const
-> std::optional<ContainerObject*>
{
if (a_idx < numContainerObjects) {
return std::make_optional(containerObjects[a_idx]);
} else {
return std::nullopt;
}
}
SInt32 TESContainer::CountObjectsInContainer(TESBoundObject* a_object) const
{
SInt32 count = 0;
ForEachContainerObject([&](ContainerObject* a_contObj)
{
if (a_contObj->obj == a_object) {
count += a_contObj->count;
}
return true;
});
return count;
}
}
| 18.545455 | 77 | 0.69281 |
105bcf462092ff27827ffc0a14e2ee79ecbcb6e0 | 426 | hpp | C++ | include/3dstris/gui/widget.hpp | geniiii/3DStris | 556ef42ec2e131ffd7ac92065773dbaa483d743a | [
"MIT"
] | null | null | null | include/3dstris/gui/widget.hpp | geniiii/3DStris | 556ef42ec2e131ffd7ac92065773dbaa483d743a | [
"MIT"
] | null | null | null | include/3dstris/gui/widget.hpp | geniiii/3DStris | 556ef42ec2e131ffd7ac92065773dbaa483d743a | [
"MIT"
] | null | null | null | #pragma once
#include <3dstris/util.hpp>
class GUI;
class Widget {
public:
Widget(GUI& parent, const Pos pos, const WH wh);
virtual ~Widget() = default;
virtual void draw() const = 0;
virtual void update(const touchPosition touch,
const touchPosition previousTouch) = 0;
Pos getPos() const noexcept { return pos; }
WH getWH() const noexcept { return wh; }
protected:
GUI& parent;
Pos pos;
WH wh;
};
| 17.75 | 49 | 0.683099 |
105c103a138ed79b39bd4eee2f74f05f80c12d92 | 3,180 | hpp | C++ | include/eve/module/core/regular/impl/reduce.hpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | include/eve/module/core/regular/impl/reduce.hpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | include/eve/module/core/regular/impl/reduce.hpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | //==================================================================================================
/*
EVE - Expressive Vector Engine
Copyright : EVE Contributors & Maintainers
SPDX-License-Identifier: MIT
*/
//==================================================================================================
#pragma once
#include <eve/concept/vectorized.hpp>
#include <eve/detail/implementation.hpp>
#include <eve/detail/function/reduce.hpp>
#include <eve/detail/function/sum.hpp>
#include <eve/module/core/regular/swap_adjacent_groups.hpp>
#include <eve/module/core/regular/logical_and.hpp>
#include <eve/module/core/regular/logical_or.hpp>
#include <eve/module/core/regular/minimum.hpp>
#include <eve/module/core/regular/maximum.hpp>
#include <eve/module/core/regular/splat.hpp>
#include <eve/module/core/regular/plus.hpp>
#include <eve/module/core/regular/add.hpp>
#include <eve/module/core/regular/any.hpp>
#include <eve/module/core/regular/all.hpp>
namespace eve::detail
{
//================================================================================================
// Find the proper callable if optimization is doable, else return a generic call
template<typename Callable, typename Option = int>
EVE_FORCEINLINE auto find_reduction( Callable f, Option = 0) noexcept
{
if constexpr( std::same_as<Callable, callable_plus_> ) return eve::detail::sum;
else if constexpr( std::same_as<Callable, callable_add_> ) return eve::detail::sum;
else if constexpr( std::same_as<Callable, callable_min_> ) return eve::minimum;
else if constexpr( std::same_as<Callable, callable_max_> ) return eve::maximum;
else if constexpr( std::same_as<Callable, callable_logical_and_> ) return eve::all;
else if constexpr( std::same_as<Callable, callable_logical_or_> ) return eve::any;
else if constexpr( std::same_as<Option, splat_type> )
{
return [f]<typename Wide>(splat_type const&, Wide v) { return butterfly_reduction(v,f); };
}
else
{
return [f]<typename Wide>(Wide v) { return butterfly_reduction(v,f).get(0); };
}
}
template<scalar_value T, typename N, typename Callable>
EVE_FORCEINLINE auto reduce_( EVE_SUPPORTS(cpu_), splat_type const& s
, wide<T,N> v, Callable f
) noexcept
{
auto op = find_reduction(f,s);
return op(s, v);
}
template<scalar_value T, typename N, typename Callable>
EVE_FORCEINLINE auto reduce_(EVE_SUPPORTS(cpu_), wide<T,N> v, Callable f) noexcept
{
auto op = find_reduction(f);
return op(v);
}
template<scalar_value T, typename N>
EVE_FORCEINLINE auto reduce_( EVE_SUPPORTS(cpu_), splat_type const& s, wide<T,N> v ) noexcept
{
return eve::detail::sum(s, v);
}
template<scalar_value T, typename N>
EVE_FORCEINLINE auto reduce_(EVE_SUPPORTS(cpu_), wide<T,N> v) noexcept
{
return eve::detail::sum(v);
}
template<scalar_value T, typename N, typename Callable>
EVE_FORCEINLINE auto reduce_(EVE_SUPPORTS(cpu_), logical<wide<T,N>> v, Callable f) noexcept
{
auto op = find_reduction(f);
return op(v);
}
}
| 38.313253 | 100 | 0.628931 |
105cab27d49365dbaf757988f845fbdbf7e5449c | 9,785 | cc | C++ | chrome/utility/importer/edge_database_reader_win.cc | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | chrome/utility/importer/edge_database_reader_win.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | chrome/utility/importer/edge_database_reader_win.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | // Copyright 2015 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/utility/importer/edge_database_reader_win.h"
#include <windows.h>
#include <stddef.h>
#include <stdint.h>
#include <vector>
namespace {
// This is an arbitary size chosen for the database error message buffer.
const size_t kErrorMessageSize = 1024;
// This is the page size of the Edge data. It's unlikely to change.
const JET_API_PTR kEdgeDatabasePageSize = 8192;
// This is the code page value for a Unicode (UCS-2) column.
const unsigned short kJetUnicodeCodePage = 1200;
template <typename T>
bool ValidateAndConvertValueGeneric(const JET_COLTYP match_column_type,
const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
T* value) {
if ((column_type == match_column_type) && (column_data.size() == sizeof(T))) {
memcpy(value, &column_data[0], sizeof(T));
return true;
}
return false;
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
bool* value) {
if ((column_type == JET_coltypBit) && (column_data.size() == 1)) {
*value = (column_data[0] & 1) == 1;
return true;
}
return false;
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
base::string16* value) {
if ((column_type == JET_coltypLongText) &&
((column_data.size() % sizeof(base::char16)) == 0)) {
base::string16& value_ref = *value;
size_t char_length = column_data.size() / sizeof(base::char16);
value_ref.resize(char_length);
memcpy(&value_ref[0], &column_data[0], column_data.size());
// Remove any trailing NUL characters.
while (char_length > 0) {
if (value_ref[char_length - 1])
break;
char_length--;
}
value_ref.resize(char_length);
return true;
}
return false;
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
GUID* value) {
return ValidateAndConvertValueGeneric(JET_coltypGUID, column_type,
column_data, value);
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
int32_t* value) {
return ValidateAndConvertValueGeneric(JET_coltypLong, column_type,
column_data, value);
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
int64_t* value) {
return ValidateAndConvertValueGeneric(JET_coltypLongLong, column_type,
column_data, value);
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
FILETIME* value) {
return ValidateAndConvertValueGeneric(JET_coltypLongLong, column_type,
column_data, value);
}
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
uint32_t* value) {
return ValidateAndConvertValueGeneric(JET_coltypUnsignedLong, column_type,
column_data, value);
}
} // namespace
base::string16 EdgeErrorObject::GetErrorMessage() const {
WCHAR error_message[kErrorMessageSize] = {};
JET_API_PTR err = last_error_;
JET_ERR result = JetGetSystemParameter(JET_instanceNil, JET_sesidNil,
JET_paramErrorToString, &err,
error_message, sizeof(error_message));
if (result != JET_errSuccess)
return L"";
return error_message;
}
bool EdgeErrorObject::SetLastError(JET_ERR error) {
last_error_ = error;
return error == JET_errSuccess;
}
EdgeDatabaseTableEnumerator::EdgeDatabaseTableEnumerator(
const base::string16& table_name,
JET_SESID session_id,
JET_TABLEID table_id)
: table_id_(table_id), table_name_(table_name), session_id_(session_id) {}
EdgeDatabaseTableEnumerator::~EdgeDatabaseTableEnumerator() {
if (table_id_ != JET_tableidNil)
JetCloseTable(session_id_, table_id_);
}
bool EdgeDatabaseTableEnumerator::Reset() {
return SetLastError(JetMove(session_id_, table_id_, JET_MoveFirst, 0));
}
bool EdgeDatabaseTableEnumerator::Next() {
return SetLastError(JetMove(session_id_, table_id_, JET_MoveNext, 0));
}
template <typename T>
bool EdgeDatabaseTableEnumerator::RetrieveColumn(
const base::string16& column_name,
T* value) {
const JET_COLUMNBASE& column_base = GetColumnByName(column_name);
if (column_base.cbMax == 0) {
SetLastError(JET_errColumnNotFound);
return false;
}
if (column_base.coltyp == JET_coltypLongText &&
column_base.cp != kJetUnicodeCodePage) {
SetLastError(JET_errInvalidColumnType);
return false;
}
std::vector<uint8_t> column_data(column_base.cbMax);
unsigned long actual_size = 0;
JET_ERR err = JetRetrieveColumn(session_id_, table_id_, column_base.columnid,
&column_data[0], column_data.size(),
&actual_size, 0, nullptr);
SetLastError(err);
if (err != JET_errSuccess && err != JET_wrnColumnNull) {
return false;
}
if (err == JET_errSuccess) {
column_data.resize(actual_size);
if (!ValidateAndConvertValue(column_base.coltyp, column_data, value)) {
SetLastError(JET_errInvalidColumnType);
return false;
}
} else {
*value = T();
}
return true;
}
// Explicitly instantiate implementations of RetrieveColumn for various types.
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
bool*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
FILETIME*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
GUID*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
int32_t*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
int64_t*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
base::string16*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const base::string16&,
uint32_t*);
const JET_COLUMNBASE& EdgeDatabaseTableEnumerator::GetColumnByName(
const base::string16& column_name) {
auto found_col = columns_by_name_.find(column_name);
if (found_col == columns_by_name_.end()) {
JET_COLUMNBASE column_base = {};
column_base.cbStruct = sizeof(JET_COLUMNBASE);
if (!SetLastError(JetGetTableColumnInfo(
session_id_, table_id_, column_name.c_str(), &column_base,
sizeof(column_base), JET_ColInfoBase))) {
// 0 indicates an invalid column.
column_base.cbMax = 0;
}
columns_by_name_[column_name] = column_base;
found_col = columns_by_name_.find(column_name);
}
return found_col->second;
}
EdgeDatabaseReader::~EdgeDatabaseReader() {
// We don't need to collect other ID handles, terminating instance
// is enough to shut the entire session down.
if (instance_id_ != JET_instanceNil)
JetTerm(instance_id_);
}
bool EdgeDatabaseReader::OpenDatabase(const base::string16& database_file) {
if (IsOpen()) {
SetLastError(JET_errOneDatabasePerSession);
return false;
}
if (!SetLastError(JetSetSystemParameter(nullptr, JET_sesidNil,
JET_paramDatabasePageSize,
kEdgeDatabasePageSize, nullptr)))
return false;
if (!SetLastError(JetCreateInstance(&instance_id_, L"EdgeDataImporter")))
return false;
if (!SetLastError(JetSetSystemParameter(&instance_id_, JET_sesidNil,
JET_paramRecovery, 0, L"Off")))
return false;
if (!SetLastError(JetInit(&instance_id_)))
return false;
if (!SetLastError(
JetBeginSession(instance_id_, &session_id_, nullptr, nullptr)))
return false;
if (!SetLastError(JetAttachDatabase2(session_id_, database_file.c_str(), 0,
JET_bitDbReadOnly)))
return false;
if (!SetLastError(JetOpenDatabase(session_id_, database_file.c_str(), nullptr,
&db_id_, JET_bitDbReadOnly)))
return false;
return true;
}
std::unique_ptr<EdgeDatabaseTableEnumerator>
EdgeDatabaseReader::OpenTableEnumerator(const base::string16& table_name) {
JET_TABLEID table_id;
if (!IsOpen()) {
SetLastError(JET_errDatabaseNotFound);
return nullptr;
}
if (!SetLastError(JetOpenTable(session_id_, db_id_, table_name.c_str(),
nullptr, 0, JET_bitTableReadOnly, &table_id)))
return nullptr;
return std::make_unique<EdgeDatabaseTableEnumerator>(table_name, session_id_,
table_id);
}
| 37.490421 | 80 | 0.633112 |
105e8a8c8849240134205cbad4b48cc321374235 | 3,738 | cpp | C++ | src/eigensolve.cpp | norlab-ulaval/wmrde | 69e1f20bedd9c145878d44dbe17b3de405696fe3 | [
"BSD-2-Clause"
] | 18 | 2015-05-09T21:53:43.000Z | 2021-12-01T07:52:09.000Z | src/eigensolve.cpp | norlab-ulaval/wmrde | 69e1f20bedd9c145878d44dbe17b3de405696fe3 | [
"BSD-2-Clause"
] | 5 | 2016-05-29T09:02:09.000Z | 2021-05-07T16:36:38.000Z | src/eigensolve.cpp | norlab-ulaval/wmrde | 69e1f20bedd9c145878d44dbe17b3de405696fe3 | [
"BSD-2-Clause"
] | 11 | 2016-07-15T16:46:51.000Z | 2022-03-14T13:11:22.000Z | #include <wmrde/eigensolve.h>
void eigenSolveDynamic( const int nrows, const int ncols, Real* A, Real* b, Real* x ) {
Eigen::Map<MatrixXr> A_(A,nrows,ncols);
Eigen::Map<MatrixXr> b_(b,nrows,1);
Eigen::Map<MatrixXr> x_(x,ncols,1);
if ( nrows == ncols ) {
x_ = A_.llt().solve(b_); //requires positive definite
} else {
x_ = A_.householderQr().solve(b_);
}
}
void eigenSolveFixed( const int nrows, const int ncols, Real* A, Real* b, Real* x ) {
#ifdef FIXED_NROWS_0
if (FIXED_NROWS_0 == nrows && FIXED_NCOLS_0 == ncols) {
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_0,FIXED_NCOLS_0>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_0,1>> b_(b);
Eigen::Map<Eigen::Matrix<Real,FIXED_NCOLS_0,1>> x_(x);
#if FIXED_NROWS_0 == FIXED_NCOLS_0
x_ = A_.llt().solve(b_);
#else
x_ = A_.householderQr().solve(b_);
#endif
return;
}
#endif
#ifdef FIXED_NROWS_1
if (FIXED_NROWS_1 == nrows && FIXED_NCOLS_1 == ncols) {
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_1,FIXED_NCOLS_1>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_1,1>> b_(b);
Eigen::Map<Eigen::Matrix<Real,FIXED_NCOLS_1,1>> x_(x);
#if FIXED_NROWS_1 == FIXED_NCOLS_1
x_ = A_.llt().solve(b_);
#else
x_ = A_.householderQr().solve(b_);
#endif
return;
}
#endif
#ifdef FIXED_NROWS_2
if (FIXED_NROWS_2 == nrows && FIXED_NCOLS_2 == ncols) {
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_2,FIXED_NCOLS_2>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_2,1>> b_(b);
Eigen::Map<Eigen::Matrix<Real,FIXED_NCOLS_2,1>> x_(x);
#if FIXED_NROWS_2 == FIXED_NCOLS_2
x_ = A_.llt().solve(b_);
#else
x_ = A_.householderQr().solve(b_);
#endif
return;
}
#endif
#ifdef FIXED_NROWS_3
if (FIXED_NROWS_3 == nrows && FIXED_NCOLS_3 == ncols) {
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_3,FIXED_NCOLS_3>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_NROWS_3,1>> b_(b);
Eigen::Map<Eigen::Matrix<Real,FIXED_NCOLS_3,1>> x_(x);
#if FIXED_NROWS_3 == FIXED_NCOLS_3
x_ = A_.llt().solve(b_);
#else
x_ = A_.householderQr().solve(b_);
#endif
return;
}
#endif
#if PRINT_MATRIX_SIZE_IF_DYNAMIC
std::cout << "resorting to eigenSolveDynamic, nrows = " << nrows << ", ncols = " << ncols << std::endl;
#endif
eigenSolveDynamic(nrows, ncols, A, b, x); //fail safe
}
//Cholesky decomposition
bool eigenCholDynamic( const int n, Real* A, Real* L) {
Eigen::Map<MatrixXr> A_(A,n,n);
Eigen::Map<MatrixXr> L_(L,n,n);
// L_ = A_.llt().matrixL();
Eigen::LLT<MatrixXr> A_llt(A_);
L_ = A_llt.matrixL();
return A_llt.info() == Eigen::Success;
}
bool eigenCholFixed( const int n, Real* A, Real* L) {
#ifdef FIXED_N_0
if (FIXED_N_0 == n) {
Eigen::Map<Eigen::Matrix<Real,FIXED_N_0,FIXED_N_0>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_N_0,FIXED_N_0>> L_(L);
// L_ = A_.llt().matrixL();
Eigen::LLT<Eigen::Matrix<Real,FIXED_N_0,FIXED_N_0>> A_llt(A_);
L_ = A_llt.matrixL();
return A_llt.info() == Eigen::Success;
}
#endif
#ifdef FIXED_N_1
if (FIXED_N_1 == n) {
Eigen::Map<Eigen::Matrix<Real,FIXED_N_1,FIXED_N_1>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_N_1,FIXED_N_1>> L_(L);
// L_ = A_.llt().matrixL();
Eigen::LLT<Eigen::Matrix<Real,FIXED_N_1,FIXED_N_1>> A_llt(A_);
L_ = A_llt.matrixL();
return A_llt.info() == Eigen::Success;
}
#endif
#ifdef FIXED_N_2
if (FIXED_N_2 == n) {
Eigen::Map<Eigen::Matrix<Real,FIXED_N_2,FIXED_N_2>> A_(A);
Eigen::Map<Eigen::Matrix<Real,FIXED_N_2,FIXED_N_2>> L_(L);
// L_ = A_.llt().matrixL();
Eigen::LLT<Eigen::Matrix<Real,FIXED_N_2,FIXED_N_2>> A_llt(A_);
L_ = A_llt.matrixL();
return A_llt.info() == Eigen::Success;
}
#endif
#if PRINT_MATRIX_SIZE_IF_DYNAMIC
std::cout << "resorting to eigenCholDynamic, n = " << n << std::endl;
#endif
return eigenCholDynamic(n,A,L); //fail safe
}
| 26.892086 | 104 | 0.67603 |
105eae46a93cf2dfed9c56935880b1b46319e7b6 | 827 | cpp | C++ | src/StillDataTask.cpp | stefunkk/openstill | 17cc439fe9dbe7dea02588d77e51652fc1cc50ce | [
"MIT"
] | 1 | 2021-02-13T08:40:50.000Z | 2021-02-13T08:40:50.000Z | src/StillDataTask.cpp | stefunkk/openstill | 17cc439fe9dbe7dea02588d77e51652fc1cc50ce | [
"MIT"
] | null | null | null | src/StillDataTask.cpp | stefunkk/openstill | 17cc439fe9dbe7dea02588d77e51652fc1cc50ce | [
"MIT"
] | null | null | null | #include "StillDataTask.h"
StillDataTaskClass::StillDataTaskClass(StillDataContextClass &context, FileServiceClass &fileService, SensorDataClass &data, SettingsClass &settings) : _settings(settings), _data(data), _fileService(fileService), _context(context)
{
}
void StillDataTaskClass::exec()
{
if (_context.clearCsv)
{
_fileService.removeFile(_fileName);
_context.clearCsv = false;
}
char csvEntry[100];
sprintf(csvEntry, "%i;%.2f;%.2f;%.2f;%.2f;%i; %\n", (int)(millis()/1000) ,(float)_data.shelf10, (float)_data.header, (float)_data.tank, (float)_data.water, (int)_settings.percentagePower);
_fileService.saveFile(_fileName, csvEntry);
}
uint32_t StillDataTaskClass::timeOfNextCheck()
{
setTriggered(true);
return millisToMicros(_settings.csvTimeFrameInSeconds * 1000);
}
| 33.08 | 230 | 0.729141 |
105ebb36a30368684c583ffef1020750b09a6c59 | 3,176 | cc | C++ | gazebo/rendering/Grid_TEST.cc | traversaro/gazebo | 6fd426b3949c4ca73fa126cde68f5cc4a59522eb | [
"ECL-2.0",
"Apache-2.0"
] | 887 | 2020-04-18T08:43:06.000Z | 2022-03-31T11:58:50.000Z | gazebo/rendering/Grid_TEST.cc | traversaro/gazebo | 6fd426b3949c4ca73fa126cde68f5cc4a59522eb | [
"ECL-2.0",
"Apache-2.0"
] | 462 | 2020-04-21T21:59:19.000Z | 2022-03-31T23:23:21.000Z | gazebo/rendering/Grid_TEST.cc | traversaro/gazebo | 6fd426b3949c4ca73fa126cde68f5cc4a59522eb | [
"ECL-2.0",
"Apache-2.0"
] | 421 | 2020-04-21T09:13:03.000Z | 2022-03-30T02:22:01.000Z | /*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <gtest/gtest.h>
#include "gazebo/rendering/RenderingIface.hh"
#include "gazebo/rendering/Scene.hh"
#include "gazebo/rendering/Grid.hh"
#include "gazebo/test/ServerFixture.hh"
using namespace gazebo;
class Grid_TEST : public RenderingFixture
{
};
//////////////////////////////////////////////////
TEST_F(Grid_TEST, SetSize)
{
this->Load("worlds/empty.world");
auto scene = gazebo::rendering::get_scene("default");
if (!scene)
scene = gazebo::rendering::create_scene("default", false);
EXPECT_TRUE(scene != nullptr);
// Create a grid
int cellCount = 10;
float cellLength = 1;
auto grid = new gazebo::rendering::Grid(scene.get(), cellCount, cellLength,
ignition::math::Color::Red);
ASSERT_TRUE(grid != nullptr);
grid->Init();
// Get scene node and manual object
rendering::VisualPtr vis = grid->GridVisual();
ASSERT_TRUE(vis != nullptr);
auto sceneNode = vis->GetSceneNode();
ASSERT_TRUE(sceneNode != nullptr);
EXPECT_EQ(sceneNode->numAttachedObjects(), 1u);
auto manualObject = sceneNode->getAttachedObject(0);
ASSERT_TRUE(manualObject != nullptr);
// Check size
EXPECT_EQ(manualObject->getBoundingBox(),
Ogre::AxisAlignedBox(-cellCount * cellLength / 2,
-cellCount * cellLength / 2,
0.015,
cellCount * cellLength / 2,
cellCount * cellLength / 2,
0.015));
// Various sizes
std::vector<int> cellCountList = {1, 33, 100, 40};
std::vector<float> cellLengthList = {0.001, 0.4, 9.3, 1000};
for (auto count : cellCountList)
{
grid->SetCellCount(count);
for (auto length : cellLengthList)
{
grid->SetCellLength(length);
gzmsg << "Checking count [" << count << "] length [" << length << "]"
<< std::endl;
// Check size
const Ogre::AxisAlignedBox &box = manualObject->getBoundingBox();
const Ogre::Vector3 &actualMin = box.getMinimum();
const Ogre::Vector3 &actualMax = box.getMaximum();
Ogre::Vector3 expectedMin(-count * length / 2,
-count * length / 2, 0.015);
Ogre::Vector3 expectedMax(count * length / 2, count * length / 2, 0.015);
EXPECT_TRUE(actualMin.positionEquals(expectedMin));
EXPECT_TRUE(actualMax.positionEquals(expectedMax));
}
}
delete grid;
}
/////////////////////////////////////////////////
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| 30.538462 | 79 | 0.628463 |
105edc5729ebb32360624ec4625447ed5f1c6029 | 1,303 | cxx | C++ | VTK/Common/vtkTensor.cxx | certik/paraview | 973d37b466552ce770ac0674f30040bb7e31d7fe | [
"BSD-3-Clause"
] | 1 | 2016-05-09T00:36:44.000Z | 2016-05-09T00:36:44.000Z | VTK/Common/vtkTensor.cxx | certik/paraview | 973d37b466552ce770ac0674f30040bb7e31d7fe | [
"BSD-3-Clause"
] | null | null | null | VTK/Common/vtkTensor.cxx | certik/paraview | 973d37b466552ce770ac0674f30040bb7e31d7fe | [
"BSD-3-Clause"
] | 3 | 2015-05-14T21:18:53.000Z | 2022-03-07T02:53:45.000Z | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkTensor.cxx,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkTensor.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkTensor, "$Revision: 1.15 $");
vtkStandardNewMacro(vtkTensor);
// Construct tensor initially pointing to internal storage.
vtkTensor::vtkTensor()
{
this->T = this->Storage;
for (int j=0; j<3; j++)
{
for (int i=0; i<3; i++)
{
this->T[i+j*3] = 0.0;
}
}
}
//----------------------------------------------------------------------------
void vtkTensor::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
for (int j=0; j<3; j++)
{
os << indent;
for (int i=0; i<3; i++)
{
os << this->Storage[i+j*3] << " ";
}
os << "\n";
}
}
| 26.591837 | 78 | 0.523408 |