File: matprod.h

package info (click to toggle)
arpack%2B%2B 2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,180 kB
  • sloc: cpp: 16,612; sh: 8,635; ansic: 2,312; makefile: 284
file content (49 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
   ARPACK++ v1.2 2/20/2000
   c++ interface to ARPACK code.

   MODULE MatProd.h
   Matrix template that exemplify the data structure that
   can be used with ARPACK++. MatrixWithProduct is a base
   class for all classes in the complex, nonsym and sym
   subdirectories. 

   ARPACK Authors
      Richard Lehoucq
      Danny Sorensen
      Chao Yang
      Dept. of Computational & Applied Mathematics
      Rice University
      Houston, Texas
*/

#ifndef MATPROD_H
#define MATPROD_H

template<class ART>
class MatrixWithProduct {

 private:

  int m, n; // Number of rows and columns.

 public:

  int nrows() { return m; }

  int ncols() { return n; }

  virtual void MultMv(ART* v, ART* w) = 0;
  // Matrix-vector product: w = M*v.

  MatrixWithProduct(int nrows, int ncols = 0)
  // Constructor.
  {
    m = nrows;
    n = (ncols?ncols:nrows);
  } // Constructor.

}; // MatrixWithProduct

#endif // MATPROD_H