comparison liboctave/numeric/eigs-base.cc @ 21190:342764537e5a

don't install eigs-base.cc * eigs-base.h: New file. * __eigs__.cc: Include eigs-base.h, not eigs-base.cc * eigs-base.cc: Instantiate functions needed in Octave. * liboctave/numeric/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Thu, 04 Feb 2016 02:24:51 -0500
parents 7962dbca527f
children f7121e111991
comparison
equal deleted inserted replaced
21189:47765afaf131 21190:342764537e5a
27 #include <cfloat> 27 #include <cfloat>
28 #include <cmath> 28 #include <cmath>
29 #include <vector> 29 #include <vector>
30 #include <iostream> 30 #include <iostream>
31 31
32 #include "CSparse.h"
33 #include "CmplxCHOL.h"
34 #include "CmplxLU.h"
35 #include "MatrixType.h"
36 #include "dSparse.h"
37 #include "dbleCHOL.h"
38 #include "dbleLU.h"
39 #include "eigs-base.h"
32 #include "f77-fcn.h" 40 #include "f77-fcn.h"
41 #include "mx-ops.h"
33 #include "oct-locbuf.h" 42 #include "oct-locbuf.h"
43 #include "oct-rand.h"
34 #include "quit.h" 44 #include "quit.h"
45 #include "sparse-chol.h"
35 #include "sparse-lu.h" 46 #include "sparse-lu.h"
36 #include "dSparse.h"
37 #include "CSparse.h"
38 #include "MatrixType.h"
39 #include "sparse-chol.h"
40 #include "oct-rand.h"
41 #include "dbleCHOL.h"
42 #include "CmplxCHOL.h"
43 #include "dbleLU.h"
44 #include "CmplxLU.h"
45 47
46 #ifdef HAVE_ARPACK 48 #ifdef HAVE_ARPACK
47 typedef ColumnVector (*EigsFunc) (const ColumnVector &x, int &eigs_error);
48 typedef ComplexColumnVector (*EigsComplexFunc)
49 (const ComplexColumnVector &x, int &eigs_error);
50 49
51 // Arpack and blas fortran functions we call. 50 // Arpack and blas fortran functions we call.
52 extern "C" 51 extern "C"
53 { 52 {
54 F77_RET_T 53 F77_RET_T
3253 (*current_liboctave_error_handler) ("eigs: error %d in zneupd", info2); 3252 (*current_liboctave_error_handler) ("eigs: error %d in zneupd", info2);
3254 3253
3255 return ip(4); 3254 return ip(4);
3256 } 3255 }
3257 3256
3258 #ifndef _MSC_VER 3257 // Instantiations for the types we need.
3259 template octave_idx_type 3258
3260 lusolve (const SparseMatrix&, const SparseMatrix&, Matrix&); 3259 // Matrix
3261 3260
3262 template octave_idx_type 3261 template
3263 lusolve (const SparseComplexMatrix&, const SparseComplexMatrix&, 3262 octave_idx_type
3264 ComplexMatrix&); 3263 EigsRealSymmetricMatrix<Matrix>
3265 3264 (const Matrix& m, const std::string typ, octave_idx_type k,
3266 template octave_idx_type 3265 octave_idx_type p, octave_idx_type& info, Matrix& eig_vec,
3267 lusolve (const Matrix&, const Matrix&, Matrix&); 3266 ColumnVector& eig_val, const Matrix& _b, ColumnVector& permB,
3268 3267 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3269 template octave_idx_type 3268 bool cholB, int disp, int maxit);
3270 lusolve (const ComplexMatrix&, const ComplexMatrix&, ComplexMatrix&); 3269
3271 3270 template
3272 template ComplexMatrix 3271 octave_idx_type
3273 ltsolve (const SparseComplexMatrix&, const ColumnVector&, 3272 EigsRealSymmetricMatrixShift<Matrix>
3274 const ComplexMatrix&); 3273 (const Matrix& m, double sigma, octave_idx_type k,
3275 3274 octave_idx_type p, octave_idx_type& info, Matrix& eig_vec,
3276 template Matrix 3275 ColumnVector& eig_val, const Matrix& _b, ColumnVector& permB,
3277 ltsolve (const SparseMatrix&, const ColumnVector&, const Matrix&); 3276 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3278 3277 bool cholB, int disp, int maxit);
3279 template ComplexMatrix 3278
3280 ltsolve (const ComplexMatrix&, const ColumnVector&, const ComplexMatrix&); 3279 template
3281 3280 octave_idx_type
3282 template Matrix 3281 EigsRealNonSymmetricMatrix<Matrix>
3283 ltsolve (const Matrix&, const ColumnVector&, const Matrix&); 3282 (const Matrix& m, const std::string typ, octave_idx_type k,
3284 3283 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3285 template ComplexMatrix 3284 ComplexColumnVector& eig_val, const Matrix& _b, ColumnVector& permB,
3286 utsolve (const SparseComplexMatrix&, const ColumnVector&, 3285 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3287 const ComplexMatrix&); 3286 bool cholB, int disp, int maxit);
3288 3287
3289 template Matrix 3288 template
3290 utsolve (const SparseMatrix&, const ColumnVector&, const Matrix&); 3289 octave_idx_type
3291 3290 EigsRealNonSymmetricMatrixShift<Matrix>
3292 template ComplexMatrix 3291 (const Matrix& m, double sigmar, octave_idx_type k,
3293 utsolve (const ComplexMatrix&, const ColumnVector&, const ComplexMatrix&); 3292 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3294 3293 ComplexColumnVector& eig_val, const Matrix& _b, ColumnVector& permB,
3295 template Matrix 3294 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3296 utsolve (const Matrix&, const ColumnVector&, const Matrix&); 3295 bool cholB, int disp, int maxit);
3296
3297 // SparseMatrix
3298
3299 template
3300 octave_idx_type
3301 EigsRealSymmetricMatrix<SparseMatrix>
3302 (const SparseMatrix& m, const std::string typ, octave_idx_type k,
3303 octave_idx_type p, octave_idx_type& info, Matrix& eig_vec,
3304 ColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB,
3305 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3306 bool cholB, int disp, int maxit);
3307
3308 template
3309 octave_idx_type
3310 EigsRealSymmetricMatrixShift<SparseMatrix>
3311 (const SparseMatrix& m, double sigma, octave_idx_type k,
3312 octave_idx_type p, octave_idx_type& info, Matrix& eig_vec,
3313 ColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB,
3314 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3315 bool cholB, int disp, int maxit);
3316
3317 template
3318 octave_idx_type
3319 EigsRealNonSymmetricMatrix<SparseMatrix>
3320 (const SparseMatrix& m, const std::string typ, octave_idx_type k,
3321 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3322 ComplexColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB,
3323 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3324 bool cholB, int disp, int maxit);
3325
3326 template
3327 octave_idx_type
3328 EigsRealNonSymmetricMatrixShift<SparseMatrix>
3329 (const SparseMatrix& m, double sigmar, octave_idx_type k,
3330 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3331 ComplexColumnVector& eig_val, const SparseMatrix& _b, ColumnVector& permB,
3332 ColumnVector& resid, std::ostream& os, double tol, bool rvec,
3333 bool cholB, int disp, int maxit);
3334
3335 // ComplexMatrix
3336
3337 template
3338 octave_idx_type
3339 EigsComplexNonSymmetricMatrix<ComplexMatrix>
3340 (const ComplexMatrix& m, const std::string typ, octave_idx_type k,
3341 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3342 ComplexColumnVector& eig_val, const ComplexMatrix& _b, ColumnVector& permB,
3343 ComplexColumnVector& cresid, std::ostream& os, double tol,
3344 bool rvec, bool cholB, int disp, int maxit);
3345
3346 template
3347 octave_idx_type
3348 EigsComplexNonSymmetricMatrixShift<ComplexMatrix>
3349 (const ComplexMatrix& m, Complex sigma, octave_idx_type k,
3350 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3351 ComplexColumnVector& eig_val, const ComplexMatrix& _b, ColumnVector& permB,
3352 ComplexColumnVector& cresid, std::ostream& os, double tol,
3353 bool rvec, bool cholB, int disp, int maxit);
3354
3355 // SparseComplexMatrix
3356
3357 template
3358 octave_idx_type
3359 EigsComplexNonSymmetricMatrix<SparseComplexMatrix>
3360 (const SparseComplexMatrix& m, const std::string typ, octave_idx_type k,
3361 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3362 ComplexColumnVector& eig_val, const SparseComplexMatrix& _b,
3363 ColumnVector& permB, ComplexColumnVector& cresid, std::ostream& os,
3364 double tol, bool rvec, bool cholB, int disp, int maxit);
3365
3366 template
3367 octave_idx_type
3368 EigsComplexNonSymmetricMatrixShift<SparseComplexMatrix>
3369 (const SparseComplexMatrix& m, Complex sigma, octave_idx_type k,
3370 octave_idx_type p, octave_idx_type& info, ComplexMatrix& eig_vec,
3371 ComplexColumnVector& eig_val, const SparseComplexMatrix& _b,
3372 ColumnVector& permB, ComplexColumnVector& cresid, std::ostream& os,
3373 double tol, bool rvec, bool cholB, int disp, int maxit);
3374
3297 #endif 3375 #endif
3298
3299 #endif