MyraMath
laplacian1.h
Go to the documentation of this file.
1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
6 #ifndef MYRAMATH_SPARSE_LAPLACIAN1_H
7 #define MYRAMATH_SPARSE_LAPLACIAN1_H
8 
20 #include <myramath/MYRAMATH_EXPORT.h>
22 
23 #include <utility>
24 #include <vector>
25 
26 namespace myra {
27 
28 // Forward declarations.
29 class Pattern;
30 class Permutation;
31 template<class Number> class SparseMatrix;
32 
34 class MYRAMATH_EXPORT Natural1D
35  {
36 
37  public:
38 
40  Natural1D(int in_I);
41 
43  std::vector<int> size() const;
44 
46  int operator () (int i) const;
47 
49  std::pair<Natural1D, Natural1D> i_split() const;
50 
51  private:
52 
53  // Full constructor used by splitting methods.
54  Natural1D(int in_I, int in_i_begin, int in_i_end);
55 
56  // Private data - total size (I) and begin/end specification of subwindow.
57  int I, i_begin, i_end;
58  };
59 
61 MYRAMATH_EXPORT Pattern stencil1(int I);
62 
64 template<class Number> SparseMatrix<Number> laplacian1(int I);
65 template<> MYRAMATH_EXPORT SparseMatrix<NumberS> laplacian1<NumberS>(int I);
66 template<> MYRAMATH_EXPORT SparseMatrix<NumberD> laplacian1<NumberD>(int I);
67 template<> MYRAMATH_EXPORT SparseMatrix<NumberC> laplacian1<NumberC>(int I);
68 template<> MYRAMATH_EXPORT SparseMatrix<NumberZ> laplacian1<NumberZ>(int I);
69 
71 MYRAMATH_EXPORT Permutation bisect1(int I);
72 
74 MYRAMATH_EXPORT Pattern stencil1_unsymmetric(int I, double density = 0.5);
75 
76 } // namespace
77 
78 #endif
Represents a Permutation matrix, used to reorder rows/columns/etc of various numeric containers...
Definition: Permutation.h:34
A helper class that generates a natural ordering on a 1D structured grid of size I.
Definition: laplacian1.h:34
Definition: syntax.dox:1
Various utility functions/classes related to scalar Number types.
Holds the nonzero pattern of a sparse matrix.
Definition: Pattern.h:55
Stores an IxJ matrix A in compressed sparse column format.
Definition: bothcat.h:23