/usr/include/viennacl/linalg/tred2.hpp is in libviennacl-dev 1.5.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #ifndef VIENNACL_LINALG_TRED2_HPP_
#define VIENNACL_LINALG_TRED2_HPP_
/* =========================================================================
Copyright (c) 2010-2014, 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
============================================================================= */
/** @file viennacl/linalg/tred2.hpp
* @brief optimized CPU tridiagonalization
*
* Contributed by Alex Christensen.
*/
#include "viennacl/linalg/host_based/sse_kernels.hpp"
#include <boost/numeric/ublas/matrix.hpp>
namespace viennacl
{
namespace linalg
{
/** @brief Inplace reduction of a hermitian (or real symmetric) to tridiagonal form using householder similarity transforms (preserving eigenvalues)
*
* @param A A dense matrix to be tridiagonalized
* @param block_size The block size to be used
*/
template<typename ScalarType>
void inplace_tred2(boost::numeric::ublas::matrix<ScalarType> const & A, vcl_size_t block_size = 1)
{
#ifdef VIENNACL_WITH_OPENMP
vcl_size_t num_threads=(vcl_size_t)omp_get_max_threads();
omp_set_num_threads(omp_get_max_threads());
#else
vcl_size_t num_threads=1;
#endif
vcl_size_t n=A.size1();
if(n!=A.size2())
std::cerr << "ViennaCL: Warning in inplace_tred2(): Matrix is not hermitian (or real symmetric)" << std::endl;
block_size=std::min(n,block_size);
//get pointers to the value arrays
ScalarType** rows=new ScalarType*[n];
for(vcl_size_t i=0;i<n;i++)
rows[i]=(ScalarType*)&A(i,0);
//call the optimized CPU code
inplace_tred2(rows,A.size1(),block_size,num_threads);
delete [] rows;
}
} //namespace linalg
} //namespace viennacl
#endif
|