All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
structs.hpp
Go to the documentation of this file.
#ifndef VIENNACL_LINALG_DETAIL_BISECT_STRUCTS_HPP_
#define VIENNACL_LINALG_DETAIL_BISECT_STRUCTS_HPP_
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include "viennacl/vector.hpp"
#include "viennacl/matrix.hpp"
namespace viennacl
{
namespace linalg
{
namespace detail
{
template<typename NumericT>
struct InputData
{
std::vector<NumericT> std_a;
std::vector<NumericT> std_b;
viennacl::vector<NumericT> g_a;
viennacl::vector<NumericT> g_b;
InputData(std::vector<NumericT> diagonal, std::vector<NumericT> superdiagonal, const unsigned int sz) :
std_a(sz), std_b(sz), g_a(sz), g_b(sz)
{
std_a = diagonal;
std_b = superdiagonal;
viennacl::copy(std_b, g_b);
viennacl::copy(std_a, g_a);
}
InputData(viennacl::vector<NumericT> diagonal, viennacl::vector<NumericT> superdiagonal, const unsigned int sz) :
std_a(sz), std_b(sz), g_a(sz), g_b(sz)
{
g_a = diagonal;
g_b = superdiagonal;
viennacl::copy(g_a, std_a);
viennacl::copy(g_b, std_b);
}
};
template<typename NumericT>
struct ResultDataSmall
{
std::vector<NumericT> std_eigenvalues;
viennacl::vector<NumericT> vcl_g_left;
viennacl::vector<NumericT> vcl_g_right;
viennacl::vector<unsigned int> vcl_g_left_count;
viennacl::vector<unsigned int> vcl_g_right_count;
ResultDataSmall(const unsigned int mat_size) :
std_eigenvalues(mat_size), vcl_g_left(mat_size), vcl_g_right(mat_size), vcl_g_left_count(mat_size), vcl_g_right_count(mat_size) {}
};
template<typename NumericT>
struct ResultDataLarge
{
std::vector<NumericT> std_eigenvalues;
viennacl::scalar<unsigned int> g_num_one;
viennacl::scalar<unsigned int> g_num_blocks_mult;
viennacl::vector<NumericT> g_left_one;
viennacl::vector<NumericT> g_right_one;
viennacl::vector<unsigned int> g_pos_one;
viennacl::vector<NumericT> g_left_mult;
viennacl::vector<NumericT> g_right_mult;
viennacl::vector<unsigned int> g_left_count_mult;
viennacl::vector<unsigned int> g_right_count_mult;
viennacl::vector<unsigned int> g_blocks_mult;
viennacl::vector<unsigned int> g_blocks_mult_sum;
viennacl::vector<NumericT> g_lambda_mult;
viennacl::vector<unsigned int> g_pos_mult;
ResultDataLarge(unsigned int mat_size) :
std_eigenvalues(mat_size), g_num_one(0), g_num_blocks_mult(0),
g_left_one(mat_size), g_right_one(mat_size), g_pos_one(mat_size),
g_left_mult(mat_size), g_right_mult(mat_size), g_left_count_mult(mat_size), g_right_count_mult(mat_size),
g_blocks_mult(mat_size), g_blocks_mult_sum(mat_size), g_lambda_mult(mat_size), g_pos_mult(mat_size) {}
};
} // namespace detail
} // namespace linalg
} // namespace viennacl
#endif // #ifndef VIENNACL_LINALG_DETAIL_STRUCTS_HPP_
viennacl::linalg::detail::InputData::g_b
viennacl::vector< NumericT > g_b
device side representation of superdiagonal
Definition: structs.hpp:62
viennacl::linalg::detail::ResultDataSmall::std_eigenvalues
std::vector< NumericT > std_eigenvalues
eigenvalues (host side)
Definition: structs.hpp:99
viennacl::scalar< unsigned int >
viennacl::linalg::detail::ResultDataLarge::g_left_mult
viennacl::vector< NumericT > g_left_mult
left interval limits of intervals containing multiple eigenvalues after the first iteration step ...
Definition: structs.hpp:146
viennacl::linalg::detail::InputData::InputData
InputData(viennacl::vector< NumericT > diagonal, viennacl::vector< NumericT > superdiagonal, const unsigned int sz)
Definition: structs.hpp:80
viennacl::linalg::detail::ResultDataLarge::g_left_one
viennacl::vector< NumericT > g_left_one
left interval limits of intervals containing one eigenvalue after the first iteration step ...
Definition: structs.hpp:137
matrix.hpp
Implementation of the dense matrix class.
viennacl::linalg::detail::ResultDataLarge::g_num_blocks_mult
viennacl::scalar< unsigned int > g_num_blocks_mult
number of (thread) blocks of intervals containing multiple eigenvalues after the first steo ...
Definition: structs.hpp:134
viennacl::linalg::detail::ResultDataLarge::g_blocks_mult
viennacl::vector< unsigned int > g_blocks_mult
start addresses in g_left_mult etc. of blocks of intervals containing more than one eigenvalue after ...
Definition: structs.hpp:156
viennacl::linalg::detail::InputData::std_a
std::vector< NumericT > std_a
host side representation of diagonal
Definition: structs.hpp:56
viennacl::linalg::detail::ResultDataLarge::g_left_count_mult
viennacl::vector< unsigned int > g_left_count_mult
number of eigenvalues less than the left limit of the eigenvalue intervals containing multiple eigenv...
Definition: structs.hpp:151
viennacl::linalg::detail::ResultDataLarge::g_right_count_mult
viennacl::vector< unsigned int > g_right_count_mult
number of eigenvalues less than the right limit of the eigenvalue intervals containing multiple eigen...
Definition: structs.hpp:154
viennacl::linalg::detail::InputData
In this class the input matrix is stored.
Definition: structs.hpp:53
viennacl::linalg::detail::ResultDataSmall::ResultDataSmall
ResultDataSmall(const unsigned int mat_size)
Initialize variables and memory for the result for small matrices.
Definition: structs.hpp:113
viennacl::linalg::detail::ResultDataSmall::vcl_g_right
viennacl::vector< NumericT > vcl_g_right
right interval limits at the end of the computation
Definition: structs.hpp:103
viennacl::linalg::detail::ResultDataLarge::g_lambda_mult
viennacl::vector< NumericT > g_lambda_mult
eigenvalues that have been generated in the second step from intervals that still contained multiple ...
Definition: structs.hpp:162
viennacl::linalg::detail::ResultDataSmall::vcl_g_left
viennacl::vector< NumericT > vcl_g_left
left interval limits at the end of the computation
Definition: structs.hpp:101
viennacl::linalg::detail::ResultDataSmall::vcl_g_left_count
viennacl::vector< unsigned int > vcl_g_left_count
number of eigenvalues smaller than the left interval limit
Definition: structs.hpp:105
viennacl::linalg::detail::ResultDataLarge::g_pos_one
viennacl::vector< unsigned int > g_pos_one
interval indices (position in sorted listed of eigenvalues) of intervals containing one eigenvalue af...
Definition: structs.hpp:143
viennacl::linalg::detail::ResultDataLarge::std_eigenvalues
std::vector< NumericT > std_eigenvalues
eigenvalues
Definition: structs.hpp:128
viennacl::vector< NumericT >
viennacl::linalg::detail::InputData::InputData
InputData(std::vector< NumericT > diagonal, std::vector< NumericT > superdiagonal, const unsigned int sz)
Initialize the input data to the algorithm.
Definition: structs.hpp:70
viennacl::linalg::detail::ResultDataLarge::g_right_one
viennacl::vector< NumericT > g_right_one
right interval limits of intervals containing one eigenvalue after the first iteration step ...
Definition: structs.hpp:140
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::linalg::detail::ResultDataLarge::g_pos_mult
viennacl::vector< unsigned int > g_pos_mult
eigenvalue index of intervals that have been generated in the second processing step ...
Definition: structs.hpp:165
viennacl::copy
void copy(std::vector< NumericT > &cpu_vec, circulant_matrix< NumericT, AlignmentV > &gpu_mat)
Copies a circulant matrix from the std::vector to the OpenCL device (either GPU or multi-core CPU) ...
Definition: circulant_matrix.hpp:150
viennacl::linalg::detail::ResultDataLarge::ResultDataLarge
ResultDataLarge(unsigned int mat_size)
Initialize variables and memory for result.
Definition: structs.hpp:171
viennacl::linalg::detail::ResultDataSmall::vcl_g_right_count
viennacl::vector< unsigned int > vcl_g_right_count
number of eigenvalues bigger than the right interval limit
Definition: structs.hpp:107
viennacl::linalg::detail::ResultDataLarge
In this class the data of the result for large matrices is stored.
Definition: structs.hpp:125
viennacl::linalg::detail::ResultDataLarge::g_blocks_mult_sum
viennacl::vector< unsigned int > g_blocks_mult_sum
accumulated number of intervals in g_left_mult etc. of blocks of intervals containing more than one e...
Definition: structs.hpp:159
viennacl::linalg::detail::ResultDataLarge::g_num_one
viennacl::scalar< unsigned int > g_num_one
number of intervals containing one eigenvalue after the first step
Definition: structs.hpp:131
viennacl::linalg::detail::InputData::std_b
std::vector< NumericT > std_b
host side representation superdiagonal
Definition: structs.hpp:58
viennacl::linalg::detail::ResultDataSmall
In this class the data of the result for small matrices is stored.
Definition: structs.hpp:96
viennacl::linalg::detail::InputData::g_a
viennacl::vector< NumericT > g_a
device side representation of diagonal
Definition: structs.hpp:60
viennacl::linalg::detail::ResultDataLarge::g_right_mult
viennacl::vector< NumericT > g_right_mult
right interval limits of intervals containing multiple eigenvalues after the first iteration step ...
Definition: structs.hpp:148