Mercurial > fem-fenics-eugenio
comparison inst/linear_algebra_backend.m @ 250:8f309b85bb7e
Add function to set linear algebra back-end
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Sun, 13 Jul 2014 19:25:03 +0200 |
parents | |
children | b1dc98050634 |
comparison
equal
deleted
inserted
replaced
249:f56525533e54 | 250:8f309b85bb7e |
---|---|
1 ## Copyright (C) 2014 Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> | |
2 ## | |
3 ## This program is free software; you can redistribute it and/or modify it under | |
4 ## the terms of the GNU General Public License as published by the Free Software | |
5 ## Foundation; either version 3 of the License, or (at your option) any later | |
6 ## version. | |
7 ## | |
8 ## This program is distributed in the hope that it will be useful, but WITHOUT | |
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
11 ## details. | |
12 ## | |
13 ## You should have received a copy of the GNU General Public License along with | |
14 ## this program; if not, see <http://www.gnu.org/licenses/>. | |
15 | |
16 ## -*- texinfo -*- | |
17 ## @deftypefn {Function File} @var{val} = linear_algebra_backend () | |
18 ## @deftypefnx {Function File} @var{old_val} = linear_algebra_backend (@var{new_val}) | |
19 ## | |
20 ## Query or set the internal variable that specifies the linear algebra back-end | |
21 ## to use when assembling systems, matrices or vectors. It defaults to "uBLAS". | |
22 ## | |
23 ## @end deftypefn | |
24 | |
25 function output = linear_algebra_backend (varargin) | |
26 persistent backend = "uBLAS"; | |
27 persistent opts = {"uBLAS"}; | |
28 | |
29 if (nargin > 1) | |
30 print_usage (); | |
31 else | |
32 output = backend; | |
33 if (nargin == 1) | |
34 input = validatestring (varargin{1}, opts, "linear_algebra_backend", | |
35 "new_val"); | |
36 backend = input; | |
37 endif | |
38 endif | |
39 | |
40 endfunction |