# HG changeset patch # User John W. Eaton # Date 1454872003 18000 # Node ID ddf0a5f3a967705f8b6168a94789dc0a1a2e086b # Parent 2bb4e5a6290db17e6d57a8c16f067dd7f1eccfe9 split interface and implementation for dmsolve * sparse-dmsolve.h: New file. Provide dmsolve declaration only. * liboctave/numeric/module.mk: Update. * sparse-dmsolve.cc: Explicitly instantiate template types we need. * CSparse.cc, dSparse.cc: Include sparse-dmsolve.h instead of sparse-dmsolve.cc. diff -r 2bb4e5a6290d -r ddf0a5f3a967 liboctave/array/CSparse.cc --- a/liboctave/array/CSparse.cc Sun Feb 07 13:19:04 2016 -0500 +++ b/liboctave/array/CSparse.cc Sun Feb 07 14:06:43 2016 -0500 @@ -66,8 +66,8 @@ // Define whether to use a basic QR solver or one that uses a Dulmange // Mendelsohn factorization to seperate the problem into under-determined, // well-determined and over-determined parts and solves them seperately -#ifndef USE_QRSOLVE -# include "sparse-dmsolve.cc" +#if ! defined (USE_QRSOLVE) +# include "sparse-dmsolve.h" #endif // Fortran functions we call. diff -r 2bb4e5a6290d -r ddf0a5f3a967 liboctave/array/dSparse.cc --- a/liboctave/array/dSparse.cc Sun Feb 07 13:19:04 2016 -0500 +++ b/liboctave/array/dSparse.cc Sun Feb 07 14:06:43 2016 -0500 @@ -61,8 +61,8 @@ // Define whether to use a basic QR solver or one that uses a Dulmange // Mendelsohn factorization to seperate the problem into under-determined, // well-determined and over-determined parts and solves them seperately -#ifndef USE_QRSOLVE -# include "sparse-dmsolve.cc" +#if ! defined (USE_QRSOLVE) +# include "sparse-dmsolve.h" #endif // Fortran functions we call. diff -r 2bb4e5a6290d -r ddf0a5f3a967 liboctave/numeric/module.mk --- a/liboctave/numeric/module.mk Sun Feb 07 13:19:04 2016 -0500 +++ b/liboctave/numeric/module.mk Sun Feb 07 14:06:43 2016 -0500 @@ -81,6 +81,7 @@ liboctave/numeric/randmtzig.h \ liboctave/numeric/randpoisson.h \ liboctave/numeric/sparse-chol.h \ + liboctave/numeric/sparse-dmsolve.h \ liboctave/numeric/sparse-lu.h \ liboctave/numeric/sparse-qr.h @@ -144,6 +145,7 @@ liboctave/numeric/oct-rand.cc \ liboctave/numeric/oct-spparms.cc \ liboctave/numeric/sparse-chol.cc \ + liboctave/numeric/sparse-dmsolve.cc \ liboctave/numeric/sparse-lu.cc \ liboctave/numeric/sparse-qr.cc \ $(NUMERIC_C_SRC) @@ -151,8 +153,7 @@ LIBOCTAVE_TEMPLATE_SRC += \ liboctave/numeric/base-lu.cc \ liboctave/numeric/base-qr.cc \ - liboctave/numeric/bsxfun-defs.cc \ - liboctave/numeric/sparse-dmsolve.cc + liboctave/numeric/bsxfun-defs.cc ## Special rules for sources which must be built before rest of compilation. $(LIBOCTAVE_OPT_INC) : %.h : %.in diff -r 2bb4e5a6290d -r ddf0a5f3a967 liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Sun Feb 07 13:19:04 2016 -0500 +++ b/liboctave/numeric/sparse-dmsolve.cc Sun Feb 07 14:06:43 2016 -0500 @@ -475,3 +475,37 @@ #endif } + +// Instantiations we need. + +template ComplexMatrix +dmsolve + (const SparseComplexMatrix&, const Matrix&, octave_idx_type&); + +template SparseComplexMatrix +dmsolve + (const SparseComplexMatrix&, const SparseMatrix&, octave_idx_type&); + +template ComplexMatrix +dmsolve + (const SparseComplexMatrix&, const ComplexMatrix&, octave_idx_type&); + +template SparseComplexMatrix +dmsolve + (const SparseComplexMatrix&, const SparseComplexMatrix&, octave_idx_type&); + +template Matrix +dmsolve + (const SparseMatrix&, const Matrix&, octave_idx_type&); + +template SparseMatrix +dmsolve + (const SparseMatrix&, const SparseMatrix&, octave_idx_type&); + +template ComplexMatrix +dmsolve + (const SparseMatrix&, const ComplexMatrix&, octave_idx_type&); + +template SparseComplexMatrix +dmsolve + (const SparseMatrix&, const SparseComplexMatrix&, octave_idx_type&); diff -r 2bb4e5a6290d -r ddf0a5f3a967 liboctave/numeric/sparse-dmsolve.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/numeric/sparse-dmsolve.h Sun Feb 07 14:06:43 2016 -0500 @@ -0,0 +1,31 @@ +/* + +Copyright (C) 2016 John W. Eaton +Copyright (C) 2006-2015 David Bateman + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#if ! defined (octave_sparse_dmsolve_h) +#define octave_sparse_dmsolve_h 1 + +template +RT +dmsolve (const ST& a, const T& b, octave_idx_type& info); + +#endif