1/* $Id$ $Revision$ */
2/* vim:set shiftwidth=4 ts=8: */
3
4/*************************************************************************
5 * Copyright (c) 2011 AT&T Intellectual Property
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: See CVS logs. Details at http://www.graphviz.org/
12 *************************************************************************/
13
14
15#ifndef SPARSE_SOLVER_H
16#define SPARSE_SOLVER_H
17
18#include "SparseMatrix.h"
19
20enum {SOLVE_METHOD_CG, SOLVE_METHOD_JACOBI};
21
22typedef struct Operator_struct *Operator;
23
24struct Operator_struct {
25 void *data;
26 real* (*Operator_apply)(Operator o, real *in, real *out);
27};
28
29real cg(Operator Ax, Operator precond, int n, int dim, real *x0, real *rhs, real tol, int maxit, int *flag);
30
31real SparseMatrix_solve(SparseMatrix A, int dim, real *x0, real *rhs, real tol, int maxit, int method, int *flag);
32
33Operator Operator_uniform_stress_matmul(SparseMatrix A, real alpha);
34
35Operator Operator_uniform_stress_diag_precon_new(SparseMatrix A, real alpha);
36
37#endif
38
39