All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
global_variables.cpp
Go to the documentation of this file.
/* =========================================================================
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 PDF manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
//
// *** System
//
#include <iostream>
#include <algorithm>
#include <cmath>
//
// *** ViennaCL
//
#include "viennacl/scalar.hpp"
#include "viennacl/vector.hpp"
#include "viennacl/matrix.hpp"
#include "viennacl/compressed_matrix.hpp"
#include "viennacl/coordinate_matrix.hpp"
#include "viennacl/ell_matrix.hpp"
#include "viennacl/hyb_matrix.hpp"
#ifdef VIENNACL_WITH_OPENCL
#include "viennacl/circulant_matrix.hpp"
#include "viennacl/hankel_matrix.hpp"
#include "viennacl/toeplitz_matrix.hpp"
#include "viennacl/vandermonde_matrix.hpp"
#endif
// forward declarations of global variables:
extern viennacl::scalar<float> s1;
extern viennacl::scalar<int> s2;
extern viennacl::vector<float> v1;
extern viennacl::vector<int> v2;
extern viennacl::matrix<float> m1;
// instantiation of global variables:
viennacl::scalar<float> s1;
viennacl::scalar<int> s2;
viennacl::vector<float> v1;
viennacl::vector<int> v2;
viennacl::matrix<float> m1;
//viennacl::matrix<int> m2;
// TODO: Add checks for other types
//
// -------------------------------------------------------------
//
int main()
{
std::cout << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << "## Test :: Instantiation of global variables" << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << "----------------------------------------------" << std::endl;
std::cout << std::endl;
s1 = viennacl::scalar<float>(1.0f);
s2 = viennacl::scalar<int>(1);
v1 = viennacl::vector<float>(5);
v2 = viennacl::vector<int>(5);
m1 = viennacl::matrix<float>(5, 4);
//m2 = viennacl::matrix<int>(5, 4);
std::cout << std::endl;
std::cout << "------- Test completed --------" << std::endl;
std::cout << std::endl;
return EXIT_SUCCESS;
}
//
// -------------------------------------------------------------
//
viennacl::scalar< float >
matrix.hpp
Implementation of the dense matrix class.
viennacl::matrix
A dense matrix class.
Definition: forwards.h:375
s2
viennacl::scalar< int > s2
Definition: global_variables.cpp:58
main
int main()
Definition: global_variables.cpp:71
s1
viennacl::scalar< float > s1
Definition: global_variables.cpp:57
coordinate_matrix.hpp
Implementation of the coordinate_matrix class.
v1
viennacl::vector< float > v1
Definition: global_variables.cpp:60
hyb_matrix.hpp
Implementation of the hyb_matrix class.
hankel_matrix.hpp
Implementation of the hankel_matrix class for efficient manipulation of Hankel matrices. Experimental.
circulant_matrix.hpp
Implementation of the circulant_matrix class for efficient manipulation of circulant matrices...
compressed_matrix.hpp
Implementation of the compressed_matrix class.
ell_matrix.hpp
Implementation of the ell_matrix class.
viennacl::vector
Definition: forwards.h:266
vandermonde_matrix.hpp
Implementation of the vandermonde_matrix class for efficient manipulation of Vandermonde matrices...
v2
viennacl::vector< int > v2
Definition: global_variables.cpp:61
vector.hpp
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
m1
viennacl::matrix< float > m1
Definition: global_variables.cpp:63
scalar.hpp
Implementation of the ViennaCL scalar class.
toeplitz_matrix.hpp
Implementation of the toeplitz_matrix class for efficient manipulation of Toeplitz matrices...