~ubuntu-branches/debian/squeeze/gmsh/squeeze

« back to all changes in this revision

Viewing changes to contrib/Chaco/eigen/checkeig.c

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2009-01-07 16:02:08 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090107160208-vklhtj69br5yw5bh
Tags: 2.2.6.dfsg-2
* debian/control: fixed lintian warning "debhelper-but-no-misc-depends"
* debian/watch: fixed lintian warning
  "debian-watch-file-should-mangle-version"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This software was developed by Bruce Hendrickson and Robert Leland   *
 
2
 * at Sandia National Laboratories under US Department of Energy        *
 
3
 * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
 
4
 
 
5
#include <stdio.h>
 
6
#include "defs.h"
 
7
#include "structs.h"
 
8
 
 
9
/* Check an eigenpair of A by direct multiplication.  */
 
10
double    checkeig(err, A, y, n, lambda, vwsqrt, work)
 
11
double   *err;
 
12
struct vtx_data **A;
 
13
double   *y;
 
14
int       n;
 
15
double    lambda;
 
16
double   *vwsqrt;
 
17
double   *work;
 
18
{
 
19
    double    resid;
 
20
    double    normy;
 
21
    double    norm();
 
22
    void      splarax(), scadd();
 
23
 
 
24
    splarax(err, A, n, y, vwsqrt, work);
 
25
    scadd(err, 1, n, -lambda, y);
 
26
    normy = norm(y, 1, n);
 
27
    resid = norm(err, 1, n) / normy;
 
28
    return (resid);
 
29
}