ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
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-2015, 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 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 
70  InputData(std::vector<NumericT> diagonal, std::vector<NumericT> superdiagonal, const unsigned int sz) :
71  std_a(sz), std_b(sz), g_a(sz), g_b(sz)
72  {
73  std_a = diagonal;
74  std_b = superdiagonal;
75 
76  viennacl::copy(std_b, g_b);
77  viennacl::copy(std_a, g_a);
78  }
79 
80  InputData(viennacl::vector<NumericT> diagonal, viennacl::vector<NumericT> superdiagonal, const unsigned int sz) :
81  std_a(sz), std_b(sz), g_a(sz), g_b(sz)
82  {
83  g_a = diagonal;
84  g_b = superdiagonal;
85 
86  viennacl::copy(g_a, std_a);
87  viennacl::copy(g_b, std_b);
88  }
89 };
90 
91 
95 template<typename NumericT>
97 {
99  std::vector<NumericT> std_eigenvalues;
108 
109 
113  ResultDataSmall(const unsigned int mat_size) :
114  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) {}
115 };
116 
117 
118 
119 
120 
124 template<typename NumericT>
126 {
128  std::vector<NumericT> std_eigenvalues;
129 
132 
135 
138 
141 
144 
149 
152 
157 
160 
163 
166 
171  ResultDataLarge(unsigned int mat_size) :
172  std_eigenvalues(mat_size), g_num_one(0), g_num_blocks_mult(0),
173  g_left_one(mat_size), g_right_one(mat_size), g_pos_one(mat_size),
174  g_left_mult(mat_size), g_right_mult(mat_size), g_left_count_mult(mat_size), g_right_count_mult(mat_size),
175  g_blocks_mult(mat_size), g_blocks_mult_sum(mat_size), g_lambda_mult(mat_size), g_pos_mult(mat_size) {}
176 
177 };
178 } // namespace detail
179 } // namespace linalg
180 } // namespace viennacl
181 #endif // #ifndef VIENNACL_LINALG_DETAIL_STRUCTS_HPP_
182 
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:99
viennacl::vector< NumericT > g_left_mult
left interval limits of intervals containing multiple eigenvalues after the first iteration step ...
Definition: structs.hpp:146
InputData(viennacl::vector< NumericT > diagonal, viennacl::vector< NumericT > superdiagonal, const unsigned int sz)
Definition: structs.hpp:80
viennacl::vector< NumericT > g_left_one
left interval limits of intervals containing one eigenvalue after the first iteration step ...
Definition: structs.hpp:137
Implementation of the dense matrix class.
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::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
std::vector< NumericT > std_a
host side representation of diagonal
Definition: structs.hpp:56
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
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:34
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
In this class the input matrix is stored.
Definition: structs.hpp:53
Definition: blas3.hpp:36
ResultDataSmall(const unsigned int mat_size)
Initialize variables and memory for the result for small matrices.
Definition: structs.hpp:113
viennacl::vector< NumericT > vcl_g_right
right interval limits at the end of the computation
Definition: structs.hpp:103
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::vector< NumericT > vcl_g_left
left interval limits at the end of the computation
Definition: structs.hpp:101
viennacl::vector< unsigned int > vcl_g_left_count
number of eigenvalues smaller than the left interval limit
Definition: structs.hpp:105
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
std::vector< NumericT > std_eigenvalues
eigenvalues
Definition: structs.hpp:128
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::vector< NumericT > g_right_one
right interval limits of intervals containing one eigenvalue after the first iteration step ...
Definition: structs.hpp:140
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
viennacl::vector< unsigned int > g_pos_mult
eigenvalue index of intervals that have been generated in the second processing step ...
Definition: structs.hpp:165
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(unsigned int mat_size)
Initialize variables and memory for result.
Definition: structs.hpp:171
viennacl::vector< unsigned int > vcl_g_right_count
number of eigenvalues bigger than the right interval limit
Definition: structs.hpp:107
In this class the data of the result for large matrices is stored.
Definition: structs.hpp:125
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::scalar< unsigned int > g_num_one
number of intervals containing one eigenvalue after the first step
Definition: structs.hpp:131
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:96
viennacl::vector< NumericT > g_a
device side representation of diagonal
Definition: structs.hpp:60
viennacl::vector< NumericT > g_right_mult
right interval limits of intervals containing multiple eigenvalues after the first iteration step ...
Definition: structs.hpp:148