2 * Copyright 1993-2013 NVIDIA Corporation. All rights reserved.
4 * Please refer to the NVIDIA end user license agreement (EULA) associated
5 * with this source code for terms and conditions that govern your use of
6 * this software. Any use, reproduction, disclosure, or distribution of
7 * this software and related documentation outside the terms of the EULA
8 * is strictly prohibited.
30 } // end namespace, unnamed
32 ///////////////////////////////////////////////////////////////////////////////
33 //! Write a tridiagonal, symmetric matrix in vector representation and
35 //! @param filename name of output file
36 //! @param d diagonal entries of the matrix
37 //! @param s superdiagonal entries of the matrix (len = n - 1)
38 //! @param eigenvals eigenvalues of the matrix
39 //! @param indices vector of len n containing the position of the eigenvalues
40 //! if these are sorted in ascending order
41 //! @param n size of the matrix
42 ///////////////////////////////////////////////////////////////////////////////
44 writeTridiagSymMatlab(const char *filename,
49 std::ofstream file(filename, std::ios::out);
51 // write diagonal entries
52 writeVectorMatlab(file, "d", d, n);
54 // write superdiagonal entries
55 writeVectorMatlab(file, "s", s, n-1);
58 writeVectorMatlab(file, "eigvals", eigenvals, n);