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
109
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
sequencelengths 1
9
| max_stars_count
int64 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
sequencelengths 1
9
| max_issues_count
int64 1
48.5k
⌀ | 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
sequencelengths 1
9
| max_forks_count
int64 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
330k
| max_line_length
int64 6
990k
| alphanum_fraction
float64 0.01
0.99
| author_id
stringlengths 2
40
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f666731692c1409b15ae70912db29faa51c966a4 | 5,634 | cpp | C++ | MonoNative/mscorlib/System/Security/Permissions/mscorlib_System_Security_Permissions_StrongNameIdentityPermissionAttribute.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 7 | 2015-03-10T03:36:16.000Z | 2021-11-05T01:16:58.000Z | MonoNative/mscorlib/System/Security/Permissions/mscorlib_System_Security_Permissions_StrongNameIdentityPermissionAttribute.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | 1 | 2020-06-23T10:02:33.000Z | 2020-06-24T02:05:47.000Z | MonoNative/mscorlib/System/Security/Permissions/mscorlib_System_Security_Permissions_StrongNameIdentityPermissionAttribute.cpp | brunolauze/MonoNative | 959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66 | [
"BSD-2-Clause"
] | null | null | null | #include <mscorlib/System/Security/Permissions/mscorlib_System_Security_Permissions_StrongNameIdentityPermissionAttribute.h>
#include <mscorlib/System/mscorlib_System_String.h>
#include <mscorlib/System/mscorlib_System_Type.h>
namespace mscorlib
{
namespace System
{
namespace Security
{
namespace Permissions
{
//Public Methods
mscorlib::System::Security::IPermission StrongNameIdentityPermissionAttribute::CreatePermission()
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "CreatePermission", __native_object__, 0, NULL, NULL, NULL);
return mscorlib::System::Security::IPermission(__result__);
}
//Get Set Properties Methods
// Get/Set:Name
mscorlib::System::String StrongNameIdentityPermissionAttribute::get_Name() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "get_Name", __native_object__, 0, NULL, NULL, NULL);
return mscorlib::System::String(__result__);
}
void StrongNameIdentityPermissionAttribute::set_Name(mscorlib::System::String value)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType(typeid(value).name());
__parameters__[0] = (MonoObject*)value;
Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "set_Name", __native_object__, 1, __parameter_types__, __parameters__, NULL);
}
// Get/Set:PublicKey
mscorlib::System::String StrongNameIdentityPermissionAttribute::get_PublicKey() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "get_PublicKey", __native_object__, 0, NULL, NULL, NULL);
return mscorlib::System::String(__result__);
}
void StrongNameIdentityPermissionAttribute::set_PublicKey(mscorlib::System::String value)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType(typeid(value).name());
__parameters__[0] = (MonoObject*)value;
Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "set_PublicKey", __native_object__, 1, __parameter_types__, __parameters__, NULL);
}
// Get/Set:Version
mscorlib::System::String StrongNameIdentityPermissionAttribute::get_Version() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "get_Version", __native_object__, 0, NULL, NULL, NULL);
return mscorlib::System::String(__result__);
}
void StrongNameIdentityPermissionAttribute::set_Version(mscorlib::System::String value)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType(typeid(value).name());
__parameters__[0] = (MonoObject*)value;
Global::InvokeMethod("mscorlib", "System.Security.Permissions", "StrongNameIdentityPermissionAttribute", 0, NULL, "set_Version", __native_object__, 1, __parameter_types__, __parameters__, NULL);
}
// Get/Set:Unrestricted
mscorlib::System::Boolean StrongNameIdentityPermissionAttribute::get_Unrestricted() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "SecurityAttribute", 0, NULL, "get_Unrestricted", __native_object__, 0, NULL, NULL, NULL);
return *(mscorlib::System::Boolean*)mono_object_unbox(__result__);
}
void StrongNameIdentityPermissionAttribute::set_Unrestricted(mscorlib::System::Boolean value)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType(typeid(value).name());
__parameters__[0] = reinterpret_cast<void*>(value);
Global::InvokeMethod("mscorlib", "System.Security.Permissions", "SecurityAttribute", 0, NULL, "set_Unrestricted", __native_object__, 1, __parameter_types__, __parameters__, NULL);
}
// Get/Set:Action
mscorlib::System::Security::Permissions::SecurityAction::__ENUM__ StrongNameIdentityPermissionAttribute::get_Action() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Security.Permissions", "SecurityAttribute", 0, NULL, "get_Action", __native_object__, 0, NULL, NULL, NULL);
return static_cast<mscorlib::System::Security::Permissions::SecurityAction::__ENUM__>(*(mscorlib::System::Int32*)mono_object_unbox(__result__));
}
void StrongNameIdentityPermissionAttribute::set_Action(mscorlib::System::Security::Permissions::SecurityAction::__ENUM__ value)
{
MonoType *__parameter_types__[1];
void *__parameters__[1];
__parameter_types__[0] = Global::GetType(typeid(value).name());
mscorlib::System::Int32 __param_value__ = value;
__parameters__[0] = &__param_value__;
Global::InvokeMethod("mscorlib", "System.Security.Permissions", "SecurityAttribute", 0, NULL, "set_Action", __native_object__, 1, __parameter_types__, __parameters__, NULL);
}
// Get:TypeId
mscorlib::System::Object StrongNameIdentityPermissionAttribute::get_TypeId() const
{
MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System", "Attribute", 0, NULL, "get_TypeId", __native_object__, 0, NULL, NULL, NULL);
return mscorlib::System::Object(__result__);
}
}
}
}
}
| 45.804878 | 205 | 0.739084 | brunolauze |
f6667fc5ddf352b78ed6ee9132a338f7719e614e | 514 | cpp | C++ | ObjectOrientedProgramming/AccountClassInheritance/Checking_Account.cpp | Sebery/CPP-Practice-Projects | cf200e7753be79d13042f9f9de666d25c8215d69 | [
"MIT"
] | null | null | null | ObjectOrientedProgramming/AccountClassInheritance/Checking_Account.cpp | Sebery/CPP-Practice-Projects | cf200e7753be79d13042f9f9de666d25c8215d69 | [
"MIT"
] | null | null | null | ObjectOrientedProgramming/AccountClassInheritance/Checking_Account.cpp | Sebery/CPP-Practice-Projects | cf200e7753be79d13042f9f9de666d25c8215d69 | [
"MIT"
] | null | null | null | //
// Created by Sebastian on 26/11/2020.
//
#include "Checking_Account.h"
Checking_Account::Checking_Account(std::string name, double balance, double fee)
: Account{name, balance}, fee{fee} {
}
bool Checking_Account::withdraw(double amount) {
amount += fee;
return Account::withdraw(amount);
}
std::ostream &operator<<(std::ostream &os, const Checking_Account &account) {
os << "[Checking_Account: " << account.name << " : " << account.balance << ", " << account.fee << "]";
return os;
} | 24.47619 | 106 | 0.657588 | Sebery |
f667edd2ca9cdb9cf27bf08d14221b03df07d2b6 | 1,873 | hpp | C++ | data-struct/other/SlidingWindowAggregation.hpp | shiomusubi496/library | 907f72eb6ee4ac6ef617bb359693588167f779e7 | [
"MIT"
] | 3 | 2021-11-04T08:45:12.000Z | 2021-11-29T08:44:26.000Z | data-struct/other/SlidingWindowAggregation.hpp | shiomusubi496/library | 907f72eb6ee4ac6ef617bb359693588167f779e7 | [
"MIT"
] | null | null | null | data-struct/other/SlidingWindowAggregation.hpp | shiomusubi496/library | 907f72eb6ee4ac6ef617bb359693588167f779e7 | [
"MIT"
] | null | null | null | #pragma once
#include "../../other/template.hpp"
#include "../../other/monoid.hpp"
template<class M> class SlidingWindowAggregation {
protected:
using T = typename M::value_type;
std::stack<T> lst, rst;
std::stack<T> lsm, rsm;
T internal_all_prod() const {
assert(!empty());
if (lst.empty()) return rsm.top();
if (rst.empty()) return lsm.top();
return M::op(lsm.top(), rsm.top());
}
public:
SlidingWindowAggregation() = default;
int size() const {
return lst.size() + rst.size();
}
bool empty() const {
return lst.empty() && rst.empty();
}
void push(const T& x) {
rst.push(x);
if (rsm.empty()) rsm.push(rst.top());
else rsm.push(M::op(rsm.top(), rst.top()));
}
template<class... Args> void emplace(Args&&... args) {
rst.emplace(std::forward<Args>(args)...);
if (rsm.empty()) rsm.push(rst.top());
else rsm.push(M::op(rsm.top(), rst.top()));
}
void pop() {
assert(!empty());
if (lst.empty()) {
lst.push(rst.top()); lsm.push(rst.top());
rst.pop(); rsm.pop();
while (!rst.empty()) {
lst.push(rst.top()); lsm.push(M::op(rst.top(), lsm.top()));
rst.pop(); rsm.pop();
}
}
lst.pop(); lsm.pop();
}
template<bool AlwaysTrue = true, typename std::enable_if< Monoid::has_id<M>::value && AlwaysTrue>::type* = nullptr>
T all_prod() const {
if (empty()) return M::id();
return internal_all_prod();
}
template<bool AlwaysTrue = true, typename std::enable_if<!Monoid::has_id<M>::value && AlwaysTrue>::type* = nullptr>
T all_prod() const {
return internal_all_prod();
}
};
/**
* @brief SlidingWindowAggregation(SWAG)
* @docs docs/SlidingWindowAggregation.md
*/
| 30.209677 | 119 | 0.541911 | shiomusubi496 |
f66843733c8f31723fce47e76a0304a614a1f610 | 11,924 | hpp | C++ | master/core/third/boost/geometry/algorithms/detail/assign_values.hpp | importlib/klib | a59837857689d0e60d3df6d2ebd12c3160efa794 | [
"MIT"
] | 198 | 2015-01-13T05:47:18.000Z | 2022-03-09T04:46:46.000Z | master/core/third/boost/geometry/algorithms/detail/assign_values.hpp | isuhao/klib | a59837857689d0e60d3df6d2ebd12c3160efa794 | [
"MIT"
] | 197 | 2017-07-06T16:53:59.000Z | 2019-05-31T17:57:51.000Z | master/core/third/boost/geometry/algorithms/detail/assign_values.hpp | isuhao/klib | a59837857689d0e60d3df6d2ebd12c3160efa794 | [
"MIT"
] | 139 | 2015-01-15T20:09:31.000Z | 2022-01-31T15:21:16.000Z | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
// Use, modification and distribution is 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_GEOMETRY_ALGORITHMS_ASSIGN_VALUES_HPP
#define BOOST_GEOMETRY_ALGORITHMS_ASSIGN_VALUES_HPP
#include <cstddef>
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/algorithms/append.hpp>
#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/for_each_coordinate.hpp>
namespace boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace assign
{
template
<
typename Box, std::size_t Index,
std::size_t Dimension, std::size_t DimensionCount
>
struct initialize
{
typedef typename coordinate_type<Box>::type coordinate_type;
static inline void apply(Box& box, coordinate_type const& value)
{
geometry::set<Index, Dimension>(box, value);
initialize<Box, Index, Dimension + 1, DimensionCount>::apply(box, value);
}
};
template <typename Box, std::size_t Index, std::size_t DimensionCount>
struct initialize<Box, Index, DimensionCount, DimensionCount>
{
typedef typename coordinate_type<Box>::type coordinate_type;
static inline void apply(Box&, coordinate_type const& )
{}
};
template <typename Point>
struct assign_zero_point
{
static inline void apply(Point& point)
{
geometry::assign_value(point, 0);
}
};
template <typename BoxOrSegment>
struct assign_inverse_box_or_segment
{
typedef typename point_type<BoxOrSegment>::type point_type;
static inline void apply(BoxOrSegment& geometry)
{
typedef typename coordinate_type<point_type>::type bound_type;
initialize
<
BoxOrSegment, 0, 0, dimension<BoxOrSegment>::type::value
>::apply(
geometry, boost::numeric::bounds<bound_type>::highest());
initialize
<
BoxOrSegment, 1, 0, dimension<BoxOrSegment>::type::value
>::apply(
geometry, boost::numeric::bounds<bound_type>::lowest());
}
};
template <typename BoxOrSegment>
struct assign_zero_box_or_segment
{
static inline void apply(BoxOrSegment& geometry)
{
typedef typename coordinate_type<BoxOrSegment>::type coordinate_type;
initialize
<
BoxOrSegment, 0, 0, dimension<BoxOrSegment>::type::value
>::apply(geometry, coordinate_type());
initialize
<
BoxOrSegment, 1, 0, dimension<BoxOrSegment>::type::value
>::apply(geometry, coordinate_type());
}
};
template
<
std::size_t Corner1, std::size_t Corner2,
typename Box, typename Point
>
inline void assign_box_2d_corner(Box const& box, Point& point)
{
// Be sure both are 2-Dimensional
assert_dimension<Box, 2>();
assert_dimension<Point, 2>();
// Copy coordinates
typedef typename coordinate_type<Point>::type coordinate_type;
geometry::set<0>(point, boost::numeric_cast<coordinate_type>(get<Corner1, 0>(box)));
geometry::set<1>(point, boost::numeric_cast<coordinate_type>(get<Corner2, 1>(box)));
}
template
<
typename Geometry, typename Point,
std::size_t Index,
std::size_t Dimension, std::size_t DimensionCount
>
struct assign_point_to_index
{
static inline void apply(Point const& point, Geometry& geometry)
{
geometry::set<Index, Dimension>(geometry, boost::numeric_cast
<
typename coordinate_type<Geometry>::type
>(geometry::get<Dimension>(point)));
assign_point_to_index
<
Geometry, Point, Index, Dimension + 1, DimensionCount
>::apply(point, geometry);
}
};
template
<
typename Geometry, typename Point,
std::size_t Index,
std::size_t DimensionCount
>
struct assign_point_to_index
<
Geometry, Point,
Index,
DimensionCount, DimensionCount
>
{
static inline void apply(Point const& , Geometry& )
{
}
};
template
<
typename Geometry, typename Point,
std::size_t Index,
std::size_t Dimension, std::size_t DimensionCount
>
struct assign_point_from_index
{
static inline void apply(Geometry const& geometry, Point& point)
{
geometry::set<Dimension>( point, boost::numeric_cast
<
typename coordinate_type<Point>::type
>(geometry::get<Index, Dimension>(geometry)));
assign_point_from_index
<
Geometry, Point, Index, Dimension + 1, DimensionCount
>::apply(geometry, point);
}
};
template
<
typename Geometry, typename Point,
std::size_t Index,
std::size_t DimensionCount
>
struct assign_point_from_index
<
Geometry, Point,
Index,
DimensionCount, DimensionCount
>
{
static inline void apply(Geometry const&, Point&)
{
}
};
template <typename Geometry>
struct assign_2d_box_or_segment
{
typedef typename coordinate_type<Geometry>::type coordinate_type;
// Here we assign 4 coordinates to a box of segment
// -> Most logical is: x1,y1,x2,y2
// In case the user reverses x1/x2 or y1/y2, for a box, we could reverse them (THAT IS NOT IMPLEMENTED)
template <typename Type>
static inline void apply(Geometry& geometry,
Type const& x1, Type const& y1, Type const& x2, Type const& y2)
{
geometry::set<0, 0>(geometry, boost::numeric_cast<coordinate_type>(x1));
geometry::set<0, 1>(geometry, boost::numeric_cast<coordinate_type>(y1));
geometry::set<1, 0>(geometry, boost::numeric_cast<coordinate_type>(x2));
geometry::set<1, 1>(geometry, boost::numeric_cast<coordinate_type>(y2));
}
};
}} // namespace detail::assign
#endif // DOXYGEN_NO_DETAIL
#ifndef DOXYGEN_NO_DISPATCH
namespace dispatch
{
template <typename GeometryTag, typename Geometry, std::size_t DimensionCount>
struct assign
{
BOOST_MPL_ASSERT_MSG
(
false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
, (types<Geometry>)
);
};
template <typename Point>
struct assign<point_tag, Point, 2>
{
typedef typename coordinate_type<Point>::type coordinate_type;
template <typename T>
static inline void apply(Point& point, T const& c1, T const& c2)
{
set<0>(point, boost::numeric_cast<coordinate_type>(c1));
set<1>(point, boost::numeric_cast<coordinate_type>(c2));
}
};
template <typename Point>
struct assign<point_tag, Point, 3>
{
typedef typename coordinate_type<Point>::type coordinate_type;
template <typename T>
static inline void apply(Point& point, T const& c1, T const& c2, T const& c3)
{
set<0>(point, boost::numeric_cast<coordinate_type>(c1));
set<1>(point, boost::numeric_cast<coordinate_type>(c2));
set<2>(point, boost::numeric_cast<coordinate_type>(c3));
}
};
template <typename Box>
struct assign<box_tag, Box, 2>
: detail::assign::assign_2d_box_or_segment<Box>
{};
template <typename Segment>
struct assign<segment_tag, Segment, 2>
: detail::assign::assign_2d_box_or_segment<Segment>
{};
template <typename GeometryTag, typename Geometry>
struct assign_zero {};
template <typename Point>
struct assign_zero<point_tag, Point>
: detail::assign::assign_zero_point<Point>
{};
template <typename Box>
struct assign_zero<box_tag, Box>
: detail::assign::assign_zero_box_or_segment<Box>
{};
template <typename Segment>
struct assign_zero<segment_tag, Segment>
: detail::assign::assign_zero_box_or_segment<Segment>
{};
template <typename GeometryTag, typename Geometry>
struct assign_inverse {};
template <typename Box>
struct assign_inverse<box_tag, Box>
: detail::assign::assign_inverse_box_or_segment<Box>
{};
template <typename Segment>
struct assign_inverse<segment_tag, Segment>
: detail::assign::assign_inverse_box_or_segment<Segment>
{};
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
/*!
\brief Assign two coordinates to a geometry (usually a 2D point)
\ingroup assign
\tparam Geometry \tparam_geometry
\tparam Type \tparam_numeric to specify the coordinates
\param geometry \param_geometry
\param c1 \param_x
\param c2 \param_y
\qbk{distinguish, 2 coordinate values}
\qbk{
[heading Example]
[assign_2d_point] [assign_2d_point_output]
[heading See also]
\* [link geometry.reference.algorithms.make.make_2_2_coordinate_values make]
}
*/
template <typename Geometry, typename Type>
inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2)
{
concept::check<Geometry>();
dispatch::assign
<
typename tag<Geometry>::type,
Geometry,
geometry::dimension<Geometry>::type::value
>::apply(geometry, c1, c2);
}
/*!
\brief Assign three values to a geometry (usually a 3D point)
\ingroup assign
\tparam Geometry \tparam_geometry
\tparam Type \tparam_numeric to specify the coordinates
\param geometry \param_geometry
\param c1 \param_x
\param c2 \param_y
\param c3 \param_z
\qbk{distinguish, 3 coordinate values}
\qbk{
[heading Example]
[assign_3d_point] [assign_3d_point_output]
[heading See also]
\* [link geometry.reference.algorithms.make.make_3_3_coordinate_values make]
}
*/
template <typename Geometry, typename Type>
inline void assign_values(Geometry& geometry,
Type const& c1, Type const& c2, Type const& c3)
{
concept::check<Geometry>();
dispatch::assign
<
typename tag<Geometry>::type,
Geometry,
geometry::dimension<Geometry>::type::value
>::apply(geometry, c1, c2, c3);
}
/*!
\brief Assign four values to a geometry (usually a box or segment)
\ingroup assign
\tparam Geometry \tparam_geometry
\tparam Type \tparam_numeric to specify the coordinates
\param geometry \param_geometry
\param c1 First coordinate (usually x1)
\param c2 Second coordinate (usually y1)
\param c3 Third coordinate (usually x2)
\param c4 Fourth coordinate (usually y2)
\qbk{distinguish, 4 coordinate values}
*/
template <typename Geometry, typename Type>
inline void assign_values(Geometry& geometry,
Type const& c1, Type const& c2, Type const& c3, Type const& c4)
{
concept::check<Geometry>();
dispatch::assign
<
typename tag<Geometry>::type,
Geometry,
geometry::dimension<Geometry>::type::value
>::apply(geometry, c1, c2, c3, c4);
}
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_ASSIGN_VALUES_HPP
| 26.855856 | 108 | 0.666303 | importlib |
f66b0132adc58690de57d30ce814cef2bf34ccec | 33,014 | cpp | C++ | opennurbs_matrix.cpp | averbin/opennurbslib | 8904e11a90d108304f679d233ad1ea2d621dd3b2 | [
"Zlib"
] | 14 | 2015-07-06T13:04:49.000Z | 2022-02-06T10:09:05.000Z | opennurbs_matrix.cpp | averbin/opennurbslib | 8904e11a90d108304f679d233ad1ea2d621dd3b2 | [
"Zlib"
] | 1 | 2020-12-07T03:26:39.000Z | 2020-12-07T03:26:39.000Z | opennurbs_matrix.cpp | averbin/opennurbslib | 8904e11a90d108304f679d233ad1ea2d621dd3b2 | [
"Zlib"
] | 11 | 2015-07-06T13:04:43.000Z | 2022-03-29T10:57:04.000Z | /* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/
#include "opennurbs.h"
// 8 July 2003 Dale Lear
// changed ON_Matrix to use multiple allocations
// for coefficient memory in large matrices.
// ON_Matrix.m_cmem points to a struct DBLBLK
struct DBLBLK
{
int count;
double* a;
struct DBLBLK *next;
};
double const * const * ON_Matrix::ThisM() const
{
// When the "expert" constructor Create(row_count,col_count,user_memory,...)
// is used, m_rowmem[] is empty and m = user_memory;
// When any other constructor is used, m_rowmem[] is the 0-based
// row memory.
return (m_row_count == m_rowmem.Count()) ? m_rowmem.Array() : m;
}
double * * ON_Matrix::ThisM()
{
// When the "expert" constructor Create(row_count,col_count,user_memory,...)
// is used, m_rowmem[] is empty and m = user_memory;
// When any other constructor is used, m_rowmem[] is the 0-based
// row memory.
return (m_row_count == m_rowmem.Count()) ? m_rowmem.Array() : m;
}
double* ON_Matrix::operator[](int i)
{
return m[i];
}
const double* ON_Matrix::operator[](int i) const
{
return m[i];
}
ON_Matrix::ON_Matrix()
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
}
ON_Matrix::ON_Matrix( int row_size, int col_size )
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
Create(row_size,col_size);
}
ON_Matrix::ON_Matrix( int row0, int row1, int col0, int col1 )
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
Create(row0,row1,col0,col1);
}
ON_Matrix::ON_Matrix( const ON_Xform& x )
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
*this = x;
}
ON_Matrix::ON_Matrix( const ON_Matrix& src )
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
*this = src;
}
ON_Matrix::ON_Matrix(
int row_count,
int col_count,
double** M,
bool bDestructorFreeM
)
: m(0)
, m_row_count(0)
, m_col_count(0)
, m_Mmem(0)
, m_row_offset(0)
, m_col_offset(0)
, m_cmem(0)
{
Create(row_count,col_count,M,bDestructorFreeM);
}
ON_Matrix::~ON_Matrix()
{
if ( 0 != m_Mmem )
{
onfree(m_Mmem);
m_Mmem = 0;
}
m_row_offset = 0;
m_col_offset = 0;
struct DBLBLK* p = (struct DBLBLK*)m_cmem;
m_cmem = 0;
while(0 != p)
{
struct DBLBLK* next = p->next;
onfree(p);
p = next;
}
}
int ON_Matrix::RowCount() const
{
return m_row_count;
}
int ON_Matrix::ColCount() const
{
return m_col_count;
}
int ON_Matrix::MinCount() const
{
return (m_row_count <= m_col_count) ? m_row_count : m_col_count;
}
int ON_Matrix::MaxCount() const
{
return (m_row_count >= m_col_count) ? m_row_count : m_col_count;
}
bool ON_Matrix::Create( int row_count, int col_count)
{
bool b = false;
Destroy();
if ( row_count > 0 && col_count > 0 )
{
m_rowmem.Reserve(row_count);
if ( 0 != m_rowmem.Array() )
{
m_rowmem.SetCount(row_count);
// In general, allocate coefficient memory in chunks
// of <= max_dblblk_size bytes. The value of max_dblblk_size
// is tuned to maximize speed on calculations involving
// large matrices. If all of the coefficients will fit
// into a chunk of memory <= 1.1*max_dblblk_size, then
// a single chunk is allocated.
// In limited testing, these two values appeared to work ok.
// The latter was a hair faster in solving large row reduction
// problems (for reasons I do not understand).
//const int max_dblblk_size = 1024*1024*8;
const int max_dblblk_size = 512*1024;
int rows_per_block = max_dblblk_size/(col_count*sizeof(double));
if ( rows_per_block > row_count )
rows_per_block = row_count;
else if ( rows_per_block < 1 )
rows_per_block = 1;
else if ( rows_per_block < row_count && 11*rows_per_block >= 10*row_count )
rows_per_block = row_count;
int j, i = row_count;
m = m_rowmem.Array();
double** row = m;
for ( i = row_count; i > 0; i -= rows_per_block )
{
if ( i < rows_per_block )
rows_per_block = i;
int dblblk_count = rows_per_block*col_count;
struct DBLBLK* p = (struct DBLBLK*)onmalloc(sizeof(*p) + dblblk_count*sizeof(p->a[0]));
p->a = (double*)(p+1);
p->count = dblblk_count;
p->next = (struct DBLBLK*)m_cmem;
m_cmem = p;
*row = p->a;
j = rows_per_block-1;
while(j--)
{
row[1] = row[0] + col_count;
row++;
}
row++;
}
m_row_count = row_count;
m_col_count = col_count;
b = true;
}
}
return b;
}
bool ON_Matrix::Create( // E.g., Create(1,5,1,7) creates a 5x7 sized matrix that with
// "top" row = m[1][1],...,m[1][7] and "bottom" row
// = m[5][1],...,m[5][7]. The result of Create(0,m,0,n) is
// identical to the result of Create(m+1,n+1).
int ri0, // first valid row index
int ri1, // last valid row index
int ci0, // first valid column index
int ci1 // last valid column index
)
{
bool b = false;
if ( ri1 > ri0 && ci1 > ci0 )
{
// juggle m[] pointers so that m[ri0+i][ci0+j] = m_row[i][j];
b = Create( ri1-ri0, ci1-ci0 );
if (b)
{
m_row_offset = ri0; // this is the only line of code where m_row_offset should be set to a non-zero value
m_col_offset = ci0; // this is the only line of code where m_col_offset should be set to a non-zero value
if ( ci0 != 0 )
{
int i;
for ( i = 0; i < m_row_count; i++ ) {
m[i] -= ci0;
}
}
if ( ri0 != 0 )
m -= ri0;
}
}
return b;
}
bool ON_Matrix::Create(
int row_count,
int col_count,
double** M,
bool bDestructorFreeM
)
{
Destroy();
if ( row_count < 1 || col_count < 1 || 0 == M )
return false;
m = M;
m_row_count = row_count;
m_col_count = col_count;
if ( bDestructorFreeM )
m_Mmem = M;
return true;
}
void ON_Matrix::Destroy()
{
m = 0;
m_row_count = 0;
m_col_count = 0;
m_rowmem.SetCount(0);
if ( 0 != m_Mmem )
{
// pointer passed to Create( row_count, col_count, M, bDestructorFreeM )
// when bDestructorFreeM = true.
onfree(m_Mmem);
m_Mmem = 0;
}
m_row_offset = 0;
m_col_offset = 0;
struct DBLBLK* cmem = (struct DBLBLK*)m_cmem;
m_cmem = 0;
while( 0 != cmem )
{
struct DBLBLK* next_cmem = cmem->next;
onfree(cmem);
cmem = next_cmem;
}
}
void ON_Matrix::EmergencyDestroy()
{
// call if memory pool used matrix by becomes invalid
m = 0;
m_row_count = 0;
m_col_count = 0;
m_rowmem.EmergencyDestroy();
m_Mmem = 0;
m_row_offset = 0;
m_col_offset = 0;
m_cmem = 0;
}
ON_Matrix& ON_Matrix::operator=(const ON_Matrix& src)
{
if ( this != &src )
{
if ( src.m_row_count != m_row_count || src.m_col_count != m_col_count || 0 == m )
{
Destroy();
Create( src.RowCount(), src.ColCount() );
}
if (src.m_row_count == m_row_count && src.m_col_count == m_col_count && 0 != m )
{
int i;
// src rows may be permuted - copy row by row
double** m_dest = ThisM();
double const*const* m_src = src.ThisM();
const int sizeof_row = m_col_count*sizeof(m_dest[0][0]);
for ( i = 0; i < m_row_count; i++ )
{
memcpy( m_dest[i], m_src[i], sizeof_row );
}
m_row_offset = src.m_row_offset;
m_col_offset = src.m_col_offset;
}
}
return *this;
}
ON_Matrix& ON_Matrix::operator=(const ON_Xform& src)
{
m_row_offset = 0;
m_col_offset = 0;
if ( 4 != m_row_count || 4 != m_col_count || 0 == m )
{
Destroy();
Create( 4, 4 );
}
if ( 4 == m_row_count && 4 == m_col_count && 0 != m )
{
double** this_m = ThisM();
if ( this_m )
{
memcpy( this_m[0], &src.m_xform[0][0], 4*sizeof(this_m[0][0]) );
memcpy( this_m[1], &src.m_xform[1][0], 4*sizeof(this_m[0][0]) );
memcpy( this_m[2], &src.m_xform[2][0], 4*sizeof(this_m[0][0]) );
memcpy( this_m[3], &src.m_xform[3][0], 4*sizeof(this_m[0][0]) );
}
}
return *this;
}
bool ON_Matrix::Transpose()
{
bool rc = false;
int i, j;
double t;
const int row_count = RowCount();
const int col_count = ColCount();
if ( row_count > 0 && col_count > 0 )
{
double** this_m = ThisM();
if ( row_count == col_count )
{
rc = true;
for ( i = 0; i < row_count; i++ ) for ( j = i+1; j < row_count; j++ )
{
t = this_m[i][j]; this_m[i][j] = this_m[j][i]; this_m[j][i] = t;
}
}
else if ( this_m == m_rowmem.Array() )
{
ON_Matrix A(*this);
rc = Create(col_count,row_count)
&& m_row_count == A.ColCount()
&& m_col_count == A.RowCount();
if (rc)
{
double const*const* Am = A.ThisM();
this_m = ThisM(); // Create allocates new memory
for ( i = 0; i < row_count; i++ ) for ( j = 0; j < col_count; j++ )
{
this_m[j][i] = Am[i][j];
}
m_row_offset = A.m_col_offset;
m_col_offset = A.m_row_offset;
}
else
{
// attempt to put values back
*this = A;
}
}
}
return rc;
}
bool ON_Matrix::SwapRows( int row0, int row1 )
{
bool b = false;
double** this_m = ThisM();
row0 -= m_row_offset;
row1 -= m_row_offset;
if ( this_m && 0 <= row0 && row0 < m_row_count && 0 <= row1 && row1 < m_row_count )
{
if ( row0 != row1 )
{
double* tmp = this_m[row0]; this_m[row0] = this_m[row1]; this_m[row1] = tmp;
}
b = true;
}
return b;
}
bool ON_Matrix::SwapCols( int col0, int col1 )
{
bool b = false;
int i;
double t;
double** this_m = ThisM();
col0 -= m_col_offset;
col1 -= m_col_offset;
if ( this_m && 0 <= col0 && col0 < m_col_count && 0 <= col1 && col1 < m_col_count )
{
if ( col0 != col1 )
{
for ( i = 0; i < m_row_count; i++ )
{
t = this_m[i][col0]; this_m[i][col0] = this_m[i][col1]; this_m[i][col1] = t;
}
}
b = true;
}
return b;
}
void ON_Matrix::RowScale( int dest_row, double s )
{
double** this_m = ThisM();
dest_row -= m_row_offset;
ON_ArrayScale( m_col_count, s, this_m[dest_row], this_m[dest_row] );
}
void ON_Matrix::RowOp( int dest_row, double s, int src_row )
{
double** this_m = ThisM();
dest_row -= m_row_offset;
src_row -= m_row_offset;
ON_Array_aA_plus_B( m_col_count, s, this_m[src_row], this_m[dest_row], this_m[dest_row] );
}
void ON_Matrix::ColScale( int dest_col, double s )
{
int i;
double** this_m = ThisM();
dest_col -= m_col_offset;
for ( i = 0; i < m_row_count; i++ )
{
this_m[i][dest_col] *= s;
}
}
void ON_Matrix::ColOp( int dest_col, double s, int src_col )
{
int i;
double** this_m = ThisM();
dest_col -= m_col_offset;
src_col -= m_col_offset;
for ( i = 0; i < m_row_count; i++ )
{
this_m[i][dest_col] += s*this_m[i][src_col];
}
}
int
ON_Matrix::RowReduce(
double zero_tolerance,
double& determinant,
double& pivot
)
{
double x, piv, det;
int i, k, ix, rank;
double** this_m = ThisM();
piv = det = 1.0;
rank = 0;
const int n = m_row_count <= m_col_count ? m_row_count : m_col_count;
for ( k = 0; k < n; k++ ) {
ix = k;
x = fabs(this_m[ix][k]);
for ( i = k+1; i < m_row_count; i++ ) {
if ( fabs(this_m[i][k]) > x ) {
ix = i;
x = fabs(this_m[ix][k]);
}
}
if ( x < piv || k == 0 ) {
piv = x;
}
if ( x <= zero_tolerance ) {
det = 0.0;
break;
}
rank++;
if ( ix != k )
{
// swap rows
SwapRows( ix, k );
det = -det;
}
// scale row k of matrix and B
det *= this_m[k][k];
x = 1.0/this_m[k][k];
this_m[k][k] = 1.0;
ON_ArrayScale( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[k][k+1] );
// zero column k for rows below this_m[k][k]
for ( i = k+1; i < m_row_count; i++ ) {
x = -this_m[i][k];
this_m[i][k] = 0.0;
if ( fabs(x) > zero_tolerance ) {
ON_Array_aA_plus_B( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[i][k+1], &this_m[i][k+1] );
}
}
}
pivot = piv;
determinant = det;
return rank;
}
int
ON_Matrix::RowReduce(
double zero_tolerance,
double* B,
double* pivot
)
{
double t;
double x, piv;
int i, k, ix, rank;
double** this_m = ThisM();
piv = 0.0;
rank = 0;
const int n = m_row_count <= m_col_count ? m_row_count : m_col_count;
for ( k = 0; k < n; k++ ) {
ix = k;
x = fabs(this_m[ix][k]);
for ( i = k+1; i < m_row_count; i++ ) {
if ( fabs(this_m[i][k]) > x ) {
ix = i;
x = fabs(this_m[ix][k]);
}
}
if ( x < piv || k == 0 ) {
piv = x;
}
if ( x <= zero_tolerance )
break;
rank++;
if ( ix != k )
{
// swap rows of matrix and B
SwapRows( ix, k );
t = B[ix]; B[ix] = B[k]; B[k] = t;
}
// scale row k of matrix and B
x = 1.0/this_m[k][k];
this_m[k][k] = 1.0;
ON_ArrayScale( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[k][k+1] );
B[k] *= x;
// zero column k for rows below this_m[k][k]
for ( i = k+1; i < m_row_count; i++ ) {
x = -this_m[i][k];
this_m[i][k] = 0.0;
if ( fabs(x) > zero_tolerance ) {
ON_Array_aA_plus_B( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[i][k+1], &this_m[i][k+1] );
B[i] += x*B[k];
}
}
}
if ( pivot )
*pivot = piv;
return rank;
}
int
ON_Matrix::RowReduce(
double zero_tolerance,
ON_3dPoint* B,
double* pivot
)
{
ON_3dPoint t;
double x, piv;
int i, k, ix, rank;
double** this_m = ThisM();
piv = 0.0;
rank = 0;
const int n = m_row_count <= m_col_count ? m_row_count : m_col_count;
for ( k = 0; k < n; k++ ) {
//onfree( onmalloc( 1)); // 8-06-03 lw for cancel thread responsiveness
onmalloc( 0); // 9-4-03 lw changed to 0
ix = k;
x = fabs(this_m[ix][k]);
for ( i = k+1; i < m_row_count; i++ ) {
if ( fabs(this_m[i][k]) > x ) {
ix = i;
x = fabs(this_m[ix][k]);
}
}
if ( x < piv || k == 0 ) {
piv = x;
}
if ( x <= zero_tolerance )
break;
rank++;
if ( ix != k )
{
// swap rows of matrix and B
SwapRows( ix, k );
t = B[ix]; B[ix] = B[k]; B[k] = t;
}
// scale row k of matrix and B
x = 1.0/this_m[k][k];
this_m[k][k] = 1.0;
ON_ArrayScale( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[k][k+1] );
B[k] *= x;
// zero column k for rows below this_m[k][k]
for ( i = k+1; i < m_row_count; i++ ) {
x = -this_m[i][k];
this_m[i][k] = 0.0;
if ( fabs(x) > zero_tolerance ) {
ON_Array_aA_plus_B( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[i][k+1], &this_m[i][k+1] );
B[i] += x*B[k];
}
}
}
if ( pivot )
*pivot = piv;
return rank;
}
int
ON_Matrix::RowReduce(
double zero_tolerance,
int pt_dim, int pt_stride, double* pt,
double* pivot
)
{
const int sizeof_pt = pt_dim*sizeof(pt[0]);
double* tmp_pt = (double*)onmalloc(pt_dim*sizeof(tmp_pt[0]));
double *ptA, *ptB;
double x, piv;
int i, k, ix, rank, pti;
double** this_m = ThisM();
piv = 0.0;
rank = 0;
const int n = m_row_count <= m_col_count ? m_row_count : m_col_count;
for ( k = 0; k < n; k++ ) {
// onfree( onmalloc( 1)); // 8-06-03 lw for cancel thread responsiveness
onmalloc( 0); // 9-4-03 lw changed to 0
ix = k;
x = fabs(this_m[ix][k]);
for ( i = k+1; i < m_row_count; i++ ) {
if ( fabs(this_m[i][k]) > x ) {
ix = i;
x = fabs(this_m[ix][k]);
}
}
if ( x < piv || k == 0 ) {
piv = x;
}
if ( x <= zero_tolerance )
break;
rank++;
// swap rows of matrix and B
if ( ix != k ) {
SwapRows( ix, k );
ptA = pt + (ix*pt_stride);
ptB = pt + (k*pt_stride);
memcpy( tmp_pt, ptA, sizeof_pt );
memcpy( ptA, ptB, sizeof_pt );
memcpy( ptB, tmp_pt, sizeof_pt );
}
// scale row k of matrix and B
x = 1.0/this_m[k][k];
if ( x != 1.0 ) {
this_m[k][k] = 1.0;
ON_ArrayScale( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[k][k+1] );
ptA = pt + (k*pt_stride);
for ( pti = 0; pti < pt_dim; pti++ )
ptA[pti] *= x;
}
// zero column k for rows below this_m[k][k]
ptB = pt + (k*pt_stride);
for ( i = k+1; i < m_row_count; i++ ) {
x = -this_m[i][k];
this_m[i][k] = 0.0;
if ( fabs(x) > zero_tolerance ) {
ON_Array_aA_plus_B( m_col_count - 1 - k, x, &this_m[k][k+1], &this_m[i][k+1], &this_m[i][k+1] );
ptA = pt + (i*pt_stride);
for ( pti = 0; pti < pt_dim; pti++ ) {
ptA[pti] += x*ptB[pti];
}
}
}
}
if ( pivot )
*pivot = piv;
onfree(tmp_pt);
return rank;
}
bool
ON_Matrix::BackSolve(
double zero_tolerance,
int Bsize,
const double* B,
double* X
) const
{
int i;
if ( m_col_count > m_row_count )
return false; // under determined
if ( Bsize < m_col_count || Bsize > m_row_count )
return false; // under determined
for ( i = m_col_count; i < Bsize; i++ ) {
if ( fabs(B[i]) > zero_tolerance )
return false; // over determined
}
// backsolve
double const*const* this_m = ThisM();
const int n = m_col_count-1;
if ( X != B )
X[n] = B[n];
for ( i = n-1; i >= 0; i-- ) {
X[i] = B[i] - ON_ArrayDotProduct( n-i, &this_m[i][i+1], &X[i+1] );
}
return true;
}
bool
ON_Matrix::BackSolve(
double zero_tolerance,
int Bsize,
const ON_3dPoint* B,
ON_3dPoint* X
) const
{
int i, j;
if ( m_col_count > m_row_count )
return false; // under determined
if ( Bsize < m_col_count || Bsize > m_row_count )
return false; // under determined
for ( i = m_col_count; i < Bsize; i++ ) {
if ( B[i].MaximumCoordinate() > zero_tolerance )
return false; // over determined
}
// backsolve
double const*const* this_m = ThisM();
if ( X != B )
{
X[m_col_count-1] = B[m_col_count-1];
for ( i = m_col_count-2; i >= 0; i-- ) {
X[i] = B[i];
for ( j = i+1; j < m_col_count; j++ ) {
X[i] -= this_m[i][j]*X[j];
}
}
}
else {
for ( i = m_col_count-2; i >= 0; i-- ) {
for ( j = i+1; j < m_col_count; j++ ) {
X[i] -= this_m[i][j]*X[j];
}
}
}
return true;
}
bool
ON_Matrix::BackSolve(
double zero_tolerance,
int pt_dim,
int Bsize,
int Bpt_stride,
const double* Bpt,
int Xpt_stride,
double* Xpt
) const
{
const int sizeof_pt = pt_dim*sizeof(double);
double mij;
int i, j, k;
const double* Bi;
double* Xi;
double* Xj;
if ( m_col_count > m_row_count )
return false; // under determined
if ( Bsize < m_col_count || Bsize > m_row_count )
return false; // under determined
for ( i = m_col_count; i < Bsize; i++ )
{
Bi = Bpt + i*Bpt_stride;
for( j = 0; j < pt_dim; j++ )
{
if ( fabs(Bi[j]) > zero_tolerance )
return false; // over determined
}
}
// backsolve
double const*const* this_m = ThisM();
if ( Xpt != Bpt )
{
Xi = Xpt + (m_col_count-1)*Xpt_stride;
Bi = Bpt + (m_col_count-1)*Bpt_stride;
memcpy(Xi,Bi,sizeof_pt);
for ( i = m_col_count-2; i >= 0; i-- ) {
Xi = Xpt + i*Xpt_stride;
Bi = Bpt + i*Bpt_stride;
memcpy(Xi,Bi,sizeof_pt);
for ( j = i+1; j < m_col_count; j++ ) {
Xj = Xpt + j*Xpt_stride;
mij = this_m[i][j];
for ( k = 0; k < pt_dim; k++ )
Xi[k] -= mij*Xj[k];
}
}
}
else {
for ( i = m_col_count-2; i >= 0; i-- ) {
Xi = Xpt + i*Xpt_stride;
for ( j = i+1; j < m_col_count; j++ ) {
Xj = Xpt + j*Xpt_stride;
mij = this_m[i][j];
for ( k = 0; k < pt_dim; k++ )
Xi[k] -= mij*Xj[k];
}
}
}
return true;
}
void ON_Matrix::Zero()
{
struct DBLBLK* cmem = (struct DBLBLK*)m_cmem;
while ( 0 != cmem )
{
if ( 0 != cmem->a && cmem->count > 0 )
{
memset( cmem->a, 0, cmem->count*sizeof(cmem->a[0]) );
}
cmem = cmem->next;
}
//m_a.Zero();
}
void ON_Matrix::SetDiagonal( double d)
{
const int n = MinCount();
int i;
Zero();
double** this_m = ThisM();
for ( i = 0; i < n; i++ )
{
this_m[i][i] = d;
}
}
void ON_Matrix::SetDiagonal( const double* d )
{
Zero();
if (d)
{
double** this_m = ThisM();
const int n = MinCount();
int i;
for ( i = 0; i < n; i++ )
{
this_m[i][i] = *d++;
}
}
}
void ON_Matrix::SetDiagonal( int count, const double* d )
{
Create(count,count);
Zero();
SetDiagonal(d);
}
void ON_Matrix::SetDiagonal( const ON_SimpleArray<double>& a )
{
SetDiagonal( a.Count(), a.Array() );
}
bool ON_Matrix::IsValid() const
{
if ( m_row_count < 1 || m_col_count < 1 )
return false;
if ( 0 == m )
return false;
return true;
}
int ON_Matrix::IsSquare() const
{
return ( m_row_count > 0 && m_col_count == m_row_count ) ? m_row_count : 0;
}
bool ON_Matrix::IsRowOrthoganal() const
{
double d0, d1, d;
int i0, i1, j;
double const*const* this_m = ThisM();
bool rc = ( m_row_count <= m_col_count && m_row_count > 0 );
for ( i0 = 0; i0 < m_row_count && rc; i0++ ) for ( i1 = i0+1; i1 < m_row_count && rc; i1++ ) {
d0 = d1 = d = 0.0;
for ( j = 0; j < m_col_count; j++ ) {
d0 += fabs(this_m[i0][j]);
d1 += fabs(this_m[i0][j]);
d += this_m[i0][j]*this_m[i1][j];
}
if ( d0 <= ON_EPSILON || d1 <= ON_EPSILON || fabs(d) >= d0*d1* ON_SQRT_EPSILON )
rc = false;
}
return rc;
}
bool ON_Matrix::IsRowOrthoNormal() const
{
double d;
int i, j;
bool rc = IsRowOrthoganal();
if ( rc ) {
double const*const* this_m = ThisM();
for ( i = 0; i < m_row_count; i++ ) {
d = 0.0;
for ( j = 0; j < m_col_count; j++ ) {
d += this_m[i][j]*this_m[i][j];
}
if ( fabs(1.0-d) >= ON_SQRT_EPSILON )
rc = false;
}
}
return rc;
}
bool ON_Matrix::IsColOrthoganal() const
{
double d0, d1, d;
int i, j0, j1;
bool rc = ( m_col_count <= m_row_count && m_col_count > 0 );
double const*const* this_m = ThisM();
for ( j0 = 0; j0 < m_col_count && rc; j0++ ) for ( j1 = j0+1; j1 < m_col_count && rc; j1++ ) {
d0 = d1 = d = 0.0;
for ( i = 0; i < m_row_count; i++ ) {
d0 += fabs(this_m[i][j0]);
d1 += fabs(this_m[i][j0]);
d += this_m[i][j0]*this_m[i][j1];
}
if ( d0 <= ON_EPSILON || d1 <= ON_EPSILON || fabs(d) > ON_SQRT_EPSILON )
rc = false;
}
return rc;
}
bool ON_Matrix::IsColOrthoNormal() const
{
double d;
int i, j;
bool rc = IsColOrthoganal();
double const*const* this_m = ThisM();
if ( rc ) {
for ( j = 0; j < m_col_count; j++ ) {
d = 0.0;
for ( i = 0; i < m_row_count; i++ ) {
d += this_m[i][j]*this_m[i][j];
}
if ( fabs(1.0-d) >= ON_SQRT_EPSILON )
rc = false;
}
}
return rc;
}
bool ON_Matrix::Invert( double zero_tolerance )
{
ON_Workspace ws;
int i, j, k, ix, jx, rank;
double x;
const int n = MinCount();
if ( n < 1 )
return false;
ON_Matrix I(m_col_count, m_row_count);
int* col = ws.GetIntMemory(n);
I.SetDiagonal(1.0);
rank = 0;
double** this_m = ThisM();
for ( k = 0; k < n; k++ ) {
// find largest value in sub matrix
ix = jx = k;
x = fabs(this_m[ix][jx]);
for ( i = k; i < n; i++ ) {
for ( j = k; j < n; j++ ) {
if ( fabs(this_m[i][j]) > x ) {
ix = i;
jx = j;
x = fabs(this_m[ix][jx]);
}
}
}
SwapRows( k, ix );
I.SwapRows( k, ix );
SwapCols( k, jx );
col[k] = jx;
if ( x <= zero_tolerance ) {
break;
}
x = 1.0/this_m[k][k];
this_m[k][k] = 1.0;
ON_ArrayScale( m_col_count-k-1, x, &this_m[k][k+1], &this_m[k][k+1] );
I.RowScale( k, x );
// zero this_m[!=k][k]'s
for ( i = 0; i < n; i++ ) {
if ( i != k ) {
x = -this_m[i][k];
this_m[i][k] = 0.0;
if ( fabs(x) > zero_tolerance ) {
ON_Array_aA_plus_B( m_col_count-k-1, x, &this_m[k][k+1], &this_m[i][k+1], &this_m[i][k+1] );
I.RowOp( i, x, k );
}
}
}
}
// take care of column swaps
for ( i = k-1; i >= 0; i-- ) {
if ( i != col[i] )
I.SwapRows(i,col[i]);
}
*this = I;
return (k == n) ? true : false;
}
bool ON_Matrix::Multiply( const ON_Matrix& a, const ON_Matrix& b )
{
int i, j, k, mult_count;
double x;
if (a.ColCount() != b.RowCount() )
return false;
if ( a.RowCount() < 1 || a.ColCount() < 1 || b.ColCount() < 1 )
return false;
if ( this == &a ) {
ON_Matrix tmp(a);
return Multiply(tmp,b);
}
if ( this == &b ) {
ON_Matrix tmp(b);
return Multiply(a,tmp);
}
Create( a.RowCount(), b.ColCount() );
mult_count = a.ColCount();
double const*const* am = a.ThisM();
double const*const* bm = b.ThisM();
double** this_m = ThisM();
for ( i = 0; i < m_row_count; i++ ) for ( j = 0; j < m_col_count; j++ ) {
x = 0.0;
for (k = 0; k < mult_count; k++ ) {
x += am[i][k] * bm[k][j];
}
this_m[i][j] = x;
}
return true;
}
bool ON_Matrix::Add( const ON_Matrix& a, const ON_Matrix& b )
{
int i, j;
if (a.ColCount() != b.ColCount() )
return false;
if (a.RowCount() != b.RowCount() )
return false;
if ( a.RowCount() < 1 || a.ColCount() < 1 )
return false;
if ( this != &a && this != &b ) {
Create( a.RowCount(), b.ColCount() );
}
double const*const* am = a.ThisM();
double const*const* bm = b.ThisM();
double** this_m = ThisM();
for ( i = 0; i < m_row_count; i++ ) for ( j = 0; j < m_col_count; j++ ) {
this_m[i][j] = am[i][j] + bm[i][j];
}
return true;
}
bool ON_Matrix::Scale( double s )
{
bool rc = false;
if ( m_row_count > 0 && m_col_count > 0 )
{
struct DBLBLK* cmem = (struct DBLBLK*)m_cmem;
int i;
double* p;
while ( 0 != cmem )
{
if ( 0 != cmem->a && cmem->count > 0 )
{
p = cmem->a;
i = cmem->count;
while(i--)
*p++ *= s;
}
cmem = cmem->next;
}
rc = true;
}
/*
int i = m_a.Capacity();
if ( m_row_count > 0 && m_col_count > 0 && m_row_count*m_col_count <= i ) {
double* p = m_a.Array();
while ( i-- )
*p++ *= s;
rc = true;
}
*/
return rc;
}
int ON_RowReduce( int row_count,
int col_count,
double zero_pivot,
double** A,
double** B,
double pivots[2]
)
{
// returned A is identity, B = inverse of input A
const int M = row_count;
const int N = col_count;
const size_t sizeof_row = N*sizeof(A[0][0]);
int i, j, ii;
double a, p, p0, p1;
const double* ptr0;
double* ptr1;
if ( pivots )
{
pivots[0] = 0.0;
pivots[1] = 0.0;
}
if ( zero_pivot <= 0.0 || !ON_IsValid(zero_pivot) )
zero_pivot = 0.0;
for ( i = 0; i < M; i++ )
{
memset(B[i],0,sizeof_row);
if ( i < N )
B[i][i] = 1.0;
}
p0 = p1 = A[0][0];
for ( i = 0; i < M; i++ )
{
p = fabs(a = A[i][i]);
if ( p < p0 ) p0 = p; else if (p > p1) p1 = p;
if ( 1.0 != a )
{
if ( p <= zero_pivot || !ON_IsValid(a) )
{
break;
}
a = 1.0/a;
//A[i][i] = 1.0; // no need to do this
// The "ptr" voodoo is faster but does the same thing as
//
//for ( j = i+1; j < N; j++ )
// A[i][j] *= a;
//
j = i+1;
ptr1 = A[i] + j;
j = N - j;
while(j--) *ptr1++ *= a;
// The "ptr" voodoo is faster but does the same thing as
//
//for ( j = 0; j <= i; j++ )
// B[i][j] *= a;
//
ptr1 = B[i];
j = i+1;
while(j--) *ptr1++ *= a;
}
for ( ii = i+1; ii < M; ii++ )
{
a = A[ii][i];
if ( 0.0 == a )
continue;
a = -a;
//A[ii][i] = 0.0; // no need to do this
// The "ptr" voodoo is faster but does the same thing as
//
//for( j = i+1; j < N; j++ )
// A[ii][j] += a*A[i][j];
//
j = i+1;
ptr0 = A[i] + j;
ptr1 = A[ii] + j;
j = N - j;
while(j--) *ptr1++ += a* *ptr0++;
for( j = 0; j <= i; j++ )
B[ii][j] += a*B[i][j];
}
}
if ( pivots )
{
pivots[0] = p0;
pivots[1] = p1;
}
if ( i < M )
{
return i;
}
// A is now upper triangular with all 1s on diagonal
// (That is, if the lines that say "no need to do this" are used.)
// B is lower triangular with a nonzero diagonal
for ( i = M-1; i >= 0; i-- )
{
for ( ii = i-1; ii >= 0; ii-- )
{
a = A[ii][i];
if ( 0.0 == a )
continue;
a = -a;
//A[ii][i] = 0.0; // no need to do this
// The "ptr" voodoo is faster but does the same thing as
//
//for( j = 0; j < N; j++ )
// B[ii][j] += a*B[i][j];
//
ptr0 = B[i];
ptr1 = B[ii];
j = N;
while(j--) *ptr1++ += a* *ptr0++;
}
}
// At this point, A is trash.
// If the input A was really nice (positive definite....)
// the B = inverse of the input A. If A was not nice,
// B is also trash.
return M;
}
int ON_InvertSVDW(
int count,
const double* W,
double*& invW
)
{
double w, maxw;
int i;
if ( 0 == W || count <= 0 )
return -1;
if ( 0 == invW )
{
invW = (double*)onmalloc(count*sizeof(invW[0]));
}
maxw = fabs(W[0]);
for (i = 1; i < count; i++) {
w = fabs(W[i]);
if (w > maxw) maxw = w;
}
if (maxw == 0.0)
{
if ( W != invW )
memset(invW,0,count*sizeof(invW[0]));
return 0;
}
i = 0;
maxw *= ON_SQRT_EPSILON;
while (count--)
{
if (fabs(W[count]) > maxw)
{
i++;
invW[count] = 1.0/W[count];
}
else
invW[count] = 0.0;
}
return i; // number of nonzero terms in invW[]
}
bool ON_SolveSVD(
int row_count,
int col_count,
double const * const * U,
const double* invW,
double const * const * V,
const double* B,
double*& X
)
{
int i, j;
double *Y;
const double* p0;
double workY[128], x;
if ( row_count < 1 || col_count < 1 || 0 == U || 0 == invW || 0 == V || 0 == B)
return false;
if ( 0 == X )
X = (double*)onmalloc(col_count*sizeof(X[0]));
Y = (col_count > 128)
? ( (double*)onmalloc(col_count*sizeof(*Y)) )
: workY;
for (i = 0; i < col_count; i++)
{
double y = 0.0;
for (j = 0; j < row_count; j++)
y += U[j][i] * *B++;
B -= row_count;
Y[i] = invW[i] * y;
}
for (i = 0; i < col_count; i++)
{
p0 = V[i];
j = col_count;
x = 0.0;
while (j--)
x += *p0++ * *Y++;
Y -= col_count;
X[i] = x;
}
if (Y != workY)
onfree(Y);
return true;
}
| 22.958275 | 112 | 0.500121 | averbin |
f66c182b3e30c4aa1f2fb4b15a73b57ba40eba23 | 630 | inl | C++ | src/ScriptSystem/Init/details/UECS_AutoRefl/SingletonsView_AutoRefl.inl | Jerry-Shen0527/Utopia | 5f40edc814e5f6a33957cdc889524c41c5ef870f | [
"MIT"
] | 321 | 2020-10-04T01:43:36.000Z | 2022-03-31T02:43:38.000Z | src/ScriptSystem/Init/details/UECS_AutoRefl/SingletonsView_AutoRefl.inl | Jerry-Shen0527/Utopia | 5f40edc814e5f6a33957cdc889524c41c5ef870f | [
"MIT"
] | 9 | 2020-11-17T04:06:22.000Z | 2022-02-19T09:05:29.000Z | src/ScriptSystem/Init/details/UECS_AutoRefl/SingletonsView_AutoRefl.inl | Jerry-Shen0527/Utopia | 5f40edc814e5f6a33957cdc889524c41c5ef870f | [
"MIT"
] | 41 | 2020-10-09T10:09:34.000Z | 2022-03-27T02:51:57.000Z | // This file is generated by Ubpa::USRefl::AutoRefl
#pragma once
#include <USRefl/USRefl.h>
template<>
struct Ubpa::USRefl::TypeInfo<Ubpa::UECS::SingletonsView> :
TypeInfoBase<Ubpa::UECS::SingletonsView>
{
#ifdef UBPA_USREFL_NOT_USE_NAMEOF
static constexpr char name[27] = "Ubpa::UECS::SingletonsView";
#endif
static constexpr AttrList attrs = {};
static constexpr FieldList fields = {
Field {TSTR(UMeta::constructor), WrapConstructor<Type(Span<const UECS::CmptAccessPtr>)>()},
Field {TSTR("GetSingleton"), &Type::GetSingleton},
Field {TSTR("Singletons"), &Type::Singletons},
};
};
| 28.636364 | 99 | 0.695238 | Jerry-Shen0527 |
f66f37cef2a4e4c2d23ef176fd390855137116b8 | 2,705 | hpp | C++ | include/clotho/cuda/data_spaces/sequence_space/device_sequence_space_kernels.hpp | putnampp/clotho | 6dbfd82ef37b4265381cd78888cd6da8c61c68c2 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2015-06-16T21:27:57.000Z | 2022-01-25T23:26:54.000Z | include/clotho/cuda/data_spaces/sequence_space/device_sequence_space_kernels.hpp | putnampp/clotho | 6dbfd82ef37b4265381cd78888cd6da8c61c68c2 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2015-06-16T21:12:42.000Z | 2015-06-23T12:41:00.000Z | include/clotho/cuda/data_spaces/sequence_space/device_sequence_space_kernels.hpp | putnampp/clotho | 6dbfd82ef37b4265381cd78888cd6da8c61c68c2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | // Copyright 2015 Patrick Putnam
//
// 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 DEVICE_SEQUENCE_SPACE_KERNELS_HPP_
#define DEVICE_SEQUENCE_SPACE_KERNELS_HPP_
#include "clotho/cuda/data_spaces/sequence_space/device_sequence_space_def.hpp"
#include "clotho/cuda/data_spaces/sequence_space/device_sequence_space_kernel_api.hpp"
template < class IntType >
__device__ void _resize_space_impl( device_sequence_space< IntType > * sspace, unsigned int cols, unsigned int rows ) {
// assert( blockIdx.y * gridDim.x + blockIdx.x == 0);
// assert( threadIdx.y * blockDim.x + threadIdx.x == 0 );
typedef typename device_sequence_space< IntType >::int_type int_type;
unsigned int N = cols * rows;
if( sspace->capacity < N ) {
int_type * seqs = sspace->sequences;
if( seqs ) {
delete seqs;
}
seqs = new int_type[ N ];
assert( seqs != NULL );
sspace->sequences = seqs;
sspace->capacity = N;
}
sspace->size = N;
sspace->seq_count = rows;
sspace->seq_width = cols;
}
template < class IntType >
__global__ void _resize_space( device_sequence_space< IntType > * sspace, unsigned int cols, unsigned int rows = 1 ) {
assert( blockIdx.y * gridDim.x + blockIdx.x == 0 );
if( threadIdx.y * blockDim.x + threadIdx.x == 0 ) {
_resize_space_impl( sspace, cols, rows );
}
};
template < class IntType, class ColumnSpaceType >
__global__ void _resize_space( device_sequence_space< IntType > * sspace, ColumnSpaceType * aspace, unsigned int seq_count ) {
assert( blockIdx.y * gridDim.x + blockIdx.x == 0 );
if( threadIdx.y * blockDim.x + threadIdx.x == 0 ) {
typedef device_sequence_space< IntType > space_type;
typedef typename space_type::int_type int_type;
unsigned int W = aspace->capacity;
W /= space_type::OBJECTS_PER_INT;
_resize_space_impl( sspace, W, seq_count );
}
}
template < class IntType >
__global__ void _delete_space( device_sequence_space< IntType > * sspace ) {
if( sspace->sequences != NULL ) {
delete sspace->sequences;
}
}
#endif // DEVICE_SEQUENCE_SPACE_KERNELS_HPP_
| 34.240506 | 126 | 0.686137 | putnampp |
f67383a22bc818daf38c06ea9b6933cfbf5e061e | 297 | cpp | C++ | tf_publisher/src/tf_publisher_main.cpp | HosseinSheikhi/ros2_ws | 410e5e554d077ff2f735f999fc00bb66a88ce8c0 | [
"MIT"
] | null | null | null | tf_publisher/src/tf_publisher_main.cpp | HosseinSheikhi/ros2_ws | 410e5e554d077ff2f735f999fc00bb66a88ce8c0 | [
"MIT"
] | null | null | null | tf_publisher/src/tf_publisher_main.cpp | HosseinSheikhi/ros2_ws | 410e5e554d077ff2f735f999fc00bb66a88ce8c0 | [
"MIT"
] | null | null | null | //
// Created by hossein on 9/22/20.
//
#include "tf_publisher/tf_publisher.h"
int main(int argc, char **argv){
rclcpp::init(argc, argv);
std::shared_ptr<TFPublisher> tf_publisher_node = std::make_shared<TFPublisher>();
rclcpp::spin(tf_publisher_node);
rclcpp::shutdown();
return 0;
} | 21.214286 | 83 | 0.703704 | HosseinSheikhi |
f674c0dcf600570b752370947e23f6a1f8003b21 | 5,896 | cpp | C++ | src/clinterface/batteryarg.cpp | pvavercak/randomness-testing-toolkit | 8a29349edee0dc44bc8e765708555dda57b9e339 | [
"MIT"
] | null | null | null | src/clinterface/batteryarg.cpp | pvavercak/randomness-testing-toolkit | 8a29349edee0dc44bc8e765708555dda57b9e339 | [
"MIT"
] | null | null | null | src/clinterface/batteryarg.cpp | pvavercak/randomness-testing-toolkit | 8a29349edee0dc44bc8e765708555dda57b9e339 | [
"MIT"
] | null | null | null | #include "clinterface/batteryarg.h"
namespace rtt {
namespace clinterface {
BatteryArg::BatteryArg() {}
BatteryArg::BatteryArg(const std::string & battery) {
init(battery);
}
std::string BatteryArg::getName(Constants::BatteryID batteryId) {
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
return "NIST Statistical Testing Suite";
case Constants::BatteryID::DIEHARDER:
return "Dieharder";
case Constants::BatteryID::TU01_SMALLCRUSH:
return "TestU01 Small Crush";
case Constants::BatteryID::TU01_CRUSH:
return "TestU01 Crush";
case Constants::BatteryID::TU01_BIGCRUSH:
return "TestU01 Big Crush";
case Constants::BatteryID::TU01_RABBIT:
return "TestU01 Rabbit";
case Constants::BatteryID::TU01_ALPHABIT:
return "TestU01 Alphabit";
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return "TestU01 Block Alphabit";
default:
raiseBugException("invalid battery id");
}
}
std::string BatteryArg::getShortName(Constants::BatteryID batteryId) {
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
return "nist_sts";
case Constants::BatteryID::DIEHARDER:
return "dieharder";
case Constants::BatteryID::TU01_SMALLCRUSH:
return "tu01_smallcrush";
case Constants::BatteryID::TU01_CRUSH:
return "tu01_crush";
case Constants::BatteryID::TU01_BIGCRUSH:
return "tu01_bigcrush";
case Constants::BatteryID::TU01_RABBIT:
return "tu01_rabbit";
case Constants::BatteryID::TU01_ALPHABIT:
return "tu01_alphabit";
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return "tu01_blockalphabit";
default:
raiseBugException("invalid battery id");
}
}
uint BatteryArg::getExpectedExitCode(Constants::BatteryID batteryId) {
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
return 256;
case Constants::BatteryID::DIEHARDER:
case Constants::BatteryID::TU01_SMALLCRUSH:
case Constants::BatteryID::TU01_CRUSH:
case Constants::BatteryID::TU01_BIGCRUSH:
case Constants::BatteryID::TU01_RABBIT:
case Constants::BatteryID::TU01_ALPHABIT:
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return 0;
default:
raiseBugException("invalid battery id");
}
}
Constants::BatteryID BatteryArg::getBatteryId() const {
initCheck();
return batteryId;
}
std::string BatteryArg::getName() const {
initCheck();
return name;
}
std::string BatteryArg::getShortName() const {
initCheck();
return shortName;
}
uint BatteryArg::getExpectedExitCode() const {
initCheck();
return expectedExitCode;
}
bool BatteryArg::isInTU01Family() const {
initCheck();
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
case Constants::BatteryID::DIEHARDER:
return false;
case Constants::BatteryID::TU01_SMALLCRUSH:
case Constants::BatteryID::TU01_CRUSH:
case Constants::BatteryID::TU01_BIGCRUSH:
case Constants::BatteryID::TU01_RABBIT:
case Constants::BatteryID::TU01_ALPHABIT:
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return true;
default:
raiseBugException("invalid battery id");
}
}
bool BatteryArg::isInTU01CrushFamily() const {
initCheck();
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
case Constants::BatteryID::DIEHARDER:
case Constants::BatteryID::TU01_RABBIT:
case Constants::BatteryID::TU01_ALPHABIT:
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return false;
case Constants::BatteryID::TU01_SMALLCRUSH:
case Constants::BatteryID::TU01_CRUSH:
case Constants::BatteryID::TU01_BIGCRUSH:
return true;
default:
raiseBugException("invalid battery id");
}
}
bool BatteryArg::isInTU01BitFamily() const {
initCheck();
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
case Constants::BatteryID::DIEHARDER:
case Constants::BatteryID::TU01_SMALLCRUSH:
case Constants::BatteryID::TU01_CRUSH:
case Constants::BatteryID::TU01_BIGCRUSH:
return false;
case Constants::BatteryID::TU01_RABBIT:
case Constants::BatteryID::TU01_ALPHABIT:
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return true;
default:
raiseBugException("invalid battery id");
}
}
bool BatteryArg::isInTU01AlphabitFamily() const {
initCheck();
switch(batteryId) {
case Constants::BatteryID::NIST_STS:
case Constants::BatteryID::DIEHARDER:
case Constants::BatteryID::TU01_SMALLCRUSH:
case Constants::BatteryID::TU01_CRUSH:
case Constants::BatteryID::TU01_BIGCRUSH:
case Constants::BatteryID::TU01_RABBIT:
return false;
case Constants::BatteryID::TU01_ALPHABIT:
case Constants::BatteryID::TU01_BLOCK_ALPHABIT:
return true;
default:
raiseBugException("invalid battery id");
}
}
Constants::BatteryID BatteryArg::getBatteryIdFromShortName(const std::string & shortName){
Constants::BatteryID batteryId;
for(int i = 1; i < static_cast<int>(Constants::BatteryID::LAST_ITEM); ++i) {
batteryId = static_cast<Constants::BatteryID>(i);
if(shortName == getShortName(batteryId))
return batteryId;
}
throw std::runtime_error("unknown battery argument: " + shortName);
}
void BatteryArg::init(const std::string & shortName) {
if(initialized)
raiseBugException("BatteryArg is already initialized");
batteryId = getBatteryIdFromShortName(shortName);
this->shortName = shortName;
name = getName(batteryId);
expectedExitCode = getExpectedExitCode(batteryId);
initialized = true;
}
void BatteryArg::initCheck() const {
if(!initialized)
raiseBugException("BatteryArg is not initialized");
}
} // namespace clinterface
} // namespace rtt
| 29.044335 | 90 | 0.697592 | pvavercak |
f6751c072b76874425093e568f7d9da8981801fd | 9,149 | hh | C++ | extern/typed-geometry/src/typed-geometry/functions/objects/rasterize.hh | rovedit/Fort-Candle | 445fb94852df56c279c71b95c820500e7fb33cf7 | [
"MIT"
] | null | null | null | extern/typed-geometry/src/typed-geometry/functions/objects/rasterize.hh | rovedit/Fort-Candle | 445fb94852df56c279c71b95c820500e7fb33cf7 | [
"MIT"
] | null | null | null | extern/typed-geometry/src/typed-geometry/functions/objects/rasterize.hh | rovedit/Fort-Candle | 445fb94852df56c279c71b95c820500e7fb33cf7 | [
"MIT"
] | null | null | null | #pragma once
#include <typed-geometry/functions/basic/limits.hh>
#include <typed-geometry/functions/vector/math.hh>
#include <typed-geometry/types/objects/triangle.hh>
#include "aabb.hh"
#include "coordinates.hh"
/**
* Rasterization of objects
*
* Enumerates all integer points (tg::ipos2, tg::ipos3, ...) that are contained in the objects
* (e.g. contains(obj, pos) == true for all enumerated positions)
*/
namespace tg
{
// F: (tg::ipos2 p, float a) -> void
template <class ScalarT, class F>
constexpr void rasterize(segment<2, ScalarT> const& l, F&& f)
{
// TODO add limits?
// bresenham, see http://www.roguebasin.com/index.php?title=Bresenham%27s_Line_Algorithm
auto x0 = iround(l.pos0.x);
auto x1 = iround(l.pos1.x);
auto y0 = iround(l.pos0.y);
auto y1 = iround(l.pos1.y);
auto delta_x = x1 - x0;
// if x1 == x2, then it does not matter what we set here
signed char const ix((delta_x > 0) - (delta_x < 0));
delta_x = std::abs(delta_x) << 1;
auto delta_y = y1 - y0;
// if y1 == y2, then it does not matter what we set here
signed char const iy((delta_y > 0) - (delta_y < 0));
delta_y = std::abs(delta_y) << 1;
// start
f(tg::ipos2(x0, y0), ScalarT(0));
if (delta_x >= delta_y)
{
// done
if (x0 == x1)
return;
// error may go below zero
int error(delta_y - (delta_x >> 1));
while (x0 != x1)
{
// reduce error, while taking into account the corner case of error == 0
if ((error > 0) || (!error && (ix > 0)))
{
error -= delta_x;
y0 += iy;
}
// else do nothing
error += delta_y;
x0 += ix;
f(tg::ipos2(x0, y0), min(length(tg::pos2(x0, y0) - l.pos0) / length(l.pos1 - l.pos0), ScalarT(1)));
}
}
else
{
// done
if (y0 == y1)
return;
// error may go below zero
int error(delta_x - (delta_y >> 1));
while (y1 != y0)
{
// reduce error, while taking into account the corner case of error == 0
if ((error > 0) || (!error && (iy > 0)))
{
error -= delta_y;
x0 += ix;
}
// else do nothing
error += delta_x;
y0 += iy;
f(tg::ipos2(x0, y0), min(length(tg::pos2(x0, y0) - l.pos0) / length(l.pos1 - l.pos0), ScalarT(1)));
}
}
}
// F: (tg::ipos2 p, float a, float b) -> void
// offset is subpixel offset, e.g. 0.5f means sampling at pixel center
template <class ScalarT, class F>
constexpr void rasterize_bresenham(triangle<2, ScalarT> const& t, F&& f)
{
// bresenham 3 sides of a triangle, then fill contour
// inspired by https://stackoverflow.com/a/11145708
auto const box = aabb_of(t);
// margin so that we can safely round/clamp to integer coords
auto const minPix = ifloor(box.min);
auto const maxPix = iceil(box.max);
// TODO no abs, correct?
// auto const width = maxPix.x - minPix.x;
auto const height = maxPix.y - minPix.y;
// stores leftmost and rightmost pixel from bresenham
auto contour = new int*[uint(height)];
for (auto r = 0; r < height; r++)
{
contour[r] = new int[2];
// will bresenham to find left and right bounds of row
// will scanline only if row[0] <= row[1]
contour[r][0] = tg::detail::limits<int>().max();
contour[r][1] = tg::detail::limits<int>().min();
}
// rasterize two sides of the triangle
auto lines = {tg::segment(t.pos0, t.pos1), tg::segment(t.pos1, t.pos2), tg::segment(t.pos2, t.pos0)};
// note that if the triangle is "flat" (that means one side is not slanted with respect to the pixel grid) two edges would be sufficient!
// rasterize to get triangle contour for each row
for (auto l : lines)
tg::rasterize(l, [&](tg::ipos2 p, ScalarT a) {
auto iy = p.y - minPix.y;
if (iy < 0 || iy >= height)
// std::cout << "bad y: " << iy << " | height is " << height << std::endl;
return;
// update contour
if (p.x < contour[iy][0])
contour[iy][0] = p.x;
if (p.x > contour[iy][1])
contour[iy][1] = p.x;
// TODO interpolate line parameters for bary?
(void)a;
});
for (auto y = 0; y < height; ++y)
{
// bresenham was here
for (auto x = contour[y][0]; x <= contour[y][1]; x++)
{
auto const pos = tg::ipos2(x, y + minPix.y);
// TODO if experimental: derive bary from line parameters and x / (maxPix.x - minPix.x) instead?
// TODO note that calculating barycentrics for pixels may give values outside 0..1 as pixels may be
// "touched" by a triangle but e.g. their topleft corner may not actually be contained
// TODO offset?
auto const off = ScalarT(0.0); // subpixel offset
auto bary = tg::coordinates(t, tg::pos2(pos.x + off, pos.y + off));
// TODO might be slightly outside of triangle, clamp
bary[0] = tg::clamp(bary[0], 0, 1);
bary[1] = tg::clamp(bary[1], 0, 1);
f(pos, bary[0], bary[1]);
}
}
}
// no barycentric coords returned:
// F: (tg::ipos2 p) -> void
// offset is subpixel offset, e.g. 0.5f means sampling at pixel center
template <class ScalarT, class F>
constexpr void fast_rasterize(triangle<2, ScalarT> const& t, F&& f, tg::vec<2, ScalarT> const& offset = tg::vec<2, ScalarT>(0))
{
// adaptive half-space rasterization
// see https://www.uni-obuda.hu/journal/Mileff_Nehez_Dudra_63.pdf
auto const fbox = aabb_of(t);
auto box = tg::aabb<2, int>(tg::ipos2(ifloor(fbox.min)), tg::ipos2(iceil(fbox.max)));
// edge functions and their constants
ScalarT edgeConstants[3 * 3];
tg::pos<2, ScalarT> verts[3] = {t.pos0, t.pos1, t.pos2};
// edges AB, BC and CA
for (auto e = 0; e < 3; e++)
{
auto next = (e + 1) % 3;
edgeConstants[e * 3 + 0] = verts[e].y - verts[next].y;
edgeConstants[e * 3 + 1] = verts[next].x - verts[e].x;
edgeConstants[e * 3 + 2] = verts[e].x * verts[next].y - verts[e].y * verts[next].x;
}
auto edgeFunction = [edgeConstants, offset](tg::ipos2 pos, int f) {
auto first = min(f * 3, 6);
return edgeConstants[first + 0] * (pos.x + offset.x) + edgeConstants[first + 1] * (pos.y + offset.y) + edgeConstants[first + 2];
};
auto renderBlock = [f, edgeFunction, edgeConstants](int x, int y, int sizeX, int sizeY) {
if (sizeX * sizeY <= 0)
return;
// compute once, increment later
auto pos = tg::ipos2(x, y);
auto cy1 = edgeFunction(pos, 0);
auto cy2 = edgeFunction(pos, 1);
auto cy3 = edgeFunction(pos, 2);
auto cx1 = cy1;
auto cx2 = cy2;
auto cx3 = cy3;
for (auto py = y; py < y + sizeY; py++)
{
// y has changed, clip cx to cy
cx1 = cy1;
cx2 = cy2;
cx3 = cy3;
for (auto px = x; px < x + sizeX; px++)
{
// allows for both ccw and cc vertex order
auto in = (cx1 < 0 && cx2 < 0 && cx3 < 0) || (cx1 >= 0 && cx2 >= 0 && cx3 >= 0);
if (in)
{
f(tg::ipos2(px, py));
}
// increment
cx1 += edgeConstants[3 * 0 + 0]; // I values
cx2 += edgeConstants[3 * 1 + 0];
cx3 += edgeConstants[3 * 2 + 0];
}
// update cy values
cy1 += edgeConstants[3 * 0 + 1]; // J values
cy2 += edgeConstants[3 * 1 + 1];
cy3 += edgeConstants[3 * 2 + 1];
}
};
auto width = box.max.x - box.min.x;
auto height = box.max.y - box.min.y;
renderBlock(box.min.x, box.min.y, width, height);
}
// F: (tg::ipos2 p, float a, float b) -> void
// offset is subpixel offset, e.g. 0.5f means sampling at pixel center
template <class ScalarT, class F>
constexpr void rasterize(triangle<2, ScalarT> const& t, F&& f, tg::vec<2, ScalarT> const& offset = tg::vec<2, ScalarT>(0))
{
auto const box = aabb_of(t);
// margin so that we can safely round/clamp to integer coords
auto const minPix = ifloor(box.min);
auto const maxPix = iceil(box.max);
// TODO: Bresenham on two of the triangle edges, then scanline
for (auto y = minPix.y; y <= maxPix.y; ++y)
for (auto x = minPix.x; x <= maxPix.x; ++x)
{
auto const pos = tg::pos<2, ScalarT>(ScalarT(x), ScalarT(y)) + offset;
auto const bary = coordinates(t, pos);
auto const a = bary[0];
auto const b = bary[1];
auto const c = bary[2];
if (a >= 0 && b >= 0 && c >= 0)
{
// inside triangle
f(ipos2(x, y), a, b);
}
}
}
} // namespace tg
| 32.101754 | 141 | 0.529675 | rovedit |
f677471113ab9a5273f15f27f139c97467d6fbfb | 15,862 | cpp | C++ | quantitative_finance/L2/tests/GarmanKohlhagenEngine/src/host/gk_test.cpp | Geekdude/Vitis_Libraries | bca52cee88c07e9ccbec90c00e6df98f4b450ec1 | [
"Apache-2.0"
] | 1 | 2020-10-27T07:37:10.000Z | 2020-10-27T07:37:10.000Z | quantitative_finance/L2/tests/GarmanKohlhagenEngine/src/host/gk_test.cpp | Geekdude/Vitis_Libraries | bca52cee88c07e9ccbec90c00e6df98f4b450ec1 | [
"Apache-2.0"
] | null | null | null | quantitative_finance/L2/tests/GarmanKohlhagenEngine/src/host/gk_test.cpp | Geekdude/Vitis_Libraries | bca52cee88c07e9ccbec90c00e6df98f4b450ec1 | [
"Apache-2.0"
] | 1 | 2021-04-28T05:58:38.000Z | 2021-04-28T05:58:38.000Z | /*
* Copyright 2019 Xilinx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file gk_test.cpp
* @brief Testbench to generate randomized input data and launch on kernel.
* Results are compared to a full precision model.
*/
#include <stdio.h>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <chrono>
#include "gk_host.hpp"
#include "xcl2.hpp"
/// @def Controls the data type used in the kernel
#define KERNEL_DT float
// Temporary copy of this macro definition until new xcl2.hpp is used
#define OCL_CHECK(error, call) \
call; \
if (error != CL_SUCCESS) { \
printf("%s:%d Error calling " #call ", error code is: %d\n", __FILE__, __LINE__, error); \
exit(EXIT_FAILURE); \
}
static void usage(std::string exe) {
std::cout << "Usage: " << exe << " ./xclbin/<kernel_name> <test data file>" << std::endl;
std::cout << "Test data file line format:" << std::endl;
std::cout << "s=<value>, k=<value>, r_domestic=<value>1, r_foreign=<value>1, v=<value>1, t=<value>" << std::endl;
std::cout << "# comments out the line" << std::endl;
}
static int validate_parameters(int argc, char* argv[]) {
/* check 2 arguments specified */
if (argc != 3) {
usage(argv[0]);
return 0;
}
/* check xclbin file exists */
std::ifstream ifs1(argv[1]);
if (!ifs1.is_open()) {
std::cout << "ERROR: cannot open " << argv[1] << std::endl;
return 0;
}
/* check test data file exists */
std::ifstream ifs2(argv[2]);
if (!ifs2.is_open()) {
std::cout << "ERROR: cannot open " << argv[2] << std::endl;
return 0;
}
return 1;
}
/// @brief Main entry point to test
///
/// This is a command-line application to test the kernel. It supports software
/// and hardware emulation as well as
/// running on an Alveo target.
///
/// Usage: ./gk_test ./xclbin/<kernel_name> <test data file>
///
/// @param[in] argc Standard C++ argument count
/// @param[in] argv Standard C++ input arguments
int main(int argc, char* argv[]) {
std::cout << std::endl << std::endl;
std::cout << "**************************" << std::endl;
std::cout << "Garman-Kohlhagen Demo v1.0" << std::endl;
std::cout << "**************************" << std::endl;
std::cout << std::endl;
if (!validate_parameters(argc, argv)) {
exit(1);
}
// parse the input test data file
std::vector<struct parsed_params*>* vect = parse_file(argv[2]);
if (vect == nullptr) {
return 1;
}
unsigned int num = vect->size();
// kernel expects multiple of 16 input data
unsigned int remainder = num % 16;
unsigned int extra = 0;
if (remainder != 0) {
extra = 16 - remainder;
}
unsigned int modified_num = num + extra;
// Test parameters
static const unsigned int call = 1;
std::string xclbin_file(argv[1]);
// Vectors for parameter storage. These use an aligned allocator in order
// to avoid an additional copy of the host memory into the device
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > s(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > v(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > r_domestic(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > r_foreign(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > t(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > k(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > price(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > delta(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > gamma(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > vega(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > theta(modified_num);
std::vector<KERNEL_DT, aligned_allocator<KERNEL_DT> > rho(modified_num);
// Host results (always double precision)
double* host_price = new double[modified_num];
double* host_delta = new double[modified_num];
double* host_gamma = new double[modified_num];
double* host_vega = new double[modified_num];
double* host_theta = new double[modified_num];
double* host_rho = new double[modified_num];
// write the test data to the input vectors and calculate the model results
std::cout << "Generating reference results..." << std::endl;
for (unsigned int i = 0; i < num; i++) {
s[i] = vect->at(i)->s;
v[i] = vect->at(i)->v;
t[i] = vect->at(i)->t;
k[i] = vect->at(i)->k;
r_domestic[i] = vect->at(i)->r_domestic;
r_foreign[i] = vect->at(i)->r_foreign;
}
for (unsigned int i = num; i < modified_num; i++) {
s[i] = 0;
v[i] = 0;
t[i] = 0;
k[i] = 0;
r_domestic[i] = 0;
r_foreign[i] = 0;
}
std::cout << "Running CPU model..." << std::endl;
auto t_start = std::chrono::high_resolution_clock::now();
for (unsigned int i = 0; i < num; i++) {
gk_model(s[i], v[i], r_domestic[i], t[i], k[i], r_foreign[i], call, host_price[i], host_delta[i], host_gamma[i],
host_vega[i], host_theta[i], host_rho[i]);
}
auto cpu_duration =
std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - t_start)
.count();
// OPENCL HOST CODE AREA START
// get_xil_devices() is a utility API which will find the xilinx
// platforms and will return list of devices connected to Xilinx platform
std::cout << "Connecting to device and loading kernel..." << std::endl;
std::vector<cl::Device> devices = xcl::get_xil_devices();
cl::Device device = devices[0];
cl_int err;
OCL_CHECK(err, cl::Context context(device, NULL, NULL, NULL, &err));
OCL_CHECK(err, cl::CommandQueue cq(context, device, CL_QUEUE_PROFILING_ENABLE, &err));
// Load the binary file (using function from xcl2.cpp)
cl::Program::Binaries bins = xcl::import_binary_file(xclbin_file);
devices.resize(1);
OCL_CHECK(err, cl::Program program(context, devices, bins, NULL, &err));
OCL_CHECK(err, cl::Kernel krnl_cfGKEngine(program, "gk_kernel", &err));
// Allocate Buffer in Global Memory
// Buffers are allocated using CL_MEM_USE_HOST_PTR for efficient memory and
// Device-to-host communication
std::cout << "Allocating buffers..." << std::endl;
OCL_CHECK(err, cl::Buffer buffer_s(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), s.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_v(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), v.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_r_domestic(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), r_domestic.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_t(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), t.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_k(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), k.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_r_foreign(context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY,
modified_num * sizeof(KERNEL_DT), r_foreign.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_price(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), price.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_delta(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), delta.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_gamma(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), gamma.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_vega(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), vega.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_theta(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), theta.data(), &err));
OCL_CHECK(err, cl::Buffer buffer_rho(context, CL_MEM_USE_HOST_PTR | CL_MEM_WRITE_ONLY,
modified_num * sizeof(KERNEL_DT), rho.data(), &err));
// Set the arguments
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(0, buffer_s));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(1, buffer_v));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(2, buffer_r_domestic));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(3, buffer_t));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(4, buffer_k));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(5, buffer_r_foreign));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(6, call));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(7, modified_num));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(8, buffer_price));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(9, buffer_delta));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(10, buffer_gamma));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(11, buffer_vega));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(12, buffer_theta));
OCL_CHECK(err, err = krnl_cfGKEngine.setArg(13, buffer_rho));
// Copy input data to device global memory
t_start = std::chrono::high_resolution_clock::now();
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_s}, 0));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_v}, 0));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_r_domestic}, 0));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_t}, 0));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_k}, 0));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_r_foreign}, 0));
// Launch the Kernel
std::cout << "Launching kernel..." << std::endl;
uint64_t nstimestart, nstimeend;
cl::Event event;
OCL_CHECK(err, err = cq.enqueueTask(krnl_cfGKEngine, NULL, &event));
OCL_CHECK(err, err = cq.finish());
OCL_CHECK(err, err = event.getProfilingInfo<uint64_t>(CL_PROFILING_COMMAND_START, &nstimestart));
OCL_CHECK(err, err = event.getProfilingInfo<uint64_t>(CL_PROFILING_COMMAND_END, &nstimeend));
auto duration_nanosec = nstimeend - nstimestart;
// Copy Result from Device Global Memory to Host Local Memory
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_price}, CL_MIGRATE_MEM_OBJECT_HOST));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_delta}, CL_MIGRATE_MEM_OBJECT_HOST));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_gamma}, CL_MIGRATE_MEM_OBJECT_HOST));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_vega}, CL_MIGRATE_MEM_OBJECT_HOST));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_theta}, CL_MIGRATE_MEM_OBJECT_HOST));
OCL_CHECK(err, err = cq.enqueueMigrateMemObjects({buffer_rho}, CL_MIGRATE_MEM_OBJECT_HOST));
cq.finish();
auto fpga_duration =
std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - t_start)
.count();
// OPENCL HOST CODE AREA END
// Check results
double max_price_diff = 0.0f;
double max_delta_diff = 0.0f;
double max_gamma_diff = 0.0f;
double max_vega_diff = 0.0f;
double max_theta_diff = 0.0f;
double max_rho_diff = 0.0f;
for (unsigned int i = 0; i < num; i++) {
double temp = 0.0f;
std::cout << price[i] << " " << host_price[i] << " diff = " << price[i] - host_price[i] << std::endl;
if (std::abs(temp = (price[i] - host_price[i])) > std::abs(max_price_diff)) max_price_diff = temp;
if (std::abs(temp = (delta[i] - host_delta[i])) > std::abs(max_delta_diff)) max_delta_diff = temp;
if (std::abs(temp = (gamma[i] - host_gamma[i])) > std::abs(max_gamma_diff)) max_gamma_diff = temp;
if (std::abs(temp = (vega[i] - host_vega[i])) > std::abs(max_vega_diff)) max_vega_diff = temp;
if (std::abs(temp = (theta[i] - host_theta[i])) > std::abs(max_theta_diff)) max_theta_diff = temp;
if (std::abs(temp = (rho[i] - host_rho[i])) > std::abs(max_rho_diff)) max_rho_diff = temp;
}
std::cout << "Kernel done!" << std::endl;
std::cout << "Comparing results..." << std::endl;
std::cout << "Processed " << num;
if (call) {
std::cout << " call options:" << std::endl;
} else {
std::cout << " put options:" << std::endl;
}
std::cout << "Throughput = " << (1.0 * num) / (duration_nanosec * 1.0e-9) / 1.0e6 << " Mega options/sec"
<< std::endl;
std::cout << std::endl;
std::cout << " Largest host-kernel price difference = " << max_price_diff << std::endl;
std::cout << " Largest host-kernel delta difference = " << max_delta_diff << std::endl;
std::cout << " Largest host-kernel gamma difference = " << max_gamma_diff << std::endl;
std::cout << " Largest host-kernel vega difference = " << max_vega_diff << std::endl;
std::cout << " Largest host-kernel theta difference = " << max_theta_diff << std::endl;
std::cout << " Largest host-kernel rho difference = " << max_rho_diff << std::endl;
std::cout << "CPU execution time = " << cpu_duration << "us" << std::endl;
std::cout << "FPGA time returned by profile API = " << (duration_nanosec * (1.0e-6)) << " ms"
<< std::endl;
std::cout << "FPGA execution time (including mem transfer)= " << fpga_duration << "us" << std::endl;
int ret = 0;
if (std::abs(max_price_diff) > 6.0e-5) {
std::cout << "FAIL: max_price_diff = " << max_price_diff << std::endl;
ret = 1;
}
if (std::abs(max_delta_diff) > 4.0e-7) {
std::cout << "FAIL: max_delta_diff = " << max_delta_diff << std::endl;
ret = 1;
}
if (std::abs(max_gamma_diff) > 3.0e-7) {
std::cout << "FAIL: max_gamma_diff = " << max_gamma_diff << std::endl;
ret = 1;
}
if (std::abs(max_vega_diff) > 6.0e-7) {
std::cout << "FAIL: max_vega_diff = " << max_vega_diff << std::endl;
ret = 1;
}
if (std::abs(max_theta_diff) > 5.0e-8) {
std::cout << "FAIL: max_theta_diff = " << max_theta_diff << std::endl;
ret = 1;
}
if (std::abs(max_rho_diff) > 6.0e-7) {
std::cout << "FAIL: max_rho_diff = " << max_rho_diff << std::endl;
ret = 1;
}
if (!ret) {
std::cout << "PASS" << std::endl;
}
return ret;
}
| 47.208333 | 120 | 0.619279 | Geekdude |
f679521d60113e4d94f7538beb9a775997eb4066 | 4,002 | cpp | C++ | stl/src/xstoxflt.cpp | oktonion/STL | e2fce45b9ca899f3887b7fa48e24de95859a7b8e | [
"Apache-2.0"
] | 2 | 2021-01-19T02:43:19.000Z | 2021-11-20T05:21:42.000Z | stl/src/xstoxflt.cpp | tapaswenipathak/STL | 0d75fc5ab6684d4f6239879a6ec162aad0da860d | [
"Apache-2.0"
] | null | null | null | stl/src/xstoxflt.cpp | tapaswenipathak/STL | 0d75fc5ab6684d4f6239879a6ec162aad0da860d | [
"Apache-2.0"
] | 4 | 2020-04-24T05:04:54.000Z | 2020-05-17T22:48:58.000Z | // Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// _Stoxflt function
#include "xmath.h"
#include <ctype.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
_EXTERN_C_UNLESS_PURE
constexpr int _Base = 16; // hexadecimal
constexpr int _Ndig = 7; // hexadecimal digits per long element
constexpr int _Maxsig = 5 * _Ndig; // maximum significant digits to keep
int _Stoxflt(const char* s0, const char* s, char** endptr, long lo[],
int maxsig) { // convert string to array of long plus exponent
char buf[_Maxsig + 1]; // worst case, with room for rounding digit
int nsig = 0; // number of significant digits seen
int seen = 0; // any valid field characters seen
int word = 0; // current long word to fill
const char* pd;
static const char digits[] = "0123456789abcdefABCDEF";
static const char vals[] = {// values of hex digits
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15};
maxsig *= _Ndig; // convert word count to digit count
if (_Maxsig < maxsig) {
maxsig = _Maxsig; // protect against bad call
}
lo[0] = 0; // power of ten exponent
lo[1] = 0; // first _Ndig-digit word of fraction
while (*s == '0') { // strip leading zeros
++s;
seen = 1;
}
while ((pd = (char*) memchr(&digits[0], *s, 22)) != 0) {
if (nsig <= maxsig) {
buf[nsig++] = vals[pd - digits]; // accumulate a digit
} else {
++lo[0]; // too many digits, just scale exponent
}
++s;
seen = 1;
}
if (*s == localeconv()->decimal_point[0]) {
++s;
}
if (nsig == 0) {
for (; *s == '0'; ++s, seen = 1) {
--lo[0]; // strip zeros after point
}
}
for (; (pd = (char*) memchr(&digits[0], *s, 22)) != 0; ++s, seen = 1) {
if (nsig <= maxsig) { // accumulate a fraction digit
buf[nsig++] = vals[pd - digits];
--lo[0];
}
}
if (maxsig < nsig) { // discard excess digit after rounding up
if (_Base / 2 <= buf[maxsig]) {
++buf[maxsig - 1]; // okay if digit becomes _Base
}
nsig = maxsig;
++lo[0];
}
for (; 0 < nsig && buf[nsig - 1] == '\0'; --nsig) {
++lo[0]; // discard trailing zeros
}
if (nsig == 0) {
buf[nsig++] = '\0'; // ensure at least one digit
}
lo[0] <<= 2; // change hex exponent to binary exponent
if (seen) { // convert digit sequence to words
int bufidx = 0; // next digit in buffer
int wordidx = _Ndig - nsig % _Ndig; // next digit in word (% _Ndig)
word = wordidx % _Ndig == 0 ? 0 : 1;
for (; bufidx < nsig; ++wordidx, ++bufidx) {
if (wordidx % _Ndig == 0) {
lo[++word] = buf[bufidx];
} else {
lo[word] = lo[word] * _Base + buf[bufidx];
}
}
if (*s == 'p' || *s == 'P') { // parse exponent
const char* ssav = s;
const char esign = *++s == '+' || *s == '-' ? *s++ : '+';
int eseen = 0;
long lexp = 0;
for (; isdigit((unsigned char) *s); ++s, eseen = 1) {
if (lexp < 100000000) { // else overflow
lexp = lexp * 10 + (unsigned char) *s - '0';
}
}
if (esign == '-') {
lexp = -lexp;
}
lo[0] += lexp;
if (!eseen) {
s = ssav; // roll back if incomplete exponent
}
}
}
if (!seen) {
word = 0; // return zero if bad parse
}
if (endptr) {
*endptr = (char*) (seen ? s : s0); // roll back if bad parse
}
return word;
}
_END_EXTERN_C_UNLESS_PURE
| 29.211679 | 87 | 0.471514 | oktonion |
f67acb0effd9cdec60c1fd0d041181f032eba566 | 603 | cpp | C++ | Nyx/VelocityComponent.cpp | Rykkata/nyx | 72d6f222a123e6f120cf83b4843e029036a0d8a9 | [
"Apache-2.0"
] | null | null | null | Nyx/VelocityComponent.cpp | Rykkata/nyx | 72d6f222a123e6f120cf83b4843e029036a0d8a9 | [
"Apache-2.0"
] | null | null | null | Nyx/VelocityComponent.cpp | Rykkata/nyx | 72d6f222a123e6f120cf83b4843e029036a0d8a9 | [
"Apache-2.0"
] | null | null | null | #include "VelocityComponent.h"
VelocityComponent::VelocityComponent()
{
m_xVelocity = 0;
m_yVelocity = 0;
}
VelocityComponent::~VelocityComponent()
{
}
VelocityComponent::VelocityComponent(int xVelocity, int yVelocity)
{
}
int VelocityComponent::GetXVelocity()
{
return 0;
}
int VelocityComponent::GetYVelocity()
{
return 0;
}
int VelocityComponent::SetXVelocity(int newXVelocity)
{
return 0;
}
int VelocityComponent::SetYVelocity(int newYVelocity)
{
return 0;
}
const char* VelocityComponent::GetComponentType() const
{
return TYPE;
} | 12.829787 | 67 | 0.693201 | Rykkata |
f67af4da2a2e637137d602437569600f4c040819 | 1,758 | cpp | C++ | Dev/Cpp/Viewer/3D/EffectSetting.cpp | Shockblast/Effekseer | bac86c0fc965f04a0f57c5863d37a9c2d5c3be97 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-12-21T07:03:42.000Z | 2021-12-21T07:03:42.000Z | Dev/Cpp/Viewer/3D/EffectSetting.cpp | Shockblast/Effekseer | bac86c0fc965f04a0f57c5863d37a9c2d5c3be97 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Dev/Cpp/Viewer/3D/EffectSetting.cpp | Shockblast/Effekseer | bac86c0fc965f04a0f57c5863d37a9c2d5c3be97 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #include "EffectSetting.h"
#include "../Graphics/GraphicsDevice.h"
#include "../Sound/SoundDevice.h"
#include "FileInterface.h"
#ifdef _WIN32
#include "../Graphics/Platform/DX11/efk.GraphicsDX11.h"
#endif
#include "../Graphics/Platform/GL/efk.GraphicsGL.h"
#include <EffekseerSoundOSMixer.h>
namespace Effekseer::Tool
{
std::shared_ptr<EffectSetting> EffectSetting::Create(std::shared_ptr<Effekseer::Tool::GraphicsDevice> graphicsDevice, std::shared_ptr<Effekseer::Tool::SoundDevice> soundDevice)
{
auto ret = std::make_shared<EffectSetting>();
auto setting = Effekseer::Setting::Create();
ret->setting_ = setting;
auto gd = graphicsDevice->GetGraphics()->GetGraphicsDevice();
auto fileInterface = Effekseer::MakeRefPtr<Effekseer::Tool::EffekseerFile>();
auto textureLoader = EffekseerRenderer::CreateTextureLoader(
gd,
fileInterface,
graphicsDevice->GetIsSRGBMode() ? ::Effekseer::ColorSpaceType::Linear : ::Effekseer::ColorSpaceType::Gamma);
setting->SetTextureLoader(textureLoader);
auto modelLoader = EffekseerRenderer::CreateModelLoader(gd, fileInterface);
setting->SetModelLoader(modelLoader);
setting->SetCurveLoader(Effekseer::CurveLoaderRef(new ::Effekseer::CurveLoader(fileInterface)));
if (soundDevice != nullptr)
{
setting->SetSoundLoader(soundDevice->GetSound()->CreateSoundLoader(fileInterface));
}
if (graphicsDevice->GetDeviceType() == DeviceType::DirectX11)
{
#ifdef _WIN32
setting->SetMaterialLoader(EffekseerRendererDX11::CreateMaterialLoader(gd, fileInterface));
#endif
}
else if (graphicsDevice->GetDeviceType() == DeviceType::OpenGL)
{
setting->SetMaterialLoader(EffekseerRendererGL::CreateMaterialLoader(gd, fileInterface));
}
return ret;
return nullptr;
}
} // namespace Effekseer::Tool | 29.79661 | 176 | 0.771331 | Shockblast |
f67c8ae0b3ed6985b7284832d69f3be9b2ef8a82 | 27,569 | cpp | C++ | src/tools/CHapticPoint.cpp | Yung-Quant/elec490 | 09314b1c3f4f061effa396c104f094f28a0aabff | [
"BSD-3-Clause"
] | null | null | null | src/tools/CHapticPoint.cpp | Yung-Quant/elec490 | 09314b1c3f4f061effa396c104f094f28a0aabff | [
"BSD-3-Clause"
] | null | null | null | src/tools/CHapticPoint.cpp | Yung-Quant/elec490 | 09314b1c3f4f061effa396c104f094f28a0aabff | [
"BSD-3-Clause"
] | null | null | null | //==============================================================================
/*
Software License Agreement (BSD License)
Copyright (c) 2003-2016, CHAI3D.
(www.chai3d.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of CHAI3D nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
\author <http://www.chai3d.org>
\author Francois Conti
\version $MAJOR.$MINOR.$RELEASE $Rev: 2158 $
*/
//==============================================================================
//------------------------------------------------------------------------------
#include "tools/CHapticPoint.h"
//------------------------------------------------------------------------------
#include "tools/CGenericTool.h"
#include "world/CMultiMesh.h"
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
namespace chai3d {
//------------------------------------------------------------------------------
//==============================================================================
/*!
Constructor of cHapticPoint.
*/
//==============================================================================
cHapticPoint::cHapticPoint(cGenericTool* a_parentTool)
{
// set parent tool
m_parentTool = a_parentTool;
// initialize variables
m_radiusDisplay = 0.0;
m_radiusContact = 0.0;
m_lastComputedGlobalForce.zero();
m_meshProxyContacts[0] = NULL;
m_meshProxyContacts[1] = NULL;
m_meshProxyContacts[2] = NULL;
m_audioSourceImpact[0] = NULL;
m_audioSourceImpact[1] = NULL;
m_audioSourceImpact[2] = NULL;
m_audioSourceFriction[0] = NULL;
m_audioSourceFriction[1] = NULL;
m_audioSourceFriction[2] = NULL;
m_audioProxyContacts[0] = NULL;
m_audioProxyContacts[1] = NULL;
m_audioProxyContacts[2] = NULL;
m_useAudioSources = false;
// create finger-proxy algorithm used for modelling contacts with
// cMesh objects.
m_algorithmFingerProxy = new cAlgorithmFingerProxy();
// create potential field algorithm used for modelling interaction
// forces with haptic effects.
m_algorithmPotentialField = new cAlgorithmPotentialField();
// create sphere object used for rendering the Proxy position.
m_sphereProxy = new cShapeSphere(0.0);
// create sphere object used for rendering the Goal position.
m_sphereGoal = new cShapeSphere(0.0);
// Set default radius of proxy and goal spheres
setRadius(0.01, 0.01);
// define a color for the proxy sphere
m_sphereProxy->m_material->setGrayDim();
// define a color for the goal sphere
m_sphereGoal->m_material->setGrayLight();
// Initialize force rendering algorithms
initialize(cVector3d(0.0, 0.0, 0.0));
}
//==============================================================================
/*!
Destructor of cHapticPoint.
*/
//==============================================================================
cHapticPoint::~cHapticPoint()
{
// delete force rendering algorithms
delete m_algorithmFingerProxy;
delete m_algorithmPotentialField;
// delete graphical spheres (proxy and goal)
delete m_sphereProxy;
delete m_sphereGoal;
// delete audio sources for impact
for (int i = 0; i<3; i++)
{
if (m_audioSourceImpact[i] != NULL)
{
delete m_audioSourceImpact[i];
}
}
// delete audio sources for friction
for (int i = 0; i<3; i++)
{
if (m_audioSourceFriction[i] != NULL)
{
delete m_audioSourceFriction[i];
}
}
}
//==============================================================================
/*!
This method returns the current desired goal position of the contact
point in world global coordinates.
\return Goal position of haptic point.
*/
//==============================================================================
cVector3d cHapticPoint::getGlobalPosGoal()
{
return(m_algorithmFingerProxy->getDeviceGlobalPosition());
}
//==============================================================================
/*!
This method returns the current proxy position of the haptic point in world
global coordinates.
\return Proxy position of haptic point.
*/
//==============================================================================
cVector3d cHapticPoint::getGlobalPosProxy()
{
return(m_algorithmFingerProxy->getProxyGlobalPosition());
}
//==============================================================================
/*!
This method returns the current desired goal position of the haptic point
in local tool coordinates.
\return Goal position of haptic point.
*/
//==============================================================================
cVector3d cHapticPoint::getLocalPosGoal()
{
cMatrix3d rot;
cVector3d newpos;
cVector3d toolGlobalPos = m_parentTool->getGlobalPos();
cMatrix3d toolGlobalRot = m_parentTool->getGlobalRot();
cVector3d pos = m_algorithmFingerProxy->getDeviceGlobalPosition();
toolGlobalRot.transr(rot);
pos.sub(toolGlobalPos);
rot.mulr(pos, newpos);
return(newpos);
}
//==============================================================================
/*!
This method returns the current proxy position of the haptic point in local
tool coordinates.
\return Proxy position of haptic point.
*/
//==============================================================================
cVector3d cHapticPoint::getLocalPosProxy()
{
cMatrix3d rot;
cVector3d newpos;
cVector3d toolGlobalPos = m_parentTool->getGlobalPos();
cMatrix3d toolGlobalRot = m_parentTool->getGlobalRot();
cVector3d pos = m_algorithmFingerProxy->getProxyGlobalPosition();
toolGlobalRot.transr(rot);
pos.sub(toolGlobalPos);
rot.mulr(pos, newpos);
return(newpos);
}
//==============================================================================
/*!
This method resets the position of the proxy to be at the current desired
goal position.
*/
//==============================================================================
void cHapticPoint::initialize()
{
// reset finger proxy algorithm by placing the proxy and the same position
// as the goal.
m_algorithmFingerProxy->reset();
// update position of proxy and goal spheres in tool coordinates
updateSpherePositions();
}
//==============================================================================
/*!
This method initializes the position of the haptic point to a new desired
position. The __proxy__ and the __device__ are set to the same value
despite any constraints.
\param a_globalPos New desired position of the haptic point.
*/
//==============================================================================
void cHapticPoint::initialize(cVector3d a_globalPos)
{
// initialize proxy algorithm.
m_algorithmFingerProxy->initialize(m_parentTool->getParentWorld(), a_globalPos);
m_algorithmPotentialField->initialize(m_parentTool->getParentWorld(), a_globalPos);
// update position of proxy and goal spheres in tool coordinates
updateSpherePositions();
}
//==============================================================================
/*!
This method sets the radius size of the haptic point. The radius affects
the physical radius of the proxy and the radius of the spheres that are used
to render the goal and proxy positions.
\param a_radius New radius for display rendering and contact computation.
*/
//==============================================================================
void cHapticPoint::setRadius(double a_radius)
{
m_radiusContact = a_radius;
m_radiusDisplay = a_radius;
// set the radius of the contact model of the proxy
m_algorithmFingerProxy->setProxyRadius(m_radiusContact);
// set radius of proxy and goal. goal radius is slightly smaller to avoid graphical
// artifacts when both sphere are located at the same position.
m_sphereProxy->setRadius(m_radiusDisplay);
m_sphereGoal->setRadius(0.95 * m_radiusDisplay);
}
//==============================================================================
/*!
This method sets the radius size of the display spheres (goal and proxy) and
physical contact sphere (proxy) used to compute the contact forces.
Setting the a_radiusContact parameter to zero will generally accelerate the
force rendering algorithm. For more realistic effects, settings both
values to be identical is recommended
\param a_radiusDisplay New radius for display of spheres (proxy and goal).
\param a_radiusContact New radius for contact computation (proxy).
*/
//==============================================================================
void cHapticPoint::setRadius(double a_radiusDisplay, double a_radiusContact)
{
m_radiusContact = a_radiusContact;
m_radiusDisplay = a_radiusDisplay;
// set the radius of the contact model of the proxy
m_algorithmFingerProxy->setProxyRadius(m_radiusContact);
// set radius of proxy and goal. goal radius is slightly smaller to avoid graphical
// artifacts when both sphere are located at the same position.
m_sphereProxy->setRadius(m_radiusDisplay);
m_sphereGoal->setRadius(0.95 * m_radiusDisplay);
}
//==============================================================================
/*!
This method sets the radius size of the physical proxy.
\param a_radiusContact New radius for contact computation (proxy).
*/
//==============================================================================
void cHapticPoint::setRadiusContact(double a_radiusContact)
{
m_radiusContact = a_radiusContact;
// set the radius of the contact model of the proxy
m_algorithmFingerProxy->setProxyRadius(m_radiusContact);
}
//==============================================================================
/*!
This method sets the radius size of the sphere used to display the proxy
and goal position.
\param a_radiusDisplay New radius for display of spheres (proxy and goal).
*/
//==============================================================================
void cHapticPoint::setRadiusDisplay(double a_radiusDisplay)
{
m_radiusDisplay = a_radiusDisplay;
// set radius of proxy and goal. goal radius is slightly smaller to avoid graphical
// artifacts when both sphere are located at the same position.
m_sphereProxy->setRadius(m_radiusDisplay);
m_sphereGoal->setRadius(0.99 * m_radiusDisplay);
}
//==============================================================================
/*!
This method sets the display options of the goal and proxy spheres.
If both spheres are enabled, a small line is drawn between both spheres.
\param a_showProxy If __true__, then the proxy sphere is displayed.
\param a_showGoal If __true__, then the goal sphere is displayed.
\param a_colorLine Color of line connecting proxy to goal spheres.
*/
//==============================================================================
void cHapticPoint::setShow(bool a_showProxy,
bool a_showGoal,
cColorf a_colorLine)
{
// update display properties of both spheres
m_sphereProxy->setShowEnabled(a_showProxy);
m_sphereGoal->setShowEnabled(a_showGoal);
m_colorLine = a_colorLine;
}
//==============================================================================
/*!
This method creates an audio source for this haptic point.
\param a_audioDevice Audio device.
*/
//==============================================================================
bool cHapticPoint::createAudioSource(cAudioDevice* a_audioDevice)
{
// sanity check
if (a_audioDevice == NULL) { return (C_ERROR); }
// create three audio sources for impact
for (int i=0; i<3; i++)
{
m_audioSourceImpact[i] = new cAudioSource();
}
// create three audio sources for friction
for (int i=0; i<3; i++)
{
m_audioSourceFriction[i] = new cAudioSource();
}
// audio sources have been created and are now enabled
m_useAudioSources = true;
// success
return (C_SUCCESS);
}
//==============================================================================
/*!
This method computes all interaction forces between the tool haptic points
and the virtual environment.
\param a_globalPos New desired goal position.
\param a_globalRot New desired goal rotation.
\param a_globalLinVel Linear velocity of tool.
\param a_globalAngVel Angular velocity of tool.
\return Computed interaction force in world coordinates.
*/
//==============================================================================
cVector3d cHapticPoint::computeInteractionForces(cVector3d& a_globalPos,
cMatrix3d& a_globalRot,
cVector3d& a_globalLinVel,
cVector3d& a_globalAngVel)
{
///////////////////////////////////////////////////////////////////////////
// ALGORITHM FINGER PROXY
///////////////////////////////////////////////////////////////////////////
// we first consider all object the proxy may have been in contact with and
// mark their interaction as no longer active.
for (int i=0; i<3; i++)
{
if (m_meshProxyContacts[i] != NULL)
{
m_meshProxyContacts[i]->m_interactionInside = false;
cMultiMesh* multiMesh = dynamic_cast<cMultiMesh*>(m_meshProxyContacts[i]->getOwner());
if (multiMesh != NULL)
{
multiMesh->m_interactionInside = false;
}
m_meshProxyContacts[i] = NULL;
}
}
// we now update the new position of a goal point and update the proxy position.
// As a result, the force contribution from the proxy is now calculated.
cVector3d force0 = m_algorithmFingerProxy->computeForces(a_globalPos, a_globalLinVel);
// we now flag each mesh for which the proxy may be interacting with. This information is
// necessary for haptic effects that may be associated with these mesh objects.
for (int i=0; i<3; i++)
{
if (m_algorithmFingerProxy->m_collisionEvents[i]->m_object != NULL)
{
m_meshProxyContacts[i] = m_algorithmFingerProxy->m_collisionEvents[i]->m_object;
cGenericObject* object = m_meshProxyContacts[i];
object->m_interactionInside = true;
object->m_interactionPoint = m_algorithmFingerProxy->m_collisionEvents[i]->m_localPos;
object->m_interactionNormal = m_algorithmFingerProxy->m_collisionEvents[i]->m_localNormal;
cMultiMesh* multiMesh = dynamic_cast<cMultiMesh*>(m_meshProxyContacts[i]->getOwner());
if (multiMesh != NULL)
{
multiMesh->m_interactionInside = true;
multiMesh->m_interactionPoint = cAdd(object->getLocalPos(), cMul(object->getLocalRot(),object->m_interactionPoint));
multiMesh->m_interactionNormal = cMul(object->getLocalRot(), object->m_interactionNormal);
}
}
}
///////////////////////////////////////////////////////////////////////////
// ALGORITHM POTENTIAL FIELD
///////////////////////////////////////////////////////////////////////////
// compute interaction forces (haptic effects) in world coordinates between tool and all
// objects for which haptic effects have been programmed
cVector3d force1 = m_algorithmPotentialField->computeForces(a_globalPos, a_globalLinVel);
///////////////////////////////////////////////////////////////////////////
// FINALIZATION
///////////////////////////////////////////////////////////////////////////
// update position of proxy and goal spheres in tool coordinates
updateSpherePositions();
// finally return the contribution from both force models.
force0.addr(force1, m_lastComputedGlobalForce);
///////////////////////////////////////////////////////////////////////////
// AUDIO
///////////////////////////////////////////////////////////////////////////
// force magnitude
double force = m_lastComputedGlobalForce.length();
// velocity of tool
double velocity = m_parentTool->getDeviceGlobalLinVel().length();
// friction sound
if (m_useAudioSources)
{
for (int i=0; i<3; i++)
{
///////////////////////////////////////////////////////////////////
// FRICTION SOUND
///////////////////////////////////////////////////////////////////
m_audioSourceFriction[i]->setSourcePos(a_globalPos);
// if tool is not in contact, or material does not exist, turn off sound.
if (m_meshProxyContacts[i] == NULL)
{
m_audioSourceFriction[i]->setGain(0.0);
}
// if tool is in contact and material exist
else
{
// check if tool is touching a new material, in which case we swap audio buffers
if (m_meshProxyContacts[i]->m_material->getAudioFrictionBuffer() != NULL)
{
if (m_audioSourceFriction[i]->getAudioBuffer() != m_meshProxyContacts[i]->m_material->getAudioFrictionBuffer())
{
m_audioSourceFriction[i]->stop();
m_audioSourceFriction[i]->setGain(0.0);
m_audioSourceFriction[i]->setPitch(1.0);
m_audioSourceFriction[i]->setAudioBuffer(m_meshProxyContacts[i]->m_material->getAudioFrictionBuffer());
m_audioSourceFriction[i]->setLoop(true);
m_audioSourceFriction[i]->play();
}
}
// we compute an angle that compares the velocity of the tool with the reaction force. This friction maximizes
// returns a value between o.0 and 1.0 which maximize tangential forces, versus normal forces. The higher
// the tangential force, the higher the sound level. This is slightly hacky but could be improved by
// taking the exact tangential component of the force.
double angleFactor = 0.0;
if ((force > C_SMALL) && (velocity > C_SMALL))
{
angleFactor = cSqr(cSqr(sin(cAngle(m_lastComputedGlobalForce, m_parentTool->getDeviceGlobalLinVel())))) ;
}
// adjust audio gains according to material properties, and force and velocity of tool.
m_audioSourceFriction[i]->setGain((float)(m_meshProxyContacts[i]->m_material->getAudioFrictionGain() * angleFactor * force * cSqr(velocity)));
m_audioSourceFriction[i]->setPitch((float)(m_meshProxyContacts[i]->m_material->getAudioFrictionPitchOffset() + m_meshProxyContacts[i]->m_material->getAudioFrictionPitchGain() * velocity));
}
///////////////////////////////////////////////////////////////////
// IMAPCT SOUND
///////////////////////////////////////////////////////////////////
m_audioSourceImpact[i]->setSourcePos(a_globalPos);
if ((m_audioProxyContacts[i] == NULL) && (m_meshProxyContacts[i] != NULL))
{
if ((m_audioSourceImpact[i]->getAudioBuffer() != m_meshProxyContacts[i]->m_material->getAudioImpactBuffer()) &&
(m_meshProxyContacts[i]->m_material->getAudioImpactBuffer() != NULL))
{
m_audioSourceImpact[i]->stop();
m_audioSourceImpact[i]->setAudioBuffer(m_meshProxyContacts[i]->m_material->getAudioImpactBuffer());
m_audioSourceImpact[i]->setLoop(false);
}
m_audioSourceImpact[i]->setGain((float)(m_meshProxyContacts[i]->m_material->getAudioImpactGain() * cSqr(velocity)));
m_audioSourceImpact[i]->play();
}
// update contact list
m_audioProxyContacts[i] = m_meshProxyContacts[i];
}
}
// return result
return (m_lastComputedGlobalForce);
}
//==============================================================================
/*!
This method checks if the tool is touching a particular object passed
as argument.
\param a_object Object to checked for possible contact.
\return __true__ if the object is in contact with tool, __false__ otherwise.
*/
//==============================================================================
bool cHapticPoint::isInContact(cGenericObject* a_object)
{
/////////////////////////////////////////////////////////////////////
// verify finger-proxy algorithm
/////////////////////////////////////////////////////////////////////
// contact 0
if (m_algorithmFingerProxy->m_collisionEvents[0]->m_object == a_object)
{
return (true);
}
// contact 1
if ((m_algorithmFingerProxy->m_collisionEvents[0]->m_object != NULL) &&
(m_algorithmFingerProxy->m_collisionEvents[1]->m_object == a_object))
{
return (true);
}
// contact 2
if ((m_algorithmFingerProxy->m_collisionEvents[0]->m_object != NULL) &&
(m_algorithmFingerProxy->m_collisionEvents[1]->m_object != NULL) &&
(m_algorithmFingerProxy->m_collisionEvents[2]->m_object == a_object))
{
return (true);
}
/////////////////////////////////////////////////////////////////////
// verify potential-field algorithm
/////////////////////////////////////////////////////////////////////
unsigned int num = (int)(m_algorithmPotentialField->m_interactionRecorder.m_interactions.size());
unsigned int i = 0;
while (i < num)
{
// check next interaction
if (m_algorithmPotentialField->m_interactionRecorder.m_interactions[i].m_object == a_object)
{
return (true);
}
// increment counter
i++;
}
// no object in contact
return (false);
}
//==============================================================================
/*!
This method renders the tool graphically using OpenGL.
\param a_options Rendering options.
*/
//==============================================================================
void cHapticPoint::render(cRenderOptions& a_options)
{
#ifdef C_USE_OPENGL
/////////////////////////////////////////////////////////////////////////
// Render parts that are always opaque
/////////////////////////////////////////////////////////////////////////
if (SECTION_RENDER_OPAQUE_PARTS_ONLY(a_options))
{
// render line only if both spheres are enabled for display
if (m_sphereProxy->getShowEnabled() && m_sphereGoal->getShowEnabled())
{
// disable lighting
glDisable(GL_LIGHTING);
// points describe line extremities
cVector3d posA = m_sphereProxy->getLocalPos();
cVector3d posB = m_sphereGoal->getLocalPos();
// draw line
glBegin(GL_LINES);
m_colorLine.render();
glVertex3dv(&posA(0) );
glVertex3dv(&posB(0) );
glEnd();
// restore lighting to default value
glEnable(GL_LIGHTING);
}
}
/////////////////////////////////////////////////////////////////////////
// Render other objects
/////////////////////////////////////////////////////////////////////////
// render proxy sphere
m_sphereProxy->renderSceneGraph(a_options);
// render goal sphere
m_sphereGoal->renderSceneGraph(a_options);
// render proxy algorithm (debug purposes)
//m_algorithmFingerProxy->render(a_options);
#endif
}
//==============================================================================
/*!
This method updates the position of the spheres in tool coordinates.
The position of the actual proxy and goal spheres need to be expressed in the
tool's local coordinate system. This comes from the fact that the contact
points are rendered at the same time as the tool, respectively when the
OpenGL model view matrix corresponds to the one of the parent tool.
*/
//==============================================================================
void cHapticPoint::updateSpherePositions()
{
// sanity check
if (m_parentTool == NULL) { return; }
// position and orientation of tool in world global coordinates
cMatrix3d toolGlobalRot = m_parentTool->getGlobalRot();
// temp variables
cVector3d pos;
cMatrix3d rot;
toolGlobalRot.transr(rot);
// update position of proxy sphere
pos = getLocalPosProxy();
m_sphereProxy->setLocalPos(pos);
// update position of goal sphere
pos = getLocalPosGoal();
m_sphereGoal->setLocalPos(pos);
}
//------------------------------------------------------------------------------
} // namespace chai3d
//------------------------------------------------------------------------------
| 38.131397 | 205 | 0.526606 | Yung-Quant |
f67ea69d5ae165dfde1adcbcd5d28d00ace9b8c0 | 7,852 | hpp | C++ | engine/pmem_allocator/free_list.hpp | ZiyanShi/kvdk | ad8129a56bda0df645eb9bb0c7af7632a5521a0f | [
"BSD-3-Clause"
] | 100 | 2021-07-22T03:26:07.000Z | 2022-03-31T02:13:41.000Z | engine/pmem_allocator/free_list.hpp | ZiyanShi/kvdk | ad8129a56bda0df645eb9bb0c7af7632a5521a0f | [
"BSD-3-Clause"
] | 60 | 2021-08-09T03:38:33.000Z | 2022-03-30T08:54:25.000Z | engine/pmem_allocator/free_list.hpp | ZiyanShi/kvdk | ad8129a56bda0df645eb9bb0c7af7632a5521a0f | [
"BSD-3-Clause"
] | 37 | 2021-08-05T08:13:14.000Z | 2022-03-30T11:35:56.000Z | /* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2021 Intel Corporation
*/
#pragma once
#include <memory>
#include <set>
#include "../allocator.hpp"
#include "../utils/utils.hpp"
#include "kvdk/namespace.hpp"
namespace KVDK_NAMESPACE {
constexpr uint32_t kFreelistMaxClassifiedBlockSize = 255;
constexpr uint32_t kSpaceMapLockGranularity = 64;
class PMEMAllocator;
// A byte map to record free blocks of PMem space, used for merging adjacent
// free space entries in the free list
class SpaceMap {
public:
SpaceMap(uint64_t num_blocks)
: map_(num_blocks, {false, 0}),
lock_granularity_(kSpaceMapLockGranularity),
map_spins_(num_blocks / lock_granularity_ + 1) {}
uint64_t TestAndUnset(uint64_t offset, uint64_t length);
uint64_t TryMerge(uint64_t offset, uint64_t max_merge_length,
uint64_t min_merge_length);
void Set(uint64_t offset, uint64_t length);
uint64_t Size() { return map_.size(); }
private:
// The highest 1 bit ot the token indicates if this is the start of a space
// entry, the lower 7 bits indicate how many free blocks followed
struct Token {
public:
Token(bool is_start, uint8_t size)
: token_(size | (is_start ? (1 << 7) : 0)) {}
uint8_t Size() { return token_ & INT8_MAX; }
void Clear() { token_ = 0; }
bool Empty() { return Size() == 0; }
bool IsStart() { return token_ & (1 << 7); }
void UnStart() { token_ &= INT8_MAX; }
private:
uint8_t token_;
};
// how many blocks share a lock
const uint32_t lock_granularity_;
std::vector<Token> map_;
// every lock_granularity_ bytes share a spin lock
std::vector<SpinMutex> map_spins_;
};
// free entry pool consists of three level vectors, the first level
// indicates different block size, each block size consists of several free
// space entry lists (the second level), and each list consists of several
// free space entries (the third level).
//
// For a specific block size, a write thread will move a entry list from the
// pool to its thread cache while no usable free space in the cache, and the
// background thread will move cached entry list to the pool for merge and
// balance resource
//
// Organization of the three level vectors:
//
// block size (1st level) entry list (2nd level) entries (3th level)
// 1 ----------------- list1 ------------ entry1
// | |--- entry2
// |----- list2 ------------ entry1
// |--- entry2
// |--- entry3
// ...
// 2 ----------------- list1 ------------ entry1
// | |--- entry2
// | |--- entry3
// |----- list2
// ...
// ...
// max_block_size -------- list1
// |----- list2
class SpaceEntryPool {
public:
SpaceEntryPool(uint32_t max_classified_b_size)
: pool_(max_classified_b_size), spins_(max_classified_b_size) {}
// move a list of b_size free space entries to pool, "src" will be empty
// after move
void MoveEntryList(std::vector<PMemOffsetType> &src, uint32_t b_size) {
std::lock_guard<SpinMutex> lg(spins_[b_size]);
assert(b_size < pool_.size());
pool_[b_size].emplace_back();
pool_[b_size].back().swap(src);
}
// try to fetch a b_size free space entries list from pool to dst
bool TryFetchEntryList(std::vector<PMemOffsetType> &dst, uint32_t b_size) {
if (pool_[b_size].size() != 0) {
std::lock_guard<SpinMutex> lg(spins_[b_size]);
if (pool_[b_size].size() != 0) {
dst.swap(pool_[b_size].back());
pool_[b_size].pop_back();
return true;
}
}
return false;
}
private:
std::vector<std::vector<std::vector<PMemOffsetType>>> pool_;
// Entry lists of a same block size share a spin lock
std::vector<SpinMutex> spins_;
};
class Freelist {
public:
Freelist(uint32_t max_classified_b_size, uint64_t num_segment_blocks,
uint32_t block_size, uint32_t num_threads, uint64_t num_blocks,
PMEMAllocator *allocator)
: num_segment_blocks_(num_segment_blocks), block_size_(block_size),
max_classified_b_size_(max_classified_b_size),
active_pool_(max_classified_b_size),
merged_pool_(max_classified_b_size), space_map_(num_blocks),
flist_thread_cache_(num_threads, max_classified_b_size),
pmem_allocator_(allocator) {}
Freelist(uint64_t num_segment_blocks, uint32_t block_size,
uint32_t num_threads, uint64_t num_blocks, PMEMAllocator *allocator)
: Freelist(kFreelistMaxClassifiedBlockSize, num_segment_blocks,
block_size, num_threads, num_blocks, allocator) {}
// Add a space entry
void Push(const SpaceEntry &entry);
// Request a at least "size" free space entry
bool Get(uint32_t size, SpaceEntry *space_entry);
// Try to merge thread-cached free space entries to get a at least "size"
// entry
bool MergeGet(uint32_t size, SpaceEntry *space_entry);
// Merge adjacent free spaces stored in the entry pool into larger one
//
// Fetch every free space entry lists from active_pool_, for each entry in the
// list, try to merge followed free space with it. Then insert merged entries
// into merged_pool_. After merging, move all entry lists from merged_pool_ to
// active_pool_ for next run. Calculate the minimal timestamp of free entries
// in the pool meantime
// TODO: set a condition to decide if we need to do merging
void MergeAndCheckTSInPool();
// Move cached free space list to space entry pool to balance usable space
// of write threads
//
// Iterate every active entry lists of thread caches, move the list to
// active_pool_, and update minimal timestamp of free entries meantime
void MoveCachedListsToPool();
// Origanize free space entries, including merging adjacent space and move
// thread cached space entries to pool
void OrganizeFreeSpace();
private:
// Each write threads cache some freed space entries in active_entry_offsets
// to avoid contention. To balance free space entries among threads, if too
// many entries cached by a thread, newly freed entries will be stored to
// backup_entries and move to entry pool which shared by all threads.
struct alignas(64) FlistThreadCache {
FlistThreadCache(uint32_t max_classified_b_size)
: active_entry_offsets(max_classified_b_size),
spins(max_classified_b_size) {}
FlistThreadCache() = delete;
FlistThreadCache(FlistThreadCache &&) = delete;
FlistThreadCache(const FlistThreadCache &) = delete;
// Entry size stored in block unit
Array<std::vector<PMemOffsetType>> active_entry_offsets;
// Protect active_entry_offsets
Array<SpinMutex> spins;
};
class SpaceCmp {
public:
bool operator()(const SpaceEntry &s1, const SpaceEntry &s2) const {
return s1.size > s2.size;
}
};
uint64_t MergeSpace(uint64_t offset, uint64_t max_size,
uint64_t min_merge_size) {
if (min_merge_size > max_size) {
return 0;
}
uint64_t size = space_map_.TryMerge(offset, max_size, min_merge_size);
return size;
}
const uint64_t num_segment_blocks_;
const uint32_t block_size_;
const uint32_t max_classified_b_size_;
SpaceMap space_map_;
Array<FlistThreadCache> flist_thread_cache_;
SpaceEntryPool active_pool_;
SpaceEntryPool merged_pool_;
// Store all large free space entries that larger than max_classified_b_size_
std::set<SpaceEntry, SpaceCmp> large_entries_;
SpinMutex large_entries_spin_;
PMEMAllocator *pmem_allocator_;
};
} // namespace KVDK_NAMESPACE
| 35.529412 | 80 | 0.668492 | ZiyanShi |
f67fd54f28ab948d3d0082549649acdf0f75199f | 5,554 | cpp | C++ | src/modules/TUIO/OscPrintReceivedElements.cpp | my-digital-decay/Polycode | 5dd1836bc4710aea175a77433c17696f8330f596 | [
"MIT"
] | null | null | null | src/modules/TUIO/OscPrintReceivedElements.cpp | my-digital-decay/Polycode | 5dd1836bc4710aea175a77433c17696f8330f596 | [
"MIT"
] | null | null | null | src/modules/TUIO/OscPrintReceivedElements.cpp | my-digital-decay/Polycode | 5dd1836bc4710aea175a77433c17696f8330f596 | [
"MIT"
] | null | null | null | /*
oscpack -- Open Sound Control packet manipulation library
http://www.audiomulch.com/~rossb/oscpack
Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.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.
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.
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 "OscPrintReceivedElements.h"
#include <iostream>
#include <iomanip>
#include <ctime>
namespace osc{
std::ostream& operator<<( std::ostream & os,
const ReceivedMessageArgument& arg )
{
switch( arg.TypeTag() ){
case TRUE_TYPE_TAG:
os << "bool:true";
break;
case FALSE_TYPE_TAG:
os << "bool:false";
break;
case NIL_TYPE_TAG:
os << "(Nil)";
break;
case INFINITUM_TYPE_TAG:
os << "(Infinitum)";
break;
case INT32_TYPE_TAG:
os << "int32:" << arg.AsInt32Unchecked();
break;
case FLOAT_TYPE_TAG:
os << "float32:" << arg.AsFloatUnchecked();
break;
case CHAR_TYPE_TAG:
{
char s[2] = {0};
s[0] = arg.AsCharUnchecked();
os << "char:'" << s << "'";
}
break;
case RGBA_COLOR_TYPE_TAG:
{
uint32 color = arg.AsRgbaColorUnchecked();
os << "RGBA:0x"
<< std::hex << std::setfill('0')
<< std::setw(2) << (int)((color>>24) & 0xFF)
<< std::setw(2) << (int)((color>>16) & 0xFF)
<< std::setw(2) << (int)((color>>8) & 0xFF)
<< std::setw(2) << (int)(color & 0xFF)
<< std::setfill(' ');
os.unsetf(std::ios::basefield);
}
break;
case MIDI_MESSAGE_TYPE_TAG:
{
uint32 m = arg.AsMidiMessageUnchecked();
os << "midi (port, status, data1, data2):<<"
<< std::hex << std::setfill('0')
<< "0x" << std::setw(2) << (int)((m>>24) & 0xFF)
<< " 0x" << std::setw(2) << (int)((m>>16) & 0xFF)
<< " 0x" << std::setw(2) << (int)((m>>8) & 0xFF)
<< " 0x" << std::setw(2) << (int)(m & 0xFF)
<< std::setfill(' ') << ">>";
os.unsetf(std::ios::basefield);
}
break;
case INT64_TYPE_TAG:
os << "int64:" << arg.AsInt64Unchecked();
break;
case TIME_TAG_TYPE_TAG:
{
os << "OSC-timetag:" << arg.AsTimeTagUnchecked();
std::time_t t =
(unsigned long)( arg.AsTimeTagUnchecked() >> 32 );
// strip trailing newline from string returned by ctime
const char *timeString = std::ctime( &t );
size_t len = strlen( timeString );
char *s = new char[ len + 1 ];
strcpy( s, timeString );
if( len )
s[ len - 1 ] = '\0';
os << " " << s;
}
break;
case DOUBLE_TYPE_TAG:
os << "double:" << arg.AsDoubleUnchecked();
break;
case STRING_TYPE_TAG:
os << "OSC-string:`" << arg.AsStringUnchecked() << "'";
break;
case SYMBOL_TYPE_TAG:
os << "OSC-string (symbol):`" << arg.AsSymbolUnchecked() << "'";
break;
case BLOB_TYPE_TAG:
{
unsigned long size;
const void *data;
arg.AsBlobUnchecked( data, size );
os << "OSC-blob:<<" << std::hex << std::setfill('0');
unsigned char *p = (unsigned char*)data;
for( unsigned long i = 0; i < size; ++i ){
os << "0x" << std::setw(2) << int(p[i]);
if( i != size-1 )
os << ' ';
}
os.unsetf(std::ios::basefield);
os << ">>" << std::setfill(' ');
}
break;
default:
os << "unknown";
}
return os;
}
std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m )
{
os << "[" << m.AddressPattern();
bool first = true;
for( ReceivedMessage::const_iterator i = m.ArgumentsBegin();
i != m.ArgumentsEnd(); ++i ){
if( first ){
os << " ";
first = false;
}else{
os << ", ";
}
os << *i;
}
os << "]";
return os;
}
std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b )
{
static int indent = 0;
for( int j=0; j < indent; ++j )
os << " ";
os << "{ ( ";
if( b.TimeTag() == 1 )
os << "immediate";
else
os << b.TimeTag();
os << " )\n";
++indent;
for( ReceivedBundle::const_iterator i = b.ElementsBegin();
i != b.ElementsEnd(); ++i ){
if( i->IsBundle() ){
ReceivedBundle b(*i);
os << b << "\n";
}else{
ReceivedMessage m(*i);
for( int j=0; j < indent; ++j )
os << " ";
os << m << "\n";
}
}
--indent;
for( int j=0; j < indent; ++j )
os << " ";
os << "}";
return os;
}
std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p )
{
if( p.IsBundle() ){
ReceivedBundle b(p);
os << b << "\n";
}else{
ReceivedMessage m(p);
os << m << "\n";
}
return os;
}
} // namespace osc
| 23.045643 | 71 | 0.593086 | my-digital-decay |
f682e90f25224d5ee7a4f1ab61aa3e861d85b5d4 | 1,938 | cpp | C++ | GenericCallback/main.cpp | CrystaLamb/TryMePlease | 1e33b9fc0ce9af688db409a682f5227aea0a63cb | [
"Apache-2.0"
] | null | null | null | GenericCallback/main.cpp | CrystaLamb/TryMePlease | 1e33b9fc0ce9af688db409a682f5227aea0a63cb | [
"Apache-2.0"
] | null | null | null | GenericCallback/main.cpp | CrystaLamb/TryMePlease | 1e33b9fc0ce9af688db409a682f5227aea0a63cb | [
"Apache-2.0"
] | null | null | null | #include <utility>
#include <iostream>
#include <tuple>
#include <functional>
template <typename N>
void print(N v)
{
std::cout << v << std::endl;
}
template <typename N, typename... Ns>
void print(N v, Ns... vs)
{
std::cout << v << ", ";
print(vs...);
}
template <size_t... I>
void print(std::index_sequence<I...>)
{
print(I...);
}
template <typename Func, typename Tuple, size_t... I>
auto callback(Func&& func, Tuple t, std::index_sequence<I...>)
{
return func(std::get<I>(t)...);
}
template <typename Func, typename Tuple>
auto callback(Func&& func, Tuple t)
{
return callback(std::forward<Func>(func), t, std::make_index_sequence<std::tuple_size_v<Tuple>>{});
}
template <typename Func, typename... Args>
auto callback(Func&& func, Args... args)
{
return callback(std::forward<Func>(func), std::make_tuple(args...));
}
class TestClass
{
public:
typedef std::function<int(int, int)> add_func_t;
void Test()
{
auto generic_lambda = [this](auto&&... args) -> decltype(auto)
{
return this->TestClass::Hello(std::forward<decltype(args)>(args)...);
};
CatchAddFunc(generic_lambda);
}
void CatchAddFunc(add_func_t&& func)
{
std::cout << "Catch func!\n";
}
private:
int Hello(int a, int b)
{
std::cout << a << " + " << b << " = " << a + b << "\n";
return a + b;
}
};
int main()
{
print(std::make_index_sequence<10>{});
print(std::make_index_sequence<6>{});
auto lambda = [](int a, double b) -> int
{
std::cout << a << ": " << b;
return 5;
};
auto lambda1 = [](int a, int b, int c) -> void
{
std::cout << a << " " << b << " " << c << "\nsum: " << a + b + c << std::endl;
};
std::cout << " return: " << callback(lambda, 2, 6.55) << "\n";
std::cout << " return: " << callback(lambda, 8, 8454.55) << "\n";
std::cout << " return: " << callback(lambda, 999, 5424.55) << "\n";
callback(lambda1, 8, 9, 5);
callback(lambda1, 84, 91, 52);
TestClass testClass;
testClass.Test();
} | 20.83871 | 100 | 0.594943 | CrystaLamb |
f6853d3937aa8308c67f3a3a8936c6f32d9e4b9d | 486 | cpp | C++ | 1099.cpp | fenatan/URI-Online-Judge | 983cadd364e658cdebcbc2c0165e8f54e023a823 | [
"MIT"
] | null | null | null | 1099.cpp | fenatan/URI-Online-Judge | 983cadd364e658cdebcbc2c0165e8f54e023a823 | [
"MIT"
] | null | null | null | 1099.cpp | fenatan/URI-Online-Judge | 983cadd364e658cdebcbc2c0165e8f54e023a823 | [
"MIT"
] | null | null | null | #include <stdio.h>
int main(){
int v[10001], n,x,y, maior, menor;
scanf("%d", &n);
for(int i =0; i < n; i++){
scanf("%d %d", &x, &y);
if(x > y){
maior = x; menor = y;
}else{
maior = y; menor = x;
}
v[i]=0;
for(int j = menor + 1; j < maior; j++){
if(j % 2 != 0)
v[i]+=j;
}
}
for(int i =0; i < n; i++){
printf("%d\n", v[i]);
}
return 0;
}
| 18 | 47 | 0.329218 | fenatan |
f686b9e9914f26a76f24616010336866acebd753 | 2,342 | cpp | C++ | nuiengine/core/views/KButtonView.cpp | 15d23/NUIEngine | a1369d5cea90cca81d74a39b8a853b3fba850595 | [
"Apache-2.0"
] | 204 | 2017-05-08T05:41:29.000Z | 2022-03-29T16:57:44.000Z | nuiengine/core/views/KButtonView.cpp | 15d23/NUIEngine | a1369d5cea90cca81d74a39b8a853b3fba850595 | [
"Apache-2.0"
] | 7 | 2017-05-10T15:32:09.000Z | 2020-12-23T06:00:30.000Z | nuiengine/core/views/KButtonView.cpp | 15d23/NUIEngine | a1369d5cea90cca81d74a39b8a853b3fba850595 | [
"Apache-2.0"
] | 65 | 2017-05-25T05:46:56.000Z | 2021-02-06T11:07:38.000Z | // **************************************
// File: KButtonView.cpp
// Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved.
// Website: http://www.nuiengine.com
// Description: This code is part of NUI Engine (NUI Graphics Lib)
// Comments:
// Rev: 2
// Created: 2017/4/11
// Last edit: 2017/4/28
// Author: Chen Zhi
// E-mail: cz_666@qq.com
// License: APACHE V2.0 (see license file)
// ***************************************
#include "KButtonView.h"
#include "DataSync.h"
#include "KShapeDrawable.h"
/////////////////// KImgButtonView //////////////////////////
KImgButtonView::KImgButtonView()
{
m_e_viewtype = KVIEW_BUTTON;
m_b_check_alpha = FALSE;
}
KImgButtonView::~KImgButtonView()
{
}
void KImgButtonView::setState( ViewState state, kn_bool bRefresh )
{
//调用基类函数设置文本状态,传入False不激活刷新
if (m_state != state)
{
//m_state = state;
writeLock lock(m_lst_drawable_mutex);
switch(state)
{
case BS_FOCUS:
m_lst_drawable[0] = m_focus_bk_drawable;
break;
case BS_NORMAL:
m_lst_drawable[0] = m_bk_drawable;
break;
case BS_PRESSED:
case BS_ACTIVE:
m_lst_drawable[0] = m_selected_bk_drawable;
break;
case BS_DISABLED:
m_lst_drawable[0] = m_disable_bk_drawable;
break;
default:
break;
}
lock.unlock();
KTextView::setState(state, FALSE);
if (bRefresh)
{
InvalidateView();
}
}
}
void KImgButtonView::setBKGImage(const kn_string& normalResPath,
const kn_string& focusResPath,
const kn_string& selectedResPath,
const kn_string& disabledResPath)
{
KDrawable_PTR normal = KImageDrawable_PTR(new KImageDrawable(normalResPath));
KDrawable_PTR focus = KImageDrawable_PTR(new KImageDrawable(focusResPath));
KDrawable_PTR selected = KImageDrawable_PTR(new KImageDrawable(selectedResPath));
KDrawable_PTR disable = KImageDrawable_PTR(new KImageDrawable(disabledResPath));
setBKG(normal,focus,selected,disable);
}
void KImgButtonView::setBKG( KDrawable_PTR normal, KDrawable_PTR focus, KDrawable_PTR selected, KDrawable_PTR disabled)
{
writeLock lock(m_lst_drawable_mutex);
m_bk_drawable = normal;
m_focus_bk_drawable = focus;
m_selected_bk_drawable = selected;
m_disable_bk_drawable = disabled;
m_lst_drawable[0] = m_bk_drawable;
//不要忘了释放锁
lock.unlock();
showBK(TRUE);
}
| 24.395833 | 120 | 0.690436 | 15d23 |
f688466b6cacf6f9f3c7a6d86561510d28e6ef31 | 3,054 | hpp | C++ | phylanx/execution_tree/primitives/sum_operation.hpp | rtohid/phylanx | c2e4e8e531c204a70b1907995b1fd467870e6d9d | [
"BSL-1.0"
] | null | null | null | phylanx/execution_tree/primitives/sum_operation.hpp | rtohid/phylanx | c2e4e8e531c204a70b1907995b1fd467870e6d9d | [
"BSL-1.0"
] | null | null | null | phylanx/execution_tree/primitives/sum_operation.hpp | rtohid/phylanx | c2e4e8e531c204a70b1907995b1fd467870e6d9d | [
"BSL-1.0"
] | null | null | null | // Copyright (c) 2018 Parsa Amini
// Copyright (c) 2018 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(PHYLANX_PRIMITIVES_SUM)
#define PHYLANX_PRIMITIVES_SUM
#include <phylanx/config.hpp>
#include <phylanx/execution_tree/primitives/base_primitive.hpp>
#include <phylanx/execution_tree/primitives/primitive_component_base.hpp>
#include <hpx/lcos/future.hpp>
#include <hpx/util/optional.hpp>
#include <cstdint>
#include <string>
#include <vector>
namespace phylanx { namespace execution_tree { namespace primitives
{
/// \brief Sums the values of the elements of a vector or a matrix or
/// returns the value of the scalar that was given to it.
/// \param a The scalar, vector, or matrix to perform sum over
/// \param axis Optional. If provided, sum is calculated along the
/// provided axis and a vector of results is returned.
/// \p keep_dims is ignored if \p axis present. Must be
/// nil if \p keep_dims is set
/// \param keep_dims Optional. Whether the sum value has to have the same
/// number of dimensions as \p a. Ignored if \p axis is
/// anything except nil.
class sum_operation
: public primitive_component_base
, public std::enable_shared_from_this<sum_operation>
{
protected:
hpx::future<primitive_argument_type> eval(
std::vector<primitive_argument_type> const& operands,
std::vector<primitive_argument_type> const& args) const;
using val_type = double;
using arg_type = ir::node_data<val_type>;
using args_type = std::vector<arg_type>;
public:
static match_pattern_type const match_data;
sum_operation() = default;
sum_operation(std::vector<primitive_argument_type>&& operands,
std::string const& name, std::string const& codename);
hpx::future<primitive_argument_type> eval(
std::vector<primitive_argument_type> const& args) const override;
private:
primitive_argument_type sum0d(arg_type&& arg,
hpx::util::optional<std::int64_t> axis, bool keep_dims) const;
primitive_argument_type sum1d(arg_type&& arg,
hpx::util::optional<std::int64_t> axis, bool keep_dims) const;
primitive_argument_type sum2d(arg_type&& arg,
hpx::util::optional<std::int64_t> axis, bool keep_dims) const;
primitive_argument_type sum2d_flat(
arg_type&& arg, bool keep_dims) const;
primitive_argument_type sum2d_axis0(arg_type&& arg) const;
primitive_argument_type sum2d_axis1(arg_type&& arg) const;
};
PHYLANX_EXPORT primitive create_sum_operation(hpx::id_type const& locality,
std::vector<primitive_argument_type>&& operands,
std::string const& name = "", std::string const& codename = "");
}}}
#endif
| 40.184211 | 79 | 0.672233 | rtohid |
f688bc2ad7271e058f94ab26c3876ccc1361b18e | 29,258 | cpp | C++ | Source/AllProjects/RemBrws/CQCTreeBrws/CQCTreeBrws_CfgSrvBrws.cpp | MarkStega/CQC | c1d0e01ec2abcaa5b8eb1899b9f0522fecee4b07 | [
"MIT"
] | 51 | 2020-12-26T18:17:16.000Z | 2022-03-15T04:29:35.000Z | Source/AllProjects/RemBrws/CQCTreeBrws/CQCTreeBrws_CfgSrvBrws.cpp | MarkStega/CQC | c1d0e01ec2abcaa5b8eb1899b9f0522fecee4b07 | [
"MIT"
] | null | null | null | Source/AllProjects/RemBrws/CQCTreeBrws/CQCTreeBrws_CfgSrvBrws.cpp | MarkStega/CQC | c1d0e01ec2abcaa5b8eb1899b9f0522fecee4b07 | [
"MIT"
] | 4 | 2020-12-28T07:24:39.000Z | 2021-12-29T12:09:37.000Z | //
// FILE NAME: CQCTreeBrws_CfgSrvBrws.cpp
//
// AUTHOR: Dean Roddey
//
// CREATED: 12/11/2015
//
// COPYRIGHT: Charmed Quark Systems, Ltd @ 2020
//
// This software is copyrighted by 'Charmed Quark Systems, Ltd' and
// the author (Dean Roddey.) It is licensed under the MIT Open Source
// license:
//
// https://opensource.org/licenses/MIT
//
// DESCRIPTION:
//
// This file implements the remote browser derivative that handles browsing the
// config server.
//
// CAVEATS/GOTCHAS:
//
// LOG:
//
// ---------------------------------------------------------------------------
// Includes
// ---------------------------------------------------------------------------
#include "CQCTreeBrws_.hpp"
#include "CQCTreeBrws_CfgSrvBrws_.hpp"
// ---------------------------------------------------------------------------
// Magic macros
// ---------------------------------------------------------------------------
RTTIDecls(TCQCCfgSrvBrws,TCQCTreeBrwsIntf)
// ---------------------------------------------------------------------------
// CLASS: TCQCCfgSrvBrws
// PREFIX: rbrws
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// TCQCCfgSrvBrws: Constructors and Destructor
// ---------------------------------------------------------------------------
TCQCCfgSrvBrws::TCQCCfgSrvBrws() :
TCQCTreeBrwsIntf
(
kCQCRemBrws::strPath_Configure
, kCQCRemBrws::strItem_Configure
, facCQCTreeBrws().strMsg(kTBrwsMsgs::midTitle_ConfBrower)
)
{
}
TCQCCfgSrvBrws::~TCQCCfgSrvBrws()
{
}
// ---------------------------------------------------------------------------
// TCQCCfgSrvBrws: Public, inherited methods
// ---------------------------------------------------------------------------
// Our browser object never accepts dropped files, so this won't get called
tCIDLib::TVoid
TCQCCfgSrvBrws::AcceptFiles(const TString&
, const tCIDLib::TStrList&
, const tCIDLib::TStrList&)
{
CIDAssert2(L"The config server browser should not be accepting files");
}
// We never accept dropped files in this section
tCIDLib::TBoolean
TCQCCfgSrvBrws::bAcceptsNew(const TString&, const tCIDLib::TStrHashSet&) const
{
return kCIDLib::False;
}
//
// The browser window calls us here if the user invokes a menu operation on the
// tree window.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bDoMenuAction( const TString& strPath
, TTreeBrowseInfo& wnotToSend)
{
// Get the area of this item, tell it to use just the text width
TArea areaItem;
wndBrowser().bQueryItemArea(strPath, areaItem, kCIDLib::True, kCIDLib::True);
// Get the center point of it and convert to screen coordinates
TPoint pntAt;
wndBrowser().ToScreenCoordinates(areaItem.pntCenter(), pntAt);
// Create the menu and load it up from the resource
TPopupMenu menuAction(L"/Configure Action");
// Depending on the type of thing selected, we do a different menu
tCIDLib::TBoolean bAtTop;
const tCQCRemBrws::EDTypes eDType = ePathToDType(strPath, bAtTop);
const tCIDLib::TBoolean bNoType(eDType == tCQCRemBrws::EDTypes::Count);
const tCIDLib::TBoolean bScope = wndBrowser().bIsScope(strPath);
tCIDLib::TCard4 c4MenuCmd = 0;
menuAction.Create(facCQCTreeBrws(), kCQCTreeBrws::ridMenu_GenFile);
// If an item, or not e-mail or user, then disable new
if (!bScope
|| ((eDType != tCQCRemBrws::EDTypes::EMailAccount)
&& (eDType != tCQCRemBrws::EDTypes::User)))
{
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_New, kCIDLib::False);
}
// If a scope, or not an e-mail or user, then disable delete
if (bScope
|| ((eDType != tCQCRemBrws::EDTypes::EMailAccount)
&& (eDType != tCQCRemBrws::EDTypes::User)))
{
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Delete, kCIDLib::False);
}
// If a scope, disable the Edit and Copy. If not, disable the Refresh and Paste
if (bScope)
{
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Copy, kCIDLib::False);
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Edit, kCIDLib::False);
}
else
{
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Paste, kCIDLib::False);
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Refresh, kCIDLib::False);
}
// We only allow email accounts to be renamed
if (bScope || (eDType != tCQCRemBrws::EDTypes::EMailAccount))
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_Rename, kCIDLib::False);
c4MenuCmd = menuAction.c4Process(wndBrowser(), pntAt, tCIDLib::EVJustify::Bottom);
//
// If they made a choice, then we have to translate it to the standard action
// enum that the browser window will understand.
//
return bProcessMenuSelection(c4MenuCmd, strPath, wnotToSend);
}
// We don't use a persistent connection, so we just say yes
tCIDLib::TBoolean TCQCCfgSrvBrws::bIsConnected() const
{
return kCIDLib::True;
}
//
// Our own bDoMenuAction calls this if a selection is made. It is also called by the
// browser window if an accelerator driven command is seen. That's why it's split out
// so that we can avoid duplicating this code.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bProcessMenuSelection( const tCIDLib::TCard4 c4CmdId
, const TString& strPath
, TTreeBrowseInfo& wnotToSend)
{
// See what the data type is, if any
tCIDLib::TBoolean bAtTop = kCIDLib::False;
const tCQCRemBrws::EDTypes eType = ePathToDType(strPath, bAtTop);
tCIDLib::TBoolean bRet = kCIDLib::True;
switch(c4CmdId)
{
case kCQCTreeBrws::ridMenu_GenFile_Edit :
{
// Just inform the containing application that the user wants to edit
CIDAssert(eType != tCQCRemBrws::EDTypes::Count, L"Unknown data type for Edit");
wnotToSend = TTreeBrowseInfo
(
tCQCTreeBrws::EEvents::Edit, strPath, eType, wndBrowser()
);
break;
}
case kCQCTreeBrws::ridMenu_GenFile_New :
{
CIDAssert(eType != tCQCRemBrws::EDTypes::Count, L"Unknown data type for New");
bRet = bMakeNewFile(strPath, eType, wnotToSend);
break;
}
case kCQCTreeBrws::ridMenu_GenFile_Delete :
{
CIDAssert(eType != tCQCRemBrws::EDTypes::Count, L"Unknown data type for Delete");
// Delete the indicated file
if (bDeleteFile(strPath))
{
// Let any listeners know we did this
wnotToSend = TTreeBrowseInfo
(
tCQCTreeBrws::EEvents::Deleted, strPath, eType, wndBrowser()
);
}
break;
}
case kCQCTreeBrws::ridMenu_GenFile_Refresh :
{
// We just handle this one internally
UpdateScope(strPath);
break;
}
case kCQCTreeBrws::ridMenu_GenFile_Rename :
{
// Call our parent's rename method which does what we want
bRet = bDoRename(strPath, wnotToSend);
break;
}
default :
bRet = kCIDLib::False;
break;
};
return bRet;
}
//
// For our stuff, as long as it's not our top level path or some other scope, it's fine
// to report it all when double clicked. The client code will decide if it really
// wants to deal with it and how. So just checking to see if it's a scope is a good
// enough check. We indicate these are all edit operations.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bReportInvocation(const TString& strPath, tCIDLib::TBoolean& bAsEdit) const
{
bAsEdit = kCIDLib::True;
return !wndBrowser().bIsScope(strPath);
}
//
// We add our top level scope and all of the next level ones since it's a fixed set
// that we always have.
//
tCIDLib::TVoid TCQCCfgSrvBrws::Initialize(const TCQCUserCtx& cuctxUser)
{
TParent::Initialize(cuctxUser);
TTreeView& wndTar = wndBrowser();
//
// Add our top level scope. It's not marked as virtual in this case, since we
// preload all of the possible top level items and sub-scopes. Some of our
// sub-scopes will be virtual.
//
wndTar.AddScope
(
kCQCRemBrws::strPath_Root, kCQCRemBrws::strItem_Configure, kCIDLib::False
);
//
// Load our main scopes. Some are virtual and will be faulted in only if
// they are accessed. Others we know the content and will go ahead and load them.
//
wndTar.AddScope(kCQCRemBrws::strPath_Configure, L"Accounts", kCIDLib::True);
wndTar.AddScope(kCQCRemBrws::strPath_Accounts, L"EMail", kCIDLib::True);
wndTar.AddScope(kCQCRemBrws::strPath_Configure, L"Ports", kCIDLib::True);
wndTar.AddScope(kCQCRemBrws::strPath_Configure, L"Users", kCIDLib::True);
//
// These are items at the top level, not scopes. These are for known, fixed data
// and cannot be removed.
//
wndTar.AddItem(kCQCRemBrws::strPath_Ports, L"GC-100");
wndTar.AddItem(kCQCRemBrws::strPath_Ports, L"JustAddPwr");
wndTar.AddItem(kCQCRemBrws::strPath_Configure, L"LogicSrv");
wndTar.AddItem(kCQCRemBrws::strPath_Configure, L"Location");
wndTar.AddItem(kCQCRemBrws::strPath_Configure, L"SystemCfg");
}
tCIDLib::TVoid
TCQCCfgSrvBrws::LoadScope(const TString& strPath)
{
TTreeView& wndTar = wndBrowser();
try
{
//
// Depending on the path, let's load up the relevant info and put it into
// the tree.
//
if (strPath.bStartsWithI(kCQCRemBrws::strPath_Users))
LoadUsers(wndTar);
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_EMailAccts))
LoadEMails(wndTar);
//
// Probably this happened, if we added any above. But, if the scope was
// empty, then we need to do this just in case, to clear set the child
// count info, which also turns off the virtual scope flag, so we won't
// try to fault this one back in.
//
wndTar.UpdateChildCnt(strPath);
//
// At the end of an expansion, force the expanded once state on. It won't
// get done if this is a lazily faulted in tree and the expanded scope
// ended up being empty. That will cause lots of problems later.
//
wndTar.ForceExpandedOnce(strPath);
}
catch(TError& errToCatch)
{
errToCatch.AddStackLevel(CID_FILE, CID_LINE);
TModule::LogEventObj(errToCatch);
facCQCGKit().ShowError
(
wndBrowser(), strTitle(), L"Could not expand item", errToCatch
);
}
}
//
// Some of our stuff doesn't use this, like user accounts, because they have to have a
// correct name up front. For other stuff we create a default name based on the parent
// scope.
//
tCIDLib::TVoid
TCQCCfgSrvBrws::MakeDefName(const TString& strParScope
, TString& strToFill
, const tCIDLib::TBoolean bIsFile) const
{
tCIDLib::TBoolean bAtTop = kCIDLib::False;
const tCQCRemBrws::EDTypes eType = ePathToDType(strParScope, bAtTop);
CIDAssert(bAtTop, L"The parent scope was not the top level scope for its type");
// Build up the base name for the new guy
TString strCurPath(strParScope);
strCurPath.Append(kCIDLib::chForwardSlash);
strCurPath.Append(tCQCRemBrws::strXlatEDTypes(eType));
// Now we add numbers to it until we get a unique name not already in this scope.
const tCIDLib::TCard4 c4BaseLen = strCurPath.c4Length();
tCIDLib::TCard4 c4Num = 1;
while (kCIDLib::True)
{
strCurPath.CapAt(c4BaseLen);
strCurPath.AppendFormatted(c4Num);
if (!wndBrowser().bPathExists(strCurPath))
{
strToFill = tCQCRemBrws::strXlatEDTypes(eType);
strToFill.AppendFormatted(c4Num);
break;
}
// Not unique, to try another
c4Num++;
}
}
//
// If the browser window gets an accelerator key translation call, he will call us
// here to load up an accelerator table for him which he will process. If it causes
// him to get a menu call, he will pass it on to us.
//
tCIDLib::TVoid
TCQCCfgSrvBrws::QueryAccelTable(const TString& strPath
, TAccelTable& accelToFill) const
{
//
// Just load it up from our menu. So we just create an instance of our menu but
// never show it.
//
TPopupMenu menuAction(L"/Configure Action");
// Depending on the type of thing selected, we do a different menu
tCIDLib::TBoolean bAtTop;
const tCQCRemBrws::EDTypes eDType = ePathToDType(strPath, bAtTop);
if ((eDType == tCQCRemBrws::EDTypes::EMailAccount)
|| (eDType == tCQCRemBrws::EDTypes::User))
{
menuAction.Create(facCQCTreeBrws(), kCQCTreeBrws::ridMenu_GenFile);
if (!bAtTop)
menuAction.SetItemEnable(kCQCTreeBrws::ridMenu_GenFile_New, kCIDLib::False);
}
else
{
// Don't have a menu for this so nothing
return;
}
// And now set up the accel table from the menu
accelToFill.Create(menuAction);
}
// We don't use a persistent connection, so nothing really to do here
tCIDLib::TVoid TCQCCfgSrvBrws::Terminate()
{
}
// ---------------------------------------------------------------------------
// TCQCCfgSrvBrws: Protected, inherited methods
// ---------------------------------------------------------------------------
tCIDLib::TBoolean TCQCCfgSrvBrws::bCanRename(const TString& strPath) const
{
//
// The only things we currently allow to be renamed are e-mail accounts. Everything
// else is all special stuff.
//
return
(
!wndBrowser().bIsScope(strPath)
&& strPath.bStartsWithI(kCQCRemBrws::strPath_EMailAccts)
);
}
tCIDLib::TBoolean
TCQCCfgSrvBrws::bRenameItem(const TString& strParScope
, const TString& strOldName
, const TString& strNewName
, const tCIDLib::TBoolean bIsScope)
{
try
{
// Depending on the parent scope, we do the appropriate thing
if (strParScope.bStartsWithI(kCQCRemBrws::strPath_EMailAccts))
{
TWndPtrJanitor janPtr(tCIDCtrls::ESysPtrs::Wait);
tCQCKit::TInstSrvProxy orbcInst = facCQCKit().orbcInstSrvProxy();
orbcInst->RenameEMailAccount(strOldName, strNewName, sectUser());
// And now tell the tree to update the display text of the item
wndBrowser().UpdateItem(strParScope, strOldName, strNewName);
}
else
{
TErrBox msgbErr(strTitle(), L"This data type cannot be renamed");
msgbErr.ShowIt(wndBrowser());
}
}
catch(TError& errToCatch)
{
errToCatch.AddStackLevel(CID_FILE, CID_LINE);
TModule::LogEventObj(errToCatch);
facCQCGKit().ShowError
(
wndBrowser(), strTitle(), L"Could not expand item", errToCatch
);
return kCIDLib::False;
}
return kCIDLib::True;
}
// ---------------------------------------------------------------------------
// TCQCCfgSrvBrws: Private, non-virtual methods
// ---------------------------------------------------------------------------
//
// This is called if we get a delete command (via menu or hot key). We look at
// the type and do the appropriate
//
tCIDLib::TBoolean TCQCCfgSrvBrws::bDeleteFile(const TString& strPath)
{
// Make sure that they really want to do it
TYesNoBox msgbConfirm
(
strTitle(), facCQCTreeBrws().strMsg(kTBrwsMsgs::midQ_DeleteItem, strPath)
);
if (!msgbConfirm.bShowIt(wndBrowser()))
return kCIDLib::False;
tCQCRemBrws::EDTypes eType = tCQCRemBrws::EDTypes::Count;
try
{
if (strPath.bStartsWithI(kCQCRemBrws::strPath_Users))
{
// Set this first in case of error
eType = tCQCRemBrws::EDTypes::User;
//
// Let's try to delete the indicated user. The last part of the path is
// the login name. We can get an error, even if the login name is valid,
// if they try to delete the last admin account.
//
TString strLoginName;
facCQCRemBrws().QueryNamePart(strPath, strLoginName);
tCQCKit::TSecuritySrvProxy orbcSrc = facCQCKit().orbcSecuritySrvProxy();
orbcSrc->DeleteAccount(strLoginName, sectUser());
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_EMailAccts))
{
// Set this first in case of error
eType = tCQCRemBrws::EDTypes::EMailAccount;
TString strAcctName;
facCQCRemBrws().QueryNamePart(strPath, strAcctName);
TWndPtrJanitor janPtr(tCIDCtrls::ESysPtrs::Wait);
tCQCKit::TInstSrvProxy orbcInst = facCQCKit().orbcInstSrvProxy();
if (!orbcInst->bDeleteEMailAccount(strAcctName, sectUser()))
{
facCQCTreeBrws().LogMsg
(
CID_FILE
, CID_LINE
, kTBrwsErrs::errcBrws_EMailDelete
, tCIDLib::ESeverities::Failed
, tCIDLib::EErrClasses::NotFound
, strAcctName
);
}
}
else
{
//
// Shouldn't happen, since we don't allow it in menus and we don't create
// a delete accellerator unless it's a deletable item. But, just in case.
//
facCQCGKit().ShowError
(
wndBrowser()
, strTitle()
, L"This item cannot be deleted, and you shouldn't have been able to "
L" try to do so. Sorry about that. Please report this issue."
);
return kCIDLib::False;
}
}
catch(TError& errToCatch)
{
errToCatch.AddStackLevel(CID_FILE, CID_LINE);
TModule::LogEventObj(errToCatch);
TString strMsg = TString::strConcat
(
L"An error occurred while deleting the ", tCQCRemBrws::strLoadEDTypes(eType)
);
facCQCGKit().ShowError(wndBrowser(), strTitle(), strMsg, errToCatch);
return kCIDLib::False;
}
// It didn't fail, so remove this item from the browser window
wndBrowser().RemoveItem(strPath);
return kCIDLib::True;
}
//
// This is called when we get a New menu selection. We see if it's one of the types
// of ours that we can create (it should be since the menu shouldn't have allowed
// otherwise.) We try to create the new file and get it into the browser.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bMakeNewFile(const TString& strParHPath
, const tCQCRemBrws::EDTypes eDType
, TTreeBrowseInfo& wnotToSend)
{
// We need the browser a number of times so get a convenient ref
TCQCTreeBrowser& wndTar = wndBrowser();
//
// The first thing we need to do is to get a name from the user. We call
// a helper on the browser window do this since it's sort of messy. If they
// don't commit, we return and nothing has been done.
//
TString strNewName;
if (!wndTar.bGetNewName(strParHPath, kCIDLib::False, eDType, strNewName, *this))
return kCIDLib::False;
// Build up the new full hierarchical path
TString strNewHPath(strParHPath);
facCQCRemBrws().AddPathComp(strNewHPath, strNewName);
//
// At this point the item is in the tree. We need to make sure it gets removed
// if we don't explicitly decide to keep it.
//
TTreeItemJan janTree(&wndTar, strNewHPath);
// Get the type relative version of the parent path
TString strParRelPath;
facCQCRemBrws().CreateRelPath(strParHPath, eDType, strParRelPath);
tCIDLib::TBoolean bRet = kCIDLib::False;
try
{
if (eDType == tCQCRemBrws::EDTypes::EMailAccount)
{
bRet = bMakeNewEmailAcct(strParHPath, strParRelPath, strNewName);
}
else if (eDType == tCQCRemBrws::EDTypes::User)
{
bRet = bMakeNewUserAcct(strParHPath, strParRelPath, strNewName);
}
else
{
// Not something we can edit
TErrBox msgbView
(
strTitle()
, facCQCTreeBrws().strMsg
(
kTBrwsMsgs::midStatus_CantNew
, tCQCRemBrws::strLoadEDTypes(eDType)
, strNewHPath
)
);
msgbView.ShowIt(wndBrowser());
return kCIDLib::False;
}
// It appears to have worked, so prevent the janitor from removing it
janTree.Orphan();
}
catch(TError& errToCatch)
{
errToCatch.AddStackLevel(CID_FILE, CID_LINE);
TModule::LogEventObj(errToCatch);
TErrBox msgbNew
(
strTitle()
, facCQCRemBrws().strMsg(kTBrwsMsgs::midStatus_CantCreateFile, strNewHPath)
);
msgbNew.ShowIt(wndTar);
return kCIDLib::False;
}
// Select this new guy
wndTar.SelectPath(strNewHPath);
// It workeed so fill in a notification to be sent to the containing app
wnotToSend = TTreeBrowseInfo
(
tCQCTreeBrws::EEvents::NewFile, strNewHPath, eDType, wndBrowser()
);
return bRet;
}
//
// This is called to create a e-mail account. We just generate an empty one with
// a default name, save it which also adds it to the tree view, and select it. We don't
// need the hierarchy path info here for this.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bMakeNewEmailAcct(const TString&, const TString&, const TString& strNewName)
{
// Set up a default account
TCQCEMailAccount emacctNew;
emacctNew.Set
(
tCQCKit::EEMailTypes::Unused
, strNewName
, L"me@myisp.com"
, L"HappyWeaselParty"
, L"myisp.com"
, L"Bubba"
, 25
);
TWndPtrJanitor janPtr(tCIDCtrls::ESysPtrs::Wait);
tCQCKit::TInstSrvProxy orbcInst = facCQCKit().orbcInstSrvProxy();
tCIDLib::TCard4 c4SerNum = 0;
// Indicate it must be a new account, if not it will throw
return orbcInst->bUpdateEmailAccount(emacctNew, c4SerNum, sectUser(), kCIDLib::True);
}
//
// Called when the user asks to create a new user account. This one is a little special.
// In this case, we don't get a default name. The name has to be set up front and
// cannot be changed once it's created and stored away. So in this special case we
// get a login name from the user up front and use that.
//
tCIDLib::TBoolean
TCQCCfgSrvBrws::bMakeNewUserAcct(const TString& strParHPath
, const TString& strParRelPath
, const TString& strNewName)
{
// Set up a user account with basic info
TCQCUserAccount uaccNew
(
tCQCKit::EUserRoles::NormalUser
, L"New user account"
, strNewName
, L"Welcome"
, L"John"
, L"Smith"
);
// Create the hierarchical path for display purposes
TString strNewHPath(strParHPath);
strNewHPath.Append(kCIDLib::chForwardSlash);
strNewHPath.Append(strNewName);
tCQCKit::TSecuritySrvProxy orbcSrc = facCQCKit().orbcSecuritySrvProxy();
//
// In order to provide a more targeted error message for a common possible
// error, we check to see if this login name already exists. We have to provide
// the current user's security token to get this info.
//
if (orbcSrc->bLoginExists(strNewName, cuctxUser().sectUser()))
{
TErrBox msgbNew
(
strTitle()
, facCQCTreeBrws().strMsg(kTBrwsErrs::errcBrws_UAccExists, strNewName)
);
msgbNew.ShowIt(wndBrowser());
return kCIDLib::False;
}
orbcSrc->CreateAccount(uaccNew, sectUser());
return kCIDLib::True;
}
//
// Check the path to see if starts with the top level path for any of the types we
// deal with. If not, we return the _Count value.
//
// We also indicate if it was the top level for that type, or is on some sub-scope of
// it.
//
tCQCRemBrws::EDTypes
TCQCCfgSrvBrws::ePathToDType(const TString& strPath, tCIDLib::TBoolean& bAtTop) const
{
bAtTop = kCIDLib::False;
tCQCRemBrws::EDTypes eRet = tCQCRemBrws::EDTypes::Count;
const TString* pstrRoot = nullptr;
if (strPath.bStartsWithI(kCQCRemBrws::strPath_EMailAccts))
{
eRet = tCQCRemBrws::EDTypes::EMailAccount;
pstrRoot = &kCQCRemBrws::strPath_EMailAccts;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_GC100Ports))
{
eRet = tCQCRemBrws::EDTypes::GC100Ports;
pstrRoot = &kCQCRemBrws::strPath_GC100Ports;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_JAPwrPorts))
{
eRet = tCQCRemBrws::EDTypes::JAPwrPorts;
pstrRoot = &kCQCRemBrws::strPath_JAPwrPorts;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_Location))
{
eRet = tCQCRemBrws::EDTypes::Location;
pstrRoot = &kCQCRemBrws::strPath_Location;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_LogicSrv))
{
eRet = tCQCRemBrws::EDTypes::LogicSrv;
pstrRoot = &kCQCRemBrws::strPath_LogicSrv;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_SystemCfg))
{
eRet = tCQCRemBrws::EDTypes::SystemCfg;
pstrRoot = &kCQCRemBrws::strPath_SystemCfg;
}
else if (strPath.bStartsWithI(kCQCRemBrws::strPath_Users))
{
eRet = tCQCRemBrws::EDTypes::User;
pstrRoot = &kCQCRemBrws::strPath_Users;
}
if (eRet != tCQCRemBrws::EDTypes::Count)
bAtTop = (strPath == *pstrRoot);
return eRet;
}
//
// Called when it's time to fault in our email accounts scope or the user asks to reload
// the scope. In our case we just need to interate the config server scope that contains
// the email accounts and load an entry for each one.
//
// We let exceptions propagate.
//
tCIDLib::TVoid TCQCCfgSrvBrws::LoadEMails(TTreeView& wndTar)
{
TWndPtrJanitor janPtr(tCIDCtrls::ESysPtrs::Wait);
tCQCKit::TInstSrvProxy orbcInst = facCQCKit().orbcInstSrvProxy();
tCIDLib::TStrList colList;
orbcInst->bQueryEMailAccountNames(colList, sectUser());
colList.bForEach([&wndTar](const TString& strName)
{
wndTar.AddItem(kCQCRemBrws::strPath_EMailAccts, strName);
return kCIDLib::True;
});
}
//
// Called when it's time to fault in our users scope or the user asks to reload the
// scope.
//
// We let exceptions propagate.
//
tCIDLib::TVoid TCQCCfgSrvBrws::LoadUsers(TTreeView& wndTar)
{
tCQCKit::TSecuritySrvProxy orbcSrc = facCQCKit().orbcSecuritySrvProxy();
// If we don't get any, then we are done
TVector<TCQCUserAccount> colList;
if (!orbcSrc->c4QueryAccounts(colList, sectUser()))
return;
//
// Loop though the list and load them into the tree. The text is the login
// name, which is also the key to upload changes, delete users and so forth.
//
TString strCurPath;
const tCIDLib::TCard4 c4Count = colList.c4ElemCount();
for (tCIDLib::TCard4 c4Index = 0; c4Index < c4Count; c4Index++)
{
const TCQCUserAccount& uaccCur = colList[c4Index];
wndTar.AddItem(kCQCRemBrws::strPath_Users, uaccCur.strLoginName());
}
}
//
// We query the contents of the indicated path, which must be a scope. We don't
// try to be clever. We temporarily disable drawing, remove the contents of
// the scope, then call our scope loader above to reload it. This also serves to
// toss all of the nested scopes, so we go back to virtual scope mode on all of
// them, to be subsequently reloaded as well. Not the most efficient, but the
// safest.
//
tCIDLib::TVoid TCQCCfgSrvBrws::UpdateScope(const TString& strPath)
{
TTreeView& wndTar = wndBrowser();
try
{
// Has to be a scope
CIDAssert(wndTar.bIsScope(strPath), L"Cannot update a non-scope item");
// Stop updates while we do this
TWndPaintJanitor janPaint(&wndTar);
wndBrowser().RemoveChildrenOf(strPath);
// Now call the same private helper used to do the initial load
if (strPath.bStartsWithI(kCQCRemBrws::strPath_Users))
LoadUsers(wndTar);
}
catch(TError& errToCatch)
{
errToCatch.AddStackLevel(CID_FILE, CID_LINE);
TModule::LogEventObj(errToCatch);
facCQCGKit().ShowError
(
wndBrowser(), strTitle(), L"Could not update scope", errToCatch
);
}
}
| 32.54505 | 93 | 0.610534 | MarkStega |
f68a898a386e8f688c3f1ecdaaab87af7c9ce7b8 | 70,741 | cpp | C++ | hphp/hhbbc/test/type-system.cpp | arnononline/hhvm | f80bfae3394cc48a0a99a49e003c7c3cd92e444f | [
"PHP-3.01",
"Zend-2.0"
] | 1 | 2015-05-31T17:15:47.000Z | 2015-05-31T17:15:47.000Z | hphp/hhbbc/test/type-system.cpp | mrliao/hhvm | 4ed1b985c6fad79376994726490bccdcba3699a6 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | hphp/hhbbc/test/type-system.cpp | mrliao/hhvm | 4ed1b985c6fad79376994726490bccdcba3699a6 | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include "hphp/hhbbc/type-system.h"
#include <gtest/gtest.h>
#include <boost/range/join.hpp>
#include <algorithm>
#include <limits>
#include <memory>
#include <utility>
#include <vector>
#include "folly/Lazy.h"
#include "hphp/runtime/base/complex-types.h"
#include "hphp/runtime/base/array-init.h"
#include "hphp/hhbbc/hhbbc.h"
#include "hphp/hhbbc/misc.h"
#include "hphp/hhbbc/representation.h"
#include "hphp/hhbbc/parse.h"
#include "hphp/hhbbc/index.h"
#include "hphp/runtime/vm/as.h"
#include "hphp/runtime/vm/unit-emitter.h"
namespace HPHP { namespace HHBBC {
namespace {
//////////////////////////////////////////////////////////////////////
const StaticString s_test("test");
const StaticString s_TestClass("TestClass");
const StaticString s_Base("Base");
const StaticString s_A("A");
const StaticString s_AA("AA");
const StaticString s_AB("AB");
const StaticString s_B("B");
const StaticString s_BA("BA");
const StaticString s_BB("BB");
const StaticString s_BAA("BAA");
const StaticString s_IBase("IBase");
const StaticString s_IA("IA");
const StaticString s_IAA("IAA");
const StaticString s_IB("IB");
const StaticString s_NonUnique("NonUnique");
const StaticString s_NonUniqueA("NonUniqueA");
const StaticString s_WaitHandle("HH\\WaitHandle");
// A test program so we can actually test things involving object or
// class types.
std::unique_ptr<php::Unit> make_test_unit() {
assert(SystemLib::s_inited);
std::string const hhas = R"(
.main {
Int 1
RetC
}
# Technically this should be provided by systemlib, but it's the
# only one we have to make sure the type system can see for unit
# test purposes, so we can just define it here. We don't need to
# give it any of its functions currently.
.class [abstract unique builtin] HH\WaitHandle {
}
.class [interface unique] IBase {
}
.class [interface unique] IA implements (IBase) {
}
.class [interface unique] IB implements (IBase) {
}
.class [interface unique] IAA implements (IA) {
}
.class [unique] Base {
.default_ctor;
}
.class [unique] A extends Base implements (IA) {
.default_ctor;
}
.class [no_override unique] AA extends A implements (IAA) {
.default_ctor;
}
.class [no_override unique] AB extends A {
.default_ctor;
}
.class [unique] B extends Base {
.default_ctor;
}
.class [unique] BA extends B {
.default_ctor;
}
.class [no_override unique] BB extends B {
.default_ctor;
}
.class [unique] BAA extends BA {
.default_ctor;
}
# Make sure BAA doesn't get AttrNoOverride:
.class [unique] BAADeriver extends BAA {
.default_ctor;
}
.class [unique] TestClass {
.default_ctor;
}
# Make sure TestClass doesn't get AttrNoOverride:
.class [unique] TestClassDeriver extends TestClass {
.default_ctor;
}
.class NonUnique { .default_ctor; }
.class NonUnique { .default_ctor; }
.class NonUniqueA extends NonUnique {
.default_ctor;
}
.class NonUniqueA extends NonUnique {
.default_ctor;
}
.function test() {
Int 1
RetC
}
)";
std::unique_ptr<UnitEmitter> ue(assemble_string(
hhas.c_str(), hhas.size(),
"ignore.php",
MD5("12345432123454321234543212345432")
));
return parse_unit(*ue);
}
std::unique_ptr<php::Program> make_program() {
auto program = folly::make_unique<php::Program>();
program->units.push_back(make_test_unit());
return program;
}
//////////////////////////////////////////////////////////////////////
auto const test_empty_array = folly::lazy([] {
return staticEmptyArray();
});
auto const test_array_map_value = folly::lazy([] {
auto ar = make_map_array(
s_A.get(), s_B.get(),
s_test.get(), 12
);
return ArrayData::GetScalarArray(ar.get());
});
auto const test_array_packed_value = folly::lazy([] {
auto ar = make_packed_array(
42,
23,
12
);
return ArrayData::GetScalarArray(ar.get());
});
auto const test_array_packed_value2 = folly::lazy([] {
auto ar = make_packed_array(
42,
23.0,
12
);
return ArrayData::GetScalarArray(ar.get());
});
auto const test_array_packed_value3 = folly::lazy([] {
auto ar = make_packed_array(
1,
2,
3,
4,
5
);
return ArrayData::GetScalarArray(ar.get());
});
auto const with_data = folly::lazy([] {
return std::vector<Type> {
ival(2),
dval(2.0),
sval(s_test.get()),
aval(test_array_map_value()),
aval(test_array_packed_value())
};
});
// In the sense of "non-union type", not the sense of TPrim.
auto const primitives = {
TUninit,
TInitNull,
TFalse,
TTrue,
TInt,
TDbl,
TSStr,
TCStr,
TSArrE,
TCArrE,
TSArrN,
TCArrN,
TObj,
TRes,
TCls,
TRef
};
auto const optionals = {
TOptTrue,
TOptFalse,
TOptBool,
TOptInt,
TOptDbl,
TOptNum,
TOptSStr,
TOptCStr,
TOptStr,
TOptSArrE,
TOptCArrE,
TOptSArrN,
TOptCArrN,
TOptSArr,
TOptCArr,
TOptArr,
TOptObj,
TOptRes
};
auto const non_opt_unions = {
TInitCell,
TCell,
TInitGen,
TGen,
TNull,
TBool,
TNum,
TStr,
TArrE,
TArrN,
TSArr,
TCArr,
TArr,
TInitPrim,
TPrim,
TInitUnc,
TUnc,
TTop,
};
auto const all_unions = boost::join(optionals, non_opt_unions);
auto const all = folly::lazy([] {
std::vector<Type> ret;
auto const wdata = with_data();
ret.insert(end(ret), begin(primitives), end(primitives));
ret.insert(end(ret), begin(all_unions), end(all_unions));
ret.insert(end(ret), begin(wdata), end(wdata));
return ret;
});
template<class Range>
std::vector<Type> wait_handles_of(const Index& index, const Range& r) {
std::vector<Type> ret;
for (auto& t : r) ret.push_back(wait_handle(index, t));
return ret;
}
std::vector<Type> all_with_waithandles(const Index& index) {
auto ret = wait_handles_of(index, all());
for (auto& t : all()) ret.push_back(t);
return ret;
}
auto const specialized_array_examples = folly::lazy([] {
auto ret = std::vector<Type>{};
auto test_map_a = StructMap{};
test_map_a[s_test.get()] = ival(2);
ret.emplace_back(sarr_struct(test_map_a));
auto test_map_b = StructMap{};
test_map_b[s_test.get()] = TInt;
ret.emplace_back(sarr_struct(test_map_b));
auto test_map_c = StructMap{};
test_map_c[s_A.get()] = TInt;
ret.emplace_back(sarr_struct(test_map_c));
auto test_map_d = StructMap{};
test_map_d[s_A.get()] = TInt;
test_map_d[s_test.get()] = TDbl;
ret.emplace_back(sarr_struct(test_map_d));
ret.emplace_back(arr_packedn(TInt));
ret.emplace_back(arr_mapn(TSStr, arr_mapn(TInt, TSStr)));
ret.emplace_back(arr_mapn(TSStr, TArr));
ret.emplace_back(arr_mapn(TSStr, arr_packedn(TSStr)));
ret.emplace_back(arr_mapn(TSStr, arr_mapn(TSStr, TSStr)));
return ret;
});
//////////////////////////////////////////////////////////////////////
}
TEST(Type, Top) {
auto const program = make_program();
Index index { borrow(program) };
// Everything is a subtype of Top, couldBe Top, and the union of Top
// with anything is Top.
for (auto& t : all_with_waithandles(index)) {
EXPECT_TRUE(t.subtypeOf(TTop));
EXPECT_TRUE(t.couldBe(TTop));
EXPECT_TRUE(union_of(t, TTop) == TTop);
EXPECT_TRUE(union_of(TTop, t) == TTop);
}
}
TEST(Type, Bottom) {
auto const program = make_program();
Index index { borrow(program) };
// Bottom is a subtype of everything, nothing couldBe Bottom, and
// the union_of anything with Bottom is itself.
for (auto& t : all_with_waithandles(index)) {
EXPECT_TRUE(TBottom.subtypeOf(t));
EXPECT_TRUE(!TBottom.couldBe(t));
EXPECT_TRUE(union_of(t, TBottom) == t);
EXPECT_TRUE(union_of(TBottom, t) == t);
}
}
TEST(Type, Prims) {
auto const program = make_program();
Index index { borrow(program) };
// All pairs of non-equivalent primitives are not related by either
// subtypeOf or couldBe, including if you wrap them in wait handles.
for (auto& t1 : primitives) {
for (auto& t2 : primitives) {
if (t1 != t2) {
EXPECT_TRUE(!t1.subtypeOf(t2) && !t2.subtypeOf(t1));
EXPECT_TRUE(!t1.couldBe(t2));
EXPECT_TRUE(!t2.couldBe(t1));
auto const w1 = wait_handle(index, t1);
auto const w2 = wait_handle(index, t2);
EXPECT_TRUE(!w1.subtypeOf(w2) && !w2.subtypeOf(w1));
EXPECT_TRUE(!w1.couldBe(w2));
EXPECT_TRUE(!w2.couldBe(w1));
}
}
}
}
TEST(Type, Relations) {
auto const program = make_program();
Index index { borrow(program) };
// couldBe is symmetric and reflexive
for (auto& t1 : all_with_waithandles(index)) {
for (auto& t2 : all()) {
EXPECT_TRUE(t1.couldBe(t2) == t2.couldBe(t1));
}
}
for (auto& t1 : all_with_waithandles(index)) {
EXPECT_TRUE(t1.couldBe(t1));
}
// subtype is antisymmetric and reflexive
for (auto& t1 : all_with_waithandles(index)) {
for (auto& t2 : all_with_waithandles(index)) {
if (t1 != t2) {
EXPECT_TRUE(!(t1.subtypeOf(t2) && t2.subtypeOf(t1)));
}
}
}
for (auto& t1 : all_with_waithandles(index)) {
EXPECT_TRUE(t1.subtypeOf(t1));
}
// union_of is commutative
for (auto& t1 : all_with_waithandles(index)) {
for (auto& t2 : all_with_waithandles(index)) {
EXPECT_TRUE(union_of(t1, t2) == union_of(t2, t1))
<< " " << show(t1) << ' ' << show(t2)
<< "\n union_of(t1, t2): " << show(union_of(t1, t2))
<< "\n union_of(t2, t1): " << show(union_of(t2, t1));
}
}
}
TEST(Type, Prim) {
auto subtype_true = std::initializer_list<std::pair<Type,Type>> {
{ TInt, TPrim },
{ TBool, TPrim },
{ TNum, TPrim },
{ TInitNull, TPrim },
{ TDbl, TPrim },
{ dval(0.0), TPrim },
{ ival(0), TPrim },
{ TNull, TPrim },
{ TInt, TInitPrim },
{ TBool, TInitPrim },
{ TNum, TInitPrim },
{ TInitNull, TInitPrim },
{ TDbl, TInitPrim },
{ dval(0.0), TInitPrim },
{ ival(0), TInitPrim },
};
auto subtype_false = std::initializer_list<std::pair<Type,Type>> {
{ sval(s_test.get()), TPrim },
{ TSStr, TPrim },
{ TSArr, TPrim },
{ TNull, TInitPrim }, // TNull could be uninit
{ TPrim, TBool },
{ TPrim, TInt },
{ TPrim, TNum },
{ TInitPrim, TNum },
{ TUnc, TPrim },
{ TUnc, TInitPrim },
{ TInitUnc, TPrim },
{ TSStr, TInitPrim },
{ TArr, TInitPrim },
{ TSArr, TPrim },
{ TPrim, dval(0.0) },
};
auto couldbe_true = std::initializer_list<std::pair<Type,Type>> {
{ TPrim, TInt },
{ TPrim, TBool },
{ TPrim, TNum },
{ TInitPrim, TNum },
{ TInitPrim, TFalse },
{ TPrim, TCell },
{ TPrim, TInt },
{ TPrim, TInt },
{ TPrim, TOptObj },
{ TPrim, TOptFalse },
};
auto couldbe_false = std::initializer_list<std::pair<Type,Type>> {
{ TPrim, TSStr },
{ TInitPrim, TSStr },
{ TInitPrim, sval(s_test.get()) },
{ TPrim, sval(s_test.get()) },
{ TInitPrim, TUninit },
{ TPrim, TRef },
{ TPrim, TObj },
};
for (auto kv : subtype_true) {
EXPECT_TRUE(kv.first.subtypeOf(kv.second))
<< show(kv.first) << " subtypeOf " << show(kv.second);
}
for (auto kv : subtype_false) {
EXPECT_FALSE(kv.first.subtypeOf(kv.second))
<< show(kv.first) << " !subtypeOf " << show(kv.second);
}
for (auto kv : couldbe_true) {
EXPECT_TRUE(kv.first.couldBe(kv.second))
<< show(kv.first) << " couldbe " << show(kv.second);
EXPECT_TRUE(kv.second.couldBe(kv.first))
<< show(kv.first) << " couldbe " << show(kv.second);
}
for (auto kv : couldbe_false) {
EXPECT_TRUE(!kv.first.couldBe(kv.second))
<< show(kv.first) << " !couldbe " << show(kv.second);
EXPECT_TRUE(!kv.second.couldBe(kv.first))
<< show(kv.first) << " !couldbe " << show(kv.second);
}
}
TEST(Type, CouldBeValues) {
EXPECT_FALSE(ival(2).couldBe(ival(3)));
EXPECT_TRUE(ival(2).couldBe(ival(2)));
EXPECT_FALSE(aval(test_array_packed_value()).couldBe(
aval(test_array_map_value())));
EXPECT_TRUE(aval(test_array_packed_value()).couldBe(
aval(test_array_packed_value())));
EXPECT_TRUE(dval(2.0).couldBe(dval(2.0)));
EXPECT_FALSE(dval(2.0).couldBe(dval(3.0)));
EXPECT_FALSE(sval(s_test.get()).couldBe(sval(s_A.get())));
EXPECT_TRUE(sval(s_test.get()).couldBe(sval(s_test.get())));
}
TEST(Type, Unc) {
EXPECT_TRUE(TInt.subtypeOf(TInitUnc));
EXPECT_TRUE(TInt.subtypeOf(TUnc));
EXPECT_TRUE(TDbl.subtypeOf(TInitUnc));
EXPECT_TRUE(TDbl.subtypeOf(TUnc));
EXPECT_TRUE(dval(3.0).subtypeOf(TInitUnc));
auto pairs = std::initializer_list<std::pair<Type,Type>> {
{ TUnc, TInitUnc },
{ TUnc, TInitCell },
{ TUnc, TCell },
{ TInitUnc, TInt },
{ TInitUnc, TOptInt },
{ TInitUnc, opt(ival(2)) },
{ TUnc, TInt },
{ TUnc, TOptInt },
{ TUnc, opt(ival(2)) },
{ TNum, TUnc },
{ TNum, TInitUnc },
};
for (auto kv : pairs) {
EXPECT_TRUE(kv.first.couldBe(kv.second))
<< show(kv.first) << " couldBe " << show(kv.second);
}
}
TEST(Type, DblNan) {
auto const qnan = std::numeric_limits<double>::quiet_NaN();
EXPECT_TRUE(dval(qnan).subtypeOf(dval(qnan)));
EXPECT_TRUE(dval(qnan).couldBe(dval(qnan)));
EXPECT_TRUE(dval(qnan) == dval(qnan));
}
TEST(Type, Option) {
auto const program = make_program();
Index index { borrow(program) };
EXPECT_TRUE(TTrue.subtypeOf(TOptTrue));
EXPECT_TRUE(TInitNull.subtypeOf(TOptTrue));
EXPECT_TRUE(!TUninit.subtypeOf(TOptTrue));
EXPECT_TRUE(TFalse.subtypeOf(TOptFalse));
EXPECT_TRUE(TInitNull.subtypeOf(TOptFalse));
EXPECT_TRUE(!TUninit.subtypeOf(TOptFalse));
EXPECT_TRUE(TFalse.subtypeOf(TOptBool));
EXPECT_TRUE(TTrue.subtypeOf(TOptBool));
EXPECT_TRUE(TInitNull.subtypeOf(TOptBool));
EXPECT_TRUE(!TUninit.subtypeOf(TOptBool));
EXPECT_TRUE(ival(3).subtypeOf(TOptInt));
EXPECT_TRUE(TInt.subtypeOf(TOptInt));
EXPECT_TRUE(TInitNull.subtypeOf(TOptInt));
EXPECT_TRUE(!TUninit.subtypeOf(TOptInt));
EXPECT_TRUE(TDbl.subtypeOf(TOptDbl));
EXPECT_TRUE(TInitNull.subtypeOf(TOptDbl));
EXPECT_TRUE(!TUninit.subtypeOf(TOptDbl));
EXPECT_TRUE(dval(3.0).subtypeOf(TOptDbl));
EXPECT_TRUE(sval(s_test.get()).subtypeOf(TOptSStr));
EXPECT_TRUE(TSStr.subtypeOf(TOptSStr));
EXPECT_TRUE(TInitNull.subtypeOf(TOptSStr));
EXPECT_TRUE(!TUninit.subtypeOf(TOptSStr));
EXPECT_TRUE(!TStr.subtypeOf(TOptSStr));
EXPECT_TRUE(TStr.couldBe(TOptSStr));
EXPECT_TRUE(TCStr.subtypeOf(TOptStr));
EXPECT_TRUE(TCArr.subtypeOf(TOptArr));
EXPECT_TRUE(TStr.subtypeOf(TOptStr));
EXPECT_TRUE(TSStr.subtypeOf(TOptStr));
EXPECT_TRUE(sval(s_test.get()).subtypeOf(TOptStr));
EXPECT_TRUE(TInitNull.subtypeOf(TOptStr));
EXPECT_TRUE(!TUninit.subtypeOf(TOptStr));
EXPECT_TRUE(TSArr.subtypeOf(TOptSArr));
EXPECT_TRUE(!TArr.subtypeOf(TOptSArr));
EXPECT_TRUE(TInitNull.subtypeOf(TOptSArr));
EXPECT_TRUE(!TUninit.subtypeOf(TOptSArr));
EXPECT_TRUE(TArr.subtypeOf(TOptArr));
EXPECT_TRUE(TInitNull.subtypeOf(TOptArr));
EXPECT_TRUE(!TUninit.subtypeOf(TOptArr));
EXPECT_TRUE(TObj.subtypeOf(TOptObj));
EXPECT_TRUE(TInitNull.subtypeOf(TOptObj));
EXPECT_TRUE(!TUninit.subtypeOf(TOptObj));
EXPECT_TRUE(TRes.subtypeOf(TOptRes));
EXPECT_TRUE(TInitNull.subtypeOf(TOptRes));
EXPECT_TRUE(!TUninit.subtypeOf(TOptRes));
for (auto& t : optionals) EXPECT_EQ(t, opt(unopt(t)));
for (auto& t : optionals) EXPECT_TRUE(is_opt(t));
for (auto& t : all()) {
auto const found =
std::find(begin(optionals), end(optionals), t) != end(optionals);
EXPECT_EQ(found, is_opt(t));
}
EXPECT_TRUE(is_opt(opt(sval(s_test.get()))));
EXPECT_TRUE(is_opt(opt(ival(2))));
EXPECT_TRUE(is_opt(opt(dval(2.0))));
EXPECT_FALSE(is_opt(sval(s_test.get())));
EXPECT_FALSE(is_opt(ival(2)));
EXPECT_FALSE(is_opt(dval(2.0)));
EXPECT_TRUE(wait_handle(index, opt(dval(2.0))).couldBe(
wait_handle(index, dval(2.0))));
}
TEST(Type, Num) {
EXPECT_EQ(union_of(TInt, TDbl), TNum);
EXPECT_EQ(union_of(ival(2), dval(1.0)), TNum);
EXPECT_EQ(union_of(TInt, dval(1.0)), TNum);
}
TEST(Type, OptUnionOf) {
EXPECT_EQ(opt(ival(2)), union_of(ival(2), TInitNull));
EXPECT_EQ(opt(dval(2.0)), union_of(TInitNull, dval(2.0)));
EXPECT_EQ(opt(sval(s_test.get())), union_of(sval(s_test.get()), TInitNull));
EXPECT_EQ(opt(sval(s_test.get())), union_of(TInitNull, sval(s_test.get())));
EXPECT_EQ(TOptBool, union_of(TOptFalse, TOptTrue));
EXPECT_EQ(TOptBool, union_of(TOptTrue, TOptFalse));
EXPECT_EQ(TOptCArr, union_of(TCArr, TInitNull));
EXPECT_EQ(TOptCArr, union_of(TInitNull, TCArr));
EXPECT_EQ(TOptSArr, union_of(TInitNull, TOptSArr));
EXPECT_EQ(TOptSArr, union_of(TOptSArr, TInitNull));
EXPECT_EQ(TOptArr, union_of(TOptArr, TInitNull));
EXPECT_EQ(TOptArr, union_of(TInitNull, TOptArr));
EXPECT_EQ(TInitUnc, union_of(TOptSArr, TSStr));
EXPECT_EQ(TInitUnc, union_of(TSStr, TOptSArr));
EXPECT_EQ(TOptSStr,
union_of(opt(sval(s_test.get())), opt(sval(s_TestClass.get()))));
EXPECT_EQ(TOptInt, union_of(opt(ival(2)), opt(ival(3))));
EXPECT_EQ(TOptDbl, union_of(opt(dval(2.0)), opt(dval(3.0))));
EXPECT_EQ(TOptNum, union_of(TInitNull, TNum));
EXPECT_EQ(TOptNum, union_of(TInitNull, union_of(dval(1), ival(0))));
auto const program = make_program();
Index index { borrow(program) };
auto const rcls = index.builtin_class(s_WaitHandle.get());
EXPECT_TRUE(union_of(TObj, opt(objExact(rcls))) == TOptObj);
}
TEST(Type, OptTV) {
EXPECT_TRUE(!tv(opt(ival(2))));
EXPECT_TRUE(!tv(opt(sval(s_test.get()))));
EXPECT_TRUE(!tv(opt(dval(2.0))));
EXPECT_TRUE(!tv(TOptFalse));
EXPECT_TRUE(!tv(TOptTrue));
for (auto& x : optionals) {
EXPECT_TRUE(!tv(x));
}
}
TEST(Type, OptCouldBe) {
for (auto& x : optionals) EXPECT_TRUE(x.couldBe(unopt(x)));
auto true_cases = std::initializer_list<std::pair<Type,Type>> {
{ opt(sval(s_test.get())), TStr },
{ opt(sval(s_test.get())), TInitNull },
{ opt(sval(s_test.get())), TSStr },
{ opt(sval(s_test.get())), sval(s_test.get()) },
{ opt(ival(2)), TInt },
{ opt(ival(2)), TInitNull },
{ opt(ival(2)), ival(2) },
{ opt(dval(2.0)), TDbl },
{ opt(dval(2.0)), TInitNull },
{ opt(dval(2.0)), dval(2) },
{ opt(TFalse), TBool },
{ opt(TFalse), TFalse },
{ opt(TTrue), TBool },
{ opt(TTrue), TTrue },
{ opt(TDbl), opt(TNum) },
{ TDbl, opt(TNum) },
{ TNum, opt(TDbl) },
{ opt(TInt), TNum },
{ TInt, opt(TNum) },
{ opt(TDbl), TNum },
};
auto false_cases = std::initializer_list<std::pair<Type,Type>> {
{ opt(sval(s_test.get())), TCStr },
{ opt(ival(2)), TDbl },
{ opt(dval(2.0)), TInt },
{ opt(TFalse), TTrue },
{ opt(TTrue), TFalse },
{ TFalse, opt(TNum) },
};
for (auto kv : true_cases) {
EXPECT_TRUE(kv.first.couldBe(kv.second))
<< show(kv.first) << " couldBe " << show(kv.second)
<< " should be true";
}
for (auto kv : false_cases) {
EXPECT_TRUE(!kv.first.couldBe(kv.second))
<< show(kv.first) << " couldBe " << show(kv.second)
<< " should be false";
}
for (auto kv : boost::join(true_cases, false_cases)) {
EXPECT_EQ(kv.first.couldBe(kv.second), kv.second.couldBe(kv.first))
<< show(kv.first) << " couldBe " << show(kv.second)
<< " wasn't reflexive";
}
for (auto& x : optionals) {
EXPECT_TRUE(x.couldBe(unopt(x)));
EXPECT_TRUE(x.couldBe(TInitNull));
EXPECT_TRUE(!x.couldBe(TUninit));
for (auto& y : optionals) {
EXPECT_TRUE(x.couldBe(y));
}
}
}
TEST(Type, Ref) {
EXPECT_TRUE(TRef == TRef);
EXPECT_TRUE(TRef != ref_to(TInt));
EXPECT_TRUE(ref_to(TInt) == ref_to(TInt));
EXPECT_TRUE(ref_to(TInt) != ref_to(TOptInt));
EXPECT_TRUE(TRef.couldBe(ref_to(TInt)));
EXPECT_TRUE(ref_to(TInt).couldBe(TRef));
EXPECT_TRUE(!ref_to(TInt).couldBe(ref_to(TObj)));
EXPECT_TRUE(ref_to(TOptInt).couldBe(ref_to(TInt)));
EXPECT_TRUE(!TRef.subtypeOf(ref_to(TInt)));
EXPECT_TRUE(ref_to(TInt).subtypeOf(TRef));
EXPECT_TRUE(ref_to(TInt).subtypeOf(ref_to(TOptInt)));
EXPECT_TRUE(!ref_to(TOptInt).subtypeOf(ref_to(TInt)));
EXPECT_TRUE(!ref_to(TObj).subtypeOf(ref_to(TInt)));
EXPECT_TRUE(!ref_to(TInt).subtypeOf(ref_to(TObj)));
EXPECT_TRUE(union_of(TRef, ref_to(TInt)) == TRef);
EXPECT_TRUE(union_of(ref_to(TInt), ref_to(TObj)) == ref_to(TInitCell));
EXPECT_TRUE(union_of(ref_to(TInitNull), ref_to(TObj)) == ref_to(TOptObj));
}
TEST(Type, SpecificExamples) {
// Random examples to stress option types, values, etc:
EXPECT_TRUE(!TInt.subtypeOf(ival(1)));
EXPECT_TRUE(TInitCell.couldBe(ival(1)));
EXPECT_TRUE(TInitCell.subtypeOf(TGen));
EXPECT_TRUE(ival(2).subtypeOf(TInt));
EXPECT_TRUE(!ival(2).subtypeOf(TBool));
EXPECT_TRUE(ival(3).subtypeOf(TOptInt));
EXPECT_TRUE(TInt.subtypeOf(TOptInt));
EXPECT_TRUE(!TBool.subtypeOf(TOptInt));
EXPECT_TRUE(TInitNull.subtypeOf(TOptInt));
EXPECT_TRUE(!TNull.subtypeOf(TOptInt));
EXPECT_TRUE(TNull.couldBe(TOptInt));
EXPECT_TRUE(TNull.couldBe(TOptBool));
EXPECT_TRUE(TInitNull.subtypeOf(TInitCell));
EXPECT_TRUE(TInitNull.subtypeOf(TCell));
EXPECT_TRUE(!TUninit.subtypeOf(TInitNull));
EXPECT_TRUE(ival(3).subtypeOf(TOptInt));
EXPECT_TRUE(ival(3).subtypeOf(opt(ival(3))));
EXPECT_TRUE(ival(3).couldBe(opt(ival(3))));
EXPECT_TRUE(ival(3).couldBe(TInt));
EXPECT_TRUE(TInitNull.couldBe(opt(ival(3))));
EXPECT_TRUE(TNull.couldBe(opt(ival(3))));
EXPECT_TRUE(TInitNull.subtypeOf(opt(ival(3))));
EXPECT_TRUE(!TNull.subtypeOf(opt(ival(3))));
EXPECT_EQ(TStr, union_of(sval(s_test.get()), TCStr));
EXPECT_EQ(TStr, union_of(TCStr, sval(s_test.get())));
EXPECT_EQ(TGen, union_of(TRef, TUninit));
}
TEST(Type, IndexBased) {
auto const program = make_program();
auto const unit = borrow(program->units.back());
auto const func = [&]() -> borrowed_ptr<php::Func> {
for (auto& f : unit->funcs) {
if (f->name->isame(s_test.get())) return borrow(f);
}
return nullptr;
}();
EXPECT_TRUE(func != nullptr);
auto const ctx = Context { unit, func };
Index idx{borrow(program)};
auto const cls = idx.resolve_class(ctx, s_TestClass.get());
if (!cls) EXPECT_TRUE(false);
auto const clsBase = idx.resolve_class(ctx, s_Base.get());
if (!clsBase) EXPECT_TRUE(false);
auto const objExactTy = objExact(*cls);
auto const subObjTy = subObj(*cls);
auto const clsExactTy = clsExact(*cls);
auto const subClsTy = subCls(*cls);
auto const objExactBaseTy = objExact(*clsBase);
auto const subObjBaseTy = subObj(*clsBase);
// Basic relationship between the class types and object types.
EXPECT_EQ(objcls(objExactTy), clsExactTy);
EXPECT_EQ(objcls(subObjTy), subClsTy);
// =TestClass <: <=TestClass, and not vice versa.
EXPECT_TRUE(objExactTy.subtypeOf(subObjTy));
EXPECT_TRUE(!subObjTy.subtypeOf(objExactTy));
// =TestClass <: <=TestClass, and not vice versa.
EXPECT_TRUE(clsExactTy.subtypeOf(subClsTy));
EXPECT_TRUE(!subClsTy.subtypeOf(clsExactTy));
// =TestClass couldBe <= TestClass, and vice versa.
EXPECT_TRUE(objExactTy.couldBe(subObjTy));
EXPECT_TRUE(subObjTy.couldBe(objExactTy));
EXPECT_TRUE(clsExactTy.couldBe(subClsTy));
EXPECT_TRUE(subClsTy.couldBe(clsExactTy));
// Foo= and Foo<= are both subtypes of Foo, and couldBe Foo.
EXPECT_TRUE(objExactTy.subtypeOf(TObj));
EXPECT_TRUE(subObjTy.subtypeOf(TObj));
EXPECT_TRUE(objExactTy.couldBe(TObj));
EXPECT_TRUE(subObjTy.couldBe(TObj));
EXPECT_TRUE(TObj.couldBe(objExactTy));
EXPECT_TRUE(TObj.couldBe(subObjTy));
EXPECT_TRUE(clsExactTy.subtypeOf(TCls));
EXPECT_TRUE(subClsTy.subtypeOf(TCls));
EXPECT_TRUE(clsExactTy.couldBe(TCls));
EXPECT_TRUE(subClsTy.couldBe(TCls));
EXPECT_TRUE(TCls.couldBe(clsExactTy));
EXPECT_TRUE(TCls.couldBe(subClsTy));
// Obj= and Obj<= both couldBe ?Obj, and vice versa.
EXPECT_TRUE(objExactTy.couldBe(TOptObj));
EXPECT_TRUE(subObjTy.couldBe(TOptObj));
EXPECT_TRUE(TOptObj.couldBe(objExactTy));
EXPECT_TRUE(TOptObj.couldBe(subObjTy));
// Obj= and Obj<= are subtypes of ?Obj.
EXPECT_TRUE(objExactTy.subtypeOf(TOptObj));
EXPECT_TRUE(subObjTy.subtypeOf(TOptObj));
// Obj= is a subtype of ?Obj=, and also ?Obj<=.
EXPECT_TRUE(objExactTy.subtypeOf(opt(objExactTy)));
EXPECT_TRUE(objExactTy.subtypeOf(opt(subObjTy)));
EXPECT_TRUE(!opt(objExactTy).subtypeOf(objExactTy));
EXPECT_TRUE(!opt(subObjTy).subtypeOf(objExactTy));
// Obj= couldBe ?Obj= and ?Obj<=, and vice versa.
EXPECT_TRUE(objExactTy.couldBe(opt(objExactTy)));
EXPECT_TRUE(opt(objExactTy).couldBe(objExactTy));
EXPECT_TRUE(objExactTy.couldBe(opt(subObjTy)));
EXPECT_TRUE(opt(subObjTy).couldBe(objExactTy));
// Obj<= is not a subtype of ?Obj=, it is overlapping but
// potentially contains other types. (We might eventually check
// whether objects are final as part of this, but not right now.)
EXPECT_TRUE(!subObjTy.subtypeOf(opt(objExactTy)));
EXPECT_TRUE(!opt(objExactTy).subtypeOf(subObjTy));
// Obj<= couldBe ?Obj= and vice versa.
EXPECT_TRUE(subObjTy.couldBe(opt(objExactTy)));
EXPECT_TRUE(opt(objExactTy).couldBe(subObjTy));
// ?Obj<=, ?Obj=, ?Foo<= and ?Foo= couldBe each other
EXPECT_TRUE(opt(subObjTy).couldBe(opt(objExactBaseTy)));
EXPECT_TRUE(opt(objExactBaseTy).couldBe(opt(subObjTy)));
EXPECT_TRUE(opt(subObjTy).couldBe(opt(subObjBaseTy)));
EXPECT_TRUE(opt(subObjBaseTy).couldBe(opt(subObjTy)));
EXPECT_TRUE(opt(objExactTy).couldBe(opt(objExactBaseTy)));
EXPECT_TRUE(opt(objExactBaseTy).couldBe(opt(objExactTy)));
EXPECT_TRUE(opt(objExactTy).couldBe(opt(subObjBaseTy)));
EXPECT_TRUE(opt(subObjBaseTy).couldBe(opt(objExactTy)));
}
TEST(Type, Hierarchies) {
auto const program = make_program();
auto const unit = borrow(program->units.back());
auto const func = [&]() -> borrowed_ptr<php::Func> {
for (auto& f : unit->funcs) {
if (f->name->isame(s_test.get())) return borrow(f);
}
return nullptr;
}();
EXPECT_TRUE(func != nullptr);
auto const ctx = Context { unit, func };
Index idx{borrow(program)};
// load classes in hierarchy
auto const clsBase = idx.resolve_class(ctx, s_Base.get());
if (!clsBase) EXPECT_TRUE(false);
auto const clsA = idx.resolve_class(ctx, s_A.get());
if (!clsA) EXPECT_TRUE(false);
auto const clsB = idx.resolve_class(ctx, s_B.get());
if (!clsB) EXPECT_TRUE(false);
auto const clsAA = idx.resolve_class(ctx, s_AA.get());
if (!clsAA) EXPECT_TRUE(false);
auto const clsAB = idx.resolve_class(ctx, s_AB.get());
if (!clsAB) EXPECT_TRUE(false);
auto const clsBA = idx.resolve_class(ctx, s_BA.get());
if (!clsBA) EXPECT_TRUE(false);
auto const clsBB = idx.resolve_class(ctx, s_BB.get());
if (!clsBB) EXPECT_TRUE(false);
auto const clsBAA = idx.resolve_class(ctx, s_BAA.get());
if (!clsBAA) EXPECT_TRUE(false);
auto const clsTestClass = idx.resolve_class(ctx, s_TestClass.get());
if (!clsTestClass) EXPECT_TRUE(false);
auto const clsNonUnique = idx.resolve_class(ctx, s_NonUnique.get());
if (!clsNonUnique) EXPECT_TRUE(false);
// make *exact type* and *sub type* types and objects for all loaded classes
auto const objExactBaseTy = objExact(*clsBase);
auto const subObjBaseTy = subObj(*clsBase);
auto const clsExactBaseTy = clsExact(*clsBase);
auto const subClsBaseTy = subCls(*clsBase);
auto const objExactATy = objExact(*clsA);
auto const subObjATy = subObj(*clsA);
auto const clsExactATy = clsExact(*clsA);
auto const subClsATy = subCls(*clsA);
auto const objExactAATy = objExact(*clsAA);
auto const subObjAATy = subObj(*clsAA);
auto const clsExactAATy = clsExact(*clsAA);
auto const subClsAATy = subCls(*clsAA);
auto const objExactABTy = objExact(*clsAB);
auto const subObjABTy = subObj(*clsAB);
auto const clsExactABTy = clsExact(*clsAB);
auto const subClsABTy = subCls(*clsAB);
auto const objExactBTy = objExact(*clsB);
auto const subObjBTy = subObj(*clsB);
auto const clsExactBTy = clsExact(*clsB);
auto const subClsBTy = subCls(*clsB);
auto const objExactBATy = objExact(*clsBA);
auto const subObjBATy = subObj(*clsBA);
auto const clsExactBATy = clsExact(*clsBA);
auto const subClsBATy = subCls(*clsBA);
auto const objExactBBTy = objExact(*clsBB);
auto const subObjBBTy = subObj(*clsBB);
auto const clsExactBBTy = clsExact(*clsBB);
auto const subClsBBTy = subCls(*clsBB);
auto const objExactBAATy = objExact(*clsBAA);
auto const subObjBAATy = subObj(*clsBAA);
auto const clsExactBAATy = clsExact(*clsBAA);
auto const subClsBAATy = subCls(*clsBAA);
auto const objExactTestClassTy = objExact(*clsTestClass);
auto const subObjTestClassTy = subObj(*clsTestClass);
auto const clsExactTestClassTy = clsExact(*clsTestClass);
auto const subClsTestClassTy = subCls(*clsTestClass);
auto const objExactNonUniqueTy = objExact(*clsNonUnique);
auto const subObjNonUniqueTy = subObj(*clsNonUnique);
auto const clsExactNonUniqueTy = clsExact(*clsNonUnique);
auto const subClsNonUniqueTy = subCls(*clsNonUnique);
// check that type from object and type are the same (obnoxious test)
EXPECT_EQ(objcls(objExactBaseTy), clsExactBaseTy);
EXPECT_EQ(objcls(subObjBaseTy), subClsBaseTy);
EXPECT_EQ(objcls(objExactATy), clsExactATy);
EXPECT_EQ(objcls(subObjATy), subClsATy);
EXPECT_EQ(objcls(objExactAATy), clsExactAATy);
EXPECT_EQ(objcls(subObjAATy), subClsAATy);
EXPECT_EQ(objcls(objExactABTy), clsExactABTy);
EXPECT_EQ(objcls(subObjABTy), subClsABTy);
EXPECT_EQ(objcls(objExactBTy), clsExactBTy);
EXPECT_EQ(objcls(subObjBTy), subClsBTy);
EXPECT_EQ(objcls(objExactBATy), clsExactBATy);
EXPECT_EQ(objcls(subObjBATy), subClsBATy);
EXPECT_EQ(objcls(objExactBBTy), clsExactBBTy);
EXPECT_EQ(objcls(subObjBBTy), subClsBBTy);
EXPECT_EQ(objcls(objExactBAATy), clsExactBAATy);
EXPECT_EQ(objcls(subObjBAATy), subClsBAATy);
// both subobj(A) and subcls(A) of no_override class A change to exact types
EXPECT_EQ(objcls(objExactABTy), subClsABTy);
EXPECT_EQ(objcls(subObjABTy), clsExactABTy);
// a T= is a subtype of itself but not a strict subtype
// also a T= is in a "could be" relationship with itself.
EXPECT_TRUE(objcls(objExactBaseTy).subtypeOf(clsExactBaseTy));
EXPECT_FALSE(objcls(objExactBaseTy).strictSubtypeOf(objcls(objExactBaseTy)));
EXPECT_TRUE(objcls(objExactBAATy).subtypeOf(clsExactBAATy));
EXPECT_FALSE(clsExactBAATy.strictSubtypeOf(objcls(objExactBAATy)));
EXPECT_TRUE(clsExactBAATy.couldBe(clsExactBAATy));
// Given the hierarchy A <- B <- C where A is the base then:
// B= is not in any subtype relationshipt with a A= or C=.
// Neither they are in "could be" relationships.
// Overall T= sets are always disjoint.
EXPECT_FALSE(objcls(objExactBATy).subtypeOf(clsExactBaseTy));
EXPECT_FALSE(objcls(objExactBATy).subtypeOf(clsExactBTy));
EXPECT_FALSE(objcls(objExactBATy).subtypeOf(clsExactBAATy));
EXPECT_FALSE(clsExactBATy.strictSubtypeOf(objcls(objExactBaseTy)));
EXPECT_FALSE(clsExactBATy.strictSubtypeOf(objcls(objExactBTy)));
EXPECT_FALSE(clsExactBATy.strictSubtypeOf(objcls(objExactBAATy)));
EXPECT_FALSE(clsExactBATy.couldBe(objcls(objExactBaseTy)));
EXPECT_FALSE(objcls(objExactBATy).couldBe(clsExactBTy));
EXPECT_FALSE(clsExactBATy.couldBe(objcls(objExactBAATy)));
// any T= is both a subtype and strict subtype of T<=.
// Given the hierarchy A <- B <- C where A is the base then:
// C= is a subtype and a strict subtype of B<=, ?B<=, A<= and ?A<=.
// The "could be" relationship also holds.
EXPECT_TRUE(objcls(objExactATy).subtypeOf(subClsATy));
EXPECT_TRUE(objcls(objExactBAATy).subtypeOf(subClsBaseTy));
EXPECT_TRUE(objExactBAATy.subtypeOf(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(objExactBAATy).subtypeOf(subClsBTy));
EXPECT_TRUE(objExactBAATy.subtypeOf(opt(subObjBTy)));
EXPECT_TRUE(clsExactBAATy.subtypeOf(objcls(subObjBATy)));
EXPECT_TRUE(objExactBAATy.subtypeOf(opt(subObjBATy)));
EXPECT_TRUE(clsExactBAATy.subtypeOf(objcls(subObjBAATy)));
EXPECT_TRUE(objExactBAATy.subtypeOf(opt(subObjBAATy)));
EXPECT_TRUE(objcls(objExactATy).strictSubtypeOf(subClsATy));
EXPECT_TRUE(objcls(objExactBAATy).strictSubtypeOf(subClsBaseTy));
EXPECT_TRUE(objExactBAATy.strictSubtypeOf(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(objExactBAATy).strictSubtypeOf(subClsBTy));
EXPECT_TRUE(objExactBAATy.strictSubtypeOf(opt(subObjBTy)));
EXPECT_TRUE(clsExactBAATy.strictSubtypeOf(objcls(subObjBATy)));
EXPECT_TRUE(objExactBAATy.strictSubtypeOf(opt(subObjBATy)));
EXPECT_TRUE(clsExactBAATy.strictSubtypeOf(objcls(subObjBAATy)));
EXPECT_TRUE(objExactBAATy.strictSubtypeOf(opt(subObjBAATy)));
EXPECT_TRUE(objcls(objExactATy).couldBe(subClsATy));
EXPECT_TRUE(objcls(objExactBAATy).couldBe(subClsBaseTy));
EXPECT_TRUE(objExactBAATy.couldBe(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(objExactBAATy).couldBe(subClsBTy));
EXPECT_TRUE(objExactBAATy.couldBe(opt(subObjBTy)));
EXPECT_TRUE(clsExactBAATy.couldBe(objcls(subObjBATy)));
EXPECT_TRUE(objExactBAATy.couldBe(opt(subObjBATy)));
EXPECT_TRUE(clsExactBAATy.couldBe(objcls(subObjBAATy)));
EXPECT_TRUE(objExactBAATy.couldBe(opt(subObjBAATy)));
// a T<= is a subtype of itself but not a strict subtype
// also a T<= is in a "could be" relationship with itself
EXPECT_TRUE(objcls(subObjBaseTy).subtypeOf(subClsBaseTy));
EXPECT_FALSE(objcls(subObjBaseTy).strictSubtypeOf(objcls(subObjBaseTy)));
EXPECT_TRUE(objcls(subObjBAATy).subtypeOf(subClsBAATy));
EXPECT_FALSE(subClsBAATy.strictSubtypeOf(objcls(subObjBAATy)));
EXPECT_TRUE(subClsBAATy.couldBe(subClsBAATy));
// a T<= type is in no subtype relationship with T=.
// However a T<= is in a "could be" relationship with T=.
EXPECT_FALSE(objcls(subObjATy).subtypeOf(clsExactATy));
EXPECT_FALSE(objcls(subObjATy).strictSubtypeOf(clsExactATy));
EXPECT_TRUE(clsExactATy.couldBe(objcls(subObjATy)));
// Given 2 types A and B in no inheritance relationship then
// A<= and B<= are in no subtype or "could be" relationship.
// Same if one of the 2 types is an optional type
EXPECT_FALSE(objcls(subObjATy).subtypeOf(clsExactBTy));
EXPECT_FALSE(objcls(subObjATy).strictSubtypeOf(clsExactBTy));
EXPECT_FALSE(subObjATy.subtypeOf(opt(objExactBTy)));
EXPECT_FALSE(subObjATy.strictSubtypeOf(opt(objExactBTy)));
EXPECT_FALSE(clsExactATy.couldBe(objcls(subObjBTy)));
EXPECT_FALSE(objExactATy.couldBe(opt(subObjBTy)));
EXPECT_FALSE(objcls(subObjBTy).subtypeOf(clsExactATy));
EXPECT_FALSE(subObjBTy.subtypeOf(opt(objExactATy)));
EXPECT_FALSE(objcls(subObjBTy).strictSubtypeOf(clsExactATy));
EXPECT_FALSE(subObjBTy.strictSubtypeOf(opt(objExactATy)));
EXPECT_FALSE(clsExactBTy.couldBe(objcls(subObjATy)));
EXPECT_FALSE(objExactBTy.couldBe(opt(subObjATy)));
// Given the hierarchy A <- B <- C where A is the base then:
// C<= is a subtype and a strict subtype of B<=, ?B<=, A<= and ?A<=.
// It is also in a "could be" relationship with all its ancestors
// (including optional)
EXPECT_TRUE(objcls(subObjBAATy).subtypeOf(subClsBaseTy));
EXPECT_TRUE(subObjBAATy.subtypeOf(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(subObjBAATy).subtypeOf(subClsBTy));
EXPECT_TRUE(subObjBAATy.subtypeOf(opt(subObjBTy)));
EXPECT_TRUE(subClsBAATy.subtypeOf(objcls(subObjBATy)));
EXPECT_TRUE(subObjBAATy.subtypeOf(opt(subObjBATy)));
EXPECT_TRUE(objcls(subObjBAATy).strictSubtypeOf(subClsBaseTy));
EXPECT_TRUE(subObjBAATy.strictSubtypeOf(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(subObjBAATy).strictSubtypeOf(subClsBTy));
EXPECT_TRUE(subObjBAATy.strictSubtypeOf(opt(subObjBTy)));
EXPECT_TRUE(subClsBAATy.strictSubtypeOf(objcls(subObjBATy)));
EXPECT_TRUE(subObjBAATy.strictSubtypeOf(opt(subObjBATy)));
EXPECT_TRUE(objcls(subObjBAATy).couldBe(subClsBaseTy));
EXPECT_TRUE(subObjBAATy.couldBe(opt(subObjBaseTy)));
EXPECT_TRUE(objcls(subObjBAATy).couldBe(subClsBTy));
EXPECT_TRUE(subObjBAATy.couldBe(opt(subObjBTy)));
EXPECT_TRUE(subClsBAATy.couldBe(objcls(subObjBATy)));
EXPECT_TRUE(subObjBAATy.couldBe(opt(subObjBATy)));
// Given the hierarchy A <- B <- C where A is the base then:
// A<= is not in a subtype neither a strict subtype with B<=, ?B<=, A<=
// ?A<=. However A<= is in a "could be" relationship with all its
// children (including optional)
EXPECT_FALSE(objcls(subObjBaseTy).subtypeOf(subClsATy));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjATy)));
EXPECT_FALSE(objcls(subObjBaseTy).subtypeOf(subClsBTy));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjBTy)));
EXPECT_FALSE(subClsBaseTy.subtypeOf(objcls(subObjAATy)));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjAATy)));
EXPECT_FALSE(subClsBaseTy.subtypeOf(objcls(subObjABTy)));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjABTy)));
EXPECT_FALSE(objcls(subObjBaseTy).subtypeOf(subClsBATy));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjBATy)));
EXPECT_FALSE(subClsBaseTy.subtypeOf(objcls(subObjBBTy)));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjBBTy)));
EXPECT_FALSE(subClsBaseTy.subtypeOf(objcls(subObjBAATy)));
EXPECT_FALSE(subObjBaseTy.subtypeOf(opt(subObjBAATy)));
EXPECT_FALSE(objcls(subObjBaseTy).strictSubtypeOf(subClsATy));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjATy)));
EXPECT_FALSE(objcls(subObjBaseTy).strictSubtypeOf(subClsBTy));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjBTy)));
EXPECT_FALSE(subClsBaseTy.strictSubtypeOf(objcls(subObjAATy)));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjAATy)));
EXPECT_FALSE(subClsBaseTy.strictSubtypeOf(objcls(subObjABTy)));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjABTy)));
EXPECT_FALSE(objcls(subObjBaseTy).strictSubtypeOf(subClsBATy));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjBATy)));
EXPECT_FALSE(subClsBaseTy.strictSubtypeOf(objcls(subObjBBTy)));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjBBTy)));
EXPECT_FALSE(subClsBaseTy.strictSubtypeOf(objcls(subObjBAATy)));
EXPECT_FALSE(subObjBaseTy.strictSubtypeOf(opt(subObjBAATy)));
EXPECT_TRUE(objcls(subObjBaseTy).couldBe(subClsATy));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjATy)));
EXPECT_TRUE(objcls(subObjBaseTy).couldBe(subClsBTy));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjBTy)));
EXPECT_TRUE(subClsBaseTy.couldBe(objcls(subObjAATy)));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjAATy)));
EXPECT_TRUE(subClsBaseTy.couldBe(objcls(subObjABTy)));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjABTy)));
EXPECT_TRUE(objcls(subObjBaseTy).couldBe(subClsBATy));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjBATy)));
EXPECT_TRUE(subClsBaseTy.couldBe(objcls(subObjBBTy)));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjBBTy)));
EXPECT_TRUE(subClsBaseTy.couldBe(objcls(subObjBAATy)));
EXPECT_TRUE(subObjBaseTy.couldBe(opt(subObjBAATy)));
// check union_of and commonAncestor API
EXPECT_TRUE((*(*clsA).commonAncestor(*clsB)).same(*clsBase));
EXPECT_TRUE((*(*clsB).commonAncestor(*clsA)).same(*clsBase));
EXPECT_TRUE((*(*clsAA).commonAncestor(*clsAB)).same(*clsA));
EXPECT_TRUE((*(*clsAB).commonAncestor(*clsAA)).same(*clsA));
EXPECT_TRUE((*(*clsA).commonAncestor(*clsBAA)).same(*clsBase));
EXPECT_TRUE((*(*clsBAA).commonAncestor(*clsA)).same(*clsBase));
EXPECT_TRUE((*(*clsBAA).commonAncestor(*clsB)).same(*clsB));
EXPECT_TRUE((*(*clsB).commonAncestor(*clsBAA)).same(*clsB));
EXPECT_TRUE((*(*clsBAA).commonAncestor(*clsBB)).same(*clsB));
EXPECT_TRUE((*(*clsBB).commonAncestor(*clsBAA)).same(*clsB));
EXPECT_TRUE((*(*clsAA).commonAncestor(*clsBase)).same(*clsBase));
EXPECT_TRUE((*(*clsBase).commonAncestor(*clsAA)).same(*clsBase));
EXPECT_FALSE((*clsAA).commonAncestor(*clsTestClass));
EXPECT_FALSE((*clsTestClass).commonAncestor(*clsAA));
EXPECT_FALSE((*clsBAA).commonAncestor(*clsNonUnique));
EXPECT_FALSE((*clsNonUnique).commonAncestor(*clsBAA));
// check union_of
// union of subCls
EXPECT_EQ(union_of(subClsATy, subClsBTy), subClsBaseTy);
EXPECT_EQ(union_of(subClsAATy, subClsABTy), subClsATy);
EXPECT_EQ(union_of(subClsATy, subClsBAATy), subClsBaseTy);
EXPECT_EQ(union_of(subClsBAATy, subClsBTy), subClsBTy);
EXPECT_EQ(union_of(subClsBAATy, subClsBBTy), subClsBTy);
EXPECT_EQ(union_of(subClsAATy, subClsBaseTy), subClsBaseTy);
EXPECT_EQ(union_of(subClsAATy, subClsTestClassTy), TCls);
EXPECT_EQ(union_of(subClsBAATy, subClsNonUniqueTy), TCls);
// union of subCls and clsExact mixed
EXPECT_EQ(union_of(clsExactATy, subClsBTy), subClsBaseTy);
EXPECT_EQ(union_of(subClsAATy, clsExactABTy), subClsATy);
EXPECT_EQ(union_of(clsExactATy, subClsBAATy), subClsBaseTy);
EXPECT_EQ(union_of(subClsBAATy, clsExactBTy), subClsBTy);
EXPECT_EQ(union_of(clsExactBAATy, subClsBBTy), subClsBTy);
EXPECT_EQ(union_of(subClsAATy, clsExactBaseTy), subClsBaseTy);
EXPECT_EQ(union_of(clsExactAATy, subClsTestClassTy), TCls);
EXPECT_EQ(union_of(subClsBAATy, clsExactNonUniqueTy), TCls);
// union of clsExact
EXPECT_EQ(union_of(clsExactATy, clsExactBTy), subClsBaseTy);
EXPECT_EQ(union_of(clsExactAATy, clsExactABTy), subClsATy);
EXPECT_EQ(union_of(clsExactATy, clsExactBAATy), subClsBaseTy);
EXPECT_EQ(union_of(clsExactBAATy, clsExactBTy), subClsBTy);
EXPECT_EQ(union_of(clsExactBAATy, clsExactBBTy), subClsBTy);
EXPECT_EQ(union_of(clsExactAATy, clsExactBaseTy), subClsBaseTy);
EXPECT_EQ(union_of(clsExactAATy, subClsTestClassTy), TCls);
EXPECT_EQ(union_of(clsExactBAATy, clsExactNonUniqueTy), TCls);
// union of subObj
EXPECT_EQ(union_of(subObjATy, subObjBTy), subObjBaseTy);
EXPECT_EQ(union_of(subObjAATy, subObjABTy), subObjATy);
EXPECT_EQ(union_of(subObjATy, subObjBAATy), subObjBaseTy);
EXPECT_EQ(union_of(subObjBAATy, subObjBTy), subObjBTy);
EXPECT_EQ(union_of(subObjBAATy, subObjBBTy), subObjBTy);
EXPECT_EQ(union_of(subObjAATy, subObjBaseTy), subObjBaseTy);
EXPECT_EQ(union_of(subObjAATy, subObjTestClassTy), TObj);
EXPECT_EQ(union_of(subObjBAATy, subObjNonUniqueTy), TObj);
// union of subObj and objExact mixed
EXPECT_EQ(union_of(objExactATy, subObjBTy), subObjBaseTy);
EXPECT_EQ(union_of(subObjAATy, objExactABTy), subObjATy);
EXPECT_EQ(union_of(objExactATy, subObjBAATy), subObjBaseTy);
EXPECT_EQ(union_of(subObjBAATy, objExactBTy), subObjBTy);
EXPECT_EQ(union_of(objExactBAATy, subObjBBTy), subObjBTy);
EXPECT_EQ(union_of(subObjAATy, objExactBaseTy), subObjBaseTy);
EXPECT_EQ(union_of(objExactAATy, subObjTestClassTy), TObj);
EXPECT_EQ(union_of(subObjBAATy, objExactNonUniqueTy), TObj);
// union of objExact
EXPECT_EQ(union_of(objExactATy, objExactBTy), subObjBaseTy);
EXPECT_EQ(union_of(objExactAATy, objExactABTy), subObjATy);
EXPECT_EQ(union_of(objExactATy, objExactBAATy), subObjBaseTy);
EXPECT_EQ(union_of(objExactBAATy, objExactBTy), subObjBTy);
EXPECT_EQ(union_of(objExactBAATy, objExactBBTy), subObjBTy);
EXPECT_EQ(union_of(objExactAATy, objExactBaseTy), subObjBaseTy);
EXPECT_EQ(union_of(objExactAATy, objExactTestClassTy), TObj);
EXPECT_EQ(union_of(objExactBAATy, objExactNonUniqueTy), TObj);
// optional sub obj
EXPECT_EQ(union_of(opt(subObjATy), opt(subObjBTy)), opt(subObjBaseTy));
EXPECT_EQ(union_of(subObjAATy, opt(subObjABTy)), opt(subObjATy));
EXPECT_EQ(union_of(opt(subObjATy), subObjBAATy), opt(subObjBaseTy));
EXPECT_EQ(union_of(opt(subObjBAATy), opt(subObjBTy)), opt(subObjBTy));
EXPECT_EQ(union_of(opt(subObjBAATy), subObjBBTy), opt(subObjBTy));
EXPECT_EQ(union_of(opt(subObjAATy), opt(subObjBaseTy)), opt(subObjBaseTy));
EXPECT_EQ(union_of(subObjAATy, opt(subObjTestClassTy)), opt(TObj));
EXPECT_EQ(union_of(subObjBAATy, opt(subObjNonUniqueTy)), opt(TObj));
// optional sub and exact obj mixed
EXPECT_EQ(union_of(opt(objExactATy), subObjBTy), opt(subObjBaseTy));
EXPECT_EQ(union_of(subObjAATy, opt(objExactABTy)), opt(subObjATy));
EXPECT_EQ(union_of(opt(objExactATy), objExactBAATy), opt(subObjBaseTy));
EXPECT_EQ(union_of(subObjBAATy, opt(objExactBTy)), opt(subObjBTy));
EXPECT_EQ(union_of(opt(subObjBAATy), objExactBBTy), opt(subObjBTy));
EXPECT_EQ(union_of(objExactAATy, opt(objExactBaseTy)), opt(subObjBaseTy));
EXPECT_EQ(union_of(opt(subObjAATy), objExactTestClassTy), opt(TObj));
EXPECT_EQ(union_of(subObjBAATy, opt(objExactNonUniqueTy)), opt(TObj));
}
TEST(Type, Interface) {
auto const program = make_program();
auto const unit = borrow(program->units.back());
auto const func = [&]() -> borrowed_ptr<php::Func> {
for (auto& f : unit->funcs) {
if (f->name->isame(s_test.get())) return borrow(f);
}
return nullptr;
}();
EXPECT_TRUE(func != nullptr);
auto const ctx = Context { unit, func };
Index idx{borrow(program)};
// load classes in hierarchy
auto const clsIA = idx.resolve_class(ctx, s_IA.get());
if (!clsIA) EXPECT_TRUE(false);
auto const clsIAA = idx.resolve_class(ctx, s_IAA.get());
if (!clsIAA) EXPECT_TRUE(false);
auto const clsA = idx.resolve_class(ctx, s_A.get());
if (!clsA) EXPECT_TRUE(false);
auto const clsAA = idx.resolve_class(ctx, s_AA.get());
if (!clsAA) EXPECT_TRUE(false);
// make sometypes and objects
auto const subObjIATy = subObj(*clsIA);
auto const subClsIATy = subCls(*clsIA);
auto const subObjIAATy = subObj(*clsIAA);
auto const subClsIAATy = subCls(*clsIAA);
auto const subObjATy = subObj(*clsA);
auto const clsExactATy = clsExact(*clsA);
auto const subClsATy = subCls(*clsA);
auto const subObjAATy = subObj(*clsAA);
auto const subClsAATy = subCls(*clsAA);
// we don't support interfaces quite yet so let's put few tests
// that will fail once interfaces are supported
// first 2 are "not precise" - should be true
EXPECT_FALSE(subClsATy.subtypeOf(objcls(subObjIATy)));
EXPECT_FALSE(objcls(subObjATy).strictSubtypeOf(subClsIATy));
EXPECT_TRUE(subClsATy.couldBe(objcls(subObjIATy)));
// first 2 are "not precise" - should be true
EXPECT_FALSE(subClsAATy.subtypeOf(objcls(subObjIAATy)));
EXPECT_FALSE(objcls(subObjAATy).strictSubtypeOf(objcls(subObjIAATy)));
EXPECT_TRUE(subClsAATy.couldBe(objcls(subObjIAATy)));
// 3rd one is not precise - should be false
EXPECT_FALSE(subClsATy.subtypeOf(objcls(subObjIAATy)));
EXPECT_FALSE(objcls(subObjATy).strictSubtypeOf(objcls(subObjIAATy)));
EXPECT_TRUE(clsExactATy.couldBe(objcls(subObjIAATy)));
}
TEST(Type, NonUnique) {
auto const program = make_program();
auto const unit = borrow(program->units.back());
auto const func = [&]() -> borrowed_ptr<php::Func> {
for (auto& f : unit->funcs) {
if (f->name->isame(s_test.get())) return borrow(f);
}
return nullptr;
}();
EXPECT_TRUE(func != nullptr);
auto const ctx = Context { unit, func };
Index idx{borrow(program)};
auto const clsA = idx.resolve_class(ctx, s_A.get());
if (!clsA) EXPECT_TRUE(false);
auto const clssNonUnique = idx.resolve_class(ctx, s_NonUnique.get());
if (!clssNonUnique) EXPECT_TRUE(false);
auto const clssNonUniqueA = idx.resolve_class(ctx, s_NonUniqueA.get());
if (!clssNonUniqueA) EXPECT_TRUE(false);
// non unique types are funny because we cannot really make any conclusion
// about them so they resolve to "non precise" subtype relationship
auto const subObjATy = subObj(*clsA);
auto const subClsATy = subCls(*clsA);
auto const subObjNonUniqueTy = subObj(*clssNonUnique);
auto const subClsNonUniqueTy = subCls(*clssNonUnique);
auto const subObjNonUniqueATy = subObj(*clssNonUniqueA);
auto const subClsNonUniqueATy = subCls(*clssNonUniqueA);
// all are obviously "non precise" but what can you do?....
EXPECT_FALSE(subClsNonUniqueATy.subtypeOf(objcls(subObjNonUniqueTy)));
EXPECT_FALSE(objcls(subObjNonUniqueATy).strictSubtypeOf(subClsNonUniqueTy));
EXPECT_TRUE(subClsATy.couldBe(objcls(subObjNonUniqueTy)));
}
TEST(Type, WaitH) {
auto const program = make_program();
Index index { borrow(program) };
for (auto& t : wait_handles_of(index, all())) {
EXPECT_TRUE(is_specialized_wait_handle(t));
EXPECT_TRUE(t.subtypeOf(wait_handle(index, TTop)));
}
// union_of(WaitH<A>, WaitH<B>) == WaitH<union_of(A, B)>
for (auto& t1 : all()) {
for (auto& t2 : all()) {
auto const u1 = union_of(t1, t2);
auto const u2 = union_of(wait_handle(index, t1), wait_handle(index, t2));
EXPECT_TRUE(is_specialized_wait_handle(u2));
EXPECT_EQ(wait_handle_inner(u2), u1);
EXPECT_EQ(wait_handle(index, u1), u2);
}
}
// union_of(?WaitH<A>, ?WaitH<B>) == ?WaitH<union_of(A, B)>
for (auto& t1 : all()) {
for (auto& t2 : all()) {
auto const w1 = opt(wait_handle(index, t1));
auto const w2 = opt(wait_handle(index, t2));
auto const u1 = union_of(w1, w2);
auto const u2 = opt(wait_handle(index, union_of(t1, t2)));
EXPECT_EQ(u1, u2);
}
}
auto const rcls = index.builtin_class(s_WaitHandle.get());
auto const twhobj = subObj(rcls);
EXPECT_TRUE(wait_handle(index, TTop).subtypeOf(twhobj));
// Some test cases with optional wait handles.
auto const optWH = opt(wait_handle(index, ival(2)));
EXPECT_TRUE(is_opt(optWH));
EXPECT_TRUE(TInitNull.subtypeOf(optWH));
EXPECT_TRUE(optWH.subtypeOf(TOptObj));
EXPECT_TRUE(optWH.subtypeOf(opt(twhobj)));
EXPECT_TRUE(wait_handle(index, ival(2)).subtypeOf(optWH));
EXPECT_FALSE(optWH.subtypeOf(wait_handle(index, ival(2))));
EXPECT_TRUE(optWH.couldBe(wait_handle(index, ival(2))));
// union_of(WaitH<T>, Obj<=WaitHandle) == Obj<=WaitHandle
for (auto& t : all()) {
auto const u = union_of(wait_handle(index, t), twhobj);
EXPECT_EQ(u, twhobj);
}
for (auto& t : all()) {
auto const u1 = union_of(wait_handle(index, t), TInitNull);
EXPECT_TRUE(is_opt(u1));
EXPECT_TRUE(is_specialized_wait_handle(u1));
auto const u2 = union_of(TInitNull, wait_handle(index, t));
EXPECT_TRUE(is_opt(u2));
EXPECT_TRUE(is_specialized_wait_handle(u2));
EXPECT_EQ(u1, u2);
}
// You can have WaitH<WaitH<T>>. And stuff.
for (auto& w : wait_handles_of(index, all())) {
auto const ww = wait_handle(index, w);
auto const www = wait_handle(index, ww);
EXPECT_EQ(wait_handle_inner(www), ww);
EXPECT_EQ(wait_handle_inner(ww), w);
// Skip the following in cases like WaitH<WaitH<Obj>>, which
// actually *is* a subtype of WaitH<Obj>, since a WaitH<Obj> is
// also an Obj. Similar for Top, or InitCell, etc.
auto const inner = wait_handle_inner(w);
if (twhobj.subtypeOf(inner)) continue;
EXPECT_FALSE(w.subtypeOf(ww));
EXPECT_FALSE(ww.subtypeOf(w));
EXPECT_FALSE(w.couldBe(ww));
EXPECT_TRUE(ww.subtypeOf(twhobj));
EXPECT_TRUE(www.subtypeOf(twhobj));
EXPECT_FALSE(ww.subtypeOf(www));
EXPECT_FALSE(www.subtypeOf(ww));
EXPECT_FALSE(ww.couldBe(www));
}
}
TEST(Type, FromHNIConstraint) {
EXPECT_EQ(from_hni_constraint(makeStaticString("?HH\\resource")), TOptRes);
EXPECT_EQ(from_hni_constraint(makeStaticString("HH\\resource")), TRes);
EXPECT_EQ(from_hni_constraint(makeStaticString("HH\\bool")), TBool);
EXPECT_EQ(from_hni_constraint(makeStaticString("?HH\\bool")), TOptBool);
EXPECT_EQ(from_hni_constraint(makeStaticString("HH\\int")), TInt);
EXPECT_EQ(from_hni_constraint(makeStaticString("HH\\float")), TDbl);
EXPECT_EQ(from_hni_constraint(makeStaticString("?HH\\float")), TOptDbl);
EXPECT_EQ(from_hni_constraint(makeStaticString("HH\\mixed")), TInitGen);
// These are conservative, but we're testing them that way. If we
// make the function better later we'll remove the tests.
EXPECT_EQ(from_hni_constraint(makeStaticString("stdClass")), TGen);
EXPECT_EQ(from_hni_constraint(makeStaticString("?stdClass")), TGen);
EXPECT_EQ(from_hni_constraint(makeStaticString("fooooo")), TGen);
EXPECT_EQ(from_hni_constraint(makeStaticString("")), TGen);
}
TEST(Type, ArrPacked1) {
auto const a1 = arr_packed({ival(2), TSStr, TInt});
auto const a2 = arr_packed({TInt, TStr, TInitCell});
auto const s1 = sarr_packed({ival(2), TSStr, TInt});
auto const s2 = sarr_packed({TInt, TStr, TInitCell});
auto const c1 = carr_packed({ival(2), TSStr, TInt});
auto const c2 = carr_packed({TInt, TStr, TInitCell});
for (auto& a : { a1, s1, c1, a2, s2, c2 }) {
EXPECT_TRUE(a.subtypeOf(TArr));
EXPECT_TRUE(a.subtypeOf(a));
EXPECT_EQ(a, a);
}
// Subtype stuff.
EXPECT_TRUE(a1.subtypeOf(TArr));
EXPECT_FALSE(a1.subtypeOf(TSArr));
EXPECT_FALSE(a1.subtypeOf(TCArr));
EXPECT_TRUE(s1.subtypeOf(TArr));
EXPECT_TRUE(s1.subtypeOf(TSArr));
EXPECT_FALSE(s1.subtypeOf(TCArr));
EXPECT_TRUE(c1.subtypeOf(TArr));
EXPECT_TRUE(c1.subtypeOf(TCArr));
EXPECT_FALSE(c1.subtypeOf(TSArr));
EXPECT_TRUE(a1.subtypeOf(a2));
EXPECT_TRUE(s1.subtypeOf(s2));
EXPECT_TRUE(c1.subtypeOf(c2));
EXPECT_TRUE(s1.subtypeOf(a1));
EXPECT_TRUE(c1.subtypeOf(a1));
EXPECT_FALSE(a1.subtypeOf(c1));
EXPECT_FALSE(s1.subtypeOf(c1));
EXPECT_FALSE(c1.subtypeOf(s1));
EXPECT_FALSE(a1.subtypeOf(c1));
// Could be stuff.
EXPECT_TRUE(c1.couldBe(a1));
EXPECT_TRUE(c2.couldBe(a2));
EXPECT_TRUE(s1.couldBe(a1));
EXPECT_TRUE(s2.couldBe(a2));
EXPECT_TRUE(a1.couldBe(a2));
EXPECT_TRUE(a2.couldBe(a1));
EXPECT_TRUE(s1.couldBe(a2));
EXPECT_TRUE(s2.couldBe(a1));
EXPECT_TRUE(c1.couldBe(a2));
EXPECT_TRUE(c2.couldBe(a1));
EXPECT_TRUE(s1.couldBe(s2));
EXPECT_TRUE(s2.couldBe(s1));
EXPECT_TRUE(c1.couldBe(c2));
EXPECT_TRUE(c2.couldBe(c1));
EXPECT_FALSE(c1.couldBe(s1));
EXPECT_FALSE(c2.couldBe(s1));
EXPECT_FALSE(c1.couldBe(s2));
EXPECT_FALSE(c2.couldBe(s2));
EXPECT_FALSE(s1.couldBe(c1));
EXPECT_FALSE(s2.couldBe(c1));
EXPECT_FALSE(s1.couldBe(c2));
EXPECT_FALSE(s2.couldBe(c2));
}
TEST(Type, OptArrPacked1) {
auto const a1 = opt(arr_packed({ival(2), TSStr, TInt}));
auto const a2 = opt(arr_packed({TInt, TStr, TInitCell}));
auto const s1 = opt(sarr_packed({ival(2), TSStr, TInt}));
auto const s2 = opt(sarr_packed({TInt, TStr, TInitCell}));
auto const c1 = opt(carr_packed({ival(2), TSStr, TInt}));
auto const c2 = opt(carr_packed({TInt, TStr, TInitCell}));
for (auto& a : { a1, s1, c1, a2, s2, c2 }) {
EXPECT_TRUE(a.subtypeOf(TOptArr));
EXPECT_TRUE(a.subtypeOf(a));
EXPECT_EQ(a, a);
}
// Subtype stuff.
EXPECT_TRUE(a1.subtypeOf(TOptArr));
EXPECT_FALSE(a1.subtypeOf(TOptSArr));
EXPECT_FALSE(a1.subtypeOf(TOptCArr));
EXPECT_TRUE(s1.subtypeOf(TOptArr));
EXPECT_TRUE(s1.subtypeOf(TOptSArr));
EXPECT_FALSE(s1.subtypeOf(TOptCArr));
EXPECT_TRUE(c1.subtypeOf(TOptArr));
EXPECT_TRUE(c1.subtypeOf(TOptCArr));
EXPECT_FALSE(c1.subtypeOf(TOptSArr));
EXPECT_TRUE(a1.subtypeOf(a2));
EXPECT_TRUE(s1.subtypeOf(s2));
EXPECT_TRUE(c1.subtypeOf(c2));
EXPECT_TRUE(s1.subtypeOf(a1));
EXPECT_TRUE(c1.subtypeOf(a1));
EXPECT_FALSE(a1.subtypeOf(c1));
EXPECT_FALSE(s1.subtypeOf(c1));
EXPECT_FALSE(c1.subtypeOf(s1));
EXPECT_FALSE(a1.subtypeOf(c1));
// Could be stuff.
EXPECT_TRUE(c1.couldBe(a1));
EXPECT_TRUE(c2.couldBe(a2));
EXPECT_TRUE(s1.couldBe(a1));
EXPECT_TRUE(s2.couldBe(a2));
EXPECT_TRUE(a1.couldBe(a2));
EXPECT_TRUE(a2.couldBe(a1));
EXPECT_TRUE(s1.couldBe(a2));
EXPECT_TRUE(s2.couldBe(a1));
EXPECT_TRUE(c1.couldBe(a2));
EXPECT_TRUE(c2.couldBe(a1));
EXPECT_TRUE(s1.couldBe(s2));
EXPECT_TRUE(s2.couldBe(s1));
EXPECT_TRUE(c1.couldBe(c2));
EXPECT_TRUE(c2.couldBe(c1));
EXPECT_TRUE(c1.couldBe(s1));
EXPECT_TRUE(c2.couldBe(s1));
EXPECT_TRUE(c1.couldBe(s2));
EXPECT_TRUE(c2.couldBe(s2));
EXPECT_TRUE(s1.couldBe(c1));
EXPECT_TRUE(s2.couldBe(c1));
EXPECT_TRUE(s1.couldBe(c2));
EXPECT_TRUE(s2.couldBe(c2));
}
TEST(Type, ArrPacked2) {
{
auto const a1 = arr_packed({TInt, TInt, TDbl});
auto const a2 = arr_packed({TInt, TInt});
EXPECT_FALSE(a1.subtypeOf(a2));
EXPECT_FALSE(a1.couldBe(a2));
}
{
auto const a1 = arr_packed({TInitCell, TInt});
auto const a2 = arr_packed({TInt, TInt});
EXPECT_TRUE(a1.couldBe(a2));
EXPECT_TRUE(a2.subtypeOf(a1));
}
{
auto const a1 = arr_packed({TInt, TInt, TInt});
auto const s1 = sarr_packed({TInt, TInt, TInt});
auto const c1 = carr_packed({TInt, TInt, TInt});
auto const s2 = aval(test_array_packed_value());
EXPECT_TRUE(s2.subtypeOf(a1));
EXPECT_TRUE(s2.subtypeOf(s1));
EXPECT_FALSE(s2.subtypeOf(c1));
EXPECT_TRUE(s2.couldBe(a1));
EXPECT_TRUE(s2.couldBe(s1));
EXPECT_FALSE(s2.couldBe(c1));
}
{
auto const s1 = sarr_packed({ival(42), ival(23), ival(12)});
auto const s2 = aval(test_array_packed_value());
auto const s3 = sarr_packed({TInt});
auto const a4 = sarr_packed({TInt});
auto const a5 = arr_packed({ival(42), ival(23), ival(12)});
auto const c6 = carr_packed({ival(42), ival(23), ival(12)});
EXPECT_TRUE(s1.subtypeOf(s2));
EXPECT_EQ(s1, s2);
EXPECT_FALSE(s2.subtypeOf(s3));
EXPECT_FALSE(s2.couldBe(s3));
EXPECT_FALSE(s2.subtypeOf(s3));
EXPECT_FALSE(s2.couldBe(s3));
EXPECT_TRUE(s2.couldBe(s1));
EXPECT_TRUE(s2.couldBe(a5));
EXPECT_TRUE(s2.subtypeOf(a5));
EXPECT_FALSE(a5.subtypeOf(s2));
EXPECT_FALSE(s2.subtypeOf(c6));
EXPECT_FALSE(c6.subtypeOf(s2));
}
}
TEST(Type, ArrPackedUnion) {
{
auto const a1 = arr_packed({TInt, TDbl});
auto const a2 = arr_packed({TDbl, TInt});
EXPECT_EQ(union_of(a1, a2), arr_packed({TNum, TNum}));
}
{
auto const s1 = sarr_packed({TInt, TDbl});
auto const s2 = sarr_packed({TDbl, TInt});
auto const c2 = carr_packed({TDbl, TInt});
EXPECT_EQ(union_of(s1, c2), arr_packed({TNum, TNum}));
EXPECT_EQ(union_of(s1, s1), s1);
EXPECT_EQ(union_of(s1, s2), sarr_packed({TNum, TNum}));
}
{
auto const s1 = sarr_packed({TInt});
auto const s2 = sarr_packed({TDbl, TDbl});
EXPECT_EQ(union_of(s1, s2), sarr_packedn(TNum));
}
{
auto const s1 = aval(test_array_packed_value());
auto const s2 = sarr_packed({TInt, TInt, TInt});
auto const s3 = sarr_packed({TInt, TNum, TInt});
auto const s4 = carr_packed({TInt, TObj, TInt});
EXPECT_EQ(union_of(s1, s2), s2);
EXPECT_EQ(union_of(s1, s3), s3);
EXPECT_EQ(union_of(s1, s4), arr_packed({TInt, TInitCell, TInt}));
}
{
auto const s1 = sarr_packed({TInt});
auto const os1 = opt(s1);
EXPECT_EQ(union_of(s1, TInitNull), os1);
EXPECT_EQ(union_of(os1, s1), os1);
EXPECT_EQ(union_of(TInitNull, s1), os1);
EXPECT_EQ(union_of(os1, os1), os1);
}
{
auto const s1 = sarr_packed({TInt});
EXPECT_EQ(union_of(s1, TObj), TInitCell);
EXPECT_EQ(union_of(s1, TCArr), TArr);
}
{
auto const s1 = aval(test_array_packed_value());
auto const s2 = aval(test_array_packed_value2());
EXPECT_EQ(union_of(s1, s2), sarr_packed({ival(42), TNum, ival(12)}));
}
}
TEST(Type, ArrPackedN) {
auto const s1 = aval(test_array_packed_value());
auto const s2 = sarr_packed({TInt, TInt});
EXPECT_EQ(union_of(s1, s2), sarr_packedn(TInt));
EXPECT_TRUE(s2.subtypeOf(sarr_packedn(TInt)));
EXPECT_FALSE(s2.subtypeOf(sarr_packedn(TDbl)));
EXPECT_TRUE(s2.subtypeOf(sarr_packedn(TNum)));
EXPECT_TRUE(s2.subtypeOf(arr_packedn(TInt)));
EXPECT_TRUE(s2.subtypeOf(opt(arr_packedn(TInt))));
EXPECT_TRUE(s2.couldBe(arr_packedn(TInt)));
EXPECT_TRUE(s2.couldBe(arr_packedn(TInitGen)));
auto const sn1 = sarr_packedn(TInt);
auto const sn2 = sarr_packedn(TInitNull);
EXPECT_EQ(union_of(sn1, sn2), sarr_packedn(TOptInt));
EXPECT_EQ(union_of(sn1, TInitNull), opt(sn1));
EXPECT_EQ(union_of(TInitNull, sn1), opt(sn1));
EXPECT_FALSE(sn2.couldBe(sn1));
EXPECT_FALSE(sn1.couldBe(sn2));
auto const sn3 = sarr_packedn(TInitCell);
EXPECT_TRUE(sn1.couldBe(sn3));
EXPECT_TRUE(sn2.couldBe(sn3));
EXPECT_TRUE(sn3.couldBe(sn1));
EXPECT_TRUE(sn3.couldBe(sn2));
EXPECT_TRUE(s2.couldBe(sn3));
EXPECT_TRUE(s2.couldBe(sn1));
EXPECT_FALSE(s2.couldBe(sn2));
EXPECT_EQ(union_of(carr_packedn(TInt), sarr_packedn(TInt)),
arr_packedn(TInt));
}
TEST(Type, ArrStruct) {
auto test_map_a = StructMap{};
test_map_a[s_test.get()] = ival(2);
auto test_map_b = StructMap{};
test_map_b[s_test.get()] = TInt;
auto test_map_c = StructMap{};
test_map_c[s_test.get()] = ival(2);
test_map_c[s_A.get()] = TInt;
test_map_c[s_B.get()] = TDbl;
auto const ta = arr_struct(test_map_a);
auto const tb = arr_struct(test_map_b);
auto const tc = arr_struct(test_map_c);
EXPECT_FALSE(ta.subtypeOf(tc));
EXPECT_FALSE(tc.subtypeOf(ta));
EXPECT_TRUE(ta.subtypeOf(tb));
EXPECT_FALSE(tb.subtypeOf(ta));
EXPECT_TRUE(ta.couldBe(tb));
EXPECT_TRUE(tb.couldBe(ta));
EXPECT_FALSE(tc.couldBe(ta));
EXPECT_FALSE(tc.couldBe(tb));
EXPECT_TRUE(ta.subtypeOf(TArr));
EXPECT_TRUE(tb.subtypeOf(TArr));
EXPECT_TRUE(tc.subtypeOf(TArr));
auto const sa = sarr_struct(test_map_a);
auto const sb = sarr_struct(test_map_b);
auto const sc = sarr_struct(test_map_c);
EXPECT_FALSE(sa.subtypeOf(sc));
EXPECT_FALSE(sc.subtypeOf(sa));
EXPECT_TRUE(sa.subtypeOf(sb));
EXPECT_FALSE(sb.subtypeOf(sa));
EXPECT_TRUE(sa.couldBe(sb));
EXPECT_TRUE(sb.couldBe(sa));
EXPECT_FALSE(sc.couldBe(sa));
EXPECT_FALSE(sc.couldBe(sb));
EXPECT_TRUE(sa.subtypeOf(TSArr));
EXPECT_TRUE(sb.subtypeOf(TSArr));
EXPECT_TRUE(sc.subtypeOf(TSArr));
auto test_map_d = StructMap{};
test_map_d[s_A.get()] = sval(s_B.get());
test_map_d[s_test.get()] = ival(12);
auto const sd = sarr_struct(test_map_d);
EXPECT_EQ(sd, aval(test_array_map_value()));
auto test_map_e = StructMap{};
test_map_e[s_A.get()] = TSStr;
test_map_e[s_test.get()] = TNum;
auto const se = sarr_struct(test_map_e);
EXPECT_TRUE(aval(test_array_map_value()).subtypeOf(se));
EXPECT_TRUE(se.couldBe(aval(test_array_map_value())));
}
TEST(Type, ArrMapN) {
auto const test_map = aval(test_array_map_value());
EXPECT_TRUE(test_map != arr_mapn(TSStr, TInitUnc));
EXPECT_TRUE(test_map.subtypeOf(arr_mapn(TSStr, TInitUnc)));
EXPECT_TRUE(test_map.subtypeOf(sarr_mapn(TSStr, TInitUnc)));
EXPECT_TRUE(!test_map.subtypeOf(carr_mapn(TSStr, TInitUnc)));
EXPECT_TRUE(sarr_packedn({TInt}).subtypeOf(arr_mapn(TInt, TInt)));
EXPECT_TRUE(sarr_packed({TInt}).subtypeOf(arr_mapn(TInt, TInt)));
auto test_map_a = StructMap{};
test_map_a[s_test.get()] = ival(2);
auto const tstruct = sarr_struct(test_map_a);
EXPECT_TRUE(tstruct.subtypeOf(arr_mapn(TSStr, ival(2))));
EXPECT_TRUE(tstruct.subtypeOf(arr_mapn(TSStr, TInt)));
EXPECT_TRUE(tstruct.subtypeOf(sarr_mapn(TSStr, TInt)));
EXPECT_TRUE(tstruct.subtypeOf(arr_mapn(TStr, TInt)));
EXPECT_TRUE(!tstruct.subtypeOf(carr_mapn(TStr, TInt)));
EXPECT_TRUE(test_map.couldBe(arr_mapn(TSStr, TInitCell)));
EXPECT_FALSE(test_map.couldBe(arr_mapn(TSStr, TCStr)));
EXPECT_FALSE(test_map.couldBe(arr_mapn(TSStr, TObj)));
EXPECT_FALSE(test_map.couldBe(aval(test_empty_array())));
EXPECT_FALSE(arr_mapn(TSStr, TInt).couldBe(aval(test_empty_array())));
EXPECT_TRUE(sarr_packedn(TInt).couldBe(sarr_mapn(TInt, TInt)));
EXPECT_FALSE(sarr_packedn(TInt).couldBe(sarr_mapn(TInt, TObj)));
EXPECT_TRUE(tstruct.couldBe(sarr_mapn(TSStr, TInt)));
EXPECT_FALSE(tstruct.couldBe(sarr_mapn(TSStr, TObj)));
EXPECT_FALSE(tstruct.couldBe(carr_mapn(TSStr, TObj)));
EXPECT_FALSE(tstruct.couldBe(carr_mapn(TSStr, TInt)));
}
TEST(Type, ArrEquivalentRepresentations) {
{
auto const simple = aval(test_array_packed_value());
auto const bulky = sarr_packed({ival(42), ival(23), ival(12)});
EXPECT_EQ(simple, bulky);
}
{
auto const simple = aval(test_array_map_value());
auto map = StructMap{};
map[s_A.get()] = sval(s_B.get());
map[s_test.get()] = ival(12);
auto const bulky = sarr_struct(map);
EXPECT_EQ(simple, bulky);
}
}
TEST(Type, ArrUnions) {
auto test_map_a = StructMap{};
test_map_a[s_test.get()] = ival(2);
auto const tstruct = sarr_struct(test_map_a);
auto test_map_b = StructMap{};
test_map_b[s_test.get()] = TInt;
auto const tstruct2 = sarr_struct(test_map_b);
auto test_map_c = StructMap{};
test_map_c[s_A.get()] = TInt;
auto const tstruct3 = sarr_struct(test_map_c);
auto test_map_d = StructMap{};
test_map_d[s_A.get()] = TInt;
test_map_d[s_test.get()] = TDbl;
auto const tstruct4 = sarr_struct(test_map_d);
auto const packed_int = arr_packedn(TInt);
EXPECT_EQ(union_of(tstruct, packed_int),
arr_mapn(union_of(TSStr, TInt), TInt));
EXPECT_EQ(union_of(tstruct, tstruct2), tstruct2);
EXPECT_EQ(union_of(tstruct, tstruct3), sarr_mapn(TSStr, TInt));
EXPECT_EQ(union_of(tstruct, tstruct4), sarr_mapn(TSStr, TNum));
EXPECT_EQ(union_of(sarr_packed({TInt, TDbl, TDbl}), sarr_packedn(TDbl)),
sarr_packedn(TNum));
EXPECT_EQ(union_of(sarr_packed({TInt, TDbl}), tstruct),
sarr_mapn(union_of(TSStr, TInt), TNum));
EXPECT_EQ(union_of(arr_mapn(TInt, TTrue), arr_mapn(TDbl, TFalse)),
arr_mapn(TNum, TBool));
auto const aval1 = aval(test_array_packed_value());
auto const aval2 = aval(test_array_packed_value3());
EXPECT_EQ(union_of(aval1, aval2), sarr_packedn(TInt));
}
TEST(Type, ArrOfArr) {
auto const t1 = arr_mapn(TSStr, arr_mapn(TInt, TSStr));
auto const t2 = arr_mapn(TSStr, TArr);
auto const t3 = arr_mapn(TSStr, arr_packedn(TSStr));
auto const t4 = arr_mapn(TSStr, arr_mapn(TSStr, TSStr));
EXPECT_TRUE(t1.subtypeOf(t2));
EXPECT_TRUE(t1.couldBe(t3));
EXPECT_FALSE(t1.subtypeOf(t3));
EXPECT_TRUE(t3.subtypeOf(t1));
EXPECT_TRUE(t3.subtypeOf(t2));
EXPECT_FALSE(t1.couldBe(t4));
EXPECT_FALSE(t4.couldBe(t3));
EXPECT_TRUE(t4.subtypeOf(t2));
}
TEST(Type, WideningAlreadyStable) {
// A widening union on types that are already stable should not move
// the type anywhere.
for (auto& t : all()) {
EXPECT_EQ(widening_union(t, t), t);
}
for (auto& t : specialized_array_examples()) {
EXPECT_EQ(widening_union(t, t), t);
}
}
TEST(Type, EmptyArray) {
{
auto const possible_e = union_of(arr_packedn(TInt), aempty());
EXPECT_TRUE(possible_e.couldBe(aempty()));
EXPECT_TRUE(possible_e.couldBe(arr_packedn(TInt)));
EXPECT_EQ(array_elem(possible_e, ival(0)), opt(TInt));
}
{
auto const possible_e = union_of(arr_packed({TInt, TInt}), aempty());
EXPECT_TRUE(possible_e.couldBe(aempty()));
EXPECT_TRUE(possible_e.couldBe(arr_packed({TInt, TInt})));
EXPECT_FALSE(possible_e.couldBe(arr_packed({TInt, TInt, TInt})));
EXPECT_FALSE(possible_e.subtypeOf(arr_packedn(TInt)));
EXPECT_EQ(array_elem(possible_e, ival(0)), opt(TInt));
EXPECT_EQ(array_elem(possible_e, ival(1)), opt(TInt));
}
{
auto const estat = union_of(sarr_packedn(TInt), aempty());
EXPECT_TRUE(estat.couldBe(aempty()));
EXPECT_TRUE(estat.couldBe(sarr_packedn(TInt)));
EXPECT_FALSE(estat.subtypeOf(sarr_packedn(TInt)));
EXPECT_FALSE(estat.subtypeOf(TCArr));
EXPECT_FALSE(estat.couldBe(TCArr));
EXPECT_FALSE(estat.subtypeOf(TSArrE));
EXPECT_TRUE(estat.couldBe(TSArrE));
}
EXPECT_EQ(array_newelem(aempty(), ival(142)), arr_packed({ival(142)}));
}
TEST(Type, BasicArrays) {
EXPECT_TRUE(TSArr.subtypeOf(TArr));
EXPECT_TRUE(TCArr.subtypeOf(TArr));
EXPECT_TRUE(TArrE.subtypeOf(TArr));
EXPECT_TRUE(TArrN.subtypeOf(TArr));
EXPECT_TRUE(TSArrE.subtypeOf(TArr));
EXPECT_TRUE(TSArrN.subtypeOf(TArr));
EXPECT_TRUE(TCArrE.subtypeOf(TArr));
EXPECT_TRUE(TCArrN.subtypeOf(TArr));
EXPECT_EQ(union_of(TSArr, TCArr), TArr);
EXPECT_EQ(union_of(TSArrE, TCArrE), TArrE);
EXPECT_EQ(union_of(TSArrN, TCArrN), TArrN);
EXPECT_EQ(union_of(TArrN, TArrE), TArr);
EXPECT_EQ(union_of(TSArrN, TCArrE), TArr);
EXPECT_EQ(union_of(TSArrE, TCArrN), TArr);
EXPECT_EQ(union_of(TOptCArrN, TSArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArr, TCArr), TOptArr);
EXPECT_EQ(union_of(TOptSArrE, TCArrE), TOptArrE);
EXPECT_EQ(union_of(TOptSArrN, TCArrN), TOptArrN);
EXPECT_EQ(union_of(TOptArrN, TArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArrN, TOptCArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArrN, TOptCArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArr, TOptCArr), TOptArr);
EXPECT_EQ(union_of(TOptSArrE, TOptCArrE), TOptArrE);
EXPECT_EQ(union_of(TOptSArrN, TOptCArrN), TOptArrN);
EXPECT_EQ(union_of(TOptArrN, TOptArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArrN, TOptCArrE), TOptArr);
EXPECT_EQ(union_of(TOptSArrN, TOptCArrE), TOptArr);
EXPECT_EQ(union_of(TSArr, TInitNull), TOptSArr);
EXPECT_EQ(union_of(TSArrE, TInitNull), TOptSArrE);
EXPECT_EQ(union_of(TSArrN, TInitNull), TOptSArrN);
EXPECT_EQ(union_of(TCArr, TInitNull), TOptCArr);
EXPECT_EQ(union_of(TCArrE, TInitNull), TOptCArrE);
EXPECT_EQ(union_of(TCArrN, TInitNull), TOptCArrN);
EXPECT_EQ(union_of(TArr, TInitNull), TOptArr);
EXPECT_EQ(union_of(TArrE, TInitNull), TOptArrE);
EXPECT_EQ(union_of(TArrN, TInitNull), TOptArrN);
}
/*
* These are tests for some unrepresentable bit combos. If we ever
* add predefined bits for things like TSArrE|TCArrN these will fail
* and need to be revisted.
*/
TEST(Type, ArrBitCombos) {
auto const u1 = union_of(sarr_packedn(TInt), TCArrE);
EXPECT_TRUE(u1.couldBe(TArrE));
EXPECT_TRUE(u1.couldBe(TSArrE));
EXPECT_TRUE(u1.couldBe(TCArrE));
EXPECT_TRUE(u1.couldBe(sarr_packedn(TInt)));
EXPECT_EQ(array_elem(u1, ival(0)), TOptInt);
auto const u2 = union_of(TSArrE, carr_packedn(TInt));
EXPECT_TRUE(u2.couldBe(TArrE));
EXPECT_TRUE(u2.couldBe(TSArrE));
EXPECT_TRUE(u2.couldBe(TCArrE));
EXPECT_TRUE(u2.couldBe(arr_packedn(TInt)));
EXPECT_EQ(array_elem(u2, ival(0)), TOptInt);
}
//////////////////////////////////////////////////////////////////////
}}
| 34.985658 | 79 | 0.695693 | arnononline |
f68aa1f30642677206154c59cdfc7088a3b4d3d0 | 38,240 | cpp | C++ | tools/converter/source/optimizer/PostTreatUtils.cpp | loveltyoic/MNN | ff405a307819a7228e0d1fc02c00c68021745b0a | [
"Apache-2.0"
] | null | null | null | tools/converter/source/optimizer/PostTreatUtils.cpp | loveltyoic/MNN | ff405a307819a7228e0d1fc02c00c68021745b0a | [
"Apache-2.0"
] | null | null | null | tools/converter/source/optimizer/PostTreatUtils.cpp | loveltyoic/MNN | ff405a307819a7228e0d1fc02c00c68021745b0a | [
"Apache-2.0"
] | 1 | 2021-01-15T06:28:11.000Z | 2021-01-15T06:28:11.000Z | //
// PostTreatUtils.cpp
// MNNConverter
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "PostTreatUtils.hpp"
#include <iostream>
using namespace MNN;
static bool _OpNeedContent(OpType type, int index) {
switch (type) {
case OpType_Shape:
case OpType_PriorBox:
return false;
case OpType_Interp:
case OpType_Crop:
case OpType_Reshape:
case OpType_Resize:
if (1 == index) {
return false;
}
break;
default:
break;
}
return true;
}
PostTreatUtils::PostTreatUtils(std::unique_ptr<MNN::NetT>& net) : mNet(std::move(net)) {
}
const std::set<MNN::OpType> PostTreatUtils::NC4HW4_OPs = {
MNN::OpType_Convolution,
MNN::OpType_ConvolutionDepthwise,
MNN::OpType_Pooling,
MNN::OpType_ROIPooling,
MNN::OpType_Resize,
MNN::OpType_LSTM,
MNN::OpType_SpatialProduct,
MNN::OpType_Deconvolution,
MNN::OpType_DeconvolutionDepthwise,
MNN::OpType_Proposal,
MNN::OpType_PriorBox,
MNN::OpType_DetectionOutput,
MNN::OpType_Eltwise,
MNN::OpType_LRN,
MNN::OpType_Interp,
MNN::OpType_Crop,
MNN::OpType_Scale,
MNN::OpType_TfQuantizedConv2D,
MNN::OpType_QuantizedDepthwiseConv2D,
MNN::OpType_BatchToSpaceND,
MNN::OpType_SpaceToBatchND,
MNN::OpType_BatchNorm,
MNN::OpType_Moments,
MNN::OpType_QuantizedAvgPool,
MNN::OpType_QuantizedAdd,
};
const std::set<MNN::OpType> PostTreatUtils::COMPABILITY_OPs = {
MNN::OpType_ReLU, MNN::OpType_ReLU6, MNN::OpType_Concat, MNN::OpType_Slice, MNN::OpType_Permute,
MNN::OpType_Selu, MNN::OpType_ConvertTensor, MNN::OpType_Sigmoid, MNN::OpType_Softmax, MNN::OpType_Cast,
MNN::OpType_Reshape, MNN::OpType_TanH, MNN::OpType_ArgMax,
};
const std::vector<MNN::OpType> PostTreatUtils::DELETE_Ops = {
MNN::OpType_Seq2Out,
MNN::OpType_Dropout,
};
void PostTreatUtils::treatIm2Seq() {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
if (op->type != MNN::OpType_Im2Seq) {
iter++;
continue;
}
auto inputId = op->inputIndexes[0];
auto outputId = op->outputIndexes[0];
auto outputname = mNet->tensorName[outputId];
// New Reshape
MNN::OpT* reshapeT = new MNN::OpT;
reshapeT->name = "____reshape____" + op->name;
auto reshapeP = new MNN::ReshapeT;
reshapeP->dims.push_back(0); // b
reshapeP->dims.push_back(-1); // c
reshapeP->dims.push_back(1); // h
reshapeP->dims.push_back(0); // w
reshapeT->main.type = MNN::OpParameter_Reshape;
reshapeT->type = MNN::OpType_Reshape;
reshapeT->main.value = reshapeP;
// Net Tensor
mNet->tensorName.push_back(reshapeT->name);
int tempId = mNet->tensorName.size() - 1;
reshapeT->inputIndexes.push_back(inputId);
reshapeT->outputIndexes.push_back(tempId);
op->inputIndexes[0] = tempId;
op->type = MNN::OpType_Permute;
auto convP = new MNN::PermuteT;
op->main.type = MNN::OpParameter_Permute;
op->main.value = convP;
convP->dims.push_back(0);
convP->dims.push_back(3);
convP->dims.push_back(2);
convP->dims.push_back(1);
iter = mNet->oplists.insert(iter, std::unique_ptr<MNN::OpT>(reshapeT));
}
}
void PostTreatUtils::deleteUnusefulOp() {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
bool shouldDelete = false;
for (int i = 0; i < PostTreatUtils::DELETE_Ops.size(); ++i) {
if (op->type == PostTreatUtils::DELETE_Ops[i]) {
shouldDelete = true;
break;
}
}
if (!shouldDelete) {
iter++;
continue;
}
// Find the next op
auto originInput = op->inputIndexes[0];
auto originOutput = op->outputIndexes[0];
iter = mNet->oplists.erase(iter);
for (auto subIter = mNet->oplists.begin(); subIter != mNet->oplists.end(); subIter++) {
auto& subOp = *subIter;
for (int v = 0; v < subOp->inputIndexes.size(); ++v) {
if (subOp->inputIndexes[v] == originOutput) {
subOp->inputIndexes[v] = originInput;
}
}
}
}
}
bool PostTreatUtils::_merge2Convolution(const MNN::OpT* inplaceOp, MNN::OpT* convolutionOp) {
if (inplaceOp->type == MNN::OpType_ReLU && inplaceOp->main.AsRelu()->slope == 0.0f) {
convolutionOp->main.AsConvolution2D()->common->relu = true;
return true;
}
if (inplaceOp->type == MNN::OpType_ReLU6) {
convolutionOp->main.AsConvolution2D()->common->relu6 = true;
return true;
}
const auto& convCommon = convolutionOp->main.AsConvolution2D()->common;
if (convCommon->relu || convCommon->relu6) {
return false;
}
if (inplaceOp->type == MNN::OpType_BatchNorm || inplaceOp->type == MNN::OpType_Scale) {
std::vector<float> alpha;
std::vector<float> bias;
if (inplaceOp->type == MNN::OpType_BatchNorm) {
auto l = inplaceOp->main.AsBatchNorm();
alpha.resize(l->channels);
bias.resize(l->channels);
const float* slopePtr = l->slopeData.data();
const float* meanDataPtr = l->meanData.data();
const float* varDataPtr = l->varData.data();
const float* biasDataPtr = l->biasData.data();
for (int i = 0; i < l->channels; i++) {
float sqrt_var = sqrt(varDataPtr[i]);
bias[i] = biasDataPtr[i] - slopePtr[i] * meanDataPtr[i] / sqrt_var;
alpha[i] = slopePtr[i] / sqrt_var;
}
}
if (inplaceOp->type == MNN::OpType_Scale) {
bias = inplaceOp->main.AsScale()->biasData;
alpha = inplaceOp->main.AsScale()->scaleData;
}
auto conv2D = convolutionOp->main.AsConvolution2D();
int outputCount = conv2D->common->outputCount;
for (int i = 0; i < outputCount; ++i) {
conv2D->bias[i] = conv2D->bias[i] * alpha[i] + bias[i];
}
if (nullptr != conv2D->quanParameter.get()) {
for (int i = 0; i < outputCount; ++i) {
conv2D->quanParameter->alpha[i] *= alpha[i];
}
} else {
int weightPartSize = conv2D->weight.size() / outputCount;
for (int i = 0; i < outputCount; ++i) {
float a = alpha[i];
for (int j = 0; j < weightPartSize; ++j) {
conv2D->weight[i * weightPartSize + j] *= a;
}
}
}
return true;
}
return false;
}
bool PostTreatUtils::_isSingleInputOutput(const MNN::OpT* op) {
if (op->inputIndexes.size() != 1 || op->outputIndexes.size() != 1) {
return false;
}
return true;
}
void PostTreatUtils::merge2Convolution() {
// Merge Layer
std::vector<MNN::OpT*> readyToDelete;
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end(); iter++) {
MNN::OpT& currentOp = *(iter->get());
if (currentOp.type != MNN::OpType_Convolution && currentOp.type != MNN::OpType_Deconvolution &&
currentOp.type != MNN::OpType_ConvolutionDepthwise) {
continue;
}
DCHECK(currentOp.outputIndexes.size() == 1) << "Conv output ERROR!";
// merge Batchnorm/Relu/Relu6 to Convolution
std::vector<MNN::OpT*> nextOp = this->_findOpByInputIndex(currentOp.outputIndexes[0]);
while (1) {
if (nextOp.size() != 1) {
break;
}
const int nextOutputIndex = nextOp[0]->outputIndexes[0];
bool succ = _merge2Convolution(nextOp[0], ¤tOp);
if (_isSingleInputOutput(nextOp[0]) && succ) {
// LOG(INFO) << "Merge " << nextOp[0]->name.c_str()<< " into convolution: " << currentOp.name.c_str();
currentOp.outputIndexes[0] = nextOp[0]->outputIndexes[0];
readyToDelete.push_back(nextOp[0]);
nextOp = this->_findOpByInputIndex(nextOutputIndex);
} else {
break;
}
}
}
for (auto op : readyToDelete) {
_removeOpInNet(op);
}
}
void PostTreatUtils::addTensorType() {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end(); iter++) {
auto& op = *iter;
if (op->type == MNN::OpType_StridedSlice) {
auto parameter = op->main.AsStridedSliceParam();
auto dataType = parameter->T;
{
int index = op->inputIndexes[0];
auto describe = std::unique_ptr<MNN::TensorDescribeT>(new MNN::TensorDescribeT);
describe->index = index;
describe->blob = std::unique_ptr<MNN::BlobT>(new MNN::BlobT);
describe->blob->dataType = dataType;
mNet->extraTensorDescribe.push_back(std::move(describe));
}
{
int index = op->outputIndexes[0];
auto describe = std::unique_ptr<MNN::TensorDescribeT>(new MNN::TensorDescribeT);
describe->index = index;
describe->blob = std::unique_ptr<MNN::BlobT>(new MNN::BlobT);
describe->blob->dataType = dataType;
mNet->extraTensorDescribe.push_back(std::move(describe));
}
}
if (op->type == MNN::OpType_Const) {
auto constP = op->main.AsBlob();
{
int index = op->outputIndexes[0];
auto describe = std::unique_ptr<MNN::TensorDescribeT>(new MNN::TensorDescribeT);
describe->index = index;
describe->blob = std::unique_ptr<MNN::BlobT>(new MNN::BlobT);
describe->blob->dataType = constP->dataType;
mNet->extraTensorDescribe.push_back(std::move(describe));
}
}
}
}
void PostTreatUtils::removeInplaceOp() {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end(); iter++) {
auto& op = *iter;
if (!_isSingleInputOutput(op.get())) {
continue;
}
if (op->inputIndexes[0] != op->outputIndexes[0]) {
continue;
}
auto originIndex = op->inputIndexes[0];
mNet->tensorName.push_back(op->name);
int newIndex = mNet->tensorName.size() - 1;
op->outputIndexes[0] = newIndex;
for (auto subIter = iter + 1; subIter != mNet->oplists.end(); subIter++) {
auto& subOp = *subIter;
for (int i = 0; i < subOp->inputIndexes.size(); ++i) {
if (subOp->inputIndexes[i] == originIndex) {
subOp->inputIndexes[i] = newIndex;
}
}
for (int i = 0; i < subOp->outputIndexes.size(); ++i) {
if (subOp->outputIndexes[i] == originIndex) {
subOp->outputIndexes[i] = newIndex;
}
}
}
mNet->tensorNumber = mNet->tensorName.size();
}
}
void PostTreatUtils::reIndexTensor() {
std::map<int, int> usefulTensorIndexMap;
std::vector<std::string> usefulTensorName;
std::vector<bool> tensorValid(mNet->tensorName.size(), false);
for (auto& op : mNet->oplists) {
for (auto index : op->inputIndexes) {
tensorValid[index] = true;
}
for (auto index : op->outputIndexes) {
tensorValid[index] = true;
}
}
for (int i = 0; i < tensorValid.size(); ++i) {
if (tensorValid[i]) {
usefulTensorIndexMap.insert(std::make_pair(i, usefulTensorName.size()));
usefulTensorName.push_back(mNet->tensorName[i]);
}
}
// Re index
for (auto& op : mNet->oplists) {
for (int i = 0; i < op->inputIndexes.size(); ++i) {
auto iter = usefulTensorIndexMap.find(op->inputIndexes[i]);
DCHECK(iter != usefulTensorIndexMap.end()) << "ERROR";
op->inputIndexes[i] = iter->second;
}
for (int i = 0; i < op->outputIndexes.size(); ++i) {
auto iter = usefulTensorIndexMap.find(op->outputIndexes[i]);
DCHECK(iter != usefulTensorIndexMap.end()) << "ERROR";
op->outputIndexes[i] = iter->second;
}
}
mNet->tensorName = usefulTensorName;
for (auto iter = mNet->extraTensorDescribe.begin(); iter != mNet->extraTensorDescribe.end();) {
auto index = (*iter)->index;
if (usefulTensorIndexMap.find(index) == usefulTensorIndexMap.end()) {
iter = mNet->extraTensorDescribe.erase(iter);
continue;
}
(*iter)->index = usefulTensorIndexMap.find(index)->second;
iter++;
}
}
void PostTreatUtils::addConverterForTensorFlowModel() {
if (mNet->sourceType == MNN::NetSource_CAFFE) {
return;
}
// Don't support inplace
std::vector<MNN::MNN_DATA_FORMAT> tensorType(mNet->tensorName.size());
std::map<std::string, MNN::MNN_DATA_FORMAT> opType;
for (auto& iter : mNet->oplists) {
auto type = MNN::MNN_DATA_FORMAT_NHWC;
if (iter->type == MNN::OpType_ConvertTensor) {
type = iter->main.AsTensorConvertInfo()->dest;
} else if (PostTreatUtils::NC4HW4_OPs.find(iter->type) != PostTreatUtils::NC4HW4_OPs.end()) {
type = MNN::MNN_DATA_FORMAT_NC4HW4;
} else if (PostTreatUtils::COMPABILITY_OPs.find(iter->type) != PostTreatUtils::COMPABILITY_OPs.end()) {
int caffeNumber = 0;
int tensorFlowNamer = 0;
for (auto index : iter->inputIndexes) {
if (tensorType[index] == MNN::MNN_DATA_FORMAT_NC4HW4) {
caffeNumber++;
} else if (tensorType[index] == MNN::MNN_DATA_FORMAT_NHWC) {
tensorFlowNamer++;
}
}
if (caffeNumber > tensorFlowNamer) {
type = MNN::MNN_DATA_FORMAT_NC4HW4;
} else {
type = MNN::MNN_DATA_FORMAT_NHWC;
}
if (iter->type == MNN::OpType_Reshape) {
if (iter->main.AsReshape()->dims.size() != 4) {
type = MNN::MNN_DATA_FORMAT_NHWC;
}
}
}
for (auto index : iter->outputIndexes) {
tensorType[index] = type;
}
opType.insert(std::make_pair(iter->name, type));
}
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
auto currentType = opType.find(op->name)->second;
std::vector<MNN::OpT*> transformOps;
auto currentName = op->name;
const bool useAutoFormat = NC4HW4_OPs.find(op->type) != NC4HW4_OPs.end();
for (int i = 0; i < op->inputIndexes.size(); ++i) {
auto inputIndex = op->inputIndexes[i];
MNN::OpT* inputOp = this->_findOpByOutputIndex(inputIndex);
if (inputOp && inputOp->type == MNN::OpType_Input && useAutoFormat) {
auto inputOpParam = inputOp->main.AsInput();
inputOpParam->dformat = MNN::MNN_DATA_FORMAT_NC4HW4;
tensorType[inputIndex] = MNN::MNN_DATA_FORMAT_NC4HW4;
opType[inputOp->name] = MNN::MNN_DATA_FORMAT_NC4HW4;
continue;
}
auto type = tensorType[inputIndex];
if (type == currentType) {
continue;
}
if (!_OpNeedContent(op->type, i)) {
continue;
}
// Insert Transform op
MNN::OpT* transformOp = new MNN::OpT;
transformOps.push_back(transformOp);
MNN::TensorConvertInfoT* tc = new MNN::TensorConvertInfoT;
tc->source = type;
tc->dest = currentType;
transformOp->main.type = MNN::OpParameter_TensorConvertInfo;
transformOp->main.value = tc;
transformOp->name = mNet->tensorName[inputIndex] + "___tr4" + op->name;
// printf("Insert convert for %s, %s 's input %d\n", net->tensorName[inputIndex].c_str(), op->name.c_str(),
// i);
transformOp->inputIndexes.push_back(inputIndex);
transformOp->outputIndexes.push_back(mNet->tensorName.size());
mNet->tensorName.push_back(transformOp->name);
op->inputIndexes[i] = transformOp->outputIndexes[0];
transformOp->type = MNN::OpType_ConvertTensor;
}
for (int i = transformOps.size() - 1; i >= 0; i--) {
iter = mNet->oplists.insert(iter, std::unique_ptr<MNN::OpT>(transformOps[i]));
}
for (; (*iter)->name != currentName; iter++) {
}
iter++;
}
// Reset axis map
const int axisMap[4] = {0, 2, 3, 1};
for (auto& op : mNet->oplists) {
if (opType.find(op->name)->second == MNN::MNN_DATA_FORMAT_NHWC) {
continue;
}
if (MNN::OpType_Input == op->type) {
auto input = op->main.AsInput();
if (4 == input->dims.size()) {
int h = input->dims[1];
int c = input->dims[3];
int w = input->dims[2];
input->dims[1] = c;
input->dims[2] = h;
input->dims[3] = w;
}
}
if (MNN::OpType_Concat == op->type) {
auto axis = op->main.AsAxis();
if (axis->axis >= 0 && axis->axis <= 3) {
axis->axis = axisMap[axis->axis];
}
}
if (MNN::OpType_Permute == op->type) {
auto permuteT = op->main.AsPermute();
for (int i = 0; i < permuteT->dims.size(); ++i) {
DCHECK(permuteT->dims[i] >= 0 && permuteT->dims[i] <= 3) << "Dim Error ==> " << op->name;
permuteT->dims[i] = axisMap[permuteT->dims[i]];
}
}
if (MNN::OpType_Slice == op->type) {
auto slice = op->main.AsSlice();
if (slice->axis >= 0 && slice->axis <= 3) {
slice->axis = axisMap[slice->axis];
}
}
if (MNN::OpType_Reshape == op->type) {
auto reshape = op->main.AsReshape();
auto originDim = reshape->dims;
for (int i = 0; i < reshape->dims.size(); ++i) {
CHECK(i >= 0 && i <= 3) << "Error";
reshape->dims[axisMap[i]] = originDim[i];
}
}
}
std::vector<bool> tensorTypeSet(tensorType.size(), false);
for (auto& iter : mNet->extraTensorDescribe) {
auto index = iter->index;
iter->blob->dataFormat = tensorType[index];
tensorTypeSet[index] = true;
}
for (int i = 0; i < tensorTypeSet.size(); ++i) {
if (tensorTypeSet[i]) {
continue;
}
auto describe = new MNN::TensorDescribeT;
describe->index = i;
describe->blob = std::unique_ptr<MNN::BlobT>(new MNN::BlobT);
describe->blob->dataFormat = tensorType[i];
describe->blob->dataType = MNN::DataType_DT_FLOAT;
mNet->extraTensorDescribe.push_back(std::unique_ptr<MNN::TensorDescribeT>(describe));
}
}
MNN::OpT* ensureOpInNet(std::unique_ptr<MNN::NetT>& net, MNN::OpT* op) {
for (auto& _op : net->oplists) {
if (_op.get() == op) {
return op;
}
}
return nullptr;
}
MNN::OpT* PostTreatUtils::_findOpByOutputIndex(int outputIndex) {
for (auto& op : mNet->oplists) {
if (inVector(op->outputIndexes, outputIndex)) {
return op.get();
}
}
return nullptr;
}
std::vector<MNN::OpT*> PostTreatUtils::_findOpByInputIndex(int inputIndex) {
std::vector<MNN::OpT*> ops;
for (auto& op : mNet->oplists) {
if (inVector(op->inputIndexes, inputIndex)) {
ops.push_back(op.get());
}
}
// check whether the next op is in_place op
const int opsSize = ops.size();
if (opsSize > 1) {
auto realNextOp = ops[0];
if (inVector(realNextOp->outputIndexes, inputIndex)) {
ops.clear();
ops.push_back(realNextOp);
}
}
return ops;
}
int PostTreatUtils::_getOpDecestorCount(MNN::OpT* op) {
int decestorCount = 0;
for (auto& otherOp : mNet->oplists) {
if (otherOp.get() != op) {
for (auto inputIndex : otherOp->inputIndexes) {
if (inVector(op->outputIndexes, inputIndex)) {
decestorCount++;
break; // one decestor just count one.
}
}
}
}
return decestorCount;
}
void PostTreatUtils::_removeOpInNet(MNN::OpT* op) {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end(); iter++) {
if (iter->get() == op) {
// LOG(INFO) << "remove op: " << op->name;
mNet->oplists.erase(iter);
break;
}
}
}
void PostTreatUtils::_removeOnlyOneDecestorOps(MNN::OpT* op) {
std::vector<MNN::OpT*> opsToBeChecked;
opsToBeChecked.push_back(op);
while (!opsToBeChecked.empty()) {
bool hasRemoved = false;
std::vector<MNN::OpT*> addedToBeChecked;
for (auto iter = opsToBeChecked.begin(); iter != opsToBeChecked.end();) {
MNN::OpT* op = *iter;
if (!ensureOpInNet(mNet, op)) {
hasRemoved = true;
iter = opsToBeChecked.erase(iter);
continue;
}
if (this->_getOpDecestorCount(op) == 0) {
for (int inputIndex : op->inputIndexes) {
addedToBeChecked.push_back(this->_findOpByOutputIndex(inputIndex));
}
hasRemoved = true;
this->_removeOpInNet(op);
iter = opsToBeChecked.erase(iter);
continue;
}
iter++;
}
if (!hasRemoved)
break;
opsToBeChecked.insert(opsToBeChecked.end(), addedToBeChecked.begin(), addedToBeChecked.end());
}
}
void PostTreatUtils::removeDeconvolutionShapeInput() {
std::set<MNN::OpT*> shapeOps;
for (auto& op : mNet->oplists) {
if (op->type == MNN::OpType_Deconvolution) {
if (op->inputIndexes.size() == 1) {
continue;
}
int firstInputIndex = op->inputIndexes[0];
op->inputIndexes.erase(op->inputIndexes.begin());
MNN::OpT* shapeOp = this->_findOpByOutputIndex(firstInputIndex);
if (shapeOp) {
shapeOps.insert(shapeOp);
}
}
}
for (auto& op : shapeOps) {
this->_removeOnlyOneDecestorOps(op);
}
}
void PostTreatUtils::turnInnerProduct2Convolution() {
std::vector<MNN::OpT*> readyToDelete;
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
if (op->type != MNN::OpType_InnerProduct) {
iter++;
continue;
}
// ONNX Gemm will be mapped to InnerProduct, check whether is Flatten before Gemm
// then delete Flatten(mapped to Reshape, and this Reshape will reshape tensor to be
// two dimensions, such as [M,K], which is the input of Gemm)
auto inputId = op->inputIndexes[0];
auto beforeGemm = _findOpByOutputIndex(inputId);
auto refBeforeGemm = _findOpByInputIndex(beforeGemm->outputIndexes[0]);
if (beforeGemm->type == MNN::OpType_Reshape && _isSingleInputOutput(beforeGemm) && refBeforeGemm.size() == 1) {
// change the input index
const int beforeGemmInputId = beforeGemm->inputIndexes[0];
op->inputIndexes[0] = beforeGemmInputId;
inputId = beforeGemmInputId;
readyToDelete.push_back(beforeGemm);
}
auto paramInner = op->main.AsInnerProduct();
const auto axis = paramInner->axis;
std::vector<MNN::OpT*> newOpPrevious;
std::vector<MNN::OpT*> newOpPost;
// New Reshape
MNN::OpT* reshapeT = new MNN::OpT;
newOpPrevious.push_back(reshapeT);
reshapeT->name = "____reshape____" + op->name;
auto reshapeP = new MNN::ReshapeT;
reshapeP->dims.resize(4);
for (int i = 0; i < axis; ++i) {
reshapeP->dims[i] = 0;
}
reshapeP->dims[axis] = -1;
for (int i = axis + 1; i < 4; ++i) {
reshapeP->dims[i] = 1;
}
if (mNet->sourceType == MNN::NetSource_TENSORFLOW) {
reshapeP->dims[3] = -1;
reshapeP->dims[1] = 1;
reshapeP->dims[2] = 1;
}
reshapeT->main.type = MNN::OpParameter_Reshape;
reshapeT->type = MNN::OpType_Reshape;
reshapeT->main.value = reshapeP;
// Net Tensor
mNet->tensorName.push_back(reshapeT->name);
int tempId = mNet->tensorName.size() - 1;
reshapeT->inputIndexes.push_back(inputId);
reshapeT->outputIndexes.push_back(tempId);
auto opName = op->name;
bool needPermute = 1 != axis && mNet->sourceType == MNN::NetSource_CAFFE;
if (needPermute) {
// Add Permute
auto permuteBefore = new MNN::OpT;
permuteBefore->type = MNN::OpType_Permute;
permuteBefore->main.type = MNN::OpParameter_Permute;
auto permuteT = new MNN::PermuteT;
permuteBefore->name = "___permute1__" + reshapeT->name;
permuteT->dims.resize(4);
for (int i = 0; i < 4; ++i) {
permuteT->dims[i] = i;
}
permuteT->dims[1] = axis;
permuteT->dims[axis] = 3;
permuteT->dims[3] = 1;
permuteBefore->main.value = permuteT;
permuteBefore->inputIndexes.push_back(tempId);
mNet->tensorName.push_back(permuteBefore->name);
tempId = mNet->tensorName.size() - 1;
permuteBefore->outputIndexes.push_back(tempId);
newOpPrevious.push_back(permuteBefore);
}
op->inputIndexes[0] = tempId;
op->type = MNN::OpType_Convolution;
auto convP = new MNN::Convolution2DT;
auto originInner = op->main.AsInnerProduct();
convP->common = std::unique_ptr<MNN::Convolution2DCommonT>(new MNN::Convolution2DCommonT);
convP->common->kernelX = 1;
convP->common->kernelY = 1;
convP->common->dilateX = 1;
convP->common->dilateY = 1;
convP->common->strideX = 1;
convP->common->strideY = 1;
convP->common->group = 1;
convP->common->outputCount = originInner->outputCount;
convP->common->padX = 0;
convP->common->padY = 0;
convP->common->padMode = MNN::PadMode_CAFFE;
convP->bias = originInner->bias;
convP->weight = originInner->weight;
convP->quanParameter = std::move(originInner->quanParameter);
if (convP->quanParameter.get() != nullptr) {
convP->quanParameter->has_scaleInt = false;
}
op->main.Reset();
op->main.type = MNN::OpParameter_Convolution2D;
op->main.value = convP;
if (needPermute) {
// Add Permute After
auto permuteBefore = new MNN::OpT;
permuteBefore->type = MNN::OpType_Permute;
permuteBefore->main.type = MNN::OpParameter_Permute;
auto permuteT = new MNN::PermuteT;
permuteBefore->name = "___permute2__" + reshapeT->name;
permuteT->dims.resize(4);
permuteT->dims[0] = 0;
permuteT->dims[1] = 3;
permuteT->dims[2] = 2;
permuteT->dims[3] = 2;
permuteT->dims[axis] = 1;
permuteBefore->main.value = permuteT;
mNet->tensorName.push_back(permuteBefore->name);
tempId = mNet->tensorName.size() - 1;
permuteBefore->inputIndexes.push_back(tempId);
permuteBefore->outputIndexes.push_back(op->outputIndexes[0]);
op->outputIndexes[0] = tempId;
newOpPost.push_back(permuteBefore);
}
for (int i = 0; i < newOpPrevious.size(); ++i) {
iter = mNet->oplists.insert(iter, std::unique_ptr<MNN::OpT>(newOpPrevious[newOpPrevious.size() - i - 1]));
}
for (;; iter++) {
auto& op = *iter;
if (op->name == opName) {
break;
}
}
for (int i = 0; i < newOpPost.size(); ++i) {
iter = mNet->oplists.insert(iter + 1, std::unique_ptr<MNN::OpT>(newOpPost[i]));
}
}
for (auto op : readyToDelete) {
_removeOpInNet(op);
}
}
void PostTreatUtils::turnGroupConvolution() {
// Pick DepthWise one
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end(); iter++) {
auto& op = *iter;
const auto op_type = op->type;
auto conv2D = op->main.AsConvolution2D();
auto& common = conv2D->common;
if (op_type == MNN::OpType_Convolution || op_type == MNN::OpType_Deconvolution) {
bool turnConv2DW = false;
// check whether idst quantization model
if (nullptr != conv2D->quanParameter.get()) {
auto& quanParam = conv2D->quanParameter;
auto quanWeightBuffer = quanParam->buffer.data();
const int weightShapeDim = static_cast<int>(quanWeightBuffer[0]);
if (weightShapeDim == 4) {
const auto weightShapePtr = reinterpret_cast<unsigned short*>(quanWeightBuffer + 1);
int ci = weightShapePtr[1];
if (ci == 1 && common->group != 1 && mNet->sourceType == MNN::NetSource_CAFFE) {
ci = weightShapePtr[0];
}
turnConv2DW = common->outputCount == common->group && ci == common->outputCount;
}
} else {
const int srcCount =
conv2D->weight.size() * common->group / common->outputCount / common->kernelX / common->kernelY;
turnConv2DW = common->outputCount == common->group && srcCount == common->outputCount;
}
if (turnConv2DW) {
switch (op_type) {
case MNN::OpType_Convolution:
op->type = MNN::OpType_ConvolutionDepthwise;
break;
case MNN::OpType_Deconvolution:
op->type = MNN::OpType_DeconvolutionDepthwise;
break;
default:
break;
}
}
}
}
// Delete Convolution With Grouop
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
if (op->type != MNN::OpType_Convolution && op->type != MNN::OpType_Deconvolution) {
iter++;
continue;
}
auto conv2D = op->main.AsConvolution2D();
auto& common = conv2D->common;
if (common->group == 1) {
iter++;
continue;
}
int srcCount = conv2D->weight.size() * common->group / common->outputCount / common->kernelX / common->kernelY;
DCHECK(srcCount % common->group == 0 && common->outputCount % common->group == 0)
<< "split group convolution ERROR! ==> " << op->name;
std::vector<int> newConvolutionInputIndex;
std::vector<int> newConvolutionOutputIndex;
for (int i = 0; i < common->group; ++i) {
std::ostringstream newTensorNameOs;
newTensorNameOs << op->name << "___input___" << i;
newConvolutionInputIndex.push_back(mNet->tensorName.size());
mNet->tensorName.push_back(newTensorNameOs.str());
}
for (int i = 0; i < common->group; ++i) {
std::ostringstream newTensorNameOs;
newTensorNameOs << op->name << "___output___" << i;
newConvolutionOutputIndex.push_back(mNet->tensorName.size());
mNet->tensorName.push_back(newTensorNameOs.str());
}
std::vector<MNN::OpT*> newOp;
// Create slice op
{
MNN::OpT* sliceOp = new MNN::OpT;
sliceOp->type = MNN::OpType_Slice;
sliceOp->name = op->name + "_____slice";
sliceOp->inputIndexes = op->inputIndexes;
sliceOp->outputIndexes = newConvolutionInputIndex;
auto sliceT = new MNN::SliceT;
sliceOp->main.type = MNN::OpParameter_Slice;
sliceOp->main.value = sliceT;
sliceT->axis = 1;
for (int i = 0; i < common->group - 1; ++i) {
sliceT->slicePoints.push_back(srcCount / (common->group) * (i + 1));
}
newOp.push_back(sliceOp);
}
int partWeightSize = conv2D->weight.size() / common->group;
int partBiasSize = conv2D->bias.size() / common->group;
// Create Sub Convolution
for (int i = 0; i < common->group; ++i) {
std::ostringstream opNameOs;
auto newConvOp = new MNN::OpT;
opNameOs << op->name << "__group__" << i;
newConvOp->type = op->type;
newConvOp->name = opNameOs.str();
newConvOp->main.type = MNN::OpParameter_Convolution2D;
newConvOp->inputIndexes.push_back(newConvolutionInputIndex[i]);
newConvOp->outputIndexes.push_back(newConvolutionOutputIndex[i]);
auto newConvolutionT = new MNN::Convolution2DT;
newConvOp->main.value = newConvolutionT;
newConvolutionT->common = std::unique_ptr<MNN::Convolution2DCommonT>(new MNN::Convolution2DCommonT);
newConvolutionT->common->kernelX = common->kernelX;
newConvolutionT->common->kernelY = common->kernelY;
newConvolutionT->common->dilateY = common->dilateY;
newConvolutionT->common->dilateX = common->dilateX;
newConvolutionT->common->strideX = common->strideX;
newConvolutionT->common->strideY = common->strideY;
newConvolutionT->common->group = 1;
newConvolutionT->common->padMode = common->padMode;
newConvolutionT->common->outputCount = common->outputCount / common->group;
newConvolutionT->common->padX = common->padX;
newConvolutionT->common->padY = common->padY;
newConvolutionT->common->relu = common->relu;
int startWeight = partWeightSize * i;
int startBias = partBiasSize * i;
for (int v = 0; v < partWeightSize; ++v) {
newConvolutionT->weight.push_back(conv2D->weight[startWeight + v]);
}
for (int v = 0; v < partBiasSize; ++v) {
newConvolutionT->bias.push_back(conv2D->bias[startBias + v]);
}
newOp.push_back(newConvOp);
}
// Set this op be Concat Op
{
op->type = MNN::OpType_Concat;
op->inputIndexes = newConvolutionOutputIndex;
op->main.Reset();
op->main.type = MNN::OpParameter_Axis;
auto axisT = new MNN::AxisT;
axisT->axis = 1;
op->main.value = axisT;
}
for (int v = 0; v < newOp.size(); ++v) {
int index = newOp.size() - v - 1;
iter = mNet->oplists.insert(iter, std::unique_ptr<MNN::OpT>(newOp[index]));
}
}
}
void PostTreatUtils::changeBatchnNorm2Scale() {
for (auto iter = mNet->oplists.begin(); iter != mNet->oplists.end();) {
auto& op = *iter;
const MNN::OpType opType = op->type;
if (MNN::OpType_BatchNorm != opType) {
iter++;
continue;
}
// instance norm have three input tensors(input_tensor, mean, variance)
if (op->inputIndexes.size() != 1) {
iter++;
continue;
}
// DLOG(INFO) << "change BatchNorm to Scale: " << op->name;
auto batchnormParam = op->main.AsBatchNorm();
auto scaleParam = new MNN::ScaleT;
scaleParam->channels = batchnormParam->channels;
scaleParam->scaleData.resize(batchnormParam->channels);
scaleParam->biasData.resize(batchnormParam->channels);
const float* slopePtr = batchnormParam->slopeData.data();
const float* meanDataPtr = batchnormParam->meanData.data();
const float* varDataPtr = batchnormParam->varData.data();
const float* biasDataPtr = batchnormParam->biasData.data();
for (int i = 0; i < batchnormParam->channels; i++) {
float sqrt_var = sqrt(varDataPtr[i]);
scaleParam->biasData[i] = biasDataPtr[i] - slopePtr[i] * meanDataPtr[i] / sqrt_var;
scaleParam->scaleData[i] = slopePtr[i] / sqrt_var;
}
op->type = MNN::OpType_Scale;
op->main.type = MNN::OpParameter_Scale;
op->main.value = scaleParam;
}
}
| 38.665319 | 119 | 0.536506 | loveltyoic |
f68f29acbd82cc84b30bd16c7efba55a367f1f96 | 16,901 | cpp | C++ | validation/val_proj_mgi.cpp | TUW-GEO/OGRSpatialRef3D | eb54378eabb885dd1e13616b2eb6b2bde99d90e2 | [
"MIT"
] | 6 | 2017-05-12T08:18:27.000Z | 2022-01-17T17:16:11.000Z | validation/val_proj_mgi.cpp | TUW-GEO/OGRSpatialRef3D | eb54378eabb885dd1e13616b2eb6b2bde99d90e2 | [
"MIT"
] | 1 | 2019-03-07T15:25:14.000Z | 2019-03-07T15:25:14.000Z | validation/val_proj_mgi.cpp | TUW-GEO/OGRSpatialRef3D | eb54378eabb885dd1e13616b2eb6b2bde99d90e2 | [
"MIT"
] | 1 | 2019-03-05T05:18:51.000Z | 2019-03-05T05:18:51.000Z | #include <iostream>
#include "validate.h"
#include "ogr_spatialref3D.h"
using namespace std;
void proj_mgi_to_geoc_etrs()
{
double *r0 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r1 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r2 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r3 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r4 = (double*)CPLMalloc(sizeof(double)*num_data);
OGRSpatialReference3D oSourceSRS_28, oSourceSRS_31, oSourceSRS_34, oTargetSRS;
cout << "----------------[ S -> T ]-----------------------" << endl;
cout << "Source coord.: MGI (PROJ) + In-use Height" << endl;
cout << "Target coord.: ETRS89 (GEOC)" << endl;
cout << "-------------------------------------------------" << endl;
char *wkt2 = loadWktFile(GEOC_ETRS);
oTargetSRS.importFromWkt3D(&(wkt2));
char *wkt1 = loadWktFile(PROJ_MGI_28);
oSourceSRS_28.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_31);
oSourceSRS_31.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_34);
oSourceSRS_34.importFromWkt3D(&(wkt1));
oSourceSRS_28.SetDebug(true);
oSourceSRS_31.SetDebug(true);
oSourceSRS_34.SetDebug(true);
OGRCoordinateTransformation3D *poCT_28 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_28, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_31 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_31, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_34 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_34, &oTargetSRS );
if( poCT_28 == NULL || poCT_31 == NULL || poCT_34 == NULL )
printf( "Transformaer creation failed.\n" );
else
{
printf( "Transformation successful.\n" );
SummStat err0, err1, err2, err3, err4;
for(int row_number=0; row_number < num_data; row_number++)
{
r0[row_number] = x_gebr[row_number];
r1[row_number] = y_gebr[row_number];
r2[row_number] = h_gebr[row_number];
switch(ms[row_number])
{
case 28:
oSourceSRS_28.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_28->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 31:
oSourceSRS_31.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_31->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 34:
oSourceSRS_34.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_34->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
default:
cerr << "invalid meridian strip value" << endl;
}
err0.add(fabs(r0[row_number]-x_etrs[row_number]));
err1.add(fabs(r1[row_number]-y_etrs[row_number]));
err2.add(fabs(r2[row_number]-z_etrs[row_number]));
err3.add(fabs(r3[row_number]-und_bess[row_number]));
err4.add(fabs(r4[row_number]-ras_val[row_number]));
}
cout << "Error (axis 0) : " << endl; err0.printout();
cout << "Error (axis 1) : " << endl; err1.printout();
cout << "Error (axis 2) : " << endl; err2.printout();
cout << "Error (source geoid undulation) : " << endl; err3.printout();
cout << "Error (source height correction) : " << endl; err4.printout();
}
delete poCT_28;
delete poCT_31;
delete poCT_34;
CPLFree(r0);
CPLFree(r1);
CPLFree(r2);
CPLFree(r3);
CPLFree(r4);
}
void proj_mgi_to_geog_etrs()
{
double *r0 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r1 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r2 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r3 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r4 = (double*)CPLMalloc(sizeof(double)*num_data);
OGRSpatialReference3D oSourceSRS_28, oSourceSRS_31, oSourceSRS_34, oTargetSRS;
cout << "----------------[ S -> T ]-----------------------" << endl;
cout << "Source coord.: MGI (PROJ) + In-use Height" << endl;
cout << "Target coord.: ETRS89 (GEOG) + Ellipsoidal Height" << endl;
cout << "-------------------------------------------------" << endl;
char *wkt2 = loadWktFile(GEOG_ETRS);
oTargetSRS.importFromWkt3D(&(wkt2));
char *wkt1 = loadWktFile(PROJ_MGI_28);
oSourceSRS_28.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_31);
oSourceSRS_31.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_34);
oSourceSRS_34.importFromWkt3D(&(wkt1));
oSourceSRS_28.SetDebug(true);
oSourceSRS_31.SetDebug(true);
oSourceSRS_34.SetDebug(true);
OGRCoordinateTransformation3D *poCT_28 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_28, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_31 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_31, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_34 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_34, &oTargetSRS );
if( poCT_28 == NULL || poCT_31 == NULL || poCT_34 == NULL )
printf( "Transformaer creation failed.\n" );
else
{
printf( "Transformation successful.\n" );
SummStat err0, err1, err2, err3, err4;
for(int row_number=0; row_number < num_data; row_number++)
{
r0[row_number] = x_gebr[row_number];
r1[row_number] = y_gebr[row_number];
r2[row_number] = h_gebr[row_number];
switch(ms[row_number])
{
case 28:
oSourceSRS_28.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_28->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 31:
oSourceSRS_31.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_31->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 34:
oSourceSRS_34.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_34->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
default:
cerr << "invalid meridian strip value" << endl;
}
err0.add(fabs(r0[row_number]-lon_grs[row_number]));
err1.add(fabs(r1[row_number]-lat_grs[row_number]));
err2.add(fabs(r2[row_number]-hell_grs[row_number]));
err3.add(fabs(r3[row_number]-und_bess[row_number]));
err4.add(fabs(r4[row_number]-ras_val[row_number]));
}
cout << "Error (axis 0) : " << endl; err0.printout();
cout << "Error (axis 1) : " << endl; err1.printout();
cout << "Error (axis 2) : " << endl; err2.printout();
cout << "Error (source geoid undulation) : " << endl; err3.printout();
cout << "Error (source height correction) : " << endl; err4.printout();
}
delete poCT_28;
delete poCT_31;
delete poCT_34;
CPLFree(r0);
CPLFree(r1);
CPLFree(r2);
CPLFree(r3);
CPLFree(r4);
}
void proj_mgi_to_geog_etrs_ortho()
{
double *r0 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r1 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r2 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r3 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r4 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r5 = (double*)CPLMalloc(sizeof(double)*num_data);
OGRSpatialReference3D oSourceSRS_28, oSourceSRS_31, oSourceSRS_34, oTargetSRS;
cout << "----------------[ S -> T ]-----------------------" << endl;
cout << "Source coord.: MGI (PROJ) + In-use Height" << endl;
cout << "Target coord.: ETRS89 (GEOG) + Orthometric Height" << endl;
cout << "-------------------------------------------------" << endl;
char *wkt2 = loadWktFile(GEOG_ETRS_ORTH);
oTargetSRS.importFromWkt3D(&(wkt2));
char *wkt1 = loadWktFile(PROJ_MGI_28);
oSourceSRS_28.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_31);
oSourceSRS_31.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_34);
oSourceSRS_34.importFromWkt3D(&(wkt1));
oSourceSRS_28.SetDebug(true);
oSourceSRS_31.SetDebug(true);
oSourceSRS_34.SetDebug(true);
oTargetSRS.SetDebug(true);
OGRCoordinateTransformation3D *poCT_28 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_28, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_31 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_31, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_34 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_34, &oTargetSRS );
if( poCT_28 == NULL || poCT_31 == NULL || poCT_34 == NULL )
printf( "Transformaer creation failed.\n" );
else
{
printf( "Transformation successful.\n" );
SummStat err0, err1, err2, err3, err4, err5;
for(int row_number=0; row_number < num_data; row_number++)
{
r0[row_number] = x_gebr[row_number];
r1[row_number] = y_gebr[row_number];
r2[row_number] = h_gebr[row_number];
oTargetSRS.SetDebugData(&(r5[row_number]), 0);
switch(ms[row_number])
{
case 28:
oSourceSRS_28.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_28->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 31:
oSourceSRS_31.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_31->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 34:
oSourceSRS_34.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_34->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
default:
cerr << "invalid meridian strip value" << endl;
}
err0.add(fabs(r0[row_number]-lon_grs[row_number]));
err1.add(fabs(r1[row_number]-lat_grs[row_number]));
err2.add(fabs(r2[row_number]-h_orth[row_number]));
err3.add(fabs(r3[row_number]-und_bess[row_number]));
err4.add(fabs(r4[row_number]-ras_val[row_number]));
err5.add(fabs(r5[row_number]-und_grs[row_number]));
}
cout << "Error (axis 0) : " << endl; err0.printout();
cout << "Error (axis 1) : " << endl; err1.printout();
cout << "Error (axis 2) : " << endl; err2.printout();
cout << "Error (source geoid undulation) : " << endl; err3.printout();
cout << "Error (source height correction) : " << endl; err4.printout();
cout << "Error (target geoid undulation) : " << endl; err5.printout();
}
delete poCT_28;
delete poCT_31;
delete poCT_34;
CPLFree(r0);
CPLFree(r1);
CPLFree(r2);
CPLFree(r3);
CPLFree(r4);
CPLFree(r5);
}
void proj_mgi_to_geoc_mgi()
{
}
void proj_mgi_to_geog_mgi()
{
double *r0 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r1 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r2 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r3 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r4 = (double*)CPLMalloc(sizeof(double)*num_data);
OGRSpatialReference3D oSourceSRS_28, oSourceSRS_31, oSourceSRS_34, oTargetSRS;
cout << "----------------[ S -> T ]-----------------------" << endl;
cout << "Source coord.: MGI (PROJ) + In-use Height" << endl;
cout << "Target coord.: MGI (GEOG)" << endl;
cout << "-------------------------------------------------" << endl;
char *wkt2 = loadWktFile(GEOG_MGI);
oTargetSRS.importFromWkt3D(&(wkt2));
char *wkt1 = loadWktFile(PROJ_MGI_28);
oSourceSRS_28.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_31);
oSourceSRS_31.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_34);
oSourceSRS_34.importFromWkt3D(&(wkt1));
oSourceSRS_28.SetDebug(true);
oSourceSRS_31.SetDebug(true);
oSourceSRS_34.SetDebug(true);
OGRCoordinateTransformation3D *poCT_28 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_28, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_31 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_31, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_34 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_34, &oTargetSRS );
if( poCT_28 == NULL || poCT_31 == NULL || poCT_34 == NULL )
printf( "Transformaer creation failed.\n" );
else
{
printf( "Transformation successful.\n" );
SummStat err0, err1, err2, err3, err4;
for(int row_number=0; row_number < num_data; row_number++)
{
r0[row_number] = x_gebr[row_number];
r1[row_number] = y_gebr[row_number];
r2[row_number] = h_gebr[row_number];
switch(ms[row_number])
{
case 28:
oSourceSRS_28.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_28->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 31:
oSourceSRS_31.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_31->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 34:
oSourceSRS_34.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_34->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
default:
cerr << "invalid meridian strip value" << endl;
}
err0.add(fabs(r0[row_number]-lon_mgi[row_number]));
err1.add(fabs(r1[row_number]-lat_mgi[row_number]));
err2.add(fabs(r2[row_number]-hell_mgi[row_number]));
err3.add(fabs(r3[row_number]-und_bess[row_number]));
err4.add(fabs(r4[row_number]-ras_val[row_number]));
}
cout << "Error (axis 0) : " << endl; err0.printout();
cout << "Error (axis 1) : " << endl; err1.printout();
cout << "Error (axis 2) : " << endl; err2.printout();
cout << "Error (source geoid undulation) : " << endl; err3.printout();
cout << "Error (source height correction) : " << endl; err4.printout();
}
delete poCT_28;
delete poCT_31;
delete poCT_34;
CPLFree(r0);
CPLFree(r1);
CPLFree(r2);
CPLFree(r3);
CPLFree(r4);
}
void proj_mgi_to_geog_mgi_ortho()
{
double *r0 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r1 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r2 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r3 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r4 = (double*)CPLMalloc(sizeof(double)*num_data);
double *r5 = (double*)CPLMalloc(sizeof(double)*num_data);
OGRSpatialReference3D oSourceSRS_28, oSourceSRS_31, oSourceSRS_34, oTargetSRS;
cout << "----------------[ S -> T ]-----------------------" << endl;
cout << "Source coord.: MGI (PROJ) + In-use Height" << endl;
cout << "Target coord.: MGI (GEOG) + Orthometric Height" << endl;
cout << "-------------------------------------------------" << endl;
char *wkt2 = loadWktFile(GEOG_MGI_ORTH);
oTargetSRS.importFromWkt3D(&(wkt2));
oTargetSRS.SetDebug(true);
char *wkt1 = loadWktFile(PROJ_MGI_28);
oSourceSRS_28.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_31);
oSourceSRS_31.importFromWkt3D(&(wkt1));
wkt1 = loadWktFile(PROJ_MGI_34);
oSourceSRS_34.importFromWkt3D(&(wkt1));
oSourceSRS_28.SetDebug(true);
oSourceSRS_31.SetDebug(true);
oSourceSRS_34.SetDebug(true);
OGRCoordinateTransformation3D *poCT_28 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_28, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_31 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_31, &oTargetSRS );
OGRCoordinateTransformation3D *poCT_34 = OGRCreateCoordinateTransformation3D(
&oSourceSRS_34, &oTargetSRS );
if( poCT_28 == NULL || poCT_31 == NULL || poCT_34 == NULL )
printf( "Transformaer creation failed.\n" );
else
{
printf( "Transformation successful.\n" );
SummStat err0, err1, err2, err3, err4, err5;
for(int row_number=0; row_number < num_data; row_number++)
{
r0[row_number] = x_gebr[row_number];
r1[row_number] = y_gebr[row_number];
r2[row_number] = h_gebr[row_number];
oTargetSRS.SetDebugData(&(r5[row_number]), 0);
switch(ms[row_number])
{
case 28:
oSourceSRS_28.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_28->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 31:
oSourceSRS_31.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_31->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
case 34:
oSourceSRS_34.SetDebugData(&(r3[row_number]), &(r4[row_number]));
poCT_34->Transform( 1, &(r0[row_number]), &(r1[row_number]) ,&(r2[row_number]));
break;
default:
cerr << "invalid meridian strip value" << endl;
}
err0.add(fabs(r0[row_number]-lon_mgi[row_number]));
err1.add(fabs(r1[row_number]-lat_mgi[row_number]));
err2.add(fabs(r2[row_number]-h_orth[row_number]));
err3.add(fabs(r3[row_number]-und_bess[row_number]));
err4.add(fabs(r4[row_number]-ras_val[row_number]));
err5.add(fabs(r5[row_number]-und_bess[row_number]));
}
cout << "Error (axis 0) : " << endl; err0.printout();
cout << "Error (axis 1) : " << endl; err1.printout();
cout << "Error (axis 2) : " << endl; err2.printout();
cout << "Error (source geoid undulation) : " << endl; err3.printout();
cout << "Error (source height correction) : " << endl; err4.printout();
cout << "Error (target geoid undulation) : " << endl; err5.printout();
}
delete poCT_28;
delete poCT_31;
delete poCT_34;
CPLFree(r0);
CPLFree(r1);
CPLFree(r2);
CPLFree(r3);
CPLFree(r4);
CPLFree(r5);
}
void val_proj_mgi()
{
proj_mgi_to_geoc_etrs();
proj_mgi_to_geog_etrs();
proj_mgi_to_geog_etrs_ortho();
proj_mgi_to_geoc_mgi();
proj_mgi_to_geog_mgi();
proj_mgi_to_geog_mgi_ortho();
} | 33.401186 | 84 | 0.666292 | TUW-GEO |
f68f92b1fda57e49b024b497d31673a960eaddac | 1,915 | cpp | C++ | HDUOJ/5749 .cpp | LzyRapx/Competitive-Programming | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | 81 | 2018-06-03T04:27:45.000Z | 2020-09-13T09:04:12.000Z | HDUOJ/5749 .cpp | Walkerlzy/Competitive-algorithm | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | null | null | null | HDUOJ/5749 .cpp | Walkerlzy/Competitive-algorithm | 6b0eea727f9a6444700a6966209397ac7011226f | [
"Apache-2.0"
] | 21 | 2018-07-11T04:02:38.000Z | 2020-07-18T20:31:14.000Z | //#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<string.h>
#include<algorithm>
#define N 1010
using namespace std;
int n,m;
int a[N][N];
int stk[N],top;
int L[N][N],R[N][N],U[N][N],D[N][N];
int readint()
{
char c;
while((c=getchar())&&!(c>='0' && c<='9'));
int ret= c- 48;
while((c=getchar())&&( c>='0' && c<='9'))
ret = ret * 10 + c-48;
return ret;
}
unsigned int calc(int l,int x,int r)
{
unsigned int d1=r-x+1;
unsigned int d2=x-l+1;
unsigned int ret=d1 * (d1+1) / 2 * d2 + d2* (d2-1)/2 *d1;
return ret;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
a[i][j]=readint();
}
}
for(int i=1;i<=n;i++)
{
top=0;
for(int j=1;j<=m;j++)
{
while(top && a[i][stk[top-1]] > a[i][j])
--top;
if(top==0) L[i][j]=1;
else L[i][j]=stk[top-1]+1;
stk[top++]=j;
}
}
for(int i=1;i<=n;i++)
{
top=0;
for(int j=m;j>=1;--j)
{
while(top && a[i][stk[top-1]] > a[i][j])
--top;
if(top==0) R[i][j]=m;
else R[i][j] = stk[top-1] - 1;
stk[top++] = j;
}
}
for(int i=1;i<=m;i++)
{
top=0;
for(int j=1;j<=n;j++)
{
while(top && a[stk[top-1]][i] < a[j][i])
--top;
if(top==0) U[j][i]=1;
else U[j][i] = stk[top-1]+1;
stk[top++]=j;
}
}
for(int i=1;i<=m;i++)
{
top=0;
for(int j=n;j>=1;--j)
{
while(top && a[stk[top-1]][i] < a[j][i])
--top;
if(top==0) D[j][i]=n;
else D[j][i] = stk[top-1]-1;
stk[top++]=j;
}
}
unsigned int ans=0;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
ans += (unsigned int)a[i][j]*calc(L[i][j],j,R[i][j])*calc(U[i][j],i,D[i][j]);
}
}
printf("%u\n",ans);
}
return 0;
} | 18.592233 | 82 | 0.423499 | LzyRapx |
f68fef444c5cfdd733f080da6c77f65262d5e99b | 7,592 | cpp | C++ | Patches/2TBHardDriveFix.cpp | TheMachineAmbassador/Silent-Hill-2-Enhancements | 41650db4a97ca6085db69446e7a20042b344e77f | [
"Zlib"
] | null | null | null | Patches/2TBHardDriveFix.cpp | TheMachineAmbassador/Silent-Hill-2-Enhancements | 41650db4a97ca6085db69446e7a20042b344e77f | [
"Zlib"
] | null | null | null | Patches/2TBHardDriveFix.cpp | TheMachineAmbassador/Silent-Hill-2-Enhancements | 41650db4a97ca6085db69446e7a20042b344e77f | [
"Zlib"
] | null | null | null | /**
* Copyright (C) 2022 Elisha Riedlinger
*
* 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.
*/
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include "Patches.h"
#include "Common\Utils.h"
#include "Logging\Logging.h"
typedef int(__cdecl *oTextToGameAsmProc)(unsigned __int16* a1, unsigned __int16 a2);
// Forward declarations
DWORD GetDiskSpace();
// Variables
bool DiskSizeSet = false;
char szNewFreeSpaceString[MAX_PATH] = { '\0' };
// Variables for ASM
void *jmpSkipDisk;
void *jmpNewSaveReturnAddr;
void *jmpHardDriveReturnAddr;
void *jmpSkipDisplay;
void *jmpDisplayReturnAddr;
void *jmpRemoveKBAddr;
// ASM function to update 2TB disk limit
__declspec(naked) void __stdcall HardDriveASM()
{
__asm
{
push eax
push ebx
push ecx
push edx
push esi
push edi
call GetDiskSpace
cmp eax, 0x08 // Require at least 8KBs of disk space
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
ja near EnoughDiskSpace
jmp jmpSkipDisk
EnoughDiskSpace:
jmp jmpHardDriveReturnAddr
}
}
// ASM function for new save
__declspec(naked) void __stdcall NewSaveASM()
{
__asm
{
push eax
push ebx
push ecx
push edx
push esi
push edi
call GetDiskSpace
cmp eax, 0x20 // Require at least 32KBs of disk space for new save
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
ja near EnoughDiskSpace
jmp HardDriveASM
EnoughDiskSpace:
jmp jmpNewSaveReturnAddr
}
}
// ASM function to update hard disk display
__declspec(naked) void __stdcall DisplayASM()
{
__asm
{
push eax
push ebx
push ecx
push edx
push esi
push edi
call GetDiskSpace
cmp eax, 0x3FFFFFFF
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
jb near SmallDiskSpace
jmp jmpSkipDisplay
SmallDiskSpace:
cmp esi, 0x3B9AC9FF
jmp jmpDisplayReturnAddr
}
}
// ASM function to update 2TB disk limit
__declspec(naked) void __stdcall oTextToGameAsm()
{
__asm
{
mov eax, dword ptr ss : [esp + 4]
test eax, eax
jmp jmpRemoveKBAddr
}
}
oTextToGameAsmProc oTextToGame = (oTextToGameAsmProc)oTextToGameAsm;
// Remove "KB" text
int __cdecl TextToGame(unsigned __int16* a1, unsigned __int16 a2)
{
int TTG = oTextToGame(a1, a2);
if (a2 == 147)
{
BYTE RemoveKBPatch[2] = { 0x00, 0x00 };
UpdateMemoryAddress((BYTE*)(TTG + 0x11), RemoveKBPatch, 2);
}
return TTG;
}
// Get amount of free disk space in KBs, greater than 0x7FFFFFFF will simply return 0x7FFFFFFF
DWORD GetDiskSpace()
{
static wchar_t DirectoryName[MAX_PATH] = { '\0' };
static bool GetFolder = true;
if (GetFolder)
{
if (GetSH2FolderPath(DirectoryName, MAX_PATH) && wcsrchr(DirectoryName, '\\'))
{
wcscpy_s(wcsrchr(DirectoryName, '\\'), MAX_PATH - wcslen(DirectoryName), L"\0");
}
GetFolder = false;
}
ULARGE_INTEGER FreeBytesAvailableToCaller = { NULL };
if (!GetDiskFreeSpaceEx(DirectoryName, &FreeBytesAvailableToCaller, nullptr, nullptr))
{
RUNCODEONCE(Logging::Log() << __FUNCTION__ << " Error: failed to get available disk space!");
DiskSizeSet = false;
return NULL;
}
DiskSizeSet = true;
if (FreeBytesAvailableToCaller.QuadPart < 0xF4240)
{
_snprintf_s(szNewFreeSpaceString, MAX_PATH, _TRUNCATE, "\\h%f KB", (double)FreeBytesAvailableToCaller.QuadPart);
}
else if (FreeBytesAvailableToCaller.QuadPart / 1024 < 0xF4240)
{
_snprintf_s(szNewFreeSpaceString, MAX_PATH, _TRUNCATE, "\\h%f MB", (double)FreeBytesAvailableToCaller.QuadPart / 1024.0f / 1024.0f);
}
else if (FreeBytesAvailableToCaller.QuadPart / 1024 < 0x3B9ACA00)
{
_snprintf_s(szNewFreeSpaceString, MAX_PATH, _TRUNCATE, "\\h%.1f GB", (double)FreeBytesAvailableToCaller.QuadPart / 1024.0f / 1024.0f / 1024.0f);
}
else if (FreeBytesAvailableToCaller.QuadPart / 1024 >= 0x3B9ACA00)
{
_snprintf_s(szNewFreeSpaceString, MAX_PATH, _TRUNCATE, "\\h%.2f TB", (double)FreeBytesAvailableToCaller.QuadPart / 1024.0f / 1024.0f / 1024.0f / 1024.0f);
}
ULONGLONG FreeSpace = FreeBytesAvailableToCaller.QuadPart / 1024;
if (FreeSpace > 0x7FFFFFFF)
{
RUNCODEONCE(Logging::Log() << __FUNCTION__ << " Available disk space larger than 2TBs: " << FreeSpace);
return 0x7FFFFFFF; // Largest unsigned number
}
RUNCODEONCE(Logging::Log() << __FUNCTION__ << " Available disk space smaller than 2TBs: " << FreeSpace);
return (DWORD)(FreeSpace);
}
// sprintf replacement for printing diskspace
int PrintFreeDiskSpace(char* Buffer, const char* a1, ...)
{
if (Buffer == nullptr || a1 == nullptr)
{
return sprintf(Buffer, a1);
}
char FullMessageBufferReturn[MAX_PATH] = { 0 };
va_list vaReturn;
va_start(vaReturn, a1);
_vsnprintf_s(FullMessageBufferReturn, MAX_PATH, _TRUNCATE, a1, vaReturn);
va_end(vaReturn);
if (DiskSizeSet)
{
return sprintf(Buffer, szNewFreeSpaceString);
}
else
{
strcat_s(FullMessageBufferReturn, MAX_PATH, " KB");
return sprintf(Buffer, FullMessageBufferReturn);
}
}
// Patch SH2 code to Fix 2TB disk limit
void Patch2TBHardDrive()
{
// 2TB disk check fix
constexpr BYTE HardDriveSearchBytes[]{ 0x75, 0x08, 0x5F, 0xB8, 0x02, 0x00, 0x00, 0x00, 0x5E, 0xC3, 0x84, 0xDB, 0x75, 0x14, 0x83, 0xFE, 0x20, 0x7C, 0x0F };
DWORD HardDriveAddr = SearchAndGetAddresses(0x0044B86E, 0x0044BA0E, 0x0044BA0E, HardDriveSearchBytes, sizeof(HardDriveSearchBytes), 0x22);
// Checking address pointer
if (!HardDriveAddr)
{
Logging::Log() << __FUNCTION__ << " Error: failed to find memory address!";
return;
}
jmpSkipDisk = (void*)(HardDriveAddr + 0x1A);
jmpHardDriveReturnAddr = (void*)(HardDriveAddr + 0x05);
jmpNewSaveReturnAddr = (void*)(HardDriveAddr - 0x0F);
// Disk display fix
constexpr BYTE DisplaySearchBytes[]{ 0x8B, 0xF0, 0x83, 0xC4, 0x04, 0x85, 0xF6, 0x7D, 0x02, 0x33, 0xF6, 0x6A, 0x00 };
DWORD DisplayFix = SearchAndGetAddresses(0x0044FB54, 0x0044FDB4, 0x0044FDB4, DisplaySearchBytes, sizeof(DisplaySearchBytes), 0x1A);
constexpr BYTE RemoveKBSearchBytes[]{ 0x8B, 0x44, 0x24, 0x04, 0x85, 0xC0, 0x74, 0x16, 0x66, 0x8B, 0x4C, 0x24, 0x08 };
DWORD RemoveKBAddr = SearchAndGetAddresses(0x0047EC60, 0x0047EF00, 0x0047F110, RemoveKBSearchBytes, sizeof(RemoveKBSearchBytes), 0x0);
// Checking address pointer
if (!DisplayFix || !RemoveKBAddr)
{
Logging::Log() << __FUNCTION__ << " Error: failed to find memory address!";
return;
}
jmpSkipDisplay = (void*)(DisplayFix + 0x08);
jmpDisplayReturnAddr = (void*)(DisplayFix + 0x06);
jmpRemoveKBAddr = (void*)(RemoveKBAddr + 6);
DWORD sprintfAddr = DisplayFix + 0x42;
// Update SH2 code
Logging::Log() << "Setting 2TB hard disk Fix...";
WriteJMPtoMemory((BYTE*)(HardDriveAddr - 0x14), *NewSaveASM, 5);
WriteJMPtoMemory((BYTE*)HardDriveAddr, *HardDriveASM, 5);
WriteJMPtoMemory((BYTE*)DisplayFix, *DisplayASM, 6);
WriteCalltoMemory((BYTE*)sprintfAddr, *PrintFreeDiskSpace, 6);
WriteJMPtoMemory((BYTE*)RemoveKBAddr, *TextToGame, 6);
}
| 28.01476 | 156 | 0.730374 | TheMachineAmbassador |
f69670e9bba94a0940efdd396cccc78b1f376b25 | 568 | hpp | C++ | bolt/server/include/azure_handler.hpp | gamunu/bolt | c1a2956f02656f3ec2c244486a816337126905ae | [
"Apache-2.0"
] | 1 | 2022-03-06T09:23:56.000Z | 2022-03-06T09:23:56.000Z | bolt/server/include/azure_handler.hpp | gamunu/bolt | c1a2956f02656f3ec2c244486a816337126905ae | [
"Apache-2.0"
] | 3 | 2021-04-23T18:12:20.000Z | 2021-04-23T18:12:47.000Z | bolt/server/include/azure_handler.hpp | gamunu/bolt | c1a2956f02656f3ec2c244486a816337126905ae | [
"Apache-2.0"
] | null | null | null | #pragma once
#include <azure_entity.h>
#include <cpprest/http_msg.h>
#include <cpprest/json.h>
#include <permissions.hpp>
using namespace web;
using namespace bolt::storage;
class AzureHandler
{
public:
AzureHandler(const http::http_request &request, http::method method);
void InitializeHandlers();
void HandleGet();
void HandlePost();
void HandleDelete();
void HandlePatch();
private:
void insetKeyValuePropery(boltazure::AzureEntity &entity, utility::string_t key, json::value value);
const http::http_request &m_http_request;
http::method m_method;
}; | 23.666667 | 101 | 0.767606 | gamunu |
f69ac45c71395e427977c247d919709b180a7add | 8,054 | cc | C++ | processors/IA32/bochs/cpu/ret_far.cc | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 445 | 2016-06-30T08:19:11.000Z | 2022-03-28T06:09:49.000Z | processors/IA32/bochs/cpu/ret_far.cc | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 439 | 2016-06-29T20:14:36.000Z | 2022-03-17T19:59:58.000Z | processors/IA32/bochs/cpu/ret_far.cc | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 137 | 2016-07-02T17:32:07.000Z | 2022-03-20T11:17:25.000Z | ////////////////////////////////////////////////////////////////////////
// $Id: ret_far.cc,v 1.20 2008/06/13 08:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005 Stanislav Shwartsman
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
//
// 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; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0
// Make life easier merging cpu64 & cpu code.
#define RIP EIP
#define RSP ESP
#endif
void BX_CPP_AttrRegparmN(2)
BX_CPU_C::return_protected(bxInstruction_c *i, Bit16u pop_bytes)
{
Bit16u raw_cs_selector, raw_ss_selector;
bx_selector_t cs_selector, ss_selector;
bx_descriptor_t cs_descriptor, ss_descriptor;
Bit32u stack_param_offset;
bx_address return_RIP, return_RSP, temp_RSP;
Bit32u dword1, dword2;
/* + 6+N*2: SS | +12+N*4: SS | +24+N*8 SS */
/* + 4+N*2: SP | + 8+N*4: ESP | +16+N*8 RSP */
/* parm N | + parm N | + parm N */
/* parm 3 | + parm 3 | + parm 3 */
/* parm 2 | + parm 2 | + parm 2 */
/* + 4: parm 1 | + 8: parm 1 | +16: parm 1 */
/* + 2: CS | + 4: CS | + 8: CS */
/* + 0: IP | + 0: EIP | + 0: RIP */
#if BX_SUPPORT_X86_64
if (StackAddrSize64()) temp_RSP = RSP;
else
#endif
{
if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b) temp_RSP = ESP;
else temp_RSP = SP;
}
#if BX_SUPPORT_X86_64
if (i->os64L()) {
raw_cs_selector = (Bit16u) read_virtual_qword_64(BX_SEG_REG_SS, temp_RSP + 8);
return_RIP = read_virtual_qword_64(BX_SEG_REG_SS, temp_RSP);
stack_param_offset = 16;
}
else
#endif
if (i->os32L()) {
raw_cs_selector = (Bit16u) read_virtual_dword(BX_SEG_REG_SS, temp_RSP + 4);
return_RIP = read_virtual_dword(BX_SEG_REG_SS, temp_RSP);
stack_param_offset = 8;
}
else {
raw_cs_selector = read_virtual_word(BX_SEG_REG_SS, temp_RSP + 2);
return_RIP = read_virtual_word(BX_SEG_REG_SS, temp_RSP);
stack_param_offset = 4;
}
// selector must be non-null else #GP(0)
if ((raw_cs_selector & 0xfffc) == 0) {
BX_ERROR(("return_protected: CS selector null"));
exception(BX_GP_EXCEPTION, 0, 0);
}
parse_selector(raw_cs_selector, &cs_selector);
// selector index must be within its descriptor table limits,
// else #GP(selector)
fetch_raw_descriptor(&cs_selector, &dword1, &dword2, BX_GP_EXCEPTION);
// descriptor AR byte must indicate code segment, else #GP(selector)
parse_descriptor(dword1, dword2, &cs_descriptor);
// return selector RPL must be >= CPL, else #GP(return selector)
if (cs_selector.rpl < CPL) {
BX_ERROR(("return_protected: CS.rpl < CPL"));
exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
}
// check code-segment descriptor
check_cs(&cs_descriptor, raw_cs_selector, 0, cs_selector.rpl);
// if return selector RPL == CPL then
// RETURN TO SAME PRIVILEGE LEVEL
if (cs_selector.rpl == CPL)
{
BX_DEBUG(("return_protected: return to SAME PRIVILEGE LEVEL"));
branch_far64(&cs_selector, &cs_descriptor, return_RIP, CPL);
#if BX_SUPPORT_X86_64
if (StackAddrSize64())
RSP += stack_param_offset + pop_bytes;
else
#endif
{
if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b)
RSP = ESP + stack_param_offset + pop_bytes;
else
SP += stack_param_offset + pop_bytes;
}
return;
}
/* RETURN TO OUTER PRIVILEGE LEVEL */
else {
/* + 6+N*2: SS | +12+N*4: SS | +24+N*8 SS */
/* + 4+N*2: SP | + 8+N*4: ESP | +16+N*8 RSP */
/* parm N | + parm N | + parm N */
/* parm 3 | + parm 3 | + parm 3 */
/* parm 2 | + parm 2 | + parm 2 */
/* + 4: parm 1 | + 8: parm 1 | +16: parm 1 */
/* + 2: CS | + 4: CS | + 8: CS */
/* + 0: IP | + 0: EIP | + 0: RIP */
BX_DEBUG(("return_protected: return to OUTER PRIVILEGE LEVEL"));
#if BX_SUPPORT_X86_64
if (i->os64L()) {
raw_ss_selector = read_virtual_word_64(BX_SEG_REG_SS, temp_RSP + 24 + pop_bytes);
return_RSP = read_virtual_qword_64(BX_SEG_REG_SS, temp_RSP + 16 + pop_bytes);
}
else
#endif
if (i->os32L()) {
raw_ss_selector = read_virtual_word(BX_SEG_REG_SS, temp_RSP + 12 + pop_bytes);
return_RSP = read_virtual_dword(BX_SEG_REG_SS, temp_RSP + 8 + pop_bytes);
}
else {
raw_ss_selector = read_virtual_word(BX_SEG_REG_SS, temp_RSP + 6 + pop_bytes);
return_RSP = read_virtual_word(BX_SEG_REG_SS, temp_RSP + 4 + pop_bytes);
}
/* selector index must be within its descriptor table limits,
* else #GP(selector) */
parse_selector(raw_ss_selector, &ss_selector);
if ((raw_ss_selector & 0xfffc) == 0) {
if (long_mode()) {
if (! IS_LONG64_SEGMENT(cs_descriptor) || (cs_selector.rpl == 3)) {
BX_ERROR(("return_protected: SS selector null"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
else // not in long or compatibility mode
{
BX_ERROR(("return_protected: SS selector null"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
fetch_raw_descriptor(&ss_selector, &dword1, &dword2, BX_GP_EXCEPTION);
parse_descriptor(dword1, dword2, &ss_descriptor);
/* selector RPL must = RPL of the return CS selector,
* else #GP(selector) */
if (ss_selector.rpl != cs_selector.rpl) {
BX_ERROR(("return_protected: ss.rpl != cs.rpl"));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
}
/* descriptor AR byte must indicate a writable data segment,
* else #GP(selector) */
if (ss_descriptor.valid==0 || ss_descriptor.segment==0 ||
IS_CODE_SEGMENT(ss_descriptor.type) ||
!IS_DATA_SEGMENT_WRITEABLE(ss_descriptor.type))
{
BX_ERROR(("return_protected: SS.AR byte not writable data"));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
}
/* descriptor dpl must = RPL of the return CS selector,
* else #GP(selector) */
if (ss_descriptor.dpl != cs_selector.rpl) {
BX_ERROR(("return_protected: SS.dpl != cs.rpl"));
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
}
/* segment must be present else #SS(selector) */
if (! IS_PRESENT(ss_descriptor)) {
BX_ERROR(("return_protected: ss.present == 0"));
exception(BX_SS_EXCEPTION, raw_ss_selector & 0xfffc, 0);
}
branch_far64(&cs_selector, &cs_descriptor, return_RIP, cs_selector.rpl);
/* load SS:SP from stack */
/* load SS-cache with return SS descriptor */
load_ss(&ss_selector, &ss_descriptor, cs_selector.rpl);
#if BX_SUPPORT_X86_64
if (StackAddrSize64())
RSP = return_RSP + pop_bytes;
else
#endif
if (ss_descriptor.u.segment.d_b)
RSP = (Bit32u) return_RSP + pop_bytes;
else
SP = (Bit16u) return_RSP + pop_bytes;
/* check ES, DS, FS, GS for validity */
validate_seg_regs();
}
}
| 35.480176 | 88 | 0.610256 | pavel-krivanek |
f69e781bf8eb0f31d0eea18483a411b14900b2ef | 293 | cpp | C++ | 27-remove-element/27-remove-element.cpp | Edith-panda/leetcode | 175b4cbcd25b95b4863d793c876719eabb94dafc | [
"Apache-2.0"
] | null | null | null | 27-remove-element/27-remove-element.cpp | Edith-panda/leetcode | 175b4cbcd25b95b4863d793c876719eabb94dafc | [
"Apache-2.0"
] | null | null | null | 27-remove-element/27-remove-element.cpp | Edith-panda/leetcode | 175b4cbcd25b95b4863d793c876719eabb94dafc | [
"Apache-2.0"
] | null | null | null | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int n = nums.size();
int k{0};
for(int i=0;i<n;i++){
if(nums[i] != val){
nums[k] = nums[i];
k++;
}
}
return k;
}
}; | 20.928571 | 51 | 0.375427 | Edith-panda |
f69eb41d92b39972d172e2b3a5de6be6635dcd0d | 2,956 | cpp | C++ | HugeCTR/src/model_oversubscriber/parameter_server.cpp | xmh645214784/HugeCTR-1 | de4e850ef9993998c3a69ff1f2af64bed528989f | [
"Apache-2.0"
] | null | null | null | HugeCTR/src/model_oversubscriber/parameter_server.cpp | xmh645214784/HugeCTR-1 | de4e850ef9993998c3a69ff1f2af64bed528989f | [
"Apache-2.0"
] | null | null | null | HugeCTR/src/model_oversubscriber/parameter_server.cpp | xmh645214784/HugeCTR-1 | de4e850ef9993998c3a69ff1f2af64bed528989f | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (c) 2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <model_oversubscriber/parameter_server.hpp>
#include <fstream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
namespace HugeCTR {
namespace {
void open_and_get_size(const std::string& file_name, std::ifstream& stream,
size_t& file_size_in_byte) {
stream.open(file_name, std::ifstream::binary);
if (!stream.is_open()) {
CK_THROW_(Error_t::WrongInput, "Cannot open the file: " + file_name);
}
file_size_in_byte = fs::file_size(file_name);
}
} // namespace
template <typename TypeKey>
ParameterServer<TypeKey>::ParameterServer(bool use_host_ps,
const std::string &sparse_model_file, Embedding_t embedding_type,
size_t emb_vec_size, std::shared_ptr<ResourceManager> resource_manager)
: use_host_ps_(use_host_ps),
sparse_model_entity_(SparseModelEntity<TypeKey>(use_host_ps,
sparse_model_file, embedding_type, emb_vec_size, resource_manager)) {}
template <typename TypeKey>
void ParameterServer<TypeKey>::load_keyset_from_file(
std::string keyset_file) {
try {
std::ifstream keyset_stream;
size_t file_size_in_byte = 0;
open_and_get_size(keyset_file, keyset_stream, file_size_in_byte);
if (file_size_in_byte == 0) {
CK_THROW_(Error_t::WrongInput, std::string(keyset_file) + " is empty");
}
size_t num_keys_in_file = file_size_in_byte / sizeof(TypeKey);
keyset_.resize(num_keys_in_file);
keyset_stream.read((char*)keyset_.data(), file_size_in_byte);
#ifdef ENABLE_MPI
CK_MPI_THROW_(MPI_Barrier(MPI_COMM_WORLD));
#endif
} catch (const internal_runtime_error& rt_err) {
std::cerr << rt_err.what() << std::endl;
throw;
} catch (const std::exception& err) {
std::cerr << err.what() << std::endl;
throw;
}
}
template <typename TypeKey>
void ParameterServer<TypeKey>::pull(BufferBag& buf_bag, size_t& hit_size) {
if (keyset_.size() == 0) {
CK_THROW_(Error_t::WrongInput, "keyset is empty");
}
sparse_model_entity_.load_vec_by_key(keyset_, buf_bag, hit_size);
}
template <typename TypeKey>
void ParameterServer<TypeKey>::push(BufferBag &buf_bag, size_t dump_size) {
if (dump_size == 0) return;
sparse_model_entity_.dump_vec_by_key(buf_bag, dump_size);
}
template class ParameterServer<long long>;
template class ParameterServer<unsigned>;
} // namespace HugeCTR
| 32.130435 | 77 | 0.734777 | xmh645214784 |
f6a011cd5857a6a1ecd43ba20c536bc22ff0ff91 | 19,031 | cxx | C++ | osprey/be/lno/lego_skew.cxx | sharugupta/OpenUH | daddd76858a53035f5d713f648d13373c22506e8 | [
"BSD-2-Clause"
] | null | null | null | osprey/be/lno/lego_skew.cxx | sharugupta/OpenUH | daddd76858a53035f5d713f648d13373c22506e8 | [
"BSD-2-Clause"
] | null | null | null | osprey/be/lno/lego_skew.cxx | sharugupta/OpenUH | daddd76858a53035f5d713f648d13373c22506e8 | [
"BSD-2-Clause"
] | null | null | null | /*
* Copyright (C) 2009 Advanced Micro Devices, Inc. All Rights Reserved.
*/
/*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU General Public License along
with this program; if not, write the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston MA 02111-1307, USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifdef USE_PCH
#include "lno_pch.h"
#endif // USE_PCH
#pragma hdrstop
#ifdef _KEEP_RCS_ID
/*REFERENCED*/
static char *rcs_id = "$Source$ $Revision$";
#endif /* _KEEP_RCS_ID */
#include <sys/types.h>
#include <ctype.h>
#include <limits.h>
#include <alloca.h>
#include "pu_info.h"
#include "lnoutils.h"
#include "lnopt_main.h"
#include "stab.h"
#include "targ_const.h"
#include "wn_simp.h"
#include "stdlib.h"
#include "lwn_util.h"
#include "strtab.h"
#include "config.h"
#include "optimizer.h"
#include "opt_du.h"
#include "name.h"
#include "wintrinsic.h"
#include "lno_bv.h"
#include "dep_graph.h"
#include "debug.h"
#include "cxx_memory.h"
#include "lego_pragma.h"
#include "lego_util.h"
#include "lego_skew.h"
#include "tlog.h"
//-----------------------------------------------------------------------
// NAME: Lego_Reshaped_Array
// FUNCTION: Returns TRUE if the OPR_ARRAY node 'wn_array' is a lego
// reshaped array, FALSE otherwise.
//-----------------------------------------------------------------------
static BOOL Lego_Reshaped_Array(WN* wn_array)
{
if (WN_operator(wn_array) != OPR_ARRAY)
return FALSE;
ST* st_array;
WN *array_base = WN_array_base(wn_array);
st_array = (WN_has_sym(array_base) ? WN_st(array_base) : NULL);
DISTR_ARRAY* dact = Lookup_DACT(st_array);
if (dact == NULL || !dact->Dinfo()->IsReshaped())
return FALSE;
return TRUE;
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Canonical
// FUNCTION: Returns TRUE if the access vector is canonical with respect
// to the loop 'wn_loop'. Right now, this means that it has the form
// 'c1*i+x-c2' where "i" is the index variable of 'wn_loop', "x" is some
// linear combination of loop invariant variables, and "c1" and "c2" are
// literal constants. Also, "c1" must be either 1 or -1.
//-----------------------------------------------------------------------
static BOOL Lego_Skew_Canonical(WN* wn_loop,
ACCESS_VECTOR* av)
{
if (av->Too_Messy)
return FALSE;
if (av->Contains_Non_Lin_Symb())
return FALSE;
if (!av->Has_Loop_Coeff())
return FALSE;
INT loop_depth = Do_Depth(wn_loop);
INT loop_coeff = av->Loop_Coeff(loop_depth);
if (loop_coeff != 1 && loop_coeff != -1)
return FALSE;
for (INT i = 0; i < av->Nest_Depth(); i++)
if (i != loop_depth && av->Loop_Coeff(i) != 0)
return FALSE;
if (!av->Contains_Lin_Symb())
return FALSE;
return TRUE;
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Equivalent
// FUNCTION: Returns TRUE if the canonical access vectors 'av1' and 'av2'
// are equivalent. Right now, this means that their linear portions are
// equivalent and the coefficients corresponding to 'wn_loop' are equal.
//-----------------------------------------------------------------------
static BOOL Lego_Skew_Equivalent(WN* wn_loop,
ACCESS_VECTOR* av1,
ACCESS_VECTOR* av2)
{
if (av1->Loop_Coeff(Do_Depth(wn_loop)) != av2->Loop_Coeff(Do_Depth(wn_loop)))
return FALSE;
INTSYMB_LIST* isl = NULL;
isl = Subtract(av1->Lin_Symb, av2->Lin_Symb, &LNO_local_pool);
if (isl != NULL)
return FALSE;
return TRUE;
}
//-----------------------------------------------------------------------
// NAME: Lego_Update_Skew_Count
// FUNCTION: For the given array 'wn_array' with respect to the loop
// 'wn_loop', enter all canonical skew accesses into separate buckets
// of 'st_skew'.
//-----------------------------------------------------------------------
static void Lego_Update_Skew_Count(WN* wn_loop,
WN* wn_array,
STACK<LEGO_SKEW*>* st_skew)
{
DISTR_ARRAY* dact = Lookup_DACT(WN_has_sym(WN_array_base(wn_array)) ?
WN_st(WN_array_base(wn_array)) :
NULL);
ACCESS_ARRAY *aa = (ACCESS_ARRAY *) WN_MAP_Get(LNO_Info_Map, wn_array);
if (aa == NULL || aa->Too_Messy)
return;
for (INT i = 0; i < aa->Num_Vec(); i++) {
ACCESS_VECTOR* av = aa->Dim(i);
if (Lego_Skew_Canonical(wn_loop, av)) {
INT j;
for (j = 0; j < st_skew->Elements(); j++) {
LEGO_SKEW* lsk = st_skew->Bottom_nth(j);
ST* st_old = (WN_has_sym(WN_array_base(lsk->Array())) ?
WN_st(WN_array_base(lsk->Array())) :
NULL);
DISTR_ARRAY* dact_old = Lookup_DACT(st_old);
if (dact->DACT_Equiv(dact_old, i, lsk->Dim())
&& Lego_Skew_Equivalent(wn_loop, av, lsk->Av())) {
lsk->Increment();
break;
}
}
if (j == st_skew->Elements()) {
LEGO_SKEW* lsk_new = CXX_NEW(LEGO_SKEW(av, wn_array, i, 1),
&LNO_default_pool);
st_skew->Push(lsk_new);
}
}
}
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Offset
// FUNCTION: Returns a WN* to an expression tree corresponding to the
// LEGO_SKEW 'lsk'.
//-----------------------------------------------------------------------
static WN* Lego_Skew_Offset(LEGO_SKEW* lsk,
BOOL negative_stride,
DU_MANAGER* du)
{
WN* wn_skew = NULL;
INTSYMB_CONST_ITER iter(lsk->Av()->Lin_Symb);
const INTSYMB_NODE *first = iter.First();
for (const INTSYMB_NODE *node=first; !iter.Is_Empty(); node = iter.Next()) {
WN* wn_variable = Find_Node(node->Symbol, lsk->Array());
WN* wn_constant = LWN_Make_Icon(WN_rtype(wn_variable), node->Coeff);
WN* wn_varcopy = LWN_Copy_Tree(wn_variable);
LWN_Copy_Def_Use(wn_variable, wn_varcopy, du);
OPCODE op_mpy = OPCODE_make_op(OPR_MPY, WN_rtype(wn_variable), MTYPE_V);
WN* wn_prod = LWN_CreateExp2(op_mpy, wn_constant, wn_varcopy);
if (wn_skew == NULL) {
wn_skew = wn_prod;
} else {
TYPE_ID type_add = Max_Wtype(WN_rtype(wn_skew), WN_rtype(wn_prod));
OPCODE op_add = OPCODE_make_op(OPR_ADD, type_add, MTYPE_V);
wn_skew = LWN_CreateExp2(op_add, wn_skew, wn_prod);
}
}
if (negative_stride) {
WN* wn_minusone = LWN_Make_Icon(WN_rtype(wn_skew), -1);
OPCODE op_mpy = OPCODE_make_op(OPR_MPY, WN_rtype(wn_skew), MTYPE_V);
wn_skew = LWN_CreateExp2(op_mpy, wn_minusone, wn_skew);
}
return wn_skew;
}
//-----------------------------------------------------------------------
// NAME: Lego_Loop_Want_Skew
// FUNCTION: Returns TRUE if we would like to skew the indices of the
// loop 'wn_loop'.
// NOTE: On exit, the value of the skew factor is copied back into
// 'wn_lego_skew_addr'.
//-----------------------------------------------------------------------
static BOOL Lego_Loop_Want_Skew(WN* wn_loop,
WN** wn_lego_skew_addr,
DU_MANAGER* du)
{
*wn_lego_skew_addr = NULL;
WN* wn_step = Loop_Step(wn_loop);
if (WN_operator(wn_step) != OPR_INTCONST)
return FALSE;
if (WN_const_val(wn_step) != 1)
return FALSE;
if (!Upper_Bound_Standardize(WN_end(wn_loop), TRUE))
return FALSE;
STACK<LEGO_SKEW*> st_skew(&LNO_local_pool);
LWN_ITER* itr = LWN_WALK_TreeIter(WN_do_body(wn_loop));
for (; itr != NULL; itr = LWN_WALK_TreeNext(itr)) {
WN* wn = itr->wn;
if (Lego_Reshaped_Array(wn))
Lego_Update_Skew_Count(wn_loop, wn, &st_skew);
}
if (st_skew.Elements() == 0)
return FALSE;
LEGO_SKEW* lsk_best = st_skew.Bottom_nth(0);
for (INT i = 1; i < st_skew.Elements(); i++) {
LEGO_SKEW* lsk = st_skew.Bottom_nth(i);
if (lsk->Count() > lsk_best->Count())
lsk_best = lsk;
}
BOOL negative_stride = lsk_best->Av()->Loop_Coeff(Do_Depth(wn_loop)) < 0;
*wn_lego_skew_addr = Lego_Skew_Offset(lsk_best, negative_stride, du);
return TRUE;
}
//-----------------------------------------------------------------------
// NAME: Lego_Parent_Array
// FUNCTION: Returns the closest enclosing OPR_ARRAY node which is a
// parent of 'wn_node'. Returns NULL if there is none.
//-----------------------------------------------------------------------
static WN* Lego_Parent_Array(WN* wn_node)
{
for (WN* wn = wn_node; wn != NULL; wn = LWN_Get_Parent(wn))
if (WN_operator(wn) == OPR_ARRAY)
return wn;
return NULL;
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Index
// FUNCTION: Returns an expression 'index - offset' where "index"
// is the index variable of 'wn_loop' and "offset" is the expression
// in 'wn_lego_skew_offset'.
//-----------------------------------------------------------------------
static WN* Lego_Skew_Index(WN* wn_loop,
WN* wn_lego_skew_offset,
DU_MANAGER* du)
{
TYPE_ID type = Promote_Type(Do_Wtype(wn_loop));
WN* wn_index = UBvar(WN_end(wn_loop));
WN* wn_index_copy = LWN_Copy_Tree(wn_index);
LWN_Copy_Def_Use(wn_index, wn_index_copy, du);
WN* wn_ldid = LWN_Copy_Tree(wn_lego_skew_offset);
LWN_Copy_Def_Use(wn_lego_skew_offset, wn_ldid, du);
OPCODE op = OPCODE_make_op(OPR_SUB, type, MTYPE_V);
WN* wn_skew = LWN_CreateExp2(op, wn_index_copy, wn_ldid);
return wn_skew;
}
//-----------------------------------------------------------------------
// NAME: Lego_Contains_Non_Index_Ldid
// FUNCTION: Returns TRUE if the expression 'wn_index' contains an LDID
// of a symbol other than the index variable of 'wn_loop', FALSE
// otherwise.
//-----------------------------------------------------------------------
static BOOL Lego_Contains_Non_Index_Ldid(WN* wn_loop,
WN* wn_index)
{
LWN_ITER* itr = LWN_WALK_TreeIter(wn_index);
for (; itr != NULL; itr = LWN_WALK_TreeNext(itr)) {
WN* wn = itr->wn;
if (WN_operator(wn) == OPR_LDID
&& SYMBOL(wn) != SYMBOL(WN_index(wn_loop)))
return TRUE;
}
return FALSE;
}
//-----------------------------------------------------------------------
// NAME: Lego_Index_From_Access_Vector
// FUNCTION: Returns a WN* to an expression equivalent to the access
// vector 'av'. The expressions value should be equivalent to that
// in 'wn_index'.
//-----------------------------------------------------------------------
static WN* Lego_Index_From_Access_Vector(ACCESS_VECTOR* av,
WN* wn_index,
DU_MANAGER* du)
{
WN* wn_new_index = NULL;
for (INT i = 0; i < av->Nest_Depth(); i++) {
if (av->Loop_Coeff(i) == 0)
continue;
WN* wn = 0;
for (wn = wn_index; wn != NULL; wn = LWN_Get_Parent(wn))
if (WN_opcode(wn) == OPC_DO_LOOP && Do_Depth(wn) == i)
break;
FmtAssert(wn != NULL, ("Could not find do loop with given depth"));
OPCODE op_ldid = Matching_Load_Opcode(WN_opcode(WN_start(wn)));
WN* wn_ldid = LWN_CreateLdid(op_ldid, WN_start(wn));
du->Add_Def_Use(WN_start(wn), wn_ldid);
du->Add_Def_Use(WN_step(wn), wn_ldid);
du->Ud_Get_Def(wn_ldid)->Set_loop_stmt(wn);
WN* wn_constant = LWN_Make_Icon(WN_rtype(wn_ldid), av->Loop_Coeff(i));
OPCODE op_mpy = OPCODE_make_op(OPR_MPY, WN_rtype(wn_ldid), MTYPE_V);
WN* wn_prod = LWN_CreateExp2(op_mpy, wn_constant, wn_ldid);
if (wn_new_index == NULL) {
wn_new_index = wn_prod;
} else {
TYPE_ID type_add = Max_Wtype(WN_rtype(wn_ldid), WN_rtype(wn_new_index));
OPCODE op_add = OPCODE_make_op(OPR_ADD, type_add, MTYPE_V);
wn_new_index = LWN_CreateExp2(op_add, wn_new_index, wn_prod);
}
}
if (av->Const_Offset != 0) {
if (wn_new_index == 0) {
wn_new_index = LWN_Make_Icon(av->Const_Offset, WN_rtype(wn_index));
} else {
WN* wn_offset = LWN_Make_Icon(WN_rtype(wn_new_index), av->Const_Offset);
OPCODE op_add = OPCODE_make_op(OPR_ADD, WN_rtype(wn_new_index), MTYPE_V);
wn_new_index = LWN_CreateExp2(op_add, wn_new_index, wn_offset);
}
}
return wn_new_index;
}
//-----------------------------------------------------------------------
// NAME: Lego_Simplify
// FUNCTION: Simplify the subscripts of the array expression 'wn_loop'
// which contain the index variable of loop 'wn_loop' if their access
// vectors contain only index variables and constants and if the
// subscripts also contain other symbols.
//-----------------------------------------------------------------------
static void Lego_Simplify(WN* wn_loop,
WN* wn_array,
DU_MANAGER* du)
{
ACCESS_ARRAY *aa = (ACCESS_ARRAY *) WN_MAP_Get(LNO_Info_Map, wn_array);
if (aa == NULL || aa->Too_Messy)
return;
INT loop_depth = Do_Depth(wn_loop);
INT i;
for (i = 0; i < aa->Num_Vec(); i++)
if (aa->Dim(i)->Delinearized_Symbol != NULL)
return;
for (i = 0; i < aa->Num_Vec(); i++) {
ACCESS_VECTOR* av = aa->Dim(i);
if (av->Too_Messy)
continue;
INT loop_coeff = av->Loop_Coeff(loop_depth);
if (av->Loop_Coeff(loop_depth)== 0 || av->Contains_Non_Lin_Symb())
continue;
if (av->Contains_Lin_Symb())
continue;
WN* wn_index = WN_array_index(wn_array, i);
if (!Lego_Contains_Non_Index_Ldid(wn_loop, wn_index))
continue;
WN* wn_new_index = Lego_Index_From_Access_Vector(av, wn_index, du);
Replace_Wnexp_With_Exp_Copy(wn_index, wn_new_index, du);
LWN_Delete_Tree(wn_new_index);
}
}
//-----------------------------------------------------------------------
// NAME: Lego_Simplify_Loop
// FUNCTION: Simplify the subscripts of array elements in 'wn_loop' using
// access vectors.
//-----------------------------------------------------------------------
static void Lego_Simplify_Loop(WN* wn_loop,
DU_MANAGER* du)
{
LWN_ITER* itr = LWN_WALK_TreeIter(WN_do_body(wn_loop));
for (; itr != NULL; itr = LWN_WALK_TreeNext(itr)) {
WN* wn = itr->wn;
if (WN_operator(wn) == OPR_ARRAY)
Lego_Simplify(wn_loop, wn, du);
}
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Loop
// FUNCTION: Skew the loop 'wn_loop' by subtracting 'wn_lego_skew_index'
// from each instance of the index variable of 'wn_loop' and adding the
// same value to the loop bounds.
//-----------------------------------------------------------------------
static void Lego_Skew_Loop(WN* wn_loop,
WN* wn_lego_skew_offset,
DU_MANAGER* du)
{
if (LNO_Verbose) {
fprintf(stdout, "Lego skewing loop %s on line %d\n",
WB_Whirl_Symbol(wn_loop), Srcpos_To_Line(WN_linenum(wn_loop)));
fprintf(TFile, "Lego skewing loop %s on line %d\n",
WB_Whirl_Symbol(wn_loop), Srcpos_To_Line(WN_linenum(wn_loop)));
if (LNO_Tlog)
Generate_Tlog("LNO", "lego_skewing", Srcpos_To_Line(WN_linenum(wn_loop)),
(char *) WB_Whirl_Symbol(wn_loop), "", "", "");
}
if (Index_Variable_Live_At_Exit(wn_loop))
Finalize_Index_Variable(wn_loop, TRUE, TRUE);
TYPE_ID type = Promote_Type(Do_Wtype(wn_loop));
OPCODE op_skew = OPCODE_make_op(OPR_ADD, type, MTYPE_V);
LWN_ITER* itr = LWN_WALK_TreeIter(WN_do_body(wn_loop));
STACK<WN*> index_stack(&LNO_local_pool);
for (; itr != NULL; itr = LWN_WALK_TreeNext(itr)) {
WN* wn = itr->wn;
if (WN_operator(wn) == OPR_LDID
&& SYMBOL(wn) == SYMBOL(WN_index(wn_loop)))
index_stack.Push(wn);
}
INT i;
for (i = 0; i < index_stack.Elements(); i++) {
WN* wn = index_stack.Bottom_nth(i);
WN* wn_array = Lego_Parent_Array(wn);
WN* wn_new_index = Lego_Skew_Index(wn_loop, wn_lego_skew_offset, du);
Replace_Wnexp_With_Exp_Copy(wn, wn_new_index, du);
if (wn_array != NULL)
LWN_Simplify_Tree(wn_array);
LWN_Delete_Tree(wn_new_index);
}
WN* wn_start = WN_kid0(WN_start(wn_loop));
WN* wn_stop = UBexp(WN_end(wn_loop));
for (i = 0; i < WN_kid_count(WN_end(wn_loop)); i++)
if (WN_kid(WN_end(wn_loop), i) == wn_stop)
break;
INT stop_index = i;
WN* wn_skew = LWN_Copy_Tree(wn_lego_skew_offset);
LWN_Copy_Def_Use(wn_lego_skew_offset, wn_skew, du);
WN* wn_new_start = LWN_CreateExp2(op_skew, wn_start, wn_skew);
wn_skew = LWN_Copy_Tree(wn_lego_skew_offset);
LWN_Copy_Def_Use(wn_lego_skew_offset, wn_skew, du);
WN* wn_new_stop = LWN_CreateExp2(op_skew, wn_stop, wn_skew);
WN_kid0(WN_start(wn_loop)) = wn_new_start;
LWN_Set_Parent(wn_new_start, WN_start(wn_loop));
WN_kid(WN_end(wn_loop), stop_index) = wn_new_stop;
LWN_Set_Parent(wn_new_stop, WN_end(wn_loop));
LWN_Delete_Tree(wn_lego_skew_offset);
DOLOOP_STACK shortstack(&LNO_local_pool);
Build_Doloop_Stack(LWN_Get_Parent(wn_loop), &shortstack);
LNO_Build_Access(wn_loop, &shortstack, &LNO_default_pool, 0, TRUE);
Lego_Simplify_Loop(wn_loop, du);
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Traverse
// FUNCTION: Traverse 'wn_tree' preforming lego skewing on loops for
// which is it appropriate.
//-----------------------------------------------------------------------
static void Lego_Skew_Traverse(WN* wn_tree,
DU_MANAGER* du)
{
if (WN_opcode(wn_tree) == OPC_DO_LOOP) {
WN* wn_lego_skew_offset = NULL;
if (Lego_Loop_Want_Skew(wn_tree, &wn_lego_skew_offset, du))
Lego_Skew_Loop(wn_tree, wn_lego_skew_offset, du);
}
if (WN_opcode(wn_tree) == OPC_BLOCK) {
for (WN* wn = WN_first(wn_tree); wn != NULL; wn = WN_next(wn))
Lego_Skew_Traverse(wn, du);
} else {
for (INT i = 0; i < WN_kid_count(wn_tree); i++)
Lego_Skew_Traverse(WN_kid(wn_tree, i), du);
}
}
//-----------------------------------------------------------------------
// NAME: Lego_Skew_Indices
// FUNCTION: Apply lego skewing to all appropriate loops in the tree
// 'wn_tree'.
//-----------------------------------------------------------------------
extern void Lego_Skew_Indices(WN* wn_tree)
{
DU_MANAGER* du = Du_Mgr;
Lego_Skew_Traverse(wn_tree, du);
}
| 36.249524 | 79 | 0.600967 | sharugupta |
f6a5c9741de6bc6238efa71d1d0ea5f395a11da3 | 382 | hpp | C++ | endscreen.hpp | hckr/space-logic-adventure | 7465c7ffb70b0488ce4ff88620e3d35742f4fb06 | [
"MIT"
] | 6 | 2017-09-15T16:15:03.000Z | 2020-01-09T04:31:26.000Z | endscreen.hpp | hckr/space-logic-adventure | 7465c7ffb70b0488ce4ff88620e3d35742f4fb06 | [
"MIT"
] | null | null | null | endscreen.hpp | hckr/space-logic-adventure | 7465c7ffb70b0488ce4ff88620e3d35742f4fb06 | [
"MIT"
] | 1 | 2017-12-05T05:22:02.000Z | 2017-12-05T05:22:02.000Z | #pragma once
#include "screen.hpp"
class EndScreen : public Screen
{
sf::Sprite &background_sp;
public:
EndScreen(const sf::Font &font, sf::Sprite &background_sp, const sf::Color &fillColor, const sf::Color &outlineColor);
virtual void processEvent(const sf::Event &event);
private:
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const;
};
| 23.875 | 122 | 0.722513 | hckr |
f6a792c580f12c591efe40f0c0b6d102af530cee | 6,230 | cpp | C++ | Ch17_Any/any.cpp | jamcodes/Cpp17CompleteGuide | a21ca5c3f5069b501cd650aa62e5e623bd2c953b | [
"Unlicense"
] | 3 | 2020-10-03T05:51:00.000Z | 2021-08-24T07:45:28.000Z | Ch17_Any/any.cpp | jamcodes/Cpp17CompleteGuide | a21ca5c3f5069b501cd650aa62e5e623bd2c953b | [
"Unlicense"
] | null | null | null | Ch17_Any/any.cpp | jamcodes/Cpp17CompleteGuide | a21ca5c3f5069b501cd650aa62e5e623bd2c953b | [
"Unlicense"
] | null | null | null | #include <any>
#include <complex>
#include <iostream>
#include <string>
#include <type_traits>
#include <utility>
/**
* C++17 adds `std::any` - a value type that's able to change its type, but while still having
* type safety. std::any accepts an arbitrary type - it holds the contained value and the
* `typeid` of its type - thus there's both a size and a runtime cost, including the possibility
* that std::any might allocate - the implementation should be able to hold small type like int
* without allocating, but larger type (larger than a pointer, two pointers?) will be allocated
* on the heap.
* The underlying type can be checked by comparing against typeid(T),
* value can be accessed via std::any_cast<T>
*/
/*
| Operation | Effect |
| ------------- | ----------------------------------------------------------------- |
| constructors | Create an any object (might call constructor for underlying type) |
| make_any() | Create an any object (passing value(s) to initialize it) |
| destructor | Destroys an any object |
| = | Assign a new value |
| emplace<T>() | Assign a new value having the type T |
| reset() | Destroys any value (makes the object empty) |
| has_value() | Returns whether the object has a value |
| type() | Returns the current type as std::type_info object |
| any_cast<T>() | Use current value as value of type T (exception if other type) |
| swap() | Swaps values between two objects |
*/
int main()
{
// --- construction
// - initialized empty by default, .type() of an empty std::any is equal to typeid(void)
{
std::any a{}; // empty
if (a.type() == typeid(void)) {
std::cerr << "std::any{}.type() == typeid(void)\n";
}
// deduce the type by direct initialization or assignment, deduced type decays
std::any a1{42};
if (a1.type() == typeid(int)) {
std::cerr << "std::any{42}.type() == typeid(int)\n";
}
std::any a2 = "hello any!";
if (a2.type() == typeid(char const*)) {
std::cerr << "std::any{\"hello any!\"} == typeid(char const*)\n";
}
// std::in_place_type can be used for construction, it allows to specify the type
// directly, and avoids copy/move
std::any a3{std::in_place_type<std::string>, "hello any!"};
// note that even the type passed to std::in_place_type decays!
std::any a4{std::in_place_type<char const[6]>, "Hello"};
if (a4.type() == typeid(char const*)) {
std::cerr << "std::any{std::in_place_type<char const[6]>{'hello'} == typeid(char "
"const*) -> decays!\n";
}
// std::make_any - always have to specify the type, also decays
auto a5 = std::make_any<long>(42);
auto a6 = std::make_any<std::string>("hello make_any!");
}
// --- assignment
// values can be assigned using operator=() or .emplace<T>
{
std::any a{};
a = 42; // .type() == typeid(int)
// .emplace()
a.emplace<std::string>("hello emplace");
if (a.type() == typeid(std::string)) {
std::cerr << "a.emplace<std::string> -> value == "
<< std::any_cast<std::string const&>(a) << "\n";
}
// .reset() - makes the std::any empty
a.reset();
if (a.type() == typeid(void)) {
std::cerr << "std::any empty after .reset() -> .type() == typeid(void)\n";
}
}
// --- value access
// check if holds a value using .has_value()
// check type of value using .type() -> std::type_info -> compare against typeid(T)
// access using std::any_cast<T> -> throws std::bad_any_cast if doesn't hold a value
// of the requested type. Can cast to references or pointers
{
std::any a{42};
// casting to an unqualified type, returns by value - copy
auto i = std::any_cast<int>(a);
std::cerr << "std::any holds an int value = " << i << "\n";
a.emplace<std::string>("Hello any_cast");
// we might want to avoid a copy by casting to a const&:
auto const& scr = std::any_cast<std::string const&>(a);
std::cerr << "std::any_cast<std::string const&>(a) = " << scr << "\n";
// casting to a non-const allows us to assign to the value held:
std::any_cast<std::string&>(a) = "Update using any_cast";
std::cerr << "std::any after update, value = " << std::any_cast<std::string const&>(a)
<< "\n";
// We can also move assign the same way
std::string s{"move assign using any_cast"};
std::any_cast<std::string&>(a) = std::move(s);
// using std::any_cast on a pointer to std::any returns a pointer to the held value,
// if the actual type matches the requested type, or nullptr if it doesn't
// this might be a convenient option instead of explicitly checking .type()
// Cast to type `T` when using this from,
// attempting to cast to `T*` will result in the implementation assuming that you're
// expecting the held type to be `T*` (and not `T`)
// attempting to cast to `T&` is an error
auto pi = std::any_cast<int>(&a); // returns nullptr, would throw if used on ref to any
auto ps = std::any_cast<std::string const>(&a); // returns pointer to std::string
if (pi != nullptr ){
std::cerr << "std::any_cast<int>(&a) returned a valid pointer, value = " << *pi << "\n";
}
else {
std::cerr << "std::any_cast<int>(&a) returned a nullptr\n";
}
if (ps != nullptr) {
std::cerr << "std::any_cast<std::string>(&a) returned a valid pointer, value = "
<< *ps << "\n";
}
else {
std::cerr << "std::any_cast<std::string>(&a) returned a nullptr\n";
}
}
}
| 47.557252 | 100 | 0.539165 | jamcodes |
f6a8f77ef303928846e002771b03a2ea9d99d7ba | 3,964 | cpp | C++ | samples/snippets/cpp/VS_Snippets_CLR_System/system.Threading.WaitHandle.SignalAndWait/CPP/source.cpp | hamarb123/dotnet-api-docs | 6aeb55784944a2f1f5e773b657791cbd73a92dd4 | [
"CC-BY-4.0",
"MIT"
] | 421 | 2018-04-01T01:57:50.000Z | 2022-03-28T15:24:42.000Z | samples/snippets/cpp/VS_Snippets_CLR_System/system.Threading.WaitHandle.SignalAndWait/CPP/source.cpp | hamarb123/dotnet-api-docs | 6aeb55784944a2f1f5e773b657791cbd73a92dd4 | [
"CC-BY-4.0",
"MIT"
] | 5,797 | 2018-04-02T21:12:23.000Z | 2022-03-31T23:54:38.000Z | samples/snippets/cpp/VS_Snippets_CLR_System/system.Threading.WaitHandle.SignalAndWait/CPP/source.cpp | hamarb123/dotnet-api-docs | 6aeb55784944a2f1f5e773b657791cbd73a92dd4 | [
"CC-BY-4.0",
"MIT"
] | 1,482 | 2018-03-31T11:26:20.000Z | 2022-03-30T22:36:45.000Z | //<Snippet1>
using namespace System;
using namespace System::Threading;
public ref class Example
{
private:
// The EventWaitHandle used to demonstrate the difference
// between AutoReset and ManualReset synchronization events.
//
static EventWaitHandle^ ewh;
// A counter to make sure all threads are started and
// blocked before any are released. A Long is used to show
// the use of the 64-bit Interlocked methods.
//
static __int64 threadCount = 0;
// An AutoReset event that allows the main thread to block
// until an exiting thread has decremented the count.
//
static EventWaitHandle^ clearCount =
gcnew EventWaitHandle( false,EventResetMode::AutoReset );
public:
[MTAThread]
static void main()
{
// Create an AutoReset EventWaitHandle.
//
ewh = gcnew EventWaitHandle( false,EventResetMode::AutoReset );
// Create and start five numbered threads. Use the
// ParameterizedThreadStart delegate, so the thread
// number can be passed as an argument to the Start
// method.
for ( int i = 0; i <= 4; i++ )
{
Thread^ t = gcnew Thread(
gcnew ParameterizedThreadStart( ThreadProc ) );
t->Start( i );
}
// Wait until all the threads have started and blocked.
// When multiple threads use a 64-bit value on a 32-bit
// system, you must access the value through the
// Interlocked class to guarantee thread safety.
//
while ( Interlocked::Read( threadCount ) < 5 )
{
Thread::Sleep( 500 );
}
// Release one thread each time the user presses ENTER,
// until all threads have been released.
//
while ( Interlocked::Read( threadCount ) > 0 )
{
Console::WriteLine( L"Press ENTER to release a waiting thread." );
Console::ReadLine();
// SignalAndWait signals the EventWaitHandle, which
// releases exactly one thread before resetting,
// because it was created with AutoReset mode.
// SignalAndWait then blocks on clearCount, to
// allow the signaled thread to decrement the count
// before looping again.
//
WaitHandle::SignalAndWait( ewh, clearCount );
}
Console::WriteLine();
// Create a ManualReset EventWaitHandle.
//
ewh = gcnew EventWaitHandle( false,EventResetMode::ManualReset );
// Create and start five more numbered threads.
//
for ( int i = 0; i <= 4; i++ )
{
Thread^ t = gcnew Thread(
gcnew ParameterizedThreadStart( ThreadProc ) );
t->Start( i );
}
// Wait until all the threads have started and blocked.
//
while ( Interlocked::Read( threadCount ) < 5 )
{
Thread::Sleep( 500 );
}
// Because the EventWaitHandle was created with
// ManualReset mode, signaling it releases all the
// waiting threads.
//
Console::WriteLine( L"Press ENTER to release the waiting threads." );
Console::ReadLine();
ewh->Set();
}
static void ThreadProc( Object^ data )
{
int index = static_cast<Int32>(data);
Console::WriteLine( L"Thread {0} blocks.", data );
// Increment the count of blocked threads.
Interlocked::Increment( threadCount );
// Wait on the EventWaitHandle.
ewh->WaitOne();
Console::WriteLine( L"Thread {0} exits.", data );
// Decrement the count of blocked threads.
Interlocked::Decrement( threadCount );
// After signaling ewh, the main thread blocks on
// clearCount until the signaled thread has
// decremented the count. Signal it now.
//
clearCount->Set();
}
};
//</Snippet1>
| 31.460317 | 76 | 0.590565 | hamarb123 |
f6a952885326d1669197397be784d58e1b05c496 | 2,463 | cpp | C++ | rmw_coredx_cpp/src/rmw_send_response.cpp | rupertholman/rmw_coredx | 1c97655212bfa90b1353f019ae08e8b2c487db8d | [
"Apache-2.0"
] | null | null | null | rmw_coredx_cpp/src/rmw_send_response.cpp | rupertholman/rmw_coredx | 1c97655212bfa90b1353f019ae08e8b2c487db8d | [
"Apache-2.0"
] | null | null | null | rmw_coredx_cpp/src/rmw_send_response.cpp | rupertholman/rmw_coredx | 1c97655212bfa90b1353f019ae08e8b2c487db8d | [
"Apache-2.0"
] | null | null | null | // Copyright 2015 Twin Oaks Computing, Inc.
// Modifications copyright (C) 2017-2018 Twin Oaks Computing, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifdef CoreDX_GLIBCXX_USE_CXX11_ABI_ZERO
#define _GLIBCXX_USE_CXX11_ABI 0
#endif
#include <rmw/rmw.h>
#include <rmw/types.h>
#include <rmw/allocators.h>
#include <rmw/error_handling.h>
#include <rmw/impl/cpp/macros.hpp>
#include <dds/dds.hh>
#include <dds/dds_builtinDataReader.hh>
#include "rmw_coredx_cpp/identifier.hpp"
#include "rmw_coredx_types.hpp"
#include "util.hpp"
#if defined(__cplusplus)
extern "C" {
#endif
/* ************************************************
*/
rmw_ret_t
rmw_send_response( const rmw_service_t * service,
rmw_request_id_t * ros_request_header,
void * ros_response )
{
if (!service) {
RMW_SET_ERROR_MSG("service handle is null");
return RMW_RET_ERROR;
}
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
service handle,
service->implementation_identifier, toc_coredx_identifier,
return RMW_RET_ERROR)
if (!ros_request_header) {
RMW_SET_ERROR_MSG("ros request header handle is null");
return RMW_RET_ERROR;
}
if (!ros_response) {
RMW_SET_ERROR_MSG("ros response handle is null");
return RMW_RET_ERROR;
}
CoreDXStaticServiceInfo * service_info =
static_cast<CoreDXStaticServiceInfo *>(service->data);
if (!service_info) {
RMW_SET_ERROR_MSG("service info handle is null");
return RMW_RET_ERROR;
}
void * replier = service_info->replier_;
if (!replier) {
RMW_SET_ERROR_MSG("replier handle is null");
return RMW_RET_ERROR;
}
const service_type_support_callbacks_t * callbacks = service_info->callbacks_;
if (!callbacks) {
RMW_SET_ERROR_MSG("callbacks handle is null");
return RMW_RET_ERROR;
}
callbacks->send_response(replier, ros_request_header, ros_response);
return RMW_RET_OK;
}
#if defined(__cplusplus)
}
#endif
| 27.366667 | 80 | 0.710922 | rupertholman |
f6a9ee0167f5639b7b97c28fce5f0bd35fa9ca19 | 999 | hpp | C++ | src/transmission/reliable/containers/connection_list_vector.hpp | rnascunha/coap-te | eaff16162b1a524ad06e18dbdc79ca4c8658b3a8 | [
"MIT"
] | null | null | null | src/transmission/reliable/containers/connection_list_vector.hpp | rnascunha/coap-te | eaff16162b1a524ad06e18dbdc79ca4c8658b3a8 | [
"MIT"
] | null | null | null | src/transmission/reliable/containers/connection_list_vector.hpp | rnascunha/coap-te | eaff16162b1a524ad06e18dbdc79ca4c8658b3a8 | [
"MIT"
] | null | null | null | #ifndef COAP_TE_TRANSMISSION_RELIABLE_CONNECTION_LIST_VECTOR_HPP__
#define COAP_TE_TRANSMISSION_RELIABLE_CONNECTION_LIST_VECTOR_HPP__
#include "defines/defaults.hpp"
#include <vector>
namespace CoAP{
namespace Transmission{
namespace Reliable{
#if COAP_TE_RELIABLE_CONNECTION == 1
template<typename Connection>
class connection_list_vector{
public:
using connection_t = Connection;
using handler = typename Connection::handler;
connection_list_vector();
Connection* find(handler socket) noexcept;
Connection* find_free_slot() noexcept;
void close(handler socket) noexcept;
void close_all() noexcept;
Connection* operator[](unsigned index) noexcept;
unsigned ocupied() const noexcept;
unsigned size() const noexcept;
private:
std::vector<Connection> nodes_;
};
#endif /* COAP_TE_RELIABLE_CONNECTION == 1 */
}//CoAP
}//Transmission
}//Reliable
#include "impl/connection_list_vector_impl.hpp"
#endif /* COAP_TE_TRANSMISSION_RELIABLE_CONNECTION_LIST_VECTOR_HPP__ */
| 22.704545 | 71 | 0.795796 | rnascunha |
f6adb26915396c08b1ef61a8f04e435af4cf441b | 2,503 | cpp | C++ | src/libv/update/resource_server/resource_server_state.cpp | cpplibv/libv | 293e382f459f0acbc540de8ef6283782b38d2e63 | [
"Zlib"
] | 2 | 2018-04-11T03:07:03.000Z | 2019-03-29T15:24:12.000Z | src/libv/update/resource_server/resource_server_state.cpp | cpplibv/libv | 293e382f459f0acbc540de8ef6283782b38d2e63 | [
"Zlib"
] | null | null | null | src/libv/update/resource_server/resource_server_state.cpp | cpplibv/libv | 293e382f459f0acbc540de8ef6283782b38d2e63 | [
"Zlib"
] | 1 | 2021-06-13T06:39:06.000Z | 2021-06-13T06:39:06.000Z | // Project: libv.update, File: src/libv/update/resource_server/resource_server_state.cpp, Author: Császár Mátyás [Vader]
// hpp
#include <libv/update/resource_server/resource_server_state.lpp>
// libv
//#include <libv/mt/worker_thread_pool.hpp>
#include <libv/algo/linear_find.hpp>
// pro
//#include <libv/update/log.hpp>
//#include <libv/update/resource_server/resource_file.lpp>
//#include <libv/update/resource_server/resource_peer.lpp>
namespace libv {
namespace update {
// -------------------------------------------------------------------------------------------------
void ServerState::join(libv::net::mtcp::Connection<ResourcePeer> peer) {
const auto lock = std::unique_lock(mutex);
if (active_peers.size() < settings_.limit_peer_count_active || settings_.limit_peer_count_active == 0) {
active_peers.emplace(peer);
return;
}
if (queued_peers.size() < settings_.limit_peer_count_queue || settings_.limit_peer_count_queue == 0) {
queued_peers.emplace_back(peer);
return;
}
// peer.connection().send_async(codec.encode(ResponseBusy(load_trend.busy_time())));
}
// void ServerState::inactivity_scan() {
// const auto now = std::chrono::system_clock::now();
//// const auto limit =
//// for (const auto& peer : active_peers)
//// if (peer->last_activity + settings.kick_inactivity_time > now)
//// erase(peer);
// io_context.execute_async([this] {
// inactivity_scan();
// });
// }
void ServerState::leave(libv::net::mtcp::Connection<ResourcePeer> peer) {
const auto lock = std::unique_lock(mutex);
const auto ita = active_peers.find(peer);
if (ita != active_peers.end()) {
// Active peer disconnecting
active_peers.erase(peer);
if (!queued_peers.empty()) {
const auto active_peer_limit_reached = active_peers.size() >= settings_.limit_peer_count_active && settings_.limit_peer_count_active != 0;
if (!active_peer_limit_reached) {
active_peers.emplace(queued_peers.front());
queued_peers.pop_front();
}
}
} else {
// Queued peer disconnecting
queued_peers.erase(libv::linear_find_iterator(queued_peers, peer));
}
}
void ServerState::disconnect_all() {
const auto lock = std::unique_lock(mutex);
for (const auto& peer : queued_peers)
peer.connection().cancel_and_disconnect_async();
for (const auto& peer : active_peers)
peer.connection().cancel_and_disconnect_async();
}
// -------------------------------------------------------------------------------------------------
} // namespace update
} // namespace libv
| 30.901235 | 141 | 0.669996 | cpplibv |
f6b4e82a88ed97388d7b516986ff163a97040535 | 11,683 | cpp | C++ | lldb/source/Target/UnixSignals.cpp | lforg37/sycl | 0804265491788808e1218dbda086c22ecc971ac2 | [
"Apache-2.0"
] | null | null | null | lldb/source/Target/UnixSignals.cpp | lforg37/sycl | 0804265491788808e1218dbda086c22ecc971ac2 | [
"Apache-2.0"
] | null | null | null | lldb/source/Target/UnixSignals.cpp | lforg37/sycl | 0804265491788808e1218dbda086c22ecc971ac2 | [
"Apache-2.0"
] | null | null | null | //===-- UnixSignals.cpp ---------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "lldb/Target/UnixSignals.h"
#include "Plugins/Process/Utility/FreeBSDSignals.h"
#include "Plugins/Process/Utility/LinuxSignals.h"
#include "Plugins/Process/Utility/MipsLinuxSignals.h"
#include "Plugins/Process/Utility/NetBSDSignals.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Utility/ArchSpec.h"
using namespace lldb_private;
UnixSignals::Signal::Signal(const char *name, bool default_suppress,
bool default_stop, bool default_notify,
const char *description, const char *alias)
: m_name(name), m_alias(alias), m_description(),
m_suppress(default_suppress), m_stop(default_stop),
m_notify(default_notify) {
if (description)
m_description.assign(description);
}
lldb::UnixSignalsSP UnixSignals::Create(const ArchSpec &arch) {
const auto &triple = arch.GetTriple();
switch (triple.getOS()) {
case llvm::Triple::Linux: {
switch (triple.getArch()) {
case llvm::Triple::mips:
case llvm::Triple::mipsel:
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
return std::make_shared<MipsLinuxSignals>();
default:
return std::make_shared<LinuxSignals>();
}
}
case llvm::Triple::FreeBSD:
case llvm::Triple::OpenBSD:
return std::make_shared<FreeBSDSignals>();
case llvm::Triple::NetBSD:
return std::make_shared<NetBSDSignals>();
default:
return std::make_shared<UnixSignals>();
}
}
lldb::UnixSignalsSP UnixSignals::CreateForHost() {
static lldb::UnixSignalsSP s_unix_signals_sp =
Create(HostInfo::GetArchitecture());
return s_unix_signals_sp;
}
// UnixSignals constructor
UnixSignals::UnixSignals() { Reset(); }
UnixSignals::UnixSignals(const UnixSignals &rhs) : m_signals(rhs.m_signals) {}
UnixSignals::~UnixSignals() = default;
void UnixSignals::Reset() {
// This builds one standard set of Unix Signals. If yours aren't quite in
// this order, you can either subclass this class, and use Add & Remove to
// change them or you can subclass and build them afresh in your constructor.
//
// Note: the signals below are the Darwin signals. Do not change these!
m_signals.clear();
// clang-format off
// SIGNO NAME SUPPRESS STOP NOTIFY DESCRIPTION
// ====== ============ ======== ====== ====== ===================================================
AddSignal(1, "SIGHUP", false, true, true, "hangup");
AddSignal(2, "SIGINT", true, true, true, "interrupt");
AddSignal(3, "SIGQUIT", false, true, true, "quit");
AddSignal(4, "SIGILL", false, true, true, "illegal instruction");
AddSignal(5, "SIGTRAP", true, true, true, "trace trap (not reset when caught)");
AddSignal(6, "SIGABRT", false, true, true, "abort()");
AddSignal(7, "SIGEMT", false, true, true, "pollable event");
AddSignal(8, "SIGFPE", false, true, true, "floating point exception");
AddSignal(9, "SIGKILL", false, true, true, "kill");
AddSignal(10, "SIGBUS", false, true, true, "bus error");
AddSignal(11, "SIGSEGV", false, true, true, "segmentation violation");
AddSignal(12, "SIGSYS", false, true, true, "bad argument to system call");
AddSignal(13, "SIGPIPE", false, false, false, "write on a pipe with no one to read it");
AddSignal(14, "SIGALRM", false, false, false, "alarm clock");
AddSignal(15, "SIGTERM", false, true, true, "software termination signal from kill");
AddSignal(16, "SIGURG", false, false, false, "urgent condition on IO channel");
AddSignal(17, "SIGSTOP", true, true, true, "sendable stop signal not from tty");
AddSignal(18, "SIGTSTP", false, true, true, "stop signal from tty");
AddSignal(19, "SIGCONT", false, true, true, "continue a stopped process");
AddSignal(20, "SIGCHLD", false, false, false, "to parent on child stop or exit");
AddSignal(21, "SIGTTIN", false, true, true, "to readers process group upon background tty read");
AddSignal(22, "SIGTTOU", false, true, true, "to readers process group upon background tty write");
AddSignal(23, "SIGIO", false, false, false, "input/output possible signal");
AddSignal(24, "SIGXCPU", false, true, true, "exceeded CPU time limit");
AddSignal(25, "SIGXFSZ", false, true, true, "exceeded file size limit");
AddSignal(26, "SIGVTALRM", false, false, false, "virtual time alarm");
AddSignal(27, "SIGPROF", false, false, false, "profiling time alarm");
AddSignal(28, "SIGWINCH", false, false, false, "window size changes");
AddSignal(29, "SIGINFO", false, true, true, "information request");
AddSignal(30, "SIGUSR1", false, true, true, "user defined signal 1");
AddSignal(31, "SIGUSR2", false, true, true, "user defined signal 2");
// clang-format on
}
void UnixSignals::AddSignal(int signo, const char *name, bool default_suppress,
bool default_stop, bool default_notify,
const char *description, const char *alias) {
Signal new_signal(name, default_suppress, default_stop, default_notify,
description, alias);
m_signals.insert(std::make_pair(signo, new_signal));
++m_version;
}
void UnixSignals::RemoveSignal(int signo) {
collection::iterator pos = m_signals.find(signo);
if (pos != m_signals.end())
m_signals.erase(pos);
++m_version;
}
const char *UnixSignals::GetSignalAsCString(int signo) const {
collection::const_iterator pos = m_signals.find(signo);
if (pos == m_signals.end())
return nullptr;
else
return pos->second.m_name.GetCString();
}
bool UnixSignals::SignalIsValid(int32_t signo) const {
return m_signals.find(signo) != m_signals.end();
}
ConstString UnixSignals::GetShortName(ConstString name) const {
if (name)
return ConstString(name.GetStringRef().substr(3)); // Remove "SIG" from name
return name;
}
int32_t UnixSignals::GetSignalNumberFromName(const char *name) const {
ConstString const_name(name);
collection::const_iterator pos, end = m_signals.end();
for (pos = m_signals.begin(); pos != end; pos++) {
if ((const_name == pos->second.m_name) ||
(const_name == pos->second.m_alias) ||
(const_name == GetShortName(pos->second.m_name)) ||
(const_name == GetShortName(pos->second.m_alias)))
return pos->first;
}
const int32_t signo =
StringConvert::ToSInt32(name, LLDB_INVALID_SIGNAL_NUMBER, 0);
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
return signo;
return LLDB_INVALID_SIGNAL_NUMBER;
}
int32_t UnixSignals::GetFirstSignalNumber() const {
if (m_signals.empty())
return LLDB_INVALID_SIGNAL_NUMBER;
return (*m_signals.begin()).first;
}
int32_t UnixSignals::GetNextSignalNumber(int32_t current_signal) const {
collection::const_iterator pos = m_signals.find(current_signal);
collection::const_iterator end = m_signals.end();
if (pos == end)
return LLDB_INVALID_SIGNAL_NUMBER;
else {
pos++;
if (pos == end)
return LLDB_INVALID_SIGNAL_NUMBER;
else
return pos->first;
}
}
const char *UnixSignals::GetSignalInfo(int32_t signo, bool &should_suppress,
bool &should_stop,
bool &should_notify) const {
collection::const_iterator pos = m_signals.find(signo);
if (pos == m_signals.end())
return nullptr;
else {
const Signal &signal = pos->second;
should_suppress = signal.m_suppress;
should_stop = signal.m_stop;
should_notify = signal.m_notify;
return signal.m_name.AsCString("");
}
}
bool UnixSignals::GetShouldSuppress(int signo) const {
collection::const_iterator pos = m_signals.find(signo);
if (pos != m_signals.end())
return pos->second.m_suppress;
return false;
}
bool UnixSignals::SetShouldSuppress(int signo, bool value) {
collection::iterator pos = m_signals.find(signo);
if (pos != m_signals.end()) {
pos->second.m_suppress = value;
++m_version;
return true;
}
return false;
}
bool UnixSignals::SetShouldSuppress(const char *signal_name, bool value) {
const int32_t signo = GetSignalNumberFromName(signal_name);
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
return SetShouldSuppress(signo, value);
return false;
}
bool UnixSignals::GetShouldStop(int signo) const {
collection::const_iterator pos = m_signals.find(signo);
if (pos != m_signals.end())
return pos->second.m_stop;
return false;
}
bool UnixSignals::SetShouldStop(int signo, bool value) {
collection::iterator pos = m_signals.find(signo);
if (pos != m_signals.end()) {
pos->second.m_stop = value;
++m_version;
return true;
}
return false;
}
bool UnixSignals::SetShouldStop(const char *signal_name, bool value) {
const int32_t signo = GetSignalNumberFromName(signal_name);
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
return SetShouldStop(signo, value);
return false;
}
bool UnixSignals::GetShouldNotify(int signo) const {
collection::const_iterator pos = m_signals.find(signo);
if (pos != m_signals.end())
return pos->second.m_notify;
return false;
}
bool UnixSignals::SetShouldNotify(int signo, bool value) {
collection::iterator pos = m_signals.find(signo);
if (pos != m_signals.end()) {
pos->second.m_notify = value;
++m_version;
return true;
}
return false;
}
bool UnixSignals::SetShouldNotify(const char *signal_name, bool value) {
const int32_t signo = GetSignalNumberFromName(signal_name);
if (signo != LLDB_INVALID_SIGNAL_NUMBER)
return SetShouldNotify(signo, value);
return false;
}
int32_t UnixSignals::GetNumSignals() const { return m_signals.size(); }
int32_t UnixSignals::GetSignalAtIndex(int32_t index) const {
if (index < 0 || m_signals.size() <= static_cast<size_t>(index))
return LLDB_INVALID_SIGNAL_NUMBER;
auto it = m_signals.begin();
std::advance(it, index);
return it->first;
}
uint64_t UnixSignals::GetVersion() const { return m_version; }
std::vector<int32_t>
UnixSignals::GetFilteredSignals(llvm::Optional<bool> should_suppress,
llvm::Optional<bool> should_stop,
llvm::Optional<bool> should_notify) {
std::vector<int32_t> result;
for (int32_t signo = GetFirstSignalNumber();
signo != LLDB_INVALID_SIGNAL_NUMBER;
signo = GetNextSignalNumber(signo)) {
bool signal_suppress = false;
bool signal_stop = false;
bool signal_notify = false;
GetSignalInfo(signo, signal_suppress, signal_stop, signal_notify);
// If any of filtering conditions are not met, we move on to the next
// signal.
if (should_suppress.hasValue() &&
signal_suppress != should_suppress.getValue())
continue;
if (should_stop.hasValue() && signal_stop != should_stop.getValue())
continue;
if (should_notify.hasValue() && signal_notify != should_notify.getValue())
continue;
result.push_back(signo);
}
return result;
}
| 36.85489 | 114 | 0.651887 | lforg37 |
f6b502462e3b6fca862663fd62725d11a8921bff | 512 | hpp | C++ | kizunano/node/openclconfig.hpp | kizunanocoin/node | c6013e7e992ab75432db58da05054b381f821566 | [
"BSD-3-Clause"
] | 1 | 2021-08-16T06:41:05.000Z | 2021-08-16T06:41:05.000Z | kizunano/node/openclconfig.hpp | kizunanocoin/node | c6013e7e992ab75432db58da05054b381f821566 | [
"BSD-3-Clause"
] | null | null | null | kizunano/node/openclconfig.hpp | kizunanocoin/node | c6013e7e992ab75432db58da05054b381f821566 | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include <kizunano/lib/errors.hpp>
namespace nano
{
class jsonconfig;
class tomlconfig;
class opencl_config
{
public:
opencl_config () = default;
opencl_config (unsigned, unsigned, unsigned);
nano::error serialize_json (nano::jsonconfig &) const;
nano::error deserialize_json (nano::jsonconfig &);
nano::error serialize_toml (nano::tomlconfig &) const;
nano::error deserialize_toml (nano::tomlconfig &);
unsigned platform{ 0 };
unsigned device{ 0 };
unsigned threads{ 1024 * 1024 };
};
}
| 22.26087 | 55 | 0.738281 | kizunanocoin |
f6b7587ba9fbbcadc46a0c2b9475007dd2f6e86a | 1,029 | hpp | C++ | src/common/ObjectCounter.hpp | halfmvsq/histolozee | c624c0d7c3a70bcc0d6aac87b4f24677e064b6a5 | [
"Apache-2.0"
] | null | null | null | src/common/ObjectCounter.hpp | halfmvsq/histolozee | c624c0d7c3a70bcc0d6aac87b4f24677e064b6a5 | [
"Apache-2.0"
] | null | null | null | src/common/ObjectCounter.hpp | halfmvsq/histolozee | c624c0d7c3a70bcc0d6aac87b4f24677e064b6a5 | [
"Apache-2.0"
] | null | null | null | #ifndef OBJECT_COUNTER_H
#define OBJECT_COUNTER_H
#include <cstddef>
/**
* @brief Template class for couynting the number of objects of type T created and
* currently allocated (a.k.a. the number of objects that are "alive").
*/
template< class T >
class ObjectCounter
{
public:
ObjectCounter()
{
++m_numCreated;
++m_numAlive;
}
ObjectCounter( const ObjectCounter& )
{
++m_numCreated;
++m_numAlive;
}
std::size_t numCreated() const noexcept
{
return m_numCreated;
}
std::size_t numAlive() const noexcept
{
return m_numAlive;
}
protected:
/// @note Objects should never be removed through pointers of this type
~ObjectCounter()
{
--m_numAlive;
}
private:
static std::size_t m_numCreated;
static std::size_t m_numAlive;
};
template< class T > std::size_t ObjectCounter<T>::m_numCreated = 0;
template< class T > std::size_t ObjectCounter<T>::m_numAlive = 0;
#endif // OBJECT_COUNTER_H
| 17.440678 | 82 | 0.643343 | halfmvsq |
f6b898fa886a2a244ec1a0929b6e5630d3ea60e9 | 3,924 | cpp | C++ | vstgui/tests/unittest/uidescription/uiviewcreator/uiviewswitchcontainercreator_test.cpp | GizzZmo/vstgui | 477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e | [
"BSD-3-Clause"
] | 205 | 2019-06-09T18:40:27.000Z | 2022-03-24T01:53:49.000Z | vstgui/tests/unittest/uidescription/uiviewcreator/uiviewswitchcontainercreator_test.cpp | GizzZmo/vstgui | 477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e | [
"BSD-3-Clause"
] | 9 | 2019-12-23T17:46:30.000Z | 2022-02-09T14:40:53.000Z | vstgui/tests/unittest/uidescription/uiviewcreator/uiviewswitchcontainercreator_test.cpp | GizzZmo/vstgui | 477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e | [
"BSD-3-Clause"
] | 30 | 2019-06-11T04:05:46.000Z | 2022-03-29T15:52:14.000Z | // This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
#include "../../unittests.h"
#include "../../../../uidescription/uiviewfactory.h"
#include "../../../../uidescription/uiattributes.h"
#include "../../../../uidescription/detail/uiviewcreatorattributes.h"
#include "../../../../uidescription/uiviewswitchcontainer.h"
#include "../../../../lib/cstring.h"
#include "helpers.h"
namespace VSTGUI {
using namespace UIViewCreator;
TESTCASE(UIViewSwitchContainerCreatorTest,
TEST(templateNames,
DummyUIDescription uidesc;
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrTemplateNames, "temp1,temp2", &uidesc, [] (UIViewSwitchContainer* v) {
auto controller = dynamic_cast<UIDescriptionViewSwitchController*> (v->getController ());
EXPECT(controller);
std::string str;
controller->getTemplateNames(str);
return str == "temp1,temp2";
});
);
TEST(templateSwitchControl,
DummyUIDescription uidesc;
uidesc.tag = 12345;
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrTemplateSwitchControl, kTagName, &uidesc, [&] (UIViewSwitchContainer* v) {
auto controller = dynamic_cast<UIDescriptionViewSwitchController*> (v->getController ());
EXPECT(controller);
return controller->getSwitchControlTag() == uidesc.tag;
}, true);
);
TEST(animationStyle,
DummyUIDescription uidesc;
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationStyle, "fade", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getAnimationStyle() == UIViewSwitchContainer::kFadeInOut;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationStyle, "move", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getAnimationStyle() == UIViewSwitchContainer::kMoveInOut;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationStyle, "push", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getAnimationStyle() == UIViewSwitchContainer::kPushInOut;
});
);
TEST(animationTime,
DummyUIDescription uidesc;
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTime, 1234, &uidesc, [] (UIViewSwitchContainer* v) {
return v->getAnimationTime() == 1234;
});
);
TEST(animationStyleValues,
DummyUIDescription uidesc;
testPossibleValues (kUIViewSwitchContainer, kAttrAnimationStyle, &uidesc, {"fade", "move", "push"});
);
TEST(animationTimingFunction,
DummyUIDescription uidesc;
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTimingFunction, "linear", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getTimingFunction() == UIViewSwitchContainer::kLinear;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTimingFunction, "easy-in", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getTimingFunction() == UIViewSwitchContainer::kEasyIn;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTimingFunction, "easy-out", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getTimingFunction() == UIViewSwitchContainer::kEasyOut;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTimingFunction, "easy-in-out", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getTimingFunction() == UIViewSwitchContainer::kEasyInOut;
});
testAttribute<UIViewSwitchContainer>(kUIViewSwitchContainer, kAttrAnimationTimingFunction, "easy", &uidesc, [] (UIViewSwitchContainer* v) {
return v->getTimingFunction() == UIViewSwitchContainer::kEasy;
});
);
TEST(animationTimingFunctionValues,
DummyUIDescription uidesc;
testPossibleValues (kUIViewSwitchContainer, kAttrAnimationTimingFunction, &uidesc, {"linear", "easy-in", "easy-out", "easy-in-out", "easy"});
);
);
} // VSTGUI
| 43.120879 | 148 | 0.756371 | GizzZmo |
f6ba628ba26a5c181735eb62e94c57d964617200 | 1,196 | hh | C++ | src/include/simeng/SpecialFileDirGen.hh | ABagdia/SimEng | 63b52fbb6e07c75100e03a153191b9c548f537c5 | [
"Apache-2.0"
] | null | null | null | src/include/simeng/SpecialFileDirGen.hh | ABagdia/SimEng | 63b52fbb6e07c75100e03a153191b9c548f537c5 | [
"Apache-2.0"
] | null | null | null | src/include/simeng/SpecialFileDirGen.hh | ABagdia/SimEng | 63b52fbb6e07c75100e03a153191b9c548f537c5 | [
"Apache-2.0"
] | null | null | null | #pragma once
#include <fstream>
#include <string>
#include "simeng/version.hh"
#include "yaml-cpp/yaml.h"
namespace simeng {
class SpecialFileDirGen {
public:
/** Construct a SpecialFileDirGen class by reading in the YAML file and
* running it through checks and formatting. */
SpecialFileDirGen(YAML::Node config);
/** Removes all files inside the '/src.lib/kernel/specialFiles' directory. */
void RemoveExistingSFDir();
/** Creates necessary file structure to support needed special files inside
* the '/src.lib/kernel/specialFiles' directory. */
void GenerateSFDir();
private:
/** Path to the root of the SimEng special files directory. */
const std::string specialFilesDir_ =
SIMENG_SOURCE_DIR "/src/lib/kernel/specialFiles";
/** Values declared in YAML config file needed to create the Special Files
* Directory tree. */
uint64_t core_count;
uint64_t smt;
uint64_t socket_count;
float bogoMIPS;
std::string features;
std::string cpu_implementer;
uint64_t cpu_architecture;
std::string cpu_variant;
std::string cpu_part;
uint64_t cpu_revision;
uint64_t package_count;
}; // namespace SpecialFilesDirGen
} // namespace simeng | 27.181818 | 79 | 0.736622 | ABagdia |
f6c10d358f79386e866cc417c1aa8ebf68cc00ec | 997 | cpp | C++ | liero/menu/menuItem.cpp | lauri-kaariainen/emscripten_openliero | ab3268237c7084e00f3bccb4442f0ad7762d8419 | [
"BSD-2-Clause"
] | null | null | null | liero/menu/menuItem.cpp | lauri-kaariainen/emscripten_openliero | ab3268237c7084e00f3bccb4442f0ad7762d8419 | [
"BSD-2-Clause"
] | 2 | 2015-02-11T09:43:33.000Z | 2015-02-11T17:57:58.000Z | liero/menu/menuItem.cpp | lauri-kaariainen/emscripten_openliero | ab3268237c7084e00f3bccb4442f0ad7762d8419 | [
"BSD-2-Clause"
] | null | null | null | #include "menuItem.hpp"
#include "../common.hpp"
#include "../gfx.hpp"
void MenuItem::draw(Common& common, int x, int y, bool selected, bool disabled, bool centered, int valueOffsetX)
{
int wid = common.font.getDims(string);
int valueWid = common.font.getDims(value);
if(centered)
x -= (wid >> 1);
if(selected)
{
drawRoundedBox(gfx.screenBmp, x, y, 0, 7, wid);
if(hasValue)
drawRoundedBox(gfx.screenBmp, x + valueOffsetX - (valueWid >> 1), y, 0, 7, valueWid);
}
else
{
common.font.drawText(gfx.screenBmp, string, x + 3, y + 2, 0);
if(hasValue)
common.font.drawText(gfx.screenBmp, value, x + valueOffsetX - (valueWid >> 1) + 3, y + 2, 0);
}
PalIdx c;
if(disabled)
c = disColour;
else if(selected)
c = disabled ? 7 : 168;
else
c = color;
common.font.drawText(gfx.screenBmp, string, x + 2, y + 1, c);
if(hasValue)
common.font.drawText(gfx.screenBmp, value, x + valueOffsetX - (valueWid >> 1) + 2, y + 1, c);
}
| 24.925 | 113 | 0.616851 | lauri-kaariainen |
f6c29374b28262912e0144e2a97440dd55987a66 | 844 | hpp | C++ | include/retirement.hpp | FORGIS98/budgetwarrior | ca4c79a7b9694a0db5c7fe11b1b4e9cba96a9971 | [
"MIT"
] | null | null | null | include/retirement.hpp | FORGIS98/budgetwarrior | ca4c79a7b9694a0db5c7fe11b1b4e9cba96a9971 | [
"MIT"
] | null | null | null | include/retirement.hpp | FORGIS98/budgetwarrior | ca4c79a7b9694a0db5c7fe11b1b4e9cba96a9971 | [
"MIT"
] | null | null | null | //=======================================================================
// Copyright (c) 2013-2020 Baptiste Wicht.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=======================================================================
#pragma once
#include <vector>
#include <string>
#include "module_traits.hpp"
#include "writer_fwd.hpp"
#include "date.hpp"
namespace budget {
struct retirement_module {
void load();
void handle(std::vector<std::string>& args);
};
template<>
struct module_traits<retirement_module> {
static constexpr const bool is_default = false;
static constexpr const char* command = "retirement";
};
float fi_ratio(budget::date d);
void retirement_status(budget::writer& w);
} //end of namespace budget
| 24.823529 | 73 | 0.598341 | FORGIS98 |
f6c66c2b003609a8a897b37c776863a23407bbee | 18,259 | cc | C++ | paddle/fluid/inference/api/analysis_predictor_tester.cc | JingChunzhen/Paddle | 1bce7caabc1c5e55b1fa13edb19719c397803c43 | [
"Apache-2.0"
] | 2 | 2021-02-04T15:04:21.000Z | 2021-02-07T14:20:00.000Z | paddle/fluid/inference/api/analysis_predictor_tester.cc | hexieshenghuo/Paddle | 2497f4392fe60f4c72e9b7ff5de9b8b6117aacac | [
"Apache-2.0"
] | null | null | null | paddle/fluid/inference/api/analysis_predictor_tester.cc | hexieshenghuo/Paddle | 2497f4392fe60f4c72e9b7ff5de9b8b6117aacac | [
"Apache-2.0"
] | 1 | 2021-03-16T13:40:08.000Z | 2021-03-16T13:40:08.000Z | // Copyright (c) 2018 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 "paddle/fluid/inference/api/analysis_predictor.h"
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <thread> // NOLINT
#include "paddle/fluid/framework/ir/pass.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/inference/api/helper.h"
#include "paddle/fluid/inference/api/paddle_inference_api.h"
#include "paddle/fluid/inference/tests/api/tester_helper.h"
#include "paddle/fluid/platform/cpu_info.h"
#ifdef PADDLE_WITH_MKLDNN
#include "paddle/fluid/inference/api/mkldnn_quantizer.h"
#endif
DEFINE_string(dirname, "", "dirname to tests.");
namespace paddle {
TEST(AnalysisPredictor, analysis_off) {
AnalysisConfig config;
config.SetModel(FLAGS_dirname);
config.SwitchIrOptim(false);
auto _predictor = CreatePaddlePredictor<AnalysisConfig>(config);
auto* predictor = static_cast<AnalysisPredictor*>(_predictor.get());
// Without analysis, the scope_ and sub_scope_ are created by predictor
// itself.
ASSERT_TRUE(predictor->scope_);
ASSERT_TRUE(predictor->sub_scope_);
ASSERT_EQ(predictor->scope_->parent(), nullptr);
ASSERT_EQ(predictor->sub_scope_->parent(), predictor->scope_.get());
// ir is turned off, so program shouldn't be optimized.
LOG(INFO) << "scope parameters " << predictor->scope_->LocalVarNames().size();
// 2. Dummy Input Data
int64_t data[4] = {1, 2, 3, 4};
PaddleTensor tensor;
tensor.shape = std::vector<int>({4, 1});
tensor.data.Reset(data, sizeof(data));
tensor.dtype = PaddleDType::INT64;
std::vector<PaddleTensor> inputs(4, tensor);
std::vector<PaddleTensor> outputs;
ASSERT_TRUE(predictor->Run(inputs, &outputs));
}
TEST(AnalysisPredictor, analysis_on) {
AnalysisConfig config;
config.SetModel(FLAGS_dirname);
config.SwitchIrOptim(true);
#ifdef PADDLE_WITH_CUDA
config.EnableUseGpu(100, 0);
#else
config.DisableGpu();
#endif
auto _predictor = CreatePaddlePredictor<AnalysisConfig>(config);
auto* predictor = static_cast<AnalysisPredictor*>(_predictor.get());
ASSERT_TRUE(predictor->scope_);
ASSERT_TRUE(predictor->sub_scope_);
ASSERT_EQ(predictor->scope_->parent(), nullptr);
ASSERT_EQ(predictor->sub_scope_->parent(), predictor->scope_.get());
// 2. Dummy Input Data
int64_t data[4] = {1, 2, 3, 4};
PaddleTensor tensor;
tensor.shape = std::vector<int>({4, 1});
tensor.data.Reset(data, sizeof(data));
tensor.dtype = PaddleDType::INT64;
std::vector<PaddleTensor> inputs(4, tensor);
std::vector<PaddleTensor> outputs;
ASSERT_TRUE(predictor->Run(inputs, &outputs));
for (auto& output : outputs) {
LOG(INFO) << inference::DescribeTensor(output);
}
// compare with NativePredictor
auto naive_predictor =
CreatePaddlePredictor<NativeConfig>(config.ToNativeConfig());
std::vector<PaddleTensor> naive_outputs;
ASSERT_TRUE(naive_predictor->Run(inputs, &naive_outputs));
ASSERT_EQ(naive_outputs.size(), 1UL);
inference::CompareTensor(outputs.front(), naive_outputs.front());
}
TEST(AnalysisPredictor, ZeroCopy) {
AnalysisConfig config;
config.SetModel(FLAGS_dirname);
config.SwitchUseFeedFetchOps(false);
auto predictor = CreatePaddlePredictor<AnalysisConfig>(config);
auto w0 = predictor->GetInputTensor("firstw");
auto w1 = predictor->GetInputTensor("secondw");
auto w2 = predictor->GetInputTensor("thirdw");
auto w3 = predictor->GetInputTensor("forthw");
w0->Reshape({4, 1});
w1->Reshape({4, 1});
w2->Reshape({4, 1});
w3->Reshape({4, 1});
auto* w0_data = w0->mutable_data<int64_t>(PaddlePlace::kCPU);
auto* w1_data = w1->mutable_data<int64_t>(PaddlePlace::kCPU);
auto* w2_data = w2->mutable_data<int64_t>(PaddlePlace::kCPU);
auto* w3_data = w3->mutable_data<int64_t>(PaddlePlace::kCPU);
for (int i = 0; i < 4; i++) {
w0_data[i] = i;
w1_data[i] = i;
w2_data[i] = i;
w3_data[i] = i;
}
predictor->ZeroCopyRun();
auto out = predictor->GetOutputTensor("fc_1.tmp_2");
PaddlePlace place;
int size = 0;
auto* out_data = out->data<float>(&place, &size);
LOG(INFO) << "output size: " << size / sizeof(float);
LOG(INFO) << "output_data: " << out_data;
predictor->TryShrinkMemory();
}
TEST(AnalysisPredictor, Clone) {
AnalysisConfig config;
config.SetModel(FLAGS_dirname);
config.SwitchUseFeedFetchOps(true);
config.SwitchIrOptim(true);
std::vector<std::unique_ptr<PaddlePredictor>> predictors;
predictors.emplace_back(CreatePaddlePredictor(config));
LOG(INFO) << "************** to clone ************************";
const int num_threads = 3;
for (int i = 1; i < num_threads; i++) {
predictors.emplace_back(predictors.front()->Clone());
}
auto* root_scope =
static_cast<AnalysisPredictor*>(predictors[0].get())->scope();
ASSERT_FALSE(root_scope->kids().empty());
LOG(INFO) << "***** scope ******\n"
<< framework::GenScopeTreeDebugInfo(root_scope);
// 2. Dummy Input Data
int64_t data[4] = {1, 2, 3, 4};
PaddleTensor tensor;
tensor.shape = std::vector<int>({4, 1});
tensor.data.Reset(data, sizeof(data));
tensor.dtype = PaddleDType::INT64;
std::vector<PaddleTensor> inputs(4, tensor);
std::vector<PaddleTensor> outputs;
predictors[0]->Run(inputs, &outputs);
LOG(INFO) << "Run with single thread";
for (int i = 0; i < num_threads; i++) {
LOG(INFO) << "run predictor " << i;
ASSERT_TRUE(predictors[i]->Run(inputs, &outputs));
}
LOG(INFO) << "Run with multiple threads";
std::vector<std::thread> threads;
for (int i = 0; i < num_threads; i++) {
threads.emplace_back([&predictors, &inputs, i] {
LOG(INFO) << "thread #" << i << " running";
std::vector<PaddleTensor> outputs;
auto predictor = predictors.front()->Clone();
for (int j = 0; j < 10; j++) {
ASSERT_TRUE(predictor->Run(inputs, &outputs));
}
});
}
for (auto& t : threads) {
t.join();
}
}
// This function is not released yet, will fail on some machine.
// TODO(Superjomn) Turn on it latter.
/*
TEST(AnalysisPredictor, memory_optim) {
AnalysisConfig config(FLAGS_dirname);
config.DisableGpu();
config.EnableMemoryOptim(true);
config.SwitchIrDebug();
auto native_predictor =
CreatePaddlePredictor<NativeConfig>(config.ToNativeConfig());
// 2. Dummy Input Data
int64_t data[4] = {1, 2, 3, 4};
PaddleTensor tensor;
tensor.shape = std::vector<int>({4, 1});
tensor.data.Reset(data, sizeof(data));
tensor.dtype = PaddleDType::INT64;
std::vector<PaddleTensor> inputs(4, tensor);
std::vector<PaddleTensor> output, output1;
{
// The first predictor help to cache the memory optimize strategy.
auto predictor = CreatePaddlePredictor<AnalysisConfig>(config);
LOG(INFO) << "serialized program: " << predictor->GetSerializedProgram();
ASSERT_FALSE(predictor->GetSerializedProgram().empty());
// Run several times to check the parameters are not reused by mistake.
for (int i = 0; i < 5; i++) {
ASSERT_TRUE(predictor->Run(inputs, &output));
}
}
{
output.clear();
// The second predictor to perform memory optimization.
config.EnableMemoryOptim(false);
auto predictor = CreatePaddlePredictor<AnalysisConfig>(config);
// Run with memory optimization
ASSERT_TRUE(predictor->Run(inputs, &output));
}
// Run native
ASSERT_TRUE(native_predictor->Run(inputs, &output1));
LOG(INFO) << "the output " << inference::DescribeTensor(output.front());
LOG(INFO) << "the native output "
<< inference::DescribeTensor(output1.front());
inference::CompareResult(output, output1);
}
*/
#ifdef PADDLE_WITH_MKLDNN
class MkldnnQuantizerTest : public testing::Test {
public:
MkldnnQuantizerTest() {
AnalysisConfig config(FLAGS_dirname);
predictor = std::move(CreatePaddlePredictor(config));
auto* predictor_p = static_cast<AnalysisPredictor*>(predictor.get());
auto qconfig = new MkldnnQuantizerConfig();
mkldnn_quantizer.reset(
new AnalysisPredictor::MkldnnQuantizer(*predictor_p, qconfig));
}
std::pair<std::vector<int>, float> Histogram(
const framework::LoDTensor& var_tensor, float min_val, float max_val,
int num_bins) const {
return mkldnn_quantizer->Histogram(var_tensor, min_val, max_val, num_bins);
}
std::pair<bool, framework::LoDTensor> GetMaxScalingFactor(
const framework::LoDTensor& var_tensor, bool is_unsigned) const {
return mkldnn_quantizer->GetMaxScalingFactor(var_tensor, is_unsigned);
}
std::pair<bool, framework::LoDTensor> GetMaxChScalingFactor(
const framework::LoDTensor& var_tensor, bool is_unsigned) const {
return mkldnn_quantizer->GetMaxChScalingFactor(var_tensor, is_unsigned, 0);
}
std::pair<bool, framework::LoDTensor> GetKLScalingFactor(
const framework::LoDTensor& var_tensor, bool is_unsigned) const {
return mkldnn_quantizer->GetKLScalingFactor(var_tensor, is_unsigned);
}
protected:
std::unique_ptr<PaddlePredictor> predictor;
std::unique_ptr<AnalysisPredictor::MkldnnQuantizer> mkldnn_quantizer;
float abs_error = 1e-6;
static const std::array<float, 10> non_negative_values;
static const std::array<float, 10> positive_and_negative_values;
};
const std::array<float, 10> MkldnnQuantizerTest::non_negative_values = {
0.0158671, 0.026459, 0.0280772, 0.00962479, 0.0131628,
0.016704, 0.00118407, 0.00765726, 0.0123213, 0.00944741};
const std::array<float, 10> MkldnnQuantizerTest::positive_and_negative_values =
{-0.0482659, -0.0102493, -0.00794221, -0.00387115, -0.00674586,
-0.0495346, 0.0629528, -0.00531285, -0.0230353, 0.0269089};
TEST_F(MkldnnQuantizerTest, histogram_inverted_min_max) {
const auto& values = non_negative_values;
auto min_val = *std::min_element(values.begin(), values.end());
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
ASSERT_THROW(Histogram(var_tensor, max_val, min_val, 3),
platform::EnforceNotMet);
}
TEST_F(MkldnnQuantizerTest, histogram_non_negative_to_3) {
// all non-negative values
const auto& values = non_negative_values;
auto min_val = *std::min_element(values.begin(), values.end());
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
std::vector<int> histogram;
float bin_width;
std::tie(histogram, bin_width) = Histogram(var_tensor, min_val, max_val, 3);
ASSERT_NEAR(bin_width, std::abs(max_val - min_val) / 3.f, abs_error)
<< "Improperly calculated bin_width.";
ASSERT_EQ(histogram[0], 4);
ASSERT_EQ(histogram[1], 4);
ASSERT_EQ(histogram[2], 2);
}
TEST_F(MkldnnQuantizerTest, histogram_positive_and_negative_to_3) {
const auto& values = positive_and_negative_values;
auto min_val = *std::min_element(values.begin(), values.end());
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
std::vector<int> histogram;
float bin_width;
std::tie(histogram, bin_width) = Histogram(var_tensor, min_val, max_val, 3);
ASSERT_NEAR(bin_width, std::abs(max_val - min_val) / 3.0f, abs_error)
<< "Improperly calculated bin_width.";
ASSERT_EQ(histogram[0], 3);
ASSERT_EQ(histogram[1], 5);
ASSERT_EQ(histogram[2], 2);
}
TEST_F(MkldnnQuantizerTest, histogram_zero_bins) {
const auto& values = non_negative_values;
auto min_val = *std::min_element(values.begin(), values.end());
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
ASSERT_THROW(Histogram(var_tensor, min_val, max_val, 0),
platform::EnforceNotMet);
}
TEST_F(MkldnnQuantizerTest, histogram_empty) {
// empty tensor
ASSERT_THROW(Histogram({}, -1, 1, 1), platform::EnforceNotMet);
// zero tensor
framework::LoDTensor var_tensor;
var_tensor.Resize({0});
var_tensor.mutable_data<double>(platform::CPUPlace());
ASSERT_THROW(Histogram(var_tensor, -1, 1, 1), platform::EnforceNotMet);
}
TEST_F(MkldnnQuantizerTest, kl_scaling_factor_signed) {
const auto& values = positive_and_negative_values;
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
bool is_unsigned;
framework::LoDTensor lod_tensor;
std::tie(is_unsigned, lod_tensor) = GetKLScalingFactor(var_tensor, false);
ASSERT_EQ(is_unsigned, false);
ASSERT_EQ(lod_tensor.numel(), 1);
ASSERT_NEAR(lod_tensor.data<double>()[0], 1.0 / 0.0899106152344, abs_error);
}
TEST_F(MkldnnQuantizerTest, max_scaling_factor_signed) {
const auto& values = positive_and_negative_values;
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
bool is_unsigned;
framework::LoDTensor lod_tensor;
std::tie(is_unsigned, lod_tensor) = GetMaxScalingFactor(var_tensor, false);
ASSERT_EQ(is_unsigned, false);
ASSERT_EQ(lod_tensor.numel(), 1);
ASSERT_NEAR(lod_tensor.data<double>()[0], 1.0 / max_val, abs_error);
}
TEST_F(MkldnnQuantizerTest, max_scaling_factor_unsigned) {
const auto& values = non_negative_values;
auto max_val = *std::max_element(values.begin(), values.end());
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
bool is_unsigned;
framework::LoDTensor lod_tensor;
std::tie(is_unsigned, lod_tensor) = GetMaxScalingFactor(var_tensor, true);
ASSERT_EQ(is_unsigned, true);
ASSERT_EQ(lod_tensor.numel(), 1);
ASSERT_NEAR(lod_tensor.data<double>()[0], 1.0 / max_val, abs_error);
}
TEST_F(MkldnnQuantizerTest, max_scaling_factor_chwise_unsigned) {
const auto& values = non_negative_values;
auto max_val = *std::max_element(values.begin(), values.end());
int channels = 3;
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(channels, 1, 1, values.size()));
for (int i = 0; i < channels; i++)
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()) +
i * values.size());
bool is_unsigned;
framework::LoDTensor lod_tensor;
std::tie(is_unsigned, lod_tensor) = GetMaxChScalingFactor(var_tensor, true);
ASSERT_EQ(is_unsigned, true);
ASSERT_EQ(lod_tensor.numel(), channels);
for (int i = 0; i < channels; i++) {
ASSERT_NEAR(lod_tensor.data<double>()[i], 1.0 / max_val, abs_error);
}
}
TEST_F(MkldnnQuantizerTest, kl_scaling_factor_unsigned) {
const auto& values = non_negative_values;
framework::LoDTensor var_tensor;
var_tensor.Resize(framework::make_dim(values.size()));
std::copy(begin(values), end(values),
var_tensor.mutable_data<float>(platform::CPUPlace()));
bool is_unsigned;
framework::LoDTensor lod_tensor;
std::tie(is_unsigned, lod_tensor) = GetKLScalingFactor(var_tensor, true);
ASSERT_EQ(is_unsigned, true);
ASSERT_EQ(lod_tensor.numel(), 1);
ASSERT_NEAR(lod_tensor.data<double>()[0], 1.0 / 0.0252845321362, abs_error);
}
#endif
#ifdef PADDLE_WITH_CUDA
TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
AnalysisConfig config;
config.SetModel(FLAGS_dirname);
config.SwitchIrOptim(true);
config.EnableUseGpu(100, 0);
config.EnableMkldnnBfloat16();
#ifdef PADDLE_WITH_MKLDNN
if (platform::MayIUse(platform::cpu_isa_t::avx512_core))
ASSERT_EQ(config.mkldnn_bfloat16_enabled(), true);
else
ASSERT_EQ(config.mkldnn_bfloat16_enabled(), false);
#else
ASSERT_EQ(config.mkldnn_bfloat16_enabled(), false);
#endif
}
#endif
TEST(AnalysisPredictor, bf16_pass_strategy) {
std::vector<std::string> passes;
PassStrategy passStrategy(passes);
passStrategy.EnableMkldnnBfloat16();
}
} // namespace paddle
namespace paddle_infer {
TEST(Predictor, Run) {
Config config;
config.SetModel(FLAGS_dirname);
auto predictor = CreatePredictor(config);
auto w0 = predictor->GetInputHandle("firstw");
auto w1 = predictor->GetInputHandle("secondw");
auto w2 = predictor->GetInputHandle("thirdw");
auto w3 = predictor->GetInputHandle("forthw");
w0->Reshape({4, 1});
w1->Reshape({4, 1});
w2->Reshape({4, 1});
w3->Reshape({4, 1});
auto* w0_data = w0->mutable_data<int64_t>(PlaceType::kCPU);
auto* w1_data = w1->mutable_data<int64_t>(PlaceType::kCPU);
auto* w2_data = w2->mutable_data<int64_t>(PlaceType::kCPU);
auto* w3_data = w3->mutable_data<int64_t>(PlaceType::kCPU);
for (int i = 0; i < 4; i++) {
w0_data[i] = i;
w1_data[i] = i;
w2_data[i] = i;
w3_data[i] = i;
}
predictor->Run();
auto out = predictor->GetOutputHandle("fc_1.tmp_2");
PlaceType place;
int size = 0;
out->data<float>(&place, &size);
LOG(INFO) << "output size: " << size / sizeof(float);
predictor->TryShrinkMemory();
}
} // namespace paddle_infer
| 32.839928 | 80 | 0.708418 | JingChunzhen |
f6c6e83606df8fbe4bde2fb8f25789dc95d301c1 | 20,338 | cpp | C++ | velox/expression/tests/CastExprTest.cpp | littleeleventhwolf/velox | 856d1f91f7da09a9313c893e12adb0070ddd3fb9 | [
"Apache-2.0"
] | null | null | null | velox/expression/tests/CastExprTest.cpp | littleeleventhwolf/velox | 856d1f91f7da09a9313c893e12adb0070ddd3fb9 | [
"Apache-2.0"
] | 23 | 2021-11-11T12:38:17.000Z | 2022-01-28T10:59:38.000Z | velox/expression/tests/CastExprTest.cpp | littleeleventhwolf/velox | 856d1f91f7da09a9313c893e12adb0070ddd3fb9 | [
"Apache-2.0"
] | 8 | 2021-11-11T12:26:21.000Z | 2022-01-12T08:58:32.000Z | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 <limits>
#include "velox/buffer/Buffer.h"
#include "velox/common/memory/Memory.h"
#include "velox/expression/ControlExpr.h"
#include "velox/expression/VectorFunction.h"
#include "velox/functions/prestosql/tests/FunctionBaseTest.h"
#include "velox/type/Type.h"
#include "velox/vector/BaseVector.h"
#include "velox/vector/TypeAliases.h"
using namespace facebook::velox;
using namespace facebook::velox::test;
namespace {
/// Wraps input in a dictionary that reverses the order of rows.
class TestingDictionaryFunction : public exec::VectorFunction {
public:
bool isDefaultNullBehavior() const override {
return false;
}
void apply(
const SelectivityVector& rows,
std::vector<VectorPtr>& args,
const TypePtr& /* outputType */,
exec::EvalCtx* context,
VectorPtr* result) const override {
VELOX_CHECK(rows.isAllSelected());
const auto size = rows.size();
auto indices = makeIndicesInReverse(size, context->pool());
*result = BaseVector::wrapInDictionary(
BufferPtr(nullptr), indices, size, args[0]);
}
static std::vector<std::shared_ptr<exec::FunctionSignature>> signatures() {
// T, integer -> T
return {exec::FunctionSignatureBuilder()
.typeVariable("T")
.returnType("T")
.argumentType("T")
.build()};
}
};
} // namespace
class CastExprTest : public functions::test::FunctionBaseTest {
protected:
CastExprTest() {
exec::registerVectorFunction(
"testing_dictionary",
TestingDictionaryFunction::signatures(),
std::make_unique<TestingDictionaryFunction>());
}
void setCastIntByTruncate(bool value) {
queryCtx_->setConfigOverridesUnsafe({
{core::QueryConfig::kCastIntByTruncate, std::to_string(value)},
});
}
void setCastMatchStructByName(bool value) {
queryCtx_->setConfigOverridesUnsafe({
{core::QueryConfig::kCastMatchStructByName, std::to_string(value)},
});
}
void setTimezone(const std::string& value) {
queryCtx_->setConfigOverridesUnsafe({
{core::QueryConfig::kSessionTimezone, value},
{core::QueryConfig::kAdjustTimestampToTimezone, "true"},
});
}
std::shared_ptr<core::CastTypedExpr> makeCastExpr(
const std::shared_ptr<const core::ITypedExpr>& input,
const TypePtr& toType,
bool nullOnFailure) {
std::vector<std::shared_ptr<const core::ITypedExpr>> inputs = {input};
return std::make_shared<core::CastTypedExpr>(toType, inputs, nullOnFailure);
}
void testComplexCast(
const std::string& fromExpression,
const VectorPtr& data,
const VectorPtr& expected,
bool nullOnFailure = false) {
auto rowVector = makeRowVector({data});
auto rowType = std::dynamic_pointer_cast<const RowType>(rowVector->type());
auto castExpr = makeCastExpr(
makeTypedExpr(fromExpression, rowType),
expected->type(),
nullOnFailure);
exec::ExprSet exprSet({castExpr}, &execCtx_);
const auto size = data->size();
SelectivityVector rows(size);
std::vector<VectorPtr> result(1);
{
exec::EvalCtx evalCtx(&execCtx_, &exprSet, rowVector.get());
exprSet.eval(rows, &evalCtx, &result);
assertEqualVectors(expected, result[0]);
}
// Test constant input.
{
// Use last element for constant.
const auto index = size - 1;
auto constantData = BaseVector::wrapInConstant(size, index, data);
auto constantRow = makeRowVector({constantData});
exec::EvalCtx evalCtx(&execCtx_, &exprSet, constantRow.get());
exprSet.eval(rows, &evalCtx, &result);
assertEqualVectors(
BaseVector::wrapInConstant(size, index, expected), result[0]);
}
// Test dictionary input. It is not sufficient to wrap input in a dictionary
// as it will be peeled off before calling "cast". Apply
// testing_dictionary function to input to ensure that "cast" receives
// dictionary input.
{
auto dictionaryCastExpr = makeCastExpr(
makeTypedExpr(
fmt::format("testing_dictionary({})", fromExpression), rowType),
expected->type(),
nullOnFailure);
exec::ExprSet dictionaryExprSet({dictionaryCastExpr}, &execCtx_);
exec::EvalCtx evalCtx(&execCtx_, &dictionaryExprSet, rowVector.get());
dictionaryExprSet.eval(rows, &evalCtx, &result);
auto indices = ::makeIndicesInReverse(size, pool());
assertEqualVectors(wrapInDictionary(indices, size, expected), result[0]);
}
}
/**
* @tparam From Source type for cast
* @tparam To Destination type for cast
* @param typeString Cast type in string
* @param input Input vector of type From
* @param expectedResult Expected output vector of type To
* @param inputNulls Input null indexes
* @param expectedNulls Expected output null indexes
*/
template <typename TFrom, typename TTo>
void testCast(
const std::string& typeString,
std::vector<std::optional<TFrom>> input,
std::vector<std::optional<TTo>> expectedResult,
bool expectFailure = false,
bool tryCast = false) {
std::vector<TFrom> rawInput(input.size());
for (auto index = 0; index < input.size(); index++) {
if (input[index].has_value()) {
rawInput[index] = input[index].value();
}
}
// Create input vector using values and nulls
auto inputVector = makeFlatVector(rawInput);
for (auto index = 0; index < input.size(); index++) {
if (!input[index].has_value()) {
inputVector->setNull(index, true);
}
}
auto rowVector = makeRowVector({inputVector});
std::string castFunction = tryCast ? "try_cast" : "cast";
if (expectFailure) {
EXPECT_THROW(
evaluate<FlatVector<typename CppToType<TTo>::NativeType>>(
castFunction + "(c0 as " + typeString + ")", rowVector),
std::invalid_argument);
return;
}
// run try cast and get the result vector
auto result = evaluate<FlatVector<typename CppToType<TTo>::NativeType>>(
castFunction + "(c0 as " + typeString + ")", rowVector);
std::string msg;
// Compare the values and nulls in the output with expected
for (int index = 0; index < input.size(); index++) {
if (expectedResult[index].has_value()) {
EXPECT_TRUE(
compareValues(result->valueAt(index), expectedResult[index], msg))
<< "values at index " << index << " do not match!" << msg;
} else {
EXPECT_TRUE(result->isNullAt(index)) << " at index " << index;
}
}
}
};
TEST_F(CastExprTest, basics) {
// Testing non-null or error cases
const std::vector<std::optional<int32_t>> ii = {1, 2, 3, 100, -100};
const std::vector<std::optional<double>> oo = {1.0, 2.0, 3.0, 100.0, -100.0};
testCast<int32_t, double>(
"double", {1, 2, 3, 100, -100}, {1.0, 2.0, 3.0, 100.0, -100.0});
testCast<int32_t, std::string>(
"string", {1, 2, 3, 100, -100}, {"1", "2", "3", "100", "-100"});
testCast<std::string, int8_t>(
"tinyint", {"1", "2", "3", "100", "-100"}, {1, 2, 3, 100, -100});
testCast<double, int>(
"int", {1.888, 2.5, 3.6, 100.44, -100.101}, {2, 3, 4, 100, -100});
testCast<double, double>(
"double",
{1.888, 2.5, 3.6, 100.44, -100.101},
{1.888, 2.5, 3.6, 100.44, -100.101});
testCast<double, std::string>(
"string",
{1.888, 2.5, 3.6, 100.44, -100.101},
{"1.888", "2.5", "3.6", "100.44", "-100.101"});
testCast<double, double>(
"double",
{1.888, 2.5, 3.6, 100.44, -100.101},
{1.888, 2.5, 3.6, 100.44, -100.101});
testCast<double, float>(
"float",
{1.888, 2.5, 3.6, 100.44, -100.101},
{1.888, 2.5, 3.6, 100.44, -100.101});
testCast<bool, std::string>("string", {true, false}, {"true", "false"});
}
TEST_F(CastExprTest, timestamp) {
testCast<std::string, Timestamp>(
"timestamp",
{
"1970-01-01",
"2000-01-01",
"1970-01-01 00:00:00",
"2000-01-01 12:21:56",
"1970-01-01 00:00:00-02:00",
std::nullopt,
},
{
Timestamp(0, 0),
Timestamp(946684800, 0),
Timestamp(0, 0),
Timestamp(946729316, 0),
Timestamp(7200, 0),
std::nullopt,
});
}
TEST_F(CastExprTest, timestampInvalid) {
testCast<int8_t, Timestamp>("timestamp", {12}, {Timestamp(0, 0)}, true);
testCast<int16_t, Timestamp>("timestamp", {1234}, {Timestamp(0, 0)}, true);
testCast<int32_t, Timestamp>("timestamp", {1234}, {Timestamp(0, 0)}, true);
testCast<int64_t, Timestamp>("timestamp", {1234}, {Timestamp(0, 0)}, true);
testCast<float, Timestamp>("timestamp", {12.99}, {Timestamp(0, 0)}, true);
testCast<double, Timestamp>("timestamp", {12.99}, {Timestamp(0, 0)}, true);
}
TEST_F(CastExprTest, timestampAdjustToTimezone) {
setTimezone("America/Los_Angeles");
// Expect unix epochs to be converted to LA timezone (8h offset).
testCast<std::string, Timestamp>(
"timestamp",
{
"1970-01-01",
"2000-01-01",
"1969-12-31 16:00:00",
"2000-01-01 12:21:56",
"1970-01-01 00:00:00+14:00",
std::nullopt,
"2000-05-01", // daylight savings - 7h offset.
},
{
Timestamp(28800, 0),
Timestamp(946713600, 0),
Timestamp(0, 0),
Timestamp(946758116, 0),
Timestamp(-21600, 0),
std::nullopt,
Timestamp(957164400, 0),
});
// Empty timezone is assumed to be GMT.
setTimezone("");
testCast<std::string, Timestamp>(
"timestamp", {"1970-01-01"}, {Timestamp(0, 0)});
}
TEST_F(CastExprTest, timestampAdjustToTimezoneInvalid) {
auto testFunc = [&]() {
testCast<std::string, Timestamp>(
"timestamp", {"1970-01-01"}, {Timestamp(1, 0)});
};
setTimezone("bla");
EXPECT_THROW(testFunc(), std::runtime_error);
}
TEST_F(CastExprTest, date) {
testCast<std::string, Date>(
"date",
{
"1970-01-01",
"2020-01-01",
"2135-11-09",
"1969-12-27",
"1812-04-15",
"1920-01-02",
std::nullopt,
},
{
Date(0),
Date(18262),
Date(60577),
Date(-5),
Date(-57604),
Date(-18262),
std::nullopt,
});
}
TEST_F(CastExprTest, invalidDate) {
testCast<int8_t, Date>("date", {12}, {Date(0)}, true);
testCast<int16_t, Date>("date", {1234}, {Date(0)}, true);
testCast<int32_t, Date>("date", {1234}, {Date(0)}, true);
testCast<int64_t, Date>("date", {1234}, {Date(0)}, true);
testCast<float, Date>("date", {12.99}, {Date(0)}, true);
testCast<double, Date>("date", {12.99}, {Date(0)}, true);
// Parsing an ill-formated date.
testCast<std::string, Date>("date", {"2012-Oct-23"}, {Date(0)}, true);
}
TEST_F(CastExprTest, truncateVsRound) {
// Testing truncate vs round cast from double to int.
setCastIntByTruncate(true);
testCast<double, int>(
"int", {1.888, 2.5, 3.6, 100.44, -100.101}, {1, 2, 3, 100, -100});
testCast<double, int8_t>(
"tinyint",
{1,
256,
257,
2147483646,
2147483647,
2147483648,
-2147483646,
-2147483647,
-2147483648,
-2147483649},
{1, 0, 1, -2, -1, -1, 2, 1, 0, 0});
setCastIntByTruncate(false);
testCast<double, int>(
"int", {1.888, 2.5, 3.6, 100.44, -100.101}, {2, 3, 4, 100, -100});
testCast<int8_t, int32_t>("int", {111, 2, 3, 10, -10}, {111, 2, 3, 10, -10});
setCastIntByTruncate(true);
testCast<int32_t, int8_t>(
"tinyint", {1111111, 2, 3, 1000, -100101}, {71, 2, 3, -24, -5});
setCastIntByTruncate(false);
EXPECT_THROW(
(testCast<int32_t, int8_t>(
"tinyint", {1111111, 2, 3, 1000, -100101}, {71, 2, 3, -24, -5})),
std::invalid_argument);
}
TEST_F(CastExprTest, nullInputs) {
// Testing null inputs
testCast<double, double>(
"double",
{std::nullopt, std::nullopt, 3.6, 100.44, std::nullopt},
{std::nullopt, std::nullopt, 3.6, 100.44, std::nullopt});
testCast<double, float>(
"float",
{std::nullopt, 2.5, 3.6, 100.44, std::nullopt},
{std::nullopt, 2.5, 3.6, 100.44, std::nullopt});
testCast<double, std::string>(
"string",
{1.888, std::nullopt, std::nullopt, std::nullopt, -100.101},
{"1.888", std::nullopt, std::nullopt, std::nullopt, "-100.101"});
}
TEST_F(CastExprTest, errorHandling) {
// Making sure error cases lead to null outputs
testCast<std::string, int8_t>(
"tinyint",
{"1abc", "2", "3", "100", std::nullopt},
{std::nullopt, 2, 3, 100, std::nullopt},
false,
true);
setCastIntByTruncate(true);
testCast<std::string, int8_t>(
"tinyint",
{"-",
"-0",
" @w 123",
"123 ",
" 122",
"",
"-12-3",
"125.5",
"1234",
"-129",
"127",
"-128"},
{std::nullopt,
0,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
std::nullopt,
127,
-128},
false,
true);
testCast<double, int>(
"integer",
{1e12, 2.5, 3.6, 100.44, -100.101},
{std::numeric_limits<int32_t>::max(), 2, 3, 100, -100},
false,
true);
setCastIntByTruncate(false);
testCast<double, int>(
"int", {1.888, 2.5, 3.6, 100.44, -100.101}, {2, 3, 4, 100, -100});
testCast<std::string, int8_t>(
"tinyint", {"1abc", "2", "3", "100", "-100"}, {1, 2, 3, 100, -100}, true);
testCast<std::string, int8_t>(
"tinyint", {"1", "2", "3", "100", "-100.5"}, {1, 2, 3, 100, -100}, true);
}
constexpr vector_size_t kVectorSize = 1'000;
TEST_F(CastExprTest, mapCast) {
auto sizeAt = [](vector_size_t row) { return row % 5; };
auto keyAt = [](vector_size_t row) { return row % 11; };
auto valueAt = [](vector_size_t row) { return row % 13; };
auto inputMap = makeMapVector<int64_t, int64_t>(
kVectorSize, sizeAt, keyAt, valueAt, nullEvery(3));
// Cast map<bigint, bigint> -> map<integer, double>.
{
auto expectedMap = makeMapVector<int32_t, double>(
kVectorSize, sizeAt, keyAt, valueAt, nullEvery(3));
testComplexCast("c0", inputMap, expectedMap);
}
// Cast map<bigint, bigint> -> map<bigint, varchar>.
{
auto valueAtString = [valueAt](vector_size_t row) {
return StringView(folly::to<std::string>(valueAt(row)));
};
auto expectedMap = makeMapVector<int64_t, StringView>(
kVectorSize, sizeAt, keyAt, valueAtString, nullEvery(3));
testComplexCast("c0", inputMap, expectedMap);
}
// Cast map<bigint, bigint> -> map<varchar, bigint>.
{
auto keyAtString = [&](vector_size_t row) {
return StringView(folly::to<std::string>(keyAt(row)));
};
auto expectedMap = makeMapVector<StringView, int64_t>(
kVectorSize, sizeAt, keyAtString, valueAt, nullEvery(3));
testComplexCast("c0", inputMap, expectedMap);
}
// null values
{
auto inputWithNullValues = makeMapVector<int64_t, int64_t>(
kVectorSize, sizeAt, keyAt, valueAt, nullEvery(3), nullEvery(7));
auto expectedMap = makeMapVector<int32_t, double>(
kVectorSize, sizeAt, keyAt, valueAt, nullEvery(3), nullEvery(7));
testComplexCast("c0", inputWithNullValues, expectedMap);
}
}
TEST_F(CastExprTest, arrayCast) {
auto sizeAt = [](vector_size_t /* row */) { return 7; };
auto valueAt = [](vector_size_t /* row */, vector_size_t idx) {
return 1 + idx;
};
auto arrayVector =
makeArrayVector<double>(kVectorSize, sizeAt, valueAt, nullEvery(3));
// Cast array<double> -> array<bigint>.
{
auto expected =
makeArrayVector<int64_t>(kVectorSize, sizeAt, valueAt, nullEvery(3));
testComplexCast("c0", arrayVector, expected);
}
// Cast array<double> -> array<varchar>.
{
auto valueAtString = [valueAt](vector_size_t row, vector_size_t idx) {
return StringView(folly::to<std::string>(valueAt(row, idx)));
};
auto expected = makeArrayVector<StringView>(
kVectorSize, sizeAt, valueAtString, nullEvery(3));
testComplexCast("c0", arrayVector, expected);
}
}
TEST_F(CastExprTest, rowCast) {
auto valueAt = [](vector_size_t row) { return double(1 + row); };
auto valueAtInt = [](vector_size_t row) { return int64_t(1 + row); };
auto doubleVectorNullEvery3 =
makeFlatVector<double>(kVectorSize, valueAt, nullEvery(3));
auto intVectorNullEvery11 =
makeFlatVector<int64_t>(kVectorSize, valueAtInt, nullEvery(11));
auto doubleVectorNullEvery11 =
makeFlatVector<double>(kVectorSize, valueAt, nullEvery(11));
auto intVectorNullEvery3 =
makeFlatVector<int64_t>(kVectorSize, valueAtInt, nullEvery(3));
auto rowVector = makeRowVector(
{intVectorNullEvery11, doubleVectorNullEvery3}, nullEvery(5));
setCastMatchStructByName(false);
// Position-based cast: ROW(c0: bigint, c1: double) -> ROW(c0: double, c1:
// bigint)
{
auto expectedRowVector = makeRowVector(
{doubleVectorNullEvery11, intVectorNullEvery3}, nullEvery(5));
testComplexCast("c0", rowVector, expectedRowVector);
}
// Position-based cast: ROW(c0: bigint, c1: double) -> ROW(a: double, b:
// bigint)
{
auto expectedRowVector = makeRowVector(
{"a", "b"},
{doubleVectorNullEvery11, intVectorNullEvery3},
nullEvery(5));
testComplexCast("c0", rowVector, expectedRowVector);
}
// Position-based cast: ROW(c0: bigint, c1: double) -> ROW(c0: double)
{
auto expectedRowVector =
makeRowVector({doubleVectorNullEvery11}, nullEvery(5));
testComplexCast("c0", rowVector, expectedRowVector);
}
// Name-based cast: ROW(c0: bigint, c1: double) -> ROW(c0: double) dropping
// b
setCastMatchStructByName(true);
{
auto intVectorNullAll = makeFlatVector<int64_t>(
kVectorSize, valueAtInt, [](vector_size_t /* row */) { return true; });
auto expectedRowVector = makeRowVector(
{"c0", "b"}, {doubleVectorNullEvery11, intVectorNullAll}, nullEvery(5));
testComplexCast("c0", rowVector, expectedRowVector);
}
}
TEST_F(CastExprTest, nulls) {
auto input =
makeFlatVector<int32_t>(kVectorSize, [](auto row) { return row; });
auto allNulls = makeFlatVector<int32_t>(
kVectorSize, [](auto row) { return row; }, nullEvery(1));
auto result = evaluate<FlatVector<int16_t>>(
"cast(if(c0 % 2 = 0, c1, c0) as smallint)",
makeRowVector({input, allNulls}));
auto expectedResult = makeFlatVector<int16_t>(
kVectorSize, [](auto row) { return row; }, nullEvery(2));
assertEqualVectors(expectedResult, result);
}
TEST_F(CastExprTest, testNullOnFailure) {
auto input =
makeNullableFlatVector<std::string>({"1", "2", "", "3.4", std::nullopt});
auto expected = makeNullableFlatVector<int32_t>(
{1, 2, std::nullopt, std::nullopt, std::nullopt});
// nullOnFailure is true, so we should return null instead of throwing.
testComplexCast("c0", input, expected, true);
// nullOnFailure is false, so we should throw.
EXPECT_THROW(
testComplexCast("c0", input, expected, false), std::invalid_argument);
}
TEST_F(CastExprTest, toString) {
auto input = std::make_shared<core::FieldAccessTypedExpr>(VARCHAR(), "a");
exec::ExprSet exprSet(
{makeCastExpr(input, BIGINT(), false),
makeCastExpr(input, ARRAY(VARCHAR()), false)},
&execCtx_);
ASSERT_EQ("cast((a) as BIGINT)", exprSet.exprs()[0]->toString());
ASSERT_EQ("cast((a) as ARRAY<VARCHAR>)", exprSet.exprs()[1]->toString());
}
| 32.488818 | 80 | 0.618645 | littleeleventhwolf |
f6c8d1d8e031901f9a627e56357066d059d42c8c | 14,900 | cpp | C++ | ring_puzzle_game/Assets.cpp | SSNikolaevich/ring_puzzle_game | 5db7f50ecc477899727ba7250e387002420db007 | [
"MIT"
] | null | null | null | ring_puzzle_game/Assets.cpp | SSNikolaevich/ring_puzzle_game | 5db7f50ecc477899727ba7250e387002420db007 | [
"MIT"
] | 1 | 2017-11-27T14:17:53.000Z | 2017-11-29T09:14:22.000Z | ring_puzzle_game/Assets.cpp | SSNikolaevich/ring_puzzle_game | 5db7f50ecc477899727ba7250e387002420db007 | [
"MIT"
] | 1 | 2018-02-20T14:33:44.000Z | 2018-02-20T14:33:44.000Z | //===========================================================================
#include "Assets.h"
//===========================================================================
const unsigned char PROGMEM titleSprite_plus_mask[] = {
// width, height,
88, 49,
// FRAME 00
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xe0, 0x80, 0xf0, 0xc0, 0xf8, 0xe0, 0xfc, 0x70, 0xfe, 0x38, 0xfe, 0x18, 0xfe, 0x18, 0xfe, 0x0c, 0xff, 0x0c, 0xff, 0x0e, 0xff, 0x06, 0xff, 0x06, 0xff, 0x06, 0xff, 0x06, 0xff, 0x06, 0xff, 0x06, 0xff, 0x06, 0xff, 0x46, 0xff, 0x46, 0xff, 0x86, 0xff, 0x8e, 0xff, 0x0c, 0xff, 0x3c, 0xff, 0x38, 0xfe, 0xf0, 0xfe, 0xe0, 0xfc, 0x80, 0xf8, 0x00, 0xf0, 0x80, 0xf0, 0xc0, 0xf0, 0xc0, 0xf8, 0x60, 0xf8, 0x60, 0xf8, 0x60, 0xf8, 0x60, 0xf8, 0x60, 0xf8, 0xc0, 0xf8, 0xc0, 0xf0, 0x80, 0xf0,
0x00, 0xe0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xe0, 0x80, 0xe0, 0x80, 0xf0, 0xc0, 0xf0, 0xc0, 0xf0, 0xc0, 0xf8, 0x60, 0xf8, 0x60, 0xf8, 0x60, 0xfc, 0x70, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x60, 0xfc, 0x60, 0xf8, 0xe0, 0xf8, 0xc0, 0xf8, 0xc0, 0xf0, 0x80, 0xf0, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfc, 0x00, 0xff, 0xf8, 0xff, 0xfe, 0xff, 0x0f, 0xff, 0x03, 0xff, 0xe0, 0xff, 0xf8, 0xff, 0xfc, 0xff, 0x06, 0xff, 0x02, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x03, 0xff, 0x1c, 0xff, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xc1, 0xff, 0x80, 0xff, 0x06, 0xff, 0x06, 0xff, 0x00, 0xff, 0x40, 0xff, 0x60, 0xff, 0xb0, 0xff, 0xc1, 0xff, 0xff, 0xff,
0x7e, 0xff, 0x60, 0xff, 0x60, 0xff, 0x60, 0xf8, 0xc0, 0xf8, 0xe0, 0xf8, 0x60, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0xfe, 0x38, 0xff, 0x7c, 0xff, 0xdc, 0xff, 0x8f, 0xff, 0x07, 0xff, 0x13, 0xff, 0x19, 0xff, 0x05, 0xff, 0x04, 0xff, 0x02, 0xff, 0x82, 0xff, 0xc2, 0xff, 0xc1, 0xff, 0x61, 0xff, 0x41, 0xff, 0x40, 0xff, 0xc0, 0xff, 0x80, 0xff, 0x00, 0xff, 0x00, 0xff, 0x84, 0xff, 0xf8, 0xff, 0xe0, 0xff, 0x01, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x00, 0xff, 0x00, 0xfe, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x0c, 0xff, 0x9e, 0xff, 0x3f, 0xff, 0x3b, 0xff, 0x70, 0xff, 0x71, 0xff, 0xff, 0xff, 0x9f, 0xff, 0x27, 0xff, 0x73, 0xff, 0x33, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff,
0x03, 0xff, 0x86, 0xff, 0x1c, 0xff, 0xf0, 0xff, 0x80, 0xff, 0x00, 0xff, 0x00, 0xff, 0x18, 0xff, 0xf0, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x1f, 0xff, 0x3e, 0xff, 0x78, 0xff, 0x01, 0xff, 0x07, 0xff, 0xfc, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x07, 0xff, 0x0f, 0xff, 0x0c, 0xff, 0x18, 0xff, 0x18, 0xff, 0x38, 0xff, 0x38, 0xff, 0x77, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0x31, 0xff, 0x31, 0xff, 0x38, 0xff, 0x18, 0xff, 0x1e, 0x7f, 0x0f, 0x7f, 0x03, 0x3f, 0x00, 0x1f, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x1f, 0x03, 0x7f, 0x0f, 0xff, 0x3c, 0xff, 0xf0, 0xff, 0xc0, 0xff, 0x01, 0xff, 0x07, 0xff, 0x0e, 0xff, 0x18, 0xff, 0x20, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x08, 0xff, 0x38, 0xff, 0xf0, 0xff, 0xf2, 0xff, 0xe2, 0xff, 0x84, 0xff, 0x18, 0xff, 0x60, 0xff, 0x80, 0xff, 0x80, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x06, 0xff, 0x1e, 0xff, 0x3c, 0xff, 0x3c, 0xff, 0x38, 0xff, 0x01, 0xff, 0x01, 0xff, 0x86, 0xff, 0xfc, 0xff, 0xe0, 0xff, 0x80, 0xff, 0xb8, 0xff,
0x9c, 0xff, 0xc7, 0xff, 0xe0, 0xff, 0xbc, 0xff, 0x87, 0xff, 0x80, 0xff, 0xc0, 0xff, 0xf8, 0xff, 0xcf, 0xff, 0xc0, 0xff, 0x80, 0xff, 0x9c, 0xff, 0x98, 0xff, 0x90, 0xff, 0x90, 0xff, 0xc8, 0xff, 0x60, 0xff, 0x30, 0xff, 0x98, 0xff, 0x0f, 0xff, 0x0c, 0xff, 0x04, 0xff, 0x02, 0xff, 0x02, 0xff, 0x02, 0xff, 0x82, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x80, 0xff, 0xc0, 0xff, 0xe1, 0xff, 0x3f, 0xff, 0x0f, 0xff, 0x00, 0x7f, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0f, 0x01, 0x1f, 0x07, 0x3f, 0x0e, 0x3f, 0x0c, 0x7f, 0x18, 0xff, 0x30, 0xff, 0x30, 0xff, 0x60, 0xff, 0x60, 0xff, 0x60, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc1, 0xff, 0xc3, 0xff, 0x61, 0xff, 0x60, 0xff, 0x38, 0xff, 0x3f, 0xff, 0x0f, 0xff, 0xc3, 0xff, 0x43, 0xff, 0xc6, 0xff, 0x46, 0xff, 0x4c, 0xff, 0x0c, 0xff, 0x4c, 0xff, 0xcc, 0xff, 0x46, 0xff, 0x46, 0xff, 0xc1, 0xff, 0x01, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0x01, 0xff,
0x41, 0xff, 0x00, 0xff, 0xc0, 0xff, 0x41, 0xff, 0x41, 0xff, 0x81, 0xff, 0x01, 0xff, 0x80, 0xff, 0x40, 0xff, 0xc0, 0xff, 0x01, 0xff, 0xc1, 0xff, 0x01, 0xff, 0x01, 0xff, 0x1f, 0xff, 0x7f, 0xff, 0x70, 0xff, 0xe7, 0xff, 0xcf, 0xff, 0xcf, 0xff, 0xc6, 0xff, 0xe6, 0xff, 0x62, 0xff, 0x71, 0xff, 0x39, 0xff, 0x1c, 0xff, 0x0c, 0x7f, 0x06, 0x3f, 0x06, 0x1f, 0x03, 0x1f, 0x01, 0x0f, 0x01, 0x07, 0x00, 0x07, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x03, 0xff, 0x00, 0xff, 0xfb, 0xff, 0x5b, 0xff, 0x78, 0xff, 0x03, 0xff, 0x79, 0xff, 0xc3, 0xff, 0xf9, 0xff, 0x00, 0xff, 0xcb, 0xff, 0xab, 0xff, 0x98, 0xff,
0x03, 0xff, 0xc8, 0xff, 0xab, 0xff, 0x9a, 0xff, 0x02, 0xff, 0xf9, 0xff, 0xc0, 0xff, 0x03, 0xff, 0xf9, 0xff, 0xab, 0xff, 0x88, 0xff, 0x03, 0xff, 0x02, 0xff, 0x03, 0x0f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
//===========================================================================
const unsigned char PROGMEM githubLogoSprite_plus_mask[] = {
// width, height,
16, 16,
// FRAME 00
0xe0, 0xe0, 0xf8, 0xf8, 0xfc, 0xfc, 0x3e, 0xfe, 0x0e, 0xfe, 0x07, 0xff, 0x0f, 0xff, 0x1f, 0xff,
0x1f, 0xff, 0x0f, 0xff, 0x07, 0xff, 0x0e, 0xfe, 0x3e, 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xe0, 0xe0,
0x07, 0x07, 0x1f, 0x1f, 0x37, 0x3f, 0x64, 0x7f, 0x48, 0x7f, 0xd8, 0xff, 0x08, 0xff, 0x00, 0xff,
0x00, 0xff, 0x08, 0xff, 0xf8, 0xff, 0x78, 0x7f, 0x7c, 0x7f, 0x3f, 0x3f, 0x1f, 0x1f, 0x07, 0x07,
};
//===========================================================================
const unsigned char PROGMEM tilesSprite_plus_mask[] = {
// width, height,
16, 16,
// FRAME 00
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x70, 0xfc, 0xf0, 0xfc, 0xf0, 0xfc, 0xe0, 0xfc,
0xd0, 0xfe, 0xb8, 0xff, 0x7c, 0xff, 0x3c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x0f, 0x0c, 0x0f, 0x0e, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x05, 0x0f, 0x03, 0x0f,
0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 01
0x00, 0x1f, 0x00, 0xbf, 0x0f, 0xff, 0x1f, 0xff, 0xbf, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xff,
0xe8, 0xff, 0xdc, 0xff, 0xbf, 0xff, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x0f, 0x0c, 0x0f, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x0f, 0x02, 0x0f, 0x01, 0x0f,
0x03, 0x0f, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 02
0x01, 0x8f, 0x03, 0xdf, 0x07, 0xff, 0x8f, 0xff, 0xdf, 0xff, 0xbe, 0xff, 0x7c, 0xff, 0xf8, 0xff,
0xf4, 0xff, 0xee, 0xff, 0xde, 0xff, 0x8d, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x0f,
0x01, 0x0f, 0x03, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 03
0x00, 0x0f, 0x00, 0x1f, 0x03, 0xff, 0x07, 0xff, 0xef, 0xff, 0xf7, 0xff, 0xfa, 0xff, 0x7c, 0xff,
0xbe, 0xff, 0xdf, 0xff, 0xef, 0xff, 0xc7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
0x00, 0x07, 0x01, 0x0f, 0x03, 0x0f, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 04
0x1c, 0xff, 0x1c, 0xff, 0x3c, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xfe, 0xe0, 0xfc, 0xd0, 0xfe,
0xb8, 0xff, 0x7c, 0xff, 0x3e, 0xff, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0c, 0x0f, 0x0c, 0x0f, 0x0e, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x05, 0x0f, 0x03, 0x0f, 0x07, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x06, 0x0f, 0x08, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 05
0x0f, 0xff, 0x01, 0xff, 0x01, 0xff, 0x81, 0xff, 0xc0, 0xff, 0xe0, 0xff, 0xf0, 0xff, 0xf8, 0xff,
0x7c, 0xff, 0x3e, 0xff, 0x1f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0e, 0x0f, 0x0c, 0x0f, 0x0b, 0x0f, 0x07, 0x0f, 0x07, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x0f,
0x00, 0x0f, 0x08, 0x0f, 0x04, 0x0f, 0x0a, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 06
0x03, 0xff, 0x07, 0xff, 0x0f, 0xff, 0x1f, 0xff, 0x3e, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xff,
0xe0, 0xff, 0xc1, 0xff, 0x83, 0xff, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0x0f, 0x08, 0x0f, 0x08, 0x0f, 0x08, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x01, 0x0f,
0x03, 0x0f, 0x0b, 0x0f, 0x0d, 0x0f, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 07
0x83, 0xff, 0x83, 0xff, 0xc7, 0xff, 0xef, 0xff, 0xf7, 0xff, 0xfa, 0xff, 0x7c, 0xff, 0xbe, 0xff,
0xdf, 0xff, 0xef, 0xff, 0xc7, 0xff, 0x83, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0f, 0x03, 0x0f, 0x03, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x07,
0x01, 0x0f, 0x03, 0x0f, 0x07, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 08
0x1f, 0xff, 0x3e, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xfe, 0xe0, 0xfc, 0xd0, 0xfe, 0xb8, 0xff,
0x7c, 0xff, 0x3c, 0xff, 0x1c, 0xff, 0x1c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0c, 0x0f, 0x0e, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x05, 0x0f, 0x03, 0x0f, 0x07, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0e, 0x0f, 0x0c, 0x0f, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 09
0x07, 0xff, 0x1b, 0xff, 0x3d, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0xc0, 0xff,
0x81, 0xff, 0x01, 0xff, 0x01, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0e, 0x0f, 0x0c, 0x0f, 0x08, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x01, 0x0f, 0x03, 0x0f, 0x07, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 10
0x07, 0xff, 0x83, 0xff, 0xc1, 0xff, 0xe0, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0x7c, 0xff, 0x3e, 0xff,
0x1e, 0xff, 0x0d, 0xff, 0x03, 0xff, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f,
0x08, 0x0f, 0x08, 0x0f, 0x08, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 11
0x81, 0xff, 0xc6, 0xff, 0xef, 0xff, 0xf7, 0xff, 0xfa, 0xff, 0x7c, 0xff, 0xbe, 0xff, 0xdf, 0xff,
0xef, 0xff, 0xc7, 0xff, 0x83, 0xff, 0x83, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0x0f, 0x07, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x07, 0x01, 0x0f,
0x03, 0x0f, 0x03, 0x0f, 0x03, 0x0f, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 12
0x3c, 0xff, 0x7c, 0xff, 0xf8, 0xff, 0xf0, 0xfe, 0xe0, 0xfc, 0xd0, 0xfc, 0xb0, 0xfc, 0x70, 0xfc,
0x00, 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0e, 0x0f, 0x0f, 0x0f, 0x0e, 0x0f, 0x05, 0x0f, 0x03, 0x0f, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0e, 0x0f, 0x0c, 0x0f, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 13
0x1f, 0xff, 0xbf, 0xff, 0xdc, 0xff, 0xe8, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0x7c, 0xff, 0xbf, 0xff,
0x1f, 0xff, 0x0f, 0xff, 0x00, 0xbf, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0b, 0x0f, 0x07, 0x0f, 0x07, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x02, 0x0f, 0x07, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0e, 0x0f, 0x0c, 0x0f, 0x08, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 14
0x8f, 0xff, 0xdf, 0xff, 0xee, 0xff, 0xf4, 0xff, 0xf8, 0xff, 0x7c, 0xff, 0xbe, 0xff, 0xdf, 0xff,
0x8f, 0xff, 0x07, 0xff, 0x03, 0xdf, 0x01, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0x0f, 0x0f, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x0f, 0x01, 0x0f, 0x03, 0x0f, 0x0f, 0x0f,
0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// FRAME 15
0xc7, 0xff, 0xef, 0xff, 0xf7, 0xff, 0xfa, 0xff, 0x7c, 0xff, 0xbe, 0xff, 0xdf, 0xff, 0xef, 0xff,
0x07, 0xff, 0x03, 0xff, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0f, 0x03, 0x0f, 0x01, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
| 107.194245 | 532 | 0.644631 | SSNikolaevich |
f6c8f8d6156f2ef23cb4aaa0413d9bd276361f9e | 7,859 | cpp | C++ | src/graphics/SimpleBrush3D.cpp | LU15W1R7H/lwirth-lib | f51cfb56b801790c200cea64d226730449d68f53 | [
"MIT"
] | 2 | 2018-04-04T17:26:32.000Z | 2020-06-26T09:22:49.000Z | src/graphics/SimpleBrush3D.cpp | LU15W1R7H/lwirth-lib | f51cfb56b801790c200cea64d226730449d68f53 | [
"MIT"
] | 1 | 2018-08-27T14:35:45.000Z | 2018-08-27T19:00:12.000Z | src/graphics/SimpleBrush3D.cpp | LU15W1R7H/lwirth-lib | f51cfb56b801790c200cea64d226730449d68f53 | [
"MIT"
] | null | null | null | #include "SimpleBrush3D.hpp"
#include "Color.hpp"
#include <cstring>
#include "Vulkan.hpp"
namespace lw
{
void SimpleBrush3D::setColor(const Color& color)
{
m_mainColor = color;
}
void SimpleBrush3D::setColor(f32 r, f32 g, f32 b, f32 a /*= 1.f*/)
{
m_mainColor = { r, g, b, a };
}
void SimpleBrush3D::drawVertexArray(Vertex2DArray & va)
{
/*switch (va.m_primitive)
{
case Triangles:
drawVertexArrayTriangleFill(va);
break;
case Quads:
drawVertexArrayQuadFill(va);
break;
default:
throw std::logic_error("not available");
}*/
}
void SimpleBrush3D::drawLine(const Vertex2D& start, const Vertex2D& end)
{
if (!m_ready)throw NotReadyException("SimpleBrush3D is not ready.");
m_lineVertexArray.push(start);
m_lineVertexArray.push(end);
}
void SimpleBrush3D::drawLine(f32 x1, f32 y1, f32 x2, f32 y2)
{
if (!m_ready)throw NotReadyException("SimpleBrush3D is not ready.");
m_lineVertexArray.push(Vertex2D({ x1, y1 }, m_mainColor));
m_lineVertexArray.push(Vertex2D({ x2, y2 }, m_mainColor));
}
void SimpleBrush3D::drawPoint(const Vertex2D & pos)
{
m_pointVertexArray.push(pos);
}
void SimpleBrush3D::drawPoint(f32 x, f32 y)
{
m_pointVertexArray.push(Vertex2D({ x, y }, m_mainColor));
}
void SimpleBrush3D::create(VK::Vulkan* pVulkan, u32 screenWidth, u32 screenHeight)
{
m_pVK = pVulkan;
m_screenWidth = screenWidth;
m_screenHeight = screenHeight;
m_vertexShader.create(&m_pVK->m_mainDevice, "D:/Dev/C++/My Projects/lwirth-lib/res/shaders/2Dshadervert.spv");
m_fragmentShader.create(&m_pVK->m_mainDevice, "D:/Dev/C++/My Projects/lwirth-lib/res/shaders/2Dshaderfrag.spv");
SimpleBrush3D::createPipeline();
//prepare index buffers
{
lw::List<u16> indexArrayVec = { 0, 1, 1, 2, 2, 0 };
VK::StagingBuffer stagingBuffer;
size_t dataSize = indexArrayVec.size() * sizeof(u16);
stagingBuffer.allocate(&m_pVK->m_mainDevice, dataSize);
void* dataPtr = stagingBuffer.map();
std::memcpy(dataPtr, indexArrayVec.raw(), dataSize);
stagingBuffer.unmap();
m_triangleMeshIndexBuffer.allocate(&m_pVK->m_mainDevice, &m_pVK->m_commandPool, m_pVK->m_mainDevice.getGraphicsQueue(), &stagingBuffer, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE);
stagingBuffer.destroy();
}
{
lw::List<u16> indexArrayVec = { 0, 1, 2, 2, 3, 0 };
VK::StagingBuffer stagingBuffer;
size_t dataSize = indexArrayVec.size() * sizeof(u16);
stagingBuffer.allocate(&m_pVK->m_mainDevice, dataSize);
void* dataPtr = stagingBuffer.map();
std::memcpy(dataPtr, indexArrayVec.raw(), dataSize);
stagingBuffer.unmap();
m_quadFillIndexBuffer.allocate(&m_pVK->m_mainDevice, &m_pVK->m_commandPool, m_pVK->m_mainDevice.getGraphicsQueue(), &stagingBuffer, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VK_SHARING_MODE_EXCLUSIVE);
stagingBuffer.destroy();
}
//Triangle::s_init(&m_pVK->m_device, &m_pVK->m_commandPool);
}
void SimpleBrush3D::destroy()
{
//Triangle::s_deinit();
SimpleBrush3D::destroyPipeline();
m_fragmentShader.destroy();
m_vertexShader.destroy();
}
void SimpleBrush3D::createPipeline()
{
}
void SimpleBrush3D::destroyPipeline()
{
m_pipelineTriangleFill.destroy();
m_pipelineLine.destroy();
m_pipelinePoint.destroy();
}
void SimpleBrush3D::prepare(const VK::CommandBuffer* cmd)
{
m_pCmdBuffer = cmd;
m_lineVertexArray.clear();
m_pointVertexArray.clear();
m_ready = true;
}
void SimpleBrush3D::disperse()
{
drawAllLines();
drawAllPoints();
m_pCmdBuffer = nullptr;
m_ready = false;
}
void SimpleBrush3D::resize(u32 screenWidth, u32 screenHeight)
{
m_screenWidth = screenWidth;
m_screenHeight = screenHeight;
destroyPipeline();
createPipeline();
}
void SimpleBrush3D::drawAllLines()
{
if (m_lineVertexArray.isEmpty())return;
vkCmdBindPipeline(m_pCmdBuffer->raw(), VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelineLine.raw());
VkViewport viewport;
viewport.x = 0.f;
viewport.y = 0.f;
viewport.width = static_cast<f32>(m_screenWidth);
viewport.height = static_cast<f32>(m_screenHeight);
viewport.minDepth = 0.f;
viewport.maxDepth = 1.f;
VkRect2D scissor;
scissor.offset = { 0, 0 };
scissor.extent = { m_screenWidth, m_screenHeight };
vkCmdSetViewport(m_pCmdBuffer->raw(), 0, 1, &viewport);
vkCmdSetScissor(m_pCmdBuffer->raw(), 0, 1, &scissor);
//m_lineVertexArray.updateBuffer(&m_pVK->m_device, &m_pVK->m_commandPool);
VkDeviceSize offsets[] = { 0 };
//vkCmdBindVertexBuffers(m_pCmdBuffer->raw(), 0, 1, m_lineVertexArray.m_buffer.ptr(), offsets);
vkCmdDraw(m_pCmdBuffer->raw(), m_lineVertexArray.size(), 1, 0, 0);
}
void SimpleBrush3D::drawAllPoints()
{
if (m_pointVertexArray.isEmpty())return;
vkCmdBindPipeline(m_pCmdBuffer->raw(), VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelinePoint.raw());
VkViewport viewport;
viewport.x = 0.f;
viewport.y = 0.f;
viewport.width = static_cast<f32>(m_screenWidth);
viewport.height = static_cast<f32>(m_screenHeight);
viewport.minDepth = 0.f;
viewport.maxDepth = 1.f;
VkRect2D scissor;
scissor.offset = { 0, 0 };
scissor.extent = { m_screenWidth, m_screenHeight };
vkCmdSetViewport(m_pCmdBuffer->raw(), 0, 1, &viewport);
vkCmdSetScissor(m_pCmdBuffer->raw(), 0, 1, &scissor);
//m_pointVertexArray.updateBuffer(&m_pVK->m_device, &m_pVK->m_commandPool);
VkDeviceSize offsets[] = { 0 };
//vkCmdBindVertexBuffers(m_pCmdBuffer->raw(), 0, 1, m_pointVertexArray.m_buffer.ptr(), offsets);
vkCmdDraw(m_pCmdBuffer->raw(), m_pointVertexArray.size(), 1, 0, 0);
}
void SimpleBrush3D::preparePipeline(VK::Pipeline & pipeline)
{
vkCmdBindPipeline(m_pCmdBuffer->raw(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline.raw());
VkViewport viewport;
viewport.x = 0.f;
viewport.y = 0.f;
viewport.width = static_cast<f32>(m_screenWidth);
viewport.height = static_cast<f32>(m_screenHeight);
viewport.minDepth = 0.f;
viewport.maxDepth = 1.f;
VkRect2D scissor;
scissor.offset = { 0, 0 };
scissor.extent = { m_screenWidth, m_screenHeight };
vkCmdSetViewport(m_pCmdBuffer->raw(), 0, 1, &viewport);
vkCmdSetScissor(m_pCmdBuffer->raw(), 0, 1, &scissor);
}
void SimpleBrush3D::drawVertexArrayTriangleFill(Vertex2DArray & va)
{
if (!m_ready)throw NotReadyException("SimpleBrush3D is not ready.");
if (va.isEmpty())return;
preparePipeline(m_pipelineTriangleFill);
//va.updateBuffer(&m_pVK->m_device, &m_pVK->m_commandPool);
VkDeviceSize offsets[] = { 0 };
//vkCmdBindVertexBuffers(m_pCmdBuffer->raw(), 0, 1, va.m_buffer.ptr(), offsets);
vkCmdDraw(m_pCmdBuffer->raw(), va.size(), 1, 0, 0);
}
void SimpleBrush3D::drawVertexArrayTriangleMesh(Vertex2DArray & va)
{
if (!m_ready)throw NotReadyException("SimpleBrush3D is not ready.");
if (va.isEmpty())return;
preparePipeline(m_pipelineLine);
//va.updateBuffer(&m_pVK->m_device, &m_pVK->m_commandPool);
VkDeviceSize offsets[] = { 0 };
//vkCmdBindVertexBuffers(m_pCmdBuffer->raw(), 0, 1, va.m_buffer.ptr(), offsets);
vkCmdBindIndexBuffer(m_pCmdBuffer->raw(), m_triangleMeshIndexBuffer.raw(), 0, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(m_pCmdBuffer->raw(), 6, 1, 0, 0, 0);
}
void SimpleBrush3D::drawVertexArrayQuadFill(Vertex2DArray & va)
{
if (!m_ready)throw NotReadyException("SimpleBrush3D is not ready.");
if (va.isEmpty())return;
preparePipeline(m_pipelineTriangleFill);
//va.updateBuffer(&m_pVK->m_device, &m_pVK->m_commandPool);
VkDeviceSize offsets[] = { 0 };
//vkCmdBindVertexBuffers(m_pCmdBuffer->raw(), 0, 1, va.m_buffer.ptr(), offsets);
vkCmdBindIndexBuffer(m_pCmdBuffer->raw(), m_quadFillIndexBuffer.raw(), 0, VK_INDEX_TYPE_UINT16);
for (size_t i = 0; i < va.size(); i += 4)
{
//#TODO optimize
vkCmdDrawIndexed(m_pCmdBuffer->raw(), 6, 1, 0, i, 0);
}
}
void SimpleBrush3D::drawVertexArrayQuadMesh(Vertex2DArray & va)
{
}
} | 27.006873 | 200 | 0.717267 | LU15W1R7H |
f6ce05b0de1e3e4011bda28df5b723267ddb3ca6 | 2,021 | cc | C++ | google/cloud/storage/oauth2/google_application_default_credentials_file.cc | orinem/google-cloud-cpp | c43f73e9abeb2b9d8a6e99f7d9750cba37f2f6b1 | [
"Apache-2.0"
] | 3 | 2020-05-27T23:21:23.000Z | 2020-05-31T22:31:53.000Z | google/cloud/storage/oauth2/google_application_default_credentials_file.cc | orinem/google-cloud-cpp | c43f73e9abeb2b9d8a6e99f7d9750cba37f2f6b1 | [
"Apache-2.0"
] | 2 | 2020-10-06T15:50:06.000Z | 2020-11-24T16:21:28.000Z | google/cloud/storage/oauth2/google_application_default_credentials_file.cc | orinem/google-cloud-cpp | c43f73e9abeb2b9d8a6e99f7d9750cba37f2f6b1 | [
"Apache-2.0"
] | 1 | 2021-12-09T16:26:23.000Z | 2021-12-09T16:26:23.000Z | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "google/cloud/storage/oauth2/google_application_default_credentials_file.h"
#include "google/cloud/internal/getenv.h"
#include <cstdlib>
namespace {
std::string const& GoogleWellKnownAdcFilePathSuffix() {
#ifdef _WIN32
static std::string const kSuffix =
"/gcloud/application_default_credentials.json";
#else
static std::string const kSuffix =
"/.config/gcloud/application_default_credentials.json";
#endif
return kSuffix;
}
} // anonymous namespace
namespace google {
namespace cloud {
namespace storage {
inline namespace STORAGE_CLIENT_NS {
namespace oauth2 {
std::string GoogleAdcFilePathFromEnvVarOrEmpty() {
auto override_value = google::cloud::internal::GetEnv(GoogleAdcEnvVar());
if (override_value.has_value()) {
return *override_value;
}
return "";
}
std::string GoogleAdcFilePathFromWellKnownPathOrEmpty() {
// Allow mocking out this value for testing.
auto override_path =
google::cloud::internal::GetEnv(GoogleGcloudAdcFileEnvVar());
if (override_path.has_value()) {
return *override_path;
}
// Search well known gcloud ADC path.
auto adc_path_root = google::cloud::internal::GetEnv(GoogleAdcHomeEnvVar());
if (adc_path_root.has_value()) {
return *adc_path_root + GoogleWellKnownAdcFilePathSuffix();
}
return "";
}
} // namespace oauth2
} // namespace STORAGE_CLIENT_NS
} // namespace storage
} // namespace cloud
} // namespace google
| 29.289855 | 84 | 0.743196 | orinem |
f6cec56e456f741d39f5b26d53b5a00a129ddcba | 45,523 | cpp | C++ | src/types/viewport.cpp | lifeng1983/Terminal | 1d35e180fdaacef731886bdb2cabca2ea4fe2b49 | [
"MIT"
] | 12 | 2020-07-23T16:31:06.000Z | 2021-09-08T01:49:10.000Z | src/types/viewport.cpp | lifeng1983/Terminal | 1d35e180fdaacef731886bdb2cabca2ea4fe2b49 | [
"MIT"
] | 6 | 2020-07-23T19:16:18.000Z | 2020-07-30T22:59:06.000Z | src/types/viewport.cpp | lifeng1983/Terminal | 1d35e180fdaacef731886bdb2cabca2ea4fe2b49 | [
"MIT"
] | 2 | 2020-05-22T12:54:28.000Z | 2020-08-02T15:21:14.000Z | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "inc/Viewport.hpp"
using namespace Microsoft::Console::Types;
Viewport::Viewport(const SMALL_RECT sr) noexcept :
_sr(sr)
{
}
Viewport::Viewport(const Viewport& other) noexcept :
_sr(other._sr)
{
}
Viewport Viewport::Empty() noexcept
{
return Viewport();
}
Viewport Viewport::FromInclusive(const SMALL_RECT sr) noexcept
{
return Viewport(sr);
}
Viewport Viewport::FromExclusive(const SMALL_RECT sr) noexcept
{
SMALL_RECT _sr = sr;
_sr.Bottom -= 1;
_sr.Right -= 1;
return Viewport::FromInclusive(_sr);
}
// Function Description:
// - Creates a new Viewport at the given origin, with the given dimensions.
// Arguments:
// - origin: The origin of the new Viewport. Becomes the Viewport's Left, Top
// - width: The width of the new viewport
// - height: The height of the new viewport
// Return Value:
// - a new Viewport at the given origin, with the given dimensions.
Viewport Viewport::FromDimensions(const COORD origin,
const short width,
const short height) noexcept
{
return Viewport::FromExclusive({ origin.X, origin.Y, origin.X + width, origin.Y + height });
}
// Function Description:
// - Creates a new Viewport at the given origin, with the given dimensions.
// Arguments:
// - origin: The origin of the new Viewport. Becomes the Viewport's Left, Top
// - dimensions: A coordinate containing the width and height of the new viewport
// in the x and y coordinates respectively.
// Return Value:
// - a new Viewport at the given origin, with the given dimensions.
Viewport Viewport::FromDimensions(const COORD origin,
const COORD dimensions) noexcept
{
return Viewport::FromExclusive({ origin.X, origin.Y, origin.X + dimensions.X, origin.Y + dimensions.Y });
}
// Function Description:
// - Creates a new Viewport at the origin, with the given dimensions.
// Arguments:
// - dimensions: A coordinate containing the width and height of the new viewport
// in the x and y coordinates respectively.
// Return Value:
// - a new Viewport at the origin, with the given dimensions.
Viewport Viewport::FromDimensions(const COORD dimensions) noexcept
{
return Viewport::FromDimensions({ 0 }, dimensions);
}
// Method Description:
// - Creates a Viewport equivalent to a 1x1 rectangle at the given coordinate.
// Arguments:
// - origin: origin of the rectangle to create.
// Return Value:
// - a 1x1 Viewport at the given coordinate
Viewport Viewport::FromCoord(const COORD origin) noexcept
{
return Viewport::FromInclusive({ origin.X, origin.Y, origin.X, origin.Y });
}
SHORT Viewport::Left() const noexcept
{
return _sr.Left;
}
SHORT Viewport::RightInclusive() const noexcept
{
return _sr.Right;
}
SHORT Viewport::RightExclusive() const noexcept
{
return _sr.Right + 1;
}
SHORT Viewport::Top() const noexcept
{
return _sr.Top;
}
SHORT Viewport::BottomInclusive() const noexcept
{
return _sr.Bottom;
}
SHORT Viewport::BottomExclusive() const noexcept
{
return _sr.Bottom + 1;
}
SHORT Viewport::Height() const noexcept
{
return BottomExclusive() - Top();
}
SHORT Viewport::Width() const noexcept
{
return RightExclusive() - Left();
}
// Method Description:
// - Get a coord representing the origin of this viewport.
// Arguments:
// - <none>
// Return Value:
// - the coordinates of this viewport's origin.
COORD Viewport::Origin() const noexcept
{
return { Left(), Top() };
}
// Method Description:
// - For Accessibility, get a COORD representing the end of this viewport in exclusive terms.
// - This is needed to represent an exclusive endpoint in UiaTextRange that includes the last
// COORD's text in the buffer at (RightInclusive(), BottomInclusive())
// Arguments:
// - <none>
// Return Value:
// - the coordinates of this viewport's end.
COORD Viewport::EndExclusive() const noexcept
{
return { Left(), BottomExclusive() };
}
// Method Description:
// - Get a coord representing the dimensions of this viewport.
// Arguments:
// - <none>
// Return Value:
// - the dimensions of this viewport.
COORD Viewport::Dimensions() const noexcept
{
return { Width(), Height() };
}
// Method Description:
// - Determines if the given viewport fits within this viewport.
// Arguments:
// - other - The viewport to fit inside this one
// Return Value:
// - True if it fits. False otherwise.
bool Viewport::IsInBounds(const Viewport& other) const noexcept
{
return other.Left() >= Left() && other.Left() <= RightInclusive() &&
other.RightInclusive() >= Left() && other.RightInclusive() <= RightInclusive() &&
other.Top() >= Top() && other.Top() <= other.BottomInclusive() &&
other.BottomInclusive() >= Top() && other.BottomInclusive() <= BottomInclusive();
}
// Method Description:
// - Determines if the given coordinate position lies within this viewport.
// Arguments:
// - pos - Coordinate position
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - True if it lies inside the viewport. False otherwise.
bool Viewport::IsInBounds(const COORD& pos, bool allowEndExclusive) const noexcept
{
if (allowEndExclusive && pos == EndExclusive())
{
return true;
}
return pos.X >= Left() && pos.X < RightExclusive() &&
pos.Y >= Top() && pos.Y < BottomExclusive();
}
// Method Description:
// - Clamps a coordinate position into the inside of this viewport.
// Arguments:
// - pos - coordinate to update/clamp
// Return Value:
// - <none>
void Viewport::Clamp(COORD& pos) const
{
THROW_HR_IF(E_NOT_VALID_STATE, !IsValid()); // we can't clamp to an invalid viewport.
pos.X = std::clamp(pos.X, Left(), RightInclusive());
pos.Y = std::clamp(pos.Y, Top(), BottomInclusive());
}
// Method Description:
// - Clamps a viewport into the inside of this viewport.
// Arguments:
// - other - Viewport to clamp to the inside of this viewport
// Return Value:
// - Clamped viewport
Viewport Viewport::Clamp(const Viewport& other) const noexcept
{
auto clampMe = other.ToInclusive();
clampMe.Left = std::clamp(clampMe.Left, Left(), RightInclusive());
clampMe.Right = std::clamp(clampMe.Right, Left(), RightInclusive());
clampMe.Top = std::clamp(clampMe.Top, Top(), BottomInclusive());
clampMe.Bottom = std::clamp(clampMe.Bottom, Top(), BottomInclusive());
return Viewport::FromInclusive(clampMe);
}
// Method Description:
// - Moves the coordinate given by the number of positions and
// in the direction given (repeated increment or decrement)
// Arguments:
// - move - Magnitude and direction of the move
// - pos - The coordinate position to adjust
// Return Value:
// - True if we successfully moved the requested distance. False if we had to stop early.
// - If False, we will restore the original position to the given coordinate.
bool Viewport::MoveInBounds(const ptrdiff_t move, COORD& pos) const noexcept
{
const auto backup = pos;
bool success = true; // If nothing happens, we're still successful (e.g. add = 0)
for (int i = 0; i < move; i++)
{
success = IncrementInBounds(pos);
// If an operation fails, break.
if (!success)
{
break;
}
}
for (int i = 0; i > move; i--)
{
success = DecrementInBounds(pos);
// If an operation fails, break.
if (!success)
{
break;
}
}
// If any operation failed, revert to backed up state.
if (!success)
{
pos = backup;
}
return success;
}
// Method Description:
// - Increments the given coordinate within the bounds of this viewport.
// Arguments:
// - pos - Coordinate position that will be incremented, if it can be.
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - True if it could be incremented. False if it would move outside.
bool Viewport::IncrementInBounds(COORD& pos, bool allowEndExclusive) const noexcept
{
return WalkInBounds(pos, { XWalk::LeftToRight, YWalk::TopToBottom }, allowEndExclusive);
}
// Method Description:
// - Increments the given coordinate within the bounds of this viewport
// rotating around to the top when reaching the bottom right corner.
// Arguments:
// - pos - Coordinate position that will be incremented.
// Return Value:
// - True if it could be incremented inside the viewport.
// - False if it rolled over from the bottom right corner back to the top.
bool Viewport::IncrementInBoundsCircular(COORD& pos) const noexcept
{
return WalkInBoundsCircular(pos, { XWalk::LeftToRight, YWalk::TopToBottom });
}
// Method Description:
// - Decrements the given coordinate within the bounds of this viewport.
// Arguments:
// - pos - Coordinate position that will be incremented, if it can be.
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - True if it could be incremented. False if it would move outside.
bool Viewport::DecrementInBounds(COORD& pos, bool allowEndExclusive) const noexcept
{
return WalkInBounds(pos, { XWalk::RightToLeft, YWalk::BottomToTop }, allowEndExclusive);
}
// Method Description:
// - Decrements the given coordinate within the bounds of this viewport
// rotating around to the bottom right when reaching the top left corner.
// Arguments:
// - pos - Coordinate position that will be decremented.
// Return Value:
// - True if it could be decremented inside the viewport.
// - False if it rolled over from the top left corner back to the bottom right.
bool Viewport::DecrementInBoundsCircular(COORD& pos) const noexcept
{
return WalkInBoundsCircular(pos, { XWalk::RightToLeft, YWalk::BottomToTop });
}
// Routine Description:
// - Compares two coordinate positions to determine whether they're the same, left, or right within the given buffer size
// Arguments:
// - first- The first coordinate position
// - second - The second coordinate position
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - Negative if First is to the left of the Second.
// - 0 if First and Second are the same coordinate.
// - Positive if First is to the right of the Second.
// - This is so you can do s_CompareCoords(first, second) <= 0 for "first is left or the same as second".
// (the < looks like a left arrow :D)
// - The magnitude of the result is the distance between the two coordinates when typing characters into the buffer (left to right, top to bottom)
int Viewport::CompareInBounds(const COORD& first, const COORD& second, bool allowEndExclusive) const noexcept
{
// Assert that our coordinates are within the expected boundaries
FAIL_FAST_IF(!IsInBounds(first, allowEndExclusive));
FAIL_FAST_IF(!IsInBounds(second, allowEndExclusive));
// First set the distance vertically
// If first is on row 4 and second is on row 6, first will be -2 rows behind second * an 80 character row would be -160.
// For the same row, it'll be 0 rows * 80 character width = 0 difference.
int retVal = (first.Y - second.Y) * Width();
// Now adjust for horizontal differences
// If first is in position 15 and second is in position 30, first is -15 left in relation to 30.
retVal += (first.X - second.X);
// Further notes:
// If we already moved behind one row, this will help correct for when first is right of second.
// For example, with row 4, col 79 and row 5, col 0 as first and second respectively, the distance is -1.
// Assume the row width is 80.
// Step one will set the retVal as -80 as first is one row behind the second.
// Step two will then see that first is 79 - 0 = +79 right of second and add 79
// The total is -80 + 79 = -1.
return retVal;
}
// Method Description:
// - Walks the given coordinate within the bounds of this viewport in the specified
// X and Y directions.
// Arguments:
// - pos - Coordinate position that will be adjusted, if it can be.
// - dir - Walking direction specifying which direction to go when reaching the end of a row/column
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - True if it could be adjusted as specified and remain in bounds. False if it would move outside.
bool Viewport::WalkInBounds(COORD& pos, const WalkDir dir, bool allowEndExclusive) const noexcept
{
auto copy = pos;
if (WalkInBoundsCircular(copy, dir, allowEndExclusive))
{
pos = copy;
return true;
}
else
{
return false;
}
}
// Method Description:
// - Walks the given coordinate within the bounds of this viewport
// rotating around to the opposite corner when reaching the final corner
// in the specified direction.
// Arguments:
// - pos - Coordinate position that will be adjusted.
// - dir - Walking direction specifying which direction to go when reaching the end of a row/column
// - allowEndExclusive - if true, allow the EndExclusive COORD as a valid position.
// Used in accessibility to signify that the exclusive end
// includes the last COORD in a given viewport.
// Return Value:
// - True if it could be adjusted inside the viewport.
// - False if it rolled over from the final corner back to the initial corner
// for the specified walk direction.
bool Viewport::WalkInBoundsCircular(COORD& pos, const WalkDir dir, bool allowEndExclusive) const noexcept
{
// Assert that the position given fits inside this viewport.
FAIL_FAST_IF(!IsInBounds(pos, allowEndExclusive));
if (dir.x == XWalk::LeftToRight)
{
if (allowEndExclusive && pos.X == Left() && pos.Y == BottomExclusive())
{
pos.Y = Top();
return false;
}
else if (pos.X == RightInclusive())
{
pos.X = Left();
if (dir.y == YWalk::TopToBottom)
{
pos.Y++;
if (allowEndExclusive && pos.Y == BottomExclusive())
{
return true;
}
else if (pos.Y > BottomInclusive())
{
pos.Y = Top();
return false;
}
}
else
{
pos.Y--;
if (pos.Y < Top())
{
pos.Y = BottomInclusive();
return false;
}
}
}
else
{
pos.X++;
}
}
else
{
if (pos.X == Left())
{
pos.X = RightInclusive();
if (dir.y == YWalk::TopToBottom)
{
pos.Y++;
if (pos.Y > BottomInclusive())
{
pos.Y = Top();
return false;
}
}
else
{
pos.Y--;
if (pos.Y < Top())
{
pos.Y = BottomInclusive();
return false;
}
}
}
else
{
pos.X--;
}
}
return true;
}
// Routine Description:
// - If walking through a viewport, one might want to know the origin
// for the direction walking.
// - For example, for walking up and to the left (bottom right corner
// to top left corner), the origin would start at the bottom right.
// Arguments:
// - dir - The direction one intends to walk through the viewport
// Return Value:
// - The origin for the walk to reach every position without circling
// if using this same viewport with the `WalkInBounds` methods.
COORD Viewport::GetWalkOrigin(const WalkDir dir) const noexcept
{
COORD origin{ 0 };
origin.X = dir.x == XWalk::LeftToRight ? Left() : RightInclusive();
origin.Y = dir.y == YWalk::TopToBottom ? Top() : BottomInclusive();
return origin;
}
// Routine Description:
// - Given two viewports that will be used for copying data from one to the other (source, target),
// determine which direction you will have to walk through them to ensure that an overlapped copy
// won't erase data in the source that hasn't yet been read and copied into the target at the same
// coordinate offset position from their respective origins.
// - Note: See elaborate ASCII-art comment inside the body of this function for more details on how/why this works.
// Arguments:
// - source - The viewport representing the region that will be copied from
// - target - The viewport representing the region that will be copied to
// Return Value:
// - The direction to walk through both viewports from the walk origins to touch every cell and not
// accidentally overwrite something that hasn't been read yet. (use with GetWalkOrigin and WalkInBounds)
Viewport::WalkDir Viewport::DetermineWalkDirection(const Viewport& source, const Viewport& target) noexcept
{
// We can determine which direction we need to walk based on solely the origins of the two rectangles.
// I'll use a few examples to prove the situation.
//
// For the cardinal directions, let's start with this sample:
//
// source target
// origin 0,0 origin 4,0
// | |
// v V
// +--source-----+--target--------- +--source-----+--target---------
// | A B C D | E | 1 2 3 4 | becomes | A B C D | A | B C D E |
// | F G H I | J | 5 6 7 8 | =========> | F G H I | F | G H I J |
// | K L M N | O | 9 $ % @ | | K L M N | K | L M N O |
// -------------------------------- --------------------------------
//
// The source and target overlap in the 5th column (X=4).
// To ensure that we don't accidentally write over the source
// data before we copy it into the target, we want to start by
// reading that column (a.k.a. writing to the farthest away column
// of the target).
//
// This means we want to copy from right to left.
// Top to bottom and bottom to top don't really matter for this since it's
// a cardinal direction shift.
//
// If we do the right most column first as so...
//
// +--source-----+--target--------- +--source-----+--target---------
// | A B C D | E | 1 2 3 4 | step 1 | A B C D | E | 1 2 3 E |
// | F G H I | J | 5 6 7 8 | =========> | F G H I | J | 5 6 7 J |
// | K L M N | O | 9 $ % @ | | K L M N | O | 9 $ % O |
// -------------------------------- --------------------------------
//
// ... then we can see that the EJO column is safely copied first out of the way and
// can be overwritten on subsequent steps without losing anything.
// The rest of the columns aren't overlapping, so they'll be fine.
//
// But we extrapolate this logic to follow for rectangles that overlap more columns, up
// to and including only leaving one column not overlapped...
//
// source target
// origin origin
// 0,0 / 1,0
// | /
// v v
// +----+------target- +----+------target-
// | A | B C D | E | becomes | A | A B C | D |
// | F | G H I | J | =========> | F | F G H | I |
// | K | L M N | O | | K | K L M | N |
// ---source---------- ---source----------
//
// ... will still be OK following the same Right-To-Left rule as the first move.
//
// +----+------target- +----+------target-
// | A | B C D | E | step 1 | A | B C D | D |
// | F | G H I | J | =========> | F | G H I | I |
// | K | L M N | O | | K | L M N | N |
// ---source---------- ---source----------
//
// The DIN column from the source was moved to the target as the right most column
// of both rectangles. Now it is safe to iterate to the second column from the right
// and proceed with moving CHM on top of the source DIN as it was already moved.
//
// +----+------target- +----+------target-
// | A | B C D | E | step 2 | A | B C C | D |
// | F | G H I | J | =========> | F | G H H | I |
// | K | L M N | O | | K | L M M | N |
// ---source---------- ---source----------
//
// Continue walking right to left (an exercise left to the reader,) and we never lose
// any source data before it reaches the target with the Right To Left pattern.
//
// We notice that the target origin was Right of the source origin in this circumstance,
// (target origin X is > source origin X)
// so it is asserted that targets right of sources means that we should "walk" right to left.
//
// Reviewing the above, it doesn't appear to matter if we go Top to Bottom or Bottom to Top,
// so the conclusion is drawn that it doesn't matter as long as the source and target origin
// Y values are the same.
//
// Also, extrapolating this cardinal direction move to the other 3 cardinal directions,
// it should follow that they would follow the same rules.
// That is, a target left of a source, or a Westbound move, opposite of the above Eastbound move,
// should be "walked" left to right.
// (target origin X is < source origin X)
//
// We haven't given the sample yet that Northbound and Southbound moves are the same, but we
// could reason that the same logic applies and the conclusion would be a Northbound move
// would walk from the target toward the source again... a.k.a. Top to Bottom.
// (target origin Y is < source origin Y)
// Then the Southbound move would be the opposite, Bottom to Top.
// (target origin Y is > source origin Y)
//
// To confirm, let's try one more example but moving both at once in an ordinal direction Northeast.
//
// target
// origin 1, 0
// |
// v
// +----target-- +----target--
// source A | B C | A | D E |
// origin-->+------------ | becomes +------------ |
// 0, 1 | D | E | F | =========> | D | G | H |
// | ------------- | -------------
// | G H | I | G H | I
// --source----- --source-----
//
// Following our supposed rules from above, we have...
// Source Origin X = 0, Y = 1
// Target Origin X = 1, Y = 0
//
// Source Origin X < Target Origin X which means Right to Left
// Source Origin Y > Target Origin Y which means Top to Bottom
//
// So the first thing we should copy is the Top and Right most
// value from source to target.
//
// +----target-- +----target--
// A | B C | A | B E |
// +------------ | step 1 +------------ |
// | D | E | F | =========> | D | E | F |
// | ------------- | -------------
// | G H | I | G H | I
// --source----- --source-----
//
// And look. The E which was in the overlapping part of the source
// is the first thing copied out of the way and we're safe to copy the rest.
//
// We assume that this pattern then applies to all ordinal directions as well
// and it appears our rules hold.
//
// We've covered all cardinal and ordinal directions... all that is left is two
// rectangles of the same size and origin... and in that case, it doesn't matter
// as nothing is moving and therefore can't be covered up or lost.
//
// Therefore, we will codify our inequalities below as determining the walk direction
// for a given source and target viewport and use the helper `GetWalkOrigin`
// to return the place that we should start walking from when the copy commences.
const auto sourceOrigin = source.Origin();
const auto targetOrigin = target.Origin();
return Viewport::WalkDir{ targetOrigin.X < sourceOrigin.X ? Viewport::XWalk::LeftToRight : Viewport::XWalk::RightToLeft,
targetOrigin.Y < sourceOrigin.Y ? Viewport::YWalk::TopToBottom : Viewport::YWalk::BottomToTop };
}
// Method Description:
// - Clips the input rectangle to our bounds. Assumes that the input rectangle
//is an exclusive rectangle.
// Arguments:
// - psr: a pointer to an exclusive rect to clip.
// Return Value:
// - true iff the clipped rectangle is valid (with a width and height both >0)
bool Viewport::TrimToViewport(_Inout_ SMALL_RECT* const psr) const noexcept
{
psr->Left = std::max(psr->Left, Left());
psr->Right = std::min(psr->Right, RightExclusive());
psr->Top = std::max(psr->Top, Top());
psr->Bottom = std::min(psr->Bottom, BottomExclusive());
return psr->Left < psr->Right && psr->Top < psr->Bottom;
}
// Method Description:
// - Translates the input SMALL_RECT out of our coordinate space, whose origin is
// at (this.Left, this.Right)
// Arguments:
// - psr: a pointer to a SMALL_RECT the translate into our coordinate space.
// Return Value:
// - <none>
void Viewport::ConvertToOrigin(_Inout_ SMALL_RECT* const psr) const noexcept
{
const short dx = Left();
const short dy = Top();
psr->Left -= dx;
psr->Right -= dx;
psr->Top -= dy;
psr->Bottom -= dy;
}
// Method Description:
// - Translates the input coordinate out of our coordinate space, whose origin is
// at (this.Left, this.Right)
// Arguments:
// - pcoord: a pointer to a coordinate the translate into our coordinate space.
// Return Value:
// - <none>
void Viewport::ConvertToOrigin(_Inout_ COORD* const pcoord) const noexcept
{
pcoord->X -= Left();
pcoord->Y -= Top();
}
// Method Description:
// - Translates the input SMALL_RECT to our coordinate space, whose origin is
// at (this.Left, this.Right)
// Arguments:
// - psr: a pointer to a SMALL_RECT the translate into our coordinate space.
// Return Value:
// - <none>
void Viewport::ConvertFromOrigin(_Inout_ SMALL_RECT* const psr) const noexcept
{
const short dx = Left();
const short dy = Top();
psr->Left += dx;
psr->Right += dx;
psr->Top += dy;
psr->Bottom += dy;
}
// Method Description:
// - Translates the input coordinate to our coordinate space, whose origin is
// at (this.Left, this.Right)
// Arguments:
// - pcoord: a pointer to a coordinate the translate into our coordinate space.
// Return Value:
// - <none>
void Viewport::ConvertFromOrigin(_Inout_ COORD* const pcoord) const noexcept
{
pcoord->X += Left();
pcoord->Y += Top();
}
// Method Description:
// - Returns an exclusive SMALL_RECT equivalent to this viewport.
// Arguments:
// - <none>
// Return Value:
// - an exclusive SMALL_RECT equivalent to this viewport.
SMALL_RECT Viewport::ToExclusive() const noexcept
{
return { Left(), Top(), RightExclusive(), BottomExclusive() };
}
// Method Description:
// - Returns an exclusive RECT equivalent to this viewport.
// Arguments:
// - <none>
// Return Value:
// - an exclusive RECT equivalent to this viewport.
RECT Viewport::ToRect() const noexcept
{
RECT r{ 0 };
r.left = Left();
r.top = Top();
r.right = RightExclusive();
r.bottom = BottomExclusive();
return r;
}
// Method Description:
// - Returns an inclusive SMALL_RECT equivalent to this viewport.
// Arguments:
// - <none>
// Return Value:
// - an inclusive SMALL_RECT equivalent to this viewport.
SMALL_RECT Viewport::ToInclusive() const noexcept
{
return { Left(), Top(), RightInclusive(), BottomInclusive() };
}
// Method Description:
// - Returns a new viewport representing this viewport at the origin.
// For example:
// this = {6, 5, 11, 11} (w, h = 5, 6)
// result = {0, 0, 5, 6} (w, h = 5, 6)
// Arguments:
// - <none>
// Return Value:
// - a new viewport with the same dimensions as this viewport with top, left = 0, 0
Viewport Viewport::ToOrigin() const noexcept
{
Viewport returnVal = *this;
ConvertToOrigin(&returnVal._sr);
return returnVal;
}
// Method Description:
// - Translates another viewport to this viewport's coordinate space.
// For example:
// this = {5, 6, 7, 8} (w,h = 1, 1)
// other = {6, 5, 11, 11} (w, h = 5, 6)
// result = {1, -1, 6, 5} (w, h = 5, 6)
// Arguments:
// - other: the viewport to convert to this coordinate space
// Return Value:
// - the input viewport in a the coordinate space with origin at (this.Top, this.Left)
[[nodiscard]] Viewport Viewport::ConvertToOrigin(const Viewport& other) const noexcept
{
Viewport returnVal = other;
ConvertToOrigin(&returnVal._sr);
return returnVal;
}
// Method Description:
// - Translates another viewport out of this viewport's coordinate space.
// For example:
// this = {5, 6, 7, 8} (w,h = 1, 1)
// other = {0, 0, 5, 6} (w, h = 5, 6)
// result = {5, 6, 10, 12} (w, h = 5, 6)
// Arguments:
// - other: the viewport to convert out of this coordinate space
// Return Value:
// - the input viewport in a the coordinate space with origin at (0, 0)
[[nodiscard]] Viewport Viewport::ConvertFromOrigin(const Viewport& other) const noexcept
{
Viewport returnVal = other;
ConvertFromOrigin(&returnVal._sr);
return returnVal;
}
// Function Description:
// - Translates a given Viewport by the specified coord amount. Does the
// addition with safemath.
// Arguments:
// - original: The initial viewport to translate. Is unmodified by this operation.
// - delta: The amount to translate the original rect by, in both the x and y coordinates.
// Return Value:
// - The offset viewport by the given delta.
// - NOTE: Throws on safe math failure.
[[nodiscard]] Viewport Viewport::Offset(const Viewport& original, const COORD delta)
{
// If there's no delta, do nothing.
if (delta.X == 0 && delta.Y == 0)
{
return original;
}
SHORT newTop = original._sr.Top;
SHORT newLeft = original._sr.Left;
SHORT newRight = original._sr.Right;
SHORT newBottom = original._sr.Bottom;
THROW_IF_FAILED(ShortAdd(newLeft, delta.X, &newLeft));
THROW_IF_FAILED(ShortAdd(newRight, delta.X, &newRight));
THROW_IF_FAILED(ShortAdd(newTop, delta.Y, &newTop));
THROW_IF_FAILED(ShortAdd(newBottom, delta.Y, &newBottom));
return Viewport({ newLeft, newTop, newRight, newBottom });
}
// Function Description:
// - Returns a viewport created from the union of both the parameter viewports.
// The result extends from the leftmost extent of either rect to the
// rightmost extent of either rect, and from the lowest top value to the
// highest bottom value, and everything in between.
// Arguments:
// - lhs: one of the viewports to or together
// - rhs: the other viewport to or together
// Return Value:
// - a Viewport representing the union of the other two viewports.
[[nodiscard]] Viewport Viewport::Union(const Viewport& lhs, const Viewport& rhs) noexcept
{
const auto leftValid = lhs.IsValid();
const auto rightValid = rhs.IsValid();
// If neither are valid, return empty.
if (!leftValid && !rightValid)
{
return Viewport::Empty();
}
// If left isn't valid, then return just the right.
else if (!leftValid)
{
return rhs;
}
// If right isn't valid, then return just the left.
else if (!rightValid)
{
return lhs;
}
// Otherwise, everything is valid. Find the actual union.
else
{
const auto left = std::min(lhs.Left(), rhs.Left());
const auto top = std::min(lhs.Top(), rhs.Top());
const auto right = std::max(lhs.RightInclusive(), rhs.RightInclusive());
const auto bottom = std::max(lhs.BottomInclusive(), rhs.BottomInclusive());
return Viewport({ left, top, right, bottom });
}
}
// Function Description:
// - Creates a viewport from the intersection fo both the parameter viewports.
// The result will be the smallest area that fits within both rectangles.
// Arguments:
// - lhs: one of the viewports to intersect
// - rhs: the other viewport to intersect
// Return Value:
// - a Viewport representing the intersection of the other two, or an empty viewport if there's no intersection.
[[nodiscard]] Viewport Viewport::Intersect(const Viewport& lhs, const Viewport& rhs) noexcept
{
const auto left = std::max(lhs.Left(), rhs.Left());
const auto top = std::max(lhs.Top(), rhs.Top());
const auto right = std::min(lhs.RightInclusive(), rhs.RightInclusive());
const auto bottom = std::min(lhs.BottomInclusive(), rhs.BottomInclusive());
const Viewport intersection({ left, top, right, bottom });
// What we calculated with min/max might not actually represent a valid viewport that has area.
// If we calculated something that is nonsense (invalid), then just return the empty viewport.
if (!intersection.IsValid())
{
return Viewport::Empty();
}
else
{
// If it was valid, give back whatever we created.
return intersection;
}
}
// Routine Description:
// - Returns a list of Viewports representing the area from the `original` Viewport that was NOT a part of
// the given `removeMe` Viewport. It can require multiple Viewports to represent the remaining
// area as a "region".
// Arguments:
// - original - The overall viewport to start from.
// - removeMe - The space that should be taken out of the main Viewport.
// Return Value:
// - Array of 4 Viewports representing non-overlapping segments of the remaining area
// that was covered by `main` before the regional area of `removeMe` was taken out.
// - You must check that each viewport .IsValid() before using it.
[[nodiscard]] SomeViewports Viewport::Subtract(const Viewport& original, const Viewport& removeMe) noexcept
try
{
SomeViewports result;
// We could have up to four rectangles describing the area resulting when you take removeMe out of main.
// Find the intersection of the two so we know which bits of removeMe are actually applicable
// to the original rectangle for subtraction purposes.
const auto intersection = Viewport::Intersect(original, removeMe);
// If there's no intersection, there's nothing to remove.
if (!intersection.IsValid())
{
// Just put the original rectangle into the results and return early.
result.push_back(original);
}
// If the original rectangle matches the intersection, there is nothing to return.
else if (original != intersection)
{
// Generate our potential four viewports that represent the region of the original that falls outside of the remove area.
// We will bias toward generating wide rectangles over tall rectangles (if possible) so that optimizations that apply
// to manipulating an entire row at once can be realized by other parts of the console code. (i.e. Run Length Encoding)
// In the following examples, the found remaining regions are represented by:
// T = Top B = Bottom L = Left R = Right
//
// 4 Sides but Identical:
// |---------original---------| |---------original---------|
// | | | |
// | | | |
// | | | |
// | | ======> | intersect | ======> early return of nothing
// | | | |
// | | | |
// | | | |
// |---------removeMe---------| |--------------------------|
//
// 4 Sides:
// |---------original---------| |---------original---------| |--------------------------|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | |---------| | | |---------| | |LLLLLLLL|---------|RRRRRRR|
// | |removeMe | | ======> | |intersect| | ======> |LLLLLLLL| |RRRRRRR|
// | |---------| | | |---------| | |LLLLLLLL|---------|RRRRRRR|
// | | | | |BBBBBBBBBBBBBBBBBBBBBBBBBB|
// | | | | |BBBBBBBBBBBBBBBBBBBBBBBBBB|
// |--------------------------| |--------------------------| |--------------------------|
//
// 3 Sides:
// |---------original---------| |---------original---------| |--------------------------|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | |--------------------| | |-----------------| |LLLLLLLL|-----------------|
// | |removeMe | ======> | |intersect | ======> |LLLLLLLL| |
// | |--------------------| | |-----------------| |LLLLLLLL|-----------------|
// | | | | |BBBBBBBBBBBBBBBBBBBBBBBBBB|
// | | | | |BBBBBBBBBBBBBBBBBBBBBBBBBB|
// |--------------------------| |--------------------------| |--------------------------|
//
// 2 Sides:
// |---------original---------| |---------original---------| |--------------------------|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | |--------------------| | |-----------------| |LLLLLLLL|-----------------|
// | |removeMe | ======> | |intersect | ======> |LLLLLLLL| |
// | | | | | | |LLLLLLLL| |
// | | | | | | |LLLLLLLL| |
// | | | | | | |LLLLLLLL| |
// |--------| | |--------------------------| |--------------------------|
// | |
// |--------------------|
//
// 1 Side:
// |---------original---------| |---------original---------| |--------------------------|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// | | | | |TTTTTTTTTTTTTTTTTTTTTTTTTT|
// |-----------------------------| |--------------------------| |--------------------------|
// | removeMe | ======> | intersect | ======> | |
// | | | | | |
// | | | | | |
// | | | | | |
// | | |--------------------------| |--------------------------|
// | |
// |-----------------------------|
//
// 0 Sides:
// |---------original---------| |---------original---------|
// | | | |
// | | | |
// | | | |
// | | ======> | | ======> early return of Original
// | | | |
// | | | |
// | | | |
// |--------------------------| |--------------------------|
//
//
// |---------------|
// | removeMe |
// |---------------|
// We generate these rectangles by the original and intersection points, but some of them might be empty when the intersection
// lines up with the edge of the original. That's OK. That just means that the subtraction didn't leave anything behind.
// We will filter those out below when adding them to the result.
const auto top = Viewport({ original.Left(), original.Top(), original.RightInclusive(), intersection.Top() - 1 });
const auto bottom = Viewport({ original.Left(), intersection.BottomExclusive(), original.RightInclusive(), original.BottomInclusive() });
const auto left = Viewport({ original.Left(), intersection.Top(), intersection.Left() - 1, intersection.BottomInclusive() });
const auto right = Viewport({ intersection.RightExclusive(), intersection.Top(), original.RightInclusive(), intersection.BottomInclusive() });
if (top.IsValid())
{
result.push_back(top);
}
if (bottom.IsValid())
{
result.push_back(bottom);
}
if (left.IsValid())
{
result.push_back(left);
}
if (right.IsValid())
{
result.push_back(right);
}
}
return result;
}
CATCH_FAIL_FAST()
// Method Description:
// - Returns true if the rectangle described by this Viewport has internal space
// - i.e. it has a positive, non-zero height and width.
bool Viewport::IsValid() const noexcept
{
return Height() > 0 && Width() > 0;
}
| 42.073013 | 151 | 0.536564 | lifeng1983 |
f6cf89f7e535ebbb50079b8f58a06dda2052430b | 3,133 | cpp | C++ | src/Device/VertexProcessor.cpp | wenxiaoming/swiftshader | 13ec11db84e85fd5d53b5d8d59c55853eb854fe6 | [
"Apache-2.0"
] | null | null | null | src/Device/VertexProcessor.cpp | wenxiaoming/swiftshader | 13ec11db84e85fd5d53b5d8d59c55853eb854fe6 | [
"Apache-2.0"
] | null | null | null | src/Device/VertexProcessor.cpp | wenxiaoming/swiftshader | 13ec11db84e85fd5d53b5d8d59c55853eb854fe6 | [
"Apache-2.0"
] | 5 | 2021-06-11T15:09:19.000Z | 2022-03-13T11:14:33.000Z | // Copyright 2016 The SwiftShader 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 "VertexProcessor.hpp"
#include "Pipeline/VertexProgram.hpp"
#include "Pipeline/Constants.hpp"
#include "System/Math.hpp"
#include "Vulkan/VkDebug.hpp"
#include <cstring>
namespace sw
{
void VertexCache::clear()
{
for(uint32_t i = 0; i < SIZE; i++)
{
tag[i] = 0xFFFFFFFF;
}
}
uint32_t VertexProcessor::States::computeHash()
{
uint32_t *state = reinterpret_cast<uint32_t*>(this);
uint32_t hash = 0;
for(unsigned int i = 0; i < sizeof(States) / sizeof(uint32_t); i++)
{
hash ^= state[i];
}
return hash;
}
bool VertexProcessor::State::operator==(const State &state) const
{
if(hash != state.hash)
{
return false;
}
static_assert(is_memcmparable<State>::value, "Cannot memcmp States");
return memcmp(static_cast<const States*>(this), static_cast<const States*>(&state), sizeof(States)) == 0;
}
VertexProcessor::VertexProcessor()
{
routineCache = nullptr;
setRoutineCacheSize(1024);
}
VertexProcessor::~VertexProcessor()
{
delete routineCache;
routineCache = nullptr;
}
void VertexProcessor::setRoutineCacheSize(int cacheSize)
{
delete routineCache;
routineCache = new RoutineCache<State>(clamp(cacheSize, 1, 65536));
}
const VertexProcessor::State VertexProcessor::update(const sw::Context* context)
{
State state;
state.shaderID = context->vertexShader->getSerialID();
for(int i = 0; i < MAX_INTERFACE_COMPONENTS / 4; i++)
{
state.input[i].type = context->input[i].type;
state.input[i].count = context->input[i].count;
state.input[i].normalized = context->input[i].normalized;
// TODO: get rid of attribType -- just keep the VK format all the way through, this fully determines
// how to handle the attribute.
state.input[i].attribType = context->vertexShader->inputs[i*4].Type;
}
state.hash = state.computeHash();
return state;
}
Routine *VertexProcessor::routine(const State &state,
vk::PipelineLayout const *pipelineLayout,
SpirvShader const *vertexShader,
const vk::DescriptorSet::Bindings &descriptorSets)
{
Routine *routine = routineCache->query(state);
if(!routine) // Create one
{
VertexRoutine *generator = new VertexProgram(state, pipelineLayout, vertexShader, descriptorSets);
generator->generate();
routine = (*generator)("VertexRoutine_%0.8X", state.shaderID);
delete generator;
routineCache->add(state, routine);
}
return routine;
}
}
| 26.777778 | 107 | 0.688158 | wenxiaoming |
f6d3dc11620d400ff83228bcf024300c31efa7d6 | 3,115 | cpp | C++ | cmdstan/stan/lib/stan_math/test/unit/math/torsten/mixSolver/pred1_mix2_test.cpp | csetraynor/Torsten | 55b59b8068e2a539346f566ec698c755a9e3536c | [
"BSD-3-Clause"
] | null | null | null | cmdstan/stan/lib/stan_math/test/unit/math/torsten/mixSolver/pred1_mix2_test.cpp | csetraynor/Torsten | 55b59b8068e2a539346f566ec698c755a9e3536c | [
"BSD-3-Clause"
] | null | null | null | cmdstan/stan/lib/stan_math/test/unit/math/torsten/mixSolver/pred1_mix2_test.cpp | csetraynor/Torsten | 55b59b8068e2a539346f566ec698c755a9e3536c | [
"BSD-3-Clause"
] | null | null | null | #include <stan/math/rev/mat.hpp> // FIX ME - more specific
#include <stan/math/torsten/PKModel/Pred/Pred1_mix2.hpp>
#include <stan/math/torsten/PKModel/functors/mix2_functor.hpp>
#include <gtest/gtest.h>
struct ODE_functor {
template <typename T0, typename T1, typename T2, typename T3>
inline
std::vector<typename boost::math::tools::promote_args<T0, T1, T2, T3>::type>
operator()(const T0& t,
const std::vector<T1>& y,
const std::vector<T2>& y_pk,
const std::vector<T3>& theta,
const std::vector<double>& x_r,
const std::vector<int>& x_i,
std::ostream* pstream_) const {
typedef typename boost::math::tools::promote_args<T0, T1, T2, T3>::type
scalar;
scalar VC = theta[2],
Mtt = theta[5],
circ0 = theta[6],
alpha = theta[7],
gamma = theta[8],
ktr = 4 / Mtt,
prol = y[0] + circ0,
transit = y[1] + circ0,
circ = y[2] + circ0,
conc = y_pk[1] / VC,
Edrug = alpha * conc;
std::vector<scalar> dxdt(3);
dxdt[0] = ktr * prol * ((1 - Edrug) * pow(circ0 / circ, gamma) - 1);
dxdt[1] = ktr * (prol - transit);
dxdt[2] = ktr * (transit - circ);
return dxdt;
}
};
TEST(Torsten, pred1_mix) {
using Eigen::Matrix;
using Eigen::Dynamic;
double dt = 1.0;
int nParameters = 9;
std::vector<double> parameters(nParameters);
parameters[0] = 10; // CL
parameters[1] = 15; // Q
parameters[2] = 35; // VC
parameters[3] = 105; // VP
parameters[4] = 2.0; // ka
parameters[5] = 125; // Mtt
parameters[6] = 5; // Circ0
parameters[7] = 3e-4; // alpha
parameters[8] = 0.17; // gamma
std::vector<double> biovar_dummy(1, 0);
std::vector<double> tlag_dummy(1, 0);
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> K(0, 0);
// initialize Model Parameters object
torsten::ModelParameters<double, double, double, double>
parms(dt, parameters, biovar_dummy, tlag_dummy);
int nOdes = 6;
Matrix<double, 1, Dynamic> init(nOdes);
init << 10000, 0, 0, 0, 0, 0; // initial dose in the gut
std::vector<double> rate(6, 0); // no rate
// Use default value of parameters
double rel_tol = 1e-6, abs_tol = 1e-6;
long int max_num_steps = 1e+6;
typedef torsten::mix2_functor<ODE_functor> F0;
torsten::Pred1_mix2<F0> Pred1(F0(ODE_functor()), rel_tol, abs_tol, max_num_steps, 0,
"rk45");
Matrix<double, 1, Dynamic> pred = Pred1(dt, parms, init, rate);
// Compare to results obtained with mrgsolve
Eigen::VectorXd mrgResults(6);
mrgResults << 1353.352829, 5597.489, 1787.0134,
-0.0060546255, -7.847821e-05, -7.039447e-07;
// PK compartments
EXPECT_FLOAT_EQ(mrgResults(0), pred(0));
EXPECT_FLOAT_EQ(mrgResults(1), pred(1));
EXPECT_FLOAT_EQ(mrgResults(2), pred(2));
// PD compartments
// (are estimated less accurately)
EXPECT_NEAR(mrgResults(3), pred(3), std::abs(mrgResults(3) * 1e-4));
EXPECT_NEAR(mrgResults(4), pred(4), std::abs(mrgResults(4) * 1e-4));
EXPECT_NEAR(mrgResults(5), pred(5), std::abs(mrgResults(5) * 1e-4));
}
| 31.464646 | 86 | 0.61862 | csetraynor |
f6d9d896e4f0834d9c5c3285e409dc3be35914be | 343 | cpp | C++ | 14/1448. Count Good Nodes in Binary Tree.cpp | eagleoflqj/LeetCode | ca5dd06cad4c7fe5bf679cca7ee60f4348b316e9 | [
"MIT"
] | null | null | null | 14/1448. Count Good Nodes in Binary Tree.cpp | eagleoflqj/LeetCode | ca5dd06cad4c7fe5bf679cca7ee60f4348b316e9 | [
"MIT"
] | 1 | 2021-12-25T10:33:23.000Z | 2022-02-16T00:34:05.000Z | 14/1448. Count Good Nodes in Binary Tree.cpp | eagleoflqj/LeetCode | ca5dd06cad4c7fe5bf679cca7ee60f4348b316e9 | [
"MIT"
] | null | null | null | class Solution {
int helper(TreeNode *root, int M) {
if(!root)
return 0;
int good = root->val >= M;
if(good)
M = root->val;
return good + helper(root->left, M) + helper(root->right, M);
}
public:
int goodNodes(TreeNode* root) {
return helper(root, INT_MIN);
}
};
| 22.866667 | 69 | 0.507289 | eagleoflqj |
f6dc0ededa96ca4ebf070ed8249ab09c2e49f76e | 318 | cpp | C++ | Entrega4/ComparacionAviones.cpp | driden/EntregaGrafos4 | 90d5d3d82580725b1bc7161e2191ba5bbfd98041 | [
"MIT"
] | null | null | null | Entrega4/ComparacionAviones.cpp | driden/EntregaGrafos4 | 90d5d3d82580725b1bc7161e2191ba5bbfd98041 | [
"MIT"
] | null | null | null | Entrega4/ComparacionAviones.cpp | driden/EntregaGrafos4 | 90d5d3d82580725b1bc7161e2191ba5bbfd98041 | [
"MIT"
] | null | null | null | #include "ComparacionAviones.h"
CompRetorno ComparacionAviones::Comparar(const CostoArco& t1, const CostoArco& t2) const
{
if (t1.aviones > t2.aviones) return MAYOR;
if (t1.aviones < t2.aviones) return MENOR;
if (t1.tiempo > t2.tiempo) return MAYOR;
if (t1.tiempo < t2.tiempo) return MENOR;
return IGUALES;
}
| 24.461538 | 88 | 0.732704 | driden |
f6e20bd24fe446d6ee2b78b8fc1984a92e4e832f | 4,755 | cpp | C++ | Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp | gaschler/cgal | d1fe2afa18da5524db6d4946f42ca4b8d00e0bda | [
"CC0-1.0"
] | 2 | 2020-12-12T09:30:07.000Z | 2021-01-04T05:00:23.000Z | Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp | guorongtao/cgal | a848e52552a9205124b7ae13c7bcd2b860eb4530 | [
"CC0-1.0"
] | 1 | 2021-03-12T14:38:20.000Z | 2021-03-12T14:38:20.000Z | Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp | szobov/cgal | e7b91b92b8c6949e3b62023bdd1e9f3ad8472626 | [
"CC0-1.0"
] | 1 | 2022-03-05T04:18:59.000Z | 2022-03-05T04:18:59.000Z | // STL includes.
#include <string>
#include <vector>
#include <utility>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <iterator>
// CGAL includes.
#include <CGAL/Timer.h>
#include <CGAL/property_map.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Shape_detection/Region_growing/Region_growing.h>
#include <CGAL/Shape_detection/Region_growing/Region_growing_on_point_set.h>
namespace SD = CGAL::Shape_detection;
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using FT = typename Kernel::FT;
using Point_2 = typename Kernel::Point_2;
using Vector_2 = typename Kernel::Vector_2;
using Point_with_normal = std::pair<Point_2, Vector_2>;
using Input_range = std::vector<Point_with_normal>;
using Point_map = CGAL::First_of_pair_property_map<Point_with_normal>;
using Normal_map = CGAL::Second_of_pair_property_map<Point_with_normal>;
using Neighbor_query = SD::Point_set::Sphere_neighbor_query<Kernel, Input_range, Point_map>;
using Region_type = SD::Point_set::Least_squares_line_fit_region<Kernel, Input_range, Point_map, Normal_map>;
using Region_growing = SD::Region_growing<Input_range, Neighbor_query, Region_type>;
using Timer = CGAL::Timer;
using Region = std::vector<std::size_t>;
void benchmark_region_growing_on_point_set_2(
const std::size_t test_count,
const Input_range& input_range,
const FT sphere_radius,
const FT distance_threshold,
const FT angle_threshold,
const std::size_t min_region_size) {
// Create instances of the parameter classes.
Neighbor_query neighbor_query(
input_range,
sphere_radius);
Region_type region_type(
input_range,
distance_threshold, angle_threshold, min_region_size);
// Create an instance of the region growing class.
Region_growing region_growing(
input_range, neighbor_query, region_type);
// Run the algorithm.
Timer timer;
std::vector<Region> regions;
timer.start();
region_growing.detect(std::back_inserter(regions));
timer.stop();
// Compute the number of points assigned to all found regions.
std::size_t number_of_assigned_points = 0;
for (const auto& region : regions)
number_of_assigned_points += region.size();
std::vector<std::size_t> unassigned_points;
region_growing.unassigned_items(std::back_inserter(unassigned_points));
// Print statistics.
std::cout << "Test #" << test_count << std::endl;
std::cout << " sphere_radius = " << sphere_radius << std::endl;
std::cout << " min_region_size = " << min_region_size << std::endl;
std::cout << " distance_threshold = " << distance_threshold << std::endl;
std::cout << " angle_threshold = " << angle_threshold << std::endl;
std::cout << " -----" << std::endl;
std::cout << " Time elapsed: " << timer.time() << std::endl;
std::cout << " Number of detected regions: " << regions.size() << std::endl;
std::cout << " Number of assigned points: " << number_of_assigned_points << std::endl;
std::cout << " Number of unassigned points: " << unassigned_points.size() << std::endl;
std::cout << std::endl << std::endl;
}
int main(int argc, char *argv[]) {
// Load xyz data either from a local folder or a user-provided file.
std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz");
CGAL::set_ascii_mode(in);
if (!in) {
std::cout <<
"Error: cannot read the file point_set_2.xyz!" << std::endl;
std::cout <<
"You can either create a symlink to the data folder or provide this file by hand."
<< std::endl << std::endl;
return EXIT_FAILURE;
}
Input_range input_range;
FT a, b, c, d, e, f;
while (in >> a >> b >> c >> d >> e >> f)
input_range.push_back(std::make_pair(Point_2(a, b), Vector_2(d, e)));
in.close();
// Default parameter values for the data file point_set_2.xyz.
const FT distance_threshold = FT(45) / FT(10);
const FT angle_threshold = FT(45);
const std::size_t min_region_size = 5;
// Run benchmarks.
benchmark_region_growing_on_point_set_2(1, input_range, FT(1),
distance_threshold, angle_threshold, min_region_size);
benchmark_region_growing_on_point_set_2(2, input_range, FT(3),
distance_threshold, angle_threshold, min_region_size);
benchmark_region_growing_on_point_set_2(3, input_range, FT(6),
distance_threshold, angle_threshold, min_region_size);
benchmark_region_growing_on_point_set_2(4, input_range, FT(9),
distance_threshold, angle_threshold, min_region_size);
return EXIT_SUCCESS;
}
| 36.29771 | 112 | 0.686225 | gaschler |
f6e31b47bf971e8872a7819ad50a0b4387374e04 | 4,835 | cpp | C++ | nano/nano_rpc/entry.cpp | MacroChip/nano-node | d555eae77a564550c76cc541a47d297a1dcd59d1 | [
"BSD-2-Clause"
] | 1 | 2021-05-23T11:23:01.000Z | 2021-05-23T11:23:01.000Z | nano/nano_rpc/entry.cpp | Nikolya7373/nano-node | c673e4e340f46351786b1b5267b7e1635aba9ff5 | [
"BSD-3-Clause"
] | 5 | 2020-11-23T23:18:27.000Z | 2020-11-24T23:40:23.000Z | nano/nano_rpc/entry.cpp | Nikolya7373/nano-node | c673e4e340f46351786b1b5267b7e1635aba9ff5 | [
"BSD-3-Clause"
] | null | null | null | #include <nano/lib/errors.hpp>
#include <nano/lib/threading.hpp>
#include <nano/lib/utility.hpp>
#include <nano/node/cli.hpp>
#include <nano/node/ipc/ipc_server.hpp>
#include <nano/rpc/rpc.hpp>
#include <nano/rpc/rpc_request_processor.hpp>
#include <nano/secure/utility.hpp>
#include <boost/filesystem.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/program_options.hpp>
#include <csignal>
namespace
{
void logging_init (boost::filesystem::path const & application_path_a)
{
static std::atomic_flag logging_already_added = ATOMIC_FLAG_INIT;
if (!logging_already_added.test_and_set ())
{
boost::log::add_common_attributes ();
auto path = application_path_a / "log";
uintmax_t max_size{ 128 * 1024 * 1024 };
uintmax_t rotation_size{ 4 * 1024 * 1024 };
bool flush{ true };
boost::log::add_file_log (boost::log::keywords::target = path, boost::log::keywords::file_name = path / "rpc_log_%Y-%m-%d_%H-%M-%S.%N.log", boost::log::keywords::rotation_size = rotation_size, boost::log::keywords::auto_flush = flush, boost::log::keywords::scan_method = boost::log::sinks::file::scan_method::scan_matching, boost::log::keywords::max_size = max_size, boost::log::keywords::format = "[%TimeStamp%]: %Message%");
}
}
volatile sig_atomic_t sig_int_or_term = 0;
void run (boost::filesystem::path const & data_path, std::vector<std::string> const & config_overrides)
{
boost::filesystem::create_directories (data_path);
boost::system::error_code error_chmod;
nano::set_secure_perm_directory (data_path, error_chmod);
std::unique_ptr<nano::thread_runner> runner;
nano::rpc_config rpc_config;
auto error = nano::read_rpc_config_toml (data_path, rpc_config, config_overrides);
if (!error)
{
logging_init (data_path);
boost::asio::io_context io_ctx;
try
{
nano::ipc_rpc_processor ipc_rpc_processor (io_ctx, rpc_config);
auto rpc = nano::get_rpc (io_ctx, rpc_config, ipc_rpc_processor);
rpc->start ();
debug_assert (!nano::signal_handler_impl);
nano::signal_handler_impl = [&io_ctx]() {
io_ctx.stop ();
sig_int_or_term = 1;
};
std::signal (SIGINT, &nano::signal_handler);
std::signal (SIGTERM, &nano::signal_handler);
runner = std::make_unique<nano::thread_runner> (io_ctx, rpc_config.rpc_process.io_threads);
runner->join ();
if (sig_int_or_term == 1)
{
rpc->stop ();
}
}
catch (const std::runtime_error & e)
{
std::cerr << "Error while running rpc (" << e.what () << ")\n";
}
}
else
{
std::cerr << "Error deserializing config: " << error.get_message () << std::endl;
}
}
}
int main (int argc, char * const * argv)
{
nano::set_umask ();
boost::program_options::options_description description ("Command line options");
// clang-format off
description.add_options ()
("help", "Print out options")
("config", boost::program_options::value<std::vector<std::string>>()->multitoken(), "Pass RPC configuration values. This takes precedence over any values in the configuration file. This option can be repeated multiple times.")
("daemon", "Start RPC daemon")
("data_path", boost::program_options::value<std::string> (), "Use the supplied path as the data directory")
("network", boost::program_options::value<std::string> (), "Use the supplied network (live, beta or test)")
("version", "Prints out version");
// clang-format on
boost::program_options::variables_map vm;
try
{
boost::program_options::store (boost::program_options::parse_command_line (argc, argv, description), vm);
}
catch (boost::program_options::error const & err)
{
std::cerr << err.what () << std::endl;
return 1;
}
boost::program_options::notify (vm);
auto network (vm.find ("network"));
if (network != vm.end ())
{
auto err (nano::network_constants::set_active_network (network->second.as<std::string> ()));
if (err)
{
std::cerr << nano::network_constants::active_network_err_msg << std::endl;
std::exit (1);
}
}
auto data_path_it = vm.find ("data_path");
if (data_path_it == vm.end ())
{
std::string error_string;
if (!nano::migrate_working_path (error_string))
{
std::cerr << error_string << std::endl;
return 1;
}
}
boost::filesystem::path data_path ((data_path_it != vm.end ()) ? data_path_it->second.as<std::string> () : nano::working_path ());
if (vm.count ("daemon") > 0)
{
std::vector<std::string> config_overrides;
auto config (vm.find ("config"));
if (config != vm.end ())
{
config_overrides = config->second.as<std::vector<std::string>> ();
}
run (data_path, config_overrides);
}
else if (vm.count ("version"))
{
std::cout << "Version " << NANO_VERSION_STRING << "\n"
<< "Build Info " << BUILD_INFO << std::endl;
}
else
{
std::cout << description << std::endl;
}
return 1;
}
| 30.601266 | 428 | 0.687694 | MacroChip |
f6e328b99cac6eb723dcf13452b7086e05f9bd0a | 14,146 | cc | C++ | lib/ts/ink_hash_table.cc | garfieldonly/ats_git | 940ff5c56bebabb96130a55c2a17212c5c518138 | [
"Apache-2.0"
] | 1 | 2022-01-19T14:34:34.000Z | 2022-01-19T14:34:34.000Z | lib/ts/ink_hash_table.cc | mingzym/trafficserver | a01c3a357b4ff9193f2e2a8aee48e3751ef2177a | [
"Apache-2.0"
] | 2 | 2017-12-05T23:48:37.000Z | 2017-12-20T01:22:07.000Z | lib/ts/ink_hash_table.cc | maskit/trafficserver | 3ffa19873f7cd7ced2fbdfed5a0ac8ddbbe70a68 | [
"Apache-2.0"
] | null | null | null | /** @file
A brief file description
@section license License
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.
*/
/****************************************************************************
ink_hash_table.c
This file implements hash tables. This allows us to provide alternative
implementations of hash tables.
****************************************************************************/
#include "ts/ink_error.h"
#include "ts/ink_hash_table.h"
#include "ts/ink_memory.h"
/*===========================================================================*
This is the Tcl implementation of InkHashTable
*===========================================================================*/
/*---------------------------------------------------------------------------*
InkHashTable *ink_hash_table_create(InkHashTableKeyType key_type)
This routine allocates an initializes an empty InkHashTable, and returns a
pointer to the new table. The <key_type> argument indicates whether keys
are represented as strings, or as words. Legal values are
InkHashTableKeyType_String and InkHashTableKeyType_Word.
*---------------------------------------------------------------------------*/
InkHashTable *
ink_hash_table_create(InkHashTableKeyType key_type)
{
InkHashTable *ht_ptr;
Tcl_HashTable *tcl_ht_ptr;
int tcl_key_type;
tcl_ht_ptr = (Tcl_HashTable *)ats_malloc(sizeof(Tcl_HashTable));
if (key_type == InkHashTableKeyType_String)
tcl_key_type = TCL_STRING_KEYS;
else if (key_type == InkHashTableKeyType_Word)
tcl_key_type = TCL_ONE_WORD_KEYS;
else
ink_fatal("ink_hash_table_create: bad key_type %d", key_type);
Tcl_InitHashTable(tcl_ht_ptr, tcl_key_type);
ht_ptr = (InkHashTable *)tcl_ht_ptr;
return (ht_ptr);
} /* End ink_hash_table_create */
/*---------------------------------------------------------------------------*
void ink_hash_table_destroy(InkHashTable *ht_ptr)
This routine takes a hash table <ht_ptr>, and frees its storage.
*---------------------------------------------------------------------------*/
InkHashTable *
ink_hash_table_destroy(InkHashTable *ht_ptr)
{
Tcl_HashTable *tcl_ht_ptr;
tcl_ht_ptr = (Tcl_HashTable *)ht_ptr;
Tcl_DeleteHashTable(tcl_ht_ptr);
ats_free(tcl_ht_ptr);
return (InkHashTable *)0;
} /* End ink_hash_table_destroy */
/*---------------------------------------------------------------------------*
void ink_hash_table_destroy_and_free_values(InkHashTable *ht_ptr)
This routine takes a hash table <ht_ptr>, and frees its storage, after
first calling ink_free on all the values. You better darn well make sure the
values have been dynamically allocated.
*---------------------------------------------------------------------------*/
static int
_ink_hash_table_free_entry_value(InkHashTable *ht_ptr, InkHashTableEntry *e)
{
InkHashTableValue value;
value = ink_hash_table_entry_value(ht_ptr, e);
if (value != NULL) {
ats_free(value);
}
return (0);
} /* End _ink_hash_table_free_entry_value */
InkHashTable *
ink_hash_table_destroy_and_free_values(InkHashTable *ht_ptr)
{
ink_hash_table_map(ht_ptr, _ink_hash_table_free_entry_value);
ink_hash_table_destroy(ht_ptr);
return (InkHashTable *)0;
} /* End ink_hash_table_destroy_and_free_values */
/*---------------------------------------------------------------------------*
int ink_hash_table_isbound(InkHashTable *ht_ptr, InkHashTableKey key)
This routine takes a hash table <ht_ptr>, a key <key>, and returns 1
if the value <key> is bound in the hash table, 0 otherwise.
*---------------------------------------------------------------------------*/
int
ink_hash_table_isbound(InkHashTable *ht_ptr, const char *key)
{
InkHashTableEntry *he_ptr;
he_ptr = ink_hash_table_lookup_entry(ht_ptr, key);
return ((he_ptr == NULL) ? 0 : 1);
} /* End ink_hash_table_isbound */
/*---------------------------------------------------------------------------*
int ink_hash_table_lookup(InkHashTable *ht_ptr,
InkHashTableKey key,
InkHashTableValue *value_ptr)
This routine takes a hash table <ht_ptr>, a key <key>, and stores the
value bound to the key by reference through <value_ptr>. If no binding is
found, 0 is returned, else 1 is returned.
*---------------------------------------------------------------------------*/
int
ink_hash_table_lookup(InkHashTable *ht_ptr, const char *key, InkHashTableValue *value_ptr)
{
InkHashTableEntry *he_ptr;
InkHashTableValue value;
he_ptr = ink_hash_table_lookup_entry(ht_ptr, key);
if (he_ptr == NULL)
return (0);
value = ink_hash_table_entry_value(ht_ptr, he_ptr);
*value_ptr = value;
return (1);
} /* End ink_hash_table_lookup */
/*---------------------------------------------------------------------------*
int ink_hash_table_delete(InkHashTable *ht_ptr, InkHashTableKey key)
This routine takes a hash table <ht_ptr> and a key <key>, and deletes the
binding for the <key> in the hash table if it exists. This routine
returns 1 if the key existed, else 0.
*---------------------------------------------------------------------------*/
int
ink_hash_table_delete(InkHashTable *ht_ptr, const char *key)
{
char *tcl_key;
Tcl_HashTable *tcl_ht_ptr;
Tcl_HashEntry *tcl_he_ptr;
tcl_key = (char *)key;
tcl_ht_ptr = (Tcl_HashTable *)ht_ptr;
tcl_he_ptr = Tcl_FindHashEntry(tcl_ht_ptr, tcl_key);
if (!tcl_he_ptr)
return (0);
Tcl_DeleteHashEntry(tcl_he_ptr);
return (1);
} /* End ink_hash_table_delete */
/*---------------------------------------------------------------------------*
InkHashTableEntry *ink_hash_table_lookup_entry(InkHashTable *ht_ptr,
InkHashTableKey key)
This routine takes a hash table <ht_ptr> and a key <key>, and returns the
entry matching the key, or NULL otherwise.
*---------------------------------------------------------------------------*/
InkHashTableEntry *
ink_hash_table_lookup_entry(InkHashTable *ht_ptr, const char *key)
{
Tcl_HashTable *tcl_ht_ptr;
Tcl_HashEntry *tcl_he_ptr;
InkHashTableEntry *he_ptr;
tcl_ht_ptr = (Tcl_HashTable *)ht_ptr;
tcl_he_ptr = Tcl_FindHashEntry(tcl_ht_ptr, key);
he_ptr = (InkHashTableEntry *)tcl_he_ptr;
return (he_ptr);
} /* End ink_hash_table_lookup_entry */
/*---------------------------------------------------------------------------*
InkHashTableEntry *ink_hash_table_get_entry(InkHashTable *ht_ptr,
InkHashTableKey key,
int *new_value)
This routine takes a hash table <ht_ptr> and a key <key>, and returns the
entry matching the key, or creates, binds, and returns a new entry.
If the binding already existed, *new is set to 0, else 1.
*---------------------------------------------------------------------------*/
InkHashTableEntry *
ink_hash_table_get_entry(InkHashTable *ht_ptr, const char *key, int *new_value)
{
Tcl_HashTable *tcl_ht_ptr;
Tcl_HashEntry *tcl_he_ptr;
tcl_ht_ptr = (Tcl_HashTable *)ht_ptr;
tcl_he_ptr = Tcl_CreateHashEntry(tcl_ht_ptr, key, new_value);
if (tcl_he_ptr == NULL) {
ink_fatal("%s: Tcl_CreateHashEntry returned NULL", "ink_hash_table_get_entry");
}
return ((InkHashTableEntry *)tcl_he_ptr);
} /* End ink_hash_table_get_entry */
/*---------------------------------------------------------------------------*
void ink_hash_table_set_entry(InkHashTable *ht_ptr,
InkHashTableEntry *he_ptr,
InkHashTableValue value)
This routine takes a hash table <ht_ptr>, a hash table entry <he_ptr>,
and changes the value field of the entry to <value>.
*---------------------------------------------------------------------------*/
void
ink_hash_table_set_entry(InkHashTable *ht_ptr, InkHashTableEntry *he_ptr, InkHashTableValue value)
{
(void)ht_ptr;
ClientData tcl_value;
Tcl_HashEntry *tcl_he_ptr;
tcl_value = (ClientData)value;
tcl_he_ptr = (Tcl_HashEntry *)he_ptr;
Tcl_SetHashValue(tcl_he_ptr, tcl_value);
} /* End ink_hash_table_set_entry */
/*---------------------------------------------------------------------------*
void ink_hash_table_insert(InkHashTable *ht_ptr,
InkHashTableKey key,
InkHashTableValue value)
This routine takes a hash table <ht_ptr>, a key <key>, and binds the value
<value> to the key, replacing any previous binding, if any.
*---------------------------------------------------------------------------*/
void
ink_hash_table_insert(InkHashTable *ht_ptr, const char *key, InkHashTableValue value)
{
int new_value;
InkHashTableEntry *he_ptr;
he_ptr = ink_hash_table_get_entry(ht_ptr, key, &new_value);
ink_hash_table_set_entry(ht_ptr, he_ptr, value);
} /* End ink_hash_table_insert */
/*---------------------------------------------------------------------------*
void ink_hash_table_map(InkHashTable *ht_ptr, InkHashTableEntryFunction map)
This routine takes a hash table <ht_ptr> and a function pointer <map>, and
applies the function <map> to each entry in the hash table. The function
<map> should return 0 normally, otherwise the iteration will stop.
*---------------------------------------------------------------------------*/
void
ink_hash_table_map(InkHashTable *ht_ptr, InkHashTableEntryFunction map)
{
int retcode;
InkHashTableEntry *e;
InkHashTableIteratorState state;
for (e = ink_hash_table_iterator_first(ht_ptr, &state); e != NULL; e = ink_hash_table_iterator_next(ht_ptr, &state)) {
retcode = (*map)(ht_ptr, e);
if (retcode != 0)
break;
}
} /* End ink_hash_table_map */
/*---------------------------------------------------------------------------*
InkHashTableKey ink_hash_table_entry_key(InkHashTable *ht_ptr,
InkHashTableEntry *entry_ptr)
This routine takes a hash table <ht_ptr> and a pointer to a hash table
entry <entry_ptr>, and returns the key portion of the entry.
*---------------------------------------------------------------------------*/
InkHashTableKey
ink_hash_table_entry_key(InkHashTable *ht_ptr, InkHashTableEntry *entry_ptr)
{
char *tcl_key;
tcl_key = (char *)Tcl_GetHashKey((Tcl_HashTable *)ht_ptr, (Tcl_HashEntry *)entry_ptr);
return ((InkHashTableKey)tcl_key);
} /* End ink_hash_table_entry_key */
/*---------------------------------------------------------------------------*
InkHashTableValue ink_hash_table_entry_value(InkHashTable *ht_ptr,
InkHashTableEntry *entry_ptr)
This routine takes a hash table <ht_ptr> and a pointer to a hash table
entry <entry_ptr>, and returns the value portion of the entry.
*---------------------------------------------------------------------------*/
InkHashTableValue
ink_hash_table_entry_value(InkHashTable *ht_ptr, InkHashTableEntry *entry_ptr)
{
(void)ht_ptr;
ClientData tcl_value;
tcl_value = Tcl_GetHashValue((Tcl_HashEntry *)entry_ptr);
return ((InkHashTableValue)tcl_value);
} /* End ink_hash_table_entry_value */
/*---------------------------------------------------------------------------*
void ink_hash_table_dump_strings(InkHashTable *ht_ptr)
This routine takes a hash table of string values, and dumps the keys and
string values to stdout. It is the caller's responsibility to ensure that
both the key and the value are NUL terminated strings.
*---------------------------------------------------------------------------*/
static int
DumpStringEntry(InkHashTable *ht_ptr, InkHashTableEntry *e)
{
InkHashTableKey key;
InkHashTableValue value;
key = ink_hash_table_entry_key(ht_ptr, e);
value = ink_hash_table_entry_value(ht_ptr, e);
fprintf(stderr, "key = '%s', value = '%s'\n", (char *)key, (char *)value);
return (0);
}
void
ink_hash_table_dump_strings(InkHashTable *ht_ptr)
{
ink_hash_table_map(ht_ptr, DumpStringEntry);
} /* End ink_hash_table_dump_strings */
/*---------------------------------------------------------------------------*
void ink_hash_table_replace_string(InkHashTable *ht_ptr,
char *string_key, char *string_value)
This conveninece routine is intended for hash tables with keys of type
InkHashTableKeyType_String, and values being dynamically allocated strings.
This routine binds <string_key> to a copy of <string_value>, and any
previous bound value is deallocated.
*---------------------------------------------------------------------------*/
void
ink_hash_table_replace_string(InkHashTable *ht_ptr, char *string_key, char *string_value)
{
int new_value;
char *old_str;
InkHashTableEntry *he_ptr;
/*
* The following line will flag a type-conversion warning on the
* DEC Alpha, but that message can be ignored, since we're
* still dealing with pointers, and we aren't loosing any bits.
*/
he_ptr = ink_hash_table_get_entry(ht_ptr, (InkHashTableKey)string_key, &new_value);
if (new_value == 0) {
old_str = (char *)ink_hash_table_entry_value(ht_ptr, he_ptr);
if (old_str)
ats_free(old_str);
}
ink_hash_table_set_entry(ht_ptr, he_ptr, (InkHashTableValue)(ats_strdup(string_value)));
} /* End ink_hash_table_replace_string */
| 32.51954 | 120 | 0.592394 | garfieldonly |
f6e774b1b24314bcbefe403af6de2a662da3240d | 2,423 | hpp | C++ | lib/include/drivers/uart/detail/init.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | lib/include/drivers/uart/detail/init.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | lib/include/drivers/uart/detail/init.hpp | niclasberg/asfw | f836de1c0d6350541e3253863dedab6a3eb81df7 | [
"MIT"
] | null | null | null | #pragma once
#include "types.hpp"
#include "reg/peripheral_operations.hpp"
#include "board/regmap/uart.hpp"
#include "reg/set.hpp"
#include "reg/write.hpp"
#include "reg/apply.hpp"
namespace drivers::uart
{
namespace detail
{
using board::uart::CR1::PsVal;
using board::uart::CR1::MVal;
using board::uart::CR2::StopVal;
template<MVal _dataBits, StopVal _stopBits, bool _parityOn, PsVal _parity = PsVal::EVEN>
struct FrameFormatDef
{
constexpr bool_<_parityOn> getParityEnabled() const { return {}; }
constexpr integral_constant<PsVal, _parity> getParity() const { return {}; }
constexpr integral_constant<MVal, _dataBits> getDataBits() const { return {}; }
constexpr integral_constant<StopVal, _stopBits> getStopBits() const { return {}; }
};
template<
class UartX,
std::uint32_t _peripheralClockFrequency,
std::uint32_t _baudRate,
MVal _dataBits,
StopVal _stopBits,
bool _parityOn,
PsVal _parity>
void initUart(
UartX uartX,
constant_<_peripheralClockFrequency> peripheralClockFrequency,
constant_<_baudRate> baudRate,
FrameFormatDef<_dataBits, _stopBits, _parityOn, _parity>)
{
uartX.enable();
reg::set(uartX, board::uart::CR1::UE);
// Configure baud rate generator
// baud rate = pClockFrequency / (16 * usartDivider)
// where usartDivider = div_Mantissa.(div_fraction/16)
auto dividerTimes16 =
(peripheralClockFrequency + uint32_c<_baudRate/2>) / baudRate;
auto mantissa = dividerTimes16 / uint32_c<16>;
auto fraction = (dividerTimes16 - uint32_c<16> * mantissa);
reg::apply(uartX,
reg::write(board::uart::BRR::DIV_Mantissa, mantissa),
reg::write(board::uart::BRR::DIV_Fraction, fraction));
reg::write(uartX, board::uart::CR2::STOP, constant_c<_stopBits>);
reg::apply(uartX,
reg::write(board::uart::CR1::PCE, bool_c<_parityOn>),
reg::write(board::uart::CR1::PS, constant_c<_parity>),
reg::write(board::uart::CR1::M, constant_c<_dataBits>),
reg::set (board::uart::CR1::TE));
}
}
} | 37.859375 | 96 | 0.588114 | niclasberg |
f6e7dd267fd0640b20c53bd06fdcf1448a4d5f76 | 2,574 | cpp | C++ | Code/EditorPlugins/Assets/EnginePluginAssets/TextureCubeAsset/TextureCubeView.cpp | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | null | null | null | Code/EditorPlugins/Assets/EnginePluginAssets/TextureCubeAsset/TextureCubeView.cpp | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | null | null | null | Code/EditorPlugins/Assets/EnginePluginAssets/TextureCubeAsset/TextureCubeView.cpp | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | 1 | 2022-03-28T15:57:46.000Z | 2022-03-28T15:57:46.000Z | #include <EnginePluginAssetsPCH.h>
#include <EnginePluginAssets/TextureCubeAsset/TextureCubeContext.h>
#include <EnginePluginAssets/TextureCubeAsset/TextureCubeView.h>
#include <EditorEngineProcessFramework/EngineProcess/EngineProcessMessages.h>
#include <GameEngine/GameApplication/GameApplication.h>
#include <RendererCore/Debug/DebugRenderer.h>
#include <RendererCore/Pipeline/View.h>
#include <RendererCore/RenderWorld/RenderWorld.h>
ezTextureCubeViewContext::ezTextureCubeViewContext(ezTextureCubeContext* pContext)
: ezEngineProcessViewContext(pContext)
{
m_pTextureContext = pContext;
}
ezTextureCubeViewContext::~ezTextureCubeViewContext() {}
ezViewHandle ezTextureCubeViewContext::CreateView()
{
ezView* pView = nullptr;
ezRenderWorld::CreateView("Texture Cube Editor - View", pView);
pView->SetRenderPipelineResource(CreateDebugRenderPipeline());
pView->SetRenderPassProperty("DepthPrePass", "Active", false);
pView->SetRenderPassProperty("AOPass", "Active", false);
ezEngineProcessDocumentContext* pDocumentContext = GetDocumentContext();
pView->SetWorld(pDocumentContext->GetWorld());
pView->SetCamera(&m_Camera);
return pView->GetHandle();
}
void ezTextureCubeViewContext::SetCamera(const ezViewRedrawMsgToEngine* pMsg)
{
// Do not apply render mode here otherwise we would switch to a different pipeline.
// Also use hard-coded clipping planes so the quad is not culled to early.
ezCameraMode::Enum cameraMode = (ezCameraMode::Enum)pMsg->m_iCameraMode;
m_Camera.SetCameraMode(cameraMode, pMsg->m_fFovOrDim, 0.0001f, 50.0f);
m_Camera.LookAt(pMsg->m_vPosition, pMsg->m_vPosition + pMsg->m_vDirForwards, pMsg->m_vDirUp);
// Draw some stats
auto hResource = m_pTextureContext->GetTexture();
if (hResource.IsValid())
{
ezResourceLock<ezTextureCubeResource> pResource(hResource, ezResourceAcquireMode::AllowLoadingFallback);
ezGALResourceFormat::Enum format = pResource->GetFormat();
ezUInt32 uiWidthAndHeight = pResource->GetWidthAndHeight();
const ezUInt32 viewHeight = pMsg->m_uiWindowHeight;
ezStringBuilder sText;
if (ezReflectionUtils::EnumerationToString(ezGetStaticRTTI<ezGALResourceFormat>(), format, sText))
{
sText.Shrink(21, 0);
}
else
{
sText = "Unknown format";
}
sText.PrependFormat("{0}x{1}x6 - ", uiWidthAndHeight, uiWidthAndHeight);
ezDebugRenderer::Draw2DText(m_hView, sText, ezVec2I32(10, viewHeight - 10), ezColor::White, 16, ezDebugRenderer::HorizontalAlignment::Left,
ezDebugRenderer::VerticalAlignment::Bottom);
}
}
| 36.771429 | 143 | 0.773893 | alinoctavian |
f6eb9cafa30dd77c6a78e04eccc285efa3aa5f43 | 450 | cpp | C++ | Test Midterm/1.cpp | zyzkevin/C-Programming-and-Algorithms | be9642b62a3285341990c25bdc3c124c4dd8c38b | [
"MIT"
] | null | null | null | Test Midterm/1.cpp | zyzkevin/C-Programming-and-Algorithms | be9642b62a3285341990c25bdc3c124c4dd8c38b | [
"MIT"
] | null | null | null | Test Midterm/1.cpp | zyzkevin/C-Programming-and-Algorithms | be9642b62a3285341990c25bdc3c124c4dd8c38b | [
"MIT"
] | null | null | null | #include <iostream>
#include <vector>
using namespace std;
class A {
static int count;
public:
// 在此处补充你的代码
A ()
{
count++;
}
static int theNumberOfA() {
return count;
}
};
int A::count = 0;
int main() {
vector<A> v;
for(int i = 0; i < 3; i++) {
{
A a;
v.push_back(a);
}
cout << A::theNumberOfA() << endl;
}
system("pause");
return 0;
} | 13.235294 | 42 | 0.457778 | zyzkevin |
f6ece479737e76d5f7f1da109c6e15b356dc41e8 | 334 | hpp | C++ | src/mdp/core/oo/state/exceptions/unknown_object_exception.hpp | MarkieMark/fastrl | e4f0b9b60a7ecb6f13bbb79936ea82acb8adae0e | [
"Apache-2.0"
] | 4 | 2019-04-19T00:11:36.000Z | 2020-04-08T09:50:37.000Z | src/mdp/core/oo/state/exceptions/unknown_object_exception.hpp | MarkieMark/fastrl | e4f0b9b60a7ecb6f13bbb79936ea82acb8adae0e | [
"Apache-2.0"
] | null | null | null | src/mdp/core/oo/state/exceptions/unknown_object_exception.hpp | MarkieMark/fastrl | e4f0b9b60a7ecb6f13bbb79936ea82acb8adae0e | [
"Apache-2.0"
] | null | null | null |
/*
* Mark Benjamin 6th March 2019
* Copyright (c) 2019 Mark Benjamin
*/
#ifndef FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_EXCEPTION_HPP
#define FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_EXCEPTION_HPP
class UnknownObjectException {
};
#endif //FASTRL_MDP_CORE_OO_STATE_EXCEPTIONS_UNKNOWN_OBJECT_EXCEPTION_HPP
| 22.266667 | 73 | 0.856287 | MarkieMark |
f6eff6422c429229bab5efda11a1062173665f21 | 14,900 | cpp | C++ | examples/210-Evt-EventListeners.cpp | shanep/Catch2 | 2db1cf34047f76cb2679a3804b476881536ad27b | [
"BSL-1.0"
] | 682 | 2015-07-10T00:39:26.000Z | 2022-03-30T05:24:53.000Z | examples/210-Evt-EventListeners.cpp | shanep/Catch2 | 2db1cf34047f76cb2679a3804b476881536ad27b | [
"BSL-1.0"
] | 1,399 | 2015-07-24T22:09:09.000Z | 2022-03-29T06:22:48.000Z | examples/210-Evt-EventListeners.cpp | shanep/Catch2 | 2db1cf34047f76cb2679a3804b476881536ad27b | [
"BSL-1.0"
] | 311 | 2015-07-09T13:59:48.000Z | 2022-03-28T00:15:20.000Z | // 210-Evt-EventListeners.cpp
// Contents:
// 1. Printing of listener data
// 2. My listener and registration
// 3. Test cases
#include <catch2/catch_test_macros.hpp>
#include <catch2/reporters/catch_reporter_event_listener.hpp>
#include <catch2/reporters/catch_reporter_registrars.hpp>
#include <catch2/catch_test_case_info.hpp>
#include <iostream>
// -----------------------------------------------------------------------
// 1. Printing of listener data:
//
namespace {
std::string ws(int const level) {
return std::string( 2 * level, ' ' );
}
std::ostream& operator<<(std::ostream& out, Catch::Tag t) {
return out << "original: " << t.original << "lower cased: " << t.lowerCased;
}
template< typename T >
std::ostream& operator<<( std::ostream& os, std::vector<T> const& v ) {
os << "{ ";
for ( const auto& x : v )
os << x << ", ";
return os << "}";
}
// struct SourceLineInfo {
// char const* file;
// std::size_t line;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::SourceLineInfo const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- file: " << info.file << "\n"
<< ws(level+1) << "- line: " << info.line << "\n";
}
//struct MessageInfo {
// std::string macroName;
// std::string message;
// SourceLineInfo lineInfo;
// ResultWas::OfType type;
// unsigned int sequence;
//};
void print( std::ostream& os, int const level, Catch::MessageInfo const& info ) {
os << ws(level+1) << "- macroName: '" << info.macroName << "'\n"
<< ws(level+1) << "- message '" << info.message << "'\n";
print( os,level+1 , "- lineInfo", info.lineInfo );
os << ws(level+1) << "- sequence " << info.sequence << "\n";
}
void print( std::ostream& os, int const level, std::string const& title, std::vector<Catch::MessageInfo> const& v ) {
os << ws(level ) << title << ":\n";
for ( const auto& x : v )
{
os << ws(level+1) << "{\n";
print( os, level+2, x );
os << ws(level+1) << "}\n";
}
// os << ws(level+1) << "\n";
}
// struct TestRunInfo {
// std::string name;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::TestRunInfo const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- name: " << info.name << "\n";
}
// struct Counts {
// std::size_t total() const;
// bool allPassed() const;
// bool allOk() const;
//
// std::size_t passed = 0;
// std::size_t failed = 0;
// std::size_t failedButOk = 0;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::Counts const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- total(): " << info.total() << "\n"
<< ws(level+1) << "- allPassed(): " << info.allPassed() << "\n"
<< ws(level+1) << "- allOk(): " << info.allOk() << "\n"
<< ws(level+1) << "- passed: " << info.passed << "\n"
<< ws(level+1) << "- failed: " << info.failed << "\n"
<< ws(level+1) << "- failedButOk: " << info.failedButOk << "\n";
}
// struct Totals {
// Counts assertions;
// Counts testCases;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::Totals const& info ) {
os << ws(level) << title << ":\n";
print( os, level+1, "- assertions", info.assertions );
print( os, level+1, "- testCases" , info.testCases );
}
// struct TestRunStats {
// TestRunInfo runInfo;
// Totals totals;
// bool aborting;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::TestRunStats const& info ) {
os << ws(level) << title << ":\n";
print( os, level+1 , "- runInfo", info.runInfo );
print( os, level+1 , "- totals" , info.totals );
os << ws(level+1) << "- aborting: " << info.aborting << "\n";
}
// struct Tag {
// StringRef original, lowerCased;
// };
//
//
// enum class TestCaseProperties : uint8_t {
// None = 0,
// IsHidden = 1 << 1,
// ShouldFail = 1 << 2,
// MayFail = 1 << 3,
// Throws = 1 << 4,
// NonPortable = 1 << 5,
// Benchmark = 1 << 6
// };
//
//
// struct TestCaseInfo : NonCopyable {
//
// bool isHidden() const;
// bool throws() const;
// bool okToFail() const;
// bool expectedToFail() const;
//
//
// std::string name;
// std::string className;
// std::vector<Tag> tags;
// SourceLineInfo lineInfo;
// TestCaseProperties properties = TestCaseProperties::None;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::TestCaseInfo const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- isHidden(): " << info.isHidden() << "\n"
<< ws(level+1) << "- throws(): " << info.throws() << "\n"
<< ws(level+1) << "- okToFail(): " << info.okToFail() << "\n"
<< ws(level+1) << "- expectedToFail(): " << info.expectedToFail() << "\n"
<< ws(level+1) << "- tagsAsString(): '" << info.tagsAsString() << "'\n"
<< ws(level+1) << "- name: '" << info.name << "'\n"
<< ws(level+1) << "- className: '" << info.className << "'\n"
<< ws(level+1) << "- tags: " << info.tags << "\n";
print( os, level+1 , "- lineInfo", info.lineInfo );
os << ws(level+1) << "- properties (flags): 0x" << std::hex << static_cast<uint32_t>(info.properties) << std::dec << "\n";
}
// struct TestCaseStats {
// TestCaseInfo testInfo;
// Totals totals;
// std::string stdOut;
// std::string stdErr;
// bool aborting;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::TestCaseStats const& info ) {
os << ws(level ) << title << ":\n";
print( os, level+1 , "- testInfo", *info.testInfo );
print( os, level+1 , "- totals" , info.totals );
os << ws(level+1) << "- stdOut: " << info.stdOut << "\n"
<< ws(level+1) << "- stdErr: " << info.stdErr << "\n"
<< ws(level+1) << "- aborting: " << info.aborting << "\n";
}
// struct SectionInfo {
// std::string name;
// std::string description;
// SourceLineInfo lineInfo;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::SectionInfo const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- name: " << info.name << "\n";
print( os, level+1 , "- lineInfo", info.lineInfo );
}
// struct SectionStats {
// SectionInfo sectionInfo;
// Counts assertions;
// double durationInSeconds;
// bool missingAssertions;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::SectionStats const& info ) {
os << ws(level ) << title << ":\n";
print( os, level+1 , "- sectionInfo", info.sectionInfo );
print( os, level+1 , "- assertions" , info.assertions );
os << ws(level+1) << "- durationInSeconds: " << info.durationInSeconds << "\n"
<< ws(level+1) << "- missingAssertions: " << info.missingAssertions << "\n";
}
// struct AssertionInfo
// {
// StringRef macroName;
// SourceLineInfo lineInfo;
// StringRef capturedExpression;
// ResultDisposition::Flags resultDisposition;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionInfo const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- macroName: '" << info.macroName << "'\n";
print( os, level+1 , "- lineInfo" , info.lineInfo );
os << ws(level+1) << "- capturedExpression: '" << info.capturedExpression << "'\n"
<< ws(level+1) << "- resultDisposition (flags): 0x" << std::hex << info.resultDisposition << std::dec << "\n";
}
//struct AssertionResultData
//{
// std::string reconstructExpression() const;
//
// std::string message;
// mutable std::string reconstructedExpression;
// LazyExpression lazyExpression;
// ResultWas::OfType resultType;
//};
void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionResultData const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- reconstructExpression(): '" << info.reconstructExpression() << "'\n"
<< ws(level+1) << "- message: '" << info.message << "'\n"
<< ws(level+1) << "- lazyExpression: '" << "(info.lazyExpression)" << "'\n"
<< ws(level+1) << "- resultType: '" << info.resultType << "'\n";
}
//class AssertionResult {
// bool isOk() const;
// bool succeeded() const;
// ResultWas::OfType getResultType() const;
// bool hasExpression() const;
// bool hasMessage() const;
// std::string getExpression() const;
// std::string getExpressionInMacro() const;
// bool hasExpandedExpression() const;
// std::string getExpandedExpression() const;
// std::string getMessage() const;
// SourceLineInfo getSourceInfo() const;
// std::string getTestMacroName() const;
//
// AssertionInfo m_info;
// AssertionResultData m_resultData;
//};
void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionResult const& info ) {
os << ws(level ) << title << ":\n"
<< ws(level+1) << "- isOk(): " << info.isOk() << "\n"
<< ws(level+1) << "- succeeded(): " << info.succeeded() << "\n"
<< ws(level+1) << "- getResultType(): " << info.getResultType() << "\n"
<< ws(level+1) << "- hasExpression(): " << info.hasExpression() << "\n"
<< ws(level+1) << "- hasMessage(): " << info.hasMessage() << "\n"
<< ws(level+1) << "- getExpression(): '" << info.getExpression() << "'\n"
<< ws(level+1) << "- getExpressionInMacro(): '" << info.getExpressionInMacro() << "'\n"
<< ws(level+1) << "- hasExpandedExpression(): " << info.hasExpandedExpression() << "\n"
<< ws(level+1) << "- getExpandedExpression(): " << info.getExpandedExpression() << "'\n"
<< ws(level+1) << "- getMessage(): '" << info.getMessage() << "'\n";
print( os, level+1 , "- getSourceInfo(): ", info.getSourceInfo() );
os << ws(level+1) << "- getTestMacroName(): '" << info.getTestMacroName() << "'\n";
print( os, level+1 , "- *** m_info (AssertionInfo)", info.m_info );
print( os, level+1 , "- *** m_resultData (AssertionResultData)", info.m_resultData );
}
// struct AssertionStats {
// AssertionResult assertionResult;
// std::vector<MessageInfo> infoMessages;
// Totals totals;
// };
void print( std::ostream& os, int const level, std::string const& title, Catch::AssertionStats const& info ) {
os << ws(level ) << title << ":\n";
print( os, level+1 , "- assertionResult", info.assertionResult );
print( os, level+1 , "- infoMessages", info.infoMessages );
print( os, level+1 , "- totals", info.totals );
}
// -----------------------------------------------------------------------
// 2. My listener and registration:
//
char const * dashed_line =
"--------------------------------------------------------------------------";
struct MyListener : Catch::EventListenerBase {
using EventListenerBase::EventListenerBase; // inherit constructor
// Get rid of Wweak-tables
~MyListener();
// The whole test run starting
void testRunStarting( Catch::TestRunInfo const& testRunInfo ) override {
std::cout
<< std::boolalpha
<< "\nEvent: testRunStarting:\n";
print( std::cout, 1, "- testRunInfo", testRunInfo );
}
// The whole test run ending
void testRunEnded( Catch::TestRunStats const& testRunStats ) override {
std::cout
<< dashed_line
<< "\nEvent: testRunEnded:\n";
print( std::cout, 1, "- testRunStats", testRunStats );
}
// A test is being skipped (because it is "hidden")
void skipTest( Catch::TestCaseInfo const& testInfo ) override {
std::cout
<< dashed_line
<< "\nEvent: skipTest:\n";
print( std::cout, 1, "- testInfo", testInfo );
}
// Test cases starting
void testCaseStarting( Catch::TestCaseInfo const& testInfo ) override {
std::cout
<< dashed_line
<< "\nEvent: testCaseStarting:\n";
print( std::cout, 1, "- testInfo", testInfo );
}
// Test cases ending
void testCaseEnded( Catch::TestCaseStats const& testCaseStats ) override {
std::cout << "\nEvent: testCaseEnded:\n";
print( std::cout, 1, "testCaseStats", testCaseStats );
}
// Sections starting
void sectionStarting( Catch::SectionInfo const& sectionInfo ) override {
std::cout << "\nEvent: sectionStarting:\n";
print( std::cout, 1, "- sectionInfo", sectionInfo );
}
// Sections ending
void sectionEnded( Catch::SectionStats const& sectionStats ) override {
std::cout << "\nEvent: sectionEnded:\n";
print( std::cout, 1, "- sectionStats", sectionStats );
}
// Assertions before/ after
void assertionStarting( Catch::AssertionInfo const& assertionInfo ) override {
std::cout << "\nEvent: assertionStarting:\n";
print( std::cout, 1, "- assertionInfo", assertionInfo );
}
void assertionEnded( Catch::AssertionStats const& assertionStats ) override {
std::cout << "\nEvent: assertionEnded:\n";
print( std::cout, 1, "- assertionStats", assertionStats );
}
};
} // end anonymous namespace
CATCH_REGISTER_LISTENER( MyListener )
// Get rid of Wweak-tables
MyListener::~MyListener() {}
// -----------------------------------------------------------------------
// 3. Test cases:
//
TEST_CASE( "1: Hidden testcase", "[.hidden]" ) {
}
TEST_CASE( "2: Testcase with sections", "[tag-A][tag-B]" ) {
int i = 42;
REQUIRE( i == 42 );
SECTION("Section 1") {
INFO("Section 1");
i = 7;
SECTION("Section 1.1") {
INFO("Section 1.1");
REQUIRE( i == 42 );
}
}
SECTION("Section 2") {
INFO("Section 2");
REQUIRE( i == 42 );
}
WARN("At end of test case");
}
struct Fixture {
int fortytwo() const {
return 42;
}
};
TEST_CASE_METHOD( Fixture, "3: Testcase with class-based fixture", "[tag-C][tag-D]" ) {
REQUIRE( fortytwo() == 42 );
}
// Compile & run:
// - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 210-Evt-EventListeners 210-Evt-EventListeners.cpp 000-CatchMain.o && 210-Evt-EventListeners --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 210-Evt-EventListeners.cpp 000-CatchMain.obj && 210-Evt-EventListeners --success
// Expected compact output (all assertions):
//
// prompt> 210-Evt-EventListeners --reporter compact --success
// result omitted for brevity.
| 34.651163 | 156 | 0.555101 | shanep |
f6f0b0e80b50c86bfc23ec26f479d41967b4a7a4 | 958 | hpp | C++ | client/data_parser.hpp | derpicated/dynamic_network_of_speakers | e2407d330a2f83d8a2de33cc9905d783906c7dfc | [
"MIT"
] | 8 | 2016-05-23T22:56:57.000Z | 2016-05-28T08:22:18.000Z | client/data_parser.hpp | derpicated/dynamic_network_of_speakers | e2407d330a2f83d8a2de33cc9905d783906c7dfc | [
"MIT"
] | 10 | 2016-05-24T20:15:45.000Z | 2016-05-27T22:13:50.000Z | client/data_parser.hpp | derpicated/dynamic_network_of_speakers | e2407d330a2f83d8a2de33cc9905d783906c7dfc | [
"MIT"
] | 1 | 2019-03-09T18:03:56.000Z | 2019-03-09T18:03:56.000Z | #ifndef DNS_data_parser_HPP
#define DNS_data_parser_HPP
#include "./libs/logger/easylogging++.h"
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#include "libs/jzon/Jzon.h"
class audioObject {
public:
audioObject ();
float distance;
float angle;
};
class speakerData {
public:
speakerData ();
std::string speakerid;
std::map<std::string, audioObject> objects;
};
class data_parser {
private:
Jzon::Parser _filereader;
Jzon::Writer _filewriter;
public:
data_parser ();
speakerData parseClientData (std::string jsonstring,
std::string client_id,
std::map<std::string, std::vector<float>>& objects);
std::map<std::string, std::string> parseAudioSourceData (std::string jsonstring);
std::string composeClientData (speakerData speaker);
std::string composeAudioSourceData (std::map<std::string, std::string> audioSources);
};
#endif
| 19.958333 | 89 | 0.693111 | derpicated |
f6f0c548bdf9dba71e22a2df8a67da4205e9b0df | 313 | cpp | C++ | SimulationTest/cpuTests/DistributionTest.cpp | KevinMcGin/Simulation | f1dbed05d6024274f6a69e0679f529feaae1e26e | [
"MIT"
] | 4 | 2021-12-11T17:59:07.000Z | 2021-12-24T11:08:55.000Z | SimulationTest/cpuTests/DistributionTest.cpp | KevinMcGin/Simulation | f1dbed05d6024274f6a69e0679f529feaae1e26e | [
"MIT"
] | 121 | 2021-12-11T09:20:47.000Z | 2022-03-13T18:36:48.000Z | SimulationTest/cpuTests/DistributionTest.cpp | KevinMcGin/Simulation | f1dbed05d6024274f6a69e0679f529feaae1e26e | [
"MIT"
] | null | null | null | #include <gtest/gtest.h>
#include "distribution/Distribution.h"
TEST(DistributionTest, RandomTest) {
auto value = Distribution::random(0.0, 1.0);
EXPECT_TRUE(value <= 1 && value >= -1);
}
TEST(DistributionTest, RandomTest2) {
auto value = Distribution::random(1.0);
EXPECT_TRUE(value <= 1 && value >= 0);
}
| 26.083333 | 45 | 0.693291 | KevinMcGin |
f6f4fac03aec15be60d2d238c16818d25bd77b20 | 2,157 | cpp | C++ | src/library/library_task_builder.cpp | solson/lean | b13ac127fd83f3724d2f096b1fb85dc6b15e3746 | [
"Apache-2.0"
] | 2,232 | 2015-01-01T18:20:29.000Z | 2022-03-30T02:35:50.000Z | src/library/library_task_builder.cpp | SNU-2D/lean | 72a965986fa5aeae54062e98efb3140b2c4e79fd | [
"Apache-2.0"
] | 1,187 | 2015-01-06T05:18:44.000Z | 2019-10-31T18:45:42.000Z | src/library/library_task_builder.cpp | SNU-2D/lean | 72a965986fa5aeae54062e98efb3140b2c4e79fd | [
"Apache-2.0"
] | 306 | 2015-01-16T22:30:27.000Z | 2022-03-28T02:55:51.000Z | /*
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Gabriel Ebner
*/
#include "library/library_task_builder.h"
#include "library/message_builder.h"
namespace lean {
struct library_scopes_imp : public delegating_task_imp {
io_state m_ios;
log_tree::node m_lt;
library_scopes_imp(std::unique_ptr<gtask_imp> && base, log_tree::node const & lt) :
delegating_task_imp(std::forward<std::unique_ptr<gtask_imp>>(base)),
m_ios(get_global_ios()), m_lt(lt) {}
// TODO(gabriel): set logtree status to cancelled?
void execute(void * result) override {
scope_global_ios scope1(m_ios);
scope_log_tree scope2(m_lt);
if (m_lt) m_lt.set_state(log_tree::state::Running);
try {
delegating_task_imp::execute(result);
} catch (interrupted) {
if (m_lt) m_lt.set_state(log_tree::state::Cancelled);
throw;
}
}
};
std::unique_ptr<gtask_imp> library_scopes::operator()(std::unique_ptr<gtask_imp> && base) {
return std::unique_ptr<gtask_imp>(new library_scopes_imp(
std::forward<std::unique_ptr<gtask_imp>>(base), m_lt));
}
struct exception_reporter_imp : public delegating_task_imp {
exception_reporter_imp(std::unique_ptr<gtask_imp> && base) :
delegating_task_imp(std::forward<std::unique_ptr<gtask_imp>>(base)) {}
void execute(void * result) override {
try {
delegating_task_imp::execute(result);
} catch (std::exception & ex) {
message_builder(environment(), get_global_ios(),
logtree().get_location().m_file_name,
logtree().get_location().m_range.m_begin,
ERROR)
.set_exception(ex)
.report();
throw;
}
}
};
std::unique_ptr<gtask_imp> exception_reporter::operator()(std::unique_ptr<gtask_imp> && base) {
return std::unique_ptr<gtask_imp>(new exception_reporter_imp(
std::forward<std::unique_ptr<gtask_imp>>(base)));
}
}
| 33.184615 | 95 | 0.636069 | solson |
f6f509119bb84c8279e686234b80bcecd546506e | 2,200 | hpp | C++ | native-osx/libs/boost/boost/function.hpp | CodeDistillery/myodaemon | 0db901ec9ca39fcf84eb88836c6f4477c8767f25 | [
"Unlicense"
] | null | null | null | native-osx/libs/boost/boost/function.hpp | CodeDistillery/myodaemon | 0db901ec9ca39fcf84eb88836c6f4477c8767f25 | [
"Unlicense"
] | null | null | null | native-osx/libs/boost/boost/function.hpp | CodeDistillery/myodaemon | 0db901ec9ca39fcf84eb88836c6f4477c8767f25 | [
"Unlicense"
] | null | null | null | // Boost.Function library
// Copyright Douglas Gregor 2001-2003. Use, modification and
// distribution is 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)
// For more information, see http://www.boost.org/libs/function
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
// design of this library.
#include <functional> // unary_function, binary_function
#include <boost/preprocessor/iterate.hpp>
#include <boost/detail/workaround.hpp>
#ifndef BOOST_FUNCTION_MAX_ARGS
# define BOOST_FUNCTION_MAX_ARGS 10
#endif // BOOST_FUNCTION_MAX_ARGS
// Include the prologue here so that the use of file-level iteration
// in anything that may be included by function_template.hpp doesn't break
#include <boost/function/detail/prologue.hpp>
// Older Visual Age C++ version do not handle the file iteration well
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
# if BOOST_FUNCTION_MAX_ARGS >= 0
# include <boost/function/function0.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 1
# include <boost/function/function1.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 2
# include <boost/function/function2.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 3
# include <boost/function/function3.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 4
# include <boost/function/function4.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 5
# include <boost/function/function5.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 6
# include <boost/function/function6.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 7
# include <boost/function/function7.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 8
# include <boost/function/function8.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 9
# include <boost/function/function9.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 10
# include <boost/function/function10.hpp>
# endif
#else
// What is the '3' for?
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,<boost/function/detail/function_iterate.hpp>))
# include BOOST_PP_ITERATE()
# undef BOOST_PP_ITERATION_PARAMS_1
#endif
| 32.835821 | 114 | 0.749545 | CodeDistillery |
f6f68b5edc534714a8e0a89529eba2e546ab6570 | 11,329 | hxx | C++ | OCC/opencascade-7.2.0/x64/debug/inc/BOPTools_AlgoTools2D.hxx | jiaguobing/FastCAE | 2348ab87e83fe5c704e4c998cf391229c25ac5d5 | [
"BSD-3-Clause"
] | 2 | 2020-02-21T01:04:35.000Z | 2020-02-21T03:35:37.000Z | OCC/opencascade-7.2.0/x64/debug/inc/BOPTools_AlgoTools2D.hxx | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | OCC/opencascade-7.2.0/x64/debug/inc/BOPTools_AlgoTools2D.hxx | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2021-11-21T13:03:26.000Z | 2021-11-21T13:03:26.000Z | // Created by: Peter KURNEV
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BOPTools_AlgoTools2D_HeaderFile
#define _BOPTools_AlgoTools2D_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <Standard_Integer.hxx>
class TopoDS_Edge;
class TopoDS_Face;
class gp_Vec;
class Geom2d_Curve;
class Geom_Curve;
class BRepAdaptor_Surface;
class ProjLib_ProjectedCurve;
class IntTools_Context;
//! The class contains handy static functions
//! dealing with the topology
//! This is the copy of the BOPTools_AlgoTools2D.cdl
class BOPTools_AlgoTools2D
{
public:
DEFINE_STANDARD_ALLOC
//! Compute P-Curve for the edge <aE> on the face <aF>.<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
Standard_EXPORT static Standard_Boolean EdgeTangent (const TopoDS_Edge& anE, const Standard_Real aT, gp_Vec& Tau);
//! Compute surface parameters <U,V> of the face <aF>
//! for the point from the edge <aE> at parameter <aT>.<br>
//! If <aE> has't pcurve on surface, algorithm tries to get it by
//! projection and can
//! raise exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Standard_Real aT,
Standard_Real& U,
Standard_Real& V,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
//! [aToler] - reached tolerance
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
//! [aFirst, aLast] - range of the P-Curve<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! [aFirst, aLast] - range of the P-Curve
//! [aToler] - reached tolerance
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
//! Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .<br>
//! [aT1, aT2] - range to adjust<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
Standard_EXPORT static void AdjustPCurveOnSurf (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
//! Compute intermediate value in between [aFirst, aLast] .
Standard_EXPORT static Standard_Real IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast);
//! Compute intermediate value of parameter for the edge <anE>.
Standard_EXPORT static Standard_Real IntermediatePoint (const TopoDS_Edge& anE);
//! Build pcurve of edge on face if the surface is plane, and update the edge.
Standard_EXPORT static void BuildPCurveForEdgeOnPlane (const TopoDS_Edge& theE, const TopoDS_Face& theF);
//! Build pcurve of edge on face if the surface is plane, but do not update the edge.
//! The output are the pcurve and the flag telling that pcurve was built.
Standard_EXPORT static void BuildPCurveForEdgeOnPlane (const TopoDS_Edge& theE, const TopoDS_Face& theF,
Handle(Geom2d_Curve)& aC2D, Standard_Boolean& bToUpdate);
Standard_EXPORT static void BuildPCurveForEdgesOnPlane (const BOPCol_ListOfShape& theLE, const TopoDS_Face& theF);
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! [aFirst, aLast] - range of the P-Curve<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aT1, aT2] - range to build<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
const Standard_Real aT1,
const Standard_Real aT2,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Attach P-Curve from the edge <aEold> on surface <aF>
//! to the edge <aEnew>
//! Returns 0 in case of success
Standard_EXPORT static Standard_Integer AttachExistingPCurve (const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx);
//! Checks if CurveOnSurface of theE on theF matches with isoline of theF surface.
//! Sets corresponding values for isTheUIso and isTheVIso variables.
//! ATTENTION!!!
//! This method is based on comparation between direction of
//! surface (which theF is based on) iso-lines and the direction
//! of the edge p-curve (on theF) in middle-point of the p-curve.
//! This method should be used carefully
//! (e.g. BRep_Tool::IsClosed(...) together) in order to
//! avoid false classification some p-curves as isoline (e.g. circle
//! on a plane).
Standard_EXPORT static void IsEdgeIsoline(const TopoDS_Edge& theE,
const TopoDS_Face& theF,
Standard_Boolean& isTheUIso,
Standard_Boolean& isTheVIso);
protected:
private:
};
#endif // _BOPTools_AlgoTools2D_HeaderFile
| 48.004237 | 201 | 0.603937 | jiaguobing |
f6f9fd6e8b6cb50837f5a6cab7929d4d8dd12d9f | 1,430 | cpp | C++ | src/Dijkstra.cpp | dbahrdt/path_finder | 1105966e5b50590acd9aca30ceb6922b0e40c259 | [
"Apache-2.0"
] | 1 | 2021-03-12T23:18:30.000Z | 2021-03-12T23:18:30.000Z | src/Dijkstra.cpp | dbahrdt/path_finder | 1105966e5b50590acd9aca30ceb6922b0e40c259 | [
"Apache-2.0"
] | 8 | 2020-05-27T17:25:58.000Z | 2020-05-29T10:39:54.000Z | src/Dijkstra.cpp | dbahrdt/path_finder | 1105966e5b50590acd9aca30ceb6922b0e40c259 | [
"Apache-2.0"
] | 1 | 2020-10-19T09:01:09.000Z | 2020-10-19T09:01:09.000Z | //
// Created by sokol on 02.10.19.
//
#include "path_finder/routing/Dijkstra.h"
#include <queue>
pathFinder::Dijkstra::Dijkstra(const pathFinder::Graph &graph) : graph(graph) {
costs.reserve(graph.numberOfNodes);
previousNode.reserve(graph.numberOfNodes);
while (costs.size() < graph.numberOfNodes) {
costs.emplace_back(MAX_DISTANCE);
previousNode.emplace_back(std::nullopt);
}
}
std::optional<pathFinder::Distance> pathFinder::Dijkstra::getShortestDistance(pathFinder::NodeId source,
pathFinder::NodeId target) {
if (source >= graph.numberOfNodes || target >= graph.numberOfNodes)
return std::nullopt;
// clean up distances
for (auto &nodeId : visited) {
costs[nodeId] = MAX_DISTANCE;
}
visited.clear();
visited.emplace_back(source);
costs[source] = 0;
std::priority_queue<CostNode> q;
q.emplace(source, 0, source);
while (!q.empty()) {
const auto costNode = q.top();
q.pop();
if (costNode.id == target) {
return costNode.cost;
}
for (const auto &edge : graph.edgesFor(costNode.id)) {
Distance currentCost = costNode.cost + edge.distance;
if (currentCost < costs[edge.target]) {
costs[edge.target] = currentCost;
q.emplace(edge.target, currentCost, edge.source);
visited.emplace_back(edge.target);
}
}
}
return costs[target];
}
| 31.086957 | 106 | 0.63986 | dbahrdt |
f6fa458e033f6655db3f29ef40d5a8a23a622d74 | 1,077 | cpp | C++ | BuildRoads.cpp | kshivam654/Hacktoberfest-1 | 0d95feb3e9f09a6feeedbd30e0cc831129fb5251 | [
"MIT"
] | 32 | 2020-05-23T07:40:31.000Z | 2021-02-02T18:14:30.000Z | BuildRoads.cpp | kshivam654/Hacktoberfest-1 | 0d95feb3e9f09a6feeedbd30e0cc831129fb5251 | [
"MIT"
] | 45 | 2020-05-22T10:30:51.000Z | 2020-12-28T08:17:13.000Z | BuildRoads.cpp | kshivam654/Hacktoberfest-1 | 0d95feb3e9f09a6feeedbd30e0cc831129fb5251 | [
"MIT"
] | 31 | 2020-05-22T10:18:16.000Z | 2020-10-23T07:52:35.000Z | #include <iostream>
#include <vector>
#include<list>
using namespace std;
#define ll long long int
#define OJ \
freopen("input.txt", "r", stdin); \
freopen("output.txt", "w", stdout);
#define FIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
bool visited[100001] = {false};
list<int> adj[100001];
void dfs(int index, list<int> *adj){
visited[index] = true;
for(auto a: adj[index]){
if(visited[a] == false){
dfs(a, adj);
}
}
}
int main()
{
OJ;
FIO;
int n, r;
cin >> n >> r;
int a, b;
for(int i=0; i<r; i++){
cin >> a >> b;
adj[a].push_back(b);
adj[b].push_back(a);
}
vector<long long int> ans;
for(int i=1; i<=n; i++){
if(visited[i] == false){
ans.push_back(i);
dfs(i, adj);
}
}
cout << ans.size()-1 << endl;
for(int i=1; i<ans.size(); i++){
cout << ans[i] << " " << ans[i]-1 << endl;
}
}
| 19.581818 | 50 | 0.454039 | kshivam654 |
f6fb385275941f0cec0ab2f473210344b6ac8ec2 | 2,590 | hpp | C++ | thirdparty/ngraph/src/nnfusion/core/graph/output.hpp | xiezhq-hermann/nnfusion | 1b2c23b0732bee295e37b990811719e0c4c6e993 | [
"MIT"
] | 1 | 2021-05-14T08:10:30.000Z | 2021-05-14T08:10:30.000Z | thirdparty/ngraph/src/nnfusion/core/graph/output.hpp | xiezhq-hermann/nnfusion | 1b2c23b0732bee295e37b990811719e0c4c6e993 | [
"MIT"
] | null | null | null | thirdparty/ngraph/src/nnfusion/core/graph/output.hpp | xiezhq-hermann/nnfusion | 1b2c23b0732bee295e37b990811719e0c4c6e993 | [
"MIT"
] | 1 | 2021-02-13T08:10:55.000Z | 2021-02-13T08:10:55.000Z | //*****************************************************************************
// Copyright 2017-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.
//*****************************************************************************
// Microsoft (c) 2019, NNFusion Team
#pragma once
#include <memory>
#include "nnfusion/common/descriptor/tensor.hpp"
namespace nnfusion
{
namespace graph
{
class Output
{
public:
/// \param tensor The view of this tensor; where the value will be written
Output(const std::shared_ptr<nnfusion::descriptor::Tensor>& tensor)
: m_tensor(tensor)
{
}
nnfusion::descriptor::Tensor& get_tensor() const { return *m_tensor; }
std::shared_ptr<nnfusion::descriptor::Tensor> get_tensor_ptr() const
{
return m_tensor;
}
void set_tensor_ptr(const std::shared_ptr<nnfusion::descriptor::Tensor>& tensor)
{
m_tensor = tensor;
}
/// \return the element type of the output
const nnfusion::element::Type& get_element_type() const
{
return m_tensor->get_element_type();
}
/// \return the shape of the output
const nnfusion::Shape& get_shape() const { return m_tensor->get_shape(); }
const nnfusion::PartialShape& get_partial_shape() const
{
return m_tensor->get_partial_shape();
}
void set_type_and_shape(const nnfusion::element::Type& element_type,
const nnfusion::PartialShape& pshape)
{
m_tensor->set_tensor_type(element_type, pshape);
}
protected:
std::shared_ptr<nnfusion::descriptor::Tensor> m_tensor;
private:
Output(const Output&) = delete;
Output(Output&&) = delete;
Output& operator=(const Output&) = delete;
};
}
}
| 33.636364 | 92 | 0.555985 | xiezhq-hermann |
f6fbb5a694c7825f019c6284531e19564cda1f97 | 7,031 | cc | C++ | common/point_of_sail.cc | denidoank/avalonsailing | 8bc6d511e243ebd4fd90e7fb678ac7560226b5ca | [
"Apache-2.0"
] | null | null | null | common/point_of_sail.cc | denidoank/avalonsailing | 8bc6d511e243ebd4fd90e7fb678ac7560226b5ca | [
"Apache-2.0"
] | null | null | null | common/point_of_sail.cc | denidoank/avalonsailing | 8bc6d511e243ebd4fd90e7fb678ac7560226b5ca | [
"Apache-2.0"
] | null | null | null | // Copyright 2012 The Avalon Project Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the LICENSE file.
// Author: grundmann@google.com (Steffen Grundmann)
#include "common/point_of_sail.h"
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include "common/angle.h"
#include "common/check.h"
#include "common/convert.h"
#include "common/delta_angle.h"
#include "common/normalize.h"
#include "common/polar_diagram.h"
#include "common/sign.h"
extern int debug;
PointOfSail::PointOfSail() {
Reset();
}
// We make the decision about the point of sail on the slowly
// filtered true wind only. If the wind turns quickly, then we
// react on that with the AntiWindGust method.
// Everything in radians here.
// If alpha_star and alpha_true are rate limited then the sector
// output doesn't jump.
Angle PointOfSail::SailableHeading(
Angle alpha_star, // rate limited alpha star
Angle alpha_true, // true wind vector, slowly filtered
Angle previous_output, // previous output direction, needed to implement hysteresis
SectorT* sector, // sector codes for state handling and maneuver
Angle* target) {
Angle limit1 = alpha_true.opposite() - TackZone();
Angle limit2 = alpha_true.opposite() + TackZone();
Angle limit3 = alpha_true - JibeZoneHalfWidth();
Angle limit4 = alpha_true + JibeZoneHalfWidth();
if (debug) {
fprintf(stderr, "limits true : % 5.2lf % 5.2lf % 5.2lf % 5.2lf degrees\n",
limit1.deg(), limit2.deg(), limit3.deg(), limit4.deg());
}
// This keeps a small part of the previous output, later used in the hysteresis
// calculation. The hysteresis is good for minimizing the number of maneuvers.
Angle hysteresis_tack = (alpha_star - previous_output) * 0.1; // about 5 degrees
Angle hysteresis_jibe = (alpha_star - previous_output) * 0.3;
bool left = false;
/* Sector defintion
1, 2: left and right in the tack zone
3 : Reaching with sail on starboard
4, 5: right and left in the jibe zone
6 : Reaching with sail on portside
*/
*target = 0;
Angle alpha_star_limited = alpha_star;
if (limit1 <= alpha_star && alpha_star < limit2) {
// Modify if in the non-sailable tack range.
alpha_star_limited = (alpha_star - hysteresis_tack).nearest(limit1, limit2, &left);
*sector = left ? TackPort : TackStar;
*target = left ? limit1 : limit2;
} else if (limit2 <= alpha_star && alpha_star < limit3) {
*sector = ReachStar;
} else if ((limit3 <= alpha_star) && (alpha_star < limit4)) {
// Modify if in the non-sailable jibe range.
alpha_star_limited = (alpha_star - hysteresis_jibe).nearest(limit3, limit4, &left);
*sector = left ? JibeStar : JibePort;
*target = left ? limit3 : limit4;
} else if ((limit4 <= alpha_star) && (alpha_star < limit1)) {
*sector = ReachPort;
} else {
fprintf(stderr, "Illegal sector range: limits: %lf %lf %lf %lf alpha*: %lf degrees\n",
limit1.deg(), limit2.deg(), limit3.deg(), limit4.deg(), alpha_star.deg());
limit1.print("limit1");
limit2.print("limit2");
limit3.print("limit3");
limit4.print("limit4");
alpha_star.print("alpha_star");
CHECK(0);
}
if (debug) {
fprintf(stderr, "limits: % 5.2lf % 5.2lf % 5.2lf % 5.2lf alpha*: %lf degrees, sector %d %c\n",
limit1.deg(), limit2.deg(), limit3.deg(), limit4.deg(), alpha_star.deg(), int(*sector), left?'L':'R');
}
return alpha_star_limited;
}
// We use the apparent wind (which is not as inert as the
// true wind) and react to wind gusts at the very start
// of the normal controller logic.
// If the sector is stable, we can calculate a bearing correction in response to fast wind
// turns.
Angle PointOfSail::AntiWindGust(SectorT sector, // sector codes
Angle alpha_app,
double mag_app_m_s) {
// If the apparent wind has direct influence on the desired heading then
// an instable system is created. We observed such oscillations during our
// lake tests: their exact mechanism is not clear. We apply an asymmetric
// change rate limitation, i.e. if we notice that we went too much into the wind then
// we fall off quickly and return very slowly only. Just like a real helmsman.
const Angle decay = deg(0.2 * 0.1); // 0.2 degree per second (very slow)
Angle correction;
if (mag_app_m_s > 0.5) {
// For the apparent wind the tack zone is smaller and the jibe zone is bigger.
// For the Jibe zone we do not take this into account because it will not
// have much of a negative effect, but would reduce the sailable angles
// a lot.
const Angle kAppOffset = deg(12); // TODO: 10 degrees seems to be better.
// Bigger than 0, if we are too close and have to fall off left.
Angle delta1 = rad(TackZoneRad()).opposite() - kAppOffset - alpha_app;
// Bigger than 0, if we shall fall off right.
Angle delta2 = -rad(TackZoneRad()).opposite() + kAppOffset - alpha_app;
// What do these deltas mean? It means that the normal control has failed or
// that the wind turned quickly.
// If delta1 is positive then the current phi_z (precisely the phi_z averaged during the
// measuring period of the most recent available apparent wind) should be changed by
// (-delta1). By doing that the boat would turn in such a way that it steers at the limit of the
// tack zone.
// If delta1 is negative it can be ignored.
switch (sector) {
case TackPort:
case ReachPort:
buffer2_ = 0;
correction = -PositiveFilterOffset(delta1, decay, &buffer1_);
if (debug && correction.negative()) {
fprintf(stderr, "corr1 FALL OFF LEFT: % 5.2lf \n", correction.deg());
}
break;
case TackStar:
case ReachStar:
buffer1_ = 0;
correction = PositiveFilterOffset(-delta2, decay, &buffer2_);
if (debug && correction > 0) {
fprintf(stderr, "corr2 FALL OFF RIGHT: % 5.2lf \n", correction.deg());
}
break;
case JibeStar:
case JibePort:
correction = 0;
buffer1_ = 0;
buffer2_ = 0;
break;
}
}
return correction;
}
void PointOfSail::Reset() {
buffer1_ = 0;
buffer2_ = 0;
}
Angle FilterOffset(Angle in, Angle decay, Angle* prev) {
if (in.sign() != 0 && in.sign() != prev->sign()) {
*prev = in;
return in;
}
if (in.positive() || prev->positive()) {
if (prev->positive())
*prev -= decay;
if (in > *prev)
*prev = in;
}
if (in.negative() || prev->negative()) {
if (prev->negative())
*prev += decay;
if (in < *prev)
*prev = in;
}
return *prev;
}
Angle PositiveFilterOffset(Angle in, Angle decay, Angle* prev) {
if (in.positive()) {
// clip the correction at 45 degrees.
return FilterOffset(std::min(in, deg(45)), decay, prev);
} else {
return FilterOffset(deg(0), decay, prev);
}
}
| 36.619792 | 114 | 0.65197 | denidoank |
f6ff7fde0a308e5535d379ce468b03c1a5fa9a35 | 1,625 | hpp | C++ | include/private/coherence/component/net/extend/protocol/AcceptChannelResponse.hpp | chpatel3/coherence-cpp-extend-client | 4ea5267eae32064dff1e73339aa3fbc9347ef0f6 | [
"UPL-1.0",
"Apache-2.0"
] | 6 | 2020-07-01T21:38:30.000Z | 2021-11-03T01:35:11.000Z | include/private/coherence/component/net/extend/protocol/AcceptChannelResponse.hpp | chpatel3/coherence-cpp-extend-client | 4ea5267eae32064dff1e73339aa3fbc9347ef0f6 | [
"UPL-1.0",
"Apache-2.0"
] | 1 | 2020-07-24T17:29:22.000Z | 2020-07-24T18:29:04.000Z | include/private/coherence/component/net/extend/protocol/AcceptChannelResponse.hpp | chpatel3/coherence-cpp-extend-client | 4ea5267eae32064dff1e73339aa3fbc9347ef0f6 | [
"UPL-1.0",
"Apache-2.0"
] | 6 | 2020-07-10T18:40:58.000Z | 2022-02-18T01:23:40.000Z | /*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
#ifndef COH_ACCEPT_CHANNEL_RESPONSE_HPP
#define COH_ACCEPT_CHANNEL_RESPONSE_HPP
#include "private/coherence/component/net/extend/AbstractPofResponse.hpp"
COH_OPEN_NAMESPACE5(coherence,component,net,extend,protocol)
using coherence::component::net::extend::AbstractPofResponse;
/**
* This Request is used to accept a Channel that was spawned by a peer.
*
* @authore nsa 2008.03.17
*/
class COH_EXPORT AcceptChannelResponse
: public class_spec<AcceptChannelResponse,
extends<AbstractPofResponse> >
{
friend class factory<AcceptChannelResponse>;
// ----- constructors ---------------------------------------------------
protected:
/**
* Create a new NamedCacheProtocol instance.
*/
AcceptChannelResponse();
private:
/**
* Blocked copy constructor.
*/
AcceptChannelResponse(const AcceptChannelResponse&);
// ----- Message interface ----------------------------------------------
public:
/**
* {@inheritDoc}
*/
virtual int32_t getTypeId() const;
/**
* {@inheritDoc}
*/
virtual void run();
// ----- constants ------------------------------------------------------
public:
/**
* The type identifier of this Message class.
*/
static const int32_t type_id = 14;
};
COH_CLOSE_NAMESPACE5
#endif // COH_ACCEPT_CHANNEL_RESPONSE_HPP
| 23.550725 | 77 | 0.582154 | chpatel3 |
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 | shadwstalkr |
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 | ledmonster |
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 | eao197 |
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 | rkanavath |
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 | Fez29 |
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 | PetrVevoda |
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 | santaclose |
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 | jluisfgarza |
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 | Yash-Wasalwar-07 |
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 | AetherealLlama |
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 | lznamens |
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 | pedrospeixoto |
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 | yyxgiser |
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 | sethrj |
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 | colinswrath |
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 | snaar |
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 | acc-cosc-1337-spring-2021 |
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 | BorisPis |
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 | adityamuley29 |
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 | foragony |
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 | aj7tesh |
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 | calumgrant |
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 | qicosmos |
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 | XoDeR |
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 | edwig |
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 | xiao6768 |
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 | jonaszell97 |