ViennaCL - The Vienna Computing Library  1.6.0
Free open-source GPU-accelerated linear algebra and solver library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
structs.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_LINALG_DETAIL_BISECT_STRUCTS_HPP_
2 #define VIENNACL_LINALG_DETAIL_BISECT_STRUCTS_HPP_
3 
4 /* =========================================================================
5  Copyright (c) 2010-2014, Institute for Microelectronics,
6  Institute for Analysis and Scientific Computing,
7  TU Wien.
8  Portions of this software are copyright by UChicago Argonne, LLC.
9 
10  -----------------
11  ViennaCL - The Vienna Computing Library
12  -----------------
13 
14  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15 
16  (A list of authors and contributors can be found in the PDF manual)
17 
18  License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20 
21 
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <string.h>
35 #include <math.h>
36 #include <float.h>
37 #include <assert.h>
38 
39 #include "viennacl/vector.hpp"
40 #include "viennacl/matrix.hpp"
41 
42 namespace viennacl
43 {
44 namespace linalg
45 {
46 namespace detail
47 {
48 
52 template<typename NumericT>
53 struct InputData
54 {
56  std::vector<NumericT> std_a;
58  std::vector<NumericT> std_b;
63 
71 
72  InputData(std::vector<NumericT> diagonal, std::vector<NumericT> superdiagonal, const unsigned int sz) :
73  std_a(sz), std_b(sz), g_a(sz), g_b(sz)
74  {
75  std_a = diagonal;
76  std_b = superdiagonal;
77 
80  }
81 
82  InputData(viennacl::vector<NumericT> diagonal, viennacl::vector<NumericT> superdiagonal, const unsigned int sz) :
83  std_a(sz), std_b(sz), g_a(sz), g_b(sz)
84  {
85  g_a = diagonal;
86  g_b = superdiagonal;
87 
90  }
91 };
92 
93 
97 template<typename NumericT>
99 {
101  std::vector<NumericT> std_eigenvalues;
110 
111 
115  ResultDataSmall(const unsigned int mat_size) :
116  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)
117  {
118  }
119 };
120 
121 
122 
123 
124 
128 template<typename NumericT>
130 {
132  std::vector<NumericT> std_eigenvalues;
133 
136 
140 
144 
148 
152 
159 
163 
170 
174 
178 
182 
183 
184 
189  ResultDataLarge(const unsigned int mat_size) :
190  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),
191  g_left_mult(mat_size), g_right_mult(mat_size),g_left_count_mult(mat_size), g_right_count_mult(mat_size),
192  g_blocks_mult(mat_size), g_blocks_mult_sum(mat_size), g_lambda_mult(mat_size), g_pos_mult(mat_size) {}
193 };
194 } // namespace detail
195 } // namespace linalg
196 } // namespace viennacl
197 #endif // #ifndef VIENNACL_LINALG_DETAIL_STRUCTS_HPP_
198 
viennacl::vector< NumericT > g_b
device side representation of superdiagonal
Definition: structs.hpp:62
std::vector< NumericT > std_eigenvalues
eigenvalues (host side)
Definition: structs.hpp:101
viennacl::vector< NumericT > g_left_mult
Definition: structs.hpp:155
InputData(viennacl::vector< NumericT > diagonal, viennacl::vector< NumericT > superdiagonal, const unsigned int sz)
Definition: structs.hpp:82
viennacl::vector< NumericT > g_left_one
Definition: structs.hpp:143
Implementation of the dense matrix class.
viennacl::scalar< unsigned int > g_num_blocks_mult
Definition: structs.hpp:139
viennacl::vector< unsigned int > g_blocks_mult
Definition: structs.hpp:169
std::vector< NumericT > std_a
host side representation of diagonal
Definition: structs.hpp:56
viennacl::vector< unsigned int > g_left_count_mult
Definition: structs.hpp:162
viennacl::vector< unsigned int > g_right_count_mult
Definition: structs.hpp:166
In this class the input matrix is stored.
Definition: structs.hpp:53
ResultDataSmall(const unsigned int mat_size)
Initialize variables and memory for the result for small matrices.
Definition: structs.hpp:115
viennacl::vector< NumericT > vcl_g_right
right interval limits at the end of the computation
Definition: structs.hpp:105
viennacl::vector< NumericT > g_lambda_mult
Definition: structs.hpp:177
viennacl::vector< NumericT > vcl_g_left
left interval limits at the end of the computation
Definition: structs.hpp:103
viennacl::vector< unsigned int > vcl_g_left_count
number of eigenvalues smaller than the left interval limit
Definition: structs.hpp:107
viennacl::vector< unsigned int > g_pos_one
Definition: structs.hpp:151
std::vector< NumericT > std_eigenvalues
eigenvalues
Definition: structs.hpp:132
InputData(std::vector< NumericT > diagonal, std::vector< NumericT > superdiagonal, const unsigned int sz)
Definition: structs.hpp:72
viennacl::vector< NumericT > g_right_one
Definition: structs.hpp:147
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::vector< unsigned int > g_pos_mult
Definition: structs.hpp:181
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) ...
ResultDataLarge(const unsigned int mat_size)
Initialize variables and memory for result.
Definition: structs.hpp:189
viennacl::vector< unsigned int > vcl_g_right_count
number of eigenvalues bigger than the right interval limit
Definition: structs.hpp:109
In this class the data of the result for large matrices is stored.
Definition: structs.hpp:129
viennacl::vector< unsigned int > g_blocks_mult_sum
Definition: structs.hpp:173
viennacl::scalar< unsigned int > g_num_one
number of intervals containing one eigenvalue after the first step
Definition: structs.hpp:135
std::vector< NumericT > std_b
host side representation superdiagonal
Definition: structs.hpp:58
In this class the data of the result for small matrices is stored.
Definition: structs.hpp:98
viennacl::vector< NumericT > g_a
device side representation of diagonal
Definition: structs.hpp:60
viennacl::vector< NumericT > g_right_mult
Definition: structs.hpp:158